[U-Boot] [PATCH v3 04/60] mpc83xx: Introduce ARCH_MPC834*

2019-01-21 Thread Mario Six
Replace CONFIG_MPC834* with proper CONFIG_ARCH_MPC834* Kconfig options.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 arch/powerpc/cpu/mpc83xx/Kconfig | 12 +++
 arch/powerpc/cpu/mpc83xx/cpu_init.c  |  2 +-
 arch/powerpc/cpu/mpc83xx/spd_sdram.c |  2 +-
 arch/powerpc/cpu/mpc83xx/speed.c | 22 ++--
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h |  2 +-
 arch/powerpc/include/asm/fsl_lbc.h   |  8 +++
 arch/powerpc/include/asm/global_data.h   |  6 +++---
 arch/powerpc/include/asm/immap_83xx.h|  6 +++---
 arch/powerpc/include/asm/mpc8xxx_spi.h   |  2 +-
 drivers/pci/pci_auto.c   |  2 +-
 drivers/pci/pci_auto_old.c   |  2 +-
 include/configs/MPC8349EMDS.h|  2 --
 include/configs/MPC8349ITX.h |  3 ---
 include/configs/TQM834x.h|  2 --
 include/configs/sbc8349.h|  2 --
 include/configs/vme8349.h|  2 --
 include/mpc83xx.h| 18 
 include/usb/ehci-ci.h|  2 +-
 scripts/config_whitelist.txt |  2 --
 19 files changed, 49 insertions(+), 50 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 1b9402e024b..6cca45e4026 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -14,6 +14,7 @@ config TARGET_MPC8308_P1M
 
 config TARGET_SBC8349
bool "Support sbc8349"
+   select ARCH_MPC8349
 
 config TARGET_VE8313
bool "Support ve8313"
@@ -21,6 +22,7 @@ config TARGET_VE8313
 
 config TARGET_VME8349
bool "Support vme8349"
+   select ARCH_MPC8349
 
 config TARGET_MPC8308RDB
bool "Support MPC8308RDB"
@@ -49,6 +51,7 @@ config TARGET_MPC832XEMDS
 
 config TARGET_MPC8349EMDS
bool "Support MPC8349EMDS"
+   select ARCH_MPC8349
select BOARD_EARLY_INIT_F
select SYS_FSL_DDR
select SYS_FSL_DDR_BE
@@ -56,6 +59,7 @@ config TARGET_MPC8349EMDS
 
 config TARGET_MPC8349ITX
bool "Support MPC8349ITX"
+   select ARCH_MPC8349
imply CMD_IRQ
 
 config TARGET_MPC837XEMDS
@@ -96,6 +100,7 @@ config TARGET_TUXX1
 
 config TARGET_TQM834X
bool "Support TQM834x"
+   select ARCH_MPC8349
 
 config TARGET_HRCON
bool "Support hrcon"
@@ -135,6 +140,13 @@ config ARCH_MPC8315
 config ARCH_MPC832X
bool
 
+config ARCH_MPC834X
+   bool
+
+config ARCH_MPC8349
+   bool
+   select ARCH_MPC834X
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c 
b/arch/powerpc/cpu/mpc83xx/cpu_init.c
index 7d8d5516b4c..7c378671feb 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
@@ -240,7 +240,7 @@ void cpu_init_f (volatile immap_t * im)
 
/* System General Purpose Register */
 #ifdef CONFIG_SYS_SICRH
-#if defined(CONFIG_MPC834x) || defined(CONFIG_ARCH_MPC8313)
+#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC8313)
/* regarding to MPC34x manual rev.1 bits 28..29 must be preserved */
__raw_writel((im->sysconf.sicrh & 0x000C) | CONFIG_SYS_SICRH,
 >sysconf.sicrh);
diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c 
b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
index 3f18aadf19b..b3cbf9f8823 100644
--- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c
+++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
@@ -426,7 +426,7 @@ long int spd_sdram()
 
/*
 * Errata DDR6 work around: input enable 2 cycles earlier.
-* including MPC834x Rev1.0/1.1 and MPC8360 Rev1.1/1.2.
+* including MPC834X Rev1.0/1.1 and MPC8360 Rev1.1/1.2.
 */
if(PVR_MAJ(pvr) <= 1 && spd.mem_type == SPD_MEMTYPE_DDR){
if (caslat == 2)
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index ab025af70d4..7cb6f3727df 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -86,14 +86,14 @@ int get_clocks(void)
 
u32 csb_clk;
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
-   defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
u32 tsec1_clk;
u32 tsec2_clk;
u32 usbdr_clk;
 #elif defined(CONFIG_ARCH_MPC8309)
u32 usbdr_clk;
 #endif
-#ifdef CONFIG_MPC834x
+#ifdef CONFIG_ARCH_MPC834X
u32 usbmph_clk;
 #endif
u32 core_clk;
@@ -156,7 +156,7 @@ int get_clocks(void)
sccr = im->clk.sccr;
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
-   defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
switch ((sccr & 

[U-Boot] [PATCH v3 33/60] powerpc: Migrate HIGH_BATS to Kconfig

2019-01-21 Thread Mario Six
Migrate the CONFIG_HIGH_BATS variable to Kconfig.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 arch/powerpc/Kconfig  | 6 ++
 configs/MPC8313ERDB_33_defconfig  | 1 +
 configs/MPC8313ERDB_66_defconfig  | 1 +
 configs/MPC8313ERDB_NAND_33_defconfig | 1 +
 configs/MPC8313ERDB_NAND_66_defconfig | 1 +
 configs/MPC8315ERDB_defconfig | 1 +
 configs/MPC8323ERDB_defconfig | 1 +
 configs/MPC832XEMDS_ATM_defconfig | 1 +
 configs/MPC832XEMDS_HOST_33_defconfig | 1 +
 configs/MPC832XEMDS_HOST_66_defconfig | 1 +
 configs/MPC832XEMDS_SLAVE_defconfig   | 1 +
 configs/MPC832XEMDS_defconfig | 1 +
 configs/MPC8349EMDS_PCI64_defconfig   | 1 +
 configs/MPC8349EMDS_SDRAM_defconfig   | 1 +
 configs/MPC8349EMDS_SLAVE_defconfig   | 1 +
 configs/MPC8349EMDS_defconfig | 1 +
 configs/MPC8349ITXGP_defconfig| 1 +
 configs/MPC8349ITX_LOWBOOT_defconfig  | 1 +
 configs/MPC8349ITX_defconfig  | 1 +
 configs/MPC837XEMDS_HOST_defconfig| 1 +
 configs/MPC837XEMDS_defconfig | 1 +
 configs/MPC837XERDB_defconfig | 1 +
 configs/MPC8610HPCD_defconfig | 1 +
 configs/MPC8641HPCN_36BIT_defconfig   | 1 +
 configs/MPC8641HPCN_defconfig | 1 +
 configs/TQM834x_defconfig | 1 +
 configs/caddy2_defconfig  | 1 +
 configs/ids8313_defconfig | 1 +
 configs/kmcoge5ne_defconfig   | 1 +
 configs/kmopti2_defconfig | 1 +
 configs/kmsupx5_defconfig | 1 +
 configs/kmtegr1_defconfig | 1 +
 configs/kmtepr2_defconfig | 1 +
 configs/kmvect1_defconfig | 1 +
 configs/sbc8349_PCI_33_defconfig  | 1 +
 configs/sbc8349_PCI_66_defconfig  | 1 +
 configs/sbc8349_defconfig | 1 +
 configs/sbc8641d_defconfig| 1 +
 configs/suvd3_defconfig   | 1 +
 configs/tuge1_defconfig   | 1 +
 configs/tuxx1_defconfig   | 1 +
 configs/ve8313_defconfig  | 1 +
 configs/vme8349_defconfig | 1 +
 configs/xpedite517x_defconfig | 1 +
 include/configs/MPC8313ERDB_NAND.h| 2 --
 include/configs/MPC8313ERDB_NOR.h | 2 --
 include/configs/MPC8315ERDB.h | 1 -
 include/configs/MPC8323ERDB.h | 1 -
 include/configs/MPC832XEMDS.h | 2 --
 include/configs/MPC8349EMDS.h | 1 -
 include/configs/MPC8349EMDS_SDRAM.h   | 1 -
 include/configs/MPC8349ITX.h  | 1 -
 include/configs/MPC837XEMDS.h | 1 -
 include/configs/MPC837XERDB.h | 2 --
 include/configs/MPC8610HPCD.h | 1 -
 include/configs/MPC8641HPCN.h | 1 -
 include/configs/TQM834x.h | 2 --
 include/configs/caddy2.h  | 2 --
 include/configs/ids8313.h | 1 -
 include/configs/kmcoge5ne.h   | 2 --
 include/configs/kmeter1.h | 2 --
 include/configs/kmopti2.h | 2 --
 include/configs/kmsupx5.h | 2 --
 include/configs/kmtegr1.h | 2 --
 include/configs/kmtepr2.h | 2 --
 include/configs/kmvect1.h | 2 --
 include/configs/sbc8349.h | 2 --
 include/configs/sbc8641d.h| 1 -
 include/configs/suvd3.h   | 2 --
 include/configs/tuge1.h   | 2 --
 include/configs/tuxx1.h   | 2 --
 include/configs/ve8313.h  | 2 --
 include/configs/vme8349.h | 2 --
 include/configs/xpedite517x.h | 1 -
 scripts/config_whitelist.txt  | 1 -
 75 files changed, 49 insertions(+), 50 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index c727d9162c4..ab9eefef153 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -39,6 +39,12 @@ config MPC8xx
 
 endchoice
 
+config HIGH_BATS
+   bool "Enable high BAT registers"
+   help
+ Enable BATs (block address translation registers) 4-7 on machines
+ that support them.
+
 source "arch/powerpc/cpu/mpc83xx/Kconfig"
 source "arch/powerpc/cpu/mpc85xx/Kconfig"
 source "arch/powerpc/cpu/mpc86xx/Kconfig"
diff --git a/configs/MPC8313ERDB_33_defconfig b/configs/MPC8313ERDB_33_defconfig
index c99d7399966..641c6c8545b 100644
--- a/configs/MPC8313ERDB_33_defconfig
+++ b/configs/MPC8313ERDB_33_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_SYS_CLK_FREQ=
 CONFIG_MPC83xx=y
+CONFIG_HIGH_BATS=y
 CONFIG_TARGET_MPC8313ERDB_NOR=y
 CONFIG_SYSTEM_PLL_FACTOR_5_1=y
 CONFIG_CORE_PLL_RATIO_2_1=y
diff --git a/configs/MPC8313ERDB_66_defconfig b/configs/MPC8313ERDB_66_defconfig
index c1eb49af7bc..b1a4bcbc538 100644
--- a/configs/MPC8313ERDB_66_defconfig
+++ b/configs/MPC8313ERDB_66_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_SYS_CLK_FREQ=6667
 CONFIG_MPC83xx=y
+CONFIG_HIGH_BATS=y
 CONFIG_TARGET_MPC8313ERDB_NOR=y
 CONFIG_CORE_PLL_RATIO_2_1=y
 CONFIG_PCI_HOST_MODE_ENABLE=y
diff --git 

[U-Boot] [PATCH v3 58/60] mpc83xx: Use pre-defined asm functions

2019-01-21 Thread Mario Six
For a lot of inline assembly calls in the mpc8xxx and mpc83xx
directories, we already have convenient pre-defined helper functions,
but they're not used, resulting in hard-to-read code.

Use these helper functions where ever possible and useful.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/cpu.c   | 19 +++
 arch/powerpc/cpu/mpc83xx/ecc.c   | 36 ++--
 arch/powerpc/cpu/mpc83xx/spd_sdram.c | 36 +---
 arch/powerpc/cpu/mpc8xxx/fsl_pamu.c  | 12 +-
 arch/powerpc/lib/cache.c |  6 ++---
 5 files changed, 63 insertions(+), 46 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index 9c67099a17a..3048ecf34ad 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -133,18 +133,18 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
 #ifdef MPC83xx_RESET
 
/* Interrupts and MMU off */
-   __asm__ __volatile__ ("mfmsr%0":"=r" (msr):);
-
-   msr &= ~( MSR_EE | MSR_IR | MSR_DR);
-   __asm__ __volatile__ ("mtmsr%0"::"r" (msr));
+   msr = mfmsr();
+   msr &= ~(MSR_EE | MSR_IR | MSR_DR);
+   mtmsr(msr);
 
/* enable Reset Control Reg */
immap->reset.rpr = 0x52535445;
-   __asm__ __volatile__ ("sync");
-   __asm__ __volatile__ ("isync");
+   sync();
+   isync();
 
/* confirm Reset Control Reg is enabled */
-   while(!((immap->reset.rcer) & RCER_CRE));
+   while(!((immap->reset.rcer) & RCER_CRE))
+   ;
 
udelay(200);
 
@@ -156,10 +156,9 @@ do_reset (cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
immap->reset.rmr = RMR_CSRE;/* Checkstop Reset enable */
 
/* Interrupts and MMU off */
-   __asm__ __volatile__ ("mfmsr%0":"=r" (msr):);
-
+   msr = mfmsr();
msr &= ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR);
-   __asm__ __volatile__ ("mtmsr%0"::"r" (msr));
+   mtmsr(msr);
 
/*
 * Trying to execute the next instruction at a non-existing address
diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c
index 73f0be2a30e..10e9b96add1 100644
--- a/arch/powerpc/cpu/mpc83xx/ecc.c
+++ b/arch/powerpc/cpu/mpc83xx/ecc.c
@@ -191,8 +191,8 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
}
 
ddr->err_disable = val;
-   __asm__ __volatile__("sync");
-   __asm__ __volatile__("isync");
+   sync();
+   isync();
return 0;
} else if (strcmp(argv[1], "errdetectclr") == 0) {
val = ddr->err_detect;
@@ -249,8 +249,8 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
printf("Incorrect command\n");
 
ddr->ecc_err_inject = val;
-   __asm__ __volatile__("sync");
-   __asm__ __volatile__("isync");
+   sync();
+   isync();
return 0;
} else if (strcmp(argv[1], "mirror") == 0) {
val = ddr->ecc_err_inject;
@@ -282,26 +282,26 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
 
/* enable injects */
ddr->ecc_err_inject |= ECC_ERR_INJECT_EIEN;
-   __asm__ __volatile__("sync");
-   __asm__ __volatile__("isync");
+   sync();
+   isync();
 
/* write memory location injecting errors */
ppcDWstore((u32 *) i, pattern);
-   __asm__ __volatile__("sync");
+   sync();
 
/* disable injects */
ddr->ecc_err_inject &= ~ECC_ERR_INJECT_EIEN;
-   __asm__ __volatile__("sync");
-   __asm__ __volatile__("isync");
+   sync();
+   isync();
 
/* read data, this generates ECC error */
ppcDWload((u32 *) i, ret);
-   __asm__ __volatile__("sync");
+   sync();
 
/* re-initialize memory, double word write the 
location again,
 * generates new ECC code this time */
ppcDWstore((u32 *) i, writeback);
-   __asm__ __volatile__("sync");
+   sync();
}
   

[U-Boot] [PATCH v3 57/60] mpc83xx: Replace ppcDWstore with inline assembly

2019-01-21 Thread Mario Six
ppcDWstore/ppcDWload are hardly used by any board, but since they're
implemented in start.S, they're always present in every U-Boot image,
even if they're not needed.

Re-implement these fuctions in C with inline assembly, so that the
compiler can decide when to actually include them.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/cpu.c   | 18 ++
 arch/powerpc/cpu/mpc83xx/start.S | 12 
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index 4ea4249aff0..9c67099a17a 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -229,3 +229,21 @@ int cpu_mmc_init(bd_t *bis)
return 0;
 #endif
 }
+
+void ppcDWstore(unsigned int *addr, unsigned int *value)
+{
+   asm("lfd 1, 0(%1)\n\t"
+   "stfd 1, 0(%0)"
+   :
+   : "r" (addr), "r" (value)
+   : "memory");
+}
+
+void ppcDWload(unsigned int *addr, unsigned int *ret)
+{
+   asm("lfd 1, 0(%0)\n\t"
+   "stfd 1, 0(%1)"
+   :
+   : "r" (addr), "r" (ret)
+   : "memory");
+}
diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S
index 4df22f64fec..ee8c2e68dda 100644
--- a/arch/powerpc/cpu/mpc83xx/start.S
+++ b/arch/powerpc/cpu/mpc83xx/start.S
@@ -119,18 +119,6 @@ disable_addr_trans:
mtspr   SRR1, r3
rfi
 
-   .globl  ppcDWstore
-ppcDWstore:
-   lfd 1, 0(r4)
-   stfd1, 0(r3)
-   blr
-
-   .globl  ppcDWload
-ppcDWload:
-   lfd 1, 0(r3)
-   stfd1, 0(r4)
-   blr
-
 #ifndef CONFIG_DEFAULT_IMMR
 #error CONFIG_DEFAULT_IMMR must be defined
 #endif /* CONFIG_DEFAULT_IMMR */
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [linux-sunxi] [PATCH 2/9] sunxi: clk: A80: add MMC clock support

2019-01-21 Thread Chen-Yu Tsai
On Mon, Jan 21, 2019 at 5:32 PM Jagan Teki  wrote:
>
> On Sat, Jan 19, 2019 at 7:02 AM Andre Przywara  wrote:
> >
> > The A80 handles resets and clock gates for the MMC devices differently,
> > outside of the CCU IP block. Consequently we have a separate clock
> > device with a separate binding for that.
> >
> > Implement that with the respective clock gates and resets to allow the
> > A80 taking part in the DM_MMC game.
> >
> > Signed-off-by: Andre Przywara 
> > ---
> >  drivers/clk/sunxi/clk_a80.c | 28 +++-
> >  1 file changed, 27 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/sunxi/clk_a80.c b/drivers/clk/sunxi/clk_a80.c
> > index d6dd6a1fa1..2bfc2ca9f5 100644
> > --- a/drivers/clk/sunxi/clk_a80.c
> > +++ b/drivers/clk/sunxi/clk_a80.c
> > @@ -30,19 +30,45 @@ static const struct ccu_reset a80_resets[] = {
> > [RST_BUS_UART5] = RESET(0x5b4, BIT(21)),
> >  };
> >
> > +static const struct ccu_clk_gate a80_mmc_gates[] = {
> > +   [0] = GATE(0x0, BIT(16)),
> > +   [1] = GATE(0x4, BIT(16)),
> > +   [2] = GATE(0x8, BIT(16)),
> > +   [3] = GATE(0xc, BIT(16)),
> > +};
> > +
> > +static const struct ccu_reset a80_mmc_resets[] = {
> > +   [0] = GATE(0x0, BIT(18)),
> > +   [1] = GATE(0x4, BIT(18)),
> > +   [2] = GATE(0x8, BIT(18)),
> > +   [3] = GATE(0xc, BIT(18)),
> > +};
> > +
> >  static const struct ccu_desc a80_ccu_desc = {
> > .gates = a80_gates,
> > .resets = a80_resets,
> >  };
> >
> > +static const struct ccu_desc a80_mmc_clk_desc = {
> > +   .gates = a80_mmc_gates,
> > +   .resets = a80_mmc_resets,
> > +};
> > +
> >  static int a80_clk_bind(struct udevice *dev)
> >  {
> > -   return sunxi_reset_bind(dev, ARRAY_SIZE(a80_resets));
> > +   ulong count = ARRAY_SIZE(a80_resets);
> > +
> > +   if (device_is_compatible(dev, "allwinner,allwinner,sun9i-a80-mmc"))
> > +   count = ARRAY_SIZE(a80_mmc_resets);
> > +
> > +   return sunxi_reset_bind(dev, count);
> >  }
> >
> >  static const struct udevice_id a80_ccu_ids[] = {
> > { .compatible = "allwinner,sun9i-a80-ccu",
> >   .data = (ulong)_ccu_desc },
> > +   { .compatible = "allwinner,allwinner,sun9i-a80-mmc",
>
> This can be "allwinner,sun9i-a80-mmc-config-clk"

*Must*, not can. :)

ChenYu
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] board: mvebu: drop unused ETH_PHY macro definitions

2019-01-21 Thread Stefan Roese

On 02.01.19 17:26, Baruch Siach wrote:

These macros are not used anywhere in the boards code.

Cc: Chris Packham 
Cc: Dirk Eibach 
Cc: Mario Six 
Cc: Dennis Gilmore 
Signed-off-by: Baruch Siach 
---
  board/Marvell/db-88f6820-amc/db-88f6820-amc.c | 4 
  board/Marvell/db-88f6820-gp/db-88f6820-gp.c   | 4 
  board/gdsys/a38x/controlcenterdc.c| 4 
  board/kobol/helios4/helios4.c | 4 
  board/solidrun/clearfog/clearfog.c| 4 
  5 files changed, 20 deletions(-)


Applied to u-boot-marvell/master

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/1] arm64: mvebu: defconfig: enable CONFIG_CMD_NVME

2019-01-21 Thread Stefan Roese

On 26.12.18 10:37, Heinrich Schuchardt wrote:

An NVME drive may be installed on the MACCHIATObin board using the PCIe
slot or on the Clearfog Pro using mini a PCI-e slot. With the configuration
change it becomes usable.

Signed-off-by: Heinrich Schuchardt 
---
  configs/clearfog_gt_8k_defconfig  | 2 ++
  configs/mvebu_db_armada8k_defconfig   | 2 ++
  configs/mvebu_mcbin-88f8040_defconfig | 2 ++
  3 files changed, 6 insertions(+)


Applied to u-boot-marvell/master

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/1] arm64: dts: marvell: armada-ap806: reserve PSCI area

2019-01-21 Thread Stefan Roese

On 21.12.18 17:30, Heinrich Schuchardt wrote:

The memory area [0x400-0x420[ is occupied by the PSCI firmware. Any
attempt to access it from U-Boot leads to an immediate crash.

So let's make the same memory reservation as the vendor device tree.

Signed-off-by: Heinrich Schuchardt 
---
cf. https://lkml.org/lkml/2018/12/21/253

v3
Move change from armada-8040-mcbin.dts to armada-ap806.dtsi.
I only have a MACCHIATObin for testing. But in
https://github.com/MarvellEmbeddedProcessors/linux-marvell
it is done in the same way.
v2
add missing right brace

---
  arch/arm/dts/armada-ap806.dtsi | 11 +++
  1 file changed, 11 insertions(+)


Applied to u-boot-marvell/master

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 06/60] mpc83xx: Introduce ARCH_MPC837X

2019-01-21 Thread Mario Six
Replace CONFIG_MPC837x with a proper CONFIG_ARCH_MPC837X Kconfig option.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 arch/powerpc/cpu/mpc83xx/Kconfig |  5 
 arch/powerpc/cpu/mpc83xx/speed.c | 30 ++--
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h |  2 +-
 arch/powerpc/include/asm/global_data.h   |  6 ++--
 arch/powerpc/include/asm/immap_83xx.h|  2 +-
 arch/powerpc/include/asm/mpc8xxx_spi.h   |  2 +-
 drivers/ram/mpc83xx_sdram.c  |  8 +++---
 include/configs/MPC837XEMDS.h|  1 -
 include/configs/MPC837XERDB.h|  1 -
 include/mpc83xx.h| 24 
 scripts/config_whitelist.txt |  1 -
 11 files changed, 42 insertions(+), 40 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 5f9d036e371..e41f4d1f9a3 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -64,12 +64,14 @@ config TARGET_MPC8349ITX
 
 config TARGET_MPC837XEMDS
bool "Support MPC837XEMDS"
+   select ARCH_MPC837X
select BOARD_EARLY_INIT_F
imply CMD_SATA
imply FSL_SATA
 
 config TARGET_MPC837XERDB
bool "Support MPC837XERDB"
+   select ARCH_MPC837X
select BOARD_EARLY_INIT_F
 
 config TARGET_IDS8313
@@ -151,6 +153,9 @@ config ARCH_MPC8349
 config ARCH_MPC8360
bool
 
+config ARCH_MPC837X
+   bool
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index ed77675a8ea..668ed27862b 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -86,7 +86,7 @@ int get_clocks(void)
 
u32 csb_clk;
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
-   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
u32 tsec1_clk;
u32 tsec2_clk;
u32 usbdr_clk;
@@ -123,11 +123,11 @@ int get_clocks(void)
u32 brg_clk;
 #endif
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
-   defined(CONFIG_MPC837x)
+   defined(CONFIG_ARCH_MPC837X)
u32 pciexp1_clk;
u32 pciexp2_clk;
 #endif
-#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
+#if defined(CONFIG_ARCH_MPC837X) || defined(CONFIG_ARCH_MPC8315)
u32 sata_clk;
 #endif
 
@@ -156,7 +156,7 @@ int get_clocks(void)
sccr = im->clk.sccr;
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
-   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
switch ((sccr & SCCR_TSEC1CM) >> SCCR_TSEC1CM_SHIFT) {
case 0:
tsec1_clk = 0;
@@ -177,7 +177,7 @@ int get_clocks(void)
 #endif
 
 #if defined(CONFIG_ARCH_MPC830X) || defined(CONFIG_ARCH_MPC831X) || \
-   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
switch ((sccr & SCCR_USBDRCM) >> SCCR_USBDRCM_SHIFT) {
case 0:
usbdr_clk = 0;
@@ -198,7 +198,7 @@ int get_clocks(void)
 #endif
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315) || \
-   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
switch ((sccr & SCCR_TSEC2CM) >> SCCR_TSEC2CM_SHIFT) {
case 0:
tsec2_clk = 0;
@@ -321,7 +321,7 @@ int get_clocks(void)
i2c1_clk = enc_clk;
 #elif defined(CONFIG_FSL_ESDHC)
i2c1_clk = sdhc_clk;
-#elif defined(CONFIG_MPC837x)
+#elif defined(CONFIG_ARCH_MPC837X)
i2c1_clk = enc_clk;
 #elif defined(CONFIG_ARCH_MPC8309)
i2c1_clk = csb_clk;
@@ -331,7 +331,7 @@ int get_clocks(void)
 #endif
 
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
-   defined(CONFIG_MPC837x)
+   defined(CONFIG_ARCH_MPC837X)
switch ((sccr & SCCR_PCIEXP1CM) >> SCCR_PCIEXP1CM_SHIFT) {
case 0:
pciexp1_clk = 0;
@@ -369,7 +369,7 @@ int get_clocks(void)
}
 #endif
 
-#if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
+#if defined(CONFIG_ARCH_MPC837X) || defined(CONFIG_ARCH_MPC8315)
switch ((sccr & SCCR_SATA1CM) >> SCCR_SATA1CM_SHIFT) {
case 0:
sata_clk = 0;
@@ -449,7 +449,7 @@ int get_clocks(void)
 
gd->arch.csb_clk = csb_clk;
 #if defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X) || \
-   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC837x)
+   defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
gd->arch.tsec1_clk = tsec1_clk;
gd->arch.tsec2_clk = tsec2_clk;

[U-Boot] [PATCH v3 18/60] mpc8315erdb: Merge BR/OR settings

2019-01-21 Thread Mario Six
The mpc8315erdb has the option of either configuring the eLBC (enhanced
local system bus) such that

* NOR flash is the first memory bank, and NAND flash is the second
  memory bank, or
* NAND flash is the first memory bank, and NOR flash is the second
  memory bank,

by using CONFIG_SYS_NOR_{BR,OR}_PRELIM and
CONFIG_SYS_NAND_{BR,OR}_PRELIM for defining
CONFIG_SYS_{BR,OR}{0,1}_PRELIM.

After Kconfig migration, replacing some lines in the defconfig will have
the same effect.

Hence, we will not create distinct ve8313_{NOR,NAND} configs for such a small 
change.

Instead, fix the current default (NOR first, NAND second), and unroll
the CONFIG_SYS_NAND_{BR,OR}_PRELIM options. This will ease the Kconfig
migration.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 include/configs/MPC8315ERDB.h | 40 +--
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index b8506321af3..a2b5b07ea9c 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -191,20 +191,6 @@
 #define CONFIG_SYS_LBLAWBAR0_PRELIMCONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_8MB)
 
-#define CONFIG_SYS_NOR_BR_PRELIM   (CONFIG_SYS_FLASH_BASE \
-   | BR_PS_16  /* 16 bit port */ \
-   | BR_MS_GPCM/* MSEL = GPCM */ \
-   | BR_V) /* valid */
-#define CONFIG_SYS_NOR_OR_PRELIM   (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
-   | OR_UPM_XAM \
-   | OR_GPCM_CSNT \
-   | OR_GPCM_ACS_DIV2 \
-   | OR_GPCM_XACS \
-   | OR_GPCM_SCY_15 \
-   | OR_GPCM_TRLX_SET \
-   | OR_GPCM_EHTR_SET \
-   | OR_GPCM_EAD)
-
 #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */
 /* 127 64KB sectors and 8 8KB top sectors per device */
 #define CONFIG_SYS_MAX_FLASH_SECT  135
@@ -236,13 +222,26 @@
 #define CONFIG_SYS_NAND_U_BOOT_OFFS  16384
 #define CONFIG_SYS_NAND_U_BOOT_RELOC 0x0001
 
-#define CONFIG_SYS_NAND_BR_PRELIM  (CONFIG_SYS_NAND_BASE \
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE \
+   | BR_PS_16  /* 16 bit port */ \
+   | BR_MS_GPCM/* MSEL = GPCM */ \
+   | BR_V) /* valid */
+#define CONFIG_SYS_OR0_PRELIM (OR_AM_8MB \
+   | OR_UPM_XAM \
+   | OR_GPCM_CSNT \
+   | OR_GPCM_ACS_DIV2 \
+   | OR_GPCM_XACS \
+   | OR_GPCM_SCY_15 \
+   | OR_GPCM_TRLX_SET \
+   | OR_GPCM_EHTR_SET \
+   | OR_GPCM_EAD)
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_NAND_BASE \
| BR_DECC_CHK_GEN   /* Use HW ECC */ \
| BR_PS_8   /* 8 bit port */ \
| BR_MS_FCM /* MSEL = FCM */ \
| BR_V) /* valid */
-#define CONFIG_SYS_NAND_OR_PRELIM  \
-   (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
+#define CONFIG_SYS_OR1_PRELIM \
+   (OR_AM_32KB \
| OR_FCM_CSCT \
| OR_FCM_CST \
| OR_FCM_CHT \
@@ -251,10 +250,9 @@
| OR_FCM_EHTR)
/* 0x8396 */
 
-#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM
-#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM
-#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM
-#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM
+/* Still needed for spl_minimal.c */
+#define CONFIG_SYS_NAND_BR_PRELIM CONFIG_SYS_BR1_PRELIM
+#define CONFIG_SYS_NAND_OR_PRELIM CONFIG_SYS_OR1_PRELIM
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIMCONFIG_SYS_NAND_BASE
 #define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 30/60] mpc83xx: Get rid of CONFIG_83XX_CLKIN

2019-01-21 Thread Mario Six
MPC83xx uses CONFIG_83XX_CLKIN instead of CONFIG_SYS_CLK_FREQ to set the
system clock. To migrate the architecture, we can replace
CONFIG_83XX_CLKIN with CONFIG_SYS_CLK_FREQ.

To do this
* replace all occurrences of CONFIG_83XX_CLKIN with CONFIG_SYS_CLK_FREQ
* set CONFIG_SYS_CLK_FREQ to the old value of CONFIG_83XX_CLKIN in all
  MPC83xx config files

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 Kconfig |  2 +-
 arch/powerpc/cpu/mpc83xx/speed.c|  4 +--
 arch/powerpc/cpu/mpc83xx/spl_minimal.c  |  2 +-
 board/freescale/mpc8349emds/MAINTAINERS |  1 +
 board/freescale/mpc837xerdb/MAINTAINERS |  1 +
 board/tqc/tqm834x/pci.c |  2 +-
 configs/MPC8308RDB_defconfig|  1 +
 configs/MPC8313ERDB_33_defconfig|  1 +
 configs/MPC8313ERDB_66_defconfig|  1 +
 configs/MPC8313ERDB_NAND_33_defconfig   |  1 +
 configs/MPC8313ERDB_NAND_66_defconfig   |  1 +
 configs/MPC8315ERDB_defconfig   |  1 +
 configs/MPC8323ERDB_defconfig   |  1 +
 configs/MPC832XEMDS_ATM_defconfig   |  1 +
 configs/MPC832XEMDS_HOST_33_defconfig   |  1 +
 configs/MPC832XEMDS_HOST_66_defconfig   |  1 +
 configs/MPC832XEMDS_SLAVE_defconfig |  1 +
 configs/MPC832XEMDS_defconfig   |  1 +
 configs/MPC8349EMDS_SDRAM_defconfig |  1 +
 configs/MPC8349EMDS_SLAVE_defconfig | 25 ++
 configs/MPC8349EMDS_defconfig   |  1 +
 configs/MPC8349ITXGP_defconfig  |  2 ++
 configs/MPC8349ITX_LOWBOOT_defconfig|  1 +
 configs/MPC8349ITX_defconfig|  1 +
 configs/MPC837XEMDS_HOST_defconfig  |  1 +
 configs/MPC837XEMDS_defconfig   |  1 +
 configs/MPC837XERDB_SLAVE_defconfig | 34 +
 configs/MPC837XERDB_defconfig   |  2 ++
 configs/TQM834x_defconfig   |  1 +
 configs/caddy2_defconfig|  1 +
 configs/hrcon_defconfig |  1 +
 configs/hrcon_dh_defconfig  |  1 +
 configs/ids8313_defconfig   |  1 +
 configs/kmcoge5ne_defconfig |  1 +
 configs/kmeter1_defconfig   |  1 +
 configs/kmopti2_defconfig   |  1 +
 configs/kmsupx5_defconfig   |  1 +
 configs/kmtegr1_defconfig   |  1 +
 configs/kmtepr2_defconfig   |  1 +
 configs/kmvect1_defconfig   |  1 +
 configs/mpc8308_p1m_defconfig   |  1 +
 configs/sbc8349_PCI_33_defconfig|  1 +
 configs/sbc8349_PCI_66_defconfig|  1 +
 configs/sbc8349_defconfig   |  1 +
 configs/strider_con_defconfig   |  1 +
 configs/strider_con_dp_defconfig|  1 +
 configs/strider_cpu_defconfig   |  1 +
 configs/strider_cpu_dp_defconfig|  1 +
 configs/suvd3_defconfig |  1 +
 configs/tuge1_defconfig |  1 +
 configs/tuxx1_defconfig |  1 +
 configs/ve8313_defconfig|  1 +
 configs/vme8349_defconfig   |  1 +
 include/configs/MPC8308RDB.h|  6 -
 include/configs/MPC8313ERDB_NAND.h  | 17 +
 include/configs/MPC8313ERDB_NOR.h   | 15 +--
 include/configs/MPC8315ERDB.h   |  6 -
 include/configs/MPC8323ERDB.h   |  9 ---
 include/configs/MPC832XEMDS.h   | 13 --
 include/configs/MPC8349EMDS.h   | 19 ++
 include/configs/MPC8349EMDS_SDRAM.h | 19 ++
 include/configs/MPC8349ITX.h|  7 -
 include/configs/MPC837XEMDS.h   | 13 --
 include/configs/MPC837XERDB.h   | 14 --
 include/configs/TQM834x.h   |  3 ---
 include/configs/caddy2.h| 11 
 include/configs/hrcon.h |  6 -
 include/configs/ids8313.h   |  3 ---
 include/configs/kmeter1.h   |  7 -
 include/configs/mpc8308_p1m.h   |  6 -
 include/configs/sbc8349.h   | 16 
 include/configs/strider.h   |  6 -
 include/configs/ve8313.h|  4 ---
 include/configs/vme8349.h   |  9 ---
 74 files changed, 119 insertions(+), 208 deletions(-)
 create mode 100644 configs/MPC8349EMDS_SLAVE_defconfig
 create mode 100644 configs/MPC837XERDB_SLAVE_defconfig

diff --git a/Kconfig b/Kconfig
index 48c62e1c025..119f322bbe0 100644
--- a/Kconfig
+++ b/Kconfig
@@ -484,7 +484,7 @@ config SYS_TEXT_BASE
 
 
 config SYS_CLK_FREQ
-   depends on ARC || ARCH_SUNXI
+   depends on ARC || ARCH_SUNXI || MPC83xx
int "CPU clock frequency"
help
  TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index 668ed27862b..e870a23103b 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -137,8 +137,8 @@ int get_clocks(void)
clkin_div = ((im->clk.spmr & SPMR_CKID) >> 

[U-Boot] [PATCH v3 20/60] MPC832XEMDS: Migrate to CONFIG_TARGET_MPC832XEMDS

2019-01-21 Thread Mario Six
Use the proper CONFIG_TARGET_MPC832XEMDS Kconfig option to replace the
CONFIG_MPC832XEMDS ad-hoc config option.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 board/freescale/common/pq-mds-pib.c | 6 +++---
 include/configs/MPC832XEMDS.h   | 1 -
 scripts/config_whitelist.txt| 1 -
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/board/freescale/common/pq-mds-pib.c 
b/board/freescale/common/pq-mds-pib.c
index d152a7821f4..ae660398575 100644
--- a/board/freescale/common/pq-mds-pib.c
+++ b/board/freescale/common/pq-mds-pib.c
@@ -36,7 +36,7 @@ int pib_init(void)
i2c_write(0x26, 0x6, 1, , 1);
val8 = 0x34;
i2c_write(0x26, 0x7, 1, , 1);
-#if defined(CONFIG_MPC832XEMDS)
+#if defined(CONFIG_TARGET_MPC832XEMDS)
val8 = 0xf9;/* PMC2, PMC3 slot to PCI bus */
 #else
val8 = 0xf3;/* PMC1, PMC2, PMC3 slot to PCI bus */
@@ -55,7 +55,7 @@ int pib_init(void)
 
eieio();
 
-#if defined(CONFIG_MPC832XEMDS)
+#if defined(CONFIG_TARGET_MPC832XEMDS)
printf("PCI 32bit bus on PMC2 \n");
 #else
printf("PCI 32bit bus on PMC1 & PMC2 \n");
@@ -76,7 +76,7 @@ int pib_init(void)
eieio();
 
printf("QOC3 ATM card on PMC0\n");
-#elif defined(CONFIG_MPC832XEMDS)
+#elif defined(CONFIG_TARGET_MPC832XEMDS)
val8 = 0;
i2c_write(0x26, 0x7, 1, , 1);
val8 = 0xf7;
diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h
index 0bb7db9bc37..4cb595bb8e5 100644
--- a/include/configs/MPC832XEMDS.h
+++ b/include/configs/MPC832XEMDS.h
@@ -11,7 +11,6 @@
  */
 #define CONFIG_E3001   /* E300 family */
 #define CONFIG_QE  1   /* Has QE */
-#define CONFIG_MPC832XEMDS 1   /* MPC832XEMDS board specific */
 
 /*
  * System Clock Setup
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 6f031c22033..cae3f97c5ce 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1250,7 +1250,6 @@ CONFIG_MMU
 CONFIG_MONITOR_IS_IN_RAM
 CONFIG_MPC8313ERDB
 CONFIG_MPC8315ERDB
-CONFIG_MPC832XEMDS
 CONFIG_MPC8349ITX
 CONFIG_MPC837XEMDS
 CONFIG_MPC837XERDB
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 49/60] mpc83xx: Migrate arbiter config to Kconfig

2019-01-21 Thread Mario Six
Migrate the arbiter configuration to Kconfig.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/Kconfig   |   1 +
 arch/powerpc/cpu/mpc83xx/arbiter/Kconfig   | 139 +
 arch/powerpc/cpu/mpc83xx/arbiter/arbiter.h |  28 +
 arch/powerpc/cpu/mpc83xx/cpu_init.c|  29 +
 arch/powerpc/cpu/mpc83xx/spl_minimal.c |   8 +-
 configs/MPC8308RDB_defconfig   |   2 +
 configs/MPC8313ERDB_33_defconfig   |   2 +
 configs/MPC8313ERDB_66_defconfig   |   2 +
 configs/MPC8313ERDB_NAND_33_defconfig  |   2 +
 configs/MPC8313ERDB_NAND_66_defconfig  |   2 +
 configs/MPC8315ERDB_defconfig  |   2 +
 configs/MPC8323ERDB_defconfig  |   2 +
 configs/MPC8349EMDS_PCI64_defconfig|   2 +
 configs/MPC8349EMDS_SDRAM_defconfig|   2 +
 configs/MPC8349EMDS_SLAVE_defconfig|   2 +
 configs/MPC8349EMDS_defconfig  |   2 +
 configs/MPC8349ITXGP_defconfig |   2 +
 configs/MPC8349ITX_LOWBOOT_defconfig   |   2 +
 configs/MPC8349ITX_defconfig   |   2 +
 configs/MPC837XEMDS_HOST_defconfig |   2 +
 configs/MPC837XEMDS_SLAVE_defconfig|   2 +
 configs/MPC837XEMDS_defconfig  |   2 +
 configs/MPC837XERDB_SLAVE_defconfig|   2 +
 configs/MPC837XERDB_defconfig  |   2 +
 configs/hrcon_defconfig|   2 +
 configs/hrcon_dh_defconfig |   2 +
 configs/ids8313_defconfig  |   2 +
 configs/kmcoge5ne_defconfig|   4 +
 configs/kmeter1_defconfig  |   4 +
 configs/kmopti2_defconfig  |   4 +
 configs/kmsupx5_defconfig  |   4 +
 configs/kmtegr1_defconfig  |   4 +
 configs/kmtepr2_defconfig  |   4 +
 configs/kmvect1_defconfig  |   4 +
 configs/mpc8308_p1m_defconfig  |   2 +
 configs/strider_con_defconfig  |   2 +
 configs/strider_con_dp_defconfig   |   2 +
 configs/strider_cpu_defconfig  |   2 +
 configs/strider_cpu_dp_defconfig   |   2 +
 configs/suvd3_defconfig|   4 +
 configs/tuge1_defconfig|   4 +
 configs/tuxx1_defconfig|   4 +
 configs/ve8313_defconfig   |   2 +
 include/configs/MPC8308RDB.h   |   5 -
 include/configs/MPC8313ERDB_NAND.h |   3 -
 include/configs/MPC8313ERDB_NOR.h  |   3 -
 include/configs/MPC8315ERDB.h  |   5 -
 include/configs/MPC8323ERDB.h  |   5 -
 include/configs/MPC8349EMDS.h  |   2 -
 include/configs/MPC8349EMDS_SDRAM.h|   2 -
 include/configs/MPC8349ITX.h   |   2 -
 include/configs/MPC837XEMDS.h  |   4 -
 include/configs/MPC837XERDB.h  |   4 -
 include/configs/hrcon.h|   5 -
 include/configs/ids8313.h  |   3 -
 include/configs/kmcoge5ne.h|   8 --
 include/configs/kmeter1.h  |   8 --
 include/configs/kmopti2.h  |   8 --
 include/configs/kmsupx5.h  |   8 --
 include/configs/kmtegr1.h  |   8 --
 include/configs/kmtepr2.h  |   8 --
 include/configs/kmvect1.h  |   8 --
 include/configs/mpc8308_p1m.h  |   5 -
 include/configs/strider.h  |   5 -
 include/configs/suvd3.h|   8 --
 include/configs/tuge1.h|   8 --
 include/configs/tuxx1.h|   8 --
 include/configs/ve8313.h   |   3 -
 scripts/config_whitelist.txt   |   4 -
 69 files changed, 269 insertions(+), 172 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/arbiter/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/arbiter/arbiter.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 9f7b3a2e019..8a3bb10466c 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -295,6 +295,7 @@ source "arch/powerpc/cpu/mpc83xx/lblaw/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/elbc/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/hid/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/sysio/Kconfig"
+source "arch/powerpc/cpu/mpc83xx/arbiter/Kconfig"
 
 menu "Legacy options"
 
diff --git a/arch/powerpc/cpu/mpc83xx/arbiter/Kconfig 
b/arch/powerpc/cpu/mpc83xx/arbiter/Kconfig
new file mode 100644
index 000..f562476da85
--- /dev/null
+++ b/arch/powerpc/cpu/mpc83xx/arbiter/Kconfig
@@ -0,0 +1,139 @@
+menu "Arbiter"
+
+choice
+   prompt "Pipeline depth"
+
+config ACR_PIPE_DEP_UNSET
+   bool "Don't set value"
+
+config ACR_PIPE_DEP_1
+   bool "1"
+
+config ACR_PIPE_DEP_2
+   bool "2"
+
+config ACR_PIPE_DEP_3
+   bool "3"
+
+config ACR_PIPE_DEP_4
+   bool "4"
+
+endchoice
+
+choice
+   prompt "Repeat count"
+
+config 

[U-Boot] [PATCH v3 50/60] mpc83xx: Migrate SPCR to Kconfig

2019-01-21 Thread Mario Six
Migrate the SPCR setting to Kconfig.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/Kconfig  |   1 +
 arch/powerpc/cpu/mpc83xx/cpu_init.c   |  29 +
 arch/powerpc/cpu/mpc83xx/initreg/Kconfig  |   5 +
 arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr | 115 ++
 arch/powerpc/cpu/mpc83xx/initreg/initreg.h|  43 +++
 configs/MPC8308RDB_defconfig  |   1 +
 configs/MPC8315ERDB_defconfig |   1 +
 configs/MPC8323ERDB_defconfig |   1 +
 configs/MPC8349EMDS_PCI64_defconfig   |   2 +
 configs/MPC8349EMDS_SLAVE_defconfig   |   2 +
 configs/MPC8349EMDS_defconfig |   2 +
 configs/MPC8349ITXGP_defconfig|   2 +
 configs/MPC8349ITX_LOWBOOT_defconfig  |   2 +
 configs/MPC8349ITX_defconfig  |   2 +
 configs/MPC837XEMDS_HOST_defconfig|   1 +
 configs/MPC837XEMDS_SLAVE_defconfig   |   1 +
 configs/MPC837XEMDS_defconfig |   1 +
 configs/MPC837XERDB_SLAVE_defconfig   |   1 +
 configs/MPC837XERDB_defconfig |   1 +
 configs/hrcon_defconfig   |   1 +
 configs/hrcon_dh_defconfig|   1 +
 configs/mpc8308_p1m_defconfig |   1 +
 configs/strider_con_defconfig |   1 +
 configs/strider_con_dp_defconfig  |   1 +
 configs/strider_cpu_defconfig |   1 +
 configs/strider_cpu_dp_defconfig  |   1 +
 include/configs/MPC8308RDB.h  |   2 -
 include/configs/MPC8315ERDB.h |   2 -
 include/configs/MPC8323ERDB.h |   3 -
 include/configs/MPC8349EMDS.h |   2 -
 include/configs/MPC8349ITX.h  |   2 -
 include/configs/MPC837XEMDS.h |   3 -
 include/configs/MPC837XERDB.h |   3 -
 include/configs/hrcon.h   |   2 -
 include/configs/mpc8308_p1m.h |   2 -
 include/configs/strider.h |   2 -
 scripts/config_whitelist.txt  |   1 -
 37 files changed, 192 insertions(+), 52 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/initreg/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr
 create mode 100644 arch/powerpc/cpu/mpc83xx/initreg/initreg.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 8a3bb10466c..fe20e85086b 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -296,6 +296,7 @@ source "arch/powerpc/cpu/mpc83xx/elbc/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/hid/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/sysio/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/arbiter/Kconfig"
+source "arch/powerpc/cpu/mpc83xx/initreg/Kconfig"
 
 menu "Legacy options"
 
diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c 
b/arch/powerpc/cpu/mpc83xx/cpu_init.c
index 77502567a70..59faa78d24c 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
@@ -16,6 +16,7 @@
 #include "elbc/elbc.h"
 #include "sysio/sysio.h"
 #include "arbiter/arbiter.h"
+#include "initreg/initreg.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -52,34 +53,6 @@ static void config_qe_ioports(void)
  */
 void cpu_init_f (volatile immap_t * im)
 {
-   __be32 spcr_mask =
-#ifdef CONFIG_SYS_SPCR_OPT /* Optimize transactions between CSB and other dev 
*/
-   SPCR_OPT |
-#endif
-#ifdef CONFIG_SYS_SPCR_TSECEP /* all eTSEC's Emergency priority */
-   SPCR_TSECEP |
-#endif
-#ifdef CONFIG_SYS_SPCR_TSEC1EP /* TSEC1 Emergency priority */
-   SPCR_TSEC1EP |
-#endif
-#ifdef CONFIG_SYS_SPCR_TSEC2EP /* TSEC2 Emergency priority */
-   SPCR_TSEC2EP |
-#endif
-   0;
-   __be32 spcr_val =
-#ifdef CONFIG_SYS_SPCR_OPT
-   (CONFIG_SYS_SPCR_OPT << SPCR_OPT_SHIFT) |
-#endif
-#ifdef CONFIG_SYS_SPCR_TSECEP /* all eTSEC's Emergency priority */
-   (CONFIG_SYS_SPCR_TSECEP << SPCR_TSECEP_SHIFT) |
-#endif
-#ifdef CONFIG_SYS_SPCR_TSEC1EP /* TSEC1 Emergency priority */
-   (CONFIG_SYS_SPCR_TSEC1EP << SPCR_TSEC1EP_SHIFT) |
-#endif
-#ifdef CONFIG_SYS_SPCR_TSEC2EP /* TSEC2 Emergency priority */
-   (CONFIG_SYS_SPCR_TSEC2EP << SPCR_TSEC2EP_SHIFT) |
-#endif
-   0;
__be32 sccr_mask =
 #ifdef CONFIG_SYS_SCCR_ENCCM /* Encryption clock mode */
SCCR_ENCCM |
diff --git a/arch/powerpc/cpu/mpc83xx/initreg/Kconfig 
b/arch/powerpc/cpu/mpc83xx/initreg/Kconfig
new file mode 100644
index 000..82c24891784
--- /dev/null
+++ b/arch/powerpc/cpu/mpc83xx/initreg/Kconfig
@@ -0,0 +1,5 @@
+menu "Initial register configuration"
+
+source "arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr"
+
+endmenu
diff --git a/arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr 
b/arch/powerpc/cpu/mpc83xx/initreg/Kconfig.spcr
new file mode 100644
index 

[U-Boot] [PATCH v3 52/60] mpc83xx: Get rid of CONFIG_SYS_DDR_BASE

2019-01-21 Thread Mario Six
CONFIG_SYS_DDR_BASE is specific to mpc83xx an is always set to the same
value as CONFIG_SYS_SDRAM_BASE. Just use CONFIG_SYS_SDRAM_BASE instead.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 board/esd/vme8349/vme8349.c   | 2 +-
 board/freescale/mpc8323erdb/mpc8323erdb.c | 2 +-
 board/freescale/mpc832xemds/mpc832xemds.c | 2 +-
 board/freescale/mpc8349emds/mpc8349emds.c | 2 +-
 board/freescale/mpc8349itx/mpc8349itx.c   | 2 +-
 board/ids/ids8313/ids8313.c   | 2 +-
 board/keymile/km83xx/km83xx.c | 4 ++--
 board/sbc8349/sbc8349.c   | 2 +-
 board/tqc/tqm834x/tqm834x.c   | 6 +++---
 board/ve8313/ve8313.c | 2 +-
 include/configs/MPC8308RDB.h  | 5 ++---
 include/configs/MPC8313ERDB_NAND.h| 5 ++---
 include/configs/MPC8313ERDB_NOR.h | 5 ++---
 include/configs/MPC8315ERDB.h | 5 ++---
 include/configs/MPC8323ERDB.h | 5 ++---
 include/configs/MPC832XEMDS.h | 5 ++---
 include/configs/MPC8349EMDS.h | 5 ++---
 include/configs/MPC8349EMDS_SDRAM.h   | 5 ++---
 include/configs/MPC8349ITX.h  | 5 ++---
 include/configs/MPC837XEMDS.h | 5 ++---
 include/configs/MPC837XERDB.h | 5 ++---
 include/configs/TQM834x.h | 5 ++---
 include/configs/caddy2.h  | 5 ++---
 include/configs/hrcon.h   | 5 ++---
 include/configs/ids8313.h | 5 ++---
 include/configs/kmcoge5ne.h   | 5 ++---
 include/configs/kmeter1.h | 5 ++---
 include/configs/kmopti2.h | 5 ++---
 include/configs/kmsupx5.h | 5 ++---
 include/configs/kmtegr1.h | 5 ++---
 include/configs/kmtepr2.h | 5 ++---
 include/configs/kmvect1.h | 5 ++---
 include/configs/mpc8308_p1m.h | 5 ++---
 include/configs/sbc8349.h | 5 ++---
 include/configs/strider.h | 5 ++---
 include/configs/suvd3.h   | 5 ++---
 include/configs/tuge1.h   | 5 ++---
 include/configs/tuxx1.h   | 5 ++---
 include/configs/ve8313.h  | 5 ++---
 include/configs/vme8349.h | 5 ++---
 scripts/config_whitelist.txt  | 1 -
 41 files changed, 73 insertions(+), 104 deletions(-)

diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c
index a46d0b6da63..4c220fa8e13 100644
--- a/board/esd/vme8349/vme8349.c
+++ b/board/esd/vme8349/vme8349.c
@@ -38,7 +38,7 @@ int dram_init(void)
return -ENXIO;
 
/* DDR SDRAM - Main memory */
-   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
+   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR;
 
msize = spd_sdram();
 
diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c 
b/board/freescale/mpc8323erdb/mpc8323erdb.c
index 772688186b5..2dc6d7f5f5f 100644
--- a/board/freescale/mpc8323erdb/mpc8323erdb.c
+++ b/board/freescale/mpc8323erdb/mpc8323erdb.c
@@ -79,7 +79,7 @@ int dram_init(void)
return -ENXIO;
 
/* DDR SDRAM - Main SODIMM */
-   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
+   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR;
 
msize = fixed_sdram();
 
diff --git a/board/freescale/mpc832xemds/mpc832xemds.c 
b/board/freescale/mpc832xemds/mpc832xemds.c
index 869538feb92..61b95c601e6 100644
--- a/board/freescale/mpc832xemds/mpc832xemds.c
+++ b/board/freescale/mpc832xemds/mpc832xemds.c
@@ -98,7 +98,7 @@ int dram_init(void)
return -ENXIO;
 
/* DDR SDRAM - Main SODIMM */
-   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
+   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR;
 
msize = fixed_sdram();
 
diff --git a/board/freescale/mpc8349emds/mpc8349emds.c 
b/board/freescale/mpc8349emds/mpc8349emds.c
index d40ed3742e0..ea018e5d201 100644
--- a/board/freescale/mpc8349emds/mpc8349emds.c
+++ b/board/freescale/mpc8349emds/mpc8349emds.c
@@ -56,7 +56,7 @@ int dram_init(void)
return -ENXIO;
 
/* DDR SDRAM - Main SODIMM */
-   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
+   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR;
 #if defined(CONFIG_SPD_EEPROM)
 #ifndef CONFIG_SYS_FSL_DDR2
msize = spd_sdram() * 1024 * 1024;
diff --git a/board/freescale/mpc8349itx/mpc8349itx.c 
b/board/freescale/mpc8349itx/mpc8349itx.c
index 62bcf235711..aaaea7ce89f 100644
--- a/board/freescale/mpc8349itx/mpc8349itx.c
+++ b/board/freescale/mpc8349itx/mpc8349itx.c
@@ -132,7 +132,7 @@ int dram_init(void)
return -ENXIO;
 
/* DDR SDRAM - Main SODIMM */
-   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
+   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & LAWBAR_BAR;
 

Re: [U-Boot] [PATCH] dtoc: make generated platdata structs const

2019-01-21 Thread Simon Goldschmidt

Hi Simon,

Am 20.01.2019 um 21:23 schrieb Simon Glass:

Hi Simon,

On Tue, 8 Jan 2019 at 08:29, Simon Goldschmidt
 wrote:


The platdata initialization structs are currently generated into .rwdata.
Make sure the are put into .rodata by generating them as const.

Signed-off-by: Simon Goldschmidt 


Unfortunately this breaks the dtoc and binman tests (make qcheck). Can
you please take a look?


Yes, sorry, I wasn't aware of that.

I'll fix the dtoc tests, but I don't get binman test failures, so I 
don't know what I should fix there...


Regards,
Simon



Regards,
Simon


---

  tools/dtoc/dtb_platdata.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index 6cb1259446..ca580b45d4 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -461,7 +461,7 @@ class DtbPlatdata(object):
  """
  struct_name, _ = get_compat_name(node)
  var_name = conv_name_to_c(node.name)
-self.buf('static struct %s%s %s%s = {\n' %
+self.buf('static const struct %s%s %s%s = {\n' %
   (STRUCT_PREFIX, struct_name, VAL_PREFIX, var_name))
  for pname, prop in node.props.items():
  if pname in PROP_IGNORE_LIST or pname[0] == '#':
--
2.17.1



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [linux-sunxi] [PATCH 2/9] sunxi: clk: A80: add MMC clock support

2019-01-21 Thread Andre Przywara
On Mon, 21 Jan 2019 17:34:25 +0800
Chen-Yu Tsai  wrote:

> On Mon, Jan 21, 2019 at 5:32 PM Jagan Teki
>  wrote:
> >
> > On Sat, Jan 19, 2019 at 7:02 AM Andre Przywara
> >  wrote:  
> > >
> > > The A80 handles resets and clock gates for the MMC devices
> > > differently, outside of the CCU IP block. Consequently we have a
> > > separate clock device with a separate binding for that.
> > >
> > > Implement that with the respective clock gates and resets to
> > > allow the A80 taking part in the DM_MMC game.
> > >
> > > Signed-off-by: Andre Przywara 
> > > ---
> > >  drivers/clk/sunxi/clk_a80.c | 28 +++-
> > >  1 file changed, 27 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/clk/sunxi/clk_a80.c
> > > b/drivers/clk/sunxi/clk_a80.c index d6dd6a1fa1..2bfc2ca9f5 100644
> > > --- a/drivers/clk/sunxi/clk_a80.c
> > > +++ b/drivers/clk/sunxi/clk_a80.c
> > > @@ -30,19 +30,45 @@ static const struct ccu_reset a80_resets[] = {
> > > [RST_BUS_UART5] = RESET(0x5b4, BIT(21)),
> > >  };
> > >
> > > +static const struct ccu_clk_gate a80_mmc_gates[] = {
> > > +   [0] = GATE(0x0, BIT(16)),
> > > +   [1] = GATE(0x4, BIT(16)),
> > > +   [2] = GATE(0x8, BIT(16)),
> > > +   [3] = GATE(0xc, BIT(16)),
> > > +};
> > > +
> > > +static const struct ccu_reset a80_mmc_resets[] = {
> > > +   [0] = GATE(0x0, BIT(18)),
> > > +   [1] = GATE(0x4, BIT(18)),
> > > +   [2] = GATE(0x8, BIT(18)),
> > > +   [3] = GATE(0xc, BIT(18)),
> > > +};
> > > +
> > >  static const struct ccu_desc a80_ccu_desc = {
> > > .gates = a80_gates,
> > > .resets = a80_resets,
> > >  };
> > >
> > > +static const struct ccu_desc a80_mmc_clk_desc = {
> > > +   .gates = a80_mmc_gates,
> > > +   .resets = a80_mmc_resets,
> > > +};
> > > +
> > >  static int a80_clk_bind(struct udevice *dev)
> > >  {
> > > -   return sunxi_reset_bind(dev, ARRAY_SIZE(a80_resets));
> > > +   ulong count = ARRAY_SIZE(a80_resets);
> > > +
> > > +   if (device_is_compatible(dev,
> > > "allwinner,allwinner,sun9i-a80-mmc"))
> > > +   count = ARRAY_SIZE(a80_mmc_resets);
> > > +
> > > +   return sunxi_reset_bind(dev, count);
> > >  }
> > >
> > >  static const struct udevice_id a80_ccu_ids[] = {
> > > { .compatible = "allwinner,sun9i-a80-ccu",
> > >   .data = (ulong)_ccu_desc },
> > > +   { .compatible = "allwinner,allwinner,sun9i-a80-mmc",  
> >
> > This can be "allwinner,sun9i-a80-mmc-config-clk"  
> 
> *Must*, not can. :)

Indeed, thanks for spotting this, Jagan.

Also I just figured that we need to enable the parent clocks and resets
of this clock itself. I hope we can do this unconditionally, even for
the complex CCU, as enabling fixed-clocks should be covered by the clock
framework already.

Cheers,
Andre.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 2/2] efi_selftest: fix variables test for GetNextVariableName()

2019-01-21 Thread Heinrich Schuchardt
From: AKASHI Takahiro 

There is a bug in efi variables test.
Fix it with some cosmetic improvements.

Please note that efi variables test still fails at QueryVariableInfo()
and GetVariable(), but this is not due to a change in this patch.
  ==8<==
  Testing EFI API implementation

  Selected test: 'variables'

  Setting up 'variables'
  Setting up 'variables' succeeded

  Executing 'variables'
  .../u-boot/lib/efi_selftest/efi_selftest_variables.c(60):
  TODO: QueryVariableInfo failed
  .../u-boot/lib/efi_selftest/efi_selftest_variables.c(131):
  TODO: GetVariable returned wrong length 7
  .../u-boot/lib/efi_selftest/efi_selftest_variables.c(133):
  TODO: GetVariable returned wrong value
  Executing 'variables' succeeded

  Boot services terminated

  Summary: 0 failures
  ==>8==

Signed-off-by: AKASHI Takahiro 
Reviewed-by: Heinrich Schuchardt 
---
v3
no change
v2
no change
---
 lib/efi_selftest/efi_selftest_variables.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lib/efi_selftest/efi_selftest_variables.c 
b/lib/efi_selftest/efi_selftest_variables.c
index ffc8cad329..47a8e7fb95 100644
--- a/lib/efi_selftest/efi_selftest_variables.c
+++ b/lib/efi_selftest/efi_selftest_variables.c
@@ -141,19 +141,22 @@ static int execute(void)
if (ret == EFI_NOT_FOUND)
break;
if (ret != EFI_SUCCESS) {
-   efi_st_todo("GetNextVariableName failed\n");
-   break;
+   efi_st_error("GetNextVariableName failed (%u)\n",
+(unsigned int)ret);
+   return EFI_ST_FAILURE;
}
if (!efi_st_memcmp(, _vendor0, sizeof(efi_guid_t)) &&
!efi_st_strcmp_16_8(varname, "efi_st_var0"))
-   flag |= 2;
+   flag |= 1;
if (!efi_st_memcmp(, _vendor1, sizeof(efi_guid_t)) &&
!efi_st_strcmp_16_8(varname, "efi_st_var1"))
flag |= 2;
}
-   if (flag != 3)
-   efi_st_todo(
+   if (flag != 3) {
+   efi_st_error(
"GetNextVariableName did not return all variables\n");
+   return EFI_ST_FAILURE;
+   }
/* Delete variable 1 */
ret = runtime->set_variable(L"efi_st_var1", _vendor1,
0, 0, NULL);
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 0/2] efi_loader: add GetNextVariableName

2019-01-21 Thread Heinrich Schuchardt
In this patch series GetNextVariableName runtime service is implemented.

v3
rebase on efi-next
v2
update variable_name_size in GetNextVariableName
add more comments
change some internal variable names

AKASHI Takahiro (2):
  efi_loader: implement GetNextVariableName()
  efi_selftest: fix variables test for GetNextVariableName()

 lib/efi_loader/efi_variable.c | 154 +-
 lib/efi_selftest/efi_selftest_variables.c |  13 +-
 2 files changed, 160 insertions(+), 7 deletions(-)

-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 00/11] SF: Migrate to Linux SPI NOR framework

2019-01-21 Thread Jagan Teki
On Mon, Jan 21, 2019 at 5:28 PM Vignesh R  wrote:
>
>
>
> On 14/01/19 8:32 PM, Vignesh R wrote:
> > Hi Jagan,
> >
> > Could you please review v2? If we plan to merge this series for
> > v2019.04, we should probably plan to take it a bit early so as to
> > address any regression or fall out in time. Thanks!
> >
>
> Gentle ping... Jagan could you review this series?
> If there are no comments, I will address Simon's comments and post v3 tomo.

Been with DM migration changes, will comment in coming days.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 06/11] clk: Add SiFive FU540 PRCI clock driver

2019-01-21 Thread Auer, Lukas
On Mon, 2019-01-21 at 05:55 +, Anup Patel wrote:
> > -Original Message-
> > From: Auer, Lukas [mailto:lukas.a...@aisec.fraunhofer.de]
> > Sent: Monday, January 21, 2019 1:43 AM
> > To: s...@chromium.org; bmeng...@gmail.com; r...@andestech.com; Anup
> > Patel ; joe.hershber...@ni.com;
> > yamada.masah...@socionext.com
> > Cc: paul.walms...@sifive.com; pal...@sifive.com; h...@infradead.org;
> > u-
> > b...@lists.denx.de; ag...@suse.de; Atish Patra  > >
> > Subject: Re: [PATCH v2 06/11] clk: Add SiFive FU540 PRCI clock
> > driver
> > 
> > Hi Anup,
> > 
> > On Fri, 2019-01-18 at 11:19 +, Anup Patel wrote:
> > > Add driver code for the SiFive FU540 PRCI IP block.  This IP
> > > block
> > > handles reset and clock control for the SiFive FU540 device and
> > > implements SoC-level clock tree controls and dividers.
> > > 
> > > Based on code written by Wesley Terpstra 
> > > found in
> > > commit 999529edf517ed75b56659d456d221b2ee56bb60 of:
> > > https://github.com/riscv/riscv-linux
> > > 
> > > Boot and PLL rate change were tested on a SiFive HiFive Unleashed
> > > board.
> > > 
> > > Signed-off-by: Paul Walmsley 
> > > Signed-off-by: Atish Patra 
> > > Signed-off-by: Anup Patel 
> > > Reviewed-by: Alexander Graf 
> > > ---
> > >  drivers/clk/Kconfig   |   1 +
> > >  drivers/clk/Makefile  |   1 +
> > >  drivers/clk/sifive/Kconfig|  19 +
> > >  drivers/clk/sifive/Makefile   |   5 +
> > >  .../clk/sifive/analogbits-wrpll-cln28hpc.h| 101 +++
> > >  drivers/clk/sifive/fu540-prci.c   | 604
> > > ++
> > >  drivers/clk/sifive/wrpll-cln28hpc.c   | 390 +++
> > >  include/dt-bindings/clk/sifive-fu540-prci.h   |  29 +
> > >  8 files changed, 1150 insertions(+)
> > >  create mode 100644 drivers/clk/sifive/Kconfig  create mode
> > > 100644
> > > drivers/clk/sifive/Makefile  create mode 100644
> > > drivers/clk/sifive/analogbits-wrpll-cln28hpc.h
> > >  create mode 100644 drivers/clk/sifive/fu540-prci.c  create mode
> > > 100644 drivers/clk/sifive/wrpll-cln28hpc.c
> > >  create mode 100644 include/dt-bindings/clk/sifive-fu540-prci.h
> > > 
> > 
> > The corresponding patch series for the Linux Kernel [1] includes
> > code
> > comments, which have not been addressed yet in this version of the
> > driver.
> > Are you planning on syncing it with the Linux driver once it is
> > upstream, or
> > incorporating the comments directly?
> > 
> > [1]:
> > https://patchwork.kernel.org/project/linux-
> > clk/list/?series=33383=%2A=both
> 
> Yes, the Linux patches might take some time to merge so unblock
> this patch series we took the first version as reference. Later once
> it is merged we will send one sync-up patch to U-Boot.

That sounds good, thanks!

> 
> > > diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index
> > > eadf7f8250..ce462f5717 100644
> > > --- a/drivers/clk/Kconfig
> > > +++ b/drivers/clk/Kconfig
> > > @@ -104,6 +104,7 @@ source "drivers/clk/imx/Kconfig"
> > >  source "drivers/clk/mvebu/Kconfig"
> > >  source "drivers/clk/owl/Kconfig"
> > >  source "drivers/clk/renesas/Kconfig"
> > > +source "drivers/clk/sifive/Kconfig"
> > >  source "drivers/clk/tegra/Kconfig"
> > >  source "drivers/clk/uniphier/Kconfig"
> > > 
> > > diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index
> > > 9acbb1a650..2f4446568c 100644
> > > --- a/drivers/clk/Makefile
> > > +++ b/drivers/clk/Makefile
> > > @@ -22,6 +22,7 @@ obj-$(CONFIG_CLK_HSDK) += clk-hsdk-cgu.o
> > >  obj-$(CONFIG_CLK_MPC83XX) += mpc83xx_clk.o
> > >  obj-$(CONFIG_CLK_OWL) += owl/
> > >  obj-$(CONFIG_CLK_RENESAS) += renesas/
> > > +obj-$(CONFIG_CLK_SIFIVE) += sifive/
> > >  obj-$(CONFIG_CLK_STM32F) += clk_stm32f.o
> > >  obj-$(CONFIG_CLK_STM32MP1) += clk_stm32mp1.o
> > >  obj-$(CONFIG_CLK_UNIPHIER) += uniphier/ diff --git
> > > a/drivers/clk/sifive/Kconfig b/drivers/clk/sifive/Kconfig new
> > > file
> > > mode 100644 index 00..81fc9f8fda
> > > --- /dev/null
> > > +++ b/drivers/clk/sifive/Kconfig
> > > @@ -0,0 +1,19 @@
> > > +# SPDX-License-Identifier: GPL-2.0
> > > +
> > > +config CLK_ANALOGBITS_WRPLL_CLN28HPC
> > > + bool
> > 
> > The analogbits library is not specific to SiFive. The Linux Kernel
> > patch series
> > adds it as a standalone entry to make it available to other
> > drivers. I think the
> > same thing would also make sense here.
> 
> Based on other CLK drivers, it seems analogbits library is not
> generic enough
> might require more work to become generic PLL library.
> 
> To unblock this patch series, we have made it SiFive specific. Later
> if it is
> accepted in Linux as standalone library then we will refactor here as
> well.
> 
> IMHO, analogbits library is not generic enough so might be difficult
> to
> take it as standalone library in Linux.
> 

That makes sense. I agree, the best option will be to include the
library the same way as in Linux.

Thanks,
Lukas

[U-Boot] [PATCH v3 11/60] keymile: Unroll km/km83xx-common.h

2019-01-21 Thread Mario Six
Simplify the keymile config files once more by unrolling the
km/km83xx-common.h, and resolve the #ifdef logic as needed.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 include/configs/km8360.h| 287 ++-
 include/configs/km83xx-common.h | 296 
 include/configs/kmopti2.h   | 285 +-
 include/configs/kmsupx5.h   | 285 +-
 include/configs/kmtegr1.h   | 284 +-
 include/configs/kmtepr2.h   | 285 +-
 include/configs/kmvect1.h   | 284 +-
 include/configs/suvd3.h | 287 ++-
 include/configs/tuge1.h | 285 +-
 include/configs/tuxx1.h | 285 +-
 10 files changed, 2543 insertions(+), 320 deletions(-)
 delete mode 100644 include/configs/km83xx-common.h

diff --git a/include/configs/km8360.h b/include/configs/km8360.h
index d6c2772825e..67d310c42cf 100644
--- a/include/configs/km8360.h
+++ b/include/configs/km8360.h
@@ -37,8 +37,291 @@
  */
 #define CONFIG_QE  /* Has QE */
 
-/* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
+/* include common defines/options for all Keymile boards */
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN  6600
+#define CONFIG_SYS_CLK_FREQ6600
+#define CONFIG_83XX_PCICLK 6600
+
+/*
+ * IMMR new address
+ */
+#define CONFIG_SYS_IMMR0xE000
+
+/*
+ * Bus Arbitration Configuration Register (ACR)
+ */
+#define CONFIG_SYS_ACR_PIPE_DEP 3   /* pipeline depth 4 transactions */
+#define CONFIG_SYS_ACR_RPTCNT   3   /* 4 consecutive transactions */
+#define CONFIG_SYS_ACR_APARK0   /* park bus to master (below) */
+#define CONFIG_SYS_ACR_PARKM3   /* parking master = QuiccEngine */
+
+/*
+ * DDR Setup
+ */
+#define CONFIG_SYS_DDR_BASE0x /* DDR is system memory */
+#define CONFIG_SYS_SDRAM_BASE  CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_SDRAM_BASE2 (CONFIG_SYS_SDRAM_BASE + 0x1000) /* +256M */
+
+#define CONFIG_SYS_DDR_SDRAM_BASE  CONFIG_SYS_DDR_BASE
+#define CONFIG_SYS_DDR_SDRAM_CLK_CNTL  (DDR_SDRAM_CLK_CNTL_SS_EN | \
+   DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
+
+#define CFG_83XX_DDR_USES_CS0
+
+/*
+ * Manually set up DDR parameters
+ */
+#define CONFIG_DDR_II
+#define CONFIG_SYS_DDR_SIZE2048 /* MB */
+
+/*
+ * The reserved memory
+ */
+#define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE /* start of 
monitor */
+#define CONFIG_SYS_FLASH_BASE  0xF000
+
+#if (CONFIG_SYS_MONITOR_BASE < CONFIG_SYS_FLASH_BASE)
+#define CONFIG_SYS_RAMBOOT
+#endif
+
+/* Reserve 768 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN (768 * 1024)
+
+/*
+ * Initial RAM Base Address Setup
+ */
+#define CONFIG_SYS_INIT_RAM_LOCK
+#define CONFIG_SYS_INIT_RAM_ADDR   0xE600 /* Initial RAM address */
+#define CONFIG_SYS_INIT_RAM_SIZE   0x1000 /* End of used area in RAM */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
+   GENERATED_GBL_DATA_SIZE)
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ * Bank Bus Machine PortSz  Size  Device
+ *  --- --- --  -  --
+ *  0   Local   GPCM16 bit  256MB FLASH
+ *  1   Local   GPCM 8 bit  128MB GPIO/PIGGY
+ *
+ */
+/*
+ * FLASH on the Local Bus
+ */
+#define CONFIG_SYS_FLASH_SIZE  256 /* max FLASH size is 256M */
+
+#define CONFIG_SYS_LBLAWBAR0_PRELIMCONFIG_SYS_FLASH_BASE
+#define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_256MB)
+
+#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE | \
+   BR_PS_16 | /* 16 bit port size */ \
+   BR_MS_GPCM | /* MSEL = GPCM */ \
+   BR_V)
+
+#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) | \
+   OR_GPCM_CSNT | OR_GPCM_ACS_DIV2 | \
+   OR_GPCM_SCY_5 | \
+   OR_GPCM_TRLX_SET | OR_GPCM_EAD)
+
+#define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max num of flash banks   */
+#define CONFIG_SYS_MAX_FLASH_SECT  512 /* max num of sects on one chip */
+#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE }
+
+/*
+ * PRIO1/PIGGY on the local bus CS1
+ */
+/* Window base at flash base */
+#define CONFIG_SYS_LBLAWBAR1_PRELIMCONFIG_SYS_KMBEC_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_128MB)
+
+#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_KMBEC_FPGA_BASE | \
+   BR_PS_8 | /* 8 bit port size */ \
+ 

[U-Boot] [PATCH v3 23/60] strider: Migrate to CONFIG_TARGET_STRIDER

2019-01-21 Thread Mario Six
Use the proper CONFIG_TARGET_STRIDER Kconfig option to replace the
CONFIG_STRIDER ad-hoc config option.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 board/gdsys/common/Makefile  | 4 ++--
 board/gdsys/mpc8308/Makefile | 2 +-
 include/configs/strider.h| 1 -
 scripts/config_whitelist.txt | 1 -
 4 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile
index 67d2b310b30..9090933e345 100644
--- a/board/gdsys/common/Makefile
+++ b/board/gdsys/common/Makefile
@@ -11,8 +11,8 @@ obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o ch7301.o
 obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o
 obj-$(CONFIG_CONTROLCENTERD) += dp501.o
 obj-$(CONFIG_TARGET_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o 
fanctrl.o
-obj-$(CONFIG_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o
-obj-$(CONFIG_STRIDER) += fanctrl.o
+obj-$(CONFIG_TARGET_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o 
ch7301.o
+obj-$(CONFIG_TARGET_STRIDER) += fanctrl.o
 obj-$(CONFIG_STRIDER_CON) += osd.o
 obj-$(CONFIG_STRIDER_CON_DP) += osd.o
 
diff --git a/board/gdsys/mpc8308/Makefile b/board/gdsys/mpc8308/Makefile
index f29376fc9ed..dc579479f95 100644
--- a/board/gdsys/mpc8308/Makefile
+++ b/board/gdsys/mpc8308/Makefile
@@ -5,4 +5,4 @@
 
 obj-y := mpc8308.o sdram.o
 obj-$(CONFIG_TARGET_HRCON) += hrcon.o
-obj-$(CONFIG_STRIDER) += strider.o
+obj-$(CONFIG_TARGET_STRIDER) += strider.o
diff --git a/include/configs/strider.h b/include/configs/strider.h
index 89e0610871e..c42fe8c3ece 100644
--- a/include/configs/strider.h
+++ b/include/configs/strider.h
@@ -13,7 +13,6 @@
  */
 #define CONFIG_E3001 /* E300 family */
 #define CONFIG_MPC83xx 1 /* MPC83xx family */
-#define CONFIG_STRIDER 1 /* STRIDER board specific */
 
 #define CONFIG_SYS_FSL_ESDHC_ADDR  CONFIG_SYS_MPC83xx_ESDHC_ADDR
 
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 9de1666d7f9..49fc2f9f83e 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1938,7 +1938,6 @@ CONFIG_STANDALONE_LOAD_ADDR
 CONFIG_STATIC_BOARD_REV
 CONFIG_STD_DEVICES_SETTINGS
 CONFIG_STM32_FLASH
-CONFIG_STRIDER
 CONFIG_STRIDER_CON
 CONFIG_STRIDER_CON_DP
 CONFIG_STRIDER_CPU
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 29/60] mpc83xx: Replace CONFIG_83XX_CLKIN in calculations

2019-01-21 Thread Mario Six
CONFIG_SYS_CLK_FREQ is the standard way to set the system clock
frequency. On MPC83xx, CONFIG_83XX_CLKIN is used for this purpose.
Hence, the obvious way is to replace CONFIG_83XX_CLKIN with
CONFIG_SYS_CLK_FREQ.

A few MPC83xx boards use the CONFIG_83XX_CLKIN variable for computing
CONFIG_SYS_NS16550_CLK. This makes it harder to replace
CONFIG_83XX_CLKIN.

But the value of the multiplicator can be read from the SPMR register.

Hence, replace the static calculations with a call to a new get_bus_freq
function, as other architectures do.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 arch/powerpc/cpu/mpc83xx/spl_minimal.c | 8 
 include/configs/MPC8315ERDB.h  | 2 +-
 include/configs/ids8313.h  | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/spl_minimal.c 
b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
index 746f1febba0..3315ee05e11 100644
--- a/arch/powerpc/cpu/mpc83xx/spl_minimal.c
+++ b/arch/powerpc/cpu/mpc83xx/spl_minimal.c
@@ -89,3 +89,11 @@ void puts(const char *str)
while (*str)
putc(*str++);
 }
+
+ulong get_bus_freq(ulong dummy)
+{
+   volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
+   u8 spmf = (im->clk.spmr & SPMR_SPMF) >> SPMR_SPMF_SHIFT;
+
+   return CONFIG_83XX_CLKIN * spmf;
+}
diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index c373a0ab4c1..adb2bb6c2d8 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -271,7 +271,7 @@
  */
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE1
-#define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 2)
+#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0))
 
 #define CONFIG_SYS_BAUDRATE_TABLE  \
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200}
diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
index caa3dd1f1a6..4b0ec273fb7 100644
--- a/include/configs/ids8313.h
+++ b/include/configs/ids8313.h
@@ -301,7 +301,7 @@
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
 #define CONFIG_SYS_NS16550_COM1(CONFIG_SYS_IMMR + 0x4500)
 #define CONFIG_SYS_NS16550_COM2(CONFIG_SYS_IMMR + 0x4600)
-#define CONFIG_SYS_NS16550_CLK (CONFIG_83XX_CLKIN * 2)
+#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0))
 
 #define CONFIG_HAS_FSL_DR_USB
 #define CONFIG_SYS_SCCR_USBDRCM3
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 53/60] mpc83xx: Get rid of CONFIG_SYS_DDR_SDRAM_BASE

2019-01-21 Thread Mario Six
CONFIG_SYS_DDR_SDRAM_BASE is set to the same value as
CONFIG_SYS_SDRAM_BASE on all existing boards. Just use
CONFIG_SYS_SDRAM_BASE instead.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/spd_sdram.c  | 2 +-
 board/freescale/mpc8308rdb/sdram.c| 4 ++--
 board/freescale/mpc8313erdb/sdram.c   | 8 
 board/freescale/mpc8315erdb/sdram.c   | 2 +-
 board/freescale/mpc8349emds/mpc8349emds.c | 8 
 board/freescale/mpc8349itx/mpc8349itx.c   | 8 
 board/freescale/mpc837xemds/mpc837xemds.c | 2 +-
 board/freescale/mpc837xerdb/mpc837xerdb.c | 2 +-
 board/gdsys/mpc8308/sdram.c   | 4 ++--
 board/ids/ids8313/ids8313.c   | 2 +-
 board/mpc8308_p1m/sdram.c | 4 ++--
 board/sbc8349/sbc8349.c   | 8 
 board/ve8313/ve8313.c | 8 
 drivers/ddr/fsl/main.c| 4 
 include/configs/MPC8308RDB.h  | 1 -
 include/configs/MPC8313ERDB_NAND.h| 1 -
 include/configs/MPC8313ERDB_NOR.h | 1 -
 include/configs/MPC8315ERDB.h | 1 -
 include/configs/MPC8323ERDB.h | 1 -
 include/configs/MPC832XEMDS.h | 1 -
 include/configs/MPC8349EMDS.h | 1 -
 include/configs/MPC8349EMDS_SDRAM.h   | 1 -
 include/configs/MPC8349ITX.h  | 1 -
 include/configs/MPC837XEMDS.h | 1 -
 include/configs/MPC837XERDB.h | 1 -
 include/configs/TQM834x.h | 1 -
 include/configs/caddy2.h  | 1 -
 include/configs/hrcon.h   | 1 -
 include/configs/ids8313.h | 1 -
 include/configs/kmcoge5ne.h   | 1 -
 include/configs/kmeter1.h | 1 -
 include/configs/kmopti2.h | 1 -
 include/configs/kmsupx5.h | 1 -
 include/configs/kmtegr1.h | 1 -
 include/configs/kmtepr2.h | 1 -
 include/configs/kmvect1.h | 1 -
 include/configs/mpc8308_p1m.h | 1 -
 include/configs/sbc8349.h | 1 -
 include/configs/strider.h | 1 -
 include/configs/suvd3.h   | 1 -
 include/configs/tuge1.h   | 1 -
 include/configs/tuxx1.h   | 1 -
 include/configs/ve8313.h  | 1 -
 include/configs/vme8349.h | 1 -
 44 files changed, 35 insertions(+), 61 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/spd_sdram.c 
b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
index b3cbf9f8823..5ca307ca583 100644
--- a/arch/powerpc/cpu/mpc83xx/spd_sdram.c
+++ b/arch/powerpc/cpu/mpc83xx/spd_sdram.c
@@ -281,7 +281,7 @@ long int spd_sdram()
/*
 * Set up LAWBAR for all of DDR.
 */
-   ecm->bar = CONFIG_SYS_DDR_SDRAM_BASE & 0xf000;
+   ecm->bar = CONFIG_SYS_SDRAM_BASE & 0xf000;
ecm->ar  = (LAWAR_EN | LAWAR_TRGT_IF_DDR | (LAWAR_SIZE & law_size));
debug("DDR:bar=0x%08x\n", ecm->bar);
debug("DDR:ar=0x%08x\n", ecm->ar);
diff --git a/board/freescale/mpc8308rdb/sdram.c 
b/board/freescale/mpc8308rdb/sdram.c
index e64b3107b5f..317e63ea6a1 100644
--- a/board/freescale/mpc8308rdb/sdram.c
+++ b/board/freescale/mpc8308rdb/sdram.c
@@ -33,7 +33,7 @@ static long fixed_sdram(void)
u32 msize_log2 = __ilog2(msize);
 
out_be32(>sysconf.ddrlaw[0].bar,
-   CONFIG_SYS_DDR_SDRAM_BASE  & 0xf000);
+   CONFIG_SYS_SDRAM_BASE  & 0xf000);
out_be32(>sysconf.ddrlaw[0].ar, LBLAWAR_EN | (msize_log2 - 1));
out_be32(>sysconf.ddrcdr, CONFIG_SYS_DDRCDR_VALUE);
 
@@ -61,7 +61,7 @@ static long fixed_sdram(void)
setbits_be32(>ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
sync();
 
-   return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize);
+   return get_ram_size(CONFIG_SYS_SDRAM_BASE, msize);
 }
 
 int dram_init(void)
diff --git a/board/freescale/mpc8313erdb/sdram.c 
b/board/freescale/mpc8313erdb/sdram.c
index 5e074e3d87b..090412d4b6c 100644
--- a/board/freescale/mpc8313erdb/sdram.c
+++ b/board/freescale/mpc8313erdb/sdram.c
@@ -47,7 +47,7 @@ static long fixed_sdram(void)
volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR;
u32 msize_log2 = __ilog2(msize);
 
-   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_SDRAM_BASE & 0xf000;
+   im->sysconf.ddrlaw[0].bar = CONFIG_SYS_SDRAM_BASE & 0xf000;
im->sysconf.ddrlaw[0].ar = LBLAWAR_EN | (msize_log2 - 1);
im->sysconf.ddrcdr = CONFIG_SYS_DDRCDR_VALUE;
 
@@ -57,12 +57,12 @@ static long fixed_sdram(void)
 */
__udelay(5);
 
-#if ((CONFIG_SYS_DDR_SDRAM_BASE & 0x00FF) != 0)
+#if ((CONFIG_SYS_SDRAM_BASE & 0x00FF) != 0)
 #warning Chip select bounds is only configurable in 16MB increments
 #endif
im->ddr.csbnds[0].csbnds =
-   ((CONFIG_SYS_DDR_SDRAM_BASE >> CSBNDS_SA_SHIFT) & CSBNDS_SA) |
-   

[U-Boot] [PATCH v3 41/60] powerpc: mpc83xx: Fix MPC8308 IMMR memory layout

2019-01-21 Thread Mario Six
The MPC8308 has two I2C controllers, but no PCI controller.

Fix the register map layout for this SoC.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/Makefile |  2 ++
 arch/powerpc/include/asm/immap_83xx.h | 42 +--
 2 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Makefile 
b/arch/powerpc/cpu/mpc83xx/Makefile
index aa4affa911b..304029977e5 100644
--- a/arch/powerpc/cpu/mpc83xx/Makefile
+++ b/arch/powerpc/cpu/mpc83xx/Makefile
@@ -29,7 +29,9 @@ obj-y += interrupts.o
 obj-y += ecc.o
 obj-$(CONFIG_QE) += qe_io.o
 obj-$(CONFIG_FSL_SERDES) += serdes.o
+ifndef CONFIG_ARCH_MPC8308
 obj-$(CONFIG_PCI) += pci.o
+endif
 obj-$(CONFIG_PCIE) += pcie.o
 obj-$(CONFIG_OF_LIBFDT) += fdt.o
 
diff --git a/arch/powerpc/include/asm/immap_83xx.h 
b/arch/powerpc/include/asm/immap_83xx.h
index 30bbd5671ba..d02da6495ce 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ b/arch/powerpc/include/asm/immap_83xx.h
@@ -714,7 +714,7 @@ typedef struct immap {
u8  res7[0xC];
 } immap_t;
 
-#elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC8315)
+#elif defined(CONFIG_ARCH_MPC8315)
 typedef struct immap {
sysconf83xx_t   sysconf;/* System configuration */
wdt83xx_t   wdt;/* Watch Dog Timer (WDT) 
Registers */
@@ -729,8 +729,8 @@ typedef struct immap {
gpio83xx_t  gpio[1];/* General purpose I/O module */
u8  res0[0x1300];
ddr83xx_t   ddr;/* DDR Memory Controller Memory 
*/
-   fsl_i2c_t   i2c[2]; /* I2C Controllers */
-   u8  res1[0x1300];
+   fsl_i2c_t   i2c[1]; /* I2C Controllers */
+   u8  res1[0x1400];
duart83xx_t duart[2];   /* DUART */
u8  res2[0x900];
fsl_lbc_t   im_lbc; /* Local Bus Controller Regs */
@@ -759,6 +759,42 @@ typedef struct immap {
u8  res12[0x1CF00];
 } immap_t;
 
+#elif defined(CONFIG_ARCH_MPC8308)
+typedef struct immap {
+   sysconf83xx_t   sysconf;/* System configuration */
+   wdt83xx_t   wdt;/* Watch Dog Timer (WDT) 
Registers */
+   rtclk83xx_t rtc;/* Real Time Clock Module 
Registers */
+   rtclk83xx_t pit;/* Periodic Interval Timer */
+   gtm83xx_t   gtm[1]; /* Global Timers Module */
+   u8  res0[0x100];
+   ipic83xx_t  ipic;   /* Integrated Programmable 
Interrupt Controller */
+   arbiter83xx_t   arbiter;/* System Arbiter Registers */
+   reset83xx_t reset;  /* Reset Module */
+   clk83xx_t   clk;/* System Clock Module */
+   pmc83xx_t   pmc;/* Power Management Control 
Module */
+   gpio83xx_t  gpio[1];/* General purpose I/O module */
+   u8  res1[0x1300];
+   ddr83xx_t   ddr;/* DDR Memory Controller Memory 
*/
+   fsl_i2c_t   i2c[2]; /* I2C Controllers */
+   u8  res2[0x1300];
+   duart83xx_t duart[2];   /* DUART */
+   u8  res3[0x900];
+   fsl_lbc_t   im_lbc; /* Local Bus Controller Regs */
+   u8  res4[0x1000];
+   spi8xxx_t   spi;/* Serial Peripheral Interface 
*/
+   u8  res5[0x1000];
+   pex83xx_t   pciexp[1];  /* PCI Express Controller */
+   u8  res6[0x19000];
+   usb83xx_t   usb[1]; /* USB DR Controller */
+   tsec83xx_t  tsec[2];
+   u8  res7[0x6000];
+   tdmdmac83xx_t   tdmdmac;/* TDM DMAC */
+   sdhc83xx_t  sdhc;   /* SDHC Controller */
+   u8  res8[0xb4000];
+   serdes83xx_tserdes[1];  /* SerDes Registers */
+   u8  res9[0x1CF00];
+} immap_t;
+
 #elif defined(CONFIG_ARCH_MPC837X)
 typedef struct immap {
sysconf83xx_t   sysconf;/* System configuration */
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 55/60] mpc83xx: Add arch clock.h to make SDHC work

2019-01-21 Thread Mario Six
The fsl-esdhc driver can be used for the SDHC functionality on MPC83xx,
but it needs some additional definitions.

Add a clock.h file, so we can use the driver for MPC83xx.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/include/asm/arch-mpc83xx/clock.h | 22 +++
 1 file changed, 22 insertions(+)
 create mode 100644 arch/powerpc/include/asm/arch-mpc83xx/clock.h

diff --git a/arch/powerpc/include/asm/arch-mpc83xx/clock.h 
b/arch/powerpc/include/asm/arch-mpc83xx/clock.h
new file mode 100644
index 000..d57e93c2df9
--- /dev/null
+++ b/arch/powerpc/include/asm/arch-mpc83xx/clock.h
@@ -0,0 +1,22 @@
+/*
+ * (C) Copyright 2018
+ * Mario Six, Guntermann & Drunck GmbH, mario@gdsys.cc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __ASM_POWERPC_CLOCK_H
+#define __ASM_POWERPC_CLOCK_H
+
+/* Make fsl_esdhc driver happy */
+enum mxc_clock {
+   MXC_ESDHC_CLK,
+};
+
+DECLARE_GLOBAL_DATA_PTR;
+
+uint mxc_get_clock(int clk)
+{
+   return gd->arch.sdhc_clk;
+}
+#endif /* __ASM_POWERPC_CLOCK_H */
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 43/60] powerpc: mpc83xx: fdt: Use get_serial_clock()

2019-01-21 Thread Mario Six
Replace the hard-coded CONFIG_SYS_NS16550_CLK value for the FDT fixup
with the previously introduced get_serial_clock function

This will make it possible to activate DM for serial devices on MPC83xx
later on.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/fdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/fdt.c b/arch/powerpc/cpu/mpc83xx/fdt.c
index cfd391b78ab..b487e31cc0f 100644
--- a/arch/powerpc/cpu/mpc83xx/fdt.c
+++ b/arch/powerpc/cpu/mpc83xx/fdt.c
@@ -116,8 +116,8 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #endif
 
 #ifdef CONFIG_SYS_NS16550
-   do_fixup_by_compat_u32(blob, "ns16550",
-   "clock-frequency", CONFIG_SYS_NS16550_CLK, 1);
+do_fixup_by_compat_u32(blob, "ns16550",
+"clock-frequency", get_serial_clock(), 1);
 #endif
 
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] tests: dtoc: adapt tests to changed dtoc output

2019-01-21 Thread Simon Goldschmidt
The dtoc tests need to be adapted to dtoc being changed to output platdata
structs as const, which has been introduced in commit 7d05d3a8e35f ("dtoc:
make generated platdata structs const").

Fixes: 7d05d3a8e35f ("dtoc: make generated platdata structs const")
Signed-off-by: Simon Goldschmidt 
---

 tools/dtoc/test_dtoc.py | 54 -
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index 11bead1260..cb6d6e7baf 100644
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -196,7 +196,7 @@ struct dtd_sandbox_spl_test_2 {
 with open(output) as infile:
 data = infile.read()
 self._CheckStrings(C_HEADER + '''
-static struct dtd_sandbox_spl_test dtv_spl_test = {
+static const struct dtd_sandbox_spl_test dtv_spl_test = {
 \t.bytearray\t\t= {0x6, 0x0, 0x0},
 \t.byteval\t\t= 0x5,
 \t.intval\t\t\t= 0x1,
@@ -214,7 +214,7 @@ U_BOOT_DEVICE(spl_test) = {
 \t.platdata_size\t= sizeof(dtv_spl_test),
 };
 
-static struct dtd_sandbox_spl_test dtv_spl_test2 = {
+static const struct dtd_sandbox_spl_test dtv_spl_test2 = {
 \t.bytearray\t\t= {0x1, 0x23, 0x34},
 \t.byteval\t\t= 0x8,
 \t.intval\t\t\t= 0x3,
@@ -230,7 +230,7 @@ U_BOOT_DEVICE(spl_test2) = {
 \t.platdata_size\t= sizeof(dtv_spl_test2),
 };
 
-static struct dtd_sandbox_spl_test dtv_spl_test3 = {
+static const struct dtd_sandbox_spl_test dtv_spl_test3 = {
 \t.stringarray\t\t= {"one", "", ""},
 };
 U_BOOT_DEVICE(spl_test3) = {
@@ -239,7 +239,7 @@ U_BOOT_DEVICE(spl_test3) = {
 \t.platdata_size\t= sizeof(dtv_spl_test3),
 };
 
-static struct dtd_sandbox_spl_test_2 dtv_spl_test4 = {
+static const struct dtd_sandbox_spl_test_2 dtv_spl_test4 = {
 };
 U_BOOT_DEVICE(spl_test4) = {
 \t.name\t\t= "sandbox_spl_test_2",
@@ -247,7 +247,7 @@ U_BOOT_DEVICE(spl_test4) = {
 \t.platdata_size\t= sizeof(dtv_spl_test4),
 };
 
-static struct dtd_sandbox_i2c_test dtv_i2c_at_0 = {
+static const struct dtd_sandbox_i2c_test dtv_i2c_at_0 = {
 };
 U_BOOT_DEVICE(i2c_at_0) = {
 \t.name\t\t= "sandbox_i2c_test",
@@ -255,7 +255,7 @@ U_BOOT_DEVICE(i2c_at_0) = {
 \t.platdata_size\t= sizeof(dtv_i2c_at_0),
 };
 
-static struct dtd_sandbox_pmic_test dtv_pmic_at_9 = {
+static const struct dtd_sandbox_pmic_test dtv_pmic_at_9 = {
 \t.low_power\t\t= true,
 \t.reg\t\t\t= {0x9, 0x0},
 };
@@ -287,7 +287,7 @@ struct dtd_target {
 with open(output) as infile:
 data = infile.read()
 self._CheckStrings(C_HEADER + '''
-static struct dtd_target dtv_phandle_target = {
+static const struct dtd_target dtv_phandle_target = {
 \t.intval\t\t\t= 0x0,
 };
 U_BOOT_DEVICE(phandle_target) = {
@@ -296,7 +296,7 @@ U_BOOT_DEVICE(phandle_target) = {
 \t.platdata_size\t= sizeof(dtv_phandle_target),
 };
 
-static struct dtd_target dtv_phandle2_target = {
+static const struct dtd_target dtv_phandle2_target = {
 \t.intval\t\t\t= 0x1,
 };
 U_BOOT_DEVICE(phandle2_target) = {
@@ -305,7 +305,7 @@ U_BOOT_DEVICE(phandle2_target) = {
 \t.platdata_size\t= sizeof(dtv_phandle2_target),
 };
 
-static struct dtd_target dtv_phandle3_target = {
+static const struct dtd_target dtv_phandle3_target = {
 \t.intval\t\t\t= 0x2,
 };
 U_BOOT_DEVICE(phandle3_target) = {
@@ -314,7 +314,7 @@ U_BOOT_DEVICE(phandle3_target) = {
 \t.platdata_size\t= sizeof(dtv_phandle3_target),
 };
 
-static struct dtd_source dtv_phandle_source = {
+static const struct dtd_source dtv_phandle_source = {
 \t.clocks\t\t\t= {
 \t\t\t{_phandle_target, {}},
 \t\t\t{_phandle2_target, {11}},
@@ -327,7 +327,7 @@ U_BOOT_DEVICE(phandle_source) = {
 \t.platdata_size\t= sizeof(dtv_phandle_source),
 };
 
-static struct dtd_source dtv_phandle_source2 = {
+static const struct dtd_source dtv_phandle_source2 = {
 \t.clocks\t\t\t= {
 \t\t\t{_phandle_target, {}},},
 };
@@ -363,7 +363,7 @@ struct dtd_target {
 with open(output) as infile:
 data = infile.read()
 self._CheckStrings(C_HEADER + '''
-static struct dtd_target dtv_phandle_target = {
+static const struct dtd_target dtv_phandle_target = {
 };
 U_BOOT_DEVICE(phandle_target) = {
 \t.name\t\t= "target",
@@ -371,7 +371,7 @@ U_BOOT_DEVICE(phandle_target) = {
 \t.platdata_size\t= sizeof(dtv_phandle_target),
 };
 
-static struct dtd_source dtv_phandle_source2 = {
+static const struct dtd_source dtv_phandle_source2 = {
 \t.clocks\t\t\t= {
 \t\t\t{_phandle_target, {}},},
 };
@@ -422,7 +422,7 @@ struct dtd_compat1 {
 with open(output) as infile:
 data = infile.read()
 self._CheckStrings(C_HEADER + '''
-static struct dtd_compat1 dtv_spl_test = {
+static const struct dtd_compat1 dtv_spl_test = {
 \t.intval\t\t\t= 0x1,
 };
 U_BOOT_DEVICE(spl_test) = {
@@ -456,7 +456,7 @@ struct dtd_test3 {
 with open(output) as infile:
 data = infile.read()
 self._CheckStrings(C_HEADER + '''
-static struct dtd_test1 dtv_test1 = {
+static const struct dtd_test1 dtv_test1 = {
 \t.reg\t\t\t= {0x1234, 0x5678},
 };
 U_BOOT_DEVICE(test1) 

Re: [U-Boot] [linux-sunxi] [PATCH 2/9] sunxi: clk: A80: add MMC clock support

2019-01-21 Thread Jagan Teki
On Sat, Jan 19, 2019 at 7:02 AM Andre Przywara  wrote:
>
> The A80 handles resets and clock gates for the MMC devices differently,
> outside of the CCU IP block. Consequently we have a separate clock
> device with a separate binding for that.
>
> Implement that with the respective clock gates and resets to allow the
> A80 taking part in the DM_MMC game.
>
> Signed-off-by: Andre Przywara 
> ---
>  drivers/clk/sunxi/clk_a80.c | 28 +++-
>  1 file changed, 27 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/sunxi/clk_a80.c b/drivers/clk/sunxi/clk_a80.c
> index d6dd6a1fa1..2bfc2ca9f5 100644
> --- a/drivers/clk/sunxi/clk_a80.c
> +++ b/drivers/clk/sunxi/clk_a80.c
> @@ -30,19 +30,45 @@ static const struct ccu_reset a80_resets[] = {
> [RST_BUS_UART5] = RESET(0x5b4, BIT(21)),
>  };
>
> +static const struct ccu_clk_gate a80_mmc_gates[] = {
> +   [0] = GATE(0x0, BIT(16)),
> +   [1] = GATE(0x4, BIT(16)),
> +   [2] = GATE(0x8, BIT(16)),
> +   [3] = GATE(0xc, BIT(16)),
> +};
> +
> +static const struct ccu_reset a80_mmc_resets[] = {
> +   [0] = GATE(0x0, BIT(18)),
> +   [1] = GATE(0x4, BIT(18)),
> +   [2] = GATE(0x8, BIT(18)),
> +   [3] = GATE(0xc, BIT(18)),
> +};
> +
>  static const struct ccu_desc a80_ccu_desc = {
> .gates = a80_gates,
> .resets = a80_resets,
>  };
>
> +static const struct ccu_desc a80_mmc_clk_desc = {
> +   .gates = a80_mmc_gates,
> +   .resets = a80_mmc_resets,
> +};
> +
>  static int a80_clk_bind(struct udevice *dev)
>  {
> -   return sunxi_reset_bind(dev, ARRAY_SIZE(a80_resets));
> +   ulong count = ARRAY_SIZE(a80_resets);
> +
> +   if (device_is_compatible(dev, "allwinner,allwinner,sun9i-a80-mmc"))
> +   count = ARRAY_SIZE(a80_mmc_resets);
> +
> +   return sunxi_reset_bind(dev, count);
>  }
>
>  static const struct udevice_id a80_ccu_ids[] = {
> { .compatible = "allwinner,sun9i-a80-ccu",
>   .data = (ulong)_ccu_desc },
> +   { .compatible = "allwinner,allwinner,sun9i-a80-mmc",

This can be "allwinner,sun9i-a80-mmc-config-clk"
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [linux-sunxi] [PATCH 2/9] sunxi: clk: A80: add MMC clock support

2019-01-21 Thread Andre Przywara
On Mon, 21 Jan 2019 18:02:17 +0800
Chen-Yu Tsai  wrote:

> On Mon, Jan 21, 2019 at 5:39 PM Andre Przywara
>  wrote:
> >
> > On Mon, 21 Jan 2019 17:34:25 +0800
> > Chen-Yu Tsai  wrote:
> >  
> > > On Mon, Jan 21, 2019 at 5:32 PM Jagan Teki
> > >  wrote:  
> > > >
> > > > On Sat, Jan 19, 2019 at 7:02 AM Andre Przywara
> > > >  wrote:  
> > > > >
> > > > > The A80 handles resets and clock gates for the MMC devices
> > > > > differently, outside of the CCU IP block. Consequently we
> > > > > have a separate clock device with a separate binding for that.
> > > > >
> > > > > Implement that with the respective clock gates and resets to
> > > > > allow the A80 taking part in the DM_MMC game.
> > > > >
> > > > > Signed-off-by: Andre Przywara 
> > > > > ---
> > > > >  drivers/clk/sunxi/clk_a80.c | 28 +++-
> > > > >  1 file changed, 27 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/clk/sunxi/clk_a80.c
> > > > > b/drivers/clk/sunxi/clk_a80.c index d6dd6a1fa1..2bfc2ca9f5
> > > > > 100644 --- a/drivers/clk/sunxi/clk_a80.c
> > > > > +++ b/drivers/clk/sunxi/clk_a80.c
> > > > > @@ -30,19 +30,45 @@ static const struct ccu_reset
> > > > > a80_resets[] = { [RST_BUS_UART5] = RESET(0x5b4,
> > > > > BIT(21)), };
> > > > >
> > > > > +static const struct ccu_clk_gate a80_mmc_gates[] = {
> > > > > +   [0] = GATE(0x0, BIT(16)),
> > > > > +   [1] = GATE(0x4, BIT(16)),
> > > > > +   [2] = GATE(0x8, BIT(16)),
> > > > > +   [3] = GATE(0xc, BIT(16)),
> > > > > +};
> > > > > +
> > > > > +static const struct ccu_reset a80_mmc_resets[] = {
> > > > > +   [0] = GATE(0x0, BIT(18)),
> > > > > +   [1] = GATE(0x4, BIT(18)),
> > > > > +   [2] = GATE(0x8, BIT(18)),
> > > > > +   [3] = GATE(0xc, BIT(18)),
> > > > > +};
> > > > > +
> > > > >  static const struct ccu_desc a80_ccu_desc = {
> > > > > .gates = a80_gates,
> > > > > .resets = a80_resets,
> > > > >  };
> > > > >
> > > > > +static const struct ccu_desc a80_mmc_clk_desc = {
> > > > > +   .gates = a80_mmc_gates,
> > > > > +   .resets = a80_mmc_resets,
> > > > > +};
> > > > > +
> > > > >  static int a80_clk_bind(struct udevice *dev)
> > > > >  {
> > > > > -   return sunxi_reset_bind(dev, ARRAY_SIZE(a80_resets));
> > > > > +   ulong count = ARRAY_SIZE(a80_resets);
> > > > > +
> > > > > +   if (device_is_compatible(dev,
> > > > > "allwinner,allwinner,sun9i-a80-mmc"))
> > > > > +   count = ARRAY_SIZE(a80_mmc_resets);
> > > > > +
> > > > > +   return sunxi_reset_bind(dev, count);
> > > > >  }
> > > > >
> > > > >  static const struct udevice_id a80_ccu_ids[] = {
> > > > > { .compatible = "allwinner,sun9i-a80-ccu",
> > > > >   .data = (ulong)_ccu_desc },
> > > > > +   { .compatible = "allwinner,allwinner,sun9i-a80-mmc",  
> > > >
> > > > This can be "allwinner,sun9i-a80-mmc-config-clk"  
> > >
> > > *Must*, not can. :)  
> >
> > Indeed, thanks for spotting this, Jagan.
> >
> > Also I just figured that we need to enable the parent clocks and
> > resets of this clock itself. I hope we can do this unconditionally,
> > even for the complex CCU, as enabling fixed-clocks should be
> > covered by the clock framework already.  
> 
> You need to deassert the reset control for the MMC clock config block,
> otherwise none of the toggles are going to work. And you can't assert
> it afterwards, otherwise the bits revert to default. Also, you need to
> enable the bus clock to be able to access the bits.

Yeah, that was what I was thinking of.

> So yeah, you can do this unconditionally. The Linux driver simply
> tries to be smarter and only enables the bus clock when toggling the
> bits.

With "unconditionally" I meant doing this in the probe routine, which
right now I *share* between the CCU clocks and this config clock. The
patch is pretty small because of this.

The CCU has only fixed parent clocks and no resets, so I think we can
add parent clock and optional reset handling there and should cover
this config clock as well, without providing a separate probe routine
(and the rest of the boilerplate).

Cheers,
Andre.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 9/9] arm: dts: sunxi: Enumerate MMC2 as MMC1

2019-01-21 Thread Jagan Teki
Environment and fastboot MMC devices are configured based number
of mmc slots defined on particular board in sunxi platform.

If number of slots are not more than 1, it assigns 0 which usually mmc
device on SD slot. With DM_MMC it is detected as 0 since mmc0 node always
be an mmc device.

If number of slots are more than 1, it assigns 1 which assumes 0 is mmc
device and 1 is emmc device. But with DM_MMC there is chance of detecting
emmc as device 2 since mmc1 is SDIO as per devicetree definition.

So override mmc2 to mmc1 in sunxi dtsi, this will eventually detect mmc2
as mmc 1 device even if the board dts has mmc0, mmc1, mmc2.

Some platforms like A20 has mmc0...mmc3, but there is no usecases now for
enabling all mmc controllers in any of A20 board dts files.

Signed-off-by: Jagan Teki 
---
 arch/arm/dts/sunxi-u-boot.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi
index 8a9f2a6417..fdd4c80aa4 100644
--- a/arch/arm/dts/sunxi-u-boot.dtsi
+++ b/arch/arm/dts/sunxi-u-boot.dtsi
@@ -1,6 +1,10 @@
 #include 
 
 / {
+   aliases {
+   mmc1 = 
+   };
+
binman {
filename = "u-boot-sunxi-with-spl.bin";
pad-byte = <0xff>;
-- 
2.18.0.321.gffc6fa0e3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 4/9] mmc: sunxi: Add mmc, emmc H5/A64 compatible

2019-01-21 Thread Jagan Teki
Added H5, A64 compatible for mmc and emmc.

Cc: Jaehoon Chung 
Signed-off-by: Jagan Teki 
---
 drivers/mmc/sunxi_mmc.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index ec4f227130..1259e627cc 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -697,6 +697,14 @@ static const struct udevice_id sunxi_mmc_ids[] = {
  .compatible = "allwinner,sun8i-a83t-emmc",
  .data = (ulong)_a10_variant,
},
+   {
+ .compatible = "allwinner,sun50i-a64-mmc",
+ .data = (ulong)_a10_variant,
+   },
+   {
+ .compatible = "allwinner,sun50i-a64-emmc",
+ .data = (ulong)_a10_variant,
+   },
{ /* sentinel */ }
 };
 
-- 
2.18.0.321.gffc6fa0e3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 7/9] dm: mmc: sunxi: Add CLK and RESET support

2019-01-21 Thread Jagan Teki
Now CLK and RESET driver for Allwinner SoC are available,
so add the relevant operations on mmc sunxi driver.

Cc: Jaehoon Chung 
Signed-off-by: Jagan Teki 
---
Changes for v3:
- Grab changes for ML

 drivers/mmc/sunxi_mmc.c | 52 +
 1 file changed, 47 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 0c443a732d..3c17958c95 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -8,10 +8,12 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -21,7 +23,6 @@
 
 #ifdef CONFIG_DM_MMC
 struct sunxi_mmc_variant {
-   u16 gate_offset;
u16 mclk_offset;
 };
 #endif
@@ -41,6 +42,8 @@ struct sunxi_mmc_priv {
struct mmc_config cfg;
 #ifdef CONFIG_DM_MMC
const struct sunxi_mmc_variant *variant;
+   struct clk clk_ahb;
+   struct reset_ctl reset;
 #endif
 };
 
@@ -602,6 +605,32 @@ static const struct dm_mmc_ops sunxi_mmc_ops = {
.get_cd = sunxi_mmc_getcd,
 };
 
+static int sunxi_mmc_enable(struct udevice *dev)
+{
+   struct sunxi_mmc_priv *priv = dev_get_priv(dev);
+   int ret;
+
+   ret = clk_enable(>clk_ahb);
+   if (ret) {
+   dev_err(dev, "failed to enable AHB clock\n");
+   return ret;
+   }
+
+   if (reset_valid(>reset)) {
+   ret = reset_deassert(>reset);
+   if (ret) {
+   dev_err(dev, "failed to deassert reset\n");
+   goto err_clk_ahb;
+   }
+   }
+
+   return 0;
+
+err_clk_ahb:
+   clk_disable(>clk_ahb);
+   return ret;
+}
+
 static int sunxi_mmc_probe(struct udevice *dev)
 {
struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
@@ -609,7 +638,7 @@ static int sunxi_mmc_probe(struct udevice *dev)
struct sunxi_mmc_priv *priv = dev_get_priv(dev);
struct mmc_config *cfg = >cfg;
struct ofnode_phandle_args args;
-   u32 *gate_reg, *ccu_reg;
+   u32 *ccu_reg;
int bus_width, ret;
 
cfg->name = dev->name;
@@ -641,8 +670,22 @@ static int sunxi_mmc_probe(struct udevice *dev)
priv->mmc_no = ((uintptr_t)priv->reg - SUNXI_MMC0_BASE) / 0x1000;
priv->mclkreg = (void *)ccu_reg +
(priv->variant->mclk_offset + (priv->mmc_no * 4));
-   gate_reg = (void *)ccu_reg + priv->variant->gate_offset;
-   setbits_le32(gate_reg, BIT(AHB_GATE_OFFSET_MMC(priv->mmc_no)));
+
+   ret = clk_get_by_name(dev, "ahb", >clk_ahb);
+   if (ret) {
+   dev_err(dev, "failed to get AHB clock\n");
+   return ret;
+   }
+
+   ret = reset_get_by_name(dev, "ahb", >reset);
+   if (ret && ret != -ENOENT) {
+   dev_err(dev, "failed to get reset\n");
+   return ret;
+   }
+
+   ret = sunxi_mmc_enable(dev);
+   if (ret)
+   return ret;
 
ret = mmc_set_mod_clk(priv, 2400);
if (ret)
@@ -676,7 +719,6 @@ static int sunxi_mmc_bind(struct udevice *dev)
 }
 
 static const struct sunxi_mmc_variant sun4i_a10_variant = {
-   .gate_offset = 0x60,
.mclk_offset = 0x88,
 };
 
-- 
2.18.0.321.gffc6fa0e3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 6/9] mmc: sunxi: Add DM_MMC support for A80

2019-01-21 Thread Jagan Teki
Unlike other Allwinner SoC's, A80 comes with different ahb
gate clock offset values and also has mmc common controller.
So support them via driver data.

Cc: Rask Ingemann Lambertsen 
Cc: Jaehoon Chung 
Signed-off-by: Jagan Teki 
---
 drivers/mmc/sunxi_mmc.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 1e13a0665d..0c443a732d 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -680,6 +680,10 @@ static const struct sunxi_mmc_variant sun4i_a10_variant = {
.mclk_offset = 0x88,
 };
 
+static const struct sunxi_mmc_variant sun9i_a80_variant = {
+   .mclk_offset = 0x410,
+};
+
 static const struct sunxi_mmc_variant sun50i_h6_variant = {
.mclk_offset = 0x830,
 };
@@ -701,6 +705,10 @@ static const struct udevice_id sunxi_mmc_ids[] = {
  .compatible = "allwinner,sun8i-a83t-emmc",
  .data = (ulong)_a10_variant,
},
+   {
+ .compatible = "allwinner,sun9i-a80-mmc",
+ .data = (ulong)_a80_variant,
+   },
{
  .compatible = "allwinner,sun50i-a64-mmc",
  .data = (ulong)_a10_variant,
-- 
2.18.0.321.gffc6fa0e3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 2/9] sunxi: clk: A80: add MMC clock support

2019-01-21 Thread Jagan Teki
From: Andre Przywara 

The A80 handles resets and clock gates for the MMC devices differently,
outside of the CCU IP block. Consequently we have a separate clock
device with a separate binding for that.

Implement that with the respective clock gates and resets to allow the
A80 taking part in the DM_MMC game.

Signed-off-by: Andre Przywara 
[jagan: fix a80 mmc clock config compatible]
Signed-off-by: Jagan Teki 
---
 drivers/clk/sunxi/clk_a80.c | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi/clk_a80.c b/drivers/clk/sunxi/clk_a80.c
index d6dd6a1fa1..efcc7a433d 100644
--- a/drivers/clk/sunxi/clk_a80.c
+++ b/drivers/clk/sunxi/clk_a80.c
@@ -30,19 +30,45 @@ static const struct ccu_reset a80_resets[] = {
[RST_BUS_UART5] = RESET(0x5b4, BIT(21)),
 };
 
+static const struct ccu_clk_gate a80_mmc_gates[] = {
+   [0] = GATE(0x0, BIT(16)),
+   [1] = GATE(0x4, BIT(16)),
+   [2] = GATE(0x8, BIT(16)),
+   [3] = GATE(0xc, BIT(16)),
+};
+
+static const struct ccu_reset a80_mmc_resets[] = {
+   [0] = GATE(0x0, BIT(18)),
+   [1] = GATE(0x4, BIT(18)),
+   [2] = GATE(0x8, BIT(18)),
+   [3] = GATE(0xc, BIT(18)),
+};
+
 static const struct ccu_desc a80_ccu_desc = {
.gates = a80_gates,
.resets = a80_resets,
 };
 
+static const struct ccu_desc a80_mmc_clk_desc = {
+   .gates = a80_mmc_gates,
+   .resets = a80_mmc_resets,
+};
+
 static int a80_clk_bind(struct udevice *dev)
 {
-   return sunxi_reset_bind(dev, ARRAY_SIZE(a80_resets));
+   ulong count = ARRAY_SIZE(a80_resets);
+
+   if (device_is_compatible(dev, "allwinner,allwinner,sun9i-a80-mmc"))
+   count = ARRAY_SIZE(a80_mmc_resets);
+
+   return sunxi_reset_bind(dev, count);
 }
 
 static const struct udevice_id a80_ccu_ids[] = {
{ .compatible = "allwinner,sun9i-a80-ccu",
  .data = (ulong)_ccu_desc },
+   { .compatible = "allwinner,sun9i-a80-mmc-config-clk",
+ .data = (ulong)_mmc_clk_desc },
{ }
 };
 
-- 
2.18.0.321.gffc6fa0e3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 12/60] keymile: Make distinct kmeter1, and kmcoge5ne configs

2019-01-21 Thread Mario Six
The kmeter1, and kmcoge5ne boards also build from the same config
file with #ifdef logic.

Create a separate include config for each board with the #ifdef logic
resolved as needed.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Combined config creation and simplification patches

---
 arch/powerpc/cpu/mpc83xx/Kconfig  |  11 +-
 board/keymile/km83xx/Kconfig  |  17 +-
 board/keymile/km83xx/km83xx.c |   2 +-
 configs/kmcoge5ne_defconfig   |   3 +-
 configs/kmeter1_defconfig |   3 +-
 include/configs/{km8360.h => kmcoge5ne.h} |  29 --
 include/configs/kmeter1.h | 458 ++
 7 files changed, 485 insertions(+), 38 deletions(-)
 rename include/configs/{km8360.h => kmcoge5ne.h} (95%)
 create mode 100644 include/configs/kmeter1.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 1ebb092f0bf..29d84f363d1 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -80,8 +80,15 @@ config TARGET_IDS8313
select DM
imply CMD_DM
 
-config TARGET_KM8360
-   bool "Support km8360"
+config TARGET_KMETER1
+   bool "Support kmeter1"
+   select ARCH_MPC8360
+   imply CMD_CRAMFS
+   imply CMD_DIAG
+   imply FS_CRAMFS
+
+config TARGET_KMCOGE5NE
+   bool "Support kmcoge5ne"
select ARCH_MPC8360
imply CMD_CRAMFS
imply CMD_DIAG
diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig
index 0c4fa0b7fdb..f17034f 100644
--- a/board/keymile/km83xx/Kconfig
+++ b/board/keymile/km83xx/Kconfig
@@ -1,4 +1,4 @@
-if TARGET_KM8360
+if TARGET_KMETER1
 
 config SYS_BOARD
default "km83xx"
@@ -7,7 +7,20 @@ config SYS_VENDOR
default "keymile"
 
 config SYS_CONFIG_NAME
-   default "km8360"
+   default "kmeter1"
+
+endif
+
+if TARGET_KMCOGE5NE
+
+config SYS_BOARD
+   default "km83xx"
+
+config SYS_VENDOR
+   default "keymile"
+
+config SYS_CONFIG_NAME
+   default "kmcoge5ne"
 
 endif
 
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 12044ee0d70..1fd6f919014 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -271,7 +271,7 @@ int last_stage_init(void)
}
 #endif
 
-#if defined(CONFIG_KMCOGE5NE)
+#if defined(CONFIG_TARGET_KMCOGE5NE)
struct bfticu_iomap *base =
(struct bfticu_iomap *)CONFIG_SYS_BFTIC3_BASE;
u8 dip_switch = in_8((u8 *)&(base->mswitch)) & BFTICU_DIPSWITCH_MASK;
diff --git a/configs/kmcoge5ne_defconfig b/configs/kmcoge5ne_defconfig
index cb47b0b7fde..b7c42fa9cbe 100644
--- a/configs/kmcoge5ne_defconfig
+++ b/configs/kmcoge5ne_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_KM8360=y
+CONFIG_TARGET_KMCOGE5NE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMCOGE5NE"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/kmeter1_defconfig b/configs/kmeter1_defconfig
index 0c3fadfcf8a..1773f74358e 100644
--- a/configs/kmeter1_defconfig
+++ b/configs/kmeter1_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_KM8360=y
+CONFIG_TARGET_KMETER1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMETER1"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/include/configs/km8360.h b/include/configs/kmcoge5ne.h
similarity index 95%
rename from include/configs/km8360.h
rename to include/configs/kmcoge5ne.h
index 67d310c42cf..1cff0a19f1b 100644
--- a/include/configs/km8360.h
+++ b/include/configs/kmcoge5ne.h
@@ -12,11 +12,6 @@
 #define CONFIG_SYS_KMBEC_FPGA_BASE 0xE800
 #define CONFIG_SYS_KMBEC_FPGA_SIZE 64
 
-#if defined CONFIG_KMETER1
-#define CONFIG_HOSTNAME"kmeter1"
-#define CONFIG_KM_BOARD_NAME   "kmeter1"
-#define CONFIG_KM_DEF_NETDEV   "netdev=eth2\0"
-#elif defined CONFIG_KMCOGE5NE
 #define CONFIG_HOSTNAME"kmcoge5ne"
 #define CONFIG_KM_BOARD_NAME   "kmcoge5ne"
 #define CONFIG_KM_DEF_NETDEV   "netdev=eth1\0"
@@ -28,9 +23,6 @@
 
 #define CONFIG_KM_UBI_PARTITION_NAME_BOOT  "ubi0"
 #define CONFIG_KM_UBI_PARTITION_NAME_APP   "ubi1"
-#else
-#error ("Board not supported")
-#endif
 
 /*
  * High Level Configuration Options
@@ -165,10 +157,8 @@
 #define CONFIG_UEC_ETH
 #define CONFIG_ETHPRIME"UEC0"
 
-#if !defined(CONFIG_ARCH_MPC8309)
 #define CONFIG_UEC_ETH1/* GETH1 */
 #define UEC_VERBOSE_DEBUG  1
-#endif
 
 #ifdef CONFIG_UEC_ETH1
 #define CONFIG_SYS_UEC1_UCC_NUM3   /* UCC4 */
@@ -357,7 +347,6 @@
 
 #define CONFIG_SYS_DDR_SDRAM_CFG2  0x00401000
 
-#ifdef CONFIG_KMCOGE5NE
 /**
  * KMCOGE5NE has 512 MB RAM
  */
@@ -368,12 +357,6 @@
CSCONFIG_BANK_BIT_3 | \
CSCONFIG_ROW_BIT_13 | \
  

[U-Boot] [PATCH v3 25/60] MPC8315ERDB: Remove CONFIG_MPC8315ERDB

2019-01-21 Thread Mario Six
CONFIG_MPC8315ERDB is unused, and TARGET_MPC8315ERDB could replace it.

Hence, get rid of CONFIG_MPC8315ERDB.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 include/configs/MPC8315ERDB.h | 1 -
 scripts/config_whitelist.txt  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index a2b5b07ea9c..c373a0ab4c1 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -22,7 +22,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001 /* E300 family */
-#define CONFIG_MPC8315ERDB 1 /* MPC8315ERDB board specific */
 
 /*
  * System Clock Setup
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 3691246aaee..e13f290bfad 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1247,7 +1247,6 @@ CONFIG_MMC_SPI_SPEED
 CONFIG_MMC_SUNXI_SLOT
 CONFIG_MMU
 CONFIG_MONITOR_IS_IN_RAM
-CONFIG_MPC8315ERDB
 CONFIG_MPC837XEMDS
 CONFIG_MPC837XERDB
 CONFIG_MPC83XX_GPIO
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] env: Fix saving environment to "bad CRC" location

2019-01-21 Thread Simon Goldschmidt

Am 19.01.2019 um 14:28 schrieb Sam Protsenko:

Hi Simon,

On Fri, Jan 18, 2019 at 10:46 PM Simon Goldschmidt
 wrote:




Am Fr., 18. Jan. 2019, 20:20 hat Sam Protsenko  
geschrieben:


In case when the environment on some location is malformed (CRC isn't
matching), there is a chance we won't be able to save the environment to
that location. For example, consider the case when we only have the
environment on eMMC, but it's zeroed out. In that case, we won't be able
to "env save" to it, because of "bad CRC" error. That's happening
because in env_load() function we consider malformed environment as
incorrect one, and  defaulting to the location with highest (0)
priority, which can be different from one we are dealing with right now
(e.g., highest priority can be ENV_FAT on SD card, which is not
inserted, but we want to use ENV_MMC on eMMC, where we were booted
from).

This issue began to reproduce after commit d30ba2315ae3 ("u-boot: remove
driver lookup loop from env_save()") on BeagleBone Black, but that
commit didn't introduce the wrong logic, it just changed the behavior
for default location to use, merely revealing this issue.



In my opinion, this automatism of selecting a driver to save the env can always 
produce a behaviour that is unexpected to the user.



Completely agree with you. That's my thoughts exactly, when I ran into
this issue.


I wonder if it wouldn't be better to either let the board define some default 
env driver for saving or the user should specify the driver as argument to 'env 
save'.



Yeah, if I have some spare time, gonna implement something like this,
at least as RFC patch. We can start full-scale discussion in that
thread, as there could be more possible ways of fixing that, and we
should consider different platforms when deciding on that. But I think
we should take this patch anyway, as "env save" without arguments
should be left too, for compatibility reasons.


Note that this is not an objection to your oatches, I'm just not content with 
the current auto-selection...



Yeah, but that's another matter, I hope I will get to that soon.
Meanwhile, can you please add your "Reviewed-by" tag, if the code
looks ok to you? With this patch we won't have semi-bricked boards, at
least.


Well, I don't know if that's another matter. This multi-env code is 
pretty new, and it seems to me it hasn't fully worked, yet, for corner 
cases. Being like that, I'm not totally sure your change is OK for 
everyone using more than one env source. What if the first device 
returning an error code was an unexpected error? You'll then save your 
environment to some other storage without noticing... Is that expected 
behaviour for multi-env support? Or shouldn't we rather return an error 
and let the user supply the target device instead?


I just fear your change might break things for others.

I'm not saying your patch is totally wrong, just thinking. I did use 
multi-env support, but never checked error paths back then...


Regards,
Simon




Regards,
Simon



To fix that, let's implement next logic in env_load():
   1. Try to find out correct environment; if found -- use it
   2. If working environment wasn't found, but we found malformed one
  (with bad CRC), let's use it for further "env save". But make sure
  to use malformed environment location with highest priority.
   3. If neither correct nor malformed environment was found, let's
  default to environment location with highest priority (0)

Steps to reproduce mentioned issue on BeagleBone Black (fixed in this
patch):

1. Boot from SD card and erase eMMC in U-Boot shell:
=> mmc dev 1
=> mmc erase 0 10
=> gpt write mmc 1 $partitions
2. Write new SPL and U-Boot to eMMC; the rest of eMMC will stay filled
with zeroes
3. Boot from eMMC; try to do:
=> env save
4. Observe the error (incorrect behavior). Correct behavior: environment
should be stored correctly on eMMC, in spite of it has "bad CRC"

Fixes: d30ba2315ae3 ("u-boot: remove driver lookup loop from env_save()")
Signed-off-by: Sam Protsenko 
---
  env/env.c | 25 +++--
  1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/env/env.c b/env/env.c
index 003509d342..4b417b90a2 100644
--- a/env/env.c
+++ b/env/env.c
@@ -177,6 +177,7 @@ int env_get_char(int index)
  int env_load(void)
  {
 struct env_driver *drv;
+   int best_prio = -1;
 int prio;

 for (prio = 0; (drv = env_driver_lookup(ENVOP_LOAD, prio)); prio++) {
@@ -195,20 +196,32 @@ int env_load(void)
  * one message.
  */
 ret = drv->load();
-   if (ret) {
-   debug("Failed (%d)\n", ret);
-   } else {
+   if (!ret) {
 printf("OK\n");
 return 0;
+   } else if (ret == -ENOMSG) {
+   /* Handle "bad CRC" case */
+   if (best_prio == -1)
+

Re: [U-Boot] env: sf: fix environment in SPI NOR

2019-01-21 Thread Heiko Schocher

Hello Tom,

Am 19.01.2019 um 03:54 schrieb Tom Rini:

On Fri, Jan 18, 2019 at 10:45:56AM +0100, Heiko Schocher wrote:


commit 9a9d66f5eff0 ("env: add spi_flash_read_env function")

breaks Environment functionality, as it reads only
until 2 \0 are found, but fills the buffer with 0x0
instead 0xff which leads in an incorrect crc sum.

Fix: init the read buffer with 0xff instead 0x00

Signed-off-by: Heiko Schocher 


Applied to u-boot/master, thanks!


I am sorry, this patch was nonsense. After erasing the flash, and
saving a default Environment, the CONFIG_ENV_SIZE bytes are filled
with 0x00. So the memset with 0x00 should be OK. I have no idea
what gone wrong on my board :-(

I am not sure what gone wrong here, so, please can you revert this
patch?

bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] arm64: mvebu: Add basic support for uDPU board

2019-01-21 Thread Stefan Roese

On 15.01.19 12:50, Vladimir Vid wrote:

This adds initial support for micro-DPU (uDPU) board which is based on 
Armada-3720 SoC.
micro-DPU is the single-port FTTdp "distribution point unit" made by Methode 
Electronics
which offers complete modularity with replaceable SFP modules both for uplink 
and downlink
(G.hn over twisted-pair, G.hn over coax, 1G and 2.5G Ethernet over Cat-5e 
cable).

On-board features:
- 512 MiB DDR3
- 2 x 2.5G SFP via HSGMII SERDES interface to the A3720 SoC
- USB 2.0 Type-C connector
- 4GB eMMC
- ETSI TS 101548 reverse powering via twisted pair (RJ45) or coax (F Type)

Cc: Luka Perkov 
Cc: Luis Torres 
Cc: Scott Roberts 
Cc: Paul Arola 
Signed-off-by: Vladimir Vid 

Cc: Chris Packham 
Cc: Stefan Roese 
---

v2:
- updated compatible string
- added 'u-boot,dm-pre-reloc' to spi0 and spi-flash nodes
- updated board defconfig (properly with savedefconfig this time)
- removed unused PCA driver from defconfig


This patch generates the following error:

drivers/mmc/mv_sdhci.c: In function ‘mv_sdh_init’:
drivers/mmc/mv_sdhci.c:91:9: warning: implicit declaration of function 
‘add_sdhci’ [-Wimplicit-function-declaration]
  return add_sdhci(host, 0, min_clk);
 ^

Please fix and resubmit.

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v4 00/10] Changes for Turris Mox

2019-01-21 Thread Stefan Roese

On 17.12.18 16:10, Marek Behún wrote:

This is the fourth version of patches for Turris Mox.

Changes from previous version:

- changed patch subject prefix from board: turris_mox to arm: mvebu: turris_mox 
as requested by Stefan

- added Reviewed-by Stefan

- add description of the changes for watchdog in patch 6

- patch 9 reworked to use get_ram_size instead of reading OTP


Whole series applied to u-boot-marvell/master

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 1/2] efi_loader: implement GetNextVariableName()

2019-01-21 Thread Heinrich Schuchardt
From: AKASHI Takahiro 

The current GetNextVariableName() is a placeholder.
With this patch, it works well as expected.

Signed-off-by: AKASHI Takahiro 
rebased on efi-next
Reviewed-by: Heinrich Schuchardt 
---
v3:
rebase on efi-next
v2:
update variable_name_size in GetNextVariableName
add more comments
change some internal variable names
---
 lib/efi_loader/efi_variable.c | 154 +-
 1 file changed, 152 insertions(+), 2 deletions(-)

diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
index eea7f68b85..993bf3ce90 100644
--- a/lib/efi_loader/efi_variable.c
+++ b/lib/efi_loader/efi_variable.c
@@ -9,6 +9,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #define READ_ONLY BIT(31)
 
@@ -203,14 +206,161 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name,
return EFI_EXIT(EFI_SUCCESS);
 }
 
-/* 
http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#GetNextVariableName.28.29
 */
+static char *efi_variables_list;
+static char *efi_cur_variable;
+
+/**
+ * parse_uboot_variable() - parse a u-boot variable and get uefi-related
+ * information
+ * @variable:  whole data of u-boot variable (ie. name=value)
+ * @variable_name_size: size of variable_name buffer in byte
+ * @variable_name: name of uefi variable in u16, null-terminated
+ * @vendor:vendor's guid
+ * @attributes:attributes
+ *
+ * A uefi variable is encoded into a u-boot variable as described above.
+ * This function parses such a u-boot variable and retrieve uefi-related
+ * information into respective parameters. In return, variable_name_size
+ * is the size of variable name including NULL.
+ *
+ * Return: EFI_SUCCESS if parsing is OK, EFI_NOT_FOUND when
+   the entire variable list has been returned,
+   otherwise non-zero status code
+ */
+static efi_status_t parse_uboot_variable(char *variable,
+efi_uintn_t *variable_name_size,
+u16 *variable_name,
+const efi_guid_t *vendor,
+u32 *attributes)
+{
+   char *guid, *name, *end, c;
+   unsigned long name_len;
+   u16 *p;
+
+   guid = strchr(variable, '_');
+   if (!guid)
+   return EFI_INVALID_PARAMETER;
+   guid++;
+   name = strchr(guid, '_');
+   if (!name)
+   return EFI_INVALID_PARAMETER;
+   name++;
+   end = strchr(name, '=');
+   if (!end)
+   return EFI_INVALID_PARAMETER;
+
+   name_len = end - name;
+   if (*variable_name_size < (name_len + 1)) {
+   *variable_name_size = name_len + 1;
+   return EFI_BUFFER_TOO_SMALL;
+   }
+   end++; /* point to value */
+
+   /* variable name */
+   p = variable_name;
+   utf8_utf16_strncpy(, name, name_len);
+   variable_name[name_len] = 0;
+   *variable_name_size = name_len + 1;
+
+   /* guid */
+   c = *(name - 1);
+   *(name - 1) = '\0'; /* guid need be null-terminated here */
+   uuid_str_to_bin(guid, (unsigned char *)vendor, UUID_STR_FORMAT_GUID);
+   *(name - 1) = c;
+
+   /* attributes */
+   parse_attr(end, attributes);
+
+   return EFI_SUCCESS;
+}
+
+/**
+ * efi_get_next_variable_name() - enumerate the current variable names
+ * @variable_name_size:size of variable_name buffer in byte
+ * @variable_name: name of uefi variable's name in u16
+ * @vendor:vendor's guid
+ *
+ * This function implements the GetNextVariableName service.
+ *
+ * See the Unified Extensible Firmware Interface (UEFI) specification for
+ * details: http://wiki.phoenix.com/wiki/index.php/
+ * EFI_RUNTIME_SERVICES#GetNextVariableName.28.29
+ *
+ * Return: status code
+ */
 efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size,
   u16 *variable_name,
   const efi_guid_t *vendor)
 {
+   char *native_name, *variable;
+   ssize_t name_len, list_len;
+   char regex[256];
+   char * const regexlist[] = {regex};
+   u32 attributes;
+   int i;
+   efi_status_t ret;
+
EFI_ENTRY("%p \"%ls\" %pUl", variable_name_size, variable_name, vendor);
 
-   return EFI_EXIT(EFI_DEVICE_ERROR);
+   if (!variable_name_size || !variable_name || !vendor)
+   EFI_EXIT(EFI_INVALID_PARAMETER);
+
+   if (variable_name[0]) {
+   /* check null-terminated string */
+   for (i = 0; i < *variable_name_size; i++)
+   if (!variable_name[i])
+   break;
+   if (i >= *variable_name_size)
+   return EFI_EXIT(EFI_INVALID_PARAMETER);
+
+   

Re: [U-Boot] [RFC 1/9] Arm: dts: imx7d-pico: Import Linux pico-pi dts

2019-01-21 Thread Offouga Joris


> Le 21 janv. 2019 à 11:58, Bryan O'Donoghue  a 
> écrit :
> 
> 
> 
>> On 21/01/2019 10:34, jorisoffouga wrote:
>>> Le 21/01/2019 à 10:52, Bryan O'Donoghue a écrit :
>>> 
>>> 
 On 20/01/2019 21:18, Joris Offouga wrote:
 This patch imports the Linux kernel base board imx7d-pico.dtsi and specific
 dts for imx7d-pico-pi
>>> 
>>> I recommend including the upstream Linux SHA in the commit log to make it 
>>> easier to validate against and also if any changes/bugfixes go in upstream 
>>> makes it easier to cherry-pick onto the local dts in u-boot.
>>> 
>> Indeed, i add to v2.
>> I have a problem with pmic, can you watch the patch corresponding to the 
>> pmic ?
>> https://patchwork.ozlabs.org/patch/1028229/
> 
> Let me add Jun, he's better place than me to help with this.
Thanks , i'm waiting for this help 
Joris 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 07/60] keymile: Make distinct kmtegr1, kmvect1, suvd3 configs

2019-01-21 Thread Mario Six
The kmtegr1, kmvect1, and suvd3 boards all use the same config include
file with lots of #ifdefs in it.

The Kconfig migation will become easier if we get rid of these #ifdefs
first.

Hence, create distinct config include files for these boards, and unwind
the #ifdef logic in these config files to only include the options
necessary for each board.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Combined config creation and simplification patches.

---
 arch/powerpc/cpu/mpc83xx/Kconfig |  16 +++-
 board/keymile/km83xx/Kconfig |  26 ++
 configs/kmtegr1_defconfig|   2 +-
 configs/kmvect1_defconfig|   2 +-
 include/configs/kmtegr1.h| 100 +++
 include/configs/kmvect1.h| 133 +++
 include/configs/suvd3.h  |  94 --
 7 files changed, 274 insertions(+), 99 deletions(-)
 create mode 100644 include/configs/kmtegr1.h
 create mode 100644 include/configs/kmvect1.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index e41f4d1f9a3..59e0c9a8d08 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -89,9 +89,19 @@ config TARGET_KM8360
 
 config TARGET_SUVD3
bool "Support suvd3"
-   select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMTEGR1"
-   select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMVECT1"
-   select ARCH_MPC832X if SYS_EXTRA_OPTIONS="SUVD3"
+   select ARCH_MPC832X
+   imply CMD_CRAMFS
+   imply FS_CRAMFS
+
+config TARGET_KMVECT1
+   bool "Support kmvect1"
+   select ARCH_MPC8309
+   imply CMD_CRAMFS
+   imply FS_CRAMFS
+
+config TARGET_KMTEGR1
+   bool "Support kmtegr1"
+   select ARCH_MPC8309
imply CMD_CRAMFS
imply FS_CRAMFS
 
diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig
index d6c594c96ac..d52ee9117b5 100644
--- a/board/keymile/km83xx/Kconfig
+++ b/board/keymile/km83xx/Kconfig
@@ -11,6 +11,32 @@ config SYS_CONFIG_NAME
 
 endif
 
+if TARGET_KMVECT1
+
+config SYS_BOARD
+   default "km83xx"
+
+config SYS_VENDOR
+   default "keymile"
+
+config SYS_CONFIG_NAME
+   default "kmvect1"
+
+endif
+
+if TARGET_KMTEGR1
+
+config SYS_BOARD
+   default "km83xx"
+
+config SYS_VENDOR
+   default "keymile"
+
+config SYS_CONFIG_NAME
+   default "kmtegr1"
+
+endif
+
 if TARGET_SUVD3
 
 config SYS_BOARD
diff --git a/configs/kmtegr1_defconfig b/configs/kmtegr1_defconfig
index 40181758e9c..38a861b8610 100644
--- a/configs/kmtegr1_defconfig
+++ b/configs/kmtegr1_defconfig
@@ -1,7 +1,7 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_SUVD3=y
+CONFIG_TARGET_KMTEGR1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="KMTEGR1"
diff --git a/configs/kmvect1_defconfig b/configs/kmvect1_defconfig
index 74b688fb5f9..2f71ee75198 100644
--- a/configs/kmvect1_defconfig
+++ b/configs/kmvect1_defconfig
@@ -1,7 +1,7 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_SUVD3=y
+CONFIG_TARGET_KMVECT1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="KMVECT1"
diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
new file mode 100644
index 000..69397ae5ae4
--- /dev/null
+++ b/include/configs/kmtegr1.h
@@ -0,0 +1,100 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2006 Freescale Semiconductor, Inc.
+ *Dave Liu 
+ *
+ * Copyright (C) 2007 Logic Product Development, Inc.
+ *Peter Barada 
+ *
+ * Copyright (C) 2007 MontaVista Software, Inc.
+ *Anton Vorontsov 
+ *
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * High Level Configuration Options
+ */
+
+/* This needs to be set prior to including km/km83xx-common.h */
+
+#define CONFIG_HOSTNAME   "kmtegr1"
+#define CONFIG_KM_BOARD_NAME   "kmtegr1"
+#define CONFIG_KM_UBI_PARTITION_NAME_BOOT  "ubi0"
+#define CONFIG_KM_UBI_PARTITION_NAME_APP   "ubi1"
+
+#define CONFIG_ENV_ADDR0xF010
+#define CONFIG_ENV_OFFSET  0x10
+
+#define CONFIG_NAND_ECC_BCH
+#define CONFIG_NAND_KMETER1
+#define CONFIG_SYS_MAX_NAND_DEVICE 1
+#define NAND_MAX_CHIPS 1
+
+/* include common defines/options for all 8309 Keymile boards */
+#include "km/km8309-common.h"
+/* must be after the include because KMBEC_FPGA is otherwise undefined */
+#define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
+
+#define CONFIG_SYS_APP1_BASE   0xA000
+#define CONFIG_SYS_APP1_SIZE   256 /* Megabytes */
+#define CONFIG_SYS_APP2_BASE   0xB000
+#define CONFIG_SYS_APP2_SIZE   256 /* Megabytes */
+
+/* EEprom support */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
+
+/*
+ * Init Local Bus Memory Controller:
+ *
+ 

[U-Boot] [PATCH v3 09/60] keymile: Unroll includes

2019-01-21 Thread Mario Six
To further simplify config include files, unroll the km/km8309-common.h
and km/km8321-common.h include files.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 include/configs/km8309-common.h | 174 
 include/configs/km8321-common.h | 139 -
 include/configs/kmtegr1.h   | 164 +-
 include/configs/kmvect1.h   | 164 +-
 include/configs/suvd3.h | 116 -
 include/configs/tuxx1.h | 115 -
 6 files changed, 551 insertions(+), 321 deletions(-)
 delete mode 100644 include/configs/km8309-common.h
 delete mode 100644 include/configs/km8321-common.h

diff --git a/include/configs/km8309-common.h b/include/configs/km8309-common.h
deleted file mode 100644
index 3bd334c5152..000
--- a/include/configs/km8309-common.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2012 Keymile AG
- *Gerlando Falauto 
- *
- * Based on km8321-common.h, see respective copyright notice for credits
- */
-
-#ifndef __CONFIG_KM8309_COMMON_H
-#define __CONFIG_KM8309_COMMON_H
-
-/*
- * High Level Configuration Options
- */
-#define CONFIG_E3001   /* E300 family */
-#define CONFIG_QE  1   /* Has QE */
-
-#define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
-
-/* include common defines/options for all 83xx Keymile boards */
-#include "km83xx-common.h"
-
-/* QE microcode/firmware address */
-#define CONFIG_SYS_QE_FMAN_FW_IN_NOR
-/* between the u-boot partition and env */
-#ifndef CONFIG_SYS_QE_FW_ADDR
-#define CONFIG_SYS_QE_FW_ADDR   0xF00C
-#endif
-
-/*
- * System IO Config
- */
-/* 0x14000180 SICR_1 */
-#define CONFIG_SYS_SICRL (0\
-   | SICR_1_UART1_UART1RTS \
-   | SICR_1_I2C_CKSTOP \
-   | SICR_1_IRQ_A_IRQ  \
-   | SICR_1_IRQ_B_IRQ  \
-   | SICR_1_GPIO_A_GPIO\
-   | SICR_1_GPIO_B_GPIO\
-   | SICR_1_GPIO_C_GPIO\
-   | SICR_1_GPIO_D_GPIO\
-   | SICR_1_GPIO_E_GPIO\
-   | SICR_1_GPIO_F_GPIO\
-   | SICR_1_USB_A_UART2S   \
-   | SICR_1_USB_B_UART2RTS \
-   | SICR_1_FEC1_FEC1  \
-   | SICR_1_FEC2_FEC2  \
-   )
-
-/* 0x00080400 SICR_2 */
-#define CONFIG_SYS_SICRH (0\
-   | SICR_2_FEC3_FEC3  \
-   | SICR_2_HDLC1_A_HDLC1  \
-   | SICR_2_ELBC_A_LA  \
-   | SICR_2_ELBC_B_LCLK\
-   | SICR_2_HDLC2_A_HDLC2  \
-   | SICR_2_USB_D_GPIO \
-   | SICR_2_PCI_PCI\
-   | SICR_2_HDLC1_B_HDLC1  \
-   | SICR_2_HDLC1_C_HDLC1  \
-   | SICR_2_HDLC2_B_GPIO   \
-   | SICR_2_HDLC2_C_HDLC2  \
-   | SICR_2_QUIESCE_B  \
-   )
-
-/* GPR_1 */
-#define CONFIG_SYS_GPR1  0x50008060
-
-#define CONFIG_SYS_GP1DIR 0x
-#define CONFIG_SYS_GP1ODR 0x
-#define CONFIG_SYS_GP2DIR 0xFF00
-#define CONFIG_SYS_GP2ODR 0x
-
-/*
- * Hardware Reset Configuration Word
- */
-#define CONFIG_SYS_HRCW_LOW (\
-   HRCWL_LCL_BUS_TO_SCB_CLK_1X1 | \
-   HRCWL_DDR_TO_SCB_CLK_2X1 | \
-   HRCWL_CSB_TO_CLKIN_2X1 | \
-   HRCWL_CORE_TO_CSB_2X1 | \
-   HRCWL_CE_PLL_VCO_DIV_2 | \
-   HRCWL_CE_TO_PLL_1X3)
-
-#define CONFIG_SYS_HRCW_HIGH (\
-   HRCWH_PCI_AGENT | \
-   HRCWH_PCI_ARBITER_DISABLE | \
-   HRCWH_CORE_ENABLE | \
-   HRCWH_FROM_0X0100 | \
-   HRCWH_BOOTSEQ_DISABLE | \
-   HRCWH_SW_WATCHDOG_DISABLE | \
-   HRCWH_ROM_LOC_LOCAL_16BIT | \
-   HRCWH_BIG_ENDIAN | \
-   HRCWH_LALE_NORMAL)
-
-#define CONFIG_SYS_DDRCDR (\
-   DDRCDR_EN | \
-   DDRCDR_PZ_MAXZ | \
-   DDRCDR_NZ_MAXZ | \
-   DDRCDR_M_ODR)
-
-#define CONFIG_SYS_DDR_CS0_BNDS0x007f
-#define CONFIG_SYS_DDR_SDRAM_CFG   (SDRAM_CFG_SDRAM_TYPE_DDR2 | \
-SDRAM_CFG_32_BE | \
-SDRAM_CFG_SREN | \
-SDRAM_CFG_HSE)
-
-#define CONFIG_SYS_DDR_SDRAM_CFG2  0x00401000
-#define CONFIG_SYS_DDR_CLK_CNTL
(DDR_SDRAM_CLK_CNTL_CLK_ADJUST_05)
-#define CONFIG_SYS_DDR_INTERVAL((0x064 << 
SDRAM_INTERVAL_BSTOPRE_SHIFT) | \
-(0x200 << SDRAM_INTERVAL_REFINT_SHIFT))
-
-#define CONFIG_SYS_DDR_CS0_CONFIG  (CSCONFIG_EN | CSCONFIG_AP | \
-CSCONFIG_ODT_RD_NEVER | \
-

[U-Boot] [PATCH v3 08/60] keymile: Move config files

2019-01-21 Thread Mario Six
We want to unroll several include files, while keeping include
statements consistent.

To make it easier to not break the include statements, move the include
files to the main configs directory. All three include files moved will
be unrolled, so they won't pollute the directory for long.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 include/configs/{km => }/km8309-common.h | 0
 include/configs/{km => }/km8321-common.h | 0
 include/configs/km8360.h | 2 +-
 include/configs/{km => }/km83xx-common.h | 4 ++--
 include/configs/kmtegr1.h| 4 ++--
 include/configs/kmvect1.h| 4 ++--
 include/configs/suvd3.h  | 4 ++--
 include/configs/tuxx1.h  | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
 rename include/configs/{km => }/km8309-common.h (100%)
 rename include/configs/{km => }/km8321-common.h (100%)
 rename include/configs/{km => }/km83xx-common.h (99%)

diff --git a/include/configs/km/km8309-common.h 
b/include/configs/km8309-common.h
similarity index 100%
rename from include/configs/km/km8309-common.h
rename to include/configs/km8309-common.h
diff --git a/include/configs/km/km8321-common.h 
b/include/configs/km8321-common.h
similarity index 100%
rename from include/configs/km/km8321-common.h
rename to include/configs/km8321-common.h
diff --git a/include/configs/km8360.h b/include/configs/km8360.h
index 7e2876ee088..d6c2772825e 100644
--- a/include/configs/km8360.h
+++ b/include/configs/km8360.h
@@ -38,7 +38,7 @@
 #define CONFIG_QE  /* Has QE */
 
 /* include common defines/options for all 83xx Keymile boards */
-#include "km/km83xx-common.h"
+#include "km83xx-common.h"
 
 /*
  * System IO Setup
diff --git a/include/configs/km/km83xx-common.h 
b/include/configs/km83xx-common.h
similarity index 99%
rename from include/configs/km/km83xx-common.h
rename to include/configs/km83xx-common.h
index fb2a1cb39a0..c80169c9b68 100644
--- a/include/configs/km/km83xx-common.h
+++ b/include/configs/km83xx-common.h
@@ -8,8 +8,8 @@
 #define __CONFIG_KM83XX_H
 
 /* include common defines/options for all Keymile boards */
-#include "keymile-common.h"
-#include "km-powerpc.h"
+#include "km/keymile-common.h"
+#include "km/km-powerpc.h"
 
 /*
  * System Clock Setup
diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
index 69397ae5ae4..95a131892de 100644
--- a/include/configs/kmtegr1.h
+++ b/include/configs/kmtegr1.h
@@ -20,7 +20,7 @@
  * High Level Configuration Options
  */
 
-/* This needs to be set prior to including km/km83xx-common.h */
+/* This needs to be set prior to including km83xx-common.h */
 
 #define CONFIG_HOSTNAME   "kmtegr1"
 #define CONFIG_KM_BOARD_NAME   "kmtegr1"
@@ -36,7 +36,7 @@
 #define NAND_MAX_CHIPS 1
 
 /* include common defines/options for all 8309 Keymile boards */
-#include "km/km8309-common.h"
+#include "km8309-common.h"
 /* must be after the include because KMBEC_FPGA is otherwise undefined */
 #define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
 
diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h
index 178e769976a..0bbf541aec7 100644
--- a/include/configs/kmvect1.h
+++ b/include/configs/kmvect1.h
@@ -20,14 +20,14 @@
  * High Level Configuration Options
  */
 
-/* This needs to be set prior to including km/km83xx-common.h */
+/* This needs to be set prior to including km83xx-common.h */
 
 #define CONFIG_HOSTNAME"kmvect1"
 #define CONFIG_KM_BOARD_NAME   "kmvect1"
 /* at end of uboot partition, before env */
 #define CONFIG_SYS_QE_FW_ADDR   0xF00B
 /* include common defines/options for all 8309 Keymile boards */
-#include "km/km8309-common.h"
+#include "km8309-common.h"
 
 #define CONFIG_SYS_APP1_BASE   0xA000
 #define CONFIG_SYS_APP1_SIZE   256 /* Megabytes */
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
index 2a3f7ff5260..98137392edb 100644
--- a/include/configs/suvd3.h
+++ b/include/configs/suvd3.h
@@ -20,12 +20,12 @@
  * High Level Configuration Options
  */
 
-/* This needs to be set prior to including km/km83xx-common.h */
+/* This needs to be set prior to including km83xx-common.h */
 
 #define CONFIG_HOSTNAME"suvd3"
 #define CONFIG_KM_BOARD_NAME   "suvd3"
 /* include common defines/options for all 8321 Keymile boards */
-#include "km/km8321-common.h"
+#include "km8321-common.h"
 
 #define CONFIG_SYS_APP1_BASE   0xA000
 #define CONFIG_SYS_APP1_SIZE   256 /* Megabytes */
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index 8729fc9b2ef..1301d230f6d 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -43,7 +43,7 @@
 #endif
 
 /* include common defines/options for all 8321 Keymile boards */
-#include "km/km8321-common.h"
+#include "km8321-common.h"
 
 #define CONFIG_SYS_APP1_BASE   0xA000/* PAXG */
 #defineCONFIG_SYS_APP1_SIZE256 

[U-Boot] [PATCH v3 02/60] mpc83xx: Introduce ARCH_MPC831*

2019-01-21 Thread Mario Six
Replace CONFIG_MPC833* with proper CONFIG_ARCH_MPC833* Kconfig options.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config options from whitelist

---
 arch/powerpc/cpu/mpc83xx/Kconfig | 15 
 arch/powerpc/cpu/mpc83xx/cpu.c   |  2 +-
 arch/powerpc/cpu/mpc83xx/cpu_init.c  |  4 +-
 arch/powerpc/cpu/mpc83xx/fdt.c   |  6 +--
 arch/powerpc/cpu/mpc83xx/spd_sdram.c |  2 +-
 arch/powerpc/cpu/mpc83xx/speed.c | 40 ++--
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h |  4 +-
 arch/powerpc/include/asm/global_data.h   |  8 ++--
 arch/powerpc/include/asm/immap_83xx.h|  4 +-
 arch/powerpc/include/asm/mpc8xxx_spi.h   |  4 +-
 drivers/ram/mpc83xx_sdram.c  |  4 +-
 include/configs/MPC8313ERDB.h|  2 -
 include/configs/MPC8315ERDB.h|  2 -
 include/configs/ids8313.h|  3 --
 include/configs/ve8313.h |  2 -
 include/mpc83xx.h| 20 +-
 scripts/config_whitelist.txt |  3 --
 17 files changed, 64 insertions(+), 61 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 142b9247860..20780ba68bd 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -17,6 +17,7 @@ config TARGET_SBC8349
 
 config TARGET_VE8313
bool "Support ve8313"
+   select ARCH_MPC8313
 
 config TARGET_VME8349
bool "Support vme8349"
@@ -28,11 +29,13 @@ config TARGET_MPC8308RDB
 
 config TARGET_MPC8313ERDB
bool "Support MPC8313ERDB"
+   select ARCH_MPC8313
select BOARD_EARLY_INIT_F
select SUPPORT_SPL
 
 config TARGET_MPC8315ERDB
bool "Support MPC8315ERDB"
+   select ARCH_MPC8315
select BOARD_EARLY_INIT_F
 
 config TARGET_MPC8323ERDB
@@ -65,6 +68,7 @@ config TARGET_MPC837XERDB
 
 config TARGET_IDS8313
bool "Support ids8313"
+   select ARCH_MPC8313
select DM
imply CMD_DM
 
@@ -113,6 +117,17 @@ config ARCH_MPC8309
bool
select ARCH_MPC830X
 
+config ARCH_MPC831X
+   bool
+
+config ARCH_MPC8313
+   bool
+   select ARCH_MPC831X
+
+config ARCH_MPC8315
+   bool
+   select ARCH_MPC831X
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index b29f271e9bc..8a88068fdba 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#if defined(CONFIG_BOOTCOUNT_LIMIT) && !defined(CONFIG_MPC831x)
+#if defined(CONFIG_BOOTCOUNT_LIMIT) && !defined(CONFIG_ARCH_MPC831X)
 #include 
 #include 
 #endif
diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c 
b/arch/powerpc/cpu/mpc83xx/cpu_init.c
index 1555205e069..7d8d5516b4c 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
@@ -240,7 +240,7 @@ void cpu_init_f (volatile immap_t * im)
 
/* System General Purpose Register */
 #ifdef CONFIG_SYS_SICRH
-#if defined(CONFIG_MPC834x) || defined(CONFIG_MPC8313)
+#if defined(CONFIG_MPC834x) || defined(CONFIG_ARCH_MPC8313)
/* regarding to MPC34x manual rev.1 bits 28..29 must be preserved */
__raw_writel((im->sysconf.sicrh & 0x000C) | CONFIG_SYS_SICRH,
 >sysconf.sicrh);
@@ -312,7 +312,7 @@ void cpu_init_f (volatile immap_t * im)
im->gpio[1].dat = CONFIG_SYS_GPIO2_DAT;
im->gpio[1].dir = CONFIG_SYS_GPIO2_DIR;
 #endif
-#if defined(CONFIG_USB_EHCI_FSL) && defined(CONFIG_MPC831x)
+#if defined(CONFIG_USB_EHCI_FSL) && defined(CONFIG_ARCH_MPC831X)
uint32_t temp;
struct usb_ehci *ehci = (struct usb_ehci *)CONFIG_SYS_FSL_USB1_ADDR;
 
diff --git a/arch/powerpc/cpu/mpc83xx/fdt.c b/arch/powerpc/cpu/mpc83xx/fdt.c
index 0ecafd708fc..cfd391b78ab 100644
--- a/arch/powerpc/cpu/mpc83xx/fdt.c
+++ b/arch/powerpc/cpu/mpc83xx/fdt.c
@@ -16,7 +16,7 @@ extern void ft_qe_setup(void *blob);
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_BOOTCOUNT_LIMIT) && \
-   (defined(CONFIG_QE) && !defined(CONFIG_MPC831x))
+   (defined(CONFIG_QE) && !defined(CONFIG_ARCH_MPC831X))
 #include 
 
 void fdt_fixup_muram (void *blob)
@@ -52,7 +52,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
 defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3) ||\
 defined(CONFIG_HAS_ETH4) || defined(CONFIG_HAS_ETH5)
-#ifdef CONFIG_MPC8313
+#ifdef CONFIG_ARCH_MPC8313
/*
* mpc8313e erratum IPIC1 swapped TSEC interrupt ID numbers on rev. 1
* h/w (see AN3545).  The base device tree in use has rev. 1 ID numbers,
@@ -123,7 +123,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 
 #if 

[U-Boot] [PATCH v3 03/60] mpc83xx: Introduce ARCH_MPC832*

2019-01-21 Thread Mario Six
Replace CONFIG_MPC832* with proper CONFIG_ARCH_MPC832* Kconfig options.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 arch/powerpc/cpu/mpc83xx/Kconfig  |  7 +++
 arch/powerpc/cpu/mpc83xx/speed.c  | 10 +-
 arch/powerpc/include/asm/immap_83xx.h |  2 +-
 include/configs/MPC8323ERDB.h |  1 -
 include/configs/MPC832XEMDS.h |  1 -
 include/configs/km/km8321-common.h|  1 -
 include/linux/immap_qe.h  |  2 +-
 include/mpc83xx.h |  6 +++---
 scripts/config_whitelist.txt  |  1 -
 9 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 20780ba68bd..1b9402e024b 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -40,9 +40,11 @@ config TARGET_MPC8315ERDB
 
 config TARGET_MPC8323ERDB
bool "Support MPC8323ERDB"
+   select ARCH_MPC832X
 
 config TARGET_MPC832XEMDS
bool "Support MPC832XEMDS"
+   select ARCH_MPC832X
select BOARD_EARLY_INIT_F
 
 config TARGET_MPC8349EMDS
@@ -82,11 +84,13 @@ config TARGET_SUVD3
bool "Support suvd3"
select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMTEGR1"
select ARCH_MPC8309 if SYS_EXTRA_OPTIONS="KMVECT1"
+   select ARCH_MPC832X if SYS_EXTRA_OPTIONS="SUVD3"
imply CMD_CRAMFS
imply FS_CRAMFS
 
 config TARGET_TUXX1
bool "Support tuxx1"
+   select ARCH_MPC832X
imply CMD_CRAMFS
imply FS_CRAMFS
 
@@ -128,6 +132,9 @@ config ARCH_MPC8315
bool
select ARCH_MPC831X
 
+config ARCH_MPC832X
+   bool
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index 9f09d2955f8..ab025af70d4 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -98,7 +98,7 @@ int get_clocks(void)
 #endif
u32 core_clk;
u32 i2c1_clk;
-#if !defined(CONFIG_MPC832x)
+#if !defined(CONFIG_ARCH_MPC832X)
u32 i2c2_clk;
 #endif
 #if defined(CONFIG_ARCH_MPC8315)
@@ -315,7 +315,7 @@ int get_clocks(void)
i2c1_clk = tsec2_clk;
 #elif defined(CONFIG_MPC8360)
i2c1_clk = csb_clk;
-#elif defined(CONFIG_MPC832x)
+#elif defined(CONFIG_ARCH_MPC832X)
i2c1_clk = enc_clk;
 #elif defined(CONFIG_ARCH_MPC8308) || defined(CONFIG_ARCH_MPC831X)
i2c1_clk = enc_clk;
@@ -326,7 +326,7 @@ int get_clocks(void)
 #elif defined(CONFIG_ARCH_MPC8309)
i2c1_clk = csb_clk;
 #endif
-#if !defined(CONFIG_MPC832x)
+#if !defined(CONFIG_ARCH_MPC832X)
i2c2_clk = csb_clk; /* i2c-2 clk is equal to csb clk */
 #endif
 
@@ -467,7 +467,7 @@ int get_clocks(void)
 #endif
gd->arch.core_clk = core_clk;
gd->arch.i2c1_clk = i2c1_clk;
-#if !defined(CONFIG_MPC832x)
+#if !defined(CONFIG_ARCH_MPC832X)
gd->arch.i2c2_clk = i2c2_clk;
 #endif
 #if !defined(CONFIG_ARCH_MPC8309)
@@ -546,7 +546,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 #endif
printf("  I2C1:%-4s MHz\n",
   strmhz(buf, gd->arch.i2c1_clk));
-#if !defined(CONFIG_MPC832x)
+#if !defined(CONFIG_ARCH_MPC832X)
printf("  I2C2:%-4s MHz\n",
   strmhz(buf, gd->arch.i2c2_clk));
 #endif
diff --git a/arch/powerpc/include/asm/immap_83xx.h 
b/arch/powerpc/include/asm/immap_83xx.h
index d22d887babd..318b79d0b8a 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ b/arch/powerpc/include/asm/immap_83xx.h
@@ -843,7 +843,7 @@ typedef struct immap {
u8  qe[0x10];   /* QE block */
 } immap_t;
 
-#elif defined(CONFIG_MPC832x)
+#elif defined(CONFIG_ARCH_MPC832X)
 typedef struct immap {
sysconf83xx_t   sysconf;/* System configuration */
wdt83xx_t   wdt;/* Watch Dog Timer (WDT) 
Registers */
diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h
index 578202f3be3..bd1b1bb0a7c 100644
--- a/include/configs/MPC8323ERDB.h
+++ b/include/configs/MPC8323ERDB.h
@@ -14,7 +14,6 @@
  */
 #define CONFIG_E3001   /* E300 family */
 #define CONFIG_QE  1   /* Has QE */
-#define CONFIG_MPC832x 1   /* MPC832x CPU specific */
 
 /*
  * System Clock Setup
diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h
index 8f11d9b3a48..0bb7db9bc37 100644
--- a/include/configs/MPC832XEMDS.h
+++ b/include/configs/MPC832XEMDS.h
@@ -11,7 +11,6 @@
  */
 #define CONFIG_E3001   /* E300 family */
 #define CONFIG_QE  1   /* Has QE */
-#define CONFIG_MPC832x 1   /* MPC832x CPU specific */
 #define CONFIG_MPC832XEMDS 1   /* MPC832XEMDS board specific */
 
 /*
diff --git a/include/configs/km/km8321-common.h 

[U-Boot] [PATCH v3 10/60] keymile: Make distinct kmsupx5, tuge1, kmopti2, and kmtepr2 configs

2019-01-21 Thread Mario Six
The kmsupx5, tuge1, kmopti2, and kmtepr2 boards all build from the same
include config file with lots of #ifdef logic.

To ease Kconfig migration, create new config include files for these
boards, and resolve the #ifdef logic as needed.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Combined config creation and simplification patches

---
 arch/powerpc/cpu/mpc83xx/Kconfig |  24 
 board/keymile/km83xx/Kconfig |  52 +++
 configs/kmopti2_defconfig|   3 +-
 configs/kmsupx5_defconfig|   3 +-
 configs/kmtepr2_defconfig|   3 +-
 configs/tuge1_defconfig  |   3 +-
 configs/tuxx1_defconfig  |   1 -
 include/configs/kmopti2.h| 234 ++
 include/configs/kmsupx5.h| 210 +++
 include/configs/kmtepr2.h| 235 +++
 include/configs/tuge1.h  | 210 +++
 include/configs/tuxx1.h  |  62 
 12 files changed, 969 insertions(+), 71 deletions(-)
 create mode 100644 include/configs/kmopti2.h
 create mode 100644 include/configs/kmsupx5.h
 create mode 100644 include/configs/kmtepr2.h
 create mode 100644 include/configs/tuge1.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 59e0c9a8d08..1ebb092f0bf 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -111,6 +111,30 @@ config TARGET_TUXX1
imply CMD_CRAMFS
imply FS_CRAMFS
 
+config TARGET_KMSUPX5
+   bool "Support kmsupx5"
+   select ARCH_MPC832X
+   imply CMD_CRAMFS
+   imply FS_CRAMFS
+
+config TARGET_TUGE1
+   bool "Support tuge1"
+   select ARCH_MPC832X
+   imply CMD_CRAMFS
+   imply FS_CRAMFS
+
+config TARGET_KMOPTI2
+   bool "Support kmopti2"
+   select ARCH_MPC832X
+   imply CMD_CRAMFS
+   imply FS_CRAMFS
+
+config TARGET_KMTEPR2
+   bool "Support kmtepr2"
+   select ARCH_MPC832X
+   imply CMD_CRAMFS
+   imply FS_CRAMFS
+
 config TARGET_TQM834X
bool "Support TQM834x"
select ARCH_MPC8349
diff --git a/board/keymile/km83xx/Kconfig b/board/keymile/km83xx/Kconfig
index d52ee9117b5..0c4fa0b7fdb 100644
--- a/board/keymile/km83xx/Kconfig
+++ b/board/keymile/km83xx/Kconfig
@@ -62,3 +62,55 @@ config SYS_CONFIG_NAME
default "tuxx1"
 
 endif
+
+if TARGET_KMSUPX5
+
+config SYS_BOARD
+   default "km83xx"
+
+config SYS_VENDOR
+   default "keymile"
+
+config SYS_CONFIG_NAME
+   default "kmsupx5"
+
+endif
+
+if TARGET_TUGE1
+
+config SYS_BOARD
+   default "km83xx"
+
+config SYS_VENDOR
+   default "keymile"
+
+config SYS_CONFIG_NAME
+   default "tuge1"
+
+endif
+
+if TARGET_KMOPTI2
+
+config SYS_BOARD
+   default "km83xx"
+
+config SYS_VENDOR
+   default "keymile"
+
+config SYS_CONFIG_NAME
+   default "kmopti2"
+
+endif
+
+if TARGET_KMTEPR2
+
+config SYS_BOARD
+   default "km83xx"
+
+config SYS_VENDOR
+   default "keymile"
+
+config SYS_CONFIG_NAME
+   default "kmtepr2"
+
+endif
diff --git a/configs/kmopti2_defconfig b/configs/kmopti2_defconfig
index e8e821fb800..c0927dd4788 100644
--- a/configs/kmopti2_defconfig
+++ b/configs/kmopti2_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_TUXX1=y
+CONFIG_TARGET_KMOPTI2=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMOPTI2"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/kmsupx5_defconfig b/configs/kmsupx5_defconfig
index 86e2bd92378..7a00c85a841 100644
--- a/configs/kmsupx5_defconfig
+++ b/configs/kmsupx5_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_TUXX1=y
+CONFIG_TARGET_KMSUPX5=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMSUPX5"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/kmtepr2_defconfig b/configs/kmtepr2_defconfig
index 6170dc3f161..310cf5ac66f 100644
--- a/configs/kmtepr2_defconfig
+++ b/configs/kmtepr2_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_TUXX1=y
+CONFIG_TARGET_KMTEPR2=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="KMTEPR2"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/tuge1_defconfig b/configs/tuge1_defconfig
index e5826719b9f..a3e04bc0f8a 100644
--- a/configs/tuge1_defconfig
+++ b/configs/tuge1_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xF000
 CONFIG_MPC83xx=y
-CONFIG_TARGET_TUXX1=y
+CONFIG_TARGET_TUGE1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="TUGE1"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_R=y
diff --git a/configs/tuxx1_defconfig 

[U-Boot] [PATCH v3 38/60] mpc83xx: Simplify BR,OR lines

2019-01-21 Thread Mario Six
Re-format all BR,OR #define lines into single lines. This makes them
harder to read, but accessible to semi-automatic replacement.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 include/configs/MPC8308RDB.h| 46 ---
 include/configs/MPC8313ERDB_NAND.h  | 67 +++
 include/configs/MPC8313ERDB_NOR.h   | 66 ++-
 include/configs/MPC8315ERDB.h   | 34 +++---
 include/configs/MPC8323ERDB.h   | 17 ++-
 include/configs/MPC832XEMDS.h   | 70 ++---
 include/configs/MPC8349EMDS.h   | 32 +++--
 include/configs/MPC8349EMDS_SDRAM.h | 45 ---
 include/configs/MPC8349ITX.h| 60 +++--
 include/configs/MPC837XEMDS.h   | 52 +
 include/configs/MPC837XERDB.h   | 48 +---
 include/configs/TQM834x.h   | 19 ++--
 include/configs/caddy2.h| 31 -
 include/configs/hrcon.h | 32 +++--
 include/configs/ids8313.h   | 47 +--
 include/configs/kmcoge5ne.h | 55 ++-
 include/configs/kmeter1.h   | 40 +
 include/configs/kmopti2.h   | 53 +++---
 include/configs/kmsupx5.h   | 43 +-
 include/configs/kmtegr1.h   | 37 +--
 include/configs/kmtepr2.h   | 57 ++-
 include/configs/kmvect1.h   | 46 +--
 include/configs/mpc8308_p1m.h   | 40 +
 include/configs/sbc8349.h   | 18 ++--
 include/configs/strider.h   | 31 +++--
 include/configs/suvd3.h | 46 +--
 include/configs/tuge1.h | 43 +-
 include/configs/tuxx1.h | 60 ++---
 include/configs/ve8313.h| 64 ++
 include/configs/vme8349.h   | 31 -
 30 files changed, 302 insertions(+), 1028 deletions(-)

diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h
index e19bcafd5ce..185f6490d7c 100644
--- a/include/configs/MPC8308RDB.h
+++ b/include/configs/MPC8308RDB.h
@@ -175,19 +175,9 @@
 #define CONFIG_SYS_FLASH_BASE  0xFE00 /* FLASH base address */
 #define CONFIG_SYS_FLASH_SIZE  8 /* FLASH size is 8M */
 
-/* Window base at flash base */
-#define CONFIG_SYS_BR0_PRELIM  (CONFIG_SYS_FLASH_BASE \
-   | BR_PS_16  /* 16 bit port */ \
-   | BR_MS_GPCM/* MSEL = GPCM */ \
-   | BR_V) /* valid */
-#define CONFIG_SYS_OR0_PRELIM  (OR_AM_8MB \
-   | OR_UPM_XAM \
-   | OR_GPCM_CSNT \
-   | OR_GPCM_ACS_DIV2 \
-   | OR_GPCM_XACS \
-   | OR_GPCM_SCY_15 \
-   | OR_GPCM_TRLX_SET \
-   | OR_GPCM_EHTR_SET)
+/* FLASH */
+#define CONFIG_SYS_BR0_PRELIM  (0xFE00 | BR_PS_16 | BR_MS_GPCM | BR_V)
+#define CONFIG_SYS_OR0_PRELIM  (OR_AM_8MB | OR_UPM_XAM | OR_GPCM_CSNT | 
OR_GPCM_ACS_DIV2 | OR_GPCM_XACS | OR_GPCM_SCY_15 | OR_GPCM_TRLX_SET | 
OR_GPCM_EHTR_SET)
 
 #define CONFIG_SYS_MAX_FLASH_BANKS 1 /* number of banks */
 /* 127 64KB sectors and 8 8KB top sectors per device */
@@ -201,18 +191,9 @@
  */
 #define CONFIG_SYS_NAND_BASE   0xE060  /* 0xE060 */
 #define CONFIG_SYS_NAND_WINDOW_SIZE(32 * 1024) /* 0x8000 */
-#define CONFIG_SYS_BR1_PRELIM  (CONFIG_SYS_NAND_BASE \
-   | BR_DECC_CHK_GEN   /* Use HW ECC */ \
-   | BR_PS_8   /* 8 bit Port */ \
-   | BR_MS_FCM /* MSEL = FCM */ \
-   | BR_V) /* valid */
-#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB \
-   | OR_FCM_CSCT \
-   | OR_FCM_CST \
-   | OR_FCM_CHT \
-   | OR_FCM_SCY_1 \
-   | OR_FCM_TRLX \
-   | OR_FCM_EHTR)
+/* NAND */
+#define CONFIG_SYS_BR1_PRELIM  (0xE060 | BR_DECC_CHK_GEN   | BR_PS_8 | 
BR_MS_FCM | BR_V)
+#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB | OR_FCM_CSCT | OR_FCM_CST | 
OR_FCM_CHT | OR_FCM_SCY_1 | OR_FCM_TRLX | OR_FCM_EHTR)
/* 0x8396 */
 
 #ifdef CONFIG_VSC7385_ENET
@@ -220,18 +201,9 @@
/* VSC7385 Base address on CS2 */
 #define CONFIG_SYS_VSC7385_BASE0xF000
 #define CONFIG_SYS_VSC7385_SIZE(128 * 1024) /* 0x0002 */
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_VSC7385_BASE \
- 

[U-Boot] [PATCH v3 54/60] mpc83xx: Get rid of CONFIG_SYS_LBC_*

2019-01-21 Thread Mario Six
Except for one counter example, CONFIG_SYS_LBC_LBCR always has a value
of either 0x0004 or 0x.

CONFIG_SYS_LBC_MRTPR always has the value 0x2000.

CONFIG_SYS_LBC_LSDMR_{1,2,4,5} are not set for any mpc83xx board.

CONFIG_SYS_LBC_LSRT is set by one board (to 0x3200).

To simplify the configuration files, hardcode the setting of these
values for mpc83xx.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 board/freescale/mpc8313erdb/sdram.c   |  5 +++--
 board/freescale/mpc8349emds/mpc8349emds.c | 27 +++
 board/ids/ids8313/ids8313.c   |  4 ++--
 board/sbc8349/sbc8349.c   | 25 ++---
 board/ve8313/ve8313.c |  4 ++--
 include/configs/MPC8308RDB.h  |  5 -
 include/configs/MPC8313ERDB_NAND.h| 10 -
 include/configs/MPC8313ERDB_NOR.h | 10 -
 include/configs/MPC8315ERDB.h |  6 +
 include/configs/MPC8323ERDB.h |  5 -
 include/configs/MPC832XEMDS.h |  5 -
 include/configs/MPC8349EMDS.h |  8 ---
 include/configs/MPC8349EMDS_SDRAM.h   |  8 ---
 include/configs/MPC8349ITX.h  | 13 ---
 include/configs/MPC837XEMDS.h |  4 
 include/configs/MPC837XERDB.h |  4 
 include/configs/caddy2.h  |  8 ---
 include/configs/hrcon.h   |  5 -
 include/configs/ids8313.h |  9 
 include/configs/kmopti2.h |  5 -
 include/configs/kmsupx5.h |  5 -
 include/configs/kmtegr1.h |  5 -
 include/configs/kmtepr2.h |  5 -
 include/configs/kmvect1.h |  5 -
 include/configs/mpc8308_p1m.h |  5 -
 include/configs/sbc8349.h |  8 ---
 include/configs/strider.h |  5 -
 include/configs/suvd3.h   |  5 -
 include/configs/tuge1.h   |  5 -
 include/configs/tuxx1.h   |  5 -
 include/configs/ve8313.h  |  7 --
 include/configs/vme8349.h |  8 ---
 32 files changed, 43 insertions(+), 195 deletions(-)

diff --git a/board/freescale/mpc8313erdb/sdram.c 
b/board/freescale/mpc8313erdb/sdram.c
index 090412d4b6c..c8e30a09478 100644
--- a/board/freescale/mpc8313erdb/sdram.c
+++ b/board/freescale/mpc8313erdb/sdram.c
@@ -109,8 +109,9 @@ int dram_init(void)
msize = fixed_sdram();
 
/* Local Bus setup lbcr and mrtpr */
-   lbc->lbcr = CONFIG_SYS_LBC_LBCR;
-   lbc->mrtpr = CONFIG_SYS_LBC_MRTPR;
+   lbc->lbcr = (0x0004 | (0xFF << LBCR_BMT_SHIFT) | 0xF);
+   /* LB refresh timer prescal, 266MHz/32 */
+   lbc->mrtpr = 0x2000;
sync();
 
 #ifndef CONFIG_SYS_8313ERDB_BROKEN_PMC
diff --git a/board/freescale/mpc8349emds/mpc8349emds.c 
b/board/freescale/mpc8349emds/mpc8349emds.c
index f14276f6a87..913b5843e95 100644
--- a/board/freescale/mpc8349emds/mpc8349emds.c
+++ b/board/freescale/mpc8349emds/mpc8349emds.c
@@ -183,28 +183,36 @@ void sdram_init(void)
volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR;
volatile fsl_lbc_t *lbc = >im_lbc;
uint *sdram_addr = (uint *)CONFIG_SYS_LBC_SDRAM_BASE;
-
+   const u32 lsdmr_common = LSDMR_RFEN | LSDMR_BSMA1516 | LSDMR_RFCR8 |
+LSDMR_PRETOACT6 | LSDMR_ACTTORW3 | LSDMR_BL8 |
+LSDMR_WRC3 | LSDMR_CL3;
/*
 * Setup SDRAM Base and Option Registers, already done in cpu_init.c
 */
 
/* setup mtrpt, lsrt and lbcr for LB bus */
-   lbc->lbcr = CONFIG_SYS_LBC_LBCR;
-   lbc->mrtpr = CONFIG_SYS_LBC_MRTPR;
-   lbc->lsrt = CONFIG_SYS_LBC_LSRT;
+   lbc->lbcr = 0x;
+   /* LB refresh timer prescal, 266MHz/32 */
+   lbc->mrtpr = 0x2000;
+   /* LB sdram refresh timer, about 6us */
+   lbc->lsrt = 0x3200;
asm("sync");
 
/*
 * Configure the SDRAM controller Machine Mode Register.
 */
-   lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_5; /* 0x40636733; normal operation */
 
-   lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_1; /* 0x68636733; precharge all the 
banks */
+   /* 0x40636733; normal operation */
+   lbc->lsdmr = lsdmr_common | LSDMR_OP_NORMAL;
+
+   /* 0x68636733; precharge all the banks */
+   lbc->lsdmr = lsdmr_common | LSDMR_OP_PCHALL;
asm("sync");
*sdram_addr = 0xff;
udelay(100);
 
-   lbc->lsdmr = CONFIG_SYS_LBC_LSDMR_2; /* 0x48636733; auto refresh */
+   /* 0x48636733; auto refresh */
+   lbc->lsdmr = lsdmr_common | LSDMR_OP_ARFRSH;
asm("sync");
/*1 times*/
*sdram_addr = 0xff;
@@ -232,12 +240,13 @@ void sdram_init(void)
udelay(100);
 
/* 0x58636733; mode register write operation */
-   lbc->lsdmr = 

[U-Boot] [PATCH v3 48/60] mpc8308: Migrate system io config to Kconfig

2019-01-21 Thread Mario Six
Migrate the system IO configuration setting to Kconfig.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/Kconfig  |   1 +
 arch/powerpc/cpu/mpc83xx/cpu_init.c   |   1 +
 arch/powerpc/cpu/mpc83xx/sysio/Kconfig|   7 +
 .../powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308 | 323 ++
 arch/powerpc/cpu/mpc83xx/sysio/sysio.h|  32 ++
 configs/MPC8308RDB_defconfig  |   8 +
 configs/hrcon_defconfig   |   9 +
 configs/hrcon_dh_defconfig|   9 +
 configs/mpc8308_p1m_defconfig |   8 +
 configs/strider_con_defconfig |   9 +
 configs/strider_con_dp_defconfig  |   9 +
 configs/strider_cpu_defconfig |   9 +
 configs/strider_cpu_dp_defconfig  |   9 +
 include/configs/MPC8308RDB.h  |  25 --
 include/configs/hrcon.h   |  25 --
 include/configs/mpc8308_p1m.h |  25 --
 include/configs/strider.h |  25 --
 17 files changed, 434 insertions(+), 100 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/sysio/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308
 create mode 100644 arch/powerpc/cpu/mpc83xx/sysio/sysio.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 96376837abb..9f7b3a2e019 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -294,6 +294,7 @@ source "arch/powerpc/cpu/mpc83xx/bats/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/lblaw/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/elbc/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/hid/Kconfig"
+source "arch/powerpc/cpu/mpc83xx/sysio/Kconfig"
 
 menu "Legacy options"
 
diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c 
b/arch/powerpc/cpu/mpc83xx/cpu_init.c
index 5ce7b794b26..3df01ee1ca1 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c
@@ -14,6 +14,7 @@
 
 #include "lblaw/lblaw.h"
 #include "elbc/elbc.h"
+#include "sysio/sysio.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/arch/powerpc/cpu/mpc83xx/sysio/Kconfig 
b/arch/powerpc/cpu/mpc83xx/sysio/Kconfig
new file mode 100644
index 000..9e1f1587121
--- /dev/null
+++ b/arch/powerpc/cpu/mpc83xx/sysio/Kconfig
@@ -0,0 +1,7 @@
+menu "System I/O configuration"
+
+if ARCH_MPC8308
+source "arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308"
+endif
+
+endmenu
diff --git a/arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308 
b/arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308
new file mode 100644
index 000..de62171b301
--- /dev/null
+++ b/arch/powerpc/cpu/mpc83xx/sysio/Kconfig.mpc8308
@@ -0,0 +1,323 @@
+choice
+   prompt "SPI group"
+
+config SICR_SPI_SPI
+   bool "SPI"
+
+config SICR_SPI_MSRCID
+   bool "MSRCID"
+
+config SICR_SPI_LSRCID
+   bool "LSRCID"
+
+endchoice
+
+choice
+   prompt "UART group"
+
+config SICR_UART_SPI
+   bool "UART"
+
+config SICR_UART_MSRCID
+   bool "MSRCID"
+
+config SICR_UART_LSRCID
+   bool "LSRCID"
+
+endchoice
+
+choice
+   prompt "IRQ group"
+
+config SICR_IRQ_SPI
+   bool "IRQ"
+
+config SICR_IRQ_MCP_CKSTOP
+   bool "MCP/CKSTOP"
+
+config SICR_IRQ_INTA
+   bool "INTA"
+
+endchoice
+
+choice
+   prompt "I2C2 group"
+
+config SICR_I2C2_I2C
+   bool "IRQ"
+
+config SICR_I2C2_CKSTOP
+   bool "CKSTOP"
+
+endchoice
+
+choice
+   prompt "ETSEC1 A group"
+
+config SICR_ETSEC1_A_TSEC2
+   bool "TSEC1"
+
+config SICR_ETSEC1_A_TSEC_GTX_CLK125
+   bool "TSEC1 GTX_CLK125"
+
+endchoice
+
+choice
+   prompt "eSDHC A group"
+
+config SICR_ESDHC_A_SD
+   bool "SD"
+
+config SICR_ESDHC_A_GTM
+   bool "GTM"
+
+config SICR_ESDHC_A_GPIO
+   bool "GPIO"
+
+endchoice
+
+choice
+   prompt "eSDHC B group"
+
+config SICR_ESDHC_B_SD
+   bool "SD"
+
+config SICR_ESDHC_B_GTM
+   bool "GTM"
+
+config SICR_ESDHC_B_GPIO
+   bool "GPIO"
+
+endchoice
+
+choice
+   prompt "eSDHC C group"
+
+config SICR_ESDHC_C_SD
+   bool "SD"
+
+config SICR_ESDHC_C_GTM
+   bool "GTM"
+
+config SICR_ESDHC_C_GPIO
+   bool "GPIO"
+
+endchoice
+
+choice
+   prompt "GPIO A group"
+
+config SICR_GPIO_A_GPIO
+   bool "GPIO"
+
+config SICR_GPIO_A_TSEC2
+   bool "TSEC2"
+
+endchoice
+
+choice
+   prompt "GPIO B group"
+
+config SICR_GPIO_B_GPIO
+   bool "GPIO"
+
+config SICR_GPIO_B_TSEC2
+   bool "TSEC2"
+
+config SICR_GPIO_B_TSEC_GTX_CLK125
+   bool "TSEC2 GTX_CLK125"
+
+endchoice
+
+choice
+   prompt "IEEE1588 A group"
+
+config SICR_IEEE1588_A_TSEC
+   bool "TSEC"
+
+config SICR_IEEE1588_A_GPIO
+   bool "GPIO"
+
+endchoice
+
+choice
+   prompt "USB group"
+
+config SICR_USB_TSEC
+   bool "USB"
+
+endchoice
+
+choice
+   prompt "GTM group"
+
+config SICR_GTM_TSEC
+   bool "GTM"
+
+config SICR_GTM_GPIO
+   bool "GPIO"
+
+endchoice
+
+choice
+   prompt 

Re: [U-Boot] [PATCH v3 9/9] arm: dts: sunxi: Enumerate MMC2 as MMC1

2019-01-21 Thread Chen-Yu Tsai
On Mon, Jan 21, 2019 at 6:32 PM Jagan Teki  wrote:
>
> Environment and fastboot MMC devices are configured based number
> of mmc slots defined on particular board in sunxi platform.
>
> If number of slots are not more than 1, it assigns 0 which usually mmc
> device on SD slot. With DM_MMC it is detected as 0 since mmc0 node always
> be an mmc device.
>
> If number of slots are more than 1, it assigns 1 which assumes 0 is mmc
> device and 1 is emmc device. But with DM_MMC there is chance of detecting
> emmc as device 2 since mmc1 is SDIO as per devicetree definition.
>
> So override mmc2 to mmc1 in sunxi dtsi, this will eventually detect mmc2
> as mmc 1 device even if the board dts has mmc0, mmc1, mmc2.
>
> Some platforms like A20 has mmc0...mmc3, but there is no usecases now for
> enabling all mmc controllers in any of A20 board dts files.
>
> Signed-off-by: Jagan Teki 
> ---
>  arch/arm/dts/sunxi-u-boot.dtsi | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi
> index 8a9f2a6417..fdd4c80aa4 100644
> --- a/arch/arm/dts/sunxi-u-boot.dtsi
> +++ b/arch/arm/dts/sunxi-u-boot.dtsi
> @@ -1,6 +1,10 @@
>  #include 
>
>  / {
> +   aliases {
> +   mmc1 = 
> +   };
> +
> binman {
> filename = "u-boot-sunxi-with-spl.bin";
> pad-byte = <0xff>;
> --
> 2.18.0.321.gffc6fa0e3
>

Slightly curious. What happens when mmc1 (the real mmc1) is enabled
and probes before mmc2 does? Does it take mmc1? What happens then
when mmc2 probes and wants mmc1?

Also, on the A31, we use mmc3 instead of mmc2 for eMMC. Only mmc3
supports DDR transfer modes.

ChenYu
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 05/60] mpc83xx: Introduce ARCH_MPC836*

2019-01-21 Thread Mario Six
Replace CONFIG_MPC836* with proper CONFIG_ARCH_MPC836* Kconfig options.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 arch/powerpc/cpu/mpc83xx/Kconfig   |  4 
 arch/powerpc/cpu/mpc83xx/speed.c   | 10 +-
 arch/powerpc/include/asm/fsl_lbc.h |  4 ++--
 arch/powerpc/include/asm/global_data.h |  4 ++--
 arch/powerpc/include/asm/immap_83xx.h  |  2 +-
 board/keymile/km83xx/km83xx.c  |  4 ++--
 drivers/ram/mpc83xx_sdram.c|  8 
 include/configs/km8360.h   |  1 -
 include/linux/immap_qe.h   |  2 +-
 include/mpc83xx.h  | 10 +-
 include/post.h |  2 +-
 scripts/config_whitelist.txt   |  1 -
 12 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 6cca45e4026..5f9d036e371 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -80,6 +80,7 @@ config TARGET_IDS8313
 
 config TARGET_KM8360
bool "Support km8360"
+   select ARCH_MPC8360
imply CMD_CRAMFS
imply CMD_DIAG
imply FS_CRAMFS
@@ -147,6 +148,9 @@ config ARCH_MPC8349
bool
select ARCH_MPC834X
 
+config ARCH_MPC8360
+   bool
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index 7cb6f3727df..ed77675a8ea 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -113,7 +113,7 @@ int get_clocks(void)
u32 lbiu_clk;
u32 lclk_clk;
u32 mem_clk;
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
u32 mem_sec_clk;
 #endif
 #if defined(CONFIG_QE)
@@ -313,7 +313,7 @@ int get_clocks(void)
 
 #if defined(CONFIG_ARCH_MPC834X)
i2c1_clk = tsec2_clk;
-#elif defined(CONFIG_MPC8360)
+#elif defined(CONFIG_ARCH_MPC8360)
i2c1_clk = csb_clk;
 #elif defined(CONFIG_ARCH_MPC832X)
i2c1_clk = enc_clk;
@@ -407,7 +407,7 @@ int get_clocks(void)
  (1 + ((im->clk.spmr & SPMR_DDRCM) >> SPMR_DDRCM_SHIFT));
corepll = (im->clk.spmr & SPMR_COREPLL) >> SPMR_COREPLL_SHIFT;
 
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
mem_sec_clk = csb_clk * (1 +
   ((im->clk.spmr & SPMR_LBIUCM) >> SPMR_LBIUCM_SHIFT));
 #endif
@@ -476,7 +476,7 @@ int get_clocks(void)
gd->arch.lbiu_clk = lbiu_clk;
gd->arch.lclk_clk = lclk_clk;
gd->mem_clk = mem_clk;
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
gd->arch.mem_sec_clk = mem_sec_clk;
 #endif
 #if defined(CONFIG_QE)
@@ -536,7 +536,7 @@ static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
printf("  Local Bus:   %-4s MHz\n",
   strmhz(buf, gd->arch.lclk_clk));
printf("  DDR: %-4s MHz\n", strmhz(buf, gd->mem_clk));
-#if defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC8360)
printf("  DDR Secondary:   %-4s MHz\n",
   strmhz(buf, gd->arch.mem_sec_clk));
 #endif
diff --git a/arch/powerpc/include/asm/fsl_lbc.h 
b/arch/powerpc/include/asm/fsl_lbc.h
index 0ea44560332..3528acd627d 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -43,10 +43,10 @@ void lbc_sdram_init(void);
 #define BR_MSEL0x00E0
 #define BR_MSEL_SHIFT  5
 #define BR_MS_GPCM 0x  /* GPCM */
-#if !defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_MPC8360)
+#if !defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_ARCH_MPC8360)
 #define BR_MS_FCM  0x0020  /* FCM */
 #endif
-#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_MPC8360)
+#if defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC8360)
 #define BR_MS_SDRAM0x0060  /* SDRAM */
 #elif defined(CONFIG_MPC85xx)
 #define BR_MS_SDRAM0x  /* SDRAM */
diff --git a/arch/powerpc/include/asm/global_data.h 
b/arch/powerpc/include/asm/global_data.h
index cd0d76696d2..cf3ba588220 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -61,9 +61,9 @@ struct arch_global_data {
 # if defined(CONFIG_MPC837x) || defined(CONFIG_ARCH_MPC8315)
u32 sata_clk;
 # endif
-# if defined(CONFIG_MPC8360)
+# if defined(CONFIG_ARCH_MPC8360)
u32 mem_sec_clk;
-# endif /* CONFIG_MPC8360 */
+# endif /* CONFIG_ARCH_MPC8360 */
 #endif
 #endif
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
diff --git a/arch/powerpc/include/asm/immap_83xx.h 
b/arch/powerpc/include/asm/immap_83xx.h
index bf7a4b9250c..f6721e7b1d5 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ 

[U-Boot] [PATCH v3 26/60] MPC837XEMDS: Remove CONFIG_MPC837XEMDS

2019-01-21 Thread Mario Six
CONFIG_MPC837XEMDS is unused, and TARGET_MPC837XEMDS could replace it.

Hence, get rid of CONFIG_MPC837XEMDS.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 include/configs/MPC837XEMDS.h | 1 -
 scripts/config_whitelist.txt  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h
index 82dcb859736..577f7ec0b2f 100644
--- a/include/configs/MPC837XEMDS.h
+++ b/include/configs/MPC837XEMDS.h
@@ -11,7 +11,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001 /* E300 family */
-#define CONFIG_MPC837XEMDS 1 /* MPC837XEMDS board specific */
 
 /*
  * System Clock Setup
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index e13f290bfad..fcfa82817a1 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1247,7 +1247,6 @@ CONFIG_MMC_SPI_SPEED
 CONFIG_MMC_SUNXI_SLOT
 CONFIG_MMU
 CONFIG_MONITOR_IS_IN_RAM
-CONFIG_MPC837XEMDS
 CONFIG_MPC837XERDB
 CONFIG_MPC83XX_GPIO
 CONFIG_MPC83XX_GPIO_0_INIT_DIRECTION
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 28/60] mpc83xx: Migrate legacy PCI options to Kconfig

2019-01-21 Thread Mario Six
The MPC83xx include files contain some settings of the PCI subsystem.

Migrate these to Kconfig until a proper DM PCI driver exists.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 arch/powerpc/cpu/mpc83xx/Kconfig| 26 ++
 board/freescale/mpc8349emds/pci.c   | 12 ++--
 configs/MPC8349EMDS_SDRAM_defconfig |  1 +
 configs/MPC8349EMDS_defconfig   |  1 +
 configs/sbc8349_PCI_33_defconfig|  1 +
 configs/sbc8349_PCI_66_defconfig|  1 +
 configs/vme8349_defconfig   |  1 +
 include/configs/MPC8349EMDS.h   | 11 ++-
 include/configs/MPC8349EMDS_SDRAM.h | 11 ++-
 include/configs/TQM834x.h   |  2 +-
 include/configs/caddy2.h|  8 
 include/configs/sbc8349.h   | 10 +-
 include/configs/vme8349.h   | 10 +-
 13 files changed, 44 insertions(+), 51 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 0ce1aad6d03..bd4e5c14a9a 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -215,6 +215,32 @@ config ARCH_MPC8360
 config ARCH_MPC837X
bool
 
+menu "Legacy options"
+
+if ARCH_MPC8349
+
+#TODO(mario@gdsys.cc): Remove when mpc83xx PCI has been converted to DM/DT
+choice
+   prompt "PMC slot configuration"
+
+config PCI_ALL_PCI1
+   bool "All PMC slots on PCI1"
+
+config PCI_ONE_PCI1
+   bool "First PMC1 on PCI1"
+
+config PCI_TWO_PCI1
+   bool "First two PMC1 on PCI1"
+
+endchoice
+
+config PCI_64BIT
+   bool "PMC2 is 64bit"
+
+endif
+
+endmenu
+
 source "board/esd/vme8349/Kconfig"
 source "board/freescale/mpc8308rdb/Kconfig"
 source "board/freescale/mpc8313erdb/Kconfig"
diff --git a/board/freescale/mpc8349emds/pci.c 
b/board/freescale/mpc8349emds/pci.c
index a2feda855f6..005190ed87d 100644
--- a/board/freescale/mpc8349emds/pci.c
+++ b/board/freescale/mpc8349emds/pci.c
@@ -77,11 +77,11 @@ void pib_init(void)
i2c_write(0x26, 0x6, 1, , 1);
val8 = 0x34;
i2c_write(0x26, 0x7, 1, , 1);
-#if defined(PCI_64BIT)
+#if defined(CONFIG_PCI_64BIT)
val8 = 0xf4;/* PMC2:PCI1/64-bit */
-#elif defined(PCI_ALL_PCI1)
+#elif defined(CONFIG_PCI_ALL_PCI1)
val8 = 0xf3;/* PMC1:PCI1 PMC2:PCI1 PMC3:PCI1 */
-#elif defined(PCI_ONE_PCI1)
+#elif defined(CONFIG_PCI_ONE_PCI1)
val8 = 0xf9;/* PMC1:PCI1 PMC2:PCI2 PMC3:PCI2 */
 #else
val8 = 0xf5;/* PMC1:PCI1 PMC2:PCI1 PMC3:PCI2 */
@@ -98,11 +98,11 @@ void pib_init(void)
i2c_write(0x27, 0x3, 1, , 1);
asm("eieio");
 
-#if defined(PCI_64BIT)
+#if defined(CONFIG_PCI_64BIT)
printf("PCI1: 64-bit on PMC2\n");
-#elif defined(PCI_ALL_PCI1)
+#elif defined(CONFIG_PCI_ALL_PCI1)
printf("PCI1: 32-bit on PMC1, PMC2, PMC3\n");
-#elif defined(PCI_ONE_PCI1)
+#elif defined(CONFIG_PCI_ONE_PCI1)
printf("PCI1: 32-bit on PMC1\n");
printf("PCI2: 32-bit on PMC2, PMC3\n");
 #else
diff --git a/configs/MPC8349EMDS_SDRAM_defconfig 
b/configs/MPC8349EMDS_SDRAM_defconfig
index 2607dfa4f33..a98cc74027c 100644
--- a/configs/MPC8349EMDS_SDRAM_defconfig
+++ b/configs/MPC8349EMDS_SDRAM_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_MPC83xx=y
 CONFIG_TARGET_MPC8349EMDS_SDRAM=y
+CONFIG_PCI_ONE_PCI1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
diff --git a/configs/MPC8349EMDS_defconfig b/configs/MPC8349EMDS_defconfig
index 41a1d9609b5..bd8ff625e19 100644
--- a/configs/MPC8349EMDS_defconfig
+++ b/configs/MPC8349EMDS_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_MPC83xx=y
 CONFIG_TARGET_MPC8349EMDS=y
+CONFIG_PCI_ONE_PCI1=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_BOOTDELAY=6
diff --git a/configs/sbc8349_PCI_33_defconfig b/configs/sbc8349_PCI_33_defconfig
index 02d5185124c..5c2720aef14 100644
--- a/configs/sbc8349_PCI_33_defconfig
+++ b/configs/sbc8349_PCI_33_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFF80
 CONFIG_MPC83xx=y
 CONFIG_TARGET_SBC8349=y
+CONFIG_PCI_64BIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PCI_33M"
diff --git a/configs/sbc8349_PCI_66_defconfig b/configs/sbc8349_PCI_66_defconfig
index 945c5229b93..e6535dafcf7 100644
--- a/configs/sbc8349_PCI_66_defconfig
+++ b/configs/sbc8349_PCI_66_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFF80
 CONFIG_MPC83xx=y
 CONFIG_TARGET_SBC8349=y
+CONFIG_PCI_64BIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="PCI_66M"
diff --git a/configs/vme8349_defconfig b/configs/vme8349_defconfig
index a7d81a3a0f1..90c29b7fedf 100644
--- a/configs/vme8349_defconfig
+++ b/configs/vme8349_defconfig
@@ -2,6 +2,7 @@ CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFFF0
 CONFIG_MPC83xx=y
 CONFIG_TARGET_VME8349=y
+CONFIG_PCI_64BIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 

[U-Boot] [PATCH v3 51/60] mpc83xx: Migrate CONFIG_LCRR_* to Kconfig

2019-01-21 Thread Mario Six
Migrate the CONFIG_LCRR_* settings to Kconfig.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/cpu_init.c   |  22 ---
 arch/powerpc/cpu/mpc83xx/initreg/Kconfig  |   1 +
 arch/powerpc/cpu/mpc83xx/initreg/Kconfig.lcrr | 139 ++
 arch/powerpc/cpu/mpc83xx/initreg/initreg.h|  36 +
 configs/MPC8308RDB_defconfig  |   2 +
 configs/MPC8313ERDB_33_defconfig  |   2 +
 configs/MPC8313ERDB_66_defconfig  |   2 +
 configs/MPC8313ERDB_NAND_33_defconfig |   2 +
 configs/MPC8313ERDB_NAND_66_defconfig |   2 +
 configs/MPC8315ERDB_defconfig |   2 +
 configs/MPC8323ERDB_defconfig |   2 +
 configs/MPC832XEMDS_ATM_defconfig |   2 +
 configs/MPC832XEMDS_HOST_33_defconfig |   2 +
 configs/MPC832XEMDS_HOST_66_defconfig |   2 +
 configs/MPC832XEMDS_SLAVE_defconfig   |   2 +
 configs/MPC832XEMDS_defconfig |   2 +
 configs/MPC8349EMDS_PCI64_defconfig   |   2 +
 configs/MPC8349EMDS_SDRAM_defconfig   |   2 +
 configs/MPC8349EMDS_SLAVE_defconfig   |   2 +
 configs/MPC8349EMDS_defconfig |   2 +
 configs/MPC8349ITXGP_defconfig|   2 +
 configs/MPC8349ITX_LOWBOOT_defconfig  |   2 +
 configs/MPC8349ITX_defconfig  |   2 +
 configs/MPC837XEMDS_HOST_defconfig|   2 +
 configs/MPC837XEMDS_SLAVE_defconfig   |   2 +
 configs/MPC837XEMDS_defconfig |   2 +
 configs/MPC837XERDB_SLAVE_defconfig   |   2 +
 configs/MPC837XERDB_defconfig |   2 +
 configs/TQM834x_defconfig |   2 +
 configs/hrcon_defconfig   |   2 +
 configs/hrcon_dh_defconfig|   2 +
 configs/ids8313_defconfig |   2 +
 configs/kmcoge5ne_defconfig   |   3 +
 configs/kmeter1_defconfig |   3 +
 configs/kmopti2_defconfig |   3 +
 configs/kmsupx5_defconfig |   3 +
 configs/kmtegr1_defconfig |   3 +
 configs/kmtepr2_defconfig |   3 +
 configs/kmvect1_defconfig |   3 +
 configs/mpc8308_p1m_defconfig |   2 +
 configs/sbc8349_PCI_33_defconfig  |   2 +
 configs/sbc8349_PCI_66_defconfig  |   2 +
 configs/sbc8349_defconfig |   2 +
 configs/strider_con_defconfig |   2 +
 configs/strider_con_dp_defconfig  |   2 +
 configs/strider_cpu_defconfig |   2 +
 configs/strider_cpu_dp_defconfig  |   2 +
 configs/suvd3_defconfig   |   3 +
 configs/tuge1_defconfig   |   3 +
 configs/tuxx1_defconfig   |   3 +
 configs/ve8313_defconfig  |   2 +
 configs/vme8349_defconfig |   1 +
 include/configs/MPC8308RDB.h  |   2 -
 include/configs/MPC8313ERDB_NAND.h|   2 -
 include/configs/MPC8313ERDB_NOR.h |   2 -
 include/configs/MPC8315ERDB.h |   2 -
 include/configs/MPC8323ERDB.h |   2 -
 include/configs/MPC832XEMDS.h |   2 -
 include/configs/MPC8349EMDS.h |   2 -
 include/configs/MPC8349EMDS_SDRAM.h   |   2 -
 include/configs/MPC8349ITX.h  |   2 -
 include/configs/MPC837XEMDS.h |   2 -
 include/configs/MPC837XERDB.h |   2 -
 include/configs/TQM834x.h |  12 --
 include/configs/caddy2.h  |   1 -
 include/configs/hrcon.h   |   2 -
 include/configs/ids8313.h |   2 -
 include/configs/kmcoge5ne.h   |   7 -
 include/configs/kmeter1.h |   7 -
 include/configs/kmopti2.h |   4 -
 include/configs/kmsupx5.h |   4 -
 include/configs/kmtegr1.h |   4 -
 include/configs/kmtepr2.h |   4 -
 include/configs/kmvect1.h |   4 -
 include/configs/mpc8308_p1m.h |   2 -
 include/configs/sbc8349.h |   2 -
 include/configs/strider.h |   2 -
 include/configs/suvd3.h   |   4 -
 include/configs/tuge1.h   |   4 -
 include/configs/tuxx1.h   |   4 -
 include/configs/ve8313.h  |   3 -
 include/configs/vme8349.h |   1 -
 scripts/config_whitelist.txt  |   3 -
 83 files changed, 281 insertions(+), 120 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/initreg/Kconfig.lcrr

diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c 
b/arch/powerpc/cpu/mpc83xx/cpu_init.c
index 59faa78d24c..af8facad534 100644
--- 

[U-Boot] [PATCH v3 39/60] sbc8349: Remove SDRAM functionality

2019-01-21 Thread Mario Six
The MPC8349EMDS configuration was the basis for the sbc8349, so it also
contains its SDRAM option.

Since
* the SDRAM has to be soldered onto the board,
* the sbc8349 never used the support, and
* the support never worked (see previous patch fixing it),

we can assume that the support on the sbc8349 is an artifact created by
copying the MPC8349EMDS config wholesome.

Hence, instead of creating a separate sbc8349 config that supports
SDRAM, we can remove the SDRAM option for this board.

Should it be needed in the future, it can be copied from the new
MPC8349EMDS_SDRAM board.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 include/configs/sbc8349.h | 67 ---
 1 file changed, 67 deletions(-)

diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h
index 09cdb7c1a8a..42a1e1682d2 100644
--- a/include/configs/sbc8349.h
+++ b/include/configs/sbc8349.h
@@ -142,73 +142,6 @@
 
 #undef CONFIG_SYS_LB_SDRAM /* if board has SDRAM on local bus */
 
-#ifdef CONFIG_SYS_LB_SDRAM
-/* Local bus BR2, OR2 definition for SDRAM if soldered on the board*/
-/*
- * Base Register 2 and Option Register 2 configure SDRAM.
- * The SDRAM base address, CONFIG_SYS_LBC_SDRAM_BASE, is 0xf000.
- *
- * For BR2, need:
- *Base address of 0xf000 = BR[0:16] =     0
- *port-size = 32-bits = BR2[19:20] = 11
- *no parity checking = BR2[21:22] = 00
- *SDRAM for MSEL = BR2[24:26] = 011
- *Valid = BR[31] = 1
- *
- * 04812   16   20   24   28
- *     0001 1000 0110 0001 = F0001861
- */
-
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_LBC_SDRAM_BASE \
-   | BR_PS_32 \
-   | BR_MS_SDRAM \
-   | BR_V)
-   /* 0xF0001861 */
-/*
- * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
- *
- * For OR2, need:
- *64MB mask for AM, OR2[0:7] =  1100
- * XAM, OR2[17:18] = 11
- *9 columns OR2[19-21] = 010
- *13 rows   OR2[23-25] = 100
- *EAD set for extra time OR[31] = 1
- *
- * 04812   16   20   24   28
- *  1100   0110 1001  0001 = FC006901
- */
-
-#define CONFIG_SYS_OR2_PRELIM  (OR_AM_64MB \
-   | OR_SDRAM_XAM \
-   | ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \
-   | ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \
-   | OR_SDRAM_EAD)
-   /* 0xFC006901 */
-
-   /* LB sdram refresh timer, about 6us */
-#define CONFIG_SYS_LBC_LSRT0x3200
-   /* LB refresh timer prescal, 266MHz/32 */
-#define CONFIG_SYS_LBC_MRTPR   0x2000
-
-#define CONFIG_SYS_LBC_LSDMR_COMMON(LSDMR_RFEN \
-   | LSDMR_BSMA1516 \
-   | LSDMR_RFCR8 \
-   | LSDMR_PRETOACT6 \
-   | LSDMR_ACTTORW3 \
-   | LSDMR_BL8 \
-   | LSDMR_WRC3 \
-   | LSDMR_CL3)
-
-/*
- * SDRAM Controller configuration sequence.
- */
-#define CONFIG_SYS_LBC_LSDMR_1 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_PCHALL)
-#define CONFIG_SYS_LBC_LSDMR_2 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH)
-#define CONFIG_SYS_LBC_LSDMR_3 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_ARFRSH)
-#define CONFIG_SYS_LBC_LSDMR_4 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_MRW)
-#define CONFIG_SYS_LBC_LSDMR_5 (CONFIG_SYS_LBC_LSDMR_COMMON | LSDMR_OP_NORMAL)
-#endif
-
 /*
  * Serial Port
  */
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 46/60] mpc83xx: Migrate HID config to Kconfig

2019-01-21 Thread Mario Six
Mirate the HID configuration settings to Kconfig.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/Kconfig  |   1 +
 arch/powerpc/cpu/mpc83xx/hid/Kconfig  | 565 ++
 arch/powerpc/cpu/mpc83xx/hid/hid.h|  72 
 arch/powerpc/cpu/mpc83xx/start.S  |   1 +
 configs/MPC8308RDB_defconfig  |   4 +
 configs/MPC8313ERDB_33_defconfig  |   4 +
 configs/MPC8313ERDB_66_defconfig  |   4 +
 configs/MPC8313ERDB_NAND_33_defconfig |   4 +
 configs/MPC8313ERDB_NAND_66_defconfig |   4 +
 configs/MPC8315ERDB_defconfig |   4 +
 configs/MPC8323ERDB_defconfig |   3 +
 configs/MPC832XEMDS_ATM_defconfig |   3 +
 configs/MPC832XEMDS_HOST_33_defconfig |   3 +
 configs/MPC832XEMDS_HOST_66_defconfig |   3 +
 configs/MPC832XEMDS_SLAVE_defconfig   |   3 +
 configs/MPC832XEMDS_defconfig |   3 +
 configs/MPC8349EMDS_PCI64_defconfig   |   3 +
 configs/MPC8349EMDS_SDRAM_defconfig   |   3 +
 configs/MPC8349EMDS_SLAVE_defconfig   |   3 +
 configs/MPC8349EMDS_defconfig |   3 +
 configs/MPC8349ITXGP_defconfig|   2 +
 configs/MPC8349ITX_LOWBOOT_defconfig  |   2 +
 configs/MPC8349ITX_defconfig  |   2 +
 configs/MPC837XEMDS_HOST_defconfig|   3 +
 configs/MPC837XEMDS_SLAVE_defconfig   |   3 +
 configs/MPC837XEMDS_defconfig |   3 +
 configs/MPC837XERDB_SLAVE_defconfig   |   3 +
 configs/MPC837XERDB_defconfig |   3 +
 configs/TQM834x_defconfig |   2 +
 configs/caddy2_defconfig  |   3 +
 configs/hrcon_defconfig   |   4 +
 configs/hrcon_dh_defconfig|   4 +
 configs/ids8313_defconfig |   3 +
 configs/kmcoge5ne_defconfig   |   3 +
 configs/kmeter1_defconfig |   3 +
 configs/kmopti2_defconfig |   3 +
 configs/kmsupx5_defconfig |   3 +
 configs/kmtegr1_defconfig |   3 +
 configs/kmtepr2_defconfig |   3 +
 configs/kmvect1_defconfig |   3 +
 configs/mpc8308_p1m_defconfig |   4 +
 configs/sbc8349_PCI_33_defconfig  |   3 +
 configs/sbc8349_PCI_66_defconfig  |   3 +
 configs/sbc8349_defconfig |   3 +
 configs/strider_con_defconfig |   4 +
 configs/strider_con_dp_defconfig  |   4 +
 configs/strider_cpu_defconfig |   4 +
 configs/strider_cpu_dp_defconfig  |   4 +
 configs/suvd3_defconfig   |   3 +
 configs/tuge1_defconfig   |   3 +
 configs/tuxx1_defconfig   |   3 +
 configs/ve8313_defconfig  |   3 +
 configs/vme8349_defconfig |   3 +
 include/configs/MPC8308RDB.h  |   9 -
 include/configs/MPC8313ERDB_NAND.h|   7 -
 include/configs/MPC8313ERDB_NOR.h |   7 -
 include/configs/MPC8315ERDB.h |   9 -
 include/configs/MPC8323ERDB.h |   8 -
 include/configs/MPC832XEMDS.h |   8 -
 include/configs/MPC8349EMDS.h |  11 -
 include/configs/MPC8349EMDS_SDRAM.h   |  11 -
 include/configs/MPC8349ITX.h  |   5 -
 include/configs/MPC837XEMDS.h |   8 -
 include/configs/MPC837XERDB.h |   8 -
 include/configs/TQM834x.h |   6 -
 include/configs/caddy2.h  |   6 -
 include/configs/hrcon.h   |   9 -
 include/configs/ids8313.h |   7 -
 include/configs/kmcoge5ne.h   |   8 -
 include/configs/kmeter1.h |   8 -
 include/configs/kmopti2.h |   8 -
 include/configs/kmsupx5.h |   8 -
 include/configs/kmtegr1.h |   8 -
 include/configs/kmtepr2.h |   8 -
 include/configs/kmvect1.h |   8 -
 include/configs/mpc8308_p1m.h |   9 -
 include/configs/sbc8349.h |  11 -
 include/configs/strider.h |   9 -
 include/configs/suvd3.h   |   8 -
 include/configs/tuge1.h   |   8 -
 include/configs/tuxx1.h   |   8 -
 include/configs/ve8313.h  |   6 -
 include/configs/vme8349.h |   6 -
 scripts/config_whitelist.txt  |   3 -
 84 files changed, 795 insertions(+), 243 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/hid/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/hid/hid.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 474572f245e..5fb4228076e 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -286,6 +286,7 @@ source "arch/powerpc/cpu/mpc83xx/hrcw/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/bats/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/lblaw/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/elbc/Kconfig"
+source "arch/powerpc/cpu/mpc83xx/hid/Kconfig"
 
 menu "Legacy options"
 
diff --git a/arch/powerpc/cpu/mpc83xx/hid/Kconfig 
b/arch/powerpc/cpu/mpc83xx/hid/Kconfig
new file mode 100644
index 000..c367ad2ce15
--- /dev/null
+++ b/arch/powerpc/cpu/mpc83xx/hid/Kconfig
@@ -0,0 +1,565 @@
+menu "HID setup"
+

Re: [U-Boot] [linux-sunxi] [PATCH 0/9] sunxi: enable DM_MMC

2019-01-21 Thread Andre Przywara
Hi,



>>> Testing with A10 Gemei G9 Tablet, FEL mode is broken:
>>>
>>> a) With usb-boot via fel:
>>>
>>> I get following error/warning: 
>>> Loading Environment from FAT... Card did not respond to voltage select!
>>>
>>> => mmc list
>>> mmc@1c0f000: 0
>>> ### All commands below stalls for a bit (~2 seconds), but return nothing
>>> => mmc info  
>>> => mmc dev 0
>>> => mmc part
>>>
> Similar issue with A20 Olinuxino Lime2 revk with SPI.
> 
> a) Fel mode usb-boot failure (cannot properly initialize sd / emmc)
> b) SPI boot failure (cannot properly initialize sd / emmc)
> 
> c) Regular SD-card boot works ok!
> d) eMMC boot works ok!

Can you please try whether the patch below fixes this? At least it worked
for me with FEL booting my Pine64-LTS.

Not totally happy with it, but it seems like we do a similar trick for
I2C anyway, so ...

Cheers,
Andre

---
 board/sunxi/board.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index ad14837291..e330367d1d 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -208,6 +208,10 @@ enum env_location env_get_location(enum env_operation op, 
int prio)
 }
 #endif
 
+#ifdef CONFIG_DM_MMC
+static void mmc_pinmux_setup(int sdc);
+#endif
+
 /* add board specific code here */
 int board_init(void)
 {
@@ -269,6 +273,17 @@ int board_init(void)
i2c_init_board();
 #endif
 
+#ifdef CONFIG_DM_MMC
+   /*
+* Temporary workaround for enabling I2C clocks until proper sunxi DM
+* clk, reset and pinctrl drivers land.
+*/
+   mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT);
+#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
+   mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA);
+#endif
+#endif /* CONFIG_DM_MMC */
+
/* Uses dm gpio code so do this here and not in i2c_init_board() */
return soft_i2c_board_init();
 }
-- 
2.14.5

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 56/60] mpc83xx: Don't define cpu_eth_init for DM eth

2019-01-21 Thread Mario Six
Don't use the legacy method of initializing the ethernet controller on
MPC83xx when DM is active.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/cpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index 8a88068fdba..4ea4249aff0 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -199,6 +199,7 @@ void watchdog_reset (void)
 }
 #endif
 
+#ifndef CONFIG_DM_ETH
 /*
  * Initializes on-chip ethernet controllers.
  * to override, implement board_eth_init()
@@ -214,6 +215,7 @@ int cpu_eth_init(bd_t *bis)
 #endif
return 0;
 }
+#endif /* !CONFIG_DM_ETH */
 
 /*
  * Initializes on-chip MMC controllers.
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [linux-sunxi] [PATCH 0/9] sunxi: enable DM_MMC

2019-01-21 Thread Priit Laes
On Mon, Jan 21, 2019 at 08:51:10AM +, Andre Przywara wrote:
> Hi,
> 
> 
> 
> >>> Testing with A10 Gemei G9 Tablet, FEL mode is broken:
> >>>
> >>> a) With usb-boot via fel:
> >>>
> >>> I get following error/warning: 
> >>> Loading Environment from FAT... Card did not respond to voltage select!
> >>>
> >>> => mmc list
> >>> mmc@1c0f000: 0
> >>> ### All commands below stalls for a bit (~2 seconds), but return nothing
> >>> => mmc info  
> >>> => mmc dev 0
> >>> => mmc part
> >>>
> > Similar issue with A20 Olinuxino Lime2 revk with SPI.
> > 
> > a) Fel mode usb-boot failure (cannot properly initialize sd / emmc)
> > b) SPI boot failure (cannot properly initialize sd / emmc)
> > 
> > c) Regular SD-card boot works ok!
> > d) eMMC boot works ok!
> 
> Can you please try whether the patch below fixes this? At least it worked
> for me with FEL booting my Pine64-LTS.
> 
> Not totally happy with it, but it seems like we do a similar trick for
> I2C anyway, so ...

Yes, it fixes it.

Tested on A20-Olinuxino-Lime2-emmc.

PS. Comment regarding i2c looks a bit odd..

> 
> Cheers,
> Andre
> 
> ---
>  board/sunxi/board.c | 15 +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> index ad14837291..e330367d1d 100644
> --- a/board/sunxi/board.c
> +++ b/board/sunxi/board.c
> @@ -208,6 +208,10 @@ enum env_location env_get_location(enum env_operation 
> op, int prio)
>  }
>  #endif
>  
> +#ifdef CONFIG_DM_MMC
> +static void mmc_pinmux_setup(int sdc);
> +#endif
> +
>  /* add board specific code here */
>  int board_init(void)
>  {
> @@ -269,6 +273,17 @@ int board_init(void)
>   i2c_init_board();
>  #endif
>  
> +#ifdef CONFIG_DM_MMC
> + /*
> +  * Temporary workaround for enabling I2C clocks until proper sunxi DM
> +  * clk, reset and pinctrl drivers land.
> +  */
> + mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT);
> +#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
> + mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA);
> +#endif
> +#endif   /* CONFIG_DM_MMC */
> +
>   /* Uses dm gpio code so do this here and not in i2c_init_board() */
>   return soft_i2c_board_init();
>  }
> -- 
> 2.14.5
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] TPL max size for RK3288 ?

2019-01-21 Thread Kever Yang
Hi Tom,


On 01/19/2019 06:54 AM, Tom Rini wrote:
> Hey,
>
> So I was playing with how to make our linker scripts more re-usable
> and have the kinds of link error on excessive size checks that we find
> really useful to avoid introducing run time failures, and I found
> something.  On rk3288 we don't size TPL_MAX_SIZE, only for rk3368.  Is
> there a reasonable one to set here?  Thanks!
>

We did not enable TPL for rk3288 at first, and now there already one rk3288
board using TPL, so it's reasonable to use TPL_MAX_SIZE for rk3288.

rk3288's TPL_MAX_SIZE is 32768.

Thanks,
- Kever


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] re-use dm data for pre-relocate and post-relocate[Please note, mail behalf by s...@google.com]

2019-01-21 Thread Kever Yang
Simon,

    Thanks for you reply to this mail, and it's surprised that it's a
mail which is more than one years ago at Nov 2017 :)

    I have implement re-use kernel dtb in my local branch in 2018, you
can see how I do it here[0] with USING_KERNEL_DTB macro if you have
interest for it.

    I'm not sure if I can get all this upstream, looks like people on
U-Boot prefer to use one dts per board according to comments in my
another mail thread about remove mmc node 'vmmc-supply' for rk3288.

    I think it works pretty well for Rockchip and it's convenient for
most of our costumers.


Thanks,

- Kever

[0] https://github.com/rockchip-linux/u-boot

On 12/29/2018 05:12 AM, Simon Glass wrote:
> Hi Kever,
>
> On Tue, 21 Nov 2017 at 03:24, Kever Yang  wrote:
>> Hi Simon,
>>
> There are a lot of points in here, so I will spread my comments
> throughout your email.
>
>>  In order to make people easier to maintain a U-Boot for product,
>>
>> we want to re-use the dtb from kernel. Some peripheral like power/pmic
>>
>> and display panel, key, charger which need work in U-Boot and may different
>>
>> in different product, we want to make people only maintain kernel dts,
>> but not
>>
>> one more U-Boot project for all these devices.
> That sounds like a good idea. The U-Boot and kernel .dts should be the
> same. But in some cases we may need changes made to the kernel version
> to support U-Boot. Unfortunately this has proven quite tricky and I'm
> not aware of any U-Boot change that has been accepted. Admittedly I
> have not tried for a number of years, so perhaps the reviewers are
> more amenable now.
>
>> I want to do this just around the
>>
>> relocate, need to read dtb from storage like emmc/nand/spi, and then use
>>
>> a new dtb for initr_dm after relocate.
> This seems OK, but why? Do you mean that U-Boot should read the
> kernel's DTB and use that after relocation? The problem is that it
> needs to be loaded from somewhere, and you need the DT for U-Boot to
> work. So you add a pre-reloc DT with just enough drivers for loading
> the post-reloc DT. But why bother? You may as well just load the full
> thing.
>
>>  Here are issues I have met:
>>
>> - The kernel dts may not have a stdout in chosen, we may use earlycon,
>> earlyprintk instead;
> I suppose U-Boot could support this, but IMO it would be better to
> upstream the change for stdout.
>
>>  this lead to U-Boot can not find a serial driver after relocate;
>>
>> - no alias for mmc device which is need by  U-Boot but not used in kernel;
> Again, we could upstream a change.
>
>> - not able to init mmc driver twice with current driver;
>>
>>  mmc driver not able to work before relocate, no bss for (static int
>> initialized), and hang even
> Well you cannot access BSS before relocation. If you use DM then it
> should not need to access BSS. You should be able to use the
> uclass-private data instead.
>
>>  if I skip this;
>>
>>  mmc driver can init and read dtb before initr_dm, but not able to
>> init again after initr_dm.
> Why not? That seems like a bug.
>
>>
>> In fact, I don't think we have to re-init serial driver and mmc driver,
>> and most other driver which
>>
>> need pre-relocate like clock, the only driver I have seem have different
>> use in pre-relocate and post-relocate
> Yes that's true, but the idea has never been implemented.
>
>> is video driver(no idea why it have to be pre-relocate, we always have
>> display very late),
> The video driver is only inited before relocation to find out the
> amount of memory it needs to be allocated. It does not actually probe
> it fully.
>
>> can we add a tag for re-use the dm driver data for those with pre-relocate ?
> Yes I think it could work like this:
>
> - initr_dm() remembers the old dm_root pointer
> - post-reloc drivers can request access to the priv/platdata/uc_priv
> from before relocation, e.g. using:
>
> int dm_get_pre_reloc_dev(struct udevice *dev, struct udevice *pre_reloc_devp);
>
> this returns the pre-reloc device associated with the post-reloc
> device 'dev', if available.
>
> Regards,
> Simon
>



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 8/9] arm: sunxi: Enable DM_MMC

2019-01-21 Thread Jagan Teki
Enable DM_MMC for all Allwinner SoCs, this will eventually
enable BLK.

Also removed DM_MMC enablement in few parts of sunxi
configurations.

Signed-off-by: Jagan Teki 
---
 arch/arm/Kconfig  | 1 +
 arch/arm/mach-sunxi/Kconfig   | 1 -
 configs/Linksprite_pcDuino3_defconfig | 1 -
 3 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a23cbd5719..075c3dfe81 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -851,6 +851,7 @@ config ARCH_SUNXI
select DM_ETH
select DM_GPIO
select DM_KEYBOARD
+   select DM_MMC if MMC
select DM_SERIAL
select DM_USB if DISTRO_DEFAULTS
select OF_BOARD_SETUP
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 3c54f5106d..74e234cded 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -154,7 +154,6 @@ config MACH_SUN4I
bool "sun4i (Allwinner A10)"
select CPU_V7A
select ARM_CORTEX_CPU_IS_UP
-   select DM_MMC if MMC
select DM_SCSI if SCSI
select PHY_SUN4I_USB
select DRAM_SUN4I
diff --git a/configs/Linksprite_pcDuino3_defconfig 
b/configs/Linksprite_pcDuino3_defconfig
index 9156f132d1..18f658e96b 100644
--- a/configs/Linksprite_pcDuino3_defconfig
+++ b/configs/Linksprite_pcDuino3_defconfig
@@ -14,7 +14,6 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-pcduino3"
 CONFIG_SCSI_AHCI=y
-CONFIG_DM_MMC=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_MII=y
 CONFIG_SUN7I_GMAC=y
-- 
2.18.0.321.gffc6fa0e3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC 1/9] Arm: dts: imx7d-pico: Import Linux pico-pi dts

2019-01-21 Thread Bryan O'Donoghue



On 21/01/2019 10:34, jorisoffouga wrote:


Le 21/01/2019 à 10:52, Bryan O'Donoghue a écrit :



On 20/01/2019 21:18, Joris Offouga wrote:
This patch imports the Linux kernel base board imx7d-pico.dtsi and 
specific

dts for imx7d-pico-pi


I recommend including the upstream Linux SHA in the commit log to make 
it easier to validate against and also if any changes/bugfixes go in 
upstream makes it easier to cherry-pick onto the local dts in u-boot.



Indeed, i add to v2.

I have a problem with pmic, can you watch the patch corresponding to the 
pmic ?


https://patchwork.ozlabs.org/patch/1028229/


Let me add Jun, he's better place than me to help with this.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [linux-sunxi] [PATCH 0/9] sunxi: enable DM_MMC

2019-01-21 Thread Priit Laes
On Mon, Jan 21, 2019 at 12:54:52AM +, André Przywara wrote:
> On 20/01/2019 19:51, Priit Laes wrote:
> 
> Hi,
> 
> > On Sat, Jan 19, 2019 at 01:30:46AM +, Andre Przywara wrote:
> >> This series enables the Allwinner MMC driver to drive all SoCs with its
> >> DM_MMC variant. We use the gates clock and reset support from the new
> >> clock driver, but keep the actual mod clock in its somewhat hackish
> >> state. Properly supporting this via the clock driver is a bit more work.
> >> The per-compatible variant struct for now only holds the mod clock
> >> address (which will go away), but we will need the struct later again
> >> for the various timing modes.
> >>
> >> This allows us to eventually enable DM_MMC for all SoCs, and get rid of
> >> the nasty deprecation warning.
> >>
> >> The first patch adds the MMC clock gates and resets to the clock driver.
> >> Patch 2/9 adds support for the A80 MMC config clock, which is a bit
> >> special. I can't test this, so please give this a try if you have a board.
> >>
> >> Patch 3 uses the new clocks in the MMC driver, the following three patches
> >> add the remaining compatible strings along with their required mod clock
> >> addresses.
> >>
> >> Patch 7 fixes the Pine64-LTS board, while patch 8 eventually enables
> >> everything. Patch 9 is some comment fix to make it easier to reason
> >> about what part of the driver is for DM_MMC and which is not.
> >>
> >> I successfully compiled the HEAD for all 142 Allwinner boards, also
> >> compiled all patches for selected boards.
> >>
> >> This was briefly tested on Pine-H64 (H6), Pine64-LTS (A64), OrangePi PC 2
> >> (H5), OrangePi Zero (H2+) and BananaPi-M1 (A20).
> >>
> >> Please run it on every board that you can get hold of to give this series
> >> a good shake.
> > 
> > Testing with A10 Gemei G9 Tablet, FEL mode is broken:
> > 
> > a) With usb-boot via fel:
> > 
> > I get following error/warning: 
> > Loading Environment from FAT... Card did not respond to voltage select!
> > 
> > => mmc list
> > mmc@1c0f000: 0
> > ### All commands below stalls for a bit (~2 seconds), but return nothing
> > => mmc info  
> > => mmc dev 0
> > => mmc part

Similar issue with A20 Olinuxino Lime2 revk with SPI.

a) Fel mode usb-boot failure (cannot properly initialize sd / emmc)
b) SPI boot failure (cannot properly initialize sd / emmc)

c) Regular SD-card boot works ok!
d) eMMC boot works ok!

> Ah, thanks for mentioning that. Can reproduce this on the Pine64-LTS.
> And I was already wondering why we wouldn't need the pinctrl parts I was
> working on ...
> 
> So if we boot from SD card, the SPL sets up the pinmux for the SD pins,
> and stuff works. For U-Boot proper we rely on board_mmc_init() to do
> this for us, but this gets only called for !DM_MMC configurations.
> If we boot with a SPL which doesn't initialise the MMC (booting via FEL
> or SPI or NAND), the pinmux setup is missing and it fails.
> 
> If anyone has a clever idea how to fix this without too much hacking and
> without bringing in a DM_PINCTRL driver, I am all ears.

Well, we know that there are basically only a few SPL boot options..
> 
> Thanks for testing and the report!
> 
> Cheers,
> Andre.
> 
> > 
> > b) When booting from SD-card [1], card is properly found, identified and
> > even partitions are there.
> > 
> > dd if=u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 seek=8 bs=1024
> > 
> > 
> >> This goes on top of current sunxi/master (543049ab5906) and is available
> >> on https://github.com/apritzel/u-boot/commits/sunxi-dm.
> >>
> >> This replaces Jagan's v2 series "mmc: sunxi: Enable DM_MMC" in a more
> >> driver model compliant way, borrowing two patches from him.
> >>
> >> Cheers,
> >> Andre.
> >>
> >> Andre Przywara (7):
> >>   sunxi: clk: add MMC gates/resets
> >>   sunxi: clk: A80: add MMC clock support
> >>   mmc: sunxi: Add DM clk and reset support
> >>   mmc: sunxi: Add H6 support
> >>   mmc: sunxi: Add A80 support
> >>   mmc: sunxi: Honour non-removable property in DT
> >>   mmc: sunxi: Mark end of DM_MMC #ifdefs
> >>
> >> Jagan Teki (2):
> >>   mmc: sunxi: Add missing compatible strings
> >>   arm: sunxi: Enable DM_MMC
> >>
> >>  arch/arm/Kconfig  |  1 +
> >>  arch/arm/mach-sunxi/Kconfig   |  1 -
> >>  configs/Linksprite_pcDuino3_defconfig |  1 -
> >>  drivers/clk/sunxi/clk_a10.c   |  4 +++
> >>  drivers/clk/sunxi/clk_a10s.c  |  3 ++
> >>  drivers/clk/sunxi/clk_a23.c   |  6 
> >>  drivers/clk/sunxi/clk_a31.c   |  8 +
> >>  drivers/clk/sunxi/clk_a64.c   |  6 
> >>  drivers/clk/sunxi/clk_a80.c   | 28 -
> >>  drivers/clk/sunxi/clk_a83t.c  |  6 
> >>  drivers/clk/sunxi/clk_h3.c|  6 
> >>  drivers/clk/sunxi/clk_h6.c|  6 
> >>  drivers/clk/sunxi/clk_r40.c   |  8 +
> >>  drivers/mmc/sunxi_mmc.c   | 59 
> >> +--
> >>  14 files changed, 131 insertions(+), 12 

[U-Boot] [PATCH v3 14/60] vme8349: Migrate to CONFIG_TARGET_VME8349

2019-01-21 Thread Mario Six
CONFIG_TARGET_VME8349 can replace CONFIG_VME8349. Hence, replace
CONFIG_VME8349 with CONFIG_TARGET_VME8349, and remove CONFIG_VME8349.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 drivers/pci/pci_auto.c | 2 +-
 drivers/pci/pci_auto_old.c | 2 +-
 include/configs/vme8349.h  | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index a673d8ae136..f5e46842bf6 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -359,7 +359,7 @@ int dm_pciauto_config_device(struct udevice *dev)
  PCI_DEV(dm_pci_get_bdf(dev)));
break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
case PCI_CLASS_BRIDGE_OTHER:
/*
 * The host/PCI bridge 1 seems broken in 8349 - it presents
diff --git a/drivers/pci/pci_auto_old.c b/drivers/pci/pci_auto_old.c
index 90c22a08cbc..6ab1b3b43fc 100644
--- a/drivers/pci/pci_auto_old.c
+++ b/drivers/pci/pci_auto_old.c
@@ -376,7 +376,7 @@ int pciauto_config_device(struct pci_controller *hose, 
pci_dev_t dev)
  PCI_DEV(dev));
break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
case PCI_CLASS_BRIDGE_OTHER:
/*
 * The host/PCI bridge 1 seems broken in 8349 - it presents
diff --git a/include/configs/vme8349.h b/include/configs/vme8349.h
index 56955501309..fe570abf8f7 100644
--- a/include/configs/vme8349.h
+++ b/include/configs/vme8349.h
@@ -28,7 +28,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001   /* E300 Family */
-#define CONFIG_VME8349 1   /* ESD VME8349 board specific */
 
 /* Don't enable PCI2 on vme834x - it doesn't exist physically. */
 #undef CONFIG_MPC83XX_PCI2 /* support for 2nd PCI controller */
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 37/60] tqm834x: Expand CONFIG_SYS_OR_TIMING_FLASH macro

2019-01-21 Thread Mario Six
We want to normalize all BR/OR config lines as much as possible.

The TQM834x board uses CONFIG_SYS_OR_TIMING_FLASH in a OR definition,
which we want to remove. But CONFIG_SYS_OR_TIMING_FLASH is also used
outside of the config file.

Replace these usages with the definition of the variable, so we can
remove the variable in the next patch.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 board/tqc/tqm834x/tqm834x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/tqc/tqm834x/tqm834x.c b/board/tqc/tqm834x/tqm834x.c
index 7c92f4f54c1..c75251e132c 100644
--- a/board/tqc/tqm834x/tqm834x.c
+++ b/board/tqc/tqm834x/tqm834x.c
@@ -235,8 +235,8 @@ static int detect_num_flash_banks(void)
debug("Number of flash banks detected: %d\n", 
cfi_flash_num_flash_banks);
 
/* set OR0 and BR0 */
-   set_lbc_or(0, CONFIG_SYS_OR_TIMING_FLASH |
-  (-(total_size) & OR_GPCM_AM));
+   set_lbc_or(0, OR_GPCM_CSNT | OR_GPCM_ACS_DIV4 | OR_GPCM_SCY_5 |
+  OR_GPCM_TRLX | (-(total_size) & OR_GPCM_AM));
set_lbc_br(0, (CONFIG_SYS_FLASH_BASE & BR_BA) |
   (BR_MS_GPCM | BR_PS_32 | BR_V));
 
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2 00/21] imx: vybrid: Update BK4 and PCM052 boards to only use DM/DTS

2019-01-21 Thread Lukasz Majewski
Hi Stefan,

> This patch series converts PCM052 and BK4 to use Driver Model and
> Device Tree.
> 
> Some notable changes:
> - The way how MAC address is read from fuses can now be adjusted
> - DTS improvement/sync with kernel (also extract u-boot specific
> properties)
> - Using generic code instead of one from board
> 
> The output of u-boot boot:
> U-Boot 2019.01-rc3-00076-gc149229be0 (Jan 14 2019 - 08:38:48 +0100)
> 
> CPU: Freescale Vybrid VF610 at 396 MHz
> Reset cause: POWER ON RESET
> Model: Liebherr (LVF) BK4 Vybrid Board
> Board: BK4r1 (L333)
> DRAM:  512 MiB
> NAND:  1024 MiB
> MMC:   FSL_SDHC: 0
> Loading Environment from NAND... OK
> In:serial@40028000
> Out:   serial@40028000
> Err:   serial@40028000
> Net:   eth0: fec@400d, eth1: fec@400d1000
> Enter passphrase to stop autoboot, booting in 3 seconds
> 
> Buildman CI:
> ./tools/buildman/buildman.py --branch=HEAD~4  vf610 mx6 vybrid
> --detail --verbose --show_errors --force-build --count=21
> --output-dir=../BUILD/
> 
> Travis-CI:
> https://travis-ci.org/lmajewski/u-boot-dfu/jobs/481963146

I've bisected this error, and it turned out that the following patch is
the culprit (on top of which I've rebased my work):

"fs: fat: dynamically allocate memory for temporary buffer"

Without this patch applied:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/482301236

With:
https://travis-ci.org/lmajewski/u-boot-dfu/builds/482297604

Test: test/py qemu_arm

Error is in: "test_efi_selftest"

Executing 'block device'
/home/travis/build/lmajewski/u-boot-dfu/lib/efi_selftest/efi_selftest_block_device.c(386):
TODO: Wrong volume label 'xxa1', expected 'U-BOOT TEST'
/home/travis/build/lmajewski/u-boot-dfu/lib/efi_selftest/efi_selftest_block_device.c(413):
ERROR: Unexpected file content
/home/travis/build/lmajewski/u-boot-dfu/lib/efi_selftest/efi_selftest.c(110):
ERROR: Executing 'block device' failed



> 
> U-boot master branch: SHA1: c4d323793ba2e0616d93ca104e1e2b9a9fbccf9b
> 
> 
> Changes in v2:
> - Rename pcm052.dts to vf610-pcm052.dts
> - Rename bk4r1.dts to vf610-bk4r1.dts
> - Extract 'u-boot,dm-pre-reloc;' property to separate file (to
> facilitate sync with Linux kernel dts files)
> - New patch
> - Disable EFI related support and commands (as we do not plan
> to use EFI on this setup)
> 
> Lukasz Majewski (21):
>   net: FEC: Add compatible for vybrid (vf610) to reuse fec_mxc.c
> driver net: Kconfig: FEC: Add dependency on VF610
>   vybrid: ddr: Extend vf610-pinfunc.h with DDR pads definitions
>   vybrid: clock: Provide enable_i2c_clk() function for Vybrid
>   vybrid: Define the imx_get_mac_from_fuse() as a __weak function
>   pcm052: board: Remove "m4go" command as it is superseded by
> "bootaux" pcm052: board: vybrid: Update the board name for BK4 device
>   ARM: DTS: vybrid: Update vf.dtsi file to descibe more vf610 hardware
>   pcm052: board: cosmetic: Add copyright notice to pcm052.c
>   ARM: DTS: Update pcm052 based dts files (bk4r1/pcm052)
>   ARM: DTS: Provide vf610-bk4r1-u-boot.dtsi for U-Boot specific
> properties
>   defconfig: bk4/pcm052: Update bk4r1|pcm052_defconfig to support
> DM/DT config: pcm052: Use SZ_X{MK} from linux/sizes.h for
> include/configs/pcm052.h
>   config: bk4: Update include/configs/bk4r1.h file
>   pcm052: board: Remove in-board setup code (it is now replaced by DM
> setup)
>   config: bk4: Update u-boot script to support recovery via SD card
>   config: bk4: Update u-boot envs to support NOR memories initial
> setup pcm052: bk4: sdcard: Add support for SD card booting/recovery
>   pcm052: board: Add code to setup LED default states
>   pcm052: mac: Provide board specific imx_get_mac_from_fuse() function
>   pcm052: bk4: Add board_phy_config() for BK4 to setup ksz8081 phy
> 
>  arch/arm/cpu/armv7/vf610/Kconfig  |   1 +
>  arch/arm/cpu/armv7/vf610/generic.c|  21 +-
>  arch/arm/dts/Makefile |   4 +-
>  arch/arm/dts/bk4r1.dts|  47 
>  arch/arm/dts/vf.dtsi  |  62 +
>  arch/arm/dts/vf610-bk4r1-u-boot.dtsi  |  27 ++
>  arch/arm/dts/vf610-bk4r1.dts  |  97 +++
>  arch/arm/dts/{pcm052.dts => vf610-pcm052.dts} |   6 +-
>  arch/arm/dts/vf610-pcm052.dtsi| 259 +
>  arch/arm/dts/vf610-pinfunc.h  |  50 
>  arch/arm/include/asm/arch-vf610/clock.h   |   3 +
>  arch/arm/include/asm/arch-vf610/imx-regs.h|   2 +
>  board/phytec/pcm052/pcm052.c  | 386
> ++
> configs/bk4r1_defconfig   |  49 +++-
> configs/pcm052_defconfig  |  36 ++-
> drivers/net/Kconfig   |   2 +-
> drivers/net/fec_mxc.c |   1 +
> include/configs/bk4r1.h   | 263
> +- include/configs/pcm052.h  |
> 51 +--- 19 files changed, 956 insertions(+), 411 

[U-Boot] [PATCH v3 47/60] mpc83xx: Migrate CONFIG_SYS_IMMR to Kconfig

2019-01-21 Thread Mario Six
Migrate CONFIG_SYS_IMMR to Kconfig for MPC83xx.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/Kconfig| 7 +++
 configs/TQM834x_defconfig   | 1 +
 configs/ids8313_defconfig   | 1 +
 include/configs/MPC8308RDB.h| 5 -
 include/configs/MPC8313ERDB_NAND.h  | 2 --
 include/configs/MPC8313ERDB_NOR.h   | 2 --
 include/configs/MPC8315ERDB.h   | 5 -
 include/configs/MPC8323ERDB.h   | 5 -
 include/configs/MPC832XEMDS.h   | 5 -
 include/configs/MPC8349EMDS.h   | 2 --
 include/configs/MPC8349EMDS_SDRAM.h | 2 --
 include/configs/MPC8349ITX.h| 5 -
 include/configs/MPC837XEMDS.h   | 5 -
 include/configs/MPC837XERDB.h   | 5 -
 include/configs/TQM834x.h   | 3 ---
 include/configs/caddy2.h| 2 --
 include/configs/hrcon.h | 5 -
 include/configs/ids8313.h   | 2 --
 include/configs/kmcoge5ne.h | 5 -
 include/configs/kmeter1.h   | 5 -
 include/configs/kmopti2.h   | 5 -
 include/configs/kmsupx5.h   | 5 -
 include/configs/kmtegr1.h   | 5 -
 include/configs/kmtepr2.h   | 5 -
 include/configs/kmvect1.h   | 5 -
 include/configs/mpc8308_p1m.h   | 5 -
 include/configs/sbc8349.h   | 2 --
 include/configs/strider.h   | 5 -
 include/configs/suvd3.h | 5 -
 include/configs/tuge1.h | 5 -
 include/configs/tuxx1.h | 5 -
 include/configs/ve8313.h| 2 --
 include/configs/vme8349.h   | 2 --
 33 files changed, 9 insertions(+), 121 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 5fb4228076e..96376837abb 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -282,6 +282,13 @@ config ARCH_MPC837X
select MPC83XX_LDP_PIN
select MPC83XX_SECOND_I2C_SUPPORT
 
+config SYS_IMMR
+   hex "Value for IMMR"
+   default 0xE000
+   help
+ Address for the Internal Memory-Mapped Registers (IMMR) window used
+ to configure the features of the SoC.
+
 source "arch/powerpc/cpu/mpc83xx/hrcw/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/bats/Kconfig"
 source "arch/powerpc/cpu/mpc83xx/lblaw/Kconfig"
diff --git a/configs/TQM834x_defconfig b/configs/TQM834x_defconfig
index e85bfaea315..f5746cfad71 100644
--- a/configs/TQM834x_defconfig
+++ b/configs/TQM834x_defconfig
@@ -4,6 +4,7 @@ CONFIG_SYS_CLK_FREQ=6000
 CONFIG_MPC83xx=y
 CONFIG_HIGH_BATS=y
 CONFIG_TARGET_TQM834X=y
+CONFIG_SYS_IMMR=0xff40
 CONFIG_DDR_MC_CLOCK_MODE_1_1=y
 CONFIG_SYSTEM_PLL_FACTOR_4_1=y
 CONFIG_CORE_PLL_RATIO_2_1=y
diff --git a/configs/ids8313_defconfig b/configs/ids8313_defconfig
index 24590d1448b..9c16a1231c6 100644
--- a/configs/ids8313_defconfig
+++ b/configs/ids8313_defconfig
@@ -4,6 +4,7 @@ CONFIG_SYS_CLK_FREQ=6600
 CONFIG_MPC83xx=y
 CONFIG_HIGH_BATS=y
 CONFIG_TARGET_IDS8313=y
+CONFIG_SYS_IMMR=0xF000
 CONFIG_CORE_PLL_RATIO_2_1=y
 CONFIG_PCI_HOST_MODE_ENABLE=y
 CONFIG_BOOT_ROM_INTERFACE_GPCM_8BIT=y
diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h
index 9c4de054403..e825cfbd174 100644
--- a/include/configs/MPC8308RDB.h
+++ b/include/configs/MPC8308RDB.h
@@ -52,11 +52,6 @@
SICRL_I2C2_PF0 |\
SICRL_ETSEC1_GTX_CLK125)/* 0x0040 */
 
-/*
- * IMMR new address
- */
-#define CONFIG_SYS_IMMR0xE000
-
 /*
  * SERDES
  */
diff --git a/include/configs/MPC8313ERDB_NAND.h 
b/include/configs/MPC8313ERDB_NAND.h
index 2f48b135c46..e23df14ec17 100644
--- a/include/configs/MPC8313ERDB_NAND.h
+++ b/include/configs/MPC8313ERDB_NAND.h
@@ -54,8 +54,6 @@
 #define CONFIG_VSC7385_ENET
 #define CONFIG_TSEC2
 
-#define CONFIG_SYS_IMMR0xE000
-
 #if !defined(CONFIG_SPL_BUILD)
 #define CONFIG_DEFAULT_IMMRCONFIG_SYS_IMMR
 #endif
diff --git a/include/configs/MPC8313ERDB_NOR.h 
b/include/configs/MPC8313ERDB_NOR.h
index bd1e54feec3..17cd8adc859 100644
--- a/include/configs/MPC8313ERDB_NOR.h
+++ b/include/configs/MPC8313ERDB_NOR.h
@@ -30,8 +30,6 @@
 #define CONFIG_VSC7385_ENET
 #define CONFIG_TSEC2
 
-#define CONFIG_SYS_IMMR0xE000
-
 #define CONFIG_SYS_MEMTEST_START   0x1000
 #define CONFIG_SYS_MEMTEST_END 0x07f0
 
diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
index 5ce213f5949..fbba2fbb50b 100644
--- a/include/configs/MPC8315ERDB.h
+++ b/include/configs/MPC8315ERDB.h
@@ -31,11 +31,6 @@
 
 #define CONFIG_HWCONFIG
 
-/*
- * IMMR new address
- */
-#define CONFIG_SYS_IMMR0xE000
-
 /*
  * Arbiter Setup
  */
diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h
index abc62f7e699..b528c2901b4 100644
--- a/include/configs/MPC8323ERDB.h
+++ b/include/configs/MPC8323ERDB.h
@@ -20,11 +20,6 @@
  */
 #define CONFIG_SYS_SICRL  

[U-Boot] [PATCH v3 44/60] mpc83xx: Remove last CONFIG_MPC83xx

2019-01-21 Thread Mario Six
Remove the last instances of the CONFIG_MPC83xx symbol.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 include/configs/hrcon.h   | 1 -
 include/configs/strider.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/include/configs/hrcon.h b/include/configs/hrcon.h
index 9318e6252ae..4001a0a16b0 100644
--- a/include/configs/hrcon.h
+++ b/include/configs/hrcon.h
@@ -12,7 +12,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001 /* E300 family */
-#define CONFIG_MPC83xx 1 /* MPC83xx family */
 
 #define CONFIG_SYS_FSL_ESDHC_ADDR  CONFIG_SYS_MPC83xx_ESDHC_ADDR
 
diff --git a/include/configs/strider.h b/include/configs/strider.h
index dd89ee8c815..94164de06c2 100644
--- a/include/configs/strider.h
+++ b/include/configs/strider.h
@@ -12,7 +12,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001 /* E300 family */
-#define CONFIG_MPC83xx 1 /* MPC83xx family */
 
 #define CONFIG_SYS_FSL_ESDHC_ADDR  CONFIG_SYS_MPC83xx_ESDHC_ADDR
 
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 59/60] keymile: Remove CONFIG_SYS_APP{1, 2}_{BASE, SIZE}

2019-01-21 Thread Mario Six
CONFIG_SYS_APP1_BASE, CONFIG_SYS_APP2_BASE, CONFIG_SYS_APP1_SIZE, and
CONFIG_SYS_APP2_SIZE are no longer used in the keymile config files
(they were used for setting values, which were converted to Kconfig
earlier in the series).

Remove them from the configs and the whitelist.

Signed-off-by: Mario Six 

---

v2 -> v3:
New in v3

---
 include/configs/kmopti2.h| 5 -
 include/configs/kmsupx5.h| 3 ---
 include/configs/kmtegr1.h| 5 -
 include/configs/kmtepr2.h| 5 -
 include/configs/kmvect1.h| 5 -
 include/configs/suvd3.h  | 5 -
 include/configs/tuge1.h  | 3 ---
 include/configs/tuxx1.h  | 5 -
 scripts/config_whitelist.txt | 4 
 9 files changed, 40 deletions(-)

diff --git a/include/configs/kmopti2.h b/include/configs/kmopti2.h
index 0094f34ef1b..f1b7c2f02e3 100644
--- a/include/configs/kmopti2.h
+++ b/include/configs/kmopti2.h
@@ -289,11 +289,6 @@
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
-#define CONFIG_SYS_APP1_BASE   0xA000/* PAXG */
-#defineCONFIG_SYS_APP1_SIZE256 /* Megabytes */
-#define CONFIG_SYS_APP2_BASE   0xB000/* PINC3 */
-#defineCONFIG_SYS_APP2_SIZE256 /* Megabytes */
-
 /*
  * Init Local Bus Memory Controller:
  *   Device on board
diff --git a/include/configs/kmsupx5.h b/include/configs/kmsupx5.h
index 5afb969379b..0dd7420e8c9 100644
--- a/include/configs/kmsupx5.h
+++ b/include/configs/kmsupx5.h
@@ -289,9 +289,6 @@
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
-#define CONFIG_SYS_APP1_BASE   0xA000/* PAXG */
-#defineCONFIG_SYS_APP1_SIZE256 /* Megabytes */
-
 /*
  * Init Local Bus Memory Controller:
  *   Device on board
diff --git a/include/configs/kmtegr1.h b/include/configs/kmtegr1.h
index 4f61ed0346d..8f9bbefa7fa 100644
--- a/include/configs/kmtegr1.h
+++ b/include/configs/kmtegr1.h
@@ -344,11 +344,6 @@
 /* must be after the include because KMBEC_FPGA is otherwise undefined */
 #define CONFIG_SYS_NAND_BASE CONFIG_SYS_KMBEC_FPGA_BASE /* PRIO_BASE_ADDRESS */
 
-#define CONFIG_SYS_APP1_BASE   0xA000
-#define CONFIG_SYS_APP1_SIZE   256 /* Megabytes */
-#define CONFIG_SYS_APP2_BASE   0xB000
-#define CONFIG_SYS_APP2_SIZE   256 /* Megabytes */
-
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
diff --git a/include/configs/kmtepr2.h b/include/configs/kmtepr2.h
index 862fdb7e2d7..b77219f72cb 100644
--- a/include/configs/kmtepr2.h
+++ b/include/configs/kmtepr2.h
@@ -289,11 +289,6 @@
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
-#define CONFIG_SYS_APP1_BASE   0xA000/* PAXG */
-#defineCONFIG_SYS_APP1_SIZE256 /* Megabytes */
-#define CONFIG_SYS_APP2_BASE   0xB000/* PINC3 */
-#defineCONFIG_SYS_APP2_SIZE256 /* Megabytes */
-
 /*
  * Init Local Bus Memory Controller:
  *   Device on board
diff --git a/include/configs/kmvect1.h b/include/configs/kmvect1.h
index 802ab9c9344..785475ef458 100644
--- a/include/configs/kmvect1.h
+++ b/include/configs/kmvect1.h
@@ -333,11 +333,6 @@
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
-#define CONFIG_SYS_APP1_BASE   0xA000
-#define CONFIG_SYS_APP1_SIZE   256 /* Megabytes */
-#define CONFIG_SYS_APP2_BASE   0xB000
-#define CONFIG_SYS_APP2_SIZE   256 /* Megabytes */
-
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
diff --git a/include/configs/suvd3.h b/include/configs/suvd3.h
index 9421204f2c3..456cd9dd707 100644
--- a/include/configs/suvd3.h
+++ b/include/configs/suvd3.h
@@ -286,11 +286,6 @@
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
-#define CONFIG_SYS_APP1_BASE   0xA000
-#define CONFIG_SYS_APP1_SIZE   256 /* Megabytes */
-#define CONFIG_SYS_APP2_BASE   0xB000
-#define CONFIG_SYS_APP2_SIZE   256 /* Megabytes */
-
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
diff --git a/include/configs/tuge1.h b/include/configs/tuge1.h
index 3364b5379ea..01d8d6b3039 100644
--- a/include/configs/tuge1.h
+++ b/include/configs/tuge1.h
@@ -289,9 +289,6 @@
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
-#define CONFIG_SYS_APP1_BASE   0xA000/* PAXG */
-#defineCONFIG_SYS_APP1_SIZE256 /* Megabytes */
-
 /*
  * Init Local Bus Memory Controller:
  *   Device on board
diff --git a/include/configs/tuxx1.h b/include/configs/tuxx1.h
index 4a3edf9be08..c1d06f00676 100644
--- a/include/configs/tuxx1.h
+++ b/include/configs/tuxx1.h
@@ -289,11 +289,6 @@
 /* EEprom support */
 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
 
-#define CONFIG_SYS_APP1_BASE   0xA000/* PAXG */
-#defineCONFIG_SYS_APP1_SIZE256 /* Megabytes */
-#define CONFIG_SYS_APP2_BASE   0xB000/* PINC3 */
-#define

Re: [U-Boot] [linux-sunxi] [PATCH 0/9] sunxi: enable DM_MMC

2019-01-21 Thread Jagan Teki
On Sat, Jan 19, 2019 at 7:02 AM Andre Przywara  wrote:
>
> This series enables the Allwinner MMC driver to drive all SoCs with its
> DM_MMC variant. We use the gates clock and reset support from the new
> clock driver, but keep the actual mod clock in its somewhat hackish
> state. Properly supporting this via the clock driver is a bit more work.
> The per-compatible variant struct for now only holds the mod clock
> address (which will go away), but we will need the struct later again
> for the various timing modes.
>
> This allows us to eventually enable DM_MMC for all SoCs, and get rid of
> the nasty deprecation warning.
>
> The first patch adds the MMC clock gates and resets to the clock driver.
> Patch 2/9 adds support for the A80 MMC config clock, which is a bit
> special. I can't test this, so please give this a try if you have a board.
>
> Patch 3 uses the new clocks in the MMC driver, the following three patches
> add the remaining compatible strings along with their required mod clock
> addresses.
>
> Patch 7 fixes the Pine64-LTS board, while patch 8 eventually enables
> everything. Patch 9 is some comment fix to make it easier to reason
> about what part of the driver is for DM_MMC and which is not.
>
> I successfully compiled the HEAD for all 142 Allwinner boards, also
> compiled all patches for selected boards.
>
> This was briefly tested on Pine-H64 (H6), Pine64-LTS (A64), OrangePi PC 2
> (H5), OrangePi Zero (H2+) and BananaPi-M1 (A20).
>
> Please run it on every board that you can get hold of to give this series
> a good shake.
>
> This goes on top of current sunxi/master (543049ab5906) and is available
> on https://github.com/apritzel/u-boot/commits/sunxi-dm.
>
> This replaces Jagan's v2 series "mmc: sunxi: Enable DM_MMC" in a more
> driver model compliant way, borrowing two patches from him.

You may be wait some tome before I'm commenting or for next version
changes.  Many changes like CLK and RESET support to mmc been in ML,
since you are not happy with v2 I prepared the CLK version for v2 (in
between you sent your version). Let me grab your few changes and
finalize my v3.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [RFC 1/9] Arm: dts: imx7d-pico: Import Linux pico-pi dts

2019-01-21 Thread Bryan O'Donoghue



On 20/01/2019 21:18, Joris Offouga wrote:

This patch imports the Linux kernel base board imx7d-pico.dtsi and specific
dts for imx7d-pico-pi


I recommend including the upstream Linux SHA in the commit log to make 
it easier to validate against and also if any changes/bugfixes go in 
upstream makes it easier to cherry-pick onto the local dts in u-boot.


---
bod
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 1/9] sunxi: clk: add MMC gates/resets

2019-01-21 Thread Jagan Teki
From: Andre Przywara 

Add the MMC clock gates and reset bits for all the Allwinner SoCs.
This allows them to be used by the MMC driver.

We don't advertise the mod clock yet, as this is still handled by the
MMC driver.

Signed-off-by: Andre Przywara 
[jagan: add V3S gates/resets, fix CLK_AHB1_MMC3 bit]
Signed-off-by: Jagan Teki 
---
 drivers/clk/sunxi/clk_a10.c  | 4 
 drivers/clk/sunxi/clk_a10s.c | 3 +++
 drivers/clk/sunxi/clk_a23.c  | 6 ++
 drivers/clk/sunxi/clk_a31.c  | 8 
 drivers/clk/sunxi/clk_a64.c  | 6 ++
 drivers/clk/sunxi/clk_a83t.c | 6 ++
 drivers/clk/sunxi/clk_h3.c   | 6 ++
 drivers/clk/sunxi/clk_h6.c   | 6 ++
 drivers/clk/sunxi/clk_r40.c  | 8 
 drivers/clk/sunxi/clk_v3s.c  | 6 ++
 10 files changed, 59 insertions(+)

diff --git a/drivers/clk/sunxi/clk_a10.c b/drivers/clk/sunxi/clk_a10.c
index b00f51af8b..2aa41efe17 100644
--- a/drivers/clk/sunxi/clk_a10.c
+++ b/drivers/clk/sunxi/clk_a10.c
@@ -18,6 +18,10 @@ static struct ccu_clk_gate a10_gates[] = {
[CLK_AHB_OHCI0] = GATE(0x060, BIT(2)),
[CLK_AHB_EHCI1] = GATE(0x060, BIT(3)),
[CLK_AHB_OHCI1] = GATE(0x060, BIT(4)),
+   [CLK_AHB_MMC0]  = GATE(0x060, BIT(8)),
+   [CLK_AHB_MMC1]  = GATE(0x060, BIT(9)),
+   [CLK_AHB_MMC2]  = GATE(0x060, BIT(10)),
+   [CLK_AHB_MMC3]  = GATE(0x060, BIT(11)),
 
[CLK_APB1_UART0]= GATE(0x06c, BIT(16)),
[CLK_APB1_UART1]= GATE(0x06c, BIT(17)),
diff --git a/drivers/clk/sunxi/clk_a10s.c b/drivers/clk/sunxi/clk_a10s.c
index aa904ce067..87b74e52dc 100644
--- a/drivers/clk/sunxi/clk_a10s.c
+++ b/drivers/clk/sunxi/clk_a10s.c
@@ -16,6 +16,9 @@ static struct ccu_clk_gate a10s_gates[] = {
[CLK_AHB_OTG]   = GATE(0x060, BIT(0)),
[CLK_AHB_EHCI]  = GATE(0x060, BIT(1)),
[CLK_AHB_OHCI]  = GATE(0x060, BIT(2)),
+   [CLK_AHB_MMC0]  = GATE(0x060, BIT(8)),
+   [CLK_AHB_MMC1]  = GATE(0x060, BIT(9)),
+   [CLK_AHB_MMC2]  = GATE(0x060, BIT(10)),
 
[CLK_APB1_UART0]= GATE(0x06c, BIT(16)),
[CLK_APB1_UART1]= GATE(0x06c, BIT(17)),
diff --git a/drivers/clk/sunxi/clk_a23.c b/drivers/clk/sunxi/clk_a23.c
index 854259bf81..1ef2359286 100644
--- a/drivers/clk/sunxi/clk_a23.c
+++ b/drivers/clk/sunxi/clk_a23.c
@@ -13,6 +13,9 @@
 #include 
 
 static struct ccu_clk_gate a23_gates[] = {
+   [CLK_BUS_MMC0]  = GATE(0x060, BIT(8)),
+   [CLK_BUS_MMC1]  = GATE(0x060, BIT(9)),
+   [CLK_BUS_MMC2]  = GATE(0x060, BIT(10)),
[CLK_BUS_OTG]   = GATE(0x060, BIT(24)),
[CLK_BUS_EHCI]  = GATE(0x060, BIT(26)),
[CLK_BUS_OHCI]  = GATE(0x060, BIT(29)),
@@ -35,6 +38,9 @@ static struct ccu_reset a23_resets[] = {
[RST_USB_PHY1]  = RESET(0x0cc, BIT(1)),
[RST_USB_HSIC]  = RESET(0x0cc, BIT(2)),
 
+   [RST_BUS_MMC0]  = RESET(0x2c0, BIT(8)),
+   [RST_BUS_MMC1]  = RESET(0x2c0, BIT(9)),
+   [RST_BUS_MMC2]  = RESET(0x2c0, BIT(10)),
[RST_BUS_OTG]   = RESET(0x2c0, BIT(24)),
[RST_BUS_EHCI]  = RESET(0x2c0, BIT(26)),
[RST_BUS_OHCI]  = RESET(0x2c0, BIT(29)),
diff --git a/drivers/clk/sunxi/clk_a31.c b/drivers/clk/sunxi/clk_a31.c
index a38d76cb7c..fa81f9a710 100644
--- a/drivers/clk/sunxi/clk_a31.c
+++ b/drivers/clk/sunxi/clk_a31.c
@@ -13,6 +13,10 @@
 #include 
 
 static struct ccu_clk_gate a31_gates[] = {
+   [CLK_AHB1_MMC0] = GATE(0x060, BIT(8)),
+   [CLK_AHB1_MMC1] = GATE(0x060, BIT(9)),
+   [CLK_AHB1_MMC2] = GATE(0x060, BIT(10)),
+   [CLK_AHB1_MMC3] = GATE(0x060, BIT(12)),
[CLK_AHB1_OTG]  = GATE(0x060, BIT(24)),
[CLK_AHB1_EHCI0]= GATE(0x060, BIT(26)),
[CLK_AHB1_EHCI1]= GATE(0x060, BIT(27)),
@@ -40,6 +44,10 @@ static struct ccu_reset a31_resets[] = {
[RST_USB_PHY1]  = RESET(0x0cc, BIT(1)),
[RST_USB_PHY2]  = RESET(0x0cc, BIT(2)),
 
+   [RST_AHB1_MMC0] = RESET(0x2c0, BIT(8)),
+   [RST_AHB1_MMC1] = RESET(0x2c0, BIT(9)),
+   [RST_AHB1_MMC2] = RESET(0x2c0, BIT(10)),
+   [RST_AHB1_MMC3] = RESET(0x2c0, BIT(11)),
[RST_AHB1_OTG]  = RESET(0x2c0, BIT(24)),
[RST_AHB1_EHCI0]= RESET(0x2c0, BIT(26)),
[RST_AHB1_EHCI1]= RESET(0x2c0, BIT(27)),
diff --git a/drivers/clk/sunxi/clk_a64.c b/drivers/clk/sunxi/clk_a64.c
index a2ba6eefc5..910275fbce 100644
--- a/drivers/clk/sunxi/clk_a64.c
+++ b/drivers/clk/sunxi/clk_a64.c
@@ -13,6 +13,9 @@
 #include 
 
 static const struct ccu_clk_gate a64_gates[] = {
+   [CLK_BUS_MMC0]  = GATE(0x060, BIT(8)),
+   [CLK_BUS_MMC1]  = GATE(0x060, BIT(9)),
+   [CLK_BUS_MMC2]  = GATE(0x060, BIT(10)),
[CLK_BUS_OTG]   = GATE(0x060, BIT(23)),
  

[U-Boot] [PATCH v3 5/9] mmc: sunxi: Add DM_MMC support for H6

2019-01-21 Thread Jagan Teki
Unlike other Allwinner SoC's, H6 comes with different
clock and reset control offset values. So support them
via driver data.

Cc: Jaehoon Chung 
Signed-off-by: Jagan Teki 
---
 drivers/mmc/sunxi_mmc.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 1259e627cc..1e13a0665d 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -680,6 +680,10 @@ static const struct sunxi_mmc_variant sun4i_a10_variant = {
.mclk_offset = 0x88,
 };
 
+static const struct sunxi_mmc_variant sun50i_h6_variant = {
+   .mclk_offset = 0x830,
+};
+
 static const struct udevice_id sunxi_mmc_ids[] = {
{
  .compatible = "allwinner,sun4i-a10-mmc",
@@ -705,6 +709,14 @@ static const struct udevice_id sunxi_mmc_ids[] = {
  .compatible = "allwinner,sun50i-a64-emmc",
  .data = (ulong)_a10_variant,
},
+   {
+ .compatible = "allwinner,sun50i-h6-mmc",
+ .data = (ulong)_h6_variant,
+   },
+   {
+ .compatible = "allwinner,sun50i-h6-emmc",
+ .data = (ulong)_h6_variant,
+   },
{ /* sentinel */ }
 };
 
-- 
2.18.0.321.gffc6fa0e3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 0/9] mmc: sunxi: Enable DM_MMC

2019-01-21 Thread Jagan Teki
Compared to previous version changes[1] this version do manage
ahb clocks/resets via CLK framework.

This version created changes along with Andre patches to support
clock/resets[2]

Tested A64, SD, eMMC and respective changes available at
u-boot-sunxi/next

Changes for v3:
- Handle clock via CLK framework.
Changes for v2:
- update the 'reset enablement' logic to do
  required SoC's

[1] https://patchwork.ozlabs.org/cover/1026828/
[2] https://patchwork.ozlabs.org/cover/1027850/

Andre Przywara (2):
  sunxi: clk: add MMC gates/resets
  sunxi: clk: A80: add MMC clock support

Jagan Teki (7):
  mmc: sunxi: Add A83T emmc compatible
  mmc: sunxi: Add mmc, emmc H5/A64 compatible
  mmc: sunxi: Add DM_MMC support for H6
  mmc: sunxi: Add DM_MMC support for A80
  dm: mmc: sunxi: Add CLK and RESET support
  arm: sunxi: Enable DM_MMC
  arm: dts: sunxi: Enumerate MMC2 as MMC1

 arch/arm/Kconfig  |  1 +
 arch/arm/dts/sunxi-u-boot.dtsi|  4 ++
 arch/arm/mach-sunxi/Kconfig   |  1 -
 configs/Linksprite_pcDuino3_defconfig |  1 -
 drivers/clk/sunxi/clk_a10.c   |  4 ++
 drivers/clk/sunxi/clk_a10s.c  |  3 +
 drivers/clk/sunxi/clk_a23.c   |  6 ++
 drivers/clk/sunxi/clk_a31.c   |  8 +++
 drivers/clk/sunxi/clk_a64.c   |  6 ++
 drivers/clk/sunxi/clk_a80.c   | 28 -
 drivers/clk/sunxi/clk_a83t.c  |  6 ++
 drivers/clk/sunxi/clk_h3.c|  6 ++
 drivers/clk/sunxi/clk_h6.c|  6 ++
 drivers/clk/sunxi/clk_r40.c   |  8 +++
 drivers/clk/sunxi/clk_v3s.c   |  6 ++
 drivers/mmc/sunxi_mmc.c   | 84 +--
 16 files changed, 170 insertions(+), 8 deletions(-)

-- 
2.18.0.321.gffc6fa0e3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 3/9] mmc: sunxi: Add A83T emmc compatible

2019-01-21 Thread Jagan Teki
Add emmc compatible for A83T SoC.

Cc: Jaehoon Chung 
Signed-off-by: Jagan Teki 
---
 drivers/mmc/sunxi_mmc.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 302332bf97..ec4f227130 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -693,6 +693,10 @@ static const struct udevice_id sunxi_mmc_ids[] = {
  .compatible = "allwinner,sun7i-a20-mmc",
  .data = (ulong)_a10_variant,
},
+   {
+ .compatible = "allwinner,sun8i-a83t-emmc",
+ .data = (ulong)_a10_variant,
+   },
{ /* sentinel */ }
 };
 
-- 
2.18.0.321.gffc6fa0e3

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] Please pull u-boot-marvell/master

2019-01-21 Thread Stefan Roese

Hi Tom,

please pull the first Marvell patches in this merge window with the
following changes:


- Sync Armada-38x dts with Linux 4.20 from Chris
- Misc changes and enhancements to Turris Mox (v4) from Marek
- Reserve PSCI area for Armada 8k from Heinrich
- New Allied Telesis x530 board (Armada-385) from Chris
- Misc minor changes (defconfig etc)


Thanks,
Stefan


The following changes since commit 2acc24fc28ef782f4baef1aa0193d520ee9610b9:

  Kconfig: Migrate BOUNCE_BUFFER (2019-01-19 09:49:26 -0500)

are available in the Git repository at:

  git://www.denx.de/git/u-boot-marvell.git

for you to fetch changes up to 0e31666dfa043ab71fb1fbbba4feacfe8af3e06b:

  ARM: mvebu: add support for Allied Telesis x530 (2019-01-21 11:39:50 +0100)


Baruch Siach (1):
  board: mvebu: drop unused ETH_PHY macro definitions

Chris Packham (2):
  ARM: mvebu: sync Armada-38x dts with Linux 4.20
  ARM: mvebu: add support for Allied Telesis x530

Heinrich Schuchardt (2):
  arm64: dts: marvell: armada-ap806: reserve PSCI area
  arm64: mvebu: defconfig: enable CONFIG_CMD_NVME

Marek Behún (10):
  arm: mvebu: turris_mox: Cosmetic restructurization
  arm: mvebu: turris_mox: Change SERDES map depending on module topology
  arm: mvebu: turris_mox: Check and configure modules
  arm: mvebu: dts: Fix Turris Mox device tree
  arm: mvebu: turris_mox: Update defconfig
  watchdog: armada_37xx: Fix compliance with kernel's driver
  MAINTAINERS: Add entry for CZ.NIC's Turris project
  arm: mvebu: turris_mox: Read info (and ethaddrs) from OTP
  arm: mvebu: turris_mox: Support 1 GB version of Turris Mox
  arm: mvebu: configs: turris_mox: Add 64 MiB of boot memory

 MAINTAINERS   |   8 +
 arch/arm/dts/Makefile |   4 +-
 arch/arm/dts/armada-3720-turris-mox.dts   |  23 +-
 arch/arm/dts/armada-380.dtsi  |  44 +--
 arch/arm/dts/armada-385-atl-x530-u-boot.dtsi  |  13 +
 arch/arm/dts/armada-385-atl-x530.dts  |  50 +++
 arch/arm/dts/armada-385-atl-x530.dtsi | 266 +++
 arch/arm/dts/armada-385-atl-x530DP.dts|  51 +++
 arch/arm/dts/armada-385-atl-x530DP.dtsi   | 149 +
 arch/arm/dts/armada-385.dtsi  |  63 +---
 arch/arm/dts/armada-388-clearfog.dts  |  25 +-
 arch/arm/dts/armada-388.dtsi  |  43 +--
 arch/arm/dts/armada-38x-controlcenterdc.dts   |  68 ++--
 arch/arm/dts/armada-38x.dtsi  | 283 +---
 arch/arm/dts/armada-ap806.dtsi|  11 +
 arch/arm/mach-mvebu/Kconfig   |   7 +
 arch/arm/mach-mvebu/arm64-common.c|   4 +-
 board/CZ.NIC/turris_mox/Makefile  |   2 +-
 board/CZ.NIC/turris_mox/mox_sp.c  | 136 
 board/CZ.NIC/turris_mox/mox_sp.h  |  15 +
 board/CZ.NIC/turris_mox/turris_mox.c  | 462 +++---
 board/Marvell/db-88f6820-amc/db-88f6820-amc.c |   4 -
 board/Marvell/db-88f6820-gp/db-88f6820-gp.c   |   4 -
 board/alliedtelesis/common/gpio_hog.c |  36 ++
 board/alliedtelesis/common/gpio_hog.h |  13 +
 board/alliedtelesis/x530/MAINTAINERS  |  12 +
 board/alliedtelesis/x530/Makefile |   9 +
 board/alliedtelesis/x530/kwbimage.cfg |  12 +
 board/alliedtelesis/x530/x530.c   | 161 +
 board/gdsys/a38x/controlcenterdc.c|   4 -
 board/kobol/helios4/helios4.c |   4 -
 board/solidrun/clearfog/clearfog.c|   4 -
 configs/clearfog_gt_8k_defconfig  |   2 +
 configs/mvebu_db_armada8k_defconfig   |   2 +
 configs/mvebu_mcbin-88f8040_defconfig |   2 +
 configs/turris_mox_defconfig  |   6 +
 configs/x530_defconfig|  71 
 drivers/watchdog/armada-37xx-wdt.c| 109 +++---
 include/configs/turris_mox.h  |   2 +
 include/configs/x530.h| 134 
 40 files changed, 1918 insertions(+), 400 deletions(-)
 create mode 100644 arch/arm/dts/armada-385-atl-x530-u-boot.dtsi
 create mode 100644 arch/arm/dts/armada-385-atl-x530.dts
 create mode 100644 arch/arm/dts/armada-385-atl-x530.dtsi
 create mode 100644 arch/arm/dts/armada-385-atl-x530DP.dts
 create mode 100644 arch/arm/dts/armada-385-atl-x530DP.dtsi
 create mode 100644 board/CZ.NIC/turris_mox/mox_sp.c
 create mode 100644 board/CZ.NIC/turris_mox/mox_sp.h
 create mode 100644 board/alliedtelesis/common/gpio_hog.c
 create mode 100644 board/alliedtelesis/common/gpio_hog.h
 create mode 100644 board/alliedtelesis/x530/MAINTAINERS
 create mode 100644 board/alliedtelesis/x530/Makefile
 create mode 100644 board/alliedtelesis/x530/kwbimage.cfg
 create mode 100644 

[U-Boot] [PATCH v3 13/60] mpc83xx: Make distinct MPC8313ERDB targets

2019-01-21 Thread Mario Six
MPC8313ERDB has the option of either enabling NOR or NAND boot in its
config file (by commenting out certain #ifdefs). To keep this ability
after migrating options to Kconfig, we introduce two MPC8313ERDB
configs: one for NOR, and one for NAND.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Combined config creation and simplification patches

---
 arch/powerpc/cpu/mpc83xx/Kconfig  |  10 +-
 board/freescale/mpc8313erdb/Kconfig   |  17 +-
 configs/MPC8313ERDB_33_defconfig  |   2 +-
 configs/MPC8313ERDB_66_defconfig  |   2 +-
 configs/MPC8313ERDB_NAND_33_defconfig |   2 +-
 configs/MPC8313ERDB_NAND_66_defconfig |   2 +-
 .../{MPC8313ERDB.h => MPC8313ERDB_NAND.h} |  61 +-
 include/configs/MPC8313ERDB_NOR.h | 591 ++
 8 files changed, 633 insertions(+), 54 deletions(-)
 rename include/configs/{MPC8313ERDB.h => MPC8313ERDB_NAND.h} (90%)
 create mode 100644 include/configs/MPC8313ERDB_NOR.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 29d84f363d1..ede98c70da7 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -29,8 +29,14 @@ config TARGET_MPC8308RDB
select ARCH_MPC8308
select SYS_FSL_ERRATUM_ESDHC111
 
-config TARGET_MPC8313ERDB
-   bool "Support MPC8313ERDB"
+config TARGET_MPC8313ERDB_NOR
+   bool "Support MPC8313ERDB_NOR"
+   select ARCH_MPC8313
+   select BOARD_EARLY_INIT_F
+   select SUPPORT_SPL
+
+config TARGET_MPC8313ERDB_NAND
+   bool "Support MPC8313ERDB_NAND"
select ARCH_MPC8313
select BOARD_EARLY_INIT_F
select SUPPORT_SPL
diff --git a/board/freescale/mpc8313erdb/Kconfig 
b/board/freescale/mpc8313erdb/Kconfig
index 145608feab2..b6332a1368b 100644
--- a/board/freescale/mpc8313erdb/Kconfig
+++ b/board/freescale/mpc8313erdb/Kconfig
@@ -1,4 +1,4 @@
-if TARGET_MPC8313ERDB
+if TARGET_MPC8313ERDB_NOR
 
 config SYS_BOARD
default "mpc8313erdb"
@@ -7,6 +7,19 @@ config SYS_VENDOR
default "freescale"
 
 config SYS_CONFIG_NAME
-   default "MPC8313ERDB"
+   default "MPC8313ERDB_NOR"
+
+endif
+
+if TARGET_MPC8313ERDB_NAND
+
+config SYS_BOARD
+   default "mpc8313erdb"
+
+config SYS_VENDOR
+   default "freescale"
+
+config SYS_CONFIG_NAME
+   default "MPC8313ERDB_NAND"
 
 endif
diff --git a/configs/MPC8313ERDB_33_defconfig b/configs/MPC8313ERDB_33_defconfig
index 3bb680c2179..cacb5ba0774 100644
--- a/configs/MPC8313ERDB_33_defconfig
+++ b/configs/MPC8313ERDB_33_defconfig
@@ -1,7 +1,7 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8313ERDB=y
+CONFIG_TARGET_MPC8313ERDB_NOR=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_33MHZ"
diff --git a/configs/MPC8313ERDB_66_defconfig b/configs/MPC8313ERDB_66_defconfig
index bb26a9e3813..6b29c2e5c9d 100644
--- a/configs/MPC8313ERDB_66_defconfig
+++ b/configs/MPC8313ERDB_66_defconfig
@@ -1,7 +1,7 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFE00
 CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8313ERDB=y
+CONFIG_TARGET_MPC8313ERDB_NOR=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_66MHZ"
diff --git a/configs/MPC8313ERDB_NAND_33_defconfig 
b/configs/MPC8313ERDB_NAND_33_defconfig
index ab28a78cbe5..4c8957c2742 100644
--- a/configs/MPC8313ERDB_NAND_33_defconfig
+++ b/configs/MPC8313ERDB_NAND_33_defconfig
@@ -3,7 +3,7 @@ CONFIG_SYS_TEXT_BASE=0x0010
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8313ERDB=y
+CONFIG_TARGET_MPC8313ERDB_NAND=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_33MHZ"
diff --git a/configs/MPC8313ERDB_NAND_66_defconfig 
b/configs/MPC8313ERDB_NAND_66_defconfig
index a454ec67fc6..ff3d0dc84e9 100644
--- a/configs/MPC8313ERDB_NAND_66_defconfig
+++ b/configs/MPC8313ERDB_NAND_66_defconfig
@@ -3,7 +3,7 @@ CONFIG_SYS_TEXT_BASE=0x0010
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
 CONFIG_MPC83xx=y
-CONFIG_TARGET_MPC8313ERDB=y
+CONFIG_TARGET_MPC8313ERDB_NAND=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
 CONFIG_SYS_EXTRA_OPTIONS="SYS_66MHZ"
diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB_NAND.h
similarity index 90%
rename from include/configs/MPC8313ERDB.h
rename to include/configs/MPC8313ERDB_NAND.h
index c5a8065d6a4..976b6854e49 100644
--- a/include/configs/MPC8313ERDB.h
+++ b/include/configs/MPC8313ERDB_NAND.h
@@ -15,7 +15,6 @@
 #define CONFIG_E3001
 #define CONFIG_MPC8313ERDB 1
 
-#ifdef CONFIG_NAND
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
 #define CONFIG_SPL_TARGET  "u-boot-with-spl.bin"
@@ -40,8 +39,6 @@
 #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE_SPL /* start of 
monitor */
 #endif
 
-#endif /* CONFIG_NAND */
-
 #ifndef CONFIG_SYS_MONITOR_BASE
 #define CONFIG_SYS_MONITOR_BASE

[U-Boot] [PATCH v3 19/60] ve8313: Merge BR/OR settings

2019-01-21 Thread Mario Six
The ve8313 has the option of either configuring the eLBC (enhanced local system 
bus) such that

* NOR flash is the first memory bank, and NAND flash is the second memory bank, 
or
* NAND flash is the first memory bank, and NOR flash is the second memory bank,

by using CONFIG_SYS_NOR_{BR,OR}_PRELIM and
CONFIG_SYS_NAND_{BR,OR}_PRELIM for defining
CONFIG_SYS_{BR,OR}{0,1}_PRELIM.

After Kconfig migration, replacing some lines in the defconfig will have
the same effect.

Hence, we will not create distinct ve8313_{NOR,NAND} configs for such a
small change.

Instead, fix the current default (NOR first, NAND second), and unroll
the  CONFIG_SYS_NAND_{BR,OR}_PRELIM options. This will ease the Kconfig
migration

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 include/configs/ve8313.h | 39 +++
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/include/configs/ve8313.h b/include/configs/ve8313.h
index 791eac363bd..87fbe36640b 100644
--- a/include/configs/ve8313.h
+++ b/include/configs/ve8313.h
@@ -115,18 +115,6 @@
 #define CONFIG_SYS_FLASH_SIZE  32  /* size in MB */
 #define CONFIG_SYS_FLASH_EMPTY_INFO/* display empty sectors */
 
-#define CONFIG_SYS_NOR_BR_PRELIM   (CONFIG_SYS_FLASH_BASE \
-   | BR_PS_16  /* 16 bit */ \
-   | BR_MS_GPCM/* MSEL = GPCM */ \
-   | BR_V) /* valid */
-#define CONFIG_SYS_NOR_OR_PRELIM   (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
-   | OR_GPCM_CSNT \
-   | OR_GPCM_ACS_DIV4 \
-   | OR_GPCM_SCY_5 \
-   | OR_GPCM_TRLX_SET \
-   | OR_GPCM_EAD)
-   /* 0xfe000c55 */
-
 #define CONFIG_SYS_LBLAWBAR0_PRELIMCONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_LBLAWAR0_PRELIM (LBLAWAR_EN | LBLAWAR_32MB)
 
@@ -172,24 +160,35 @@
 #define CONFIG_NAND_FSL_ELBC 1
 #define CONFIG_SYS_NAND_BLOCK_SIZE 16384
 
-#define CONFIG_SYS_NAND_BR_PRELIM  (CONFIG_SYS_NAND_BASE \
+
+#define CONFIG_SYS_BR0_PRELIM (CONFIG_SYS_FLASH_BASE \
+   | BR_PS_16  /* 16 bit */ \
+   | BR_MS_GPCM/* MSEL = GPCM */ \
+   | BR_V) /* valid */
+#define CONFIG_SYS_OR0_PRELIM (OR_AM_32MB \
+   | OR_GPCM_CSNT \
+   | OR_GPCM_ACS_DIV4 \
+   | OR_GPCM_SCY_5 \
+   | OR_GPCM_TRLX_SET \
+   | OR_GPCM_EAD)
+   /* 0xfe000c55 */
+
+#define CONFIG_SYS_BR1_PRELIM (CONFIG_SYS_NAND_BASE \
| BR_PS_8   \
| BR_DECC_CHK_GEN   \
| BR_MS_FCM \
| BR_V) /* valid */
/* 0x61000c21 */
-#define CONFIG_SYS_NAND_OR_PRELIM  (OR_AM_32KB \
+#define CONFIG_SYS_OR1_PRELIM (OR_AM_32KB \
| OR_FCM_BCTLD \
| OR_FCM_CHT \
| OR_FCM_SCY_2 \
| OR_FCM_RST \
-   | OR_FCM_TRLX)
-   /* 0x90ac */
+   | OR_FCM_TRLX) /* 0x90ac */
 
-#define CONFIG_SYS_BR0_PRELIM CONFIG_SYS_NOR_BR_PRELIM
-#define CONFIG_SYS_OR0_PRELIM CONFIG_SYS_NOR_OR_PRELIM
-#define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_NAND_BR_PRELIM
-#define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_NAND_OR_PRELIM
+/* Still needed for spl_minimal.c */
+#define CONFIG_SYS_NAND_BR_PRELIM CONFIG_SYS_BR1_PRELIM
+#define CONFIG_SYS_NAND_OR_PRELIM CONFIG_SYS_OR1_PRELIM
 
 #define CONFIG_SYS_LBLAWBAR1_PRELIMCONFIG_SYS_NAND_BASE
 #define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_32KB)
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 32/60] mpc83xx: pcie: Read the clock from registers

2019-01-21 Thread Mario Six
The MPC83xx DM timer driver disables arch.pciexp*_clk, and uses
clk_get_rate instead. But the legacy MPC83xx PCIe driver still uses
arch.pciexp*_clk for the clock.

Hence, read the PCIe clock from the registers in the legacy MPC83xx PCIe
driver.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 arch/powerpc/cpu/mpc83xx/pcie.c | 39 ++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/cpu/mpc83xx/pcie.c b/arch/powerpc/cpu/mpc83xx/pcie.c
index c250150224d..2608447d80d 100644
--- a/arch/powerpc/cpu/mpc83xx/pcie.c
+++ b/arch/powerpc/cpu/mpc83xx/pcie.c
@@ -176,6 +176,41 @@ static void mpc83xx_pcie_register_hose(int bus, struct 
pci_region *reg,
 
 #endif /* CONFIG_83XX_GENERIC_PCIE_REGISTER_HOSES */
 
+int get_pcie_clk(int index)
+{
+   volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
+   u32 pci_sync_in;
+   u8 spmf;
+   u8 clkin_div;
+   u32 sccr;
+   u32 csb_clk;
+   u32 testval;
+
+   clkin_div = ((im->clk.spmr & SPMR_CKID) >> SPMR_CKID_SHIFT);
+   sccr = im->clk.sccr;
+   pci_sync_in = CONFIG_SYS_CLK_FREQ / (1 + clkin_div);
+   spmf = (im->clk.spmr & SPMR_SPMF) >> SPMR_SPMF_SHIFT;
+   csb_clk = pci_sync_in * (1 + clkin_div) * spmf;
+
+   if (index)
+   testval = (sccr & SCCR_PCIEXP2CM) >> SCCR_PCIEXP2CM_SHIFT;
+   else
+   testval = (sccr & SCCR_PCIEXP1CM) >> SCCR_PCIEXP1CM_SHIFT;
+
+   switch (testval) {
+   case 0:
+   return 0;
+   case 1:
+   return csb_clk;
+   case 2:
+   return csb_clk / 2;
+   case 3:
+   return csb_clk / 3;
+   }
+
+   return 0;
+}
+
 static void mpc83xx_pcie_init_bus(int bus, struct pci_region *reg)
 {
immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
@@ -271,11 +306,9 @@ static void mpc83xx_pcie_init_bus(int bus, struct 
pci_region *reg)
/* Hose configure header is memory-mapped */
hose_cfg_base = (void *)pex;
 
-   get_clocks();
/* Configure the PCIE controller core clock ratio */
out_le32(hose_cfg_base + PEX_GCLK_RATIO,
-   (((bus ? gd->arch.pciexp2_clk : gd->arch.pciexp1_clk)
-   / 100) * 16) / 333);
+   ((get_pcie_clk(bus) / 100) * 16) / 333);
udelay(100);
 
/* Do Type 1 bridge configuration */
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 24/60] MPC8313ERDB: Remove CONFIG_MPC8313ERDB

2019-01-21 Thread Mario Six
CONFIG_MPC8313ERDB is unused, and
TARGET_MPC8313ERDB_NAND/TARGET_MPC8313ERDB_NOR Kconfig could replace it.

Hence, get rid of CONFIG_MPC8313ERDB.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 include/configs/MPC8313ERDB_NAND.h | 1 -
 include/configs/MPC8313ERDB_NOR.h  | 1 -
 scripts/config_whitelist.txt   | 1 -
 3 files changed, 3 deletions(-)

diff --git a/include/configs/MPC8313ERDB_NAND.h 
b/include/configs/MPC8313ERDB_NAND.h
index 976b6854e49..31c29001807 100644
--- a/include/configs/MPC8313ERDB_NAND.h
+++ b/include/configs/MPC8313ERDB_NAND.h
@@ -13,7 +13,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001
-#define CONFIG_MPC8313ERDB 1
 
 #define CONFIG_SPL_INIT_MINIMAL
 #define CONFIG_SPL_FLUSH_IMAGE
diff --git a/include/configs/MPC8313ERDB_NOR.h 
b/include/configs/MPC8313ERDB_NOR.h
index 81e92fb939f..afb0586c4b9 100644
--- a/include/configs/MPC8313ERDB_NOR.h
+++ b/include/configs/MPC8313ERDB_NOR.h
@@ -13,7 +13,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001
-#define CONFIG_MPC8313ERDB 1
 
 #ifndef CONFIG_SYS_MONITOR_BASE
 #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE/* start of 
monitor */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 49fc2f9f83e..3691246aaee 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1247,7 +1247,6 @@ CONFIG_MMC_SPI_SPEED
 CONFIG_MMC_SUNXI_SLOT
 CONFIG_MMU
 CONFIG_MONITOR_IS_IN_RAM
-CONFIG_MPC8313ERDB
 CONFIG_MPC8315ERDB
 CONFIG_MPC837XEMDS
 CONFIG_MPC837XERDB
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 31/60] mpc83xx: Kconfig: Migrate HRCW to Kconfig

2019-01-21 Thread Mario Six
The HRCW (hardware reset configuration word) is a constant that must be
hard-coded into the boot loader image. So, it must be available at
compile time, and cannot be migrated to the DT mechanism, but has to be
kept in Kconfig.

Configuration of this crucial variable should still be somewhat
comfortable. Hence, make its fields configurable in Kconfig, and
assemble the final value from these.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 arch/powerpc/cpu/mpc83xx/Kconfig|  69 ++
 arch/powerpc/cpu/mpc83xx/hrcw/Kconfig   | 816 
 arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h|  37 ++
 arch/powerpc/cpu/mpc83xx/start.S|   2 +
 board/freescale/mpc8315erdb/MAINTAINERS |   1 +
 board/freescale/mpc8349emds/MAINTAINERS |   1 +
 board/freescale/mpc8349itx/mpc8349itx.c |   2 +
 board/freescale/mpc837xemds/MAINTAINERS |   1 +
 configs/MPC8308RDB_defconfig|   7 +
 configs/MPC8313ERDB_33_defconfig|   8 +
 configs/MPC8313ERDB_66_defconfig|   7 +
 configs/MPC8313ERDB_NAND_33_defconfig   |   7 +
 configs/MPC8313ERDB_NAND_66_defconfig   |   6 +
 configs/MPC8315ERDB_defconfig   |   8 +
 configs/MPC8323ERDB_defconfig   |   6 +
 configs/MPC832XEMDS_ATM_defconfig   |   6 +
 configs/MPC832XEMDS_HOST_33_defconfig   |   6 +
 configs/MPC832XEMDS_HOST_66_defconfig   |   6 +
 configs/MPC832XEMDS_SLAVE_defconfig |   3 +
 configs/MPC832XEMDS_defconfig   |   6 +
 configs/MPC8349EMDS_PCI64_defconfig |  35 +
 configs/MPC8349EMDS_SDRAM_defconfig |  10 +
 configs/MPC8349EMDS_SLAVE_defconfig |  12 +-
 configs/MPC8349EMDS_defconfig   |  10 +
 configs/MPC8349ITXGP_defconfig  |  10 +
 configs/MPC8349ITX_LOWBOOT_defconfig|  10 +
 configs/MPC8349ITX_defconfig|   9 +
 configs/MPC837XEMDS_HOST_defconfig  |  10 +
 configs/MPC837XEMDS_SLAVE_defconfig |  35 +
 configs/MPC837XEMDS_defconfig   |  10 +
 configs/MPC837XERDB_SLAVE_defconfig |   7 +
 configs/MPC837XERDB_defconfig   |  10 +
 configs/TQM834x_defconfig   |   9 +
 configs/caddy2_defconfig|  10 +
 configs/hrcon_defconfig |   6 +
 configs/hrcon_dh_defconfig  |   6 +
 configs/ids8313_defconfig   |   3 +
 configs/kmcoge5ne_defconfig |   9 +
 configs/kmeter1_defconfig   |   9 +
 configs/kmopti2_defconfig   |   4 +
 configs/kmsupx5_defconfig   |   4 +
 configs/kmtegr1_defconfig   |   5 +
 configs/kmtepr2_defconfig   |   4 +
 configs/kmvect1_defconfig   |   5 +
 configs/mpc8308_p1m_defconfig   |   5 +
 configs/sbc8349_PCI_33_defconfig|  10 +
 configs/sbc8349_PCI_66_defconfig|  10 +
 configs/sbc8349_defconfig   |  10 +
 configs/strider_con_defconfig   |   5 +
 configs/strider_con_dp_defconfig|   5 +
 configs/strider_cpu_defconfig   |   5 +
 configs/strider_cpu_dp_defconfig|   5 +
 configs/suvd3_defconfig |   4 +
 configs/tuge1_defconfig |   4 +
 configs/tuxx1_defconfig |   4 +
 configs/ve8313_defconfig|   7 +
 configs/vme8349_defconfig   |  10 +
 include/configs/MPC8308RDB.h|  32 -
 include/configs/MPC8313ERDB_NAND.h  |  38 --
 include/configs/MPC8313ERDB_NOR.h   |  40 --
 include/configs/MPC8315ERDB.h   |  34 -
 include/configs/MPC8323ERDB.h   |  24 -
 include/configs/MPC832XEMDS.h   |  37 --
 include/configs/MPC8349EMDS.h   |  86 ---
 include/configs/MPC8349EMDS_SDRAM.h |  86 ---
 include/configs/MPC8349ITX.h|  39 --
 include/configs/MPC837XEMDS.h   |  42 --
 include/configs/MPC837XERDB.h   |  40 --
 include/configs/TQM834x.h   |  35 -
 include/configs/caddy2.h|  41 --
 include/configs/hrcon.h |  32 -
 include/configs/ids8313.h   |  21 -
 include/configs/kmcoge5ne.h |  19 -
 include/configs/kmeter1.h   |  19 -
 include/configs/kmopti2.h   |  22 -
 include/configs/kmsupx5.h   |  22 -
 include/configs/kmtegr1.h   |  22 -
 include/configs/kmtepr2.h   |  22 -
 include/configs/kmvect1.h   |  22 -
 include/configs/mpc8308_p1m.h   |  32 -
 include/configs/sbc8349.h   |  71 ---
 include/configs/strider.h   |  32 -
 include/configs/suvd3.h |  22 -
 include/configs/tuge1.h |  22 -
 include/configs/tuxx1.h |  22 -
 include/configs/ve8313.h|  19 -
 include/configs/vme8349.h   |  43 --
 87 files changed, 1330 insertions(+), 1039 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/hrcw/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/hrcw/hrcw.h
 create mode 100644 

[U-Boot] [PATCH v3 35/60] mpc83xx: Migrate LBLAW_* to Kconfig

2019-01-21 Thread Mario Six
The LBLAW_* values determine the window configuration of the memory
controller. Hence, they must be known at compile time, and cannot be
implemented in the DT mechanism.

Configuration of this crucial variable should still be somewhat
comfortable. Hence, make its fields configurable in Kconfig, and
assemble the final value from these.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 arch/powerpc/cpu/mpc83xx/Kconfig   |   1 +
 arch/powerpc/cpu/mpc83xx/cpu_init.c|   2 +
 arch/powerpc/cpu/mpc83xx/lblaw/Kconfig | 519 +
 arch/powerpc/cpu/mpc83xx/lblaw/lblaw.h |  55 +++
 arch/powerpc/cpu/mpc83xx/spl_minimal.c |   2 +
 configs/MPC8308RDB_defconfig   |  12 +
 configs/MPC8313ERDB_33_defconfig   |  16 +
 configs/MPC8313ERDB_66_defconfig   |  16 +
 configs/MPC8313ERDB_NAND_33_defconfig  |  17 +
 configs/MPC8313ERDB_NAND_66_defconfig  |  17 +
 configs/MPC8315ERDB_defconfig  |   8 +
 configs/MPC8323ERDB_defconfig  |   4 +
 configs/MPC832XEMDS_ATM_defconfig  |  12 +
 configs/MPC832XEMDS_HOST_33_defconfig  |  12 +
 configs/MPC832XEMDS_HOST_66_defconfig  |  12 +
 configs/MPC832XEMDS_SLAVE_defconfig|  12 +
 configs/MPC832XEMDS_defconfig  |  12 +
 configs/MPC8349EMDS_PCI64_defconfig|   8 +
 configs/MPC8349EMDS_SDRAM_defconfig|  12 +
 configs/MPC8349EMDS_SLAVE_defconfig|   8 +
 configs/MPC8349EMDS_defconfig  |   8 +
 configs/MPC8349ITXGP_defconfig |  12 +
 configs/MPC8349ITX_LOWBOOT_defconfig   |  12 +
 configs/MPC8349ITX_defconfig   |  12 +
 configs/MPC837XEMDS_HOST_defconfig |  12 +
 configs/MPC837XEMDS_SLAVE_defconfig|  12 +
 configs/MPC837XEMDS_defconfig  |  12 +
 configs/MPC837XERDB_SLAVE_defconfig|  12 +
 configs/MPC837XERDB_defconfig  |  12 +
 configs/TQM834x_defconfig  |  10 +
 configs/caddy2_defconfig   |   8 +
 configs/hrcon_defconfig|   8 +
 configs/hrcon_dh_defconfig |   8 +
 configs/ids8313_defconfig  |  17 +
 configs/kmcoge5ne_defconfig|  12 +
 configs/kmeter1_defconfig  |  12 +
 configs/kmopti2_defconfig  |  16 +
 configs/kmsupx5_defconfig  |  12 +
 configs/kmtegr1_defconfig  |  12 +
 configs/kmtepr2_defconfig  |  16 +
 configs/kmvect1_defconfig  |  16 +
 configs/mpc8308_p1m_defconfig  |  12 +
 configs/sbc8349_PCI_33_defconfig   |   4 +
 configs/sbc8349_PCI_66_defconfig   |   4 +
 configs/sbc8349_defconfig  |   4 +
 configs/strider_con_defconfig  |   8 +
 configs/strider_con_dp_defconfig   |   8 +
 configs/strider_cpu_defconfig  |   8 +
 configs/strider_cpu_dp_defconfig   |   8 +
 configs/suvd3_defconfig|  16 +
 configs/tuge1_defconfig|  12 +
 configs/tuxx1_defconfig|  16 +
 configs/ve8313_defconfig   |   9 +
 configs/vme8349_defconfig  |   8 +
 include/configs/MPC8308RDB.h   |  10 -
 include/configs/MPC8313ERDB_NAND.h |  18 -
 include/configs/MPC8313ERDB_NOR.h  |  18 -
 include/configs/MPC8315ERDB.h  |  10 -
 include/configs/MPC8323ERDB.h  |   3 -
 include/configs/MPC832XEMDS.h  |   8 -
 include/configs/MPC8349EMDS.h  |   6 -
 include/configs/MPC8349EMDS_SDRAM.h|   8 -
 include/configs/MPC8349ITX.h   |  10 -
 include/configs/MPC837XEMDS.h  |  10 -
 include/configs/MPC837XERDB.h  |  12 -
 include/configs/TQM834x.h  |  11 -
 include/configs/caddy2.h   |   4 -
 include/configs/hrcon.h|   6 -
 include/configs/ids8313.h  |  12 -
 include/configs/kmcoge5ne.h|  10 -
 include/configs/kmeter1.h  |  10 -
 include/configs/kmopti2.h  |  13 -
 include/configs/kmsupx5.h  |  11 -
 include/configs/kmtegr1.h  |   9 -
 include/configs/kmtepr2.h  |  13 -
 include/configs/kmvect1.h  |  13 -
 include/configs/mpc8308_p1m.h  |   9 -
 include/configs/sbc8349.h  |   7 -
 include/configs/strider.h  |   6 -
 include/configs/suvd3.h|  13 -
 include/configs/tuge1.h|  11 -
 include/configs/tuxx1.h|  16 -
 include/configs/ve8313.h   |   9 -
 include/configs/vme8349.h  |   4 -
 scripts/config_whitelist.txt   |  16 -
 85 files changed, 1125 insertions(+), 316 deletions(-)
 create mode 100644 arch/powerpc/cpu/mpc83xx/lblaw/Kconfig
 create mode 100644 arch/powerpc/cpu/mpc83xx/lblaw/lblaw.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index f7f625aea1f..8c84196b978 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -284,6 +284,7 @@ config ARCH_MPC837X
 
 source "arch/powerpc/cpu/mpc83xx/hrcw/Kconfig"
 source 

[U-Boot] [PATCH v3 36/60] mpc83xx: Normalize BR/OR option lines

2019-01-21 Thread Mario Six
All BR/OR option lines should have the same layout to make them easier
to migrate to Kconfig. This includes using the same option macros
everywhere.

The normalize the lines,
* replace function macros with their results, and
* replace hardcoded hex values with standard macros

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 include/configs/MPC8308RDB.h|  6 +++---
 include/configs/MPC8313ERDB_NAND.h  |  4 ++--
 include/configs/MPC8313ERDB_NOR.h   |  4 ++--
 include/configs/MPC8323ERDB.h   |  2 +-
 include/configs/MPC832XEMDS.h   |  6 +++---
 include/configs/MPC8349EMDS.h   |  2 +-
 include/configs/MPC8349EMDS_SDRAM.h |  2 +-
 include/configs/MPC8349ITX.h|  2 +-
 include/configs/MPC837XEMDS.h   |  2 +-
 include/configs/MPC837XERDB.h   |  2 +-
 include/configs/caddy2.h|  2 +-
 include/configs/hrcon.h |  4 ++--
 include/configs/ids8313.h   | 10 +-
 include/configs/kmcoge5ne.h | 12 ++--
 include/configs/kmeter1.h   |  8 
 include/configs/kmopti2.h   |  8 
 include/configs/kmsupx5.h   |  6 +++---
 include/configs/kmtegr1.h   |  6 +++---
 include/configs/kmtepr2.h   |  8 
 include/configs/kmvect1.h   |  8 
 include/configs/mpc8308_p1m.h   |  2 +-
 include/configs/sbc8349.h   |  4 ++--
 include/configs/strider.h   |  4 ++--
 include/configs/suvd3.h |  8 
 include/configs/tuge1.h |  6 +++---
 include/configs/tuxx1.h |  8 
 include/configs/vme8349.h   |  2 +-
 27 files changed, 69 insertions(+), 69 deletions(-)

diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h
index 1953d18e878..e19bcafd5ce 100644
--- a/include/configs/MPC8308RDB.h
+++ b/include/configs/MPC8308RDB.h
@@ -180,7 +180,7 @@
| BR_PS_16  /* 16 bit port */ \
| BR_MS_GPCM/* MSEL = GPCM */ \
| BR_V) /* valid */
-#define CONFIG_SYS_OR0_PRELIM  (MEG_TO_AM(CONFIG_SYS_FLASH_SIZE) \
+#define CONFIG_SYS_OR0_PRELIM  (OR_AM_8MB \
| OR_UPM_XAM \
| OR_GPCM_CSNT \
| OR_GPCM_ACS_DIV2 \
@@ -206,7 +206,7 @@
| BR_PS_8   /* 8 bit Port */ \
| BR_MS_FCM /* MSEL = FCM */ \
| BR_V) /* valid */
-#define CONFIG_SYS_OR1_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_NAND_WINDOW_SIZE) \
+#define CONFIG_SYS_OR1_PRELIM  (OR_AM_32KB \
| OR_FCM_CSCT \
| OR_FCM_CST \
| OR_FCM_CHT \
@@ -225,7 +225,7 @@
| BR_MS_GPCM/* MSEL = GPCM */ \
| BR_V) /* valid */
/* 0xF801 */
-#define CONFIG_SYS_OR2_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_VSC7385_SIZE) \
+#define CONFIG_SYS_OR2_PRELIM  (OR_AM_128KB \
| OR_GPCM_CSNT \
| OR_GPCM_XACS \
| OR_GPCM_SCY_15 \
diff --git a/include/configs/MPC8313ERDB_NAND.h 
b/include/configs/MPC8313ERDB_NAND.h
index 79c7f12baee..bbb9d4b936c 100644
--- a/include/configs/MPC8313ERDB_NAND.h
+++ b/include/configs/MPC8313ERDB_NAND.h
@@ -258,7 +258,7 @@
| BR_MS_GPCM/* MSEL = GPCM */ \
| BR_V) /* valid */
/* 0xFA000801 */
-#define CONFIG_SYS_OR3_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_BCSR_SIZE) \
+#define CONFIG_SYS_OR3_PRELIM  (OR_AM_32KB \
| OR_GPCM_CSNT \
| OR_GPCM_ACS_DIV2 \
| OR_GPCM_XACS \
@@ -279,7 +279,7 @@
| BR_PS_8   /* 8 bit port */ \
| BR_MS_GPCM/* MSEL = GPCM */ \
| BR_V) /* valid */
-#define CONFIG_SYS_OR2_PRELIM  (P2SZ_TO_AM(CONFIG_SYS_VSC7385_SIZE) \
+#define CONFIG_SYS_OR2_PRELIM  (OR_AM_128KB \
| OR_GPCM_CSNT \
| OR_GPCM_XACS \
| OR_GPCM_SCY_15 \
diff --git a/include/configs/MPC8313ERDB_NOR.h 
b/include/configs/MPC8313ERDB_NOR.h
index 1b2bba96d33..1cb001864a4 100644
--- a/include/configs/MPC8313ERDB_NOR.h
+++ b/include/configs/MPC8313ERDB_NOR.h
@@ -227,7 +227,7 @@
| BR_MS_GPCM/* MSEL = GPCM */ \

Re: [U-Boot] [linux-sunxi] [PATCH 2/9] sunxi: clk: A80: add MMC clock support

2019-01-21 Thread Chen-Yu Tsai
On Mon, Jan 21, 2019 at 5:39 PM Andre Przywara  wrote:
>
> On Mon, 21 Jan 2019 17:34:25 +0800
> Chen-Yu Tsai  wrote:
>
> > On Mon, Jan 21, 2019 at 5:32 PM Jagan Teki
> >  wrote:
> > >
> > > On Sat, Jan 19, 2019 at 7:02 AM Andre Przywara
> > >  wrote:
> > > >
> > > > The A80 handles resets and clock gates for the MMC devices
> > > > differently, outside of the CCU IP block. Consequently we have a
> > > > separate clock device with a separate binding for that.
> > > >
> > > > Implement that with the respective clock gates and resets to
> > > > allow the A80 taking part in the DM_MMC game.
> > > >
> > > > Signed-off-by: Andre Przywara 
> > > > ---
> > > >  drivers/clk/sunxi/clk_a80.c | 28 +++-
> > > >  1 file changed, 27 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/clk/sunxi/clk_a80.c
> > > > b/drivers/clk/sunxi/clk_a80.c index d6dd6a1fa1..2bfc2ca9f5 100644
> > > > --- a/drivers/clk/sunxi/clk_a80.c
> > > > +++ b/drivers/clk/sunxi/clk_a80.c
> > > > @@ -30,19 +30,45 @@ static const struct ccu_reset a80_resets[] = {
> > > > [RST_BUS_UART5] = RESET(0x5b4, BIT(21)),
> > > >  };
> > > >
> > > > +static const struct ccu_clk_gate a80_mmc_gates[] = {
> > > > +   [0] = GATE(0x0, BIT(16)),
> > > > +   [1] = GATE(0x4, BIT(16)),
> > > > +   [2] = GATE(0x8, BIT(16)),
> > > > +   [3] = GATE(0xc, BIT(16)),
> > > > +};
> > > > +
> > > > +static const struct ccu_reset a80_mmc_resets[] = {
> > > > +   [0] = GATE(0x0, BIT(18)),
> > > > +   [1] = GATE(0x4, BIT(18)),
> > > > +   [2] = GATE(0x8, BIT(18)),
> > > > +   [3] = GATE(0xc, BIT(18)),
> > > > +};
> > > > +
> > > >  static const struct ccu_desc a80_ccu_desc = {
> > > > .gates = a80_gates,
> > > > .resets = a80_resets,
> > > >  };
> > > >
> > > > +static const struct ccu_desc a80_mmc_clk_desc = {
> > > > +   .gates = a80_mmc_gates,
> > > > +   .resets = a80_mmc_resets,
> > > > +};
> > > > +
> > > >  static int a80_clk_bind(struct udevice *dev)
> > > >  {
> > > > -   return sunxi_reset_bind(dev, ARRAY_SIZE(a80_resets));
> > > > +   ulong count = ARRAY_SIZE(a80_resets);
> > > > +
> > > > +   if (device_is_compatible(dev,
> > > > "allwinner,allwinner,sun9i-a80-mmc"))
> > > > +   count = ARRAY_SIZE(a80_mmc_resets);
> > > > +
> > > > +   return sunxi_reset_bind(dev, count);
> > > >  }
> > > >
> > > >  static const struct udevice_id a80_ccu_ids[] = {
> > > > { .compatible = "allwinner,sun9i-a80-ccu",
> > > >   .data = (ulong)_ccu_desc },
> > > > +   { .compatible = "allwinner,allwinner,sun9i-a80-mmc",
> > >
> > > This can be "allwinner,sun9i-a80-mmc-config-clk"
> >
> > *Must*, not can. :)
>
> Indeed, thanks for spotting this, Jagan.
>
> Also I just figured that we need to enable the parent clocks and resets
> of this clock itself. I hope we can do this unconditionally, even for
> the complex CCU, as enabling fixed-clocks should be covered by the clock
> framework already.

You need to deassert the reset control for the MMC clock config block,
otherwise none of the toggles are going to work. And you can't assert
it afterwards, otherwise the bits revert to default. Also, you need to
enable the bus clock to be able to access the bits.

So yeah, you can do this unconditionally. The Linux driver simply tries
to be smarter and only enables the bus clock when toggling the bits.

Regards
ChenYu
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [linux-sunxi] [PATCH 2/9] sunxi: clk: A80: add MMC clock support

2019-01-21 Thread Chen-Yu Tsai
On Mon, Jan 21, 2019 at 6:12 PM Andre Przywara  wrote:
>
> On Mon, 21 Jan 2019 18:02:17 +0800
> Chen-Yu Tsai  wrote:
>
> > On Mon, Jan 21, 2019 at 5:39 PM Andre Przywara
> >  wrote:
> > >
> > > On Mon, 21 Jan 2019 17:34:25 +0800
> > > Chen-Yu Tsai  wrote:
> > >
> > > > On Mon, Jan 21, 2019 at 5:32 PM Jagan Teki
> > > >  wrote:
> > > > >
> > > > > On Sat, Jan 19, 2019 at 7:02 AM Andre Przywara
> > > > >  wrote:
> > > > > >
> > > > > > The A80 handles resets and clock gates for the MMC devices
> > > > > > differently, outside of the CCU IP block. Consequently we
> > > > > > have a separate clock device with a separate binding for that.
> > > > > >
> > > > > > Implement that with the respective clock gates and resets to
> > > > > > allow the A80 taking part in the DM_MMC game.
> > > > > >
> > > > > > Signed-off-by: Andre Przywara 
> > > > > > ---
> > > > > >  drivers/clk/sunxi/clk_a80.c | 28 +++-
> > > > > >  1 file changed, 27 insertions(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/drivers/clk/sunxi/clk_a80.c
> > > > > > b/drivers/clk/sunxi/clk_a80.c index d6dd6a1fa1..2bfc2ca9f5
> > > > > > 100644 --- a/drivers/clk/sunxi/clk_a80.c
> > > > > > +++ b/drivers/clk/sunxi/clk_a80.c
> > > > > > @@ -30,19 +30,45 @@ static const struct ccu_reset
> > > > > > a80_resets[] = { [RST_BUS_UART5] = RESET(0x5b4,
> > > > > > BIT(21)), };
> > > > > >
> > > > > > +static const struct ccu_clk_gate a80_mmc_gates[] = {
> > > > > > +   [0] = GATE(0x0, BIT(16)),
> > > > > > +   [1] = GATE(0x4, BIT(16)),
> > > > > > +   [2] = GATE(0x8, BIT(16)),
> > > > > > +   [3] = GATE(0xc, BIT(16)),
> > > > > > +};
> > > > > > +
> > > > > > +static const struct ccu_reset a80_mmc_resets[] = {
> > > > > > +   [0] = GATE(0x0, BIT(18)),
> > > > > > +   [1] = GATE(0x4, BIT(18)),
> > > > > > +   [2] = GATE(0x8, BIT(18)),
> > > > > > +   [3] = GATE(0xc, BIT(18)),
> > > > > > +};
> > > > > > +
> > > > > >  static const struct ccu_desc a80_ccu_desc = {
> > > > > > .gates = a80_gates,
> > > > > > .resets = a80_resets,
> > > > > >  };
> > > > > >
> > > > > > +static const struct ccu_desc a80_mmc_clk_desc = {
> > > > > > +   .gates = a80_mmc_gates,
> > > > > > +   .resets = a80_mmc_resets,
> > > > > > +};
> > > > > > +
> > > > > >  static int a80_clk_bind(struct udevice *dev)
> > > > > >  {
> > > > > > -   return sunxi_reset_bind(dev, ARRAY_SIZE(a80_resets));
> > > > > > +   ulong count = ARRAY_SIZE(a80_resets);
> > > > > > +
> > > > > > +   if (device_is_compatible(dev,
> > > > > > "allwinner,allwinner,sun9i-a80-mmc"))
> > > > > > +   count = ARRAY_SIZE(a80_mmc_resets);
> > > > > > +
> > > > > > +   return sunxi_reset_bind(dev, count);
> > > > > >  }
> > > > > >
> > > > > >  static const struct udevice_id a80_ccu_ids[] = {
> > > > > > { .compatible = "allwinner,sun9i-a80-ccu",
> > > > > >   .data = (ulong)_ccu_desc },
> > > > > > +   { .compatible = "allwinner,allwinner,sun9i-a80-mmc",
> > > > >
> > > > > This can be "allwinner,sun9i-a80-mmc-config-clk"
> > > >
> > > > *Must*, not can. :)
> > >
> > > Indeed, thanks for spotting this, Jagan.
> > >
> > > Also I just figured that we need to enable the parent clocks and
> > > resets of this clock itself. I hope we can do this unconditionally,
> > > even for the complex CCU, as enabling fixed-clocks should be
> > > covered by the clock framework already.
> >
> > You need to deassert the reset control for the MMC clock config block,
> > otherwise none of the toggles are going to work. And you can't assert
> > it afterwards, otherwise the bits revert to default. Also, you need to
> > enable the bus clock to be able to access the bits.
>
> Yeah, that was what I was thinking of.
>
> > So yeah, you can do this unconditionally. The Linux driver simply
> > tries to be smarter and only enables the bus clock when toggling the
> > bits.
>
> With "unconditionally" I meant doing this in the probe routine, which
> right now I *share* between the CCU clocks and this config clock. The
> patch is pretty small because of this.
>
> The CCU has only fixed parent clocks and no resets, so I think we can
> add parent clock and optional reset handling there and should cover
> this config clock as well, without providing a separate probe routine
> (and the rest of the boilerplate).

I think I'm missing some context here. You want to do this in the shared
*bind* function in this file? Or the shared *probe* function in
drivers/clk/sunxi/clk_sunxi.c ?

I assume it's the former? In which case you already have a conditional
to check the compatible string. So you could just expand that block and
put it there?

Either way I think it's not up to me about what's acceptable. :)

ChenYu
___
U-Boot 

Re: [U-Boot] [RFC 1/9] Arm: dts: imx7d-pico: Import Linux pico-pi dts

2019-01-21 Thread jorisoffouga


Le 21/01/2019 à 10:52, Bryan O'Donoghue a écrit :



On 20/01/2019 21:18, Joris Offouga wrote:
This patch imports the Linux kernel base board imx7d-pico.dtsi and 
specific

dts for imx7d-pico-pi


I recommend including the upstream Linux SHA in the commit log to make 
it easier to validate against and also if any changes/bugfixes go in 
upstream makes it easier to cherry-pick onto the local dts in u-boot.



Indeed, i add to v2.

I have a problem with pmic, can you watch the patch corresponding to the 
pmic ?


https://patchwork.ozlabs.org/patch/1028229/

Best regards,

Joris  Offouga


---
bod
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 15/60] mpc83xx: Make distinct caddy2 config

2019-01-21 Thread Mario Six
vme8349.h contains two separate boards: The vme8349 itself, and the
caddy2 board. The caddy2 board is chosen by setting certain config
variables. Create a proper config file for the caddy2 board to make
Kconfig migration easier.

Furthermore, simplify the vme8349 and caddy2 configs by keeping only the
options necessary for each board.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Combined config creation and simplification patches

---
 arch/powerpc/cpu/mpc83xx/Kconfig |   4 +
 board/esd/vme8349/Kconfig|  13 +
 board/esd/vme8349/vme8349.c  |   8 +-
 configs/caddy2_defconfig |   3 +-
 drivers/pci/pci_auto.c   |   3 +-
 drivers/pci/pci_auto_old.c   |   3 +-
 include/configs/caddy2.h | 512 +++
 include/configs/vme8349.h|  29 --
 8 files changed, 538 insertions(+), 37 deletions(-)
 create mode 100644 include/configs/caddy2.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index ede98c70da7..65f4583ffea 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -24,6 +24,10 @@ config TARGET_VME8349
bool "Support vme8349"
select ARCH_MPC8349
 
+config TARGET_CADDY2
+   bool "Support caddy2"
+   select ARCH_MPC8349
+
 config TARGET_MPC8308RDB
bool "Support MPC8308RDB"
select ARCH_MPC8308
diff --git a/board/esd/vme8349/Kconfig b/board/esd/vme8349/Kconfig
index b8d9432dcc9..ef2af40f7e8 100644
--- a/board/esd/vme8349/Kconfig
+++ b/board/esd/vme8349/Kconfig
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
default "vme8349"
 
 endif
+
+if TARGET_CADDY2
+
+config SYS_BOARD
+   default "vme8349"
+
+config SYS_VENDOR
+   default "esd"
+
+config SYS_CONFIG_NAME
+   default "caddy2"
+
+endif
diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c
index 45ad3a83ee8..a46d0b6da63 100644
--- a/board/esd/vme8349/vme8349.c
+++ b/board/esd/vme8349/vme8349.c
@@ -60,7 +60,7 @@ int dram_init(void)
 
 int checkboard(void)
 {
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
puts("Board: esd VME-CADDY/2\n");
 #else
puts("Board: esd VME-CPU/8349\n");
@@ -69,7 +69,7 @@ int checkboard(void)
return 0;
 }
 
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 int board_eth_init(bd_t *bis)
 {
return pci_eth_init(bis);
@@ -102,7 +102,7 @@ int misc_init_r()
  * Provide SPD values for spd_sdram(). Both boards (VME-CADDY/2
  * and VME-CADDY/2) have different SDRAM configurations.
  */
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
 #define SMALL_RAM  0xff
 #define LARGE_RAM  0x00
 #else
@@ -165,7 +165,7 @@ static spd_eeprom_t default_spd_eeprom = {
SPD_VAL(0x7e, 0x1d),/* 63 */
{ 'e', 's', 'd', '-', 'g', 'm', 'b', 'h' },
SPD_VAL(0x00, 0x00),/* 72 */
-#ifdef VME_CADDY2
+#ifdef CONFIG_TARGET_CADDY2
{ "vme-caddy/2 ram   " }
 #else
{ "vme-cpu/2 ram " }
diff --git a/configs/caddy2_defconfig b/configs/caddy2_defconfig
index 5fec4f8d499..fe0c34fc61a 100644
--- a/configs/caddy2_defconfig
+++ b/configs/caddy2_defconfig
@@ -1,10 +1,9 @@
 CONFIG_PPC=y
 CONFIG_SYS_TEXT_BASE=0xFFF0
 CONFIG_MPC83xx=y
-CONFIG_TARGET_VME8349=y
+CONFIG_TARGET_CADDY2=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="CADDY2"
 CONFIG_BOOTDELAY=6
 CONFIG_MISC_INIT_R=y
 CONFIG_HUSH_PARSER=y
diff --git a/drivers/pci/pci_auto.c b/drivers/pci/pci_auto.c
index f5e46842bf6..1a3bf708347 100644
--- a/drivers/pci/pci_auto.c
+++ b/drivers/pci/pci_auto.c
@@ -359,7 +359,8 @@ int dm_pciauto_config_device(struct udevice *dev)
  PCI_DEV(dm_pci_get_bdf(dev)));
break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) && \
+   !defined(CONFIG_TARGET_CADDY2)
case PCI_CLASS_BRIDGE_OTHER:
/*
 * The host/PCI bridge 1 seems broken in 8349 - it presents
diff --git a/drivers/pci/pci_auto_old.c b/drivers/pci/pci_auto_old.c
index 6ab1b3b43fc..b566705c9d9 100644
--- a/drivers/pci/pci_auto_old.c
+++ b/drivers/pci/pci_auto_old.c
@@ -376,7 +376,8 @@ int pciauto_config_device(struct pci_controller *hose, 
pci_dev_t dev)
  PCI_DEV(dev));
break;
 #endif
-#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349)
+#if defined(CONFIG_ARCH_MPC834X) && !defined(CONFIG_TARGET_VME8349) && \
+   !defined(CONFIG_TARGET_CADDY2)
case PCI_CLASS_BRIDGE_OTHER:
/*
 * The host/PCI bridge 1 seems broken in 8349 - it presents
diff --git a/include/configs/caddy2.h b/include/configs/caddy2.h
new file mode 100644
index 000..a7dd0b3
--- /dev/null
+++ b/include/configs/caddy2.h
@@ -0,0 +1,512 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * esd vme8349 U-Boot configuration file
+ * Copyright (c) 

[U-Boot] [PATCH v3 17/60] mpc83xx: Make distinct MPC8349EMDS_SDRAM board

2019-01-21 Thread Mario Six
The MPC8349EMDS config file contains config options to enable SDRAM
support. To keep this ability after the Kconfig migration, create a new
MPC8349EMDS_SDRAM board that enables the SDRAM support and remove the
SDRAM support from the original board.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Combined config creation and simplification patches

---
 arch/powerpc/cpu/mpc83xx/Kconfig|   8 +
 board/freescale/mpc8349emds/Kconfig |  13 +
 configs/MPC8349EMDS_SDRAM_defconfig |  27 +
 include/configs/MPC8349EMDS.h   |  76 ---
 include/configs/MPC8349EMDS_SDRAM.h | 731 
 5 files changed, 779 insertions(+), 76 deletions(-)
 create mode 100644 configs/MPC8349EMDS_SDRAM_defconfig
 create mode 100644 include/configs/MPC8349EMDS_SDRAM.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index 65f4583ffea..0ce1aad6d03 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -67,6 +67,14 @@ config TARGET_MPC8349EMDS
select SYS_FSL_DDR_BE
select SYS_FSL_HAS_DDR2
 
+config TARGET_MPC8349EMDS_SDRAM
+   bool "Support MPC8349EMDS_SDRAM"
+   select ARCH_MPC8349
+   select BOARD_EARLY_INIT_F
+   select SYS_FSL_DDR
+   select SYS_FSL_DDR_BE
+   select SYS_FSL_HAS_DDR2
+
 config TARGET_MPC8349ITX
bool "Support MPC8349ITX"
select ARCH_MPC8349
diff --git a/board/freescale/mpc8349emds/Kconfig 
b/board/freescale/mpc8349emds/Kconfig
index 51f0b34f398..d1541180799 100644
--- a/board/freescale/mpc8349emds/Kconfig
+++ b/board/freescale/mpc8349emds/Kconfig
@@ -10,3 +10,16 @@ config SYS_CONFIG_NAME
default "MPC8349EMDS"
 
 endif
+
+if TARGET_MPC8349EMDS_SDRAM
+
+config SYS_BOARD
+   default "mpc8349emds"
+
+config SYS_VENDOR
+   default "freescale"
+
+config SYS_CONFIG_NAME
+   default "MPC8349EMDS_SDRAM"
+
+endif
diff --git a/configs/MPC8349EMDS_SDRAM_defconfig 
b/configs/MPC8349EMDS_SDRAM_defconfig
new file mode 100644
index 000..2607dfa4f33
--- /dev/null
+++ b/configs/MPC8349EMDS_SDRAM_defconfig
@@ -0,0 +1,27 @@
+CONFIG_PPC=y
+CONFIG_SYS_TEXT_BASE=0xFE00
+CONFIG_MPC83xx=y
+CONFIG_TARGET_MPC8349EMDS_SDRAM=y
+CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_BOOTDELAY=6
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_IMLS=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_DATE=y
+# CONFIG_MMC is not set
+CONFIG_MTD_NOR_FLASH=y
+CONFIG_FLASH_CFI_DRIVER=y
+CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
+CONFIG_SYS_FLASH_CFI=y
+CONFIG_PHY_MARVELL=y
+CONFIG_NETDEVICES=y
+CONFIG_TSEC_ENET=y
+# CONFIG_PCI is not set
+CONFIG_SYS_NS16550=y
+CONFIG_SPI=y
+CONFIG_MPC8XXX_SPI=y
+CONFIG_OF_LIBFDT=y
diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h
index 93de2cc1c07..fe2b81b905b 100644
--- a/include/configs/MPC8349EMDS.h
+++ b/include/configs/MPC8349EMDS.h
@@ -218,82 +218,6 @@
 #define CONFIG_SYS_LCRR_CLKDIV LCRR_CLKDIV_4
 #define CONFIG_SYS_LBC_LBCR0x
 
-/*
- * The MPC834xEA MDS for 834xE rev3.1 may not be assembled SDRAM memory.
- * if board has SRDAM on local bus, you can define CONFIG_SYS_LB_SDRAM
- */
-#undef CONFIG_SYS_LB_SDRAM
-
-#ifdef CONFIG_SYS_LB_SDRAM
-/* Local bus BR2, OR2 definition for SDRAM if soldered on the MDS board */
-/*
- * Base Register 2 and Option Register 2 configure SDRAM.
- * The SDRAM base address, CONFIG_SYS_LBC_SDRAM_BASE, is 0xf000.
- *
- * For BR2, need:
- *Base address of 0xf000 = BR[0:16] =     0
- *port-size = 32-bits = BR2[19:20] = 11
- *no parity checking = BR2[21:22] = 00
- *SDRAM for MSEL = BR2[24:26] = 011
- *Valid = BR[31] = 1
- *
- * 04812   16   20   24   28
- *     0001 1000 0110 0001 = F0001861
- */
-
-#define CONFIG_SYS_BR2_PRELIM  (CONFIG_SYS_LBC_SDRAM_BASE \
-   | BR_PS_32  /* 32-bit port */ \
-   | BR_MS_SDRAM   /* MSEL = SDRAM */ \
-   | BR_V) /* Valid */
-   /* 0xF0001861 */
-#define CONFIG_SYS_LBLAWBAR2_PRELIMCONFIG_SYS_LBC_SDRAM_BASE
-#define CONFIG_SYS_LBLAWAR2_PRELIM (LBLAWAR_EN | LBLAWAR_64MB)
-
-/*
- * The SDRAM size in MB, CONFIG_SYS_LBC_SDRAM_SIZE, is 64.
- *
- * For OR2, need:
- *64MB mask for AM, OR2[0:7] =  1100
- * XAM, OR2[17:18] = 11
- *9 columns OR2[19-21] = 010
- *13 rows   OR2[23-25] = 100
- *EAD set for extra time OR[31] = 1
- *
- * 04812   16   20   24   28
- *  1100   0110 1001  0001 = FC006901
- */
-
-#define CONFIG_SYS_OR2_PRELIM  (OR_AM_64MB \
-   | OR_SDRAM_XAM \
-   | ((9 - OR_SDRAM_MIN_COLS) << OR_SDRAM_COLS_SHIFT) \
-   | ((13 - OR_SDRAM_MIN_ROWS) << OR_SDRAM_ROWS_SHIFT) \
-   | OR_SDRAM_EAD)
-  

[U-Boot] [PATCH v3 16/60] powerpc: Add LSDMR config values

2019-01-21 Thread Mario Six
The LSDMR_* macros are used to configure the system bus on MPC83xx.

A few of the possible LSDMR_* macros were never defined in the
respective include files. This renders the SDRAM support on the
MPC8349EMDS unusable, because it uses these undefined macros.

To make the SDRAM option work, introduce these macros into the proper
config file.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
No changes

---
 arch/powerpc/include/asm/fsl_lbc.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/include/asm/fsl_lbc.h 
b/arch/powerpc/include/asm/fsl_lbc.h
index 3528acd627d..bf352d9a561 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -428,14 +428,17 @@ void lbc_sdram_init(void);
 #define LSDMR_BSMA1516 (3 << (31 - 10))
 #define LSDMR_BSMA1617 (4 << (31 - 10))
 #define LSDMR_RFCR5(3 << (31 - 16))
+#define LSDMR_RFCR8 (5 << (31 - 16))
 #define LSDMR_RFCR16   (7 << (31 - 16))
 #define LSDMR_PRETOACT3 (3 << (31 - 19))
+#define LSDMR_PRETOACT6 (5 << (31 - 19))
 #define LSDMR_PRETOACT7(7 << (31 - 19))
 #define LSDMR_ACTTORW3 (3 << (31 - 22))
 #define LSDMR_ACTTORW7 (7 << (31 - 22))
 #define LSDMR_ACTTORW6 (6 << (31 - 22))
 #define LSDMR_BL8  (1 << (31 - 23))
 #define LSDMR_WRC2 (2 << (31 - 27))
+#define LSDMR_WRC3  (3 << (31 - 27))
 #define LSDMR_WRC4 (0 << (31 - 27))
 #define LSDMR_BUFCMD   (1 << (31 - 29))
 #define LSDMR_CL3  (3 << (31 - 31))
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 21/60] MPC8349ITX: Migrate to CONFIG_TARGET_MPC8349ITX

2019-01-21 Thread Mario Six
Use the proper CONFIG_TARGET_MPC8349ITX Kconfig option to replace the
CONFIG_MPC8349ITX ad-hoc config option.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 board/freescale/mpc8349itx/mpc8349itx.c | 2 +-
 configs/MPC8349ITX_LOWBOOT_defconfig| 1 -
 configs/MPC8349ITX_defconfig| 1 -
 include/configs/MPC8349ITX.h| 4 ++--
 scripts/config_whitelist.txt| 1 -
 5 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/board/freescale/mpc8349itx/mpc8349itx.c 
b/board/freescale/mpc8349itx/mpc8349itx.c
index 3bdec1c4005..d90553384f6 100644
--- a/board/freescale/mpc8349itx/mpc8349itx.c
+++ b/board/freescale/mpc8349itx/mpc8349itx.c
@@ -152,7 +152,7 @@ int dram_init(void)
 
 int checkboard(void)
 {
-#ifdef CONFIG_MPC8349ITX
+#ifdef CONFIG_TARGET_MPC8349ITX
puts("Board: Freescale MPC8349E-mITX\n");
 #else
puts("Board: Freescale MPC8349E-mITX-GP\n");
diff --git a/configs/MPC8349ITX_LOWBOOT_defconfig 
b/configs/MPC8349ITX_LOWBOOT_defconfig
index 51667235487..5e3ad6e 100644
--- a/configs/MPC8349ITX_LOWBOOT_defconfig
+++ b/configs/MPC8349ITX_LOWBOOT_defconfig
@@ -4,7 +4,6 @@ CONFIG_MPC83xx=y
 CONFIG_TARGET_MPC8349ITX=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="MPC8349ITX"
 CONFIG_BOOTDELAY=6
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs 
ip=mpc8349emitx:eth0:off console=ttyS0,115200"
diff --git a/configs/MPC8349ITX_defconfig b/configs/MPC8349ITX_defconfig
index 55e593c1150..7f9b9cb283d 100644
--- a/configs/MPC8349ITX_defconfig
+++ b/configs/MPC8349ITX_defconfig
@@ -4,7 +4,6 @@ CONFIG_MPC83xx=y
 CONFIG_TARGET_MPC8349ITX=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
-CONFIG_SYS_EXTRA_OPTIONS="MPC8349ITX"
 CONFIG_BOOTDELAY=6
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs 
ip=mpc8349emitx:eth0:off console=ttyS0,115200"
diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h
index 496780d80c0..5877279adaf 100644
--- a/include/configs/MPC8349ITX.h
+++ b/include/configs/MPC8349ITX.h
@@ -54,7 +54,7 @@
  * On-board devices
  */
 
-#ifdef CONFIG_MPC8349ITX
+#ifdef CONFIG_TARGET_MPC8349ITX
 /* The CF card interface on the back of the board */
 #define CONFIG_COMPACT_FLASH
 #define CONFIG_VSC7385_ENET/* VSC7385 ethernet support */
@@ -642,7 +642,7 @@ boards, we say we have two, but don't display a message if 
we find only one. */
/* U-Boot image on TFTP server */
 #define CONFIG_UBOOTPATH   "u-boot.bin"
 
-#ifdef CONFIG_MPC8349ITX
+#ifdef CONFIG_TARGET_MPC8349ITX
 #define CONFIG_FDTFILE "mpc8349emitx.dtb"
 #else
 #define CONFIG_FDTFILE "mpc8349emitxgp.dtb"
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index cae3f97c5ce..575673f6cd3 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1250,7 +1250,6 @@ CONFIG_MMU
 CONFIG_MONITOR_IS_IN_RAM
 CONFIG_MPC8313ERDB
 CONFIG_MPC8315ERDB
-CONFIG_MPC8349ITX
 CONFIG_MPC837XEMDS
 CONFIG_MPC837XERDB
 CONFIG_MPC83XX_GPIO
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 22/60] hrcon: Migrate to CONFIG_TARGET_HRCON

2019-01-21 Thread Mario Six
Use the proper CONFIG_TARGET_HRCON Kconfig option to replace
the CONFIG_HRCON ad-hoc config option.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Combined config creation and simplification patches
* Removed config option from whitelist

---
 board/gdsys/common/Makefile  | 2 +-
 board/gdsys/mpc8308/Makefile | 2 +-
 include/configs/hrcon.h  | 1 -
 include/gdsys_fpga.h | 2 +-
 scripts/config_whitelist.txt | 1 -
 5 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile
index af9058a5d77..67d2b310b30 100644
--- a/board/gdsys/common/Makefile
+++ b/board/gdsys/common/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_IO64) += miiphybb.o
 obj-$(CONFIG_IOCON) += osd.o mclink.o dp501.o phy.o ch7301.o
 obj-$(CONFIG_DLVISION_10G) += osd.o dp501.o
 obj-$(CONFIG_CONTROLCENTERD) += dp501.o
-obj-$(CONFIG_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o fanctrl.o
+obj-$(CONFIG_TARGET_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o 
fanctrl.o
 obj-$(CONFIG_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o ch7301.o
 obj-$(CONFIG_STRIDER) += fanctrl.o
 obj-$(CONFIG_STRIDER_CON) += osd.o
diff --git a/board/gdsys/mpc8308/Makefile b/board/gdsys/mpc8308/Makefile
index 60d22325738..f29376fc9ed 100644
--- a/board/gdsys/mpc8308/Makefile
+++ b/board/gdsys/mpc8308/Makefile
@@ -4,5 +4,5 @@
 # Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
 
 obj-y := mpc8308.o sdram.o
-obj-$(CONFIG_HRCON) += hrcon.o
+obj-$(CONFIG_TARGET_HRCON) += hrcon.o
 obj-$(CONFIG_STRIDER) += strider.o
diff --git a/include/configs/hrcon.h b/include/configs/hrcon.h
index 23ed4e54c72..cd5e883b7a1 100644
--- a/include/configs/hrcon.h
+++ b/include/configs/hrcon.h
@@ -13,7 +13,6 @@
  */
 #define CONFIG_E3001 /* E300 family */
 #define CONFIG_MPC83xx 1 /* MPC83xx family */
-#define CONFIG_HRCON   1 /* HRCON board specific */
 
 #define CONFIG_SYS_FSL_ESDHC_ADDR  CONFIG_SYS_MPC83xx_ESDHC_ADDR
 
diff --git a/include/gdsys_fpga.h b/include/gdsys_fpga.h
index db4424d3f8a..e9fb4b88b5e 100644
--- a/include/gdsys_fpga.h
+++ b/include/gdsys_fpga.h
@@ -161,7 +161,7 @@ struct ihs_fpga {
 };
 #endif
 
-#if defined(CONFIG_HRCON) || defined(CONFIG_STRIDER_CON_DP)
+#if defined(CONFIG_TARGET_HRCON) || defined(CONFIG_STRIDER_CON_DP)
 struct ihs_fpga {
u16 reflection_low; /* 0x */
u16 versions;   /* 0x0002 */
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 575673f6cd3..9de1666d7f9 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -908,7 +908,6 @@ CONFIG_HPS_SDR_CTRLCFG_RFIFOCMAP_RFIFOCMAP
 CONFIG_HPS_SDR_CTRLCFG_STATICCFG_MEMBL
 CONFIG_HPS_SDR_CTRLCFG_STATICCFG_USEECCASDATA
 CONFIG_HPS_SDR_CTRLCFG_WFIFOCMAP_WFIFOCMAP
-CONFIG_HRCON
 CONFIG_HRCON_DH
 CONFIG_HRCON_FANS
 CONFIG_HSMMC2_8BIT
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 27/60] MPC837XERDB: Remove CONFIG_MPC837XERDB

2019-01-21 Thread Mario Six
CONFIG_MPC837XERDB is unused, and TARGET_MPC837XERDB could replace it.

Hence, get rid of CONFIG_MPC837XERDB.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
* Removed config option from whitelist

---
 include/configs/MPC837XERDB.h | 1 -
 scripts/config_whitelist.txt  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h
index 6029d0f21bf..a8f5b013b28 100644
--- a/include/configs/MPC837XERDB.h
+++ b/include/configs/MPC837XERDB.h
@@ -12,7 +12,6 @@
  * High Level Configuration Options
  */
 #define CONFIG_E3001 /* E300 family */
-#define CONFIG_MPC837XERDB 1
 
 #define CONFIG_HWCONFIG
 
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index fcfa82817a1..3483c2598ea 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -1247,7 +1247,6 @@ CONFIG_MMC_SPI_SPEED
 CONFIG_MMC_SUNXI_SLOT
 CONFIG_MMU
 CONFIG_MONITOR_IS_IN_RAM
-CONFIG_MPC837XERDB
 CONFIG_MPC83XX_GPIO
 CONFIG_MPC83XX_GPIO_0_INIT_DIRECTION
 CONFIG_MPC83XX_GPIO_0_INIT_OPEN_DRAIN
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 42/60] powerpc: mpc83xx: Implement get_serial_clock()

2019-01-21 Thread Mario Six
DM serial drivers on PowerPC determine their clock frequency via the
get_serial_clock function. This function is not Implemented yet for
MPC83xx.

This patch Implements the function so that DM serial drivers work on
MPC83xx.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/cpu/mpc83xx/speed.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/powerpc/cpu/mpc83xx/speed.c b/arch/powerpc/cpu/mpc83xx/speed.c
index e870a23103b..e118a10fa8b 100644
--- a/arch/powerpc/cpu/mpc83xx/speed.c
+++ b/arch/powerpc/cpu/mpc83xx/speed.c
@@ -516,6 +516,11 @@ ulong get_ddr_freq(ulong dummy)
return gd->mem_clk;
 }
 
+int get_serial_clock(void)
+{
+   return get_bus_freq(0);
+}
+
 static int do_clocks(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
char buf[32];
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 45/60] mpc83xx: Prepare usage of DM gpio driver

2019-01-21 Thread Mario Six
The MPC85xx GPIO driver was converted to handle a broader range of SoCs.

Prepare the MPC83xx code for usage of this driver.

Signed-off-by: Mario Six 

---

v2 -> v3:
No changes

v1 -> v2:
New in v2

---
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h 
b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
index b5ec50ba44c..385d651d200 100644
--- a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
+++ b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
@@ -17,7 +17,15 @@
 
 #define MAX_NUM_GPIOS (32 * MPC83XX_GPIO_CTRLRS)
 
+struct mpc8xxx_gpio_plat {
+   ulong addr;
+   unsigned long size;
+   uint ngpios;
+};
+
+#ifndef DM_GPIO
 void mpc83xx_gpio_init_f(void);
 void mpc83xx_gpio_init_r(void);
+#endif /* DM_GPIO */
 
 #endif /* MPC83XX_GPIO_H_ */
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v2] ARM: mvebu: sync Armada-38x dts with Linux 4.20

2019-01-21 Thread Stefan Roese

On 10.12.18 08:07, Chris Packham wrote:

Sync the Armada-38x device tree files with Linux 4.20-rc5. The changes
not taken are new compatible strings for the uart and nand flash
controller. The nand binding is best updated if/when the mtd/nand
infrastructure is updated.

Signed-off-by: Chris Packham 
Reviewed-by: Stefan Roese 
---
I've updated the clearfog and controlcenterdc boards enough for them to
compile. In the case of clearfog there are a lot of changes in Linux so
it's probably best if the board maintainer looks at what is needed.
controlcenterdc isn't in linux so again I've just done enough for
compilation.

Changes in v2:
- Correct comment for SPI CS1 for clearfog (thanks Baruch)

  arch/arm/dts/armada-380.dtsi|  44 +--
  arch/arm/dts/armada-385.dtsi|  63 +
  arch/arm/dts/armada-388-clearfog.dts|  25 +-
  arch/arm/dts/armada-388.dtsi|  43 +--
  arch/arm/dts/armada-38x-controlcenterdc.dts |  68 ++---
  arch/arm/dts/armada-38x.dtsi| 283 
  6 files changed, 237 insertions(+), 289 deletions(-)


Applied to u-boot-marvell/master

Thanks,
Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


  1   2   3   >