Powerpc: mpc8xx: cleanup before migration to DM model
Subsystems (6)
v4 cover Powerpc: mpc8xx: cleanup before migration to DM model
The purpose of this serie is to clean the mpc8xx code a bit prior to moving to OF and DM model.
Christophe Leroy (16):
soft_i2c: cleanup - no mpc8xx support
powerpc: mpc8xx: harmonise initialisation of the immap local pointer
powerpc: mpc8xx: get rid of the multiple PVR_ values
powerpc: mpc8xx: make get_immr() independent of CONFIG_8xx
powerpc: mpc8xx: remove get_immr() argument
powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx
powercp: mpc8xx: move commproc.h
powerpc: mpc8xx: redistribute data in CPM dpram
powerpc: mpc8xx: initialisation of initial RAM
board: MCR3000: replace mtd->priv by mtd_to_nand()
board: MCR3000: cleanup config
common: env_embedded: allow fine placement of environment object
board: MCR3000: Use smaller flash sector for environment
powerpc: mpc8xx: refactorise reginfo
powerpc: mpc8xx: cleaning up watchdog
powerpc: mpc8xx: move watchdog into drivers/watchdog
Changes since v3:
Reordered the serie in a more logical order
Reworked memory init to use existing functions board_init_f_xxx_reserve() Reworked allocation of initial memory
Moved watchdog into drivers/watchdog/ directory
Changes since v2:
Cleaning more items in patch 5
Not removing get_immr() anymore in patch 7
Patches from 11 are new in this version
api/api_platform-powerpc.c | 2 +-
arch/powerpc/Kconfig | 4 +-
arch/powerpc/cpu/mpc8xx/Kconfig | 6 +-
arch/powerpc/cpu/mpc8xx/Makefile | 1 -
arch/powerpc/cpu/mpc8xx/cpu.c | 36 ++---------
arch/powerpc/cpu/mpc8xx/cpu_init.c | 11 ++--
arch/powerpc/cpu/mpc8xx/immap.c | 24 +++++++-
arch/powerpc/cpu/mpc8xx/interrupts.c | 2 +-
arch/powerpc/cpu/mpc8xx/reginfo.c | 71 ----------------------
arch/powerpc/cpu/mpc8xx/speed.c | 3 +-
arch/powerpc/cpu/mpc8xx/start.S | 27 +++++---
arch/powerpc/include/asm/cache.h | 6 +-
.../powerpc/include/asm/cpm_8xx.h | 18 +++---
arch/powerpc/include/asm/global_data.h | 2 +-
.../include/asm/{8xx_immap.h => immap_8xx.h} | 0
arch/powerpc/include/asm/iopin_8xx.h | 2 +-
arch/powerpc/include/asm/ppc.h | 13 ++--
arch/powerpc/include/asm/processor.h | 6 +-
board/cssi/MCR3000/MCR3000.c | 2 +
board/cssi/MCR3000/nand.c | 2 +-
board/cssi/MCR3000/u-boot.lds | 6 +-
cmd/bdinfo.c | 2 +-
configs/MCR3000_defconfig | 6 +-
drivers/i2c/soft_i2c.c | 3 -
drivers/net/Kconfig | 2 +-
drivers/net/mpc8xx_fec.c | 2 +-
drivers/serial/Kconfig | 2 +-
drivers/serial/serial_mpc8xx.c | 2 +-
drivers/spi/Kconfig | 2 +-
drivers/spi/mpc8xx_spi.c | 2 +-
drivers/watchdog/Makefile | 1 +
drivers/watchdog/mpc8xx_wdt.c | 21 +++++++
env/embedded.c | 8 +--
include/asm-generic/u-boot.h | 2 +-
include/configs/MCR3000.h | 40 ++----------
include/env_default.h | 2 +-
include/mpc8xx.h | 4 +-
include/ppc_asm.tmpl | 6 +-
include/watchdog.h | 5 --
39 files changed, 139 insertions(+), 217 deletions(-)
delete mode 100644 arch/powerpc/cpu/mpc8xx/reginfo.c
rename include/commproc.h => arch/powerpc/include/asm/cpm_8xx.h (98%)
rename arch/powerpc/include/asm/{8xx_immap.h => immap_8xx.h} (100%)
create mode 100644 drivers/watchdog/mpc8xx_wdt.cSignature · 1 line
2.13.3
PATCH v4 1/16 soft_i2c: cleanup - no mpc8xx support
commit 907208c452999 ("powerpc: Partialy restore core of mpc8xx") didn't bring back support for I2C on the mpc8xx
--- drivers/i2c/soft_i2c.c | 3 --- 1 file changed, 3 deletions(-)
drivers/i2c/soft_i2c.c +0 -3
@@ -25,9 +25,6 @@#include <asm/arch/gpio.h> #endif #endif -#if defined(CONFIG_8xx) -#include <asm/io.h> -#endif #include <i2c.h> #if defined(CONFIG_SOFT_I2C_GPIO_SCL )
Signature · 1 line
2.13.3
PATCH v4 1/16 soft_i2c: cleanup - no mpc8xx support
Quoted 4 lines · Christophe Leroy
commit
907208c452999("powerpc: Partialy restore core of mpc8xx") didn't bring back support for I2C on the mpc8xxSigned-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/a3ea7319/attachment.sig>
PATCH v4 2/16 powerpc: mpc8xx: harmonise initialisation of the immap local pointer
In reply to Christophe LeroyIn most places, immap local pointer is defined as
immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR; In a few places, it is defined as immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);
This patch replaces the few of the latest form by the other one.
The two are fully equivalent since SPRN_IMMR is set with CONFIG_SYS_IMMR very early in start.S
--- arch/powerpc/cpu/mpc8xx/cpu.c | 5 ++--- arch/powerpc/cpu/mpc8xx/speed.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-)
arch/powerpc/cpu/mpc8xx/cpu.c +2 -3
@@ -36,7 +36,7 @@ DECLARE_GLOBAL_DATA_PTR;static int check_CPU (long clock,uint pvr,uint immr) { -immap_t __iomem *immap = (immap_t __iomem *)(immr &0xFFFF0000 ); +immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR ;uint k;char buf[32 ];
@@ -237,8 +237,7 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])*/ unsigned long get_tbclk (void ) { -uint immr =get_immr (0 );/* Return full IMMR contents */ -immap_t __iomem *immap = (immap_t __iomem *)(immr &0xFFFF0000 ); +immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR ;ulong oscclk, factor, pll;if (in_be32 (&immap->im_clkrst.car_sccr) &SCCR_TBS )
arch/powerpc/cpu/mpc8xx/speed.c +1 -2
@@ -17,8 +17,7 @@ DECLARE_GLOBAL_DATA_PTR;*/ int get_clocks (void ) { -uint immr =get_immr (0 );/* Return full IMMR contents */ -immap_t __iomem *immap = (immap_t __iomem *)(immr &0xFFFF0000 ); +immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR ;uint sccr =in_be32 (&immap->im_clkrst.car_sccr);uint divider =1 << (((sccr &SCCR_DFBRG11 ) >>11 ) *2 );
Signature · 1 line
2.13.3
PATCH v4 2/16 powerpc: mpc8xx: harmonise initialisation of the immap local pointer
Quoted 11 lines · Christophe Leroy
In most places, immap local pointer is defined as
immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR; In a few places, it is defined as immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000);This patch replaces the few of the latest form by the other one.
The two are fully equivalent since
SPRN_IMMRis set withCONFIG_SYS_IMMRvery early instart.SSigned-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/6a339302/attachment.sig>
PATCH v4 3/16 powerpc: mpc8xx: get rid of the multiple PVR_ values
In reply to Christophe LeroyAvoid hardcoding the PVR values in C since they are defined in processor.h
At the same time, remove those multiple PVR values for 8xx and keep only one that we call PVR_8xx
--- arch/powerpc/cpu/mpc8xx/cpu.c | 2 +- arch/powerpc/include/asm/processor.h | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-)
arch/powerpc/cpu/mpc8xx/cpu.c +1 -1
@@ -42,7 +42,7 @@ static int check_CPU(long clock, uint pvr, uint immr)/* the highest 16 bits should be 0x0050 for a 860 */ -if ((pvr >>16 ) !=0x0050 ) +if (PVR_VER (pvr) !=PVR_VER (PVR_8xx))return -1 ; k = (immr << 16) |
arch/powerpc/include/asm/processor.h +2 -4
@@ -973,10 +973,8 @@* differentiated by the version number in the Communication Processor * Module (CPM). */ -#define PVR_821 0x00500000 -#define PVR_823 PVR_821 -#define PVR_850 PVR_821 -#define PVR_860 PVR_821 +#define PVR_8xx 0x00500000 +#define PVR_7400 0x000C0000/*
Signature · 1 line
2.13.3
PATCH v4 3/16 powerpc: mpc8xx: get rid of the multiple PVR_ values
Quoted 7 lines · Christophe Leroy
Avoid hardcoding the PVR values in C since they are defined in
processor.hAt the same time, remove those multiple PVR values for 8xx and keep only one that we call
PVR_8xxSigned-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/3961e204/attachment.sig>
PATCH v4 4/16 powerpc: mpc8xx: make get_immr() independent of CONFIG_8xx
In reply to Christophe LeroySPRN_IMMR is defined regardless of the CPU. Therefore, there is no point in enclosing get_immr() inside a #ifdef CONFIG_8xx
As it a static inline function, it will in any case only be compiled in functons using it.
--- arch/powerpc/include/asm/ppc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/include/asm/ppc.h +1 -2
@@ -40,14 +40,13 @@#include <asm/processor.h> -#if defined(CONFIG_8xx)static inline uint get_immr (uint mask) {uint immr =mfspr (SPRN_IMMR );return mask ? (immr & mask) : immr; } -#endif +static inline uint get_pvr (void ) {return mfspr (PVR );
Signature · 1 line
2.13.3
PATCH v4 4/16 powerpc: mpc8xx: make get_immr() independent of CONFIG_8xx
Quoted 7 lines · Christophe Leroy
SPRN_IMMRis defined regardless of the CPU. Therefore, there is no point in enclosingget_immr()inside a #ifdefCONFIG_8xxAs it a static inline function, it will in any case only be compiled in functons using it.
Signed-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/f118c905/attachment.sig>
PATCH v4 5/16 powerpc: mpc8xx: remove get_immr() argument
In reply to Christophe Leroyget_immr() is always called with 0 as an argument, so it is useless.
--- arch/powerpc/cpu/mpc8xx/cpu.c | 2 +- arch/powerpc/cpu/mpc8xx/reginfo.c | 2 +- arch/powerpc/include/asm/ppc.h | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-)
arch/powerpc/cpu/mpc8xx/cpu.c +1 -1
@@ -90,7 +90,7 @@ static int check_CPU(long clock, uint pvr, uint immr)int checkcpu (void ) {ulong clock = gd->cpu_clk; -uint immr =get_immr (0 );/* Return full IMMR contents */ +uint immr =get_immr ();/* Return full IMMR contents */ uint pvr =get_pvr ();puts ("CPU: " );
arch/powerpc/cpu/mpc8xx/reginfo.c +1 -1
@@ -22,7 +22,7 @@ void print_reginfo(void)*/ printf ("\nSystem Configuration registers\n" -"\tIMMR\t0x%08X\n" ,get_immr (0 )); +"\tIMMR\t0x%08X\n" ,get_immr ());printf ("\tSIUMCR\t0x%08X" ,in_be32 (&sysconf->sc_siumcr));printf ("\tSYPCR\t0x%08X\n" ,in_be32 (&sysconf->sc_sypcr));
arch/powerpc/include/asm/ppc.h +2 -4
@@ -40,11 +40,9 @@#include <asm/processor.h> -static inline uint get_immr (uint mask) +static inline uint get_immr (void ) { -uint immr =mfspr (SPRN_IMMR ); - -return mask ? (immr & mask) : immr; +return mfspr (SPRN_IMMR ); }static inline uint get_pvr (void )
Signature · 1 line
2.13.3
PATCH v4 5/16 powerpc: mpc8xx: remove get_immr() argument
Quoted 3 lines · Christophe Leroy
get_immr()is always called with 0 as an argument, so it is useless.Signed-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/8fb75b91/attachment.sig>
PATCH v4 6/16 powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx
In reply to Christophe LeroyCONFIG_8xx doesn't mean much outside of arch/powerpc/ This patch renames it CONFIG_MPC8xx just like CONFIG_MPC85xx etc ... It also renames 8xx_immap.h to immap_8xx.h to be consistent with other file names.
---
api/api_platform-powerpc.c | 2 +-
arch/powerpc/Kconfig | 2 +-
arch/powerpc/cpu/mpc8xx/Kconfig | 2 +-
arch/powerpc/cpu/mpc8xx/immap.c | 2 +-
arch/powerpc/include/asm/cache.h | 6 +++---
arch/powerpc/include/asm/global_data.h | 2 +-
arch/powerpc/include/asm/{8xx_immap.h => immap_8xx.h} | 0
arch/powerpc/include/asm/iopin_8xx.h | 2 +-
arch/powerpc/include/asm/ppc.h | 4 ++--
cmd/bdinfo.c | 2 +-
configs/MCR3000_defconfig | 2 +-
drivers/net/Kconfig | 2 +-
drivers/serial/Kconfig | 2 +-
drivers/spi/Kconfig | 2 +-
include/asm-generic/u-boot.h | 2 +-
include/commproc.h | 2 +-
include/mpc8xx.h | 4 ++--
include/ppc_asm.tmpl | 6 +++---
include/watchdog.h | 2 +-
19 files changed, 24 insertions(+), 24 deletions(-)
rename arch/powerpc/include/asm/{8xx_immap.h => immap_8xx.h} (100%)api/api_platform-powerpc.c +1 -1
@@ -30,7 +30,7 @@ int platform_sys_info(struct sys_info *si) si->clk_bus = gd->bus_clk; si->clk_cpu = gd->cpu_clk; -#if defined(CONFIG_8xx) || defined(CONFIG_E500 ) || defined(CONFIG_MPC86xx) +#if defined(CONFIG_MPC8xx) || defined(CONFIG_E500 ) || defined(CONFIG_MPC86xx)#define bi_bar bi_immr_base#elif defined(CONFIG_MPC83xx)#define bi_bar bi_immrbar
arch/powerpc/Kconfig +1 -1
@@ -30,7 +30,7 @@ config MPC86xx select SYS_FSL_DDR_BE imply CMD_REGINFO -config 8xx +config MPC8xx bool "MPC8xx" imply CMD_REGINFO
arch/powerpc/cpu/mpc8xx/Kconfig +1 -1
@@ -1,5 +1,5 @@ menu "mpc8xx CPU" - depends on 8xx + depends on MPC8xx config SYS_CPU default "mpc8xx"
arch/powerpc/cpu/mpc8xx/immap.c +1 -1
@@ -12,7 +12,7 @@#include <common.h> #include <command.h> -#include <asm/8xx_immap.h> +#include <asm/immap_8xx.h> #include <commproc.h> #include <asm/iopin_8xx.h> #include <asm/io.h>
arch/powerpc/include/asm/cache.h +3 -3
@@ -7,7 +7,7 @@#include <asm/processor.h> /* bytes per L1 cache line */ -#if defined(CONFIG_8xx) +#if defined(CONFIG_MPC8xx)#define L1_CACHE_SHIFT 4#elif defined(CONFIG_PPC64BRIDGE )#define L1_CACHE_SHIFT 7
@@ -72,7 +72,7 @@ void disable_cpc_sram(void);#define L2CACHE_NONE 0x03/* NONE */ #define L2CACHE_PARITY 0x08/* Mask for L2 Cache Parity Protected bit */ -#ifdef CONFIG_8xx +#ifdef CONFIG_MPC8xx/* Cache control on the MPC8xx is provided through some additional * special purpose registers. */
@@ -139,6 +139,6 @@ static inline void wr_dc_adr(uint val)mtspr (DC_ADR , val); }#endif -#endif /* CONFIG_8xx */ +#endif /* CONFIG_MPC8xx */ #endif
arch/powerpc/include/asm/global_data.h +1 -1
@@ -19,7 +19,7 @@ struct arch_global_data {u8 sdhc_adapter;#endif #endif -#if defined(CONFIG_8xx) +#if defined(CONFIG_MPC8xx)unsigned long brg_clk;#endif #if defined(CONFIG_CPM2 )
arch/powerpc/include/asm/immap_8xx.h renamed from arch/powerpc/include/asm/8xx_immap.h +0 -0
arch/powerpc/include/asm/iopin_8xx.h +1 -1
@@ -11,7 +11,7 @@#define _ASM_IOPIN_8XX_H_#include <linux/types.h> -#include <asm/8xx_immap.h> +#include <asm/immap_8xx.h> #include <asm/io.h> #ifdef __KERNEL__
arch/powerpc/include/asm/ppc.h +2 -2
@@ -13,8 +13,8 @@#ifndef __ASSEMBLY__ -#if defined(CONFIG_8xx) -#include <asm/8xx_immap.h> +#if defined(CONFIG_MPC8xx) +#include <asm/immap_8xx.h> #endif #ifdef CONFIG_MPC86xx#include <mpc86xx.h>
cmd/bdinfo.c +1 -1
@@ -180,7 +180,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])print_bi_flash (bd);print_num ("sramstart" , bd->bi_sramstart);print_num ("sramsize" , bd->bi_sramsize); -#if defined(CONFIG_8xx) || defined(CONFIG_E500 ) +#if defined(CONFIG_MPC8xx) || defined(CONFIG_E500 )print_num ("immr_base" , bd->bi_immr_base);#endif print_num ("bootflags" , bd->bi_bootflags);
configs/MCR3000_defconfig +1 -1
@@ -1,6 +1,6 @@ CONFIG_PPC=y CONFIG_SYS_TEXT_BASE=0x4000000 -CONFIG_8xx=y +CONFIG_MPC8xx=y CONFIG_TARGET_MCR3000=y CONFIG_8xx_GCLK_FREQ=132000000 CONFIG_CMD_IMMAP=y
drivers/net/Kconfig +1 -1
@@ -330,7 +330,7 @@ config RENESAS_RAVB config MPC8XX_FEC bool "Fast Ethernet Controller on MPC8XX" - depends on 8xx + depends on MPC8xx select MII help This driver implements support for the Fast Ethernet Controller
drivers/serial/Kconfig +1 -1
@@ -592,7 +592,7 @@ config ZYNQ_SERIAL config MPC8XX_CONS bool "Console driver for MPC8XX" - depends on 8xx + depends on MPC8xx default y choice
drivers/spi/Kconfig +1 -1
@@ -276,7 +276,7 @@ config LPC32XX_SSP config MPC8XX_SPI bool "MPC8XX SPI Driver" - depends on 8xx + depends on MPC8xx help Enable support for SPI on MPC8XX
include/asm-generic/u-boot.h +1 -1
@@ -37,7 +37,7 @@ typedef struct bd_info {unsigned long bi_dsp_freq;/* dsp core frequency */ unsigned long bi_ddr_freq;/* ddr frequency */ #endif -#if defined(CONFIG_8xx) || defined(CONFIG_E500 ) || defined(CONFIG_MPC86xx) +#if defined(CONFIG_MPC8xx) || defined(CONFIG_E500 ) || defined(CONFIG_MPC86xx)unsigned long bi_immr_base;/* base of IMMR register */ #endif #if defined(CONFIG_M68K )
include/commproc.h +1 -1
@@ -16,7 +16,7 @@#ifndef __CPM_8XX__#define __CPM_8XX__ -#include <asm/8xx_immap.h> +#include <asm/immap_8xx.h> /* CPM Command register. */
include/mpc8xx.h +2 -2
@@ -81,7 +81,7 @@#define TBSCR_TBIRQ2 0x0400/* Time Base Interrupt Request 2 */ #define TBSCR_TBIRQ1 0x0200/* Time Base Interrupt Request 1 */ #define TBSCR_TBIRQ0 0x0100/* Time Base Interrupt Request 0 */ -#if 0 /* already in asm/8xx_immap.h */ +#if 0 /* already in asm/immap_8xx.h */ #define TBSCR_REFA 0x0080/* Reference Interrupt Status A */ #define TBSCR_REFB 0x0040/* Reference Interrupt Status B */ #define TBSCR_REFAE 0x0008/* Second Interrupt Enable A */
@@ -95,7 +95,7 @@*/ #undef PISCR_PIRQ/* TBD */ #define PISCR_PITF 0x0002/* Periodic Interrupt Timer Freeze */ -#if 0 /* already in asm/8xx_immap.h */ +#if 0 /* already in asm/immap_8xx.h */ #define PISCR_PS 0x0080/* Periodic interrupt Status */ #define PISCR_PIE 0x0004/* Periodic Interrupt Enable */ #define PISCR_PTE 0x0001/* Periodic Timer Enable */
include/ppc_asm.tmpl +3 -3
@@ -81,7 +81,7 @@ #define r30 30 #define r31 31 -#if defined(CONFIG_8xx) +#if defined(CONFIG_MPC8xx) /* Some special registers */
@@ -93,10 +93,10 @@ #define LCTRL2 157 /* Load/Store Support (37-41) */ #define ICTRL 158 -#endif /* CONFIG_8xx */ +#endif /* CONFIG_MPC8xx */ -#if defined(CONFIG_8xx) +#if defined(CONFIG_MPC8xx) /* Registers in the processor's internal memory map that we use. */
include/watchdog.h +1 -1
@@ -73,7 +73,7 @@ int init_func_watchdog_reset(void);*/ /* MPC 8xx */ -#if defined(CONFIG_8xx) && !defined(__ASSEMBLY__) +#if defined(CONFIG_MPC8xx) && !defined(__ASSEMBLY__)void reset_8xx_watchdog (immap_t __iomem *immr);#endif
Signature · 1 line
2.13.3
PATCH v4 6/16 powerpc: mpc8xx: Change CONFIG_8xx to CONFIG_MPC8xx
Quoted 6 lines · Christophe Leroy
CONFIG_8xxdoesn't mean much outside ofarch/powerpc/This patch renames itCONFIG_MPC8xxjust likeCONFIG_MPC85xxetc ... It also renames8xx_immap.htoimmap_8xx.hto be consistent with other file names.Signed-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/47eddfcc/attachment.sig>
PATCH v4 7/16 powercp: mpc8xx: move commproc.h
In reply to Christophe Leroyinclude/commproc.h is dedicated to the 8xx, rename it cpm_8xx.h and move it into arch/powerpc/include/asm
--- arch/powerpc/cpu/mpc8xx/cpu.c | 2 +- arch/powerpc/cpu/mpc8xx/cpu_init.c | 2 +- arch/powerpc/cpu/mpc8xx/immap.c | 2 +- arch/powerpc/cpu/mpc8xx/interrupts.c | 2 +- include/commproc.h => arch/powerpc/include/asm/cpm_8xx.h | 0 drivers/net/mpc8xx_fec.c | 2 +- drivers/serial/serial_mpc8xx.c | 2 +- drivers/spi/mpc8xx_spi.c | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename include/commproc.h => arch/powerpc/include/asm/cpm_8xx.h (100%)
arch/powerpc/cpu/mpc8xx/cpu.c +1 -1
@@ -21,9 +21,9 @@#include <watchdog.h> #include <command.h> #include <mpc8xx.h> -#include <commproc.h> #include <netdev.h> #include <asm/cache.h> +#include <asm/cpm_8xx.h> #include <linux/compiler.h> #include <asm/io.h>
arch/powerpc/cpu/mpc8xx/cpu_init.c +1 -1
@@ -9,7 +9,7 @@#include <watchdog.h> #include <mpc8xx.h> -#include <commproc.h> +#include <asm/cpm_8xx.h> #include <asm/io.h> /*
arch/powerpc/cpu/mpc8xx/immap.c +1 -1
@@ -13,7 +13,7 @@#include <command.h> #include <asm/immap_8xx.h> -#include <commproc.h> +#include <asm/cpm_8xx.h> #include <asm/iopin_8xx.h> #include <asm/io.h>
arch/powerpc/cpu/mpc8xx/interrupts.c +1 -1
@@ -8,9 +8,9 @@#include <common.h> #include <mpc8xx.h> #include <mpc8xx_irq.h> +#include <asm/cpm_8xx.h> #include <asm/processor.h> #include <asm/io.h> -#include <commproc.h> /************************************************************************/
arch/powerpc/include/asm/cpm_8xx.h renamed from include/commproc.h +0 -0
drivers/net/mpc8xx_fec.c +1 -1
@@ -7,10 +7,10 @@#include <common.h> #include <command.h> -#include <commproc.h> #include <malloc.h> #include <net.h> #include <netdev.h> +#include <asm/cpm_8xx.h> #include <asm/io.h> #include <phy.h>
drivers/serial/serial_mpc8xx.c +1 -1
@@ -6,10 +6,10 @@*/ #include <common.h> -#include <commproc.h> #include <command.h> #include <serial.h> #include <watchdog.h> +#include <asm/cpm_8xx.h> #include <linux/compiler.h> DECLARE_GLOBAL_DATA_PTR ;
drivers/spi/mpc8xx_spi.c +1 -1
@@ -19,7 +19,7 @@#include <common.h> #include <mpc8xx.h> -#include <commproc.h> +#include <asm/cpm_8xx.h> #include <linux/ctype.h> #include <malloc.h> #include <post.h>
Signature · 1 line
2.13.3
PATCH v4 7/16 powercp: mpc8xx: move commproc.h
Quoted 4 lines · Christophe Leroy
include/commproc.his dedicated to the 8xx, rename itcpm_8xx.hand move it intoarch/powerpc/include/asmSigned-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/662e494d/attachment.sig>
PATCH v4 8/16 powerpc: mpc8xx: redistribute data in CPM dpram
In reply to Christophe LeroySome malloc memory is needed at startup for DM model. Lets reorganise the use of the CPM dpram.
The MPC866/885 dpram, we have 8kbytes dual port RAM, which is usable as:
IMMR + 0x2000..0x2800: BD/Data/Microcode
IMMR + 0x2800..0x2e00: BD/Data
IMMR + 0x2e00..0x3800: BD/Data/Microcode
IMMR + 0x3800..0x3a00: BD/Data
IMMR + 0x3a00..0x3c00: BD/Data/Microcode
IMMR + 0x3c00..0x4000: Parameters for the Peripheral Controllers
Lets reallocate all BDs in the 3800..3a00 area and give the full 2800..2e00 for dynamic RAM allocation including global data
That way, the microcode areas remain available if needed one day.
--- arch/powerpc/include/asm/cpm_8xx.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
arch/powerpc/include/asm/cpm_8xx.h +8 -8
@@ -51,14 +51,14 @@/* * DPRAM defines and allocation functions */ -#define CPM_SERIAL_BASE 0x0800 -#define CPM_I2C_BASE 0x0820 -#define CPM_SPI_BASE 0x0840 -#define CPM_FEC_BASE 0x0860 -#define CPM_SERIAL2_BASE 0x08E0 -#define CPM_SCC_BASE 0x0900 -#define CPM_POST_BASE 0x0980 -#define CPM_WLKBD_BASE 0x0a00 +#define CPM_SERIAL_BASE 0x1800 +#define CPM_I2C_BASE 0x1820 +#define CPM_SPI_BASE 0x1840 +#define CPM_FEC_BASE 0x1860 +#define CPM_SERIAL2_BASE 0x18e0 +#define CPM_SCC_BASE 0x1900 +#define CPM_POST_BASE 0x1980 +#define CPM_WLKBD_BASE 0x1a00#define BD_IIC_START ((uint) 0x0400)/* <- please use CPM_I2C_BASE !! */
Signature · 1 line
2.13.3
PATCH v4 8/16 powerpc: mpc8xx: redistribute data in CPM dpram
Quoted 11 lines · Christophe Leroy
Some malloc memory is needed at startup for DM model. Lets reorganise the use of the CPM dpram.
The MPC866/885 dpram, we have 8kbytes dual port RAM, which is usable as:
IMMR + 0x2000..0x2800: BD/Data/Microcode
IMMR + 0x2800..0x2e00: BD/Data
IMMR + 0x2e00..0x3800: BD/Data/Microcode
IMMR + 0x3800..0x3a00: BD/Data
IMMR + 0x3a00..0x3c00: BD/Data/Microcode
IMMR + 0x3c00..0x4000: Parameters for the Peripheral Controllers
Quoted 6 lines
Lets reallocate all BDs in the 3800..3a00 area and give the full 2800..2e00 for dynamic RAM allocation including global data
That way, the microcode areas remain available if needed one day.
Signed-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/fd6218f3/attachment.sig>
PATCH v4 9/16 powerpc: mpc8xx: initialisation of initial RAM
In reply to Christophe Leroyu-boot requires some RAM at startup, to store global data structure. RAM is also needed when we migrate to DM for some initial malloc
This patch implements the proper init of that RAM by calling board_init_f_alloc_reserve() and board_init_f_init_reserve()
--- arch/powerpc/cpu/mpc8xx/start.S | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-)
arch/powerpc/cpu/mpc8xx/start.S +20 -7
@@ -130,12 +130,6 @@ in_flash: /* initialize some SPRs that are hard to access from C */ /*----------------------------------------------------------------------*/ - lis r3, CONFIG_SYS_IMMR at h /* pass IMMR as arg1 to C routine */ - ori r1, r3, CONFIG_SYS_INIT_SP_OFFSET /* set up the stack in internal DPRAM */ - /* Note: R0 is still 0 here */ - stwu r0, -4(r1) /* clear final stack frame so that */ - stwu r0, -4(r1) /* stack backtraces terminate cleanly */ - /* * Disable serialized ifetch and show cycles * (i.e. set processor to normal mode).
@@ -151,6 +145,25 @@ in_flash: ori r2, r2, CONFIG_SYS_DER at l mtspr DER, r2 + /* set up the stack in internal DPRAM */ + lis r3, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)@h + ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE)@l + addi r1, r3, -8 + + bl board_init_f_alloc_reserve + addi r1, r3, -8 + + /* Zeroise the CPM dpram */ + lis r4, CONFIG_SYS_IMMR at h + ori r4, r4, (0x2000 - 4) + li r0, (0x2000 / 4) + mtctr r0 + li r0, 0 +1: stwu r0, 4(r4) + bdnz 1b + + bl board_init_f_init_reserve + /* let the C-code set up the rest */ /* */ /* Be careful to keep code relocatable ! */
@@ -158,7 +171,7 @@ in_flash: GET_GOT /* initialize GOT access */ - /* r3: IMMR */ + lis r3, CONFIG_SYS_IMMR at h bl cpu_init_f /* run low-level CPU init code (from Flash) */ bl board_init_f /* run 1st part of board init code (from Flash) */
Signature · 1 line
2.13.3
PATCH v4 9/16 powerpc: mpc8xx: initialisation of initial RAM
Quoted 7 lines · Christophe Leroy
u-boot requires some RAM at startup, to store global data structure. RAM is also needed when we migrate to DM for some initial malloc
This patch implements the proper init of that RAM by calling
board_init_f_alloc_reserve()andboard_init_f_init_reserve()Signed-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/d11b298f/attachment.sig>
PATCH v4 10/16 board: MCR3000: replace mtd->priv by mtd_to_nand()
In reply to Christophe LeroySince commit 17cb4b8f327eb ("mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data"), mtd_to_nand() has to be used instead of mtd->priv
--- board/cssi/MCR3000/nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/cssi/MCR3000/nand.c +1 -1
@@ -17,7 +17,7 @@static void nand_hwcontrol (struct mtd_info *mtdinfo,int cmd,unsigned int ctrl) { -struct nand_chip *this = mtdinfo->priv; +struct nand_chip *this =mtd_to_nand (mtdinfo);immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR ;unsigned short pddat =0 ;
Signature · 1 line
2.13.3
PATCH v4 10/16 board: MCR3000: replace mtd->priv by mtd_to_nand()
Quoted 5 lines · Christophe Leroy
Since commit
17cb4b8f327eb("mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data"),mtd_to_nand()has to be used instead ofmtd->privSigned-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/8fa16b28/attachment.sig>
PATCH v4 11/16 board: MCR3000: cleanup config
In reply to Christophe LeroySome config is redundant with Kconfig. Fix it.
Also remove unused configs
Move SDRAM_MAX_SIZE in the only place it is used
include/environment.h already defines CONFIG_ENV_SIZE from CONFIG_ENV_SECT_SIZE and defines CONFIG_ENV_ADDR as (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET)
remove BOOTARGS as bootargs is set by the different boot commands
Fix CONFIG_SYS_INIT_RAM_ADDR and CONFIG_SYS_INIT_RAM_SIZE to be in line with CPM DPRAM organisation
Remove CONFIG_SYS_GBL_DATA_SIZE, CONFIG_SYS_GBL_DATA_OFFSET and CONFIG_SYS_INIT_SP_OFFSET which are unused
--- arch/powerpc/Kconfig | 1 + board/cssi/MCR3000/MCR3000.c | 2 ++ configs/MCR3000_defconfig | 4 ++-- include/configs/MCR3000.h | 34 +++------------------------------- 4 files changed, 8 insertions(+), 33 deletions(-)
arch/powerpc/Kconfig +1 -0
@@ -32,6 +32,7 @@ config MPC86xx config MPC8xx bool "MPC8xx" + select BOARD_EARLY_INIT_F imply CMD_REGINFO endchoice
board/cssi/MCR3000/MCR3000.c +2 -0
@@ -16,6 +16,8 @@DECLARE_GLOBAL_DATA_PTR ; +#define SDRAM_MAX_SIZE (32 * 1024 * 1024) +static const uint cs1_dram_table_66[] = {/* DRAM - single read. (offset 0 in upm RAM) */ 0x0F3DFC04 ,0x0FEFBC04 ,0x00BE7804 ,0x0FFDF400 ,
configs/MCR3000_defconfig +2 -2
@@ -39,8 +39,6 @@ CONFIG_SYS_OR7_PRELIM=0xFFFF810A CONFIG_SYS_IMMR=0xFF000000 CONFIG_OF_BOARD_SETUP=y CONFIG_BOOTDELAY=5 -CONFIG_USE_BOOTARGS=y -CONFIG_BOOTARGS="ubi.mtd=4 root=ubi0:rootfs rw rootfstype=ubifs rootflags=sync console=ttyCPM0,115200N8 ip=${ipaddr}:::${netmask}:mcr3k:eth0:off" CONFIG_HUSH_PARSER=y # CONFIG_AUTO_COMPLETE is not set CONFIG_SYS_PROMPT="S3K> "
@@ -71,3 +69,5 @@ CONFIG_MPC8XX_FEC=y CONFIG_SHA256=y CONFIG_LZMA=y CONFIG_OF_LIBFDT=y +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="run flashboot"
include/configs/MCR3000.h +3 -31
@@ -9,7 +9,6 @@#define __CONFIG_H/* High Level Configuration Options */ -#define CONFIG_BOARD_EARLY_INIT_F 1/* Call board_early_init_f */ #define CONFIG_MISC_INIT_R 1/* Call misc_init_r */ #define CONFIG_EXTRA_ENV_SETTINGS \
@@ -55,25 +54,16 @@"${ofl_args}; " \ "bootm ${loadaddr} - 0xf00000\0" -#define CONFIG_BOOTDELAY 5 -#define CONFIG_IPADDR 192.168.0.3#define CONFIG_SERVERIP 192.168.0.1#define CONFIG_NETMASK 255.0.0.0 -#define CONFIG_BOOTCOMMAND "run flashboot" -#define CONFIG_LOADS_ECHO 1/* echo on for serial download */ -#undef CONFIG_LOADS_BAUD_CHANGE/* don't allow baudrate change */ #define CONFIG_WATCHDOG 1/* watchdog enabled */ /* Miscellaneous configurable options */ -#ifdef CONFIG_HUSH_PARSER -#define CONFIG_SYS_PROMPT_HUSH_PS2 "S3K> " -#endif -#define CONFIG_SYS_MEMTEST_START 0x00002000#define CONFIG_SYS_MEMTEST_END 0x00800000
@@ -82,16 +72,11 @@#define CONFIG_SYS_HZ 1000/* Definitions for initial stack pointer and data area (in DPRAM) */ -#define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_IMMR -#define CONFIG_SYS_INIT_RAM_SIZE 0x2f00 -#define CONFIG_SYS_GBL_DATA_SIZE 64 -#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \ - CONFIG_SYS_GBL_DATA_SIZE) -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET +#define CONFIG_SYS_INIT_RAM_ADDR (CONFIG_SYS_IMMR + 0x2800) +#define CONFIG_SYS_INIT_RAM_SIZE (0x2e00 - 0x2800)/* RAM configuration (note that CONFIG_SYS_SDRAM_BASE must be zero) */ #define CONFIG_SYS_SDRAM_BASE 0x00000000 -#define SDRAM_MAX_SIZE (32 * 1024 * 1024)/* FLASH organization */ #define CONFIG_SYS_FLASH_BASE CONFIG_SYS_TEXT_BASE
@@ -116,29 +101,16 @@/* environment is in FLASH */ #define CONFIG_ENV_SECT_SIZE (64 * 1024) -#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE -#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN) -#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE) +#define CONFIG_ENV_OFFSET CONFIG_SYS_MONITOR_LEN#define CONFIG_ENV_OVERWRITE 1 -/* Cache Configuration */ -#define CONFIG_SYS_CACHELINE_SIZE 16 -/* Ethernet configuration part */ #define CONFIG_SYS_DISCOVER_PHY 1 -#ifdef CONFIG_MPC8XX_FEC #define CONFIG_MII_INIT 1 -#endif /* NAND configuration part */ #define CONFIG_SYS_MAX_NAND_DEVICE 1#define CONFIG_SYS_NAND_MAX_CHIPS 1#define CONFIG_SYS_NAND_BASE 0x0C000000 -/* Internal Definitions */ - -/* Boot Flags*/ -#define BOOTFLAG_COLD 0x01 -#define BOOTFLAG_WARM 0x02 -#endif /* __CONFIG_H */
Signature · 1 line
2.13.3
PATCH v4 11/16 board: MCR3000: cleanup config
Quoted 10 lines · Christophe Leroy
Some config is redundant with
Kconfig. Fix it.
Also remove unused configs
MoveSDRAM_MAX_SIZEin the only place it is used
include/environment.halready definesCONFIG_ENV_SIZEfromCONFIG_ENV_SECT_SIZEand definesCONFIG_ENV_ADDRas (CONFIG_SYS_FLASH_BASE+CONFIG_ENV_OFFSET)remove BOOTARGS as bootargs is set by the different boot commands
Quoted 7 lines
Fix
CONFIG_SYS_INIT_RAM_ADDRandCONFIG_SYS_INIT_RAM_SIZEto be in line with CPM DPRAM organisationRemove
CONFIG_SYS_GBL_DATA_SIZE,CONFIG_SYS_GBL_DATA_OFFSETandCONFIG_SYS_INIT_SP_OFFSETwhich are unusedSigned-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/2c36db95/attachment.sig>
PATCH v4 12/16 common: env_embedded: allow fine placement of environment object
In reply to Christophe LeroyCommit 7653942b10e9e ("common/env_embedded.c: drop support for CONFIG_SYS_USE_PPCENV") dropped the .ppcenv section which was used in linking scripts to allow fine placement of embedded environment sections.
This implies that GCC randomly places objects from env/embedded.o and environment is not guaranteed to be located at the correct address:
04003df8 g F .text 00000038 mii_init 04004000 g O .text 00000004 env_size 04004004 g O .text 00002000 environment 04006004 g F .text 00000040 .hidden __lshrdi3
This patch restores this capability by allocating each object marked with __UBOOT_ENV_SECTION__ into a different section. Hence 'environment' will be alone in .text.environment, allowing a fine placement in u-boot.lds with:
. = DEFINED(env_offset) ? env_offset : .; env/embedded.o (.text.environment)
--- env/embedded.c | 8 ++++---- include/env_default.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
env/embedded.c +4 -4
@@ -35,11 +35,11 @@* a seperate section. */ #if defined(USE_HOSTCC )/* Native for 'tools/envcrc' */ -# define __UBOOT_ENV_SECTION__/*XXX DO_NOT_DEL_THIS_COMMENT*/ +# define __UBOOT_ENV_SECTION__ (name)/*XXX DO_NOT_DEL_THIS_COMMENT*/ #else /* Environment is embedded in U-Boot's .text section */ /* XXX - This only works with GNU C */ -# define __UBOOT_ENV_SECTION__ __attribute__ ((section(".text"))) +# define __UBOOT_ENV_SECTION__ (name) __attribute__ ((section(".text."#name)))#endif /*
@@ -70,7 +70,7 @@#include <env_default.h> #ifdef CONFIG_ENV_ADDR_REDUND -env_t redundand_environment __UBOOT_ENV_SECTION__ = { +env_t redundand_environment __UBOOT_ENV_SECTION__(redundand_environment) = { 0, /* CRC Sum: invalid */ 0, /* Flags: invalid */ {
@@ -87,7 +87,7 @@ env_t redundand_environment __UBOOT_ENV_SECTION__ = {* .data/.sdata section. * */ -unsigned long env_size __UBOOT_ENV_SECTION__ =sizeof (env_t); +unsigned long env_size __UBOOT_ENV_SECTION__ (env_size ) =sizeof (env_t);/* * Add in absolutes.
include/env_default.h +1 -1
@@ -11,7 +11,7 @@#include <env_callback.h> #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED -env_t environment __UBOOT_ENV_SECTION__ = { +env_t environment __UBOOT_ENV_SECTION__(environment) = {ENV_CRC ,/* CRC Sum */ #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT 1, /* Flags: valid */
Signature · 1 line
2.13.3
PATCH v4 12/16 common: env_embedded: allow fine placement of environment object
Quoted 18 lines · Christophe Leroy
Commit
7653942b10e9e("common/env_embedded.c: drop support forCONFIG_SYS_USE_PPCENV") dropped the .ppcenv section which was used in linking scripts to allow fine placement of embedded environment sections.This implies that GCC randomly places objects from
env/embedded.oand environment is not guaranteed to be located at the correct address:04003df8 g F .text 00000038 mii_init 04004000 g O .text 00000004 env_size 04004004 g O .text 00002000 environment 04006004 g F .text 00000040 .hidden __lshrdi3This patch restores this capability by allocating each object marked with
__UBOOT_ENV_SECTION__into a different section. Hence 'environment' will be alone in .text.environment, allowing a fine placement inu-boot.ldswith:
Quoted 6 lines
. = DEFINED(env_offset) ? env_offset : .; env/embedded.o (.text.environment)Fixes 7653942b10e9e ("common/env_embedded.c: drop support for CONFIG_SYS_USE_PPCENV")Cc Thomas Petazzoni <[email protected]>Signed-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/490be286/attachment.sig>
PATCH v4 13/16 board: MCR3000: Use smaller flash sector for environment
In reply to Christophe LeroyLatest versions of u-boot have increased in size and require more than the 256kb allocated to it.
The MCR3000 board is equipped with an AM29LV160DB boot flash which is organised as follows:
- One 16kb block
- Two 8kb block
- One 32kb block
- Thirty one 64kb blocks
At the time being, u-boot is a single piece occupying the 256 first kbytes, then the environment is stored in the following 64kb block
The environment being quite tiny, we save one 64kb block by embedding the environment in the first 8kb block, hence allowing to increase the monitor size to 320kb.
--- board/cssi/MCR3000/u-boot.lds | 6 +++--- include/configs/MCR3000.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
board/cssi/MCR3000/u-boot.lds +3 -3
@@ -18,14 +18,14 @@ SECTIONS .text : { arch/powerpc/cpu/mpc8xx/start.o (.text) - arch/powerpc/cpu/mpc8xx/start.o (.text*) arch/powerpc/cpu/mpc8xx/traps.o (.text*) - arch/powerpc/cpu/mpc8xx/built-in.o (.text*) arch/powerpc/lib/built-in.o (.text*) board/cssi/MCR3000/built-in.o (.text*) - disk/built-in.o (.text*) drivers/net/built-in.o (.text*) + . = DEFINED(env_offset) ? env_offset : .; + env/embedded.o (.text.environment) + *(.text) } _etext = .;
include/configs/MCR3000.h +3 -3
@@ -93,15 +93,15 @@* the maximum mapped by the Linux kernel during initialization. */ #define CONFIG_SYS_BOOTMAPSZ (8 << 20) -#define CONFIG_SYS_MONITOR_LEN (256 << 10) +#define CONFIG_SYS_MONITOR_LEN (320 << 10)#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE#define CONFIG_SYS_MALLOC_LEN (4096 << 10)/* Environment Configuration */ /* environment is in FLASH */ -#define CONFIG_ENV_SECT_SIZE (64 * 1024) -#define CONFIG_ENV_OFFSET CONFIG_SYS_MONITOR_LEN +#define CONFIG_ENV_SECT_SIZE 0x2000 +#define CONFIG_ENV_OFFSET 0x4000#define CONFIG_ENV_OVERWRITE 1/* Ethernet configuration part */
Signature · 1 line
2.13.3
PATCH v4 13/16 board: MCR3000: Use smaller flash sector for environment
Quoted 10 lines · Christophe Leroy
Latest versions of u-boot have increased in size and require more than the 256kb allocated to it.
The MCR3000 board is equipped with an AM29LV160DB boot flash which is organised as follows:
- One 16kb block
- Two 8kb block
- One 32kb block
- Thirty one 64kb blocks
Quoted 8 lines
At the time being, u-boot is a single piece occupying the 256 first kbytes, then the environment is stored in the following 64kb block
The environment being quite tiny, we save one 64kb block by embedding the environment in the first 8kb block, hence allowing to increase the monitor size to 320kb.
Signed-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/0f8498f6/attachment.sig>
PATCH v4 14/16 powerpc: mpc8xx: refactorise reginfo
In reply to Christophe Leroyreginfo is redundant with some of the commands in immap.c, so move reginfo into that file and remove duplicated info.
--- arch/powerpc/cpu/mpc8xx/Makefile | 1 - arch/powerpc/cpu/mpc8xx/immap.c | 20 +++++++++++ arch/powerpc/cpu/mpc8xx/reginfo.c | 71 --------------------------------------- 3 files changed, 20 insertions(+), 72 deletions(-) delete mode 100644 arch/powerpc/cpu/mpc8xx/reginfo.c
arch/powerpc/cpu/mpc8xx/Makefile +0 -1
@@ -12,6 +12,5 @@ obj-y += cpu_init.o obj-$(CONFIG_OF_LIBFDT) += fdt.o obj-$(CONFIG_CMD_IMMAP) += immap.o obj-y += interrupts.o -obj-$(CONFIG_CMD_REGINFO) += reginfo.o obj-y += speed.o obj-y += cache.o
arch/powerpc/cpu/mpc8xx/immap.c +20 -0
@@ -342,6 +342,26 @@ static int do_brginfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])return 0 ; } +#ifdef CONFIG_CMD_REGINFO +void print_reginfo (void ) +{ +immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR ; +sit8xx_t __iomem *timers = &immap->im_sit; + +printf ("\nSystem Configuration registers\n" +"\tIMMR\t0x%08X\n" ,get_immr ()); +do_siuinfo (NULL ,0 ,0 ,NULL ); + +printf ("Memory Controller Registers\n" ); +do_memcinfo (NULL ,0 ,0 ,NULL ); + +printf ("\nSystem Integration Timers\n" ); +printf ("\tTBSCR\t0x%04X\tRTCSC\t0x%04X\n" , +in_be16 (&timers->sit_tbscr),in_be16 (&timers->sit_rtcsc)); +printf ("\tPISCR\t0x%04X\n" ,in_be16 (&timers->sit_piscr)); +} +#endif +/***************************************************/ U_BOOT_CMD(
arch/powerpc/cpu/mpc8xx/reginfo.c deleted +0 -71
71 lines not on this page · raw message
Signature · 1 line
2.13.3
PATCH v4 14/16 powerpc: mpc8xx: refactorise reginfo
Quoted 4 lines · Christophe Leroy
reginfo is redundant with some of the commands in
immap.c, so move reginfo into that file and remove duplicated info.Signed-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/5e42a15b/attachment.sig>
PATCH v4 15/16 powerpc: mpc8xx: cleaning up watchdog
In reply to Christophe LeroyIn preparation of migration to DM watchdog, clean up a bit.
The 8xx watchdog really is a HW watchdog, so declare it as is then it goes through Kconfig
And the watchdog reset doesn't mind getting interrupted, so no need to disable interrupts
--- arch/powerpc/Kconfig | 1 + arch/powerpc/cpu/mpc8xx/cpu.c | 19 +++---------------- arch/powerpc/cpu/mpc8xx/cpu_init.c | 9 +++++---- include/configs/MCR3000.h | 2 -- include/watchdog.h | 5 ----- 5 files changed, 9 insertions(+), 27 deletions(-)
arch/powerpc/Kconfig +1 -0
@@ -34,6 +34,7 @@ config MPC8xx bool "MPC8xx" select BOARD_EARLY_INIT_F imply CMD_REGINFO + imply HW_WATCHDOG endchoice
arch/powerpc/cpu/mpc8xx/cpu.c +3 -16
@@ -272,24 +272,11 @@ unsigned long get_tbclk(void)/* ------------------------------------------------------------------------- */ -#if defined(CONFIG_WATCHDOG ) -void watchdog_reset (void ) +#if defined(CONFIG_HW_WATCHDOG ) +void hw_watchdog_reset (void ) { -int re_enable =disable_interrupts (); +immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR ; -reset_8xx_watchdog ((immap_t __iomem *)CONFIG_SYS_IMMR ); -if (re_enable) -enable_interrupts (); -} -#endif /* CONFIG_WATCHDOG */ - -#if defined(CONFIG_WATCHDOG ) - -void reset_8xx_watchdog (immap_t __iomem *immr) -{ -/* -* All other boards use the MPC8xx Internal Watchdog -*/ out_be16 (&immr->im_siu_conf.sc_swsr,0x556c );/* write magic1 */ out_be16 (&immr->im_siu_conf.sc_swsr,0xaa39 );/* write magic2 */ }
arch/powerpc/cpu/mpc8xx/cpu_init.c +5 -4
@@ -26,11 +26,12 @@ void cpu_init_f(immap_t __iomem *immr)/* SYPCR - contains watchdog control (11-9) */ -out_be32 (&immr->im_siu_conf.sc_sypcr,CONFIG_SYS_SYPCR ); +#ifndef CONFIG_HW_WATCHDOG +/* deactivate watchdog if not enabled in config */ +out_be32 (&immr->im_siu_conf.sc_sypcr,CONFIG_SYS_SYPCR & ~SYPCR_SWE ); +#endif -#if defined(CONFIG_WATCHDOG ) -reset_8xx_watchdog (immr); -#endif /* CONFIG_WATCHDOG */ +WATCHDOG_RESET ();/* SIUMCR - contains debug pin configuration (11-6) */ setbits_be32 (&immr->im_siu_conf.sc_siumcr,CONFIG_SYS_SIUMCR );
include/configs/MCR3000.h +0 -2
@@ -60,8 +60,6 @@#define CONFIG_LOADS_ECHO 1/* echo on for serial download */ -#define CONFIG_WATCHDOG 1/* watchdog enabled */ -/* Miscellaneous configurable options */ #define CONFIG_SYS_MEMTEST_START 0x00002000
include/watchdog.h +0 -5
@@ -72,11 +72,6 @@ int init_func_watchdog_reset(void);* Prototypes from $(CPU)/cpu.c. */ -/* MPC 8xx */ -#if defined(CONFIG_MPC8xx) && !defined(__ASSEMBLY__) -void reset_8xx_watchdog (immap_t __iomem *immr); -#endif -#if defined(CONFIG_HW_WATCHDOG ) && !defined(__ASSEMBLY__)void hw_watchdog_init (void );#endif
Signature · 1 line
2.13.3
PATCH v4 15/16 powerpc: mpc8xx: cleaning up watchdog
Quoted 9 lines · Christophe Leroy
In preparation of migration to DM watchdog, clean up a bit.
The 8xx watchdog really is a HW watchdog, so declare it as is then it goes through
KconfigAnd the watchdog reset doesn't mind getting interrupted, so no need to disable interrupts
Signed-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/6d607cd2/attachment.sig>
PATCH v4 16/16 powerpc: mpc8xx: move watchdog into drivers/watchdog
In reply to Christophe LeroyIn preparation of DM watchdog, move basic actions into drivers/watchdog
--- arch/powerpc/Kconfig | 2 +- arch/powerpc/cpu/mpc8xx/Kconfig | 4 ++++ arch/powerpc/cpu/mpc8xx/cpu.c | 12 ------------ drivers/watchdog/Makefile | 1 + drivers/watchdog/mpc8xx_wdt.c | 21 +++++++++++++++++++++ 5 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 drivers/watchdog/mpc8xx_wdt.c
arch/powerpc/Kconfig +1 -1
@@ -34,7 +34,7 @@ config MPC8xx bool "MPC8xx" select BOARD_EARLY_INIT_F imply CMD_REGINFO - imply HW_WATCHDOG + imply MPC8xx_WATCHDOG endchoice
arch/powerpc/cpu/mpc8xx/Kconfig +4 -0
@@ -25,6 +25,10 @@ config MPC885 endchoice +config MPC8xx_WATCHDOG + bool "Watchdog" + select HW_WATCHDOG + config 8xx_GCLK_FREQ int "CPU GCLK Frequency"
arch/powerpc/cpu/mpc8xx/cpu.c +0 -12
@@ -270,18 +270,6 @@ unsigned long get_tbclk(void)return oscclk /16 ; } -/* ------------------------------------------------------------------------- */ - -#if defined(CONFIG_HW_WATCHDOG ) -void hw_watchdog_reset (void ) -{ -immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR ; - -out_be16 (&immr->im_siu_conf.sc_swsr,0x556c );/* write magic1 */ -out_be16 (&immr->im_siu_conf.sc_swsr,0xaa39 );/* write magic2 */ -} -#endif /* CONFIG_WATCHDOG */ -/* * Initializes on-chip ethernet controllers. * to override, implement board_eth_init()
drivers/watchdog/Makefile +1 -0
@@ -22,3 +22,4 @@ obj-$(CONFIG_WDT_ASPEED) += ast_wdt.o obj-$(CONFIG_WDT_BCM6345) += bcm6345_wdt.o obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o obj-$(CONFIG_WDT_ORION) += orion_wdt.o +obj-$(CONFIG_MPC8xx_WATCHDOG) += mpc8xx_wdt.o
drivers/watchdog/mpc8xx_wdt.c new file +21 -0
@@ -0,0 +1,21 @@ +/* +* Copyright 2017 CS Systemes d'Information +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <mpc8xx.h> +#include <asm/cpm_8xx.h> +#include <asm/io.h> + +DECLARE_GLOBAL_DATA_PTR ; + +void hw_watchdog_reset (void ) +{ +immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR ; + +out_be16 (&immap->im_siu_conf.sc_swsr,0x556c );/* write magic1 */ +out_be16 (&immap->im_siu_conf.sc_swsr,0xaa39 );/* write magic2 */ +} +
Signature · 1 line
2.13.3
PATCH v4 16/16 powerpc: mpc8xx: move watchdog into drivers/watchdog
Quoted 3 lines · Christophe Leroy
In preparation of DM watchdog, move basic actions into
drivers/watchdogSigned-off-by Christophe Leroy <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180406/82c9c8a2/attachment.sig>