Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d02b08f6 authored by Stuart Menefy's avatar Stuart Menefy Committed by Paul Mundt
Browse files

sh: Clean up places that make 29-bit physical assumptions.

parent cbaa118e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -230,7 +230,10 @@ long* stack_start = &user_stack[STACK_SIZE];
void decompress_kernel(void)
{
	output_data = 0;
	output_ptr = P2SEGADDR((unsigned long)&_text+PAGE_SIZE);
	output_ptr = PHYSADDR((unsigned long)&_text+PAGE_SIZE);
#ifdef CONFIG_29BIT
	output_ptr |= P2SEG;
#endif
	free_mem_ptr = (unsigned long)&_end;
	free_mem_end_ptr = free_mem_ptr + HEAP_SIZE;

+2 −2
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ static int __init early_parse_mem(char *p)
{
	unsigned long size;

	memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;
	memory_start = (unsigned long)__va(__MEMORY_START);
	size = memparse(p, &p);

	if (size > __MEMORY_SIZE) {
@@ -254,7 +254,7 @@ void __init setup_arch(char **cmdline_p)
	data_resource.start = virt_to_phys(_etext);
	data_resource.end = virt_to_phys(_edata)-1;

	memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;
	memory_start = (unsigned long)__va(__MEMORY_START);
	if (!memory_end)
		memory_end = memory_start + __MEMORY_SIZE;

+5 −0
Original line number Diff line number Diff line
@@ -15,7 +15,12 @@ OUTPUT_ARCH(sh)
ENTRY(_start)
SECTIONS
{
#ifdef CONFIG_32BIT
	. = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
#else
	. = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
#endif

	_text = .;			/* Text and read-only data */

	.empty_zero_page : {
+5 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
/* Returns the physical address of a PnSEG (n=1,2) address   */
#define PHYSADDR(a)	(((unsigned long)(a)) & 0x1fffffff)

#ifdef CONFIG_29BIT
/*
 * Map an address to a certain privileged segment
 */
@@ -42,8 +43,11 @@
	((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P3SEG))
#define P4SEGADDR(a)	\
	((__typeof__(a))(((unsigned long)(a) & 0x1fffffff) | P4SEG))

#endif /* 29BIT */
#endif /* P1SEG */

/* Check if an address can be reached in 29 bits */
#define IS_29BIT(a)	(((unsigned long)(a)) < 0x20000000)

#endif /* __KERNEL__ */
#endif /* __ASM_SH_ADDRSPACE_H */
+7 −1
Original line number Diff line number Diff line
@@ -30,6 +30,12 @@
#define MMUCR_ME		(0)
#endif

#if defined(CONFIG_32BIT) && defined(CONFIG_CPU_SUBTYPE_ST40)
#define MMUCR_SE		(1 << 4)
#else
#define MMUCR_SE		(0)
#endif

#ifdef CONFIG_SH_STORE_QUEUES
#define MMUCR_SQMD		(1 << 9)
#else
@@ -37,7 +43,7 @@
#endif

#define MMU_NTLB_ENTRIES	64
#define MMU_CONTROL_INIT	(0x05|MMUCR_SQMD|MMUCR_ME)
#define MMU_CONTROL_INIT	(0x05|MMUCR_SQMD|MMUCR_ME|MMUCR_SE)

#define MMU_ITLB_DATA_ARRAY	0xF3000000
#define MMU_UTLB_DATA_ARRAY	0xF7000000
Loading