From: Erik M. <er...@us...> - 2002-02-13 00:22:26
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv17309/src/blob Modified Files: lart.c Log Message: - Make flash_descriptors const - Add a default flash partition table - Rename a couple of functions Index: lart.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/lart.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- lart.c 3 Jan 2002 16:07:18 -0000 1.6 +++ lart.c 13 Feb 2002 00:22:24 -0000 1.7 @@ -25,16 +25,17 @@ # include <blob/config.h> #endif +#include <blob/arch.h> #include <blob/flash.h> #include <blob/init.h> +#include <blob/partition.h> #include <blob/serial.h> - /* flash descriptor for LART flash */ /* 2x Intel 28F160F3B fast boot block flash (4MB) */ -static flash_descriptor_t lart_flash_descriptors[] = +static const flash_descriptor_t lart_flash_descriptors[] = { { size: 2 * 8 * 1024, @@ -52,27 +53,94 @@ -static void init_lart_flash_driver(void) +/* default partition table for LART */ +static const blob_partition_t lart_default_partition_table[] = { + { + /* 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 */ + }, + { + /* blob itself */ + magic: BLOB_PART_VALID_MAGIC, + next: sizeof(blob_partition_t), + offset: BLOB_FLASH_BASE, + size: BLOB_FLASH_LEN, + name: "blob", + mem_base: BLOB_RAM_BASE + }, + { + /* parameter block */ + magic: BLOB_PART_VALID_MAGIC, + next: sizeof(blob_partition_t), + offset: PARAM_FLASH_BASE, + size: PARAM_FLASH_LEN, + name: "parameters", + flags: BLOB_PART_FLAG_PTABLE + }, + { + /* 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 + }, + { + /* ramdisk */ + magic: BLOB_PART_VALID_MAGIC, + next: sizeof(blob_partition_t), + offset: RAMDISK_FLASH_BASE, + size: RAMDISK_FLASH_LEN, + name: "ramdisk", + flags: BLOB_PART_FLAG_LOAD, + mem_base: RAMDISK_RAM_BASE + }, + { + /* last entry */ + magic: BLOB_PART_LAST_MAGIC + } +}; + + + + +static void lart_set_partition_table(void) { - /* we could do funky detection over here, because the LART can - * have both internal and external flash with different - * properties. for the time being we just ignore that fact. - * -- Erik + /* the default partition table */ + default_partition_table = lart_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 + * parser figure out. */ - - flash_descriptors = lart_flash_descriptors; - flash_driver = &intel32_flash_driver; + flash_partition_table = (blob_partition_t*)0x00000000; } -__initlist(init_lart_flash_driver, INIT_LEVEL_DRIVER_SELECTION); - +__initlist(lart_set_partition_table, INIT_LEVEL_OTHER_STUFF); +/* FIXME: need to think if this is the correct init level, we might + * want to have this before the param list stuff starts running */ -static void lart_init_hardware(void) +static void lart_select_drivers(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; + + /* we could do funky detection over here, because the LART can + * have both internal and external flash with different + * properties. for the time being we just ignore that fact. + * -- Erik + */ + + flash_descriptors = lart_flash_descriptors; + flash_driver = &intel32_flash_driver; } -__initlist(lart_init_hardware, INIT_LEVEL_DRIVER_SELECTION); +__initlist(lart_select_drivers, INIT_LEVEL_DRIVER_SELECTION); |