* [U-Boot] [PATCH 1/3] mpc52xx, digsy_mtc: change phy addr for rev5 boards.
2011-04-04 6:10 [U-Boot] [PATCH 0/3] powerpc, mpc52xx: update for digsy_mtc support Heiko Schocher
@ 2011-04-04 6:10 ` Heiko Schocher
2011-04-04 9:44 ` Detlev Zundel
2011-04-27 22:52 ` Wolfgang Denk
2011-04-04 6:10 ` [U-Boot] [PATCH 2/3] mtd, cfi: introduce void flash_protect_default(void) Heiko Schocher
2011-04-04 6:10 ` [U-Boot] [PATCH 3/3] mpc52xx, digsy_mtc: protect default flash sectors Heiko Schocher
2 siblings, 2 replies; 8+ messages in thread
From: Heiko Schocher @ 2011-04-04 6:10 UTC (permalink / raw)
To: u-boot
- rev5 board has phy addr 1 -> adapt CONFIG_PHY_ADDR define
in board config file.
- also fixup the phy addr entry in dts, before booting
Linux.
Signed-off-by: Heiko Schocher <hs@denx.de>
---
board/digsy_mtc/digsy_mtc.c | 5 +++++
include/configs/digsy_mtc.h | 4 ++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/board/digsy_mtc/digsy_mtc.c b/board/digsy_mtc/digsy_mtc.c
index cbfdc9e..79cb3f1 100644
--- a/board/digsy_mtc/digsy_mtc.c
+++ b/board/digsy_mtc/digsy_mtc.c
@@ -405,6 +405,9 @@ int update_flash_size (int flash_size)
void ft_board_setup(void *blob, bd_t *bd)
{
+ int phy_addr = CONFIG_PHY_ADDR;
+ char eth_path[] = "/soc5200 at f0000000/mdio at 3000/ethernet-phy at 0";
+
ft_cpu_setup(blob, bd);
/*
* There are 2 RTC nodes in the DTS, so remove
@@ -422,5 +425,7 @@ void ft_board_setup(void *blob, bd_t *bd)
#endif
ft_adapt_flash_base(blob);
#endif
+ /* fix up the phy address */
+ do_fixup_by_path(blob, eth_path, "reg", &phy_addr, sizeof(int), 0);
}
#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */
diff --git a/include/configs/digsy_mtc.h b/include/configs/digsy_mtc.h
index d9be2b5..d4ca30e 100644
--- a/include/configs/digsy_mtc.h
+++ b/include/configs/digsy_mtc.h
@@ -348,7 +348,11 @@
*/
#define CONFIG_MPC5xxx_FEC 1
#define CONFIG_MPC5xxx_FEC_MII100
+#if defined(CONFIG_DIGSY_REV5)
+#define CONFIG_PHY_ADDR 0x01
+#else
#define CONFIG_PHY_ADDR 0x00
+#endif
#define CONFIG_PHY_RESET_DELAY 1000
#define CONFIG_NETCONSOLE /* include NetConsole support */
--
1.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH 2/3] mtd, cfi: introduce void flash_protect_default(void)
2011-04-04 6:10 [U-Boot] [PATCH 0/3] powerpc, mpc52xx: update for digsy_mtc support Heiko Schocher
2011-04-04 6:10 ` [U-Boot] [PATCH 1/3] mpc52xx, digsy_mtc: change phy addr for rev5 boards Heiko Schocher
@ 2011-04-04 6:10 ` Heiko Schocher
2011-04-07 8:21 ` Stefan Roese
2011-04-04 6:10 ` [U-Boot] [PATCH 3/3] mpc52xx, digsy_mtc: protect default flash sectors Heiko Schocher
2 siblings, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2011-04-04 6:10 UTC (permalink / raw)
To: u-boot
collect code which protects default sectors in a function, called
flash_protect_default. So boardspecific code can call it too.
Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Stefan Roese <sr@denx.de>
---
drivers/mtd/cfi_flash.c | 77 +++++++++++++++++++++++++----------------------
include/flash.h | 1 +
2 files changed, 42 insertions(+), 36 deletions(-)
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 0909fe7..e3b14d4 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -2085,6 +2085,46 @@ static void cfi_flash_set_config_reg(u32 base, u16 val)
/*-----------------------------------------------------------------------
*/
+
+void flash_protect_default(void)
+{
+ /* Monitor protection ON by default */
+#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
+ (!defined(CONFIG_MONITOR_IS_IN_RAM))
+ flash_protect(FLAG_PROTECT_SET,
+ CONFIG_SYS_MONITOR_BASE,
+ CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
+ flash_get_info(CONFIG_SYS_MONITOR_BASE));
+#endif
+
+ /* Environment protection ON by default */
+#ifdef CONFIG_ENV_IS_IN_FLASH
+ flash_protect(FLAG_PROTECT_SET,
+ CONFIG_ENV_ADDR,
+ CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1,
+ flash_get_info(CONFIG_ENV_ADDR));
+#endif
+
+ /* Redundant environment protection ON by default */
+#ifdef CONFIG_ENV_ADDR_REDUND
+ flash_protect(FLAG_PROTECT_SET,
+ CONFIG_ENV_ADDR_REDUND,
+ CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1,
+ flash_get_info(CONFIG_ENV_ADDR_REDUND));
+#endif
+
+#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
+ for (i = 0; i < (sizeof(apl) / sizeof(struct apl_s)); i++) {
+ debug("autoprotecting from %08x to %08x\n",
+ apl[i].start, apl[i].start + apl[i].size - 1);
+ flash_protect(FLAG_PROTECT_SET,
+ apl[i].start,
+ apl[i].start + apl[i].size - 1,
+ flash_get_info(apl[i].start));
+ }
+#endif
+}
+
unsigned long flash_init (void)
{
unsigned long size = 0;
@@ -2171,42 +2211,7 @@ unsigned long flash_init (void)
#endif /* CONFIG_SYS_FLASH_PROTECTION */
}
- /* Monitor protection ON by default */
-#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
- (!defined(CONFIG_MONITOR_IS_IN_RAM))
- flash_protect (FLAG_PROTECT_SET,
- CONFIG_SYS_MONITOR_BASE,
- CONFIG_SYS_MONITOR_BASE + monitor_flash_len - 1,
- flash_get_info(CONFIG_SYS_MONITOR_BASE));
-#endif
-
- /* Environment protection ON by default */
-#ifdef CONFIG_ENV_IS_IN_FLASH
- flash_protect (FLAG_PROTECT_SET,
- CONFIG_ENV_ADDR,
- CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1,
- flash_get_info(CONFIG_ENV_ADDR));
-#endif
-
- /* Redundant environment protection ON by default */
-#ifdef CONFIG_ENV_ADDR_REDUND
- flash_protect (FLAG_PROTECT_SET,
- CONFIG_ENV_ADDR_REDUND,
- CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1,
- flash_get_info(CONFIG_ENV_ADDR_REDUND));
-#endif
-
-#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
- for (i = 0; i < (sizeof(apl) / sizeof(struct apl_s)); i++) {
- debug("autoprotecting from %08x to %08x\n",
- apl[i].start, apl[i].start + apl[i].size - 1);
- flash_protect (FLAG_PROTECT_SET,
- apl[i].start,
- apl[i].start + apl[i].size - 1,
- flash_get_info(apl[i].start));
- }
-#endif
-
+ flash_protect_default();
#ifdef CONFIG_FLASH_CFI_MTD
cfi_mtd_init();
#endif
diff --git a/include/flash.h b/include/flash.h
index 1b6821a..0ca70d9 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -92,6 +92,7 @@ typedef unsigned long flash_sect_t;
/* Prototypes */
extern unsigned long flash_init (void);
+extern void flash_protect_default(void);
extern void flash_print_info (flash_info_t *);
extern int flash_erase (flash_info_t *, int, int);
extern int flash_sect_erase (ulong addr_first, ulong addr_last);
--
1.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread* [U-Boot] [PATCH 3/3] mpc52xx, digsy_mtc: protect default flash sectors
2011-04-04 6:10 [U-Boot] [PATCH 0/3] powerpc, mpc52xx: update for digsy_mtc support Heiko Schocher
2011-04-04 6:10 ` [U-Boot] [PATCH 1/3] mpc52xx, digsy_mtc: change phy addr for rev5 boards Heiko Schocher
2011-04-04 6:10 ` [U-Boot] [PATCH 2/3] mtd, cfi: introduce void flash_protect_default(void) Heiko Schocher
@ 2011-04-04 6:10 ` Heiko Schocher
2011-04-27 22:52 ` Wolfgang Denk
2 siblings, 1 reply; 8+ messages in thread
From: Heiko Schocher @ 2011-04-04 6:10 UTC (permalink / raw)
To: u-boot
call flash_protect_default() to protect default sectors.
Signed-off-by: Heiko Schocher <hs@denx.de>
---
board/digsy_mtc/digsy_mtc.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/board/digsy_mtc/digsy_mtc.c b/board/digsy_mtc/digsy_mtc.c
index 79cb3f1..9f13a3d 100644
--- a/board/digsy_mtc/digsy_mtc.c
+++ b/board/digsy_mtc/digsy_mtc.c
@@ -42,6 +42,7 @@
#if defined(CONFIG_DIGSY_REV5)
#include "is45s16800a2.h"
#include <mtd/cfi_flash.h>
+#include <flash.h>
#else
#include "is42s16800a-7t.h"
#endif
@@ -398,6 +399,7 @@ int update_flash_size (int flash_size)
size += flash_get_size(base, i);
}
}
+ flash_protect_default();
gd->bd->bi_flashstart = base;
return 0;
}
--
1.7.4
^ permalink raw reply related [flat|nested] 8+ messages in thread