Skip to contentSkip to conversation

mpc52xx, digsy_mtc_rev5: Fix Linux crash, if no Flash in bank 2

PATCH New Heiko Schocher 2 participants 2 messages Jan 21, 2011 – Mar 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc52xx, digsy_mtc_rev5: Fix Linux crash, if no Flash in bank 2

If no Flash is connected to cs1, Linux crashes, because reg entries are not correct adapted.

Following fix is needed:
- swap base addresses in CONFIG_SYS_FLASH_BANKS_LIST, as flash bank 1 is on chipselect 0 and flash bank 2 on chipselect 1
- call fdt_fixup_nor_flash_size() from ft_board_setup()

cc Wolfgang Denk <[email protected]>
cc Werner Pfister <[email protected]>
cc Detlev Zundel <[email protected]>
---
 board/digsy_mtc/digsy_mtc.c |    5 +++++
 include/configs/digsy_mtc.h |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
board/digsy_mtc/digsy_mtc.c +5 -0
index afb0948..cbfdc9e 100644
@@ -46,6 +46,7 @@
 #include "is42s16800a-7t.h"
 #endif
 #include <libfdt.h>
+#include <fdt_support.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -415,6 +416,10 @@ void ft_board_setup(void *blob, bd_t *bd)
 	ft_delete_node(blob, "mc,rv3029c2");
 #endif
 #if defined(CONFIG_SYS_UPDATE_FLASH_SIZE)
+#ifdef CONFIG_FDT_FIXUP_NOR_FLASH_SIZE
+	/* Update reg property in all nor flash nodes too */
+	fdt_fixup_nor_flash_size(blob);
+#endif
 	ft_adapt_flash_base(blob);
 #endif
 }
include/configs/digsy_mtc.h +2 -2
index bfbec6a..e7fd0f7 100644
@@ -268,8 +268,8 @@
 #define CONFIG_SYS_FLASH_BASE		0xFE000000
 #define CONFIG_SYS_FLASH_BASE_CS1	0xFC000000
 #define CONFIG_SYS_MAX_FLASH_BANKS	2
-#define CONFIG_SYS_FLASH_BANKS_LIST	{ CONFIG_SYS_FLASH_BASE_CS1, \
-					CONFIG_SYS_FLASH_BASE}
+#define CONFIG_SYS_FLASH_BANKS_LIST	{ CONFIG_SYS_FLASH_BASE, \
+					CONFIG_SYS_FLASH_BASE_CS1}
 #define CONFIG_SYS_UPDATE_FLASH_SIZE
 #define CONFIG_FDT_FIXUP_NOR_FLASH_SIZE
 #else
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 mpc52xx, digsy_mtc_rev5: Fix Linux crash, if no Flash in bank 2

Dear Heiko Schocher,

Quoted 9 lines · In message <[email protected]> you wrote:

If no Flash is connected to cs1, Linux crashes, because reg entries are not correct adapted.

Following fix is needed:
- swap base addresses in CONFIG_SYS_FLASH_BANKS_LIST, as flash bank 1 is on chipselect 0 and flash bank 2 on chipselect 1
- call fdt_fixup_nor_flash_size() from ft_board_setup()

Quoted 8 lines
cc Wolfgang Denk <[email protected]>
cc Werner Pfister <[email protected]>
cc Detlev Zundel <[email protected]>
---
 board/digsy_mtc/digsy_mtc.c |    5 +++++
 include/configs/digsy_mtc.h |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
So we follow our wandering paths, and the very darkness acts  as  our
guide and our doubts serve to reassure us. - Jean-Pierre de Caussade,
eighteenth-century Jesuit priest