From: Stefan E. <se...@us...> - 2002-05-08 16:08:10
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv17541 Modified Files: system3.c Log Message: - added default partition table. Copied from lart.c (thanks erik!) Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- system3.c 8 May 2002 14:05:44 -0000 1.15 +++ system3.c 8 May 2002 16:02:53 -0000 1.16 @@ -43,6 +43,7 @@ #include <blob/uucodec.h> #include <blob/serial.h> #include <blob/time.h> +#include <blob/partition.h> #include <blob/sa1100.h> #include <blob/sa1111.h> @@ -112,6 +113,84 @@ }, }; +/* default partition table for SYSTEM3 + +System3 flash layout +~~~~~~~~~~~~~~~~~~~~ + +16Mb Flash +256k erase size + +0x00000000 BLOB 256k +0x00040000 CONFIG 256k +0x00080000 KERNEL 1024k +0x00180000 INITRD 1536k +0x00300000 CRAMFS 13312k +0x01000000 + + */ +static const blob_partition_t system3_default_partition_table[] = { + { + /* start of table */ + magic: BLOB_DEFAULT_PART_TABLE_MAGIC, + next: sizeof(blob_partition_t), + offset: 0x00000000, /* absolute base address */ + size: 16 * 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 + }, + { + /* system config area */ + magic: BLOB_PART_VALID_MAGIC, + next: sizeof(blob_partition_t), + offset: CONFIG_FLASH_BASE, + size: CONFIG_FLASH_LEN, + name: "config", + flags: 0 + }, + { + /* kernel */ + magic: BLOB_PART_VALID_MAGIC, + next: sizeof(blob_partition_t), + offset: KERNEL_FLASH_BASE, + size: KERNEL_FLASH_LEN, + name: "zImage", + 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: "initrd.gz", + flags: BLOB_PART_FLAG_LOAD, + mem_base: RAMDISK_RAM_BASE + }, + { + /* root (cramfs) */ + magic: BLOB_PART_VALID_MAGIC, + next: sizeof(blob_partition_t), + offset: CRAMFS_FLASH_BASE, + size: CRAMFS_FLASH_LEN, + name: "cramfs.img", + flags: BLOB_PART_FLAG_CRAMFS, + }, + { + /* last entry */ + magic: BLOB_PART_LAST_MAGIC + } +}; + /********************************************************************** * static functions */ @@ -163,6 +242,25 @@ serial_driver = &sa11x0_serial_driver; } __initlist(system3_init_hardware, INIT_LEVEL_DRIVER_SELECTION); + +/********************************************************************** + * system3 default partition table + */ +static void system3_set_partition_table(void) +{ + /* the default partition table */ + default_partition_table = system3_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_partition_table = (blob_partition_t*)0x00000000; +} + +__initlist(system3_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 */ /***************************************************************** * sysver - print system version |