From: Christopher H. <ch...@us...> - 2003-01-24 09:27:59
|
Update of /cvsroot/blob/blob/src/blob In directory sc8-pr-cvs1:/tmp/cvs-serv15756/src/blob Modified Files: badge4.c Log Message: use cfi query for flash descriptors; adjust default part table to reflect actual flash size Index: badge4.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/badge4.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- badge4.c 9 Jan 2003 01:47:50 -0000 1.12 +++ badge4.c 24 Jan 2003 09:27:56 -0000 1.13 @@ -55,37 +55,22 @@ private: &badge4_i2c_bus_gpio_private }; -/* flash descriptor for BadgePAD 4 flash */ -/* 1 x Intel 28F320C3BA100 Advanced+ Boot Block Flash (32 Mbit) */ -/* http://developer.intel.com/design/flcomp/datashts/29064512.pdf */ +/* flash descriptors for BadgePAD 4 flash */ static const flash_descriptor_t badge4_flash_descriptors[] = -{ - { - /* Eight 4 KW Parameter Bottom Blocks (64K bytes) */ - size: 2 * 4 * 1024, /* 8 KiB */ - num: 8, - lockable: 1 - }, - { - /* Sixty three 32 KW Main Blocks (4032K bytes) */ - size: 2 * 32 * 1024, /* 64 KiB */ - num: 63, - lockable: 1 - }, - { - /* NULL block */ - }, -}; + QUERY_FLASH_FOR_DESCRIPTORS(0); + /* default partition table for BadgePAD 4 */ -static const blob_partition_t badge4_default_partition_table[] = { +static blob_partition_t badge4_default_partition_table[] = { +#define PART_START 0 { /* start of table */ - magic: BLOB_DEFAULT_PART_TABLE_MAGIC, - next: sizeof(blob_partition_t), - offset: 0x00000000, /* absolute base address */ - size: 4 * 1024 * 1024 /* total size of the flash */ + magic: BLOB_DEFAULT_PART_TABLE_MAGIC, + next: sizeof(blob_partition_t), + offset: 0x00000000, /* absolute base address */ + size: -1 /* filled in later */ }, +#define PART_BLOB 1 { /* blob itself */ magic: BLOB_PART_VALID_MAGIC, @@ -95,6 +80,7 @@ name: "blob", mem_base: BLOB_RAM_BASE }, +#define PART_PARAM 2 { /* parameter block */ magic: BLOB_PART_VALID_MAGIC, @@ -102,52 +88,46 @@ offset: PARAM_FLASH_BASE, size: PARAM_FLASH_LEN, name: "parameters", - flags: BLOB_PART_FLAG_PTABLE - }, -#if 0 - { - /* kernel */ - magic: BLOB_PART_VALID_MAGIC, - next: sizeof(blob_partition_t), - offset: KERNEL_FLASH_BASE, - size: KERNEL_FLASH_LEN, - name: "kernel", - flags: BLOB_PART_FLAG_LOAD | BLOB_PART_FLAG_EXEC, - mem_base: KERNEL_RAM_BASE, - entry_point: KERNEL_RAM_BASE }, -#endif +#define PART_ROOT 3 { /* root */ magic: BLOB_PART_VALID_MAGIC, next: sizeof(blob_partition_t), offset: RAMDISK_FLASH_BASE, - size: RAMDISK_FLASH_LEN, + size: -1, /* filled in later */ name: "root", flags: BLOB_PART_FLAG_JFFS2 }, +#define PART_LAST 4 { /* last entry */ - magic: BLOB_PART_LAST_MAGIC + magic: BLOB_PART_LAST_MAGIC } }; - - static void badge4_set_partition_table(void) { - /* the default partition table */ + /* set up the default partition table */ + u32 flash_size = flash_get_size(); + printf("FLASH: %d KiB\n", flash_size / 1024); + + badge4_default_partition_table[PART_START].size = flash_size; + badge4_default_partition_table[PART_ROOT].size = + flash_size - badge4_default_partition_table[PART_BLOB].size - + badge4_default_partition_table[PART_PARAM].size; + default_partition_table = badge4_default_partition_table; + /* we don't know where the flash partition table will live, so - * put the pointer at 0x0000000 and let the partition table + * point to the flash and let the partition table * parser figure out. */ flash_partition_table = (blob_partition_t*)0x00000000; } - -__initlist(badge4_set_partition_table, INIT_LEVEL_OTHER_STUFF); +__initlist(badge4_set_partition_table, INIT_LEVEL_OTHER_STUFF + 1); static void badge4_select_drivers(void) @@ -155,8 +135,8 @@ reboot_driver = &sa11x0_reboot_driver; serial_driver = &sa11x0_serial_driver; - flash_descriptors = badge4_flash_descriptors; flash_driver = &intel16_flash_driver; + flash_descriptors = badge4_flash_descriptors; } __initlist(badge4_select_drivers, INIT_LEVEL_DRIVER_SELECTION); @@ -257,7 +237,7 @@ size += (4<<i); size *= module_rows; - printf("SDRAM: %d Mbytes (rows=%d, row bits=%d, col bits=%d)\n", + printf("SDRAM: %d MiB (rows=%d, row bits=%d, col bits=%d)\n", size, module_rows, row_bits, col_bits); /* |