--- uClinux-dist/linux-2.4.x/arch/armnommu/Makefile Wed Oct 16 14:05:05 2002 +++ uClinux-dist-patch/linux-2.4.x/arch/armnommu/Makefile Wed Oct 16 14:02:00 2002 @@ -149,6 +149,10 @@ ifeq ($(CONFIG_ARCH_ATMEL),y) TEXTADDR = 0x1000000 MACHINE = atmel + ifeq ($(CONFIG_EB40LS),y) + TEXTADDR = 0x02010000 + BOARD = -eb40ls + endif endif ifeq ($(CONFIG_ARCH_NETARM),y) @@ -232,7 +236,7 @@ $(LINUX): arch/armnommu/vmlinux.lds -arch/armnommu/vmlinux.lds: arch/armnommu/vmlinux-$(PROCESSOR).lds.in dummy +arch/armnommu/vmlinux.lds: arch/armnommu/vmlinux-$(PROCESSOR)$(BOARD).lds.in dummy ifeq ($(CONFIG_ARCH_DSC21),y) @sed 's/TEXTADDR/$(TEXTADDR)/' <$< >tmp.ld @sed 's/DATAADDR/$(DATAADDR)/' $@ --- /uClinux-dist/linux-2.4.x/drivers/block/blkmem.c Wed Oct 16 14:06:13 2002 +++ /uClinux-dist-patch/linux-2.4.x/drivers/block/blkmem.c Wed Oct 16 14:01:50 2002 @@ -167,6 +167,11 @@ #define FIXED_ROMARRAY (char *)(FLASH_MEM_BASE) #endif +#if defined(CONFIG_EB40LS) +#undef FIXED_ROMARRAY +#define CAT_ROMARRAY +#endif + #if defined( CONFIG_M68360 ) #define CAT_ROMARRAY #endif @@ -196,8 +201,13 @@ extern char _edata[]; extern char __data_start[]; #ifndef FIXUP_ARENAS +#ifdef CONFIG_EB40LS #define FIXUP_ARENAS \ - arena[0].address = (unsigned long)__data_rom_start + (unsigned long)_edata - (unsigned long)__data_start; + arena[0].address = 0x01000000 + ((unsigned long) _edata - ((unsigned long) __data_start - (unsigned long) __data_rom_start )); +#else +#define FIXUP_ARENAS \ + arena[0].address = (unsigned long)__data_rom_start + (unsigned long)_edata - (unsigned long)__data_start; +#endif #endif #endif --- /uClinux-dist/linux-2.4.x/arch/armnommu/config.in Wed Oct 16 14:05:20 2002 +++ /uClinux-dist-patch/linux-2.4.x/arch/armnommu/config.in Wed Oct 16 14:02:12 2002 @@ -136,13 +136,22 @@ define_bool CONFIG_CPU_WITH_CACHE n define_bool CONFIG_CPU_WITH_MCR_INSTRUCTION n define_bool CONFIG_SERIAL_ATMEL y +bool 'EB40LS' CONFIG_EB40LS n if [ "$CONFIG_SET_MEM_PARAM" = "n" ]; then + if [ "$CONFIG_EB40LS" = "y" ]; then + define_hex DRAM_BASE 0x02000000 + define_hex DRAM_SIZE 0x00200000 + define_hex FLASH_MEM_BASE 0x03010000 + define_hex FLASH_SIZE 0x00200000 + fi + if [ "$CONFIG_EB40LS" = "n" ]; then define_hex DRAM_BASE 0x01000000 define_hex DRAM_SIZE 0x00600000 define_hex FLASH_MEM_BASE 0x01600000 define_hex FLASH_SIZE 0x00200000 fi + fi hex 'Memory mapped 16-bit io base' CONFIG_MEM16_BASE 0x03000000 hex 'Memory mapped 8-bit io base' CONFIG_MEM8_BASE 0x03000000 --- /uClinux-dist/linux-2.4.x/arch/armnommu/kernel/head-armv.S Wed Oct 16 14:03:46 2002 +++ /uClinux-dist-patch/linux-2.4.x/arch/armnommu/kernel/head-armv.S Wed Oct 16 14:02:46 2002 @@ -20,6 +20,10 @@ #include #include +#ifdef CONFIG_EB40LS +#include +#endif + #define K(a,b,c) ((a) << 24 | (b) << 12 | (c)) /* @@ -144,6 +148,9 @@ mov r1, #MACH_TYPE_SNDS100 #endif +#ifdef CONFIG_EB40LS + bl config_aic +#endif mov r0, #F_BIT | I_BIT | MODE_SVC @ make sure svc mode msr cpsr_c, r0 @ and all irqs disabled @@ -153,7 +160,9 @@ ldmia r5, {r5, r6, r8, r9, sp} @ Setup stack /* Copy data sections to their new home. */ - +#ifdef CONFIG_EB40LS + bl copy_data_section_to_ram +#endif /* Clear BSS */ mov r4, #0 @@ -517,6 +526,41 @@ .align #endif +#if defined CONFIG_EB40LS + AIC_IDCR_LOCAL: .long AIC_IDCR + AIC_IDCR_LOCAL_NEXT: .long 0xFFFFFFFF + DRS_LOCAL: .long __data_rom_start+0x01000000 /* End of ROM code (=start of ROM data) */ + RDS_LOCAL: .long __ram_data_start /* Base of RAM to initialise */ + BS_LOCAL: .long __bss_start /* Base and limit of area */ + +/*configure AIC. Disable all interrupt sources to test flash data */ +config_aic: + ldr r1,AIC_IDCR_LOCAL /* AIC_IDCR */ + ldr r2,AIC_IDCR_LOCAL_NEXT /* AIC_IDCR */ + str r2, [r1] + mov pc, lr + +/*Copy .data section from ROM into RAM so that we can + actually use it. The linker has set everything + up already so that anyone wanting stuff from .data + will read it from RAM. But there is nothing there + yet, so we need to copy it into place now...*/ + +copy_data_section_to_ram: + /* Get pointer to ROM data */ + ldr r0,DRS_LOCAL /* __data_rom_start+0x01000000*/ + ldr r1,RDS_LOCAL /*__ram_data_start and RAM copy */ + ldr r3,BS_LOCAL /*__bss_start Zero init base => top of initialised data */ + cmp r0, r1 /* Check that they are different */ + beq NoData +LoopCopyData: cmp r1, r3 /* Copy init data */ + ldrcc r2, [r0], #4 + strcc r2, [r1], #4 + bcc LoopCopyData +NoData: mov pc, lr + +#endif /* CONFIG_EB40LS */ + /* * Read processor ID register (CP#15, CR0), and look up in the linker-built * supported processor list. Note that we can't use the absolute addresses --- /uClinux-dist/linux-2.4.x/arch/armnommu/vmlinux-armv.lds.in Wed Oct 16 14:29:58 2002 +++ /uClinux-dist-patch/linux-2.4.x/arch/armnommu/vmlinux-armv-eb40ls.lds.in Wed Oct 16 14:02:27 2002 @@ -61,6 +61,7 @@ *(.got) /* Global offset table */ _etext = .; /* End of text section */ + __data_rom_start = .; /* to aid CAT_ROMARRAY */ } . = ALIGN(8192); @@ -70,6 +71,8 @@ * first, the init task union, aligned * to an 8192 byte boundary. */ + __data_start = . ; /* aid to CAT_ROMARRAY */ + __ram_data_start = . ; /* aid to CAT_ROMARRAY */ *(.init.task) /* @@ -83,6 +86,7 @@ */ *(.data) CONSTRUCTORS + . = ALIGN(16); /* aid to alignment of edata */ _edata = .; }