From: David W. <dw...@in...> - 2001-08-23 12:51:14
|
This patch adds a new config variable CONFIG_MEMORY_SIZE, and uses that in the initial memory setup instead of a hardcoded 4MiB. It also cleans up the nested if statements in the platform-specific definitions of CONFIG_MEMORY_START and CONFIG_MEMORY_SIZE. I'll commit it soon unless someone complains. I haven't yet had any feedback on the PCI patch I posted yesterday. Does that mean that nobody objects? Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxsh/kernel/ChangeLog,v retrieving revision 1.332 diff -u -r1.332 ChangeLog --- ChangeLog 2001/08/22 21:09:35 1.332 +++ ChangeLog 2001/08/23 12:44:07 @@ -1,3 +1,10 @@ +2001-08-23 David Woodhouse <dw...@in...> + + * arch/sh/config.in: Add CONFIG_MEMORY_SIZE, clean up + platform-specific memory start/size definitions. + * include/asm-sh/page.h: Define __MEMORY_SIZE. + * arch/sh/kernel/setup.c: Use __MEMORY_SIZE instead of hardcoded 4MiB. + 2001-08-22 David Woodhouse <dw...@in...> * drivers/net/via-rhine.c: Update to version LK1.1.11 from Index: arch/sh/config.in =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/config.in,v retrieving revision 1.56 diff -u -r1.56 config.in --- arch/sh/config.in 2001/08/11 10:18:29 1.56 +++ arch/sh/config.in 2001/08/23 12:44:07 @@ -89,25 +89,31 @@ define_bool CONFIG_CPU_SH4 y fi bool 'Little Endian' CONFIG_CPU_LITTLE_ENDIAN +# Platform-specific memory start and size definitions if [ "$CONFIG_SH_SOLUTION_ENGINE" = "y" -o "$CONFIG_SH_HP600" = "y" -o \ "$CONFIG_SH_BIGSUR" = "y" -o "$CONFIG_SH_7751_SOLUTION_ENGINE" = "y" -o \ "$CONFIG_SH_DREAMCAST" = "y" -o "$CONFIG_SH_SH2000" = "y" ]; then define_hex CONFIG_MEMORY_START 0c000000 -else - if [ "$CONFIG_CPU_SUBTYPE_ST40STB1" = "y" ]; then - bool 'Memory on LMI' CONFIG_ST40_LMI_MEMORY - if [ "$CONFIG_ST40_LMI_MEMORY" = "y" ] ; then - define_hex CONFIG_MEMORY_START 08000000 - else - hex 'EMI physical memory start address' CONFIG_MEMORY_START 08000000 - fi - else - if [ "$CONFIG_SH_ADX" = "y" ]; then - define_hex CONFIG_MEMORY_START 08000000 - else - hex 'Physical memory start address' CONFIG_MEMORY_START 08000000 - fi + define_hex CONFIG_MEMORY_SIZE 00400000 + define_bool CONFIG_MEMORY_SET y +fi +if [ "$CONFIG_CPU_SUBTYPE_ST40STB1" = "y" ]; then + bool 'Memory on LMI' CONFIG_ST40_LMI_MEMORY + if [ "$CONFIG_ST40_LMI_MEMORY" = "y" ] ; then + define_hex CONFIG_MEMORY_START 08000000 + define_hex CONFIG_MEMORY_SIZE 00400000 + define_bool CONFIG_MEMORY_SET y fi +fi +if [ "$CONFIG_SH_ADX" = "y" ]; then + define_hex CONFIG_MEMORY_START 08000000 + define_hex CONFIG_MEMORY_SIZE 00400000 + define_bool CONFIG_MEMORY_SET y +fi +# If none of the above have set memory start/size, ask the user. +if [ "$CONFIG_MEMORY_SET" != "y" ]; then + hex 'Physical memory start address' CONFIG_MEMORY_START 08000000 + hex 'Physical memory size' CONFIG_MEMORY_SIZE 00400000 fi endmenu Index: include/asm-sh/page.h =================================================================== RCS file: /cvsroot/linuxsh/kernel/include/asm-sh/page.h,v retrieving revision 1.13 diff -u -r1.13 page.h --- include/asm-sh/page.h 2001/08/18 06:10:41 1.13 +++ include/asm-sh/page.h 2001/08/23 12:44:07 @@ -69,6 +69,7 @@ */ #define __MEMORY_START CONFIG_MEMORY_START +#define __MEMORY_SIZE CONFIG_MEMORY_SIZE #ifdef CONFIG_DISCONTIGMEM /* Just for HP690, for now.. */ #define __MEMORY_START_2ND (__MEMORY_START+0x02000000) Index: arch/sh/kernel/setup.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/arch/sh/kernel/setup.c,v retrieving revision 1.30 diff -u -r1.30 setup.c --- arch/sh/kernel/setup.c 2001/08/07 03:43:15 1.30 +++ arch/sh/kernel/setup.c 2001/08/23 12:44:07 @@ -213,8 +213,7 @@ saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START; - /* Default is 4Mbyte. */ - memory_end = (unsigned long)PAGE_OFFSET+0x00400000+__MEMORY_START; + memory_end = (unsigned long)PAGE_OFFSET+__MEMORY_SIZE+__MEMORY_START; for (;;) { /* -- dwmw2 |