From 2629d63efc2ed9c6a02dd6605a0a5cb62f4e278d Mon Sep 17 00:00:00 2001 From: Stephan Linz Date: Wed, 27 Jun 2012 00:28:24 +0200 Subject: microblaze: Remove wrong define CONFIG_SYS_FLASH_PROTECTION CONFIG_SYS_FLASH_PROTECTION is defined twice. The second one is outside the flash configuration context and we can remove it safely. Signed-off-by: Stephan Linz Signed-off-by: Michal Simek --- include/configs/microblaze-generic.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 295d123e501..5f16820218f 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -200,8 +200,6 @@ # define CONFIG_ENV_IS_NOWHERE 1 # define CONFIG_ENV_SIZE 0x1000 # define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE) -/* hardware flash protection */ -# define CONFIG_SYS_FLASH_PROTECTION #endif /* !FLASH */ /* system ace */ -- cgit v1.2.3 From 1fe7e8fa48931898ef2e35a913f56cef02f327a4 Mon Sep 17 00:00:00 2001 From: Stephan Linz Date: Wed, 27 Jun 2012 00:28:25 +0200 Subject: microblaze: Avoid compile error on systems without cfi flash Use XILINX_FLASH_START to set/unset FLASH and RAMENV. Error: board.c: In function 'board_init': board.c:134: error: 'XILINX_FLASH_START' undeclared (first use in this function) board.c:134: error: (Each undeclared identifier is reported only once board.c:134: error: for each function it appears in.) Signed-off-by: Stephan Linz Signed-off-by: Michal Simek --- include/configs/microblaze-generic.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 5f16820218f..2ef7d6257e6 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -31,6 +31,15 @@ #define CONFIG_MICROBLAZE 1 #define MICROBLAZE_V5 1 +/* linear flash memory */ +#ifdef XILINX_FLASH_START +#define FLASH +#undef RAMENV /* hold environment in flash */ +#else +#undef FLASH +#define RAMENV /* hold environment in RAM */ +#endif + /* uart */ #ifdef XILINX_UARTLITE_BASEADDR # define CONFIG_XILINX_UARTLITE @@ -164,9 +173,6 @@ /* stack */ #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_MALLOC_BASE -/*#define RAMENV */ -#define FLASH - #ifdef FLASH # define CONFIG_SYS_FLASH_BASE XILINX_FLASH_START # define CONFIG_SYS_FLASH_SIZE XILINX_FLASH_SIZE -- cgit v1.2.3 From 7cfb13a7f4d54d4f8989cc6214b4b3b8d5861d18 Mon Sep 17 00:00:00 2001 From: Stephan Linz Date: Wed, 27 Jun 2012 00:28:26 +0200 Subject: microblaze: Enable ubi support Increase malloc area for UBI to >= 512k -- foreseeing of UBIFS set to 768k. To save memory in flash (CONFIG_SYS_MONITOR_LEN) the UBIFS is disabled by default. Signed-off-by: Stephan Linz Signed-off-by: Michal Simek --- include/configs/microblaze-generic.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 2ef7d6257e6..2fd2279a47b 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -166,7 +166,7 @@ - CONFIG_SYS_MONITOR_LEN - GENERATED_BD_INFO_SIZE) #define CONFIG_SYS_MONITOR_END \ (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) -#define CONFIG_SYS_MALLOC_LEN SIZE +#define CONFIG_SYS_MALLOC_LEN (SIZE * 3) #define CONFIG_SYS_MALLOC_BASE \ (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN) @@ -273,6 +273,8 @@ # define CONFIG_CMD_FLASH # define CONFIG_CMD_IMLS # define CONFIG_CMD_JFFS2 +# define CONFIG_CMD_UBI +# undef CONFIG_CMD_UBIFS # if !defined(RAMENV) # define CONFIG_CMD_SAVEENV @@ -285,7 +287,21 @@ #endif #if defined(CONFIG_CMD_JFFS2) -/* JFFS2 partitions */ +# define CONFIG_MTD_PARTITIONS +#endif + +#if defined(CONFIG_CMD_UBIFS) +# define CONFIG_CMD_UBI +# define CONFIG_LZO +#endif + +#if defined(CONFIG_CMD_UBI) +# define CONFIG_MTD_PARTITIONS +# define CONFIG_RBTREE +#endif + +#if defined(CONFIG_MTD_PARTITIONS) +/* MTD partitions */ #define CONFIG_CMD_MTDPARTS /* mtdparts command line support */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define CONFIG_FLASH_CFI_MTD -- cgit v1.2.3 From 8f371b18503763b246b4fefa78da1b049a74ef48 Mon Sep 17 00:00:00 2001 From: Stephan Linz Date: Sun, 1 Jul 2012 16:44:37 +0200 Subject: microblaze: Expand and correct configuration comments - fix CONFIG_SYS_MALLOC_BASE from 0x11FB_F000 to 0x13EF_F000 - add new size calculation for CONFIG_SYS_MONITOR_LEN and CONFIG_SYS_MALLOC_LEN derived from SIZE - change CONFIG_SYS_MONITOR_BASE and CONFIG_SYS_MALLOC_BASE calculation to a symbolic equation with the corresponding _LEN definitions - add a "CFI flash memory layout - Example" comment Signed-off-by: Stephan Linz --- include/configs/microblaze-generic.h | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 2fd2279a47b..1de6c697ed1 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -122,15 +122,19 @@ /* * memory layout - Example - * CONFIG_SYS_TEXT_BASE = 0x1200_0000; + * CONFIG_SYS_TEXT_BASE = 0x1200_0000; defined in config.mk * CONFIG_SYS_SRAM_BASE = 0x1000_0000; - * CONFIG_SYS_SRAM_SIZE = 0x0400_0000; + * CONFIG_SYS_SRAM_SIZE = 0x0400_0000; 64MB + * + * CONFIG_SYS_MONITOR_LEN = 0x40000 + * CONFIG_SYS_MALLOC_LEN = 3 * CONFIG_SYS_MONITOR_LEN = 0xC0000 * * CONFIG_SYS_GBL_DATA_OFFSET = 0x1000_0000 + 0x0400_0000 - 0x1000 = 0x13FF_F000 - * CONFIG_SYS_MONITOR_BASE = 0x13FF_F000 - 0x40000 = 0x13FB_F000 - * CONFIG_SYS_MALLOC_BASE = 0x13FB_F000 - 0x40000 = 0x13F7_F000 + * CONFIG_SYS_MONITOR_BASE = 0x13FF_F000 - CONFIG_SYS_MONITOR_LEN = 0x13FB_F000 + * CONFIG_SYS_MALLOC_BASE = 0x13FB_F000 - CONFIG_SYS_MALLOC_LEN = 0x13EF_F000 * * 0x1000_0000 CONFIG_SYS_SDRAM_BASE + * MEMTEST_AREA 64kB * FREE * 0x1200_0000 CONFIG_SYS_TEXT_BASE * U-BOOT code @@ -138,9 +142,9 @@ * FREE * * STACK - * 0x13F7_F000 CONFIG_SYS_MALLOC_BASE - * MALLOC_AREA 256kB Alloc - * 0x11FB_F000 CONFIG_SYS_MONITOR_BASE + * 0x13EF_F000 CONFIG_SYS_MALLOC_BASE + * MALLOC_AREA 768kB Alloc + * 0x13FB_F000 CONFIG_SYS_MONITOR_BASE * MONITOR_CODE 256kB Env * 0x13FF_F000 CONFIG_SYS_GBL_DATA_OFFSET * GLOBAL_DATA 4kB bd, gd @@ -173,6 +177,24 @@ /* stack */ #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_MALLOC_BASE +/* + * CFI flash memory layout - Example + * CONFIG_SYS_FLASH_BASE = 0x2200_0000; + * CONFIG_SYS_FLASH_SIZE = 0x0080_0000; 8MB + * + * SECT_SIZE = 0x20000; 128kB is one sector + * CONFIG_ENV_SIZE = SECT_SIZE; 128kB environment store + * + * 0x2200_0000 CONFIG_SYS_FLASH_BASE + * FREE 256kB + * 0x2204_0000 CONFIG_ENV_ADDR + * ENV_AREA 128kB + * 0x2206_0000 + * FREE + * 0x2280_0000 CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE + * + */ + #ifdef FLASH # define CONFIG_SYS_FLASH_BASE XILINX_FLASH_START # define CONFIG_SYS_FLASH_SIZE XILINX_FLASH_SIZE -- cgit v1.2.3 From 2cce2d32318e66e5b72b78ff99e0ccdffa12277b Mon Sep 17 00:00:00 2001 From: Stephan Linz Date: Fri, 29 Jun 2012 23:23:33 +0200 Subject: microblaze: Add missing undefs for UBI and UBIFS In the case of missing flash usage disaple (undef) all the UBI support in the same way as for JFFS2. Signed-off-by: Stephan Linz --- include/configs/microblaze-generic.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 1de6c697ed1..e20eb0849ce 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -306,6 +306,8 @@ # undef CONFIG_CMD_IMLS # undef CONFIG_CMD_FLASH # undef CONFIG_CMD_JFFS2 +# undef CONFIG_CMD_UBI +# undef CONFIG_CMD_UBIFS #endif #if defined(CONFIG_CMD_JFFS2) -- cgit v1.2.3 From 920c358781970057dc10df1c7e70c784cd4c7408 Mon Sep 17 00:00:00 2001 From: Stephan Linz Date: Wed, 4 Jul 2012 22:25:30 +0200 Subject: microblaze: Wire up dts configuration - enable OF control and embedded OF - set default device tree file name to 'microblaze' - add CPP to dtc proxy: board/xilinx/dts/microblaze.dts - add an empty but processable dts for microblaze-generic Signed-off-by: Stephan Linz --- include/configs/microblaze-generic.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index e20eb0849ce..9a0f9a18071 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -31,6 +31,11 @@ #define CONFIG_MICROBLAZE 1 #define MICROBLAZE_V5 1 +/* Open Firmware DTS */ +#define CONFIG_OF_CONTROL 1 +#define CONFIG_OF_EMBED 1 +#define CONFIG_DEFAULT_DEVICE_TREE microblaze + /* linear flash memory */ #ifdef XILINX_FLASH_START #define FLASH -- cgit v1.2.3 From 575a3d21f6d7cbb653e48a957d0b2db944f2b9b3 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Tue, 10 Jul 2012 10:31:31 +0200 Subject: microblaze: intc: Clear interrupt code Clear and prepare for device-tree driven configuration. Remove CONFIG_SYS_INTC_0 definition Use dynamic allocation instead of static. Signed-off-by: Michal Simek Acked-by: Simon Glass --- include/configs/microblaze-generic.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 9a0f9a18071..56dcc02c9e2 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -102,7 +102,6 @@ /* interrupt controller */ #ifdef XILINX_INTC_BASEADDR -# define CONFIG_SYS_INTC_0 1 # define CONFIG_SYS_INTC_0_ADDR XILINX_INTC_BASEADDR # define CONFIG_SYS_INTC_0_NUM XILINX_INTC_NUM_INTR_INPUTS #endif -- cgit v1.2.3 From bcec8f49d1c5570f806f9cc33eb0bcc56a6551d5 Mon Sep 17 00:00:00 2001 From: Stephan Linz Date: Sun, 29 Jul 2012 00:25:36 +0200 Subject: microblaze: Wire up SPI driver Depending on XILINX_SPI_FLASH_BASEADDR enable SPI flash and environment in SPI flash. Expected values from xparameters.h are: - XILINX_SPI_FLASH_BASEADDR - XILINX_SPI_FLASH_MAX_FREQ - XILINX_SPI_FLASH_CS Signed-off-by: Stephan Linz Acked-by: Michal Simek --- include/configs/microblaze-generic.h | 55 ++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 56dcc02c9e2..1266cf72faf 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -36,14 +36,22 @@ #define CONFIG_OF_EMBED 1 #define CONFIG_DEFAULT_DEVICE_TREE microblaze -/* linear flash memory */ +/* linear and spi flash memory */ #ifdef XILINX_FLASH_START #define FLASH +#undef SPIFLASH #undef RAMENV /* hold environment in flash */ #else +#ifdef XILINX_SPI_FLASH_BASEADDR #undef FLASH +#define SPIFLASH +#undef RAMENV /* hold environment in flash */ +#else +#undef FLASH +#undef SPIFLASH #define RAMENV /* hold environment in RAM */ #endif +#endif /* uart */ #ifdef XILINX_UARTLITE_BASEADDR @@ -218,20 +226,51 @@ # define CONFIG_ENV_SIZE 0x1000 # define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE) -# else /* !RAMENV */ +# else /* FLASH && !RAMENV */ # define CONFIG_ENV_IS_IN_FLASH 1 /* 128K(one sector) for env */ # define CONFIG_ENV_SECT_SIZE 0x20000 # define CONFIG_ENV_ADDR \ (CONFIG_SYS_FLASH_BASE + (2 * CONFIG_ENV_SECT_SIZE)) # define CONFIG_ENV_SIZE 0x20000 -# endif /* !RAMBOOT */ +# endif /* FLASH && !RAMBOOT */ #else /* !FLASH */ + +#ifdef SPIFLASH +# define CONFIG_SYS_NO_FLASH 1 +# define CONFIG_SYS_SPI_BASE XILINX_SPI_FLASH_BASEADDR +# define CONFIG_XILINX_SPI 1 +# define CONFIG_SPI 1 +# define CONFIG_SPI_FLASH 1 +# define CONFIG_SPI_FLASH_STMICRO 1 +# define CONFIG_SF_DEFAULT_MODE SPI_MODE_3 +# define CONFIG_SF_DEFAULT_SPEED XILINX_SPI_FLASH_MAX_FREQ +# define CONFIG_SF_DEFAULT_CS XILINX_SPI_FLASH_CS + +# ifdef RAMENV +# define CONFIG_ENV_IS_NOWHERE 1 +# define CONFIG_ENV_SIZE 0x1000 +# define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE) + +# else /* SPIFLASH && !RAMENV */ +# define CONFIG_ENV_IS_IN_SPI_FLASH 1 +# define CONFIG_ENV_SPI_MODE SPI_MODE_3 +# define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED +# define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS +/* 128K(two sectors) for env */ +# define CONFIG_ENV_SECT_SIZE 0x10000 +# define CONFIG_ENV_SIZE (2 * CONFIG_ENV_SECT_SIZE) +/* Warning: adjust the offset in respect of other flash content and size */ +# define CONFIG_ENV_OFFSET (128 * CONFIG_ENV_SECT_SIZE) /* at 8MB */ +# endif /* SPIFLASH && !RAMBOOT */ +#else /* !SPIFLASH */ + /* ENV in RAM */ # define CONFIG_SYS_NO_FLASH 1 # define CONFIG_ENV_IS_NOWHERE 1 # define CONFIG_ENV_SIZE 0x1000 # define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE - CONFIG_ENV_SIZE) +#endif /* !SPIFLASH */ #endif /* !FLASH */ /* system ace */ @@ -302,6 +341,15 @@ # define CONFIG_CMD_UBI # undef CONFIG_CMD_UBIFS +# if !defined(RAMENV) +# define CONFIG_CMD_SAVEENV +# define CONFIG_CMD_SAVES +# endif + +#else +#if defined(SPIFLASH) +# define CONFIG_CMD_SF + # if !defined(RAMENV) # define CONFIG_CMD_SAVEENV # define CONFIG_CMD_SAVES @@ -313,6 +361,7 @@ # undef CONFIG_CMD_UBI # undef CONFIG_CMD_UBIFS #endif +#endif #if defined(CONFIG_CMD_JFFS2) # define CONFIG_MTD_PARTITIONS -- cgit v1.2.3