linux kernel修改:

Index: linux-2.6.21.x/.config
===================================================================
--- linux-2.6.21.x/.config (revision 1713)
+++ linux-2.6.21.x/.config (revision 1714)
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.21
-# Thu Nov  3 22:02:30 2011
+# Mon May 20 15:09:34 2013
 #
 CONFIG_MIPS=y
 
@@ -17,8 +17,8 @@
 # CONFIG_RALINK_RT3883 is not set
 CONFIG_RT5350_ASIC=y
 # CONFIG_RT2880_DRAM_8M is not set
-# CONFIG_RT2880_DRAM_16M is not set
-CONFIG_RT2880_DRAM_32M=y
+CONFIG_RT2880_DRAM_16M=y
+# CONFIG_RT2880_DRAM_32M is not set
 # CONFIG_RT2880_DRAM_64M is not set
 # CONFIG_RT2880_DRAM_128M is not set
 # CONFIG_MTD_NOR_RALINK is not set
@@ -26,7 +26,7 @@
 # CONFIG_MTD_NAND_RALINK is not set
 # CONFIG_MTD_ANY_RALINK is not set
 # CONFIG_DUAL_IMAGE is not set
-CONFIG_RALINK_RAM_SIZE=32
+CONFIG_RALINK_RAM_SIZE=16
 CONFIG_MTD_PHYSMAP_START=0x1C000000
 CONFIG_MTD_PHYSMAP_LEN=0x1000000
 CONFIG_MTD_PHYSMAP_BUSWIDTH=2
@@ -1334,7 +1334,7 @@
 # CONFIG_DEBUG_KERNEL is not set
 CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CROSSCOMPILE is not set
-CONFIG_CMDLINE="console=ttyS1,57600n8 root=/dev/ram0"
+CONFIG_CMDLINE="console=ttyS1,57600n8 root=/dev/mtdblock3 imageA"
 CONFIG_UBOOT_CMDLINE=y
 
 #
Index: linux-2.6.21.x/drivers/mtd/ralink/ralink_spi.c
===================================================================
--- linux-2.6.21.x/drivers/mtd/ralink/ralink_spi.c (revision 1713)
+++ linux-2.6.21.x/drivers/mtd/ralink/ralink_spi.c (revision 1714)
@@ -96,12 +96,12 @@
         {
                 name:           "ImageA",
                 size:            MTD_IMAGE_PART_SIZE,
-                offset:         MTDPART_OFS_APPEND,
+                offset:         0x50000,
         }, 
         {
                 name:           "ImageB",
                 size:            MTD_IMAGE_PART_SIZE,
-                offset:         MTDPART_OFS_APPEND,
+                offset:         0x50000,
         }, 
         {
  name:           "RootFS",
@@ -121,7 +121,7 @@
         {
  name:           "syslog",
  size:            MTD_SYSLOG_PART_SIZE,
- offset:         MTDPART_OFS_APPEND,
+ offset:         MTD_SYSLOG_PART_OFFSET,
  }
 };
 
@@ -905,15 +905,15 @@
  #endif
  if (NULL != strstr(boot_command_line, "imageA"))
  {
- offs = MTD_BOOT_PART_SIZE;
+ offs = MTD_BOOT_PART_SIZE + MTD_CONFIG_PART_SIZE + MTD_FACTORY_PART_SIZE;
  ramtd_read(NULL, offs, sizeof(hdr), (size_t *)&i, (u_char *)(&hdr));
- rt2880_partitions[3].offset = MTD_BOOT_PART_SIZE + ntohl(hdr.ih_ksz);
+ rt2880_partitions[3].offset = MTD_BOOT_PART_SIZE + ntohl(hdr.ih_ksz) + MTD_CONFIG_PART_SIZE + MTD_FACTORY_PART_SIZE;
  }
  else if (NULL != strstr(boot_command_line, "imageB"))
  {
- offs = MTD_BOOT_PART_SIZE + MTD_IMAGE_PART_SIZE;
+ offs = MTD_BOOT_PART_SIZE + MTD_CONFIG_PART_SIZE + MTD_FACTORY_PART_SIZE;
  ramtd_read(NULL, offs, sizeof(hdr), (size_t *)&i, (u_char *)(&hdr));
- rt2880_partitions[3].offset = MTD_BOOT_PART_SIZE + MTD_IMAGE_PART_SIZE + ntohl(hdr.ih_ksz);
+ rt2880_partitions[3].offset = MTD_BOOT_PART_SIZE + ntohl(hdr.ih_ksz) + MTD_CONFIG_PART_SIZE + MTD_FACTORY_PART_SIZE;
  }
 
  rt2880_partitions[3].size =  MTD_IMAGE_PART_SIZE  - ntohl(hdr.ih_ksz);
