powerpc, mpc52xx: update for digsy_mtc support
cover powerpc, mpc52xx: update for digsy_mtc support
- change PHY addr for rev5 boards
- protect default sectors in NOR flash again
Heiko Schocher (3):
mpc52xx, digsy_mtc: change phy addr for rev5 boards. mtd, cfi: introduce void flash_protect_default(void) mpc52xx, digsy_mtc: protect default flash sectors
board/digsy_mtc/digsy_mtc.c | 7 ++++ drivers/mtd/cfi_flash.c | 77 +++++++++++++++++++++++-------------------- include/configs/digsy_mtc.h | 4 ++ include/flash.h | 1 + 4 files changed, 53 insertions(+), 36 deletions(-)
checkpatch:
total: 0 errors, 0 warnings, 27 lines checked
20110404_rebased/0001-mpc52xx-digsy_mtc-change-phy-addr-for-rev5-boards.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 96 lines checked
20110404_rebased/0002-mtd-cfi-introduce-void-flash_protect_default-void.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 14 lines checked
20110404_rebased/0003-mpc52xx-digsy_mtc-protect-default-flash-sectors.patch has no obvious style problems and is ready for submission.
Signature · 1 line
1.7.4
PATCH 1/3 mpc52xx, digsy_mtc: change phy addr for rev5 boards.
- 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.
--- board/digsy_mtc/digsy_mtc.c | 5 +++++ include/configs/digsy_mtc.h | 4 ++++ 2 files changed, 9 insertions(+), 0 deletions(-)
board/digsy_mtc/digsy_mtc.c +5 -0
@@ -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) */
include/configs/digsy_mtc.h +4 -0
@@ -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 */
Signature · 1 line
1.7.4
PATCH 1/3 mpc52xx, digsy_mtc: change phy addr for rev5 boards.
Hi Heiko,
Quoted 6 lines
- rev5 board has phy addr 1 -> adapt
CONFIG_PHY_ADDRdefine in board config file.
- also fixup the phy addr entry in dts, before booting Linux.Signed-off-by Heiko Schocher <[email protected]>
Cheers
Detlev
Signature · 7 lines
The continental people think life is a game. The English think
cricket is a game.
-- George Mikes
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.deWolfgang Denk
AppliedPATCH 1/3 mpc52xx, digsy_mtc: change phy addr for rev5 boards.
In reply to Heiko SchocherDear Heiko Schocher,
Quoted 10 lines · In message <[email protected]> you wrote:
- rev5 board has phy addr 1 -> adapt
CONFIG_PHY_ADDRdefine in board config file.
- also fixup the phy addr entry in dts, before booting Linux.Signed-off-by Heiko Schocher <[email protected]>--- board/digsy_mtc/digsy_mtc.c | 5 +++++ include/configs/digsy_mtc.h | 4 ++++ 2 files changed, 9 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 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 Keep your head and your heart going in the right direction and you will not have to worry about your feet.
PATCH 2/3 mtd, cfi: introduce void flash_protect_default(void)
In reply to Heiko Schochercollect code which protects default sectors in a function, called flash_protect_default. So boardspecific code can call it too.
--- drivers/mtd/cfi_flash.c | 77 +++++++++++++++++++++++++---------------------- include/flash.h | 1 + 2 files changed, 42 insertions(+), 36 deletions(-)
drivers/mtd/cfi_flash.c +41 -36
@@ -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
include/flash.h +1 -0
@@ -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);
Signature · 1 line
1.7.4
PATCH 2/3 mtd, cfi: introduce void flash_protect_default(void)
Quoted 2 lines · On Monday 04 April 2011 08:10:21 Heiko Schocher wrote:
collect code which protects default sectors in a function, called
flash_protect_default. So boardspecific code can call it too.
Applied to u-boot-cfi-flash. Thanks.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de
PATCH 3/3 mpc52xx, digsy_mtc: protect default flash sectors
In reply to Heiko Schochercall flash_protect_default() to protect default sectors.
--- board/digsy_mtc/digsy_mtc.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
board/digsy_mtc/digsy_mtc.c +2 -0
@@ -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 ; }
Signature · 1 line
1.7.4
Wolfgang Denk
AppliedPATCH 3/3 mpc52xx, digsy_mtc: protect default flash sectors
Dear Heiko Schocher,
Quoted 6 lines · In message <[email protected]> you wrote:
call
flash_protect_default()to protect default sectors.Signed-off-by Heiko Schocher <[email protected]>--- board/digsy_mtc/digsy_mtc.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 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 Yes, it is written. Good shall always destroy evil. -- Sirah the Yang, "The Omega Glory", stardate unknown