/* SPI 0/1 Platform Data */
/* SPI flash information */
static
structmtd_partition am335x_spi_partitions[] = {
/* All the partition sizes are listed in terms of erase size */
{
.name ="SPL"
,
.offset = 0, /* Offset = 0x0 */
.size = SZ_128K,
},
{
.name ="U-Boot"
,
.offset = MTDPART_OFS_APPEND, /* Offset = 0x20000 */
.size = 2 * SZ_128K,
},
{
.name ="U-Boot Env"
,
.offset = MTDPART_OFS_APPEND, /* Offset = 0x60000 */
.size = 2 * SZ_4K,
},
{
.name ="Kernel"
,
.offset = MTDPART_OFS_APPEND, /* Offset = 0x62000 */
.size = 28 * SZ_128K,
},
{
.name ="File System"
,
.offset = MTDPART_OFS_APPEND, /* Offset = 0x3E2000 */
.size = MTDPART_SIZ_FULL, /* size ~= 4.1 MiB */
}
};
Gary Wu:
在SDK06.00(kernel为3.2及之前)及以前的版本,通常你会在Linux/arch/arm/mach-omap2/board-am335xevm.c中找到;
而在SDK07.00(kernel为3.12)和SDK08.00(kernel 为3.14) ,由于linux源码中没有对应的板级文件,板级配置通过devicetree进行。
所以你可以参考am335x-evm.dts里面的nand flash的分区,添加SPI的分区。
harry zheng:
回复 Gary Wu:
非常感谢,我看到board-am335xevm.c中,有下面这段:
/* MTD partition table */ /* All SPL-* partitions are sized to minimal length * which can be independently programmable. For * NAND flash this is equal to size of erase-block */
是不是下面的nand分区不用改就可以用作spi分区啊,刚接触TI,很多不懂,如果不是的,能否提供一下spi分区的例子啊,跪求!
#address-cells = <1>; #size-cells = <1>; partition@0 { label = "NAND.SPL"; reg = <0x00000000 0x000020000>; }; partition@1 { label = "NAND.SPL.backup1"; reg = <0x00020000 0x00020000>; }; partition@2 { label = "NAND.SPL.backup2"; reg = <0x00040000 0x00020000>; }; partition@3 { label = "NAND.SPL.backup3"; reg = <0x00060000 0x00020000>; }; partition@4 { label = "NAND.u-boot-spl-os"; reg = <0x00080000 0x00040000>; }; partition@5 { label = "NAND.u-boot"; reg = <0x000C0000 0x00100000>; }; partition@6 { label = "NAND.u-boot-env"; reg = <0x001C0000 0x00020000>; }; partition@7 { label = "NAND.u-boot-env.backup1"; reg = <0x001E0000 0x00020000>; }; partition@8 { label = "NAND.kernel"; reg = <0x00200000 0x00800000>; }; partition@9 { label = "NAND.file-system"; reg = <0x00A00000 0x0F600000>; };