Index: linux-2.6.21.x/drivers/mtd/maps/ralink-flash.h
===================================================================
--- linux-2.6.21.x/drivers/mtd/maps/ralink-flash.h (revision 1713)
+++ linux-2.6.21.x/drivers/mtd/maps/ralink-flash.h (revision 1714)
@@ -13,16 +13,16 @@
 #endif
 
 /*added by he 2011.7.20*/
-#define   MTD_FLASH_PART_SIZE          0x1000000
+#define   MTD_FLASH_PART_SIZE        0x400000
 #define   MTD_BOOT_PART_SIZE     0x30000
-#define MTD_CONFIG_PART_SIZE     0x40000
-#define MTD_FACTORY_PART_SIZE        0x40000
-#define MTD_IMAGE_PART_SIZE      0x700000
-#define   MTD_SYSLOG_PART_SIZE      MTD_FLASH_PART_SIZE - (MTD_BOOT_PART_SIZE + MTD_CONFIG_PART_SIZE + MTD_IMAGE_PART_SIZE \
-                                                        + MTD_IMAGE_PART_SIZE + MTD_FACTORY_PART_SIZE)
+#define  MTD_CONFIG_PART_SIZE     0x10000
+#define  MTD_FACTORY_PART_SIZE      0x10000
+#define  MTD_IMAGE_PART_SIZE        0x360000
+#define   MTD_SYSLOG_PART_SIZE      MTD_FLASH_PART_SIZE - (MTD_BOOT_PART_SIZE + MTD_CONFIG_PART_SIZE + MTD_IMAGE_PART_SIZE + MTD_FACTORY_PART_SIZE)                      
+#define   MTD_CONFIG_PART_OFFSET    MTD_BOOT_PART_SIZE
+#define   MTD_SYSLOG_PART_OFFSET    MTD_BOOT_PART_SIZE + MTD_CONFIG_PART_SIZE + MTD_IMAGE_PART_SIZE + MTD_FACTORY_PART_SIZE
 
-#define MTD_CONFIG_PART_OFFSET  MTD_BOOT_PART_SIZE + MTD_IMAGE_PART_SIZE + MTD_IMAGE_PART_SIZE  
-/*end added*/
+/*end added*/ 
 #endif
 
 
@@ -31,7 +31,7 @@
 #define CONFIG_MTD_KERNEL_PART_SIZ 0
 #endif
 
-#define MTD_ROOTFS_PART_SIZE IMAGE1_SIZE - (MTD_BOOT_PART_SIZE + MTD_CONFIG_PART_SIZE \
+#define MTD_ROOTFS_PART_SIZE MTD_FLASH_PART_SIZE - (MTD_BOOT_PART_SIZE + MTD_CONFIG_PART_SIZE \
  + MTD_FACTORY_PART_SIZE + CONFIG_MTD_KERNEL_PART_SIZ)
               
 


uboot修改:

Index: uboot_version.h
===================================================================
--- uboot_version.h (revision 1715)
+++ uboot_version.h (working copy)
@@ -6,4 +6,4 @@
  * y = minor change (bug fix release)
  * z = internal change (internal debuging)
  */
-#define RALINK_LOCAL_VERSION    "3.5.2.0"
+#define RALINK_LOCAL_VERSION    "3.5.2.1"
Index: config.in
===================================================================
--- config.in (revision 1715)
+++ config.in (working copy)
@@ -180,14 +180,26 @@
     " 
 fi
 
-if [ "$RT2880_FPGA_BOARD" = "y" -o \
-     "$RT2880_ASIC_BOARD" = "y" -o "$DUAL_IMAGE_SUPPORT" = "y" ]; then
+if [ "$RT2880_FPGA_BOARD" = "y" -o "$RT2880_ASIC_BOARD" = "y" -o "$DUAL_IMAGE_SUPPORT" = "y" ]; then
 choice 'Flash Size' "4M ON_BOARD_4M_FLASH_COMPONENT \
                      8M ON_BOARD_8M_FLASH_COMPONENT \
                      16M ON_BOARD_16M_FLASH_COMPONENT 
     " 
 fi
 
+if [ "$RT3052_FPGA_BOARD" = "y" -o "$RT3052_ASIC_BOARD" = "y" -o "$DUAL_IMAGE_SUPPORT" = "y" ]; then
+choice 'Flash Size' "4M ON_BOARD_4M_NOR_FLASH_COMPONENT \
+                     8M ON_BOARD_8M_NOR_FLASH_COMPONENT \
+                     16M ON_BOARD_16M_NOR_FLASH_COMPONENT 
+    " 
+fi
+
+if [ "$RT5350_ASIC_BOARD" = "y" ]; then
+choice 'SPI Flash Size' "4M ON_BOARD_4M_SPI_FLASH_COMPONENT \
+                     16M ON_BOARD_16M_SPI_FLASH_COMPONENT 
+    " 
+fi
+
 #########
 # DRAM
 #########
Index: include/configs/rt2880.h
===================================================================
--- include/configs/rt2880.h (revision 13)
+++ include/configs/rt2880.h (working copy)
@@ -340,7 +340,7 @@
 #if defined (ON_BOARD_16M_SPI_FLASH_COMPONENT)
 #define CFG_SPI_FLASH_SIZE            0x1000000
 #define CFG_BOOTLOADER_SIZE         0x30000
-#define CFG_CONFIG_SIZE       0x40000
+#define CFG_CONFIG_SIZE           0x40000
 #define CFG_FACTORY_SIZE              0x40000
 #define CFG_IMAGE_SIZE                    0x700000
 #define CFG_SYSLOG_SIZE                 (CFG_SPI_FLASH_SIZE - (CFG_BOOTLOADER_SIZE + \
@@ -350,22 +350,25 @@
 #define CFG_FACTORY_ADDR       (CFG_FLASH_BASE + CFG_BOOTLOADER_SIZE + CFG_CONFIG_SIZE + CFG_IMAGE_SIZE * 2 )
 #define CFG_KERN_ADDR       (CFG_FLASH_BASE + CFG_BOOTLOADER_SIZE )
 #define CFG_KERN2_ADDR       (CFG_FLASH_BASE + CFG_BOOTLOADER_SIZE + CFG_IMAGE_SIZE)
-#define CFG_SYSLOG_ADDR               (CFG_FLASH_BASE + CFG_BOOTLOADER_SIZE + CFG_CONFIG_SIZE + \
+#define CFG_SYSLOG_ADDR            (CFG_FLASH_BASE + CFG_BOOTLOADER_SIZE + CFG_CONFIG_SIZE + \
                                                          CFG_FACTORY_SIZE + CFG_IMAGE_SIZE * 2) 
 
 #endif 
 
 #if defined (ON_BOARD_4M_SPI_FLASH_COMPONENT)
-#define CFG_SPI_FLASH_SIZE           0x400000
-#define CFG_BOOTLOADER_SIZE      0x30000
+#define CFG_SPI_FLASH_SIZE        0x400000
+#define CFG_BOOTLOADER_SIZE       0x30000
 #define CFG_CONFIG_SIZE      0x10000
-#define CFG_FACTORY_SIZE             0x10000
-#define CFG_IMAGE_SIZE                   (CFG_SPI_FLASH_SIZE - (CFG_BOOTLOADER_SIZE + CFG_CONFIG_SIZE + CFG_FACTORY_SIZE))
+#define CFG_FACTORY_SIZE      0x10000
+#define CFG_IMAGE_SIZE            0x360000
+#define CFG_SYSLOG_SIZE           (CFG_SPI_FLASH_SIZE - (CFG_BOOTLOADER_SIZE + CFG_CONFIG_SIZE + CFG_FACTORY_SIZE + CFG_IMAGE_SIZE))
 
-#define CFG_ENV_ADDR             (CFG_FLASH_BASE + CFG_BOOTLOADER_SIZE)
+#define CFG_ENV_ADDR      (CFG_FLASH_BASE + CFG_BOOTLOADER_SIZE)
 #define CFG_FACTORY_ADDR      (CFG_FLASH_BASE + CFG_BOOTLOADER_SIZE + CFG_CONFIG_SIZE)
 #define CFG_KERN_ADDR      (CFG_FLASH_BASE + (CFG_BOOTLOADER_SIZE + CFG_CONFIG_SIZE + CFG_FACTORY_SIZE))
-#define CFG_KERN2_ADDR                 CFG_KERN_ADDR
+#define CFG_KERN2_ADDR             CFG_KERN_ADDR
+#define CFG_SYSLOG_ADDR           (CFG_FLASH_BASE + CFG_BOOTLOADER_SIZE + CFG_CONFIG_SIZE + \
+                                                         CFG_FACTORY_SIZE + CFG_IMAGE_SIZE) 
 
 #endif


将原项目的16Mflash映像裁剪成4M,可以对照看出所修改的地方(602项目)

主要是调整flash分区大小


 

Logo

更多推荐