Re: dm, serial: problem with using ns16550 driver before relocation on mpc83xx

2020-02-09 Thread Mario Six
Hi Heiko,

On Fri, Feb 7, 2020 at 6:53 AM Heiko Schocher  wrote:
>
> Hi Simon,
>
> removed Dirk from cc and added Mario Six
>
> @Mario: Dirk is maintainer of the gazerbeam board:
>
> https://gitlab.denx.de/u-boot/u-boot/blob/master/board/gdsys/mpc8308/MAINTAINERS#L2
>
> but EMail get not delivered to his EMail address ... so I added
> you to cc ... may you have a gazerbeam board? May you can try,
> if current U-Boot mainline works (in special serial console) on it?
>
Dirk no longer works as gdsys (which is also the reason why I'm much less
active on the mailing list than I used to be).

I have a gazerbeam board. I'll try to get some time to test mainline on it some
time this week.

> thanks!
>
Regards,
Mario

> Am 06.02.2020 um 18:46 schrieb Simon Glass:
> > Hi Heiko,
> >
> > On Wed, 5 Feb 2020 at 22:19, Heiko Schocher  wrote:
> >>
> >> Hello Simon,
> >>
> >> Am 05.02.2020 um 18:59 schrieb Simon Glass:
> >>> Hi Heiko,
> >>>
> >>> On Wed, 5 Feb 2020 at 02:04, Heiko Schocher  wrote:
> >>>>
> >>>> Hello Bin, Simon,
> >>>>
> >>>> I just porting the mpc83xx based kmcoge5ne board support DTS and got
> >>>> problems using the serial ns16550 driver.
> >>>>
> >>>> I need the serial driver before rolcation, so I enabled
> >>>> "u-boot,dm-pre-reloc;" as usual in the device tree, but board does not
> >>>> boot ...
> >>>>
> >>>> I found the commit:
> >>>>
> >>>> commit 4687919684e0e4390b9fc20d1809ecaa9dc3cb81
> >>>> Author: Bin Meng 
> >>>> Date:   Wed Oct 24 06:36:36 2018 -0700
> >>>>
> >>>>serial: Remove DM_FLAG_PRE_RELOC flag in various drivers
> >>>>
> >>>> which added to the ns16550 serial driver:
> >>>>
> >>>> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> >>>> index 04b604fa2c..1e6fc6c668 100644
> >>>> --- a/drivers/serial/ns16550.c
> >>>> +++ b/drivers/serial/ns16550.c
> >>>> @@ -487,7 +487,9 @@ U_BOOT_DRIVER(ns16550_serial) = {
> >>>>.priv_auto_alloc_size = sizeof(struct NS16550),
> >>>>.probe = ns16550_serial_probe,
> >>>>.ops= _serial_ops,
> >>>> +#if !CONFIG_IS_ENABLED(OF_CONTROL)
> >>>>.flags  = DM_FLAG_PRE_RELOC,
> >>>> +#endif
> >>>> };
> >>>> #endif
> >>>> #endif /* SERIAL_PRESENT */
> >>>>
> >>>> So, as OF_CONTROL is defined for me, the flag "u-boot,dm-pre-reloc" seems
> >>>> not working anymore ...
> >>>>
> >>>> Adding this back:
> >>>>
> >>>> hs@xmglap:u-boot-secu  [20200205-temp] $ git diff
> >>>> diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
> >>>> index 9851663dc5..386ca9cffa 100644
> >>>> --- a/drivers/serial/ns16550.c
> >>>> +++ b/drivers/serial/ns16550.c
> >>>> @@ -528,7 +528,7 @@ U_BOOT_DRIVER(ns16550_serial) = {
> >>>>.priv_auto_alloc_size = sizeof(struct NS16550),
> >>>>.probe = ns16550_serial_probe,
> >>>>.ops= _serial_ops,
> >>>> -#if !CONFIG_IS_ENABLED(OF_CONTROL)
> >>>> +#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
> >>>>.flags  = DM_FLAG_PRE_RELOC,
> >>>> #endif
> >>>> };
> >>>>
> >>>> and board boots fine with the flag "u-boot,dm-pre-reloc" in DTS ...
> >>>>
> >>>> May I do something wrong here? I found in mainline for example
> >>>> the "arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi" board, which
> >>>> has the exactly same dts settings than I have now.
> >>>>
> >>>> @Dirk: Can you check, if this board boots with current mainline?
> >>>>
> >>>> Shouldn;t be the logic, that in case OF_CONTROL is enabled and if
> >>>> flag "u-boot,dm-pre-reloc" is set in DTS for the device, the device
> >>>> should be bound before relocation, and we do not need to check, if
> >>>> the driver sets DM_FLAG_PRE_RELOC ?
> >>>>
> >>>> But may I miss here something ...
> >>>>
> >>>> Any hints?
> >>>
> >>> +Tom Rini
> >>>
> >>> I found I needed this for rpi.
> >>>
> >>> http://patchwork.ozlabs.org/patch/1202913/
> >>>
> >>> But I still haven't gone back to figure out why Tom doesn't.
> >>
> >> Hmm... I have added the "u-boot,dm-pre-reloc;" to the uart node.
> >>
> >> Like it is for the gazerbeam board, see [1]
> >>
> >> It works if "DM_FLAG_PRE_RELOC" is set the driver in flags... no
> >> need for a gpio node before relocation like it is inabove patch.
> >>
> >> I wonder if we need DM_FLAG_PRE_RELOC at all in a driver and
> >> OF_CONTROL case. Shouldn't it be enough if the DTB node for the
> >> driver contains the "u-boot,dm-pre-reloc;" property?
> >
> > Well in the rpi case it is the pinctrl that needs that property. I
> > think you should dig into exactly what is going wrong on the board you
> > have. Then it should be possible to see what is missing and add it.
>
> Ok, I try to find out more, thanks!
>
> 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


[PULL] u-boot-mpc83xx/next

2020-01-08 Thread Mario Six
Hi Tom,

A small PR with MC8309 fixes from Rasmus.

CI: https://travis-ci.com/si-gdsys/u-boot-mpc83xx/builds/143550229

The following changes since commit d8a3f5259a36e76d1de127f65714c40918e8ee4c:

  Merge tag 'u-boot-imx-20200107' of
https://gitlab.denx.de/u-boot/custodians/u-boot-imx (2020-01-07
08:45:43 -0500)

are available in the Git repository at:

  g...@gitlab.denx.de:u-boot/custodians/u-boot-mpc83xx.git next

for you to fetch changes up to fddf876a8f56ff53d1354387ebf7fd3997189349:

  mpc83xx_clk: always treat MPC83XX_CLK_PCI as invalid (2020-01-08
08:14:36 +0100)


Rasmus Villemoes (5):
  mpc83xx: make ARCH_MPC8309 select SYS_FSL_ERRATUM_ESDHC111
  powerpc: mpc83xx: convert CONFIG_FSL_ELBC to Kconfig
  mpc83xx: immap_83xx: add spi8xxx_t in immap for mpc8309
  mpc83xx: set MPC83XX_GPIO_CTRLRS to 2 for MPC8309
  mpc83xx_clk: always treat MPC83XX_CLK_PCI as invalid

 arch/powerpc/cpu/mpc83xx/Kconfig | 8 
 arch/powerpc/include/asm/arch-mpc83xx/gpio.h | 3 ++-
 arch/powerpc/include/asm/immap_83xx.h| 3 +--
 arch/powerpc/include/asm/mpc8xxx_spi.h   | 1 +
 drivers/clk/mpc83xx_clk.c| 5 -
 include/configs/MPC8313ERDB_NAND.h   | 1 -
 include/configs/MPC8313ERDB_NOR.h| 1 -
 include/configs/MPC8315ERDB.h| 2 --
 include/configs/MPC837XEMDS.h| 2 --
 include/configs/MPC837XERDB.h| 2 --
 include/configs/ids8313.h| 2 --
 include/configs/ve8313.h | 1 -
 12 files changed, 16 insertions(+), 15 deletions(-)

Best regards,
Mario


Re: [PATCH] mpc83xx_clk: always treat MPC83XX_CLK_PCI as invalid

2020-01-07 Thread Mario Six
On Thu, Dec 19, 2019 at 10:46 AM Rasmus Villemoes
 wrote:
>
> The current mpc83xx_clk driver is broken for any board for which
> mpc83xx_has_pci() is true, i.e. anything not MPC8308:
>
> When is_clk_valid() reports that MPC83XX_CLK_PCI is valid,
> init_all_clks() proceeds to call init_single_clk(), but that doesn't
> know about either MPC83XX_CLK_PCI or has any handling of the
> TYPE_SCCR_ONOFF mode correctly returned by retrieve_mode(). Hence
> init_single_clk() ends up returning -EINVAL, and the whole board hangs
> in serial_init().
>
> The quickest fix is to simply pretend that clock is invalid for
> all, since nobody can have been relying on it. Adding proper support
> seems to be a bit more involved than just handling TYPE_SCCR_ONOFF:
>
> - The power-on-reset value of SCCR[PCICM] is 0, so
>   mpc83xx_clk_enable() would probably need to be tought to enable the
>   clock.
>
> - The frequency of PCI_SYNC_OUT is either SYS_CLK_IN or SYS_CLK_IN/2
>   depending on the CFG_CLKIN_DIV configuration input, but that can't
>   be read from software, so to properly fill out
>   ->speed[MPC83XX_CLK_PCI] I think one would need guidance from
>   Kconfig or dtb.
>
> Partially fixes: 07d538d281 clk: Add MPC83xx clock driver
>
> Signed-off-by: Rasmus Villemoes 
> ---
>  drivers/clk/mpc83xx_clk.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/mpc83xx_clk.c b/drivers/clk/mpc83xx_clk.c
> index 32d2db9eda..1b2b216596 100644
> --- a/drivers/clk/mpc83xx_clk.c
> +++ b/drivers/clk/mpc83xx_clk.c
> @@ -65,7 +65,10 @@ static inline bool is_clk_valid(struct udevice *clk, int 
> id)
> case MPC83XX_CLK_DMAC:
> return (type == SOC_MPC8308) || (type == SOC_MPC8309);
> case MPC83XX_CLK_PCI:
> -   return mpc83xx_has_pci(type);
> +   /*
> +* FIXME: implement proper support for this.
> +*/
> +   return 0 && mpc83xx_has_pci(type);
> case MPC83XX_CLK_CSB:
> return true;
> case MPC83XX_CLK_I2C2:
> --
> 2.23.0
>
That's OK as a workaround, but should probably be properly fixed (ideally with
the addition of a proper DM PCI driver that works with the clock
driver). But for
now:

Reviewed-by: Mario Six 

Applied to mpc83xx/next.

Best regards,
Mario


Re: [PATCH] mpc83xx: set MPC83XX_GPIO_CTRLRS to 2 for MPC8309

2020-01-07 Thread Mario Six
On Thu, Dec 12, 2019 at 10:18 AM Rasmus Villemoes
 wrote:
>
> The MPC8309 has two gpio controllers (which is already correctly
> reflected in its struct immap definition).
>
> Signed-off-by: Rasmus Villemoes 
> ---
>  arch/powerpc/include/asm/arch-mpc83xx/gpio.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h 
> b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
> index 385d651d20..8a6896e622 100644
> --- a/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
> +++ b/arch/powerpc/include/asm/arch-mpc83xx/gpio.h
> @@ -9,7 +9,8 @@
>  #if defined(CONFIG_ARCH_MPC8313) || defined(CONFIG_ARCH_MPC8308) || \
> defined(CONFIG_ARCH_MPC8315)
>  #define MPC83XX_GPIO_CTRLRS 1
> -#elif defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X)
> +#elif defined(CONFIG_ARCH_MPC834X) || defined(CONFIG_ARCH_MPC837X) || \
> +   defined(CONFIG_ARCH_MPC8309)
>  #define MPC83XX_GPIO_CTRLRS 2
>  #else
>  #define MPC83XX_GPIO_CTRLRS 0
> --
> 2.23.0
>
Reviewed-by: Mario Six 

Applied to mpc83xx/next.

Best regards,
Mario


Re: [PATCH] mpc83xx: immap_83xx: add spi8xxx_t in immap for mpc8309

2020-01-07 Thread Mario Six
On Thu, Dec 12, 2019 at 9:35 AM Rasmus Villemoes
 wrote:
>
> Allow drivers/spi/mpc8xxx_spi.c to be built for an mpc8309 target.
>
> Signed-off-by: Rasmus Villemoes 
> ---
>  arch/powerpc/include/asm/immap_83xx.h  | 3 +--
>  arch/powerpc/include/asm/mpc8xxx_spi.h | 1 +
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/immap_83xx.h 
> b/arch/powerpc/include/asm/immap_83xx.h
> index d02da6495c..609869c715 100644
> --- a/arch/powerpc/include/asm/immap_83xx.h
> +++ b/arch/powerpc/include/asm/immap_83xx.h
> @@ -941,8 +941,7 @@ typedef struct immap {
> u8  res4[0x500];
> fsl_lbc_t   im_lbc; /* Local Bus Controller Regs 
> */
> u8  res5[0x1000];
> -   u8  spi[0x100];
> -   u8  res6[0xf00];
> +   spi8xxx_t   spi;/* Serial Peripheral 
> Interface */
> dma83xx_t   dma;/* DMA */
> pciconf83xx_t   pci_conf[1];/* PCI Configuration 
> Registers */
> u8  res7[0x80];
> diff --git a/arch/powerpc/include/asm/mpc8xxx_spi.h 
> b/arch/powerpc/include/asm/mpc8xxx_spi.h
> index b583a3269d..470ee955f3 100644
> --- a/arch/powerpc/include/asm/mpc8xxx_spi.h
> +++ b/arch/powerpc/include/asm/mpc8xxx_spi.h
> @@ -11,6 +11,7 @@
>  #include 
>
>  #if defined(CONFIG_ARCH_MPC8308) || \
> +   defined(CONFIG_ARCH_MPC8309) || \
> defined(CONFIG_ARCH_MPC8313) || \
>     defined(CONFIG_ARCH_MPC8315) || \
> defined(CONFIG_ARCH_MPC834X) || \
> --
> 2.23.0
>
Reviewed-by: Mario Six 

Applied to mpc83xx/next.

Best regards,
Mario


Re: [PATCH] powerpc: mpc83xx: convert CONFIG_FSL_ELBC to Kconfig

2020-01-07 Thread Mario Six
On Thu, Dec 12, 2019 at 9:11 AM Rasmus Villemoes
 wrote:
>
> This complements commit 068789773d0 which did the conversion for
> mpc85xx.
>
> Signed-off-by: Rasmus Villemoes 
> ---
>  arch/powerpc/cpu/mpc83xx/Kconfig   | 7 +++
>  include/configs/MPC8313ERDB_NAND.h | 1 -
>  include/configs/MPC8313ERDB_NOR.h  | 1 -
>  include/configs/MPC8315ERDB.h  | 2 --
>  include/configs/MPC837XEMDS.h  | 2 --
>  include/configs/MPC837XERDB.h  | 2 --
>  include/configs/ids8313.h  | 2 --
>  include/configs/ve8313.h   | 1 -
>  8 files changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig 
> b/arch/powerpc/cpu/mpc83xx/Kconfig
> index e9f6e93c21..5d7650294d 100644
> --- a/arch/powerpc/cpu/mpc83xx/Kconfig
> +++ b/arch/powerpc/cpu/mpc83xx/Kconfig
> @@ -221,6 +221,7 @@ config ARCH_MPC8309
> select MPC83XX_PCI_SUPPORT
> select MPC83XX_SECOND_I2C_SUPPORT
> select SYS_FSL_ERRATUM_ESDHC111
> +   select FSL_ELBC
>
>  config ARCH_MPC831X
> bool
> @@ -232,6 +233,7 @@ config ARCH_MPC8313
> bool
> select ARCH_MPC831X
> select MPC83XX_SECOND_I2C_SUPPORT
> +   select FSL_ELBC
>
>  config ARCH_MPC8315
> bool
> @@ -239,6 +241,7 @@ config ARCH_MPC8315
> select MPC83XX_PCIE1_SUPPORT
> select MPC83XX_PCIE2_SUPPORT
> select MPC83XX_SATA_SUPPORT
> +   select FSL_ELBC
>
>  config ARCH_MPC832X
> bool
> @@ -275,6 +278,7 @@ config ARCH_MPC837X
> select MPC83XX_SATA_SUPPORT
> select MPC83XX_LDP_PIN
> select MPC83XX_SECOND_I2C_SUPPORT
> +   select FSL_ELBC
>
>  config SYS_IMMR
> hex "Value for IMMR"
> @@ -318,6 +322,9 @@ endif
>
>  endmenu
>
> +config FSL_ELBC
> +   bool
> +
>  source "board/esd/vme8349/Kconfig"
>  source "board/freescale/mpc8308rdb/Kconfig"
>  source "board/freescale/mpc8313erdb/Kconfig"
> diff --git a/include/configs/MPC8313ERDB_NAND.h 
> b/include/configs/MPC8313ERDB_NAND.h
> index 4153d609be..569b59008c 100644
> --- a/include/configs/MPC8313ERDB_NAND.h
> +++ b/include/configs/MPC8313ERDB_NAND.h
> @@ -43,7 +43,6 @@
>  #endif
>
>  #define CONFIG_PCI_INDIRECT_BRIDGE
> -#define CONFIG_FSL_ELBC 1
>
>  /*
>   * On-board devices
> diff --git a/include/configs/MPC8313ERDB_NOR.h 
> b/include/configs/MPC8313ERDB_NOR.h
> index ff8dedf03e..274653df29 100644
> --- a/include/configs/MPC8313ERDB_NOR.h
> +++ b/include/configs/MPC8313ERDB_NOR.h
> @@ -19,7 +19,6 @@
>  #endif
>
>  #define CONFIG_PCI_INDIRECT_BRIDGE
> -#define CONFIG_FSL_ELBC 1
>
>  /*
>   * On-board devices
> diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h
> index 521c5ca6ee..e60a6a7d7a 100644
> --- a/include/configs/MPC8315ERDB.h
> +++ b/include/configs/MPC8315ERDB.h
> @@ -116,8 +116,6 @@
>  #define CONFIG_SYS_GBL_DATA_OFFSET \
> (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
>
> -#define CONFIG_FSL_ELBC
> -
>  /*
>   * FLASH on the Local Bus
>   */
> diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h
> index 724f8afb76..36bf4b18f2 100644
> --- a/include/configs/MPC837XEMDS.h
> +++ b/include/configs/MPC837XEMDS.h
> @@ -134,8 +134,6 @@
>  #define CONFIG_SYS_GBL_DATA_OFFSET \
> (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
>
> -#define CONFIG_FSL_ELBC1
> -
>  /*
>   * FLASH on the Local Bus
>   */
> diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h
> index 37f51ba743..31ecc2ff3f 100644
> --- a/include/configs/MPC837XERDB.h
> +++ b/include/configs/MPC837XERDB.h
> @@ -158,8 +158,6 @@
>  #define CONFIG_SYS_GBL_DATA_OFFSET \
> (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
>
> -#define CONFIG_FSL_ELBC1
> -
>  /*
>   * FLASH on the Local Bus
>   */
> diff --git a/include/configs/ids8313.h b/include/configs/ids8313.h
> index 43cb14c14e..e1d271cc33 100644
> --- a/include/configs/ids8313.h
> +++ b/include/configs/ids8313.h
> @@ -14,8 +14,6 @@
>  /*
>   * High Level Configuration Options
>   */
> -#define CONFIG_FSL_ELBC
> -
>  #define CONFIG_BOOT_RETRY_TIME     900
>  #define CONFIG_BOOT_RETRY_MIN  30
>  #define CONFIG_RESET_TO_RETRY
> diff --git a/include/configs/ve8313.h b/include/configs/ve8313.h
> index 66f771d818..67793c17ae 100644
> --- a/include/configs/ve8313.h
> +++ b/include/configs/ve8313.h
> @@ -18,7 +18,6 @@
>  #define CONFIG_E3001
>
>  #define CONFIG_PCI_INDIRECT_BRIDGE 1
> -#define CONFIG_FSL_ELBC1
>
>  /*
>   * On-board devices
> --
> 2.23.0
>
Reviewed-by: Mario Six 

Applied to mpc83xx/next.

Best regards,
Mario


Re: [PATCH] mpc83xx: make ARCH_MPC8309 select SYS_FSL_ERRATUM_ESDHC111

2020-01-07 Thread Mario Six
On Wed, Dec 11, 2019 at 10:39 AM Rasmus Villemoes
 wrote:
>
> The mpc8309 is also affected by the "Manual Asynchronous CMD12 abort
> operation causes protocol violations" erratum, though it is enumerated
> as eSDHC16 in the errata sheet for mpc8309.
>
> Signed-off-by: Rasmus Villemoes 
> ---
>  arch/powerpc/cpu/mpc83xx/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig 
> b/arch/powerpc/cpu/mpc83xx/Kconfig
> index 72053ceab4..e9f6e93c21 100644
> --- a/arch/powerpc/cpu/mpc83xx/Kconfig
> +++ b/arch/powerpc/cpu/mpc83xx/Kconfig
> @@ -220,6 +220,7 @@ config ARCH_MPC8309
> select MPC83XX_QUICC_ENGINE
> select MPC83XX_PCI_SUPPORT
> select MPC83XX_SECOND_I2C_SUPPORT
> +   select SYS_FSL_ERRATUM_ESDHC111
>
>  config ARCH_MPC831X
> bool
> --
> 2.23.0
>
Reviewed-by: Mario Six 

Applied to mpc83xx/next.

Best regards,
Mario


Re: [U-Boot] [ANNOUNCEMENT] Switching to gitlab.denx.de

2019-06-18 Thread Mario Six
Hi Wolfgang,

On Tue, Jun 18, 2019 at 3:46 PM Wolfgang Denk  wrote:
>
> Hello everybody,
>
> I wrote:
>
> > as discussed before, we want to switch from the old git server to
> > more powerful soft- and hardware.  We will move the U-Boot master
> > repository and all custodian repositories to gitlab.
> ...
> > The switch will take place as follows:
> >
> > 1. We will create user accounts for all custodians at gitlab.denx.de
> >You will receive an e-mail notification with your login
> >credentials. We will start with this this afternoon (CEST),
> >so if you have not received such an e-mail by tomorrow morning,
> >please let us know.
> >
> > 2. We will block your SSH keys on the old git server, thus
> >effectively turning the custodian repositories into read-only
> >mode.  Custodians will not be able to push any new stuff to the
> >old repositories any more.
> >
> >This phase will start when all custodian repositories have been
> >created, but in no case before  12:00 p. m. (noon) CEST.  the
> >next steps will follow as quickly as possible, ideally only a few
> >minutes later.
> >
> > 3. The old repository will be cloned to the new gitlab server.  This
> >should not take long.  We don't expect any long interruption.
> >You wanted to have another cup of coffee anyway :-)
> >
> > 4. The custodian can resume work using the gitlab server, as soon as
> >he can "see" his repository there.  Tom should already be
> >prepared to pull from the gitlab repos.
>
> All these steps have been completed by now.  All custodians should
> be able to access the new repositories now, and use all teh gitlab
> features that are enabled for this project (including CI runners).
>
> The U-Boot web pages (especially the source code links and the
> custodian page) have been updated to reference the new gitlab
> repositories.
>
> By now, the gitlab repos represent the official and active mainline
> / custodian repositories.
>
I have not received an e-mail about the MPC83xx repository yet, so I think
something did not quite work as expected. Could you have a look?

>
> > 5. After all custodians have been moved, URL rewrite rules will be
> >activated, and the DNS will be changed, so that the old URLs
> >will still be working, though only for read-only access.
> >
> >Note: this last step is the most error-prone one.  It is likely
> >that the rewrite roles are incomplete at the beginning, and/or
> >incorrect for a few special cases.  Please be patient and report
> >such errors with enough detail to reproduce, then we will fix
> >them.
>
> This is what we will be working on now.
>
> Thanks for your patience!
>
> Best regards,
>
> Wolfgang Denk
>
Best regards,
Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ids8313: Disable SPI

2019-06-07 Thread Mario Six
With the recent SPI changes, the ids8313 board won't compile anymore.

Until further information from the manufacturer, disable SPI support, so
that the board will at least compile again.

Signed-off-by: Mario Six 
---
 configs/ids8313_defconfig | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/configs/ids8313_defconfig b/configs/ids8313_defconfig
index 43454a122b..154a075682 100644
--- a/configs/ids8313_defconfig
+++ b/configs/ids8313_defconfig
@@ -134,7 +134,6 @@ CONFIG_CMD_ENV_FLAGS=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_NAND_TRIMFFS=y
-CONFIG_CMD_SPI=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
@@ -160,6 +159,4 @@ CONFIG_MII=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
-- 
2.21.0

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


Re: [U-Boot] Pull request: u-boot-spi/master

2019-06-07 Thread Mario Six
Hi Heiko,

On Fri, Jun 7, 2019 at 11:15 AM Heiko Schocher  wrote:
>
> Hello Mario,
>
> Am 07.06.2019 um 11:10 schrieb Mario Six:
> > Hi Heiko,
> >
> > On Fri, Jun 7, 2019 at 10:56 AM Heiko Schocher  wrote:
> >>
> >> Hello Mario,
> >>
> >> Am 07.06.2019 um 09:51 schrieb Mario Six:
> >>> (adding Heiko, since he's the maintainer of the board in question)
> >>>
> >>> On Fri, May 24, 2019 at 9:34 PM Jagan Teki  
> >>> wrote:
> >>
> >> Huch, missed this Email ...
> >>
> >>>>
> >>>> Hi Mario,
> >>>>
> >>>> On Tue, May 21, 2019 at 4:42 PM Tom Rini  wrote:
> >>>>>
> >>>>> On Mon, May 20, 2019 at 10:48:23PM +0530, Jagan Teki wrote:
> >>>>>
> >>>>>> Hi Tom,
> >>>>>>
> >>>>>> Please pull this PR.
> >>>>>>
> >>>>>> Summary:
> >>>>>> - mpc8xxx spi driver fixes (Mario)
> >>>>>> - mpc8xxx spi dm conversion (Mario, Jagan)
> >>>>>> - SPI DM Migration update (Jagan)
> >>>>>>
> >>>>>> The following changes since commit 
> >>>>>> 748198cb8d32d41bc35e6f492bac9948f339bece:
> >>>>>>
> >>>>>> Revert "Makefile: Prioritize external dtb if defined" (2019-05-19 
> >>>>>> 18:09:35 -0400)
> >>>>>>
> >>>>>> are available in the Git repository at:
> >>>>>>
> >>>>>> git://git.denx.de/u-boot-spi.git master
> >>>>>>
> >>>>>> for you to fetch changes up to 
> >>>>>> 93842e580cee40c9d3e70de625e4bd826a749e65:
> >>>>>>
> >>>>>> dm: MIGRATION: Update migration status for SPI (2019-05-20 
> >>>>>> 22:18:54 +0530)
> >>>>>>
> >>>>>
> >>>>> NAK:
> >>>>>  powerpc:  +   ids8313
> >>>>> +(ids8313) cmd/built-in.o: In function `do_spi_xfer':
> >>>>> +(ids8313) build/../cmd/spi.c:53: undefined reference to 
> >>>>> `spi_setup_slave'
> >>>>> +(ids8313) build/../cmd/spi.c:60: undefined reference to `spi_claim_bus'
> >>>>> +(ids8313) build/../cmd/spi.c:63: undefined reference to `spi_xfer'
> >>>>> +(ids8313) build/../cmd/spi.c:80: undefined reference to 
> >>>>> `spi_release_bus'
> >>>>> +(ids8313) build/../cmd/spi.c:82: undefined reference to 
> >>>>> `spi_free_slave'
> >>>>> +(ids8313) common/built-in.o: In function `jumptable_init':
> >>>>> +(ids8313) build/../include/_exports.h:56: undefined reference to 
> >>>>> `spi_setup_slave'
> >>>>> +(ids8313) build/../include/_exports.h:58: undefined reference to 
> >>>>> `spi_free_slave'
> >>>>> +(ids8313) build/../include/_exports.h:65: undefined reference to 
> >>>>> `spi_claim_bus'
> >>>>> +(ids8313) build/../include/_exports.h:66: undefined reference to 
> >>>>> `spi_release_bus'
> >>>>> +(ids8313) build/../include/_exports.h:67: undefined reference to 
> >>>>> `spi_xfer'
> >>>>> +(ids8313) make[1]: *** [Makefile:1552: u-boot] Error 1
> >>>>> +(ids8313) make: *** [Makefile:148: sub-make] Error 2
> >>>>>
> >>>>
> >>>> Any help?
> >>>
> >>> @Heiko: I'll post a minimal patch that starts DM conversion on ids8313; I 
> >>> used
> >>> the mpc8313erdb tree from the Linux sources for now. No guarantees for
> >>> functionality, but it does compile.
> >>
> >> Just saw this patch .. it is really a fast shot :-P
> >>
> >> I just wrote an EMail to the customer, if we should remove the board
> >> from mainline (or convert it).
> >>
> >>> @Jagan: Could you rebase this series on the current master to pull in my
> >>> MPC83xx DM updates, and then apply the previously mentioned ids8313 patch 
> >>> after
> >>> Heiko gave his OK?
> >>
> >> As it blocks spi patches ... Isn,t it better we remove SPI functionality
> >> from the ids8313 board instead of adding a DTS which does not really fit?
> >>
> > That would be the alternative, of course. If you do want to go forward with
> > removing the board, then I'm all for disabling the SPI support until we know
> > more, of course.
> >
> > Do you want to prepare a patch for the SPI removal, or should I do it?
>
> If you can do it, that would be great!
>
Sure, one patch coming up...

> Many thanks!
>
> bye,
> Heiko
>
Best regards,
Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] ids8313: Start DM/DT conversion

2019-06-07 Thread Mario Six
Hi Heiko,

On Fri, Jun 7, 2019 at 10:58 AM Heiko Schocher  wrote:
>
> Hello Mario,
>
> Am 07.06.2019 um 09:51 schrieb Mario Six:
> > This commit does the minimal possible conversion so that the ids8313
> > board still compiles with the recent SPI DM conversion:
> > * Add a device tree (for now a 1-to-1 copy of the mpc8313erdb board's DT
> >from the Linux kernel sources)
> > * Remove the legacy CS switching mechanism from the board file
> > * Enable enough config options to that the board compiles
> >
> > Signed-off-by: Mario Six 
> > ---
> >   arch/powerpc/dts/Makefile|   1 +
> >   arch/powerpc/dts/ids8313.dts | 405 +++
> >   board/ids/ids8313/ids8313.c  |  32 ---
> >   configs/ids8313_defconfig|   6 +-
> >   4 files changed, 411 insertions(+), 33 deletions(-)
> >   create mode 100644 arch/powerpc/dts/ids8313.dts
>
> Thanks for putting effort here ...
>
> I try to get infos if we can drop this board from mainline...
>
> As the board blocks spi patches ... can we remove SPI from this board
> completly instead adding (simple copy) a dts which does not fit for
> the board?
>
Indeed, if the perspective of removal is there, then disabling SPI is easier.

Consider the patch obsolete, then. :-)

> Thanks!
>
> bye,
> Heiko

Best regards,
Mario
> > diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile
> > index 6a28f802c2..f43f46870c 100644
> > --- a/arch/powerpc/dts/Makefile
> > +++ b/arch/powerpc/dts/Makefile
> > @@ -3,6 +3,7 @@
> >   dtb-$(CONFIG_TARGET_T2080QDS) += t2080qds.dtb
> >   dtb-$(CONFIG_TARGET_MCR3000) += mcr3000.dtb
> >   dtb-$(CONFIG_TARGET_GAZERBEAM) += gazerbeam.dtb
> > +dtb-$(CONFIG_TARGET_IDS8313) += ids8313.dtb
> >
> >   targets += $(dtb-y)
> >
> > diff --git a/arch/powerpc/dts/ids8313.dts b/arch/powerpc/dts/ids8313.dts
> > new file mode 100644
> > index 00..a8315795b2
> > --- /dev/null
> > +++ b/arch/powerpc/dts/ids8313.dts
> > @@ -0,0 +1,405 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> > +/*
> > + * MPC8313E RDB Device Tree Source
> > + *
> > + * Copyright 2005, 2006, 2007 Freescale Semiconductor Inc.
> > + */
> > +
> > +/dts-v1/;
> > +
> > +/ {
> > + model = "MPC8313ERDB";
> > + compatible = "MPC8313ERDB", "MPC831xRDB", "MPC83xxRDB";
> > + #address-cells = <1>;
> > + #size-cells = <1>;
> > +
> > + aliases {
> > + ethernet0 = 
> > + ethernet1 = 
> > + serial0 = 
> > + serial1 = 
> > + pci0 = 
> > + };
> > +
> > + cpus {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + PowerPC,8313@0 {
> > + device_type = "cpu";
> > + reg = <0x0>;
> > + d-cache-line-size = <32>;
> > + i-cache-line-size = <32>;
> > + d-cache-size = <16384>;
> > + i-cache-size = <16384>;
> > + timebase-frequency = <0>;   // from bootloader
> > + bus-frequency = <0>;// from bootloader
> > + clock-frequency = <0>;  // from bootloader
> > + };
> > + };
> > +
> > + memory {
> > + device_type = "memory";
> > + reg = <0x 0x0800>;  // 128MB at 0
> > + };
> > +
> > + localbus@e0005000 {
> > + #address-cells = <2>;
> > + #size-cells = <1>;
> > + compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
> > + reg = <0xe0005000 0x1000>;
> > + interrupts = <77 0x8>;
> > + interrupt-parent = <>;
> > +
> > + // CS0 and CS1 are swapped when
> > + // booting from nand, but the
> > + // addresses are the same.
> > + ranges = <0x0 0x0 0xfe00 0x0080
> > +   0x1 0x0 0xe280 0x8000
> > +   0x2 0x0 0xf000 0x0002
> > +   0x3 0x0 0xfa00 0x8000>;
> > +
> > + flash@0,0 {
> > + #address-cells = <1>;
>

Re: [U-Boot] Pull request: u-boot-spi/master

2019-06-07 Thread Mario Six
Hi Heiko,

On Fri, Jun 7, 2019 at 10:56 AM Heiko Schocher  wrote:
>
> Hello Mario,
>
> Am 07.06.2019 um 09:51 schrieb Mario Six:
> > (adding Heiko, since he's the maintainer of the board in question)
> >
> > On Fri, May 24, 2019 at 9:34 PM Jagan Teki  
> > wrote:
>
> Huch, missed this Email ...
>
> >>
> >> Hi Mario,
> >>
> >> On Tue, May 21, 2019 at 4:42 PM Tom Rini  wrote:
> >>>
> >>> On Mon, May 20, 2019 at 10:48:23PM +0530, Jagan Teki wrote:
> >>>
> >>>> Hi Tom,
> >>>>
> >>>> Please pull this PR.
> >>>>
> >>>> Summary:
> >>>> - mpc8xxx spi driver fixes (Mario)
> >>>> - mpc8xxx spi dm conversion (Mario, Jagan)
> >>>> - SPI DM Migration update (Jagan)
> >>>>
> >>>> The following changes since commit 
> >>>> 748198cb8d32d41bc35e6f492bac9948f339bece:
> >>>>
> >>>>Revert "Makefile: Prioritize external dtb if defined" (2019-05-19 
> >>>> 18:09:35 -0400)
> >>>>
> >>>> are available in the Git repository at:
> >>>>
> >>>>git://git.denx.de/u-boot-spi.git master
> >>>>
> >>>> for you to fetch changes up to 93842e580cee40c9d3e70de625e4bd826a749e65:
> >>>>
> >>>>dm: MIGRATION: Update migration status for SPI (2019-05-20 22:18:54 
> >>>> +0530)
> >>>>
> >>>
> >>> NAK:
> >>> powerpc:  +   ids8313
> >>> +(ids8313) cmd/built-in.o: In function `do_spi_xfer':
> >>> +(ids8313) build/../cmd/spi.c:53: undefined reference to `spi_setup_slave'
> >>> +(ids8313) build/../cmd/spi.c:60: undefined reference to `spi_claim_bus'
> >>> +(ids8313) build/../cmd/spi.c:63: undefined reference to `spi_xfer'
> >>> +(ids8313) build/../cmd/spi.c:80: undefined reference to `spi_release_bus'
> >>> +(ids8313) build/../cmd/spi.c:82: undefined reference to `spi_free_slave'
> >>> +(ids8313) common/built-in.o: In function `jumptable_init':
> >>> +(ids8313) build/../include/_exports.h:56: undefined reference to 
> >>> `spi_setup_slave'
> >>> +(ids8313) build/../include/_exports.h:58: undefined reference to 
> >>> `spi_free_slave'
> >>> +(ids8313) build/../include/_exports.h:65: undefined reference to 
> >>> `spi_claim_bus'
> >>> +(ids8313) build/../include/_exports.h:66: undefined reference to 
> >>> `spi_release_bus'
> >>> +(ids8313) build/../include/_exports.h:67: undefined reference to 
> >>> `spi_xfer'
> >>> +(ids8313) make[1]: *** [Makefile:1552: u-boot] Error 1
> >>> +(ids8313) make: *** [Makefile:148: sub-make] Error 2
> >>>
> >>
> >> Any help?
> >
> > @Heiko: I'll post a minimal patch that starts DM conversion on ids8313; I 
> > used
> > the mpc8313erdb tree from the Linux sources for now. No guarantees for
> > functionality, but it does compile.
>
> Just saw this patch .. it is really a fast shot :-P
>
> I just wrote an EMail to the customer, if we should remove the board
> from mainline (or convert it).
>
> > @Jagan: Could you rebase this series on the current master to pull in my
> > MPC83xx DM updates, and then apply the previously mentioned ids8313 patch 
> > after
> > Heiko gave his OK?
>
> As it blocks spi patches ... Isn,t it better we remove SPI functionality
> from the ids8313 board instead of adding a DTS which does not really fit?
>
That would be the alternative, of course. If you do want to go forward with
removing the board, then I'm all for disabling the SPI support until we know
more, of course.

Do you want to prepare a patch for the SPI removal, or should I do it?

> bye,
> Heiko
>
Best regards,
Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] Pull request: u-boot-spi/master

2019-06-07 Thread Mario Six
(adding Heiko, since he's the maintainer of the board in question)

On Fri, May 24, 2019 at 9:34 PM Jagan Teki  wrote:
>
> Hi Mario,
>
> On Tue, May 21, 2019 at 4:42 PM Tom Rini  wrote:
> >
> > On Mon, May 20, 2019 at 10:48:23PM +0530, Jagan Teki wrote:
> >
> > > Hi Tom,
> > >
> > > Please pull this PR.
> > >
> > > Summary:
> > > - mpc8xxx spi driver fixes (Mario)
> > > - mpc8xxx spi dm conversion (Mario, Jagan)
> > > - SPI DM Migration update (Jagan)
> > >
> > > The following changes since commit 
> > > 748198cb8d32d41bc35e6f492bac9948f339bece:
> > >
> > >   Revert "Makefile: Prioritize external dtb if defined" (2019-05-19 
> > > 18:09:35 -0400)
> > >
> > > are available in the Git repository at:
> > >
> > >   git://git.denx.de/u-boot-spi.git master
> > >
> > > for you to fetch changes up to 93842e580cee40c9d3e70de625e4bd826a749e65:
> > >
> > >   dm: MIGRATION: Update migration status for SPI (2019-05-20 22:18:54 
> > > +0530)
> > >
> >
> > NAK:
> >powerpc:  +   ids8313
> > +(ids8313) cmd/built-in.o: In function `do_spi_xfer':
> > +(ids8313) build/../cmd/spi.c:53: undefined reference to `spi_setup_slave'
> > +(ids8313) build/../cmd/spi.c:60: undefined reference to `spi_claim_bus'
> > +(ids8313) build/../cmd/spi.c:63: undefined reference to `spi_xfer'
> > +(ids8313) build/../cmd/spi.c:80: undefined reference to `spi_release_bus'
> > +(ids8313) build/../cmd/spi.c:82: undefined reference to `spi_free_slave'
> > +(ids8313) common/built-in.o: In function `jumptable_init':
> > +(ids8313) build/../include/_exports.h:56: undefined reference to 
> > `spi_setup_slave'
> > +(ids8313) build/../include/_exports.h:58: undefined reference to 
> > `spi_free_slave'
> > +(ids8313) build/../include/_exports.h:65: undefined reference to 
> > `spi_claim_bus'
> > +(ids8313) build/../include/_exports.h:66: undefined reference to 
> > `spi_release_bus'
> > +(ids8313) build/../include/_exports.h:67: undefined reference to `spi_xfer'
> > +(ids8313) make[1]: *** [Makefile:1552: u-boot] Error 1
> > +(ids8313) make: *** [Makefile:148: sub-make] Error 2
> >
>
> Any help?

@Heiko: I'll post a minimal patch that starts DM conversion on ids8313; I used
the mpc8313erdb tree from the Linux sources for now. No guarantees for
functionality, but it does compile.

@Jagan: Could you rebase this series on the current master to pull in my
MPC83xx DM updates, and then apply the previously mentioned ids8313 patch after
Heiko gave his OK?

Thanks, and best regards,
Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] ids8313: Start DM/DT conversion

2019-06-07 Thread Mario Six
This commit does the minimal possible conversion so that the ids8313
board still compiles with the recent SPI DM conversion:
* Add a device tree (for now a 1-to-1 copy of the mpc8313erdb board's DT
  from the Linux kernel sources)
* Remove the legacy CS switching mechanism from the board file
* Enable enough config options to that the board compiles

Signed-off-by: Mario Six 
---
 arch/powerpc/dts/Makefile|   1 +
 arch/powerpc/dts/ids8313.dts | 405 +++
 board/ids/ids8313/ids8313.c  |  32 ---
 configs/ids8313_defconfig|   6 +-
 4 files changed, 411 insertions(+), 33 deletions(-)
 create mode 100644 arch/powerpc/dts/ids8313.dts

diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile
index 6a28f802c2..f43f46870c 100644
--- a/arch/powerpc/dts/Makefile
+++ b/arch/powerpc/dts/Makefile
@@ -3,6 +3,7 @@
 dtb-$(CONFIG_TARGET_T2080QDS) += t2080qds.dtb
 dtb-$(CONFIG_TARGET_MCR3000) += mcr3000.dtb
 dtb-$(CONFIG_TARGET_GAZERBEAM) += gazerbeam.dtb
+dtb-$(CONFIG_TARGET_IDS8313) += ids8313.dtb
 
 targets += $(dtb-y)
 
diff --git a/arch/powerpc/dts/ids8313.dts b/arch/powerpc/dts/ids8313.dts
new file mode 100644
index 00..a8315795b2
--- /dev/null
+++ b/arch/powerpc/dts/ids8313.dts
@@ -0,0 +1,405 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * MPC8313E RDB Device Tree Source
+ *
+ * Copyright 2005, 2006, 2007 Freescale Semiconductor Inc.
+ */
+
+/dts-v1/;
+
+/ {
+   model = "MPC8313ERDB";
+   compatible = "MPC8313ERDB", "MPC831xRDB", "MPC83xxRDB";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   aliases {
+   ethernet0 = 
+   ethernet1 = 
+   serial0 = 
+   serial1 = 
+   pci0 = 
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,8313@0 {
+   device_type = "cpu";
+   reg = <0x0>;
+   d-cache-line-size = <32>;
+   i-cache-line-size = <32>;
+   d-cache-size = <16384>;
+   i-cache-size = <16384>;
+   timebase-frequency = <0>;   // from bootloader
+   bus-frequency = <0>;// from bootloader
+   clock-frequency = <0>;  // from bootloader
+   };
+   };
+
+   memory {
+   device_type = "memory";
+   reg = <0x 0x0800>;  // 128MB at 0
+   };
+
+   localbus@e0005000 {
+   #address-cells = <2>;
+   #size-cells = <1>;
+   compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
+   reg = <0xe0005000 0x1000>;
+   interrupts = <77 0x8>;
+   interrupt-parent = <>;
+
+   // CS0 and CS1 are swapped when
+   // booting from nand, but the
+   // addresses are the same.
+   ranges = <0x0 0x0 0xfe00 0x0080
+ 0x1 0x0 0xe280 0x8000
+ 0x2 0x0 0xf000 0x0002
+ 0x3 0x0 0xfa00 0x8000>;
+
+   flash@0,0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "cfi-flash";
+   reg = <0x0 0x0 0x80>;
+   bank-width = <2>;
+   device-width = <1>;
+   };
+
+   nand@1,0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "fsl,mpc8313-fcm-nand",
+"fsl,elbc-fcm-nand";
+   reg = <0x1 0x0 0x2000>;
+
+   u-boot@0 {
+   reg = <0x0 0x10>;
+   read-only;
+   };
+
+   kernel@10 {
+   reg = <0x10 0x30>;
+   };
+
+   fs@40 {
+   reg = <0x40 0x1c0>;
+   };
+   };
+   };
+
+   soc8313@e000 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   device_type = "soc";
+   compatible = "simple-bus";
+   ranges = <0x0 0xe000 0x0010>;
+   reg = <0xe000 0x0200>;
+   bus-frequency = <0>;
+
+   wdt@200 {
+   device_t

[U-Boot] [PULL] u-boot-mpc83xx/master (take 2)

2019-05-21 Thread Mario Six
Hi Tom,

The following changes since commit d494cdb97e18a30214d0414376d4eacdf82224fe:

  mpc83xx: Add gazerbeam board (2019-05-21 08:03:38 +0200)

are available in the Git repository at:

  git://git.denx.de/u-boot-mpc83xx.git

for you to fetch changes up to d494cdb97e18a30214d0414376d4eacdf82224fe:

  mpc83xx: Add gazerbeam board (2019-05-21 08:03:38 +0200)


Dirk Eibach (2):
  gdsys: phy: Adapt fixup_88e1518() to latest Release Notes
  mpc83xx: Add gazerbeam board

Mario Six (84):
  mpc83xx: Introduce ARCH_MPC830*
  mpc83xx: Introduce ARCH_MPC831*
  mpc83xx: Introduce ARCH_MPC832*
  mpc83xx: Introduce ARCH_MPC834*
  mpc83xx: Introduce ARCH_MPC836*
  mpc83xx: Introduce ARCH_MPC837X
  keymile: Make distinct kmtegr1, kmvect1, suvd3 configs
  keymile: Move config files
  keymile: Unroll includes
  keymile: Make distinct kmsupx5, tuge1, kmopti2, and kmtepr2 configs
  keymile: Unroll km/km83xx-common.h
  keymile: Make distinct kmeter1, and kmcoge5ne configs
  mpc83xx: Make distinct MPC8313ERDB targets
  vme8349: Migrate to CONFIG_TARGET_VME8349
  mpc83xx: Make distinct caddy2 config
  powerpc: Add LSDMR config values
  mpc83xx: Make distinct MPC8349EMDS_SDRAM board
  mpc8315erdb: Merge BR/OR settings
  ve8313: Merge BR/OR settings
  MPC832XEMDS: Migrate to CONFIG_TARGET_MPC832XEMDS
  MPC8349ITX: Migrate to CONFIG_TARGET_MPC8349ITX
  hrcon: Migrate to CONFIG_TARGET_HRCON
  strider: Migrate to CONFIG_TARGET_STRIDER
  MPC8313ERDB: Remove CONFIG_MPC8313ERDB
  MPC8315ERDB: Remove CONFIG_MPC8315ERDB
  MPC837XEMDS: Remove CONFIG_MPC837XEMDS
  MPC837XERDB: Remove CONFIG_MPC837XERDB
  mpc83xx: Migrate legacy PCI options to Kconfig
  mpc83xx: Replace CONFIG_83XX_CLKIN in calculations
  mpc83xx: Get rid of CONFIG_83XX_CLKIN
  mpc83xx: Kconfig: Migrate HRCW to Kconfig
  mpc83xx: pcie: Read the clock from registers
  powerpc: Migrate HIGH_BATS to Kconfig
  mpc83xx: Migrate BATS config to Kconfig
  mpc83xx: Migrate LBLAW_* to Kconfig
  mpc83xx: Normalize BR/OR option lines
  tqm834x: Expand CONFIG_SYS_OR_TIMING_FLASH macro
  mpc83xx: Simplify BR,OR lines
  sbc8349: Remove SDRAM functionality
  mpc83xx: Migrate CONFIG_SYS_{BR, OR}*_PRELIM to Kconfig
  powerpc: mpc83xx: Fix MPC8308 IMMR memory layout
  powerpc: mpc83xx: Implement get_serial_clock()
  powerpc: mpc83xx: fdt: Use get_serial_clock()
  mpc83xx: Remove last CONFIG_MPC83xx
  mpc83xx: Prepare usage of DM gpio driver
  mpc83xx: Migrate HID config to Kconfig
  mpc83xx: Migrate CONFIG_SYS_IMMR to Kconfig
  mpc8308: Migrate system io config to Kconfig
  mpc83xx: Migrate arbiter config to Kconfig
  mpc83xx: Migrate SPCR to Kconfig
  mpc83xx: Migrate CONFIG_LCRR_* to Kconfig
  mpc83xx: Get rid of CONFIG_SYS_DDR_BASE
  mpc83xx: Get rid of CONFIG_SYS_DDR_SDRAM_BASE
  mpc83xx: Get rid of CONFIG_SYS_LBC_*
  mpc83xx: Add arch clock.h to make SDHC work
  mpc83xx: Don't define cpu_eth_init for DM eth
  mpc83xx: Replace ppcDWstore with inline assembly
  mpc83xx: Use pre-defined asm functions
  keymile: Remove CONFIG_SYS_APP{1, 2}_{BASE, SIZE}
  keymile: Factor out common includes again
  powerpc: Simplify processor.h
  mpc83xx: Define _end symbol
  mpc83xx_clk: Add enable method
  cmd: binop: Use new environment api
  cmd: binop: Use hex2bin
  i2c: ihs: Get rid of fpgamap
  i2c: ihs: Improve error handling
  gdsys_rxaui_ctrl: Return old state
  gdsys_rxaui_ctrl: Use new regmap interface
  ihs_mdio: Use new regmap interface
  gdsys: Post ppc4xx removal cleanup
  gdsys: mpc8308: Fix style violations
  gdsys: mpc8308: Use shadow register for output GPIO values
  gdsys: mpc8308: Migrate SYS_FPGA{0, 1}_{BASE, SIZE} to Kconfig
  gdsys: mpc8308: Don't use manual RAM config if RAM driver is active
  gdsys: Introduce GDSYS_LEGACY_DRIVERS
  gdsys: mpc8308: Add FPGA flavor option
  gdsys: cmd_ioloop: Fix style violations
  gdsys: cmd_ioloop: Introduce commenting enum
  gdsys: cmd_ioloop: Make DM compatible
  gdsys: ioep-fpga: Switch to gazerbeam-style reporting
  board: gazerbeam: Fix SC detection
  gazerbeam: Import Linux DT
  gazerbeam: Add u-boot specific dts include file


 Kconfig|2 +-
 arch/powerpc/Kconfig   |6 +
 arch/powerpc/cpu/mpc83xx/Kconfig   |  255 +++-
 arch/powerpc/cpu/mpc83xx/Makefile  |2 +
 arch/powerpc/cpu/mpc83xx/arbiter/Kconfig   |  139 +++
 arch/powerpc/cpu/mpc83xx/arbiter/arbiter.h |   28 +
 arch/powerpc/cpu/mpc83xx/bats/Kconfig  | 1311 
 arch

Re: [U-Boot] [PULL] u-boot-mpc83xx/master

2019-05-21 Thread Mario Six
Hi Tom,

On Tue, May 21, 2019 at 4:11 AM Tom Rini  wrote:
>
> On Mon, May 20, 2019 at 01:59:53PM +0200, Mario Six wrote:
>
> > Hi Tom,
> >
> > The following changes since commit 7eafd61a43b102808dc83066de35a1a51d00330f:
> >
> >   ihs_mdio: Use new regmap interface (2019-05-20 13:50:35 +0200)
> >
> > are available in the Git repository at:
> >
> >   git://git.denx.de/u-boot-mpc83xx.git
> >
> > for you to fetch changes up to 7eafd61a43b102808dc83066de35a1a51d00330f:
> >
> >   ihs_mdio: Use new regmap interface (2019-05-20 13:50:35 +0200)
> >
>
> NAK, sorry.  Minor, and I fixed up:
> configs/MPC8349EMDS_SDRAM_defconfig is missing from
> board/freescale/mpc8349emds/MAINTAINERS
>
> But major, new fail to builds:
> https://travis-ci.org/trini/u-boot/jobs/534940540
>
OK, I'll have a take 2 ready in a few minutes. And in light of the deprecation
warnings and looming board removals, I will also pull in the gazerbeam series
now, so that we will have a fully DM-converted MPC83xx board in tree, hence the
future of the architecture will not be jeopardized.

> Thanks!
>
> --
> Tom

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


Re: [U-Boot] [PATCH 16/16] mpc83xx: Add gazerbeam board

2019-05-20 Thread Mario Six
On Fri, Mar 29, 2019 at 10:18 AM Mario Six  wrote:
>
> From: Dirk Eibach 
>
> The gdsys gazerbeam board is based on a Freescale MPC8308 SOC.
> It boots from NOR-Flash, kernel and rootfs are stored on
> SD-Card.
>
> On board peripherals include:
> - 2x 10/100 Mbit/s Ethernet (optional)
>
> Signed-off-by: Dirk Eibach 
> Signed-off-by: Mario Six 
> ---
>  arch/powerpc/cpu/mpc83xx/Kconfig |  19 +++
>  arch/powerpc/dts/gazerbeam.dts   |   2 +-
>  board/gdsys/common/Makefile  |   1 +
>  board/gdsys/mpc8308/Kconfig  |  29 -
>  board/gdsys/mpc8308/MAINTAINERS  |   2 +
>  board/gdsys/mpc8308/Makefile |   1 +
>  board/gdsys/mpc8308/gazerbeam.c  | 179 
>  configs/gazerbeam_defconfig  | 196 +++
>  include/configs/gazerbeam.h  | 137 +
>  9 files changed, 564 insertions(+), 2 deletions(-)
>  create mode 100644 board/gdsys/mpc8308/gazerbeam.c
>  create mode 100644 configs/gazerbeam_defconfig
>  create mode 100644 include/configs/gazerbeam.h
>
> diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig 
> b/arch/powerpc/cpu/mpc83xx/Kconfig
> index fe20e85086b..b99288aa836 100644
> --- a/arch/powerpc/cpu/mpc83xx/Kconfig
> +++ b/arch/powerpc/cpu/mpc83xx/Kconfig
> @@ -175,6 +175,25 @@ config TARGET_STRIDER
> select SYS_FSL_ERRATUM_ESDHC111
> imply CMD_PCA953X
>
> +config TARGET_GAZERBEAM
> +   bool "Support gazerbeam"
> +   select ARCH_MPC8308
> +   select SYS_FSL_ERRATUM_ESDHC111
> +   imply ENV_IS_IN_FLASH
> +   help
> + The "Gazerbeam" is a modular system by Guntermann & Drunck GmbH
> + Systementwicklung based on the NXP MPC8308 SoC for usage in KVM
> + appliances.
> +
> + Features include:
> + * Two gigabit ethernet ports
> + * Multiple USB ports (depending on variant)
> + * Several gigabit ethernet or optical fiber ports (depending on
> +   variant)
> + * Several display port inputs and outputs, and supporting redrivers
> +   (depending on variant)
> + * Several FPGAs with custom logic (depending on variant)
> +
>  endchoice
>
>  config MPC83XX_QUICC_ENGINE
> diff --git a/arch/powerpc/dts/gazerbeam.dts b/arch/powerpc/dts/gazerbeam.dts
> index 5d171519e01..96c03c77ae8 100644
> --- a/arch/powerpc/dts/gazerbeam.dts
> +++ b/arch/powerpc/dts/gazerbeam.dts
> @@ -10,7 +10,7 @@
>   * option) any later version.
>   */
>
> -/include/ "gdsys/mpc8308.dtsi"
> +#include "gdsys/mpc8308.dtsi"
>
>  /include/ "gdsys/gazerbeam-base.dtsi"
>
> diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile
> index ff8d6f49665..7dfe104561a 100644
> --- a/board/gdsys/common/Makefile
> +++ b/board/gdsys/common/Makefile
> @@ -11,6 +11,7 @@ obj-$(CONFIG_TARGET_STRIDER) += mclink.o dp501.o phy.o 
> ioep-fpga.o adv7611.o ch7
>  obj-$(CONFIG_TARGET_STRIDER) += fanctrl.o
>  obj-$(CONFIG_STRIDER_CON) += osd.o
>  obj-$(CONFIG_STRIDER_CON_DP) += osd.o
> +obj-$(CONFIG_TARGET_GAZERBEAM) += osd.o ihs_mdio.o ioep-fpga.o
>
>  ifdef CONFIG_OSD
>  obj-$(CONFIG_GDSYS_LEGACY_OSD_CMDS) += osd_cmd.o
> diff --git a/board/gdsys/mpc8308/Kconfig b/board/gdsys/mpc8308/Kconfig
> index e6a47960547..30811889fbf 100644
> --- a/board/gdsys/mpc8308/Kconfig
> +++ b/board/gdsys/mpc8308/Kconfig
> @@ -71,7 +71,28 @@ config GDSYS_LEGACY_DRIVERS
>
>  endif
>
> -if TARGET_HRCON || TARGET_STRIDER
> +if TARGET_GAZERBEAM
> +
> +config SYS_BOARD
> +   default "mpc8308"
> +
> +config SYS_VENDOR
> +   default "gdsys"
> +
> +config SYS_CONFIG_NAME
> +   default "gazerbeam"
> +
> +config SYS_FPGA1_BASE
> +   default E070
> +
> +config SYS_FPGA1_SIZE
> +   default 1
> +
> +config GDSYS_LEGACY_OSD_CMDS
> +   default y
> +endif
> +
> +if TARGET_HRCON || TARGET_STRIDER || TARGET_GAZERBEAM
>
>  choice
> prompt "FPGA flavor selection"
> @@ -89,6 +110,12 @@ config SYS_FPGA_FLAVOR_GAZERBEAM
>
>  endchoice
>
> +config EXTENDED_FEATURES
> +   bool "FPGA extended features"
> +   depends on GDSYS_LEGACY_DRIVERS
> +   help
> + Enable support for the extended features field of the IHS FPGA.
> +
>  config CMD_IOLOOP
> bool "Enable 'ioloop' and 'ioreflect' commands"
> help
> diff --git a/board/gdsys/mpc8308/MAINTAINERS b/board/gdsys/mpc8308/MAINTAINERS
> index 755b9a23858..ed1b6fa1062 100644
> --- a/board/gdsys/mpc8308/MAINTAINERS
> +++ b/board/gdsys/mpc8308/MAINTAINERS
> @@ -6,7 +6,9 @@ F:  include/

[U-Boot] [PATCH] controlcenterdc: Update config

2019-05-20 Thread Mario Six
Several drivers used by the ControlCenterDC board were converted to DM
upstream. But the board had not been using these drivers yet.

Update the board's config file to reflect these changes and use the DM
version of these drivers. No further device tree updates are necessary,
since the devices in question are already present in the device tree.

This especially fixes the three compile warnings about CONFIG_DM_MMC,
CONFIG_DM_USB, and CONFIG_AHCI for the ControlCenterDC board.

Signed-off-by: Mario Six 
---
 configs/controlcenterdc_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/controlcenterdc_defconfig 
b/configs/controlcenterdc_defconfig
index 7b94f22d9e..326668d742 100644
--- a/configs/controlcenterdc_defconfig
+++ b/configs/controlcenterdc_defconfig
@@ -12,6 +12,7 @@ CONFIG_DEBUG_UART_CLOCK=25000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEBUG_UART=y
+CONFIG_AHCI=y
 CONFIG_FIT=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_VERBOSE=y
@@ -55,6 +56,7 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
 CONFIG_LED=y
 CONFIG_LED_GPIO=y
+CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_MV=y
 CONFIG_SPI_FLASH=y
-- 
2.21.0

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


[U-Boot] [PULL] u-boot-mpc83xx/master

2019-05-20 Thread Mario Six
Hi Tom,

The following changes since commit 7eafd61a43b102808dc83066de35a1a51d00330f:

  ihs_mdio: Use new regmap interface (2019-05-20 13:50:35 +0200)

are available in the Git repository at:

  git://git.denx.de/u-boot-mpc83xx.git

for you to fetch changes up to 7eafd61a43b102808dc83066de35a1a51d00330f:

  ihs_mdio: Use new regmap interface (2019-05-20 13:50:35 +0200)


Mario Six (70):
  mpc83xx: Introduce ARCH_MPC830*
  mpc83xx: Introduce ARCH_MPC831*
  mpc83xx: Introduce ARCH_MPC832*
  mpc83xx: Introduce ARCH_MPC834*
  mpc83xx: Introduce ARCH_MPC836*
  mpc83xx: Introduce ARCH_MPC837X
  keymile: Make distinct kmtegr1, kmvect1, suvd3 configs
  keymile: Move config files
  keymile: Unroll includes
  keymile: Make distinct kmsupx5, tuge1, kmopti2, and kmtepr2 configs
  keymile: Unroll km/km83xx-common.h
  keymile: Make distinct kmeter1, and kmcoge5ne configs
  mpc83xx: Make distinct MPC8313ERDB targets
  vme8349: Migrate to CONFIG_TARGET_VME8349
  mpc83xx: Make distinct caddy2 config
  powerpc: Add LSDMR config values
  mpc83xx: Make distinct MPC8349EMDS_SDRAM board
  mpc8315erdb: Merge BR/OR settings
  ve8313: Merge BR/OR settings
  MPC832XEMDS: Migrate to CONFIG_TARGET_MPC832XEMDS
  MPC8349ITX: Migrate to CONFIG_TARGET_MPC8349ITX
  hrcon: Migrate to CONFIG_TARGET_HRCON
  strider: Migrate to CONFIG_TARGET_STRIDER
  MPC8313ERDB: Remove CONFIG_MPC8313ERDB
  MPC8315ERDB: Remove CONFIG_MPC8315ERDB
  MPC837XEMDS: Remove CONFIG_MPC837XEMDS
  MPC837XERDB: Remove CONFIG_MPC837XERDB
  mpc83xx: Migrate legacy PCI options to Kconfig
  mpc83xx: Replace CONFIG_83XX_CLKIN in calculations
  mpc83xx: Get rid of CONFIG_83XX_CLKIN
  mpc83xx: Kconfig: Migrate HRCW to Kconfig
  mpc83xx: pcie: Read the clock from registers
  powerpc: Migrate HIGH_BATS to Kconfig
  mpc83xx: Migrate BATS config to Kconfig
  mpc83xx: Migrate LBLAW_* to Kconfig
  mpc83xx: Normalize BR/OR option lines
  tqm834x: Expand CONFIG_SYS_OR_TIMING_FLASH macro
  mpc83xx: Simplify BR,OR lines
  sbc8349: Remove SDRAM functionality
  mpc83xx: Migrate CONFIG_SYS_{BR, OR}*_PRELIM to Kconfig
  powerpc: mpc83xx: Fix MPC8308 IMMR memory layout
  powerpc: mpc83xx: Implement get_serial_clock()
  powerpc: mpc83xx: fdt: Use get_serial_clock()
  mpc83xx: Remove last CONFIG_MPC83xx
  mpc83xx: Prepare usage of DM gpio driver
  mpc83xx: Migrate HID config to Kconfig
  mpc83xx: Migrate CONFIG_SYS_IMMR to Kconfig
  mpc8308: Migrate system io config to Kconfig
  mpc83xx: Migrate arbiter config to Kconfig
  mpc83xx: Migrate SPCR to Kconfig
  mpc83xx: Migrate CONFIG_LCRR_* to Kconfig
  mpc83xx: Get rid of CONFIG_SYS_DDR_BASE
  mpc83xx: Get rid of CONFIG_SYS_DDR_SDRAM_BASE
  mpc83xx: Get rid of CONFIG_SYS_LBC_*
  mpc83xx: Add arch clock.h to make SDHC work
  mpc83xx: Don't define cpu_eth_init for DM eth
  mpc83xx: Replace ppcDWstore with inline assembly
  mpc83xx: Use pre-defined asm functions
  keymile: Remove CONFIG_SYS_APP{1, 2}_{BASE, SIZE}
  keymile: Factor out common includes again
  powerpc: Simplify processor.h
  mpc83xx: Define _end symbol
  mpc83xx_clk: Add enable method
  cmd: binop: Use new environment api
  cmd: binop: Use hex2bin
  i2c: ihs: Get rid of fpgamap
  i2c: ihs: Improve error handling
  gdsys_rxaui_ctrl: Return old state
  gdsys_rxaui_ctrl: Use new regmap interface
  ihs_mdio: Use new regmap interface


 Kconfig|2 +-
 arch/powerpc/Kconfig   |6 +
 arch/powerpc/cpu/mpc83xx/Kconfig   |  236 +++-
 arch/powerpc/cpu/mpc83xx/Makefile  |2 +
 arch/powerpc/cpu/mpc83xx/arbiter/Kconfig   |  139 +++
 arch/powerpc/cpu/mpc83xx/arbiter/arbiter.h |   28 +
 arch/powerpc/cpu/mpc83xx/bats/Kconfig  | 1311 
 arch/powerpc/cpu/mpc83xx/bats/bats.h   |  223 
 arch/powerpc/cpu/mpc83xx/cpu.c |   41 +-
 arch/powerpc/cpu/mpc83xx/cpu_init.c|   88 +-
 arch/powerpc/cpu/mpc83xx/ecc.c |   36 +-
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig  |   32 +
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc0|  733 +++
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc1|  733 +++
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc2|  733 +++
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc3|  733 +++
 arch/powerpc/cpu/mpc83xx/elbc/Kconfig.elbc4|  733 +++
 arch/powerpc/cpu/mpc83xx/elbc/elbc.h   |  186 +++
 arch/powerpc/cpu/mpc83xx/fdt.c |   10 +-
 arch/powerpc/cpu/mpc83xx/hid

Re: [U-Boot] [PATCH 1/1] pci: pci_mvebu: fix bus enumeration if some buses have empty slots

2019-05-14 Thread Mario Six
Hi Marek,

On Tue, May 14, 2019 at 5:12 PM Marek Behún  wrote:
>
> The documentation for the uclass_next_device says this:
>
>   @devp: On entry, pointer to device to lookup. On exit, returns pointer
>   to the next device in the uclass if no error occurred, or NULL if
>   there is no next device, or an error occurred with that next device.
>
> But this is useless, because if an error occured with that next device,
> the iteration stops and devices which should work won't be probed.

The class_{first,next}_device_check functions do exactly what you need: They
skip the devices that won't probe and only return the ones that do probe.

Best regards,

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


Re: [U-Boot] [PATCH v2 10/19] spi: mpc8xxx: Simplify logic a bit

2019-05-14 Thread Mario Six
On Tue, May 14, 2019 at 3:53 PM Jagan Teki  wrote:
>
> On Thu, May 2, 2019 at 2:37 PM Joakim Tjernlund
>  wrote:
> >
> > On Thu, 2019-05-02 at 07:31 +0200, Mario Six wrote:
> > > CAUTION: This email originated from outside of the organization. Do not 
> > > click links or open attachments unless you recognize the sender and know 
> > > the content is safe.
> > >
> > >
> > > Hi Jagan and Jocke,
> > >
> > > I'm back from vacation, so here's my answer:
> > >
> > > On Mon, Apr 29, 2019 at 12:41 PM Jagan Teki  
> > > wrote:
> > > > + Mario
> > > >
> > > > On Mon, Apr 29, 2019 at 2:48 PM Joakim Tjernlund
> > > >  wrote:
> > > > > On Mon, 2019-04-29 at 01:58 +0530, Jagan Teki wrote:
> > > > > > From: Mario Six 
> > > > > >
> > > > > > We do nothing in the loop if the "not empty" event was not 
> > > > > > detected. To
> > > > > > simplify the logic, check if this is the case, and skip the 
> > > > > > execution of
> > > > > > the loop early to reduce the nesting level and flag checking.
> > > > >
> > > > > Looked at the driver to refresh memory and noticed:
> > > > > if (charSize == 32) {
> > > > > /* Advance output buffer by 32 bits */
> > > > > din += 4;
> > > > > }
> > > > > which suggests that only 32 bit char will increase the din ptr so 
> > > > > does other bitlens
> > > > > work for reading?
> > > Yes, It will work. When charSize < 32 in a loop execution, we necessarily 
> > > also
> > > have numBlks == 0, since numBlks = DIV_ROUND_UP(bitlen, 32) and charSize =
> > > (bitlen >= 32 ? 32 : bitlen); in other words: we're at the very end of 
> > > the data
> > > to be sent/received and also the final loop execution, so we don't have to
> > > advance the pointer anymore.
> >
> > Ahh, I see now.
> >
> > But this over use of always 32 bits cause complexity/subtile bugs. The 
> > driver should use
> > the requested charsize(wordlen) throughout. As is now you cannot use the 
> > NF/NE flag as intended or
> > toggle LSB_FIRST
>
> Look like Joakim has a point here. better we can check the required
> charsize instead of looking for magic 32 number. What do you say
> Mario?

I agree, the driver code could be made more readable and cleaned up a bit, but
I don't know if it's worth postponing this series for a code readability issue
that's not a functional bug; I'd say that's an optimization that could be made
later on.

What do you guys think?

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


Re: [U-Boot] [PATCH v2 10/19] spi: mpc8xxx: Simplify logic a bit

2019-05-01 Thread Mario Six
Hi Jagan and Jocke,

I'm back from vacation, so here's my answer:

On Mon, Apr 29, 2019 at 12:41 PM Jagan Teki  wrote:
>
> + Mario
>
> On Mon, Apr 29, 2019 at 2:48 PM Joakim Tjernlund
>  wrote:
> >
> > On Mon, 2019-04-29 at 01:58 +0530, Jagan Teki wrote:
> > >
> > > From: Mario Six 
> > >
> > > We do nothing in the loop if the "not empty" event was not detected. To
> > > simplify the logic, check if this is the case, and skip the execution of
> > > the loop early to reduce the nesting level and flag checking.
> >
> > Looked at the driver to refresh memory and noticed:
> > if (charSize == 32) {
> > /* Advance output buffer by 32 bits */
> > din += 4;
> > }
> > which suggests that only 32 bit char will increase the din ptr so does 
> > other bitlens
> > work for reading?
>
Yes, It will work. When charSize < 32 in a loop execution, we necessarily also
have numBlks == 0, since numBlks = DIV_ROUND_UP(bitlen, 32) and charSize =
(bitlen >= 32 ? 32 : bitlen); in other words: we're at the very end of the data
to be sent/received and also the final loop execution, so we don't have to
advance the pointer anymore.

> Mario, can you respond this?

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


[U-Boot] [PATCH 16/16] mpc83xx: Add gazerbeam board

2019-03-29 Thread Mario Six
From: Dirk Eibach 

The gdsys gazerbeam board is based on a Freescale MPC8308 SOC.
It boots from NOR-Flash, kernel and rootfs are stored on
SD-Card.

On board peripherals include:
- 2x 10/100 Mbit/s Ethernet (optional)

Signed-off-by: Dirk Eibach 
Signed-off-by: Mario Six 
---
 arch/powerpc/cpu/mpc83xx/Kconfig |  19 +++
 arch/powerpc/dts/gazerbeam.dts   |   2 +-
 board/gdsys/common/Makefile  |   1 +
 board/gdsys/mpc8308/Kconfig  |  29 -
 board/gdsys/mpc8308/MAINTAINERS  |   2 +
 board/gdsys/mpc8308/Makefile |   1 +
 board/gdsys/mpc8308/gazerbeam.c  | 179 
 configs/gazerbeam_defconfig  | 196 +++
 include/configs/gazerbeam.h  | 137 +
 9 files changed, 564 insertions(+), 2 deletions(-)
 create mode 100644 board/gdsys/mpc8308/gazerbeam.c
 create mode 100644 configs/gazerbeam_defconfig
 create mode 100644 include/configs/gazerbeam.h

diff --git a/arch/powerpc/cpu/mpc83xx/Kconfig b/arch/powerpc/cpu/mpc83xx/Kconfig
index fe20e85086b..b99288aa836 100644
--- a/arch/powerpc/cpu/mpc83xx/Kconfig
+++ b/arch/powerpc/cpu/mpc83xx/Kconfig
@@ -175,6 +175,25 @@ config TARGET_STRIDER
select SYS_FSL_ERRATUM_ESDHC111
imply CMD_PCA953X
 
+config TARGET_GAZERBEAM
+   bool "Support gazerbeam"
+   select ARCH_MPC8308
+   select SYS_FSL_ERRATUM_ESDHC111
+   imply ENV_IS_IN_FLASH
+   help
+ The "Gazerbeam" is a modular system by Guntermann & Drunck GmbH
+ Systementwicklung based on the NXP MPC8308 SoC for usage in KVM
+ appliances.
+
+ Features include:
+ * Two gigabit ethernet ports
+ * Multiple USB ports (depending on variant)
+ * Several gigabit ethernet or optical fiber ports (depending on
+   variant)
+ * Several display port inputs and outputs, and supporting redrivers
+   (depending on variant)
+ * Several FPGAs with custom logic (depending on variant)
+
 endchoice
 
 config MPC83XX_QUICC_ENGINE
diff --git a/arch/powerpc/dts/gazerbeam.dts b/arch/powerpc/dts/gazerbeam.dts
index 5d171519e01..96c03c77ae8 100644
--- a/arch/powerpc/dts/gazerbeam.dts
+++ b/arch/powerpc/dts/gazerbeam.dts
@@ -10,7 +10,7 @@
  * option) any later version.
  */
 
-/include/ "gdsys/mpc8308.dtsi"
+#include "gdsys/mpc8308.dtsi"
 
 /include/ "gdsys/gazerbeam-base.dtsi"
 
diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile
index ff8d6f49665..7dfe104561a 100644
--- a/board/gdsys/common/Makefile
+++ b/board/gdsys/common/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_TARGET_STRIDER) += mclink.o dp501.o phy.o 
ioep-fpga.o adv7611.o ch7
 obj-$(CONFIG_TARGET_STRIDER) += fanctrl.o
 obj-$(CONFIG_STRIDER_CON) += osd.o
 obj-$(CONFIG_STRIDER_CON_DP) += osd.o
+obj-$(CONFIG_TARGET_GAZERBEAM) += osd.o ihs_mdio.o ioep-fpga.o
 
 ifdef CONFIG_OSD
 obj-$(CONFIG_GDSYS_LEGACY_OSD_CMDS) += osd_cmd.o
diff --git a/board/gdsys/mpc8308/Kconfig b/board/gdsys/mpc8308/Kconfig
index e6a47960547..30811889fbf 100644
--- a/board/gdsys/mpc8308/Kconfig
+++ b/board/gdsys/mpc8308/Kconfig
@@ -71,7 +71,28 @@ config GDSYS_LEGACY_DRIVERS
 
 endif
 
-if TARGET_HRCON || TARGET_STRIDER
+if TARGET_GAZERBEAM
+
+config SYS_BOARD
+   default "mpc8308"
+
+config SYS_VENDOR
+   default "gdsys"
+
+config SYS_CONFIG_NAME
+   default "gazerbeam"
+
+config SYS_FPGA1_BASE
+   default E070
+
+config SYS_FPGA1_SIZE
+   default 1
+
+config GDSYS_LEGACY_OSD_CMDS
+   default y
+endif
+
+if TARGET_HRCON || TARGET_STRIDER || TARGET_GAZERBEAM
 
 choice
prompt "FPGA flavor selection"
@@ -89,6 +110,12 @@ config SYS_FPGA_FLAVOR_GAZERBEAM
 
 endchoice
 
+config EXTENDED_FEATURES
+   bool "FPGA extended features"
+   depends on GDSYS_LEGACY_DRIVERS
+   help
+ Enable support for the extended features field of the IHS FPGA.
+
 config CMD_IOLOOP
bool "Enable 'ioloop' and 'ioreflect' commands"
help
diff --git a/board/gdsys/mpc8308/MAINTAINERS b/board/gdsys/mpc8308/MAINTAINERS
index 755b9a23858..ed1b6fa1062 100644
--- a/board/gdsys/mpc8308/MAINTAINERS
+++ b/board/gdsys/mpc8308/MAINTAINERS
@@ -6,7 +6,9 @@ F:  include/configs/hrcon.h
 F: configs/hrcon_defconfig
 F: configs/hrcon_dh_defconfig
 F: include/configs/strider.h
+F: configs/strider_defconfig
 F: configs/strider_cpu_defconfig
 F: configs/strider_cpu_dp_defconfig
 F: configs/strider_con_defconfig
 F: configs/strider_con_dp_defconfig
+F: configs/gazerbeam_defconfig
diff --git a/board/gdsys/mpc8308/Makefile b/board/gdsys/mpc8308/Makefile
index dc579479f95..9af5fe04d18 100644
--- a/board/gdsys/mpc8308/Makefile
+++ b/board/gdsys/mpc8308/Makefile
@@ -6,3 +6,4 @@
 obj-y := mpc8308.o sdram.o
 obj-$(CONFIG_TARGET_HRCON) += hrcon.o
 obj-$(CONFIG_TARGET_STRIDER) += strider.o
+obj-$(CONFIG_TARGET_GAZERBEAM) += gazerbeam.o
dif

[U-Boot] [PATCH 13/16] board: gazerbeam: Fix SC detection

2019-03-29 Thread Mario Six
The single channel detection in the gazerbeam board driver was not
implemented correctly.

Fix the detection.

Signed-off-by: Mario Six 
---
 drivers/board/gazerbeam.c | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/board/gazerbeam.c b/drivers/board/gazerbeam.c
index 481cce8e809..85de4e440ce 100644
--- a/drivers/board/gazerbeam.c
+++ b/drivers/board/gazerbeam.c
@@ -61,7 +61,7 @@ static int _read_board_variant_data(struct udevice *dev)
struct udevice *i2c_bus;
struct udevice *dummy;
char *listname;
-   int mc4, mc2, sc, con;
+   int mc4, mc2, sc, mc2_sc, con;
int gpio_num;
int res;
 
@@ -78,16 +78,16 @@ static int _read_board_variant_data(struct udevice *dev)
return -EIO;
}
 
-   mc2 = !dm_i2c_probe(i2c_bus, MC2_EXPANDER_ADDR, 0, );
+   mc2_sc = !dm_i2c_probe(i2c_bus, MC2_EXPANDER_ADDR, 0, );
mc4 = !dm_i2c_probe(i2c_bus, MC4_EXPANDER_ADDR, 0, );
 
-   if (mc2 && mc4) {
+   if (mc2_sc && mc4) {
debug("%s: Board hardware configuration inconsistent.\n",
  dev->name);
return -EINVAL;
}
 
-   listname = mc2 ? "var-gpios-mc2" : "var-gpios-mc4";
+   listname = mc2_sc ? "var-gpios-mc2" : "var-gpios-mc4";
 
gpio_num = gpio_request_list_by_name(dev, listname, priv->var_gpios,
 ARRAY_SIZE(priv->var_gpios),
@@ -105,12 +105,7 @@ static int _read_board_variant_data(struct udevice *dev)
return sc;
}
 
-   con = dm_gpio_get_value(>var_gpios[CON_GPIO_NO]);
-   if (con < 0) {
-   debug("%s: Error while reading 'con' GPIO (err = %d)",
- dev->name, con);
-   return con;
-   }
+   mc2 = mc2_sc ? (sc ? 0 : 1) : 0;
 
if ((sc && mc2) || (sc && mc4) || (!sc && !mc2 && !mc4)) {
debug("%s: Board hardware configuration inconsistent.\n",
@@ -118,6 +113,13 @@ static int _read_board_variant_data(struct udevice *dev)
return -EINVAL;
}
 
+   con = dm_gpio_get_value(>var_gpios[CON_GPIO_NO]);
+   if (con < 0) {
+   debug("%s: Error while reading 'con' GPIO (err = %d)",
+ dev->name, con);
+   return con;
+   }
+
priv->variant = con ? VAR_CON : VAR_CPU;
 
priv->multichannel = mc4 ? 4 : (mc2 ? 2 : (sc ? 1 : 0));
-- 
2.20.1

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


[U-Boot] [PATCH 14/16] gazerbeam: Import Linux DT

2019-03-29 Thread Mario Six
Import the Linux device tree for the Gazerbeam board.

Signed-off-by: Mario Six 
---
 arch/powerpc/dts/.gitignore   |   1 +
 arch/powerpc/dts/Makefile |   1 +
 arch/powerpc/dts/gazerbeam.dts| 600 ++
 arch/powerpc/dts/gdsys/gazerbeam-base.dtsi| 185 ++
 arch/powerpc/dts/gdsys/mpc8308.dtsi   | 354 +++
 .../dts/gdsys/soc/i2c/cirrus-audio-codec.dtsi |   6 +
 .../powerpc/dts/gdsys/soc/i2c/dallas-rtc.dtsi |   6 +
 arch/powerpc/dts/gdsys/soc/lbc/gazerbeam.dtsi |   5 +
 .../gdsys/soc/nor/flash-80k-partition.dtsi|  20 +
 9 files changed, 1178 insertions(+)
 create mode 100644 arch/powerpc/dts/.gitignore
 create mode 100644 arch/powerpc/dts/gazerbeam.dts
 create mode 100644 arch/powerpc/dts/gdsys/gazerbeam-base.dtsi
 create mode 100644 arch/powerpc/dts/gdsys/mpc8308.dtsi
 create mode 100644 arch/powerpc/dts/gdsys/soc/i2c/cirrus-audio-codec.dtsi
 create mode 100644 arch/powerpc/dts/gdsys/soc/i2c/dallas-rtc.dtsi
 create mode 100644 arch/powerpc/dts/gdsys/soc/lbc/gazerbeam.dtsi
 create mode 100644 arch/powerpc/dts/gdsys/soc/nor/flash-80k-partition.dtsi

diff --git a/arch/powerpc/dts/.gitignore b/arch/powerpc/dts/.gitignore
new file mode 100644
index 000..b60ed208c77
--- /dev/null
+++ b/arch/powerpc/dts/.gitignore
@@ -0,0 +1 @@
+*.dtb
diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile
index f080a968919..6a28f802c24 100644
--- a/arch/powerpc/dts/Makefile
+++ b/arch/powerpc/dts/Makefile
@@ -2,6 +2,7 @@
 
 dtb-$(CONFIG_TARGET_T2080QDS) += t2080qds.dtb
 dtb-$(CONFIG_TARGET_MCR3000) += mcr3000.dtb
+dtb-$(CONFIG_TARGET_GAZERBEAM) += gazerbeam.dtb
 
 targets += $(dtb-y)
 
diff --git a/arch/powerpc/dts/gazerbeam.dts b/arch/powerpc/dts/gazerbeam.dts
new file mode 100644
index 000..a4408c496c8
--- /dev/null
+++ b/arch/powerpc/dts/gazerbeam.dts
@@ -0,0 +1,600 @@
+/*
+ * Gazerbeam CON Device Tree Source
+ *
+ * (C) Copyright 2015
+ * Dirk Eibach, Guntermann & Drunck GmbH, eib...@gdsys.de
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/include/ "gdsys/mpc8308.dtsi"
+
+/include/ "gdsys/gazerbeam-base.dtsi"
+
+/include/ "gdsys/soc/i2c/cirrus-audio-codec.dtsi"
+/include/ "gdsys/soc/i2c/dallas-rtc.dtsi"
+/include/ "gdsys/soc/lbc/gazerbeam.dtsi"
+/include/ "gdsys/soc/nor/flash-80k-partition.dtsi"
+
+_lbc {
+   FPGA0:iocon_uart@1,0 {
+   reg = <0x1 0x0 0x10>;
+   little-endian;
+   interrupts = <48 0x8>;
+   interrupt-parent = <>;
+   };
+
+   FPGA1:iocon_uart@2,0 {
+   reg = <0x2 0x0 0x10>;
+   little-endian;
+   interrupts = <17 0x8>;
+   interrupt-parent = <>;
+   };
+};
+
+ {
+   compatible = "gdsys,iocon_fpga";
+   #gpio-cells = <2>;
+   gpio-controller;
+   bus = <>;
+   unit_id = <0>;
+   fpga-type = <1>;
+   usb_base = <0x0080>;
+   audio_base = <0x0040>;
+   timebase_base = <0x013c>;
+
+   /*
+* for every interrupt source there must be a dataset specifying
+* 1. type (1: standard)
+* 2. status register offset
+* 3. mask register offset
+* 4. default mask
+*/
+   fpga_interrupt_sources =
+   <1 0x000a 0x000c 0x4000>, /* 0: TOP_INTERRUPT */
+   <1 0x001c 0x001e 0x>; /* 1: EXTENDED_INTERRUPT */
+   /*
+* for every interrupt there must be a dataset specifying
+* 1. type (1: status, 2: event)
+* 2. interrupt source index
+* 3. interrupt register bit
+* 4. mask register bit
+*/
+#fpga_interrupt_map-cells = <4>;
+   fpga_interrupt_map =
+   <1 0 14 14>, /*  0: EXTENDED_INTERRUPT */
+   <1 0  0  0>, /*  1: VIDEO 0 */
+   <1 0  1  1>, /*  2: VIDEO 1 */
+   <1 0  2  2>, /*  3: VIDEO IC 0 */
+   <1 0  3  3>, /*  4: VIDEO IC 1 */
+   <1 0  4  4>, /*  5: IIC MAIN */
+   <1 0  6  6>, /*  6: IIC VIDEO 0 */
+   <1 0  7  7>, /*  7: IIC VIDEO 1 */
+   <1 1  0  0>, /*  8: OSD 0 */
+   <1 1  1  1>, /*  9: OSD 1 */
+   <1 1  2  2>, /* 10: SPDIF 0 */
+   <1 1  3  3>, /* 11: SPDIF 1 */
+   <1 0 12 12>, /* 12: COMM 0 */
+   <1 0 13 13>, /* 13: COMM 1 */
+   <1 0 10 10>, /* 14: COMM 2 */
+   <1 0 11 11>, /* 15: COMM 3 */
+   <2 0  5  5>, /*

[U-Boot] [PATCH 11/16] gdsys: cmd_ioloop: Make DM compatible

2019-03-29 Thread Mario Six
Make the ioloop command DM compatible, while keeping the old
functionality for not-yet-converted boards.

Signed-off-by: Mario Six 
---
 board/gdsys/common/cmd_ioloop.c | 293 +++-
 1 file changed, 288 insertions(+), 5 deletions(-)

diff --git a/board/gdsys/common/cmd_ioloop.c b/board/gdsys/common/cmd_ioloop.c
index 8f70c1eda22..05a14ff1038 100644
--- a/board/gdsys/common/cmd_ioloop.c
+++ b/board/gdsys/common/cmd_ioloop.c
@@ -10,11 +10,25 @@
 
 #include 
 
+#ifndef CONFIG_GDSYS_LEGACY_DRIVERS
+#include 
+#include 
+#include 
+#include 
+
+#include "../../../drivers/misc/gdsys_soc.h"
+#include "../../../drivers/misc/gdsys_ioep.h"
+#include "../../../drivers/misc/ihs_fpga.h"
+
+const int HEADER_WORDS = sizeof(struct io_generic_packet) / 2;
+#endif /* !CONFIG_GDSYS_LEGACY_DRIVERS */
+
 enum status_print_type {
STATUS_LOUD = 0,
STATUS_SILENT = 1,
 };
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
 enum {
STATE_TX_PACKET_BUILDING = BIT(0),
STATE_TX_TRANSMITTING = BIT(1),
@@ -33,11 +47,6 @@ enum {
STATE_RX_DATA_AVAILABLE = BIT(15),
 };
 
-enum {
-   CTRL_PROC_RECEIVE_ENABLE = BIT(12),
-   CTRL_FLUSH_TRANSMIT_BUFFER = BIT(15),
-};
-
 enum {
IRQ_CPU_TRANSMITBUFFER_FREE_STATUS = BIT(5),
IRQ_CPU_PACKET_TRANSMITTED_EVENT = BIT(6),
@@ -45,6 +54,11 @@ enum {
IRQ_CPU_RECEIVE_DATA_AVAILABLE_STATUS = BIT(8),
 };
 
+enum {
+   CTRL_PROC_RECEIVE_ENABLE = BIT(12),
+   CTRL_FLUSH_TRANSMIT_BUFFER = BIT(15),
+};
+
 struct io_generic_packet {
u16 target_address;
u16 source_address;
@@ -52,11 +66,16 @@ struct io_generic_packet {
u8 bc;
u16 packet_length;
 } __attribute__((__packed__));
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
 
 unsigned long long rx_ctr;
 unsigned long long tx_ctr;
 unsigned long long err_ctr;
+#ifndef CONFIG_GDSYS_LEGACY_DRIVERS
+struct udevice *dev;
+#endif /* !CONFIG_GDSYS_LEGACY_DRIVERS */
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
 static void io_check_status(uint fpga, u16 status, enum status_print_type type)
 {
u16 mask = STATE_RX_DIST_ERR | STATE_RX_LENGTH_ERR |
@@ -89,7 +108,39 @@ static void io_check_status(uint fpga, u16 status, enum 
status_print_type type)
if (status & STATE_TX_ERR)
printf("TX_ERR\n");
 }
+#else
+static void io_check_status(struct udevice *dev, enum status_print_type type)
+{
+   u16 status = 0;
+   int ret;
 
+   ret = misc_call(dev, 0, NULL, 0, , 0);
+   if (!ret)
+   return;
+
+   err_ctr++;
+
+   if (type != STATUS_LOUD)
+   return;
+
+   if (status & STATE_RX_PACKET_DROPPED)
+   printf("RX_PACKET_DROPPED, status %04x\n", status);
+
+   if (status & STATE_RX_DIST_ERR)
+   printf("RX_DIST_ERR\n");
+   if (status & STATE_RX_LENGTH_ERR)
+   printf("RX_LENGTH_ERR\n");
+   if (status & STATE_RX_FRAME_CTR_ERR)
+   printf("RX_FRAME_CTR_ERR\n");
+   if (status & STATE_RX_FCS_ERR)
+   printf("RX_FCS_ERR\n");
+
+   if (status & STATE_TX_ERR)
+   printf("TX_ERR\n");
+}
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
+
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
 static void io_send(uint fpga, uint size)
 {
uint k;
@@ -111,7 +162,29 @@ static void io_send(uint fpga, uint size)
 
tx_ctr++;
 }
+#else
+static void io_send(struct udevice *dev, uint size)
+{
+   uint k;
+   u16 buffer[HEADER_WORDS + 128];
+   struct io_generic_packet header = {
+   .source_address = 1,
+   .packet_type = 1,
+   .packet_length = size,
+   };
+   const uint words = (size + 1) / 2;
+
+   memcpy(buffer, , 2 * HEADER_WORDS);
+   for (k = 0; k < words; ++k)
+   buffer[k + HEADER_WORDS] = (2 * k + 1) + ((2 * k) << 8);
 
+   misc_write(dev, 0, buffer, HEADER_WORDS + words);
+
+   tx_ctr++;
+}
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
+
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
 static void io_receive(uint fpga)
 {
u16 rx_tx_status;
@@ -129,7 +202,17 @@ static void io_receive(uint fpga)
FPGA_GET_REG(fpga, ep.rx_tx_status, _tx_status);
}
 }
+#else
+static void io_receive(struct udevice *dev)
+{
+   u16 buffer[HEADER_WORDS + 128];
 
+   if (!misc_read(dev, 0, buffer, 0))
+   rx_ctr++;
+}
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
+
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
 static void io_reflect(uint fpga)
 {
u16 buffer[128];
@@ -159,7 +242,22 @@ static void io_reflect(uint fpga)
 
tx_ctr++;
 }
+#else
+static void io_reflect(struct udevice *dev)
+{
+   u16 buffer[HEADER_WORDS + 128];
+   struct io_generic_packet *header;
+
+   if (misc_read(dev, 0, buffer, 0))
+   return;
+
+   header = (struct io_generic_pac

[U-Boot] [PATCH 12/16] gdsys: ioep-fpga: Switch to gazerbeam-style reporting

2019-03-29 Thread Mario Six
Use a more extensive FPGA feature reporting style in the gdsys ioep-fpga
driver.

Signed-off-by: Mario Six 
---
 board/gdsys/common/ioep-fpga.c | 629 +
 1 file changed, 489 insertions(+), 140 deletions(-)

diff --git a/board/gdsys/common/ioep-fpga.c b/board/gdsys/common/ioep-fpga.c
index 91eec3ac7c1..066222c563d 100644
--- a/board/gdsys/common/ioep-fpga.c
+++ b/board/gdsys/common/ioep-fpga.c
@@ -10,231 +10,580 @@
 
 #include 
 
-enum {
-   UNITTYPE_MAIN_SERVER = 0,
-   UNITTYPE_MAIN_USER = 1,
-   UNITTYPE_VIDEO_SERVER = 2,
-   UNITTYPE_VIDEO_USER = 3,
+enum pcb_video_type {
+   PCB_DVI_SL,
+   PCB_DP_165MPIX,
+   PCB_DP_300MPIX,
+   PCB_HDMI,
+   PCB_DP_1_2,
+   PCB_HDMI_2_0,
 };
 
-enum {
-   UNITTYPEPCB_DVI = 0,
-   UNITTYPEPCB_DP_165 = 1,
-   UNITTYPEPCB_DP_300 = 2,
-   UNITTYPEPCB_HDMI = 3,
+enum pcb_transmission_type {
+   PCB_CAT_1G,
+   PCB_FIBER_3G,
+   PCB_CAT_10G,
+   PCB_FIBER_10G,
 };
 
-enum {
-   COMPRESSION_NONE = 0,
-   COMPRESSION_TYPE_1 = 1,
-   COMPRESSION_TYPE_1_2 = 3,
-   COMPRESSION_TYPE_1_2_3 = 7,
+enum carrier_speed {
+   CARRIER_SPEED_1G,
+   CARRIER_SPEED_3G,
+   CARRIER_SPEED_2_5G = CARRIER_SPEED_3G,
+   CARRIER_SPEED_10G,
 };
 
-enum {
-   AUDIO_NONE = 0,
-   AUDIO_TX = 1,
-   AUDIO_RX = 2,
-   AUDIO_RXTX = 3,
+enum ram_config {
+   RAM_DDR2_32BIT_295MBPS,
+   RAM_DDR3_32BIT_590MBPS,
+   RAM_DDR3_48BIT_590MBPS,
+   RAM_DDR3_64BIT_1800MBPS,
+   RAM_DDR3_48BIT_1800MBPS,
 };
 
-enum {
-   SYSCLK_147456 = 0,
+enum sysclock {
+   SYSCLK_147456,
 };
 
-enum {
-   RAM_DDR2_32 = 0,
-   RAM_DDR3_32 = 1,
-   RAM_DDR3_48 = 2,
+struct fpga_versions {
+   bool video_channel;
+   bool con_side;
+   enum pcb_video_type pcb_video_type;
+   enum pcb_transmission_type pcb_transmission_type;
+   unsigned int hw_version;
 };
 
-enum {
-   CARRIER_SPEED_1G = 0,
-   CARRIER_SPEED_2_5G = 1,
+struct fpga_features {
+   u8 video_channels;
+   u8 carriers;
+   enum carrier_speed carrier_speed;
+   enum ram_config ram_config;
+   enum sysclock sysclock;
+
+   bool pcm_tx;
+   bool pcm_rx;
+   bool spdif_tx;
+   bool spdif_rx;
+   bool usb2;
+   bool rs232;
+   bool compression_type1;
+   bool compression_type2;
+   bool compression_type3;
+   bool interlace;
+   bool osd;
+   bool compression_pipes;
 };
 
-bool ioep_fpga_has_osd(unsigned int fpga)
+#ifdef CONFIG_SYS_FPGA_FLAVOR_GAZERBEAM
+
+static int get_versions(unsigned int fpga, struct fpga_versions *versions)
 {
-   u16 fpga_features;
-   unsigned feature_osd;
+   enum {
+   VERSIONS_FPGA_VIDEO_CHANNEL = BIT(12),
+   VERSIONS_FPGA_CON_SIDE = BIT(13),
+   VERSIONS_FPGA_SC = BIT(14),
+   VERSIONS_PCB_CON = BIT(9),
+   VERSIONS_PCB_SC = BIT(8),
+   VERSIONS_PCB_VIDEO_MASK = 0x3 << 6,
+   VERSIONS_PCB_VIDEO_DP_1_2 = 0x0 << 6,
+   VERSIONS_PCB_VIDEO_HDMI_2_0 = 0x1 << 6,
+   VERSIONS_PCB_TRANSMISSION_MASK = 0x3 << 4,
+   VERSIONS_PCB_TRANSMISSION_FIBER_10G = 0x0 << 4,
+   VERSIONS_PCB_TRANSMISSION_CAT_10G = 0x1 << 4,
+   VERSIONS_PCB_TRANSMISSION_FIBER_3G = 0x2 << 4,
+   VERSIONS_PCB_TRANSMISSION_CAT_1G = 0x3 << 4,
+   VERSIONS_HW_VER_MASK = 0xf << 0,
+   };
+   u16 raw_versions;
+
+   memset(versions, 0, sizeof(struct fpga_versions));
+
+   FPGA_GET_REG(fpga, versions, _versions);
+
+   versions->video_channel = raw_versions & VERSIONS_FPGA_VIDEO_CHANNEL;
+   versions->con_side = raw_versions & VERSIONS_FPGA_CON_SIDE;
+
+   switch (raw_versions & VERSIONS_PCB_VIDEO_MASK) {
+   case VERSIONS_PCB_VIDEO_DP_1_2:
+   versions->pcb_video_type = PCB_DP_1_2;
+   break;
+
+   case VERSIONS_PCB_VIDEO_HDMI_2_0:
+   versions->pcb_video_type = PCB_HDMI_2_0;
+   break;
+   }
+
+   switch (raw_versions & VERSIONS_PCB_TRANSMISSION_MASK) {
+   case VERSIONS_PCB_TRANSMISSION_FIBER_10G:
+   versions->pcb_transmission_type = PCB_FIBER_10G;
+   break;
+
+   case VERSIONS_PCB_TRANSMISSION_CAT_10G:
+   versions->pcb_transmission_type = PCB_CAT_10G;
+   break;
+
+   case VERSIONS_PCB_TRANSMISSION_FIBER_3G:
+   versions->pcb_transmission_type = PCB_FIBER_3G;
+   break;
+
+   case VERSIONS_PCB_TRANSMISSION_CAT_1G:
+   versions->pcb_transmission_type = PCB_CAT_1G;
+   break;
+
+   }
 
-   FPGA_GET_REG(0, fpga_features, _features);
-   feature_osd = fpga_features & (1<<11);
+   versions->h

[U-Boot] [PATCH 15/16] gazerbeam: Add u-boot specific dts include file

2019-03-29 Thread Mario Six
Add a U-Boot specific dts file, which encapsulates the needed
modifications to the Gazerbeam Linux device tree.

Signed-off-by: Mario Six 
---
 arch/powerpc/dts/gazerbeam.dts  |   2 +
 arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi | 250 
 2 files changed, 252 insertions(+)
 create mode 100644 arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi

diff --git a/arch/powerpc/dts/gazerbeam.dts b/arch/powerpc/dts/gazerbeam.dts
index a4408c496c8..5d171519e01 100644
--- a/arch/powerpc/dts/gazerbeam.dts
+++ b/arch/powerpc/dts/gazerbeam.dts
@@ -598,3 +598,5 @@
};
 
 };
+
+#include "gdsys/gazerbeam-uboot.dtsi"
diff --git a/arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi 
b/arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi
new file mode 100644
index 000..1c4977f20f3
--- /dev/null
+++ b/arch/powerpc/dts/gdsys/gazerbeam-uboot.dtsi
@@ -0,0 +1,250 @@
+#include 
+#include 
+
+/ {
+   aliases {
+   i2c0 = 
+   i2c1 = 
+   i2c2 = "/fpga0bus/fpga0_iic_main";
+   i2c3 = "/fpga0bus/fpga0_iic_video0";
+   i2c4 = "/fpga0bus/fpga0_iic_video1";
+   i2c5 = "/fpga0bus/fpga0_iic_usb";
+   gdsys_soc0 = "/fpga0bus";
+   gdsys_soc1 = "/fpga1bus";
+   ioep0 = "/fpga0bus/fpga0_ep0";
+   ioep1 = "/fpga0bus/fpga1_ep0";
+   };
+
+   chosen {
+   stdout-path = 
+   };
+
+   cpus {
+   compatible = "cpu_bus";
+   u-boot,dm-pre-reloc;
+
+   PowerPC,8308@0 {
+   compatible = "fsl,mpc8308";
+   clocks = < MPC83XX_CLK_CORE
+  MPC83XX_CLK_CSB>;
+   u-boot,dm-pre-reloc;
+   };
+   };
+
+   board {
+   compatible = "gdsys,board_gazerbeam";
+   csb = <_soc>;
+   serdes = <>;
+   rxaui0 = <_0>;
+   rxaui1 = <_1>;
+   rxaui2 = <_2>;
+   rxaui3 = <_3>;
+   rxaui4 = <_0>;
+   rxaui5 = <_1>;
+   rxaui6 = <_2>;
+   rxaui7 = <_3>;
+   fpga0 = <>;
+   fpga1 = <>;
+   ioep0 = <>;
+   ioep1 = <>;
+
+   ver-gpios = < 12 0
+ 13 0
+ 14 0
+ 15 0>;
+
+   /* MC2/SC-Board */
+   var-gpios-mc2 = <_VB0 0 0/* VAR-MC_SC */
+_VB0 11 0>; /* VAR-CON */
+   /* MC4-Board */
+   var-gpios-mc4 = <_VB1 0 0/* VAR-MC_SC */
+_VB1 11 0>; /* VAR-CON */
+
+   reset-gpios = < 1 0  2 1>;
+   };
+
+   socclocks: clocks {
+   compatible = "fsl,mpc8308-clk";
+   #clock-cells = <1>;
+   u-boot,dm-pre-reloc;
+   };
+
+   timer {
+   compatible = "fsl,mpc83xx-timer";
+   clocks = < MPC83XX_CLK_CSB>;
+   };
+};
+
+ {
+   reset-gpios = < 26 0>;
+   done-gpios = <_VB0 19 0>;
+};
+
+ {
+   status = "disable";
+};
+
+ {
+   ranges = <0x0 0xe060 0x4000>;
+   fpga = <>;
+
+   fpga0_video0 {
+   mode = "640_480_60";
+
+   status = "disabled";
+   };
+
+   RXAUI0_0: fpga0_rxaui@fc0 {
+   compatible = "gdsys,rxaui_ctrl";
+   reg = <0x0fc0 0x10>;
+   };
+
+   fpga0_iic_video0  {
+   status = "disabled";
+   };
+
+   fpga0_axi_video0 {
+   status = "disabled";
+   };
+
+   fpga0_video1 {
+   mode = "640_480_60";
+   status = "disabled";
+   };
+
+   fpga0_iic_video1  {
+   status = "disabled";
+   };
+
+   fpga0_axi_video1 {
+   status = "disabled";
+   };
+
+   IOEP0: fpga0_ep0 {
+   };
+
+   RXAUI0_1: fpga0_rxaui@fd0 {
+   compatible = "gdsys,rxaui_ctrl";
+   reg = <0x0fd0 0x10>;
+   };
+
+   RXAUI0_2: fpga0_rxaui@fe0 {
+   compatible = "gdsys,rxaui_ctrl";
+   reg = <0x0fe0 0x10>;
+   };
+
+   RXAUI0_3: fpga0_rxaui@ff0 {
+   compatible = "gdsys,rxaui_ctrl";
+   reg = <0x0ff0 0x10>;
+   };
+};
+
+ {
+   ranges = <0x0 0xe070 0x4000>;
+   fpga = <>;
+
+   status = "disable";
+
+   fpga1_video0 {
+   mode = "

[U-Boot] [PATCH 10/16] gdsys: cmd_ioloop: Introduce commenting enum

2019-03-29 Thread Mario Six
Replace the boolean parameter of io_check_status that controls whether
the status is printed or not with a documenting enum.

Signed-off-by: Mario Six 
---
 board/gdsys/common/cmd_ioloop.c | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/board/gdsys/common/cmd_ioloop.c b/board/gdsys/common/cmd_ioloop.c
index a53c80c0add..8f70c1eda22 100644
--- a/board/gdsys/common/cmd_ioloop.c
+++ b/board/gdsys/common/cmd_ioloop.c
@@ -10,6 +10,11 @@
 
 #include 
 
+enum status_print_type {
+   STATUS_LOUD = 0,
+   STATUS_SILENT = 1,
+};
+
 enum {
STATE_TX_PACKET_BUILDING = BIT(0),
STATE_TX_TRANSMITTING = BIT(1),
@@ -52,7 +57,7 @@ unsigned long long rx_ctr;
 unsigned long long tx_ctr;
 unsigned long long err_ctr;
 
-static void io_check_status(uint fpga, u16 status, bool silent)
+static void io_check_status(uint fpga, u16 status, enum status_print_type type)
 {
u16 mask = STATE_RX_DIST_ERR | STATE_RX_LENGTH_ERR |
   STATE_RX_FRAME_CTR_ERR | STATE_RX_FCS_ERR |
@@ -66,7 +71,7 @@ static void io_check_status(uint fpga, u16 status, bool 
silent)
err_ctr++;
FPGA_SET_REG(fpga, ep.rx_tx_status, status);
 
-   if (silent)
+   if (type == STATUS_SILENT)
return;
 
if (status & STATE_RX_PACKET_DROPPED)
@@ -193,7 +198,7 @@ int do_ioreflect(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
FPGA_GET_REG(fpga, top_interrupt, _int);
FPGA_GET_REG(fpga, ep.rx_tx_status, _tx_status);
 
-   io_check_status(fpga, rx_tx_status, true);
+   io_check_status(fpga, rx_tx_status, STATUS_SILENT);
if ((top_int & IRQ_CPU_RECEIVE_DATA_AVAILABLE_STATUS) &&
(top_int & IRQ_CPU_TRANSMITBUFFER_FREE_STATUS))
io_reflect(fpga);
@@ -260,7 +265,7 @@ int do_ioloop(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
FPGA_GET_REG(fpga, top_interrupt, _int);
FPGA_GET_REG(fpga, ep.rx_tx_status, _tx_status);
 
-   io_check_status(fpga, rx_tx_status, false);
+   io_check_status(fpga, rx_tx_status, STATUS_LOUD);
if (top_int & IRQ_CPU_TRANSMITBUFFER_FREE_STATUS)
io_send(fpga, size);
if (top_int & IRQ_CPU_RECEIVE_DATA_AVAILABLE_STATUS)
-- 
2.20.1

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


[U-Boot] [PATCH 09/16] gdsys: cmd_ioloop: Fix style violations

2019-03-29 Thread Mario Six
Fix some style violations in the ioloop command, and make the code more
readable where possible.

Signed-off-by: Mario Six 
---
 board/gdsys/common/cmd_ioloop.c | 78 -
 1 file changed, 38 insertions(+), 40 deletions(-)

diff --git a/board/gdsys/common/cmd_ioloop.c b/board/gdsys/common/cmd_ioloop.c
index 8e2f4071ef7..a53c80c0add 100644
--- a/board/gdsys/common/cmd_ioloop.c
+++ b/board/gdsys/common/cmd_ioloop.c
@@ -11,33 +11,33 @@
 #include 
 
 enum {
-   STATE_TX_PACKET_BUILDING = 1<<0,
-   STATE_TX_TRANSMITTING = 1<<1,
-   STATE_TX_BUFFER_FULL = 1<<2,
-   STATE_TX_ERR = 1<<3,
-   STATE_RECEIVE_TIMEOUT = 1<<4,
-   STATE_PROC_RX_STORE_TIMEOUT = 1<<5,
-   STATE_PROC_RX_RECEIVE_TIMEOUT = 1<<6,
-   STATE_RX_DIST_ERR = 1<<7,
-   STATE_RX_LENGTH_ERR = 1<<8,
-   STATE_RX_FRAME_CTR_ERR = 1<<9,
-   STATE_RX_FCS_ERR = 1<<10,
-   STATE_RX_PACKET_DROPPED = 1<<11,
-   STATE_RX_DATA_LAST = 1<<12,
-   STATE_RX_DATA_FIRST = 1<<13,
-   STATE_RX_DATA_AVAILABLE = 1<<15,
+   STATE_TX_PACKET_BUILDING = BIT(0),
+   STATE_TX_TRANSMITTING = BIT(1),
+   STATE_TX_BUFFER_FULL = BIT(2),
+   STATE_TX_ERR = BIT(3),
+   STATE_RECEIVE_TIMEOUT = BIT(4),
+   STATE_PROC_RX_STORE_TIMEOUT = BIT(5),
+   STATE_PROC_RX_RECEIVE_TIMEOUT = BIT(6),
+   STATE_RX_DIST_ERR = BIT(7),
+   STATE_RX_LENGTH_ERR = BIT(8),
+   STATE_RX_FRAME_CTR_ERR = BIT(9),
+   STATE_RX_FCS_ERR = BIT(10),
+   STATE_RX_PACKET_DROPPED = BIT(11),
+   STATE_RX_DATA_LAST = BIT(12),
+   STATE_RX_DATA_FIRST = BIT(13),
+   STATE_RX_DATA_AVAILABLE = BIT(15),
 };
 
 enum {
-   CTRL_PROC_RECEIVE_ENABLE = 1<<12,
-   CTRL_FLUSH_TRANSMIT_BUFFER = 1<<15,
+   CTRL_PROC_RECEIVE_ENABLE = BIT(12),
+   CTRL_FLUSH_TRANSMIT_BUFFER = BIT(15),
 };
 
 enum {
-   IRQ_CPU_TRANSMITBUFFER_FREE_STATUS = 1<<5,
-   IRQ_CPU_PACKET_TRANSMITTED_EVENT = 1<<6,
-   IRQ_NEW_CPU_PACKET_RECEIVED_EVENT = 1<<7,
-   IRQ_CPU_RECEIVE_DATA_AVAILABLE_STATUS = 1<<8,
+   IRQ_CPU_TRANSMITBUFFER_FREE_STATUS = BIT(5),
+   IRQ_CPU_PACKET_TRANSMITTED_EVENT = BIT(6),
+   IRQ_NEW_CPU_PACKET_RECEIVED_EVENT = BIT(7),
+   IRQ_CPU_RECEIVE_DATA_AVAILABLE_STATUS = BIT(8),
 };
 
 struct io_generic_packet {
@@ -52,7 +52,7 @@ unsigned long long rx_ctr;
 unsigned long long tx_ctr;
 unsigned long long err_ctr;
 
-static void io_check_status(unsigned int fpga, u16 status, bool silent)
+static void io_check_status(uint fpga, u16 status, bool silent)
 {
u16 mask = STATE_RX_DIST_ERR | STATE_RX_LENGTH_ERR |
   STATE_RX_FRAME_CTR_ERR | STATE_RX_FCS_ERR |
@@ -85,9 +85,9 @@ static void io_check_status(unsigned int fpga, u16 status, 
bool silent)
printf("TX_ERR\n");
 }
 
-static void io_send(unsigned int fpga, unsigned int size)
+static void io_send(uint fpga, uint size)
 {
-   unsigned int k;
+   uint k;
struct io_generic_packet packet = {
.source_address = 1,
.packet_type = 1,
@@ -107,9 +107,8 @@ static void io_send(unsigned int fpga, unsigned int size)
tx_ctr++;
 }
 
-static void io_receive(unsigned int fpga)
+static void io_receive(uint fpga)
 {
-   unsigned int k = 0;
u16 rx_tx_status;
 
FPGA_GET_REG(fpga, ep.rx_tx_status, _tx_status);
@@ -123,17 +122,15 @@ static void io_receive(unsigned int fpga)
FPGA_GET_REG(fpga, ep.receive_data, );
 
FPGA_GET_REG(fpga, ep.rx_tx_status, _tx_status);
-
-   ++k;
}
 }
 
-static void io_reflect(unsigned int fpga)
+static void io_reflect(uint fpga)
 {
u16 buffer[128];
 
-   unsigned int k = 0;
-   unsigned int n;
+   uint k = 0;
+   uint n;
u16 rx_tx_status;
 
FPGA_GET_REG(fpga, ep.rx_tx_status, _tx_status);
@@ -166,8 +163,8 @@ static void io_reflect(unsigned int fpga)
  */
 int do_ioreflect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-   unsigned int fpga;
-   unsigned int rate = 0;
+   uint fpga;
+   uint rate = 0;
unsigned long long last_seen = 0;
 
if (argc < 2)
@@ -181,10 +178,10 @@ int do_ioreflect(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
if (argc > 2)
rate = simple_strtoul(argv[2], NULL, 10);
 
-   /* enable receive path */
+   /* Enable receive path */
FPGA_SET_REG(fpga, ep.rx_tx_control, CTRL_PROC_RECEIVE_ENABLE);
 
-   /* set device address to dummy 1*/
+   /* Set device address to dummy 1*/
FPGA_SET_REG(fpga, ep.device_address, 1);
 
rx_ctr = 0; tx_ctr = 0; err_ctr = 0;
@@ -215,18 +212,19 @@ int do_ioreflect(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
return 0;
 }
 
+#define DISP_LINE_LEN  16
+
 /*
  * FPGA

[U-Boot] [PATCH 06/16] gdsys: mpc8308: Don't use manual RAM config if RAM driver is active

2019-03-29 Thread Mario Six
The "manual" RAM configuration should not be used if the DM RAM driver
is active, hence, disable the code if the CONFIG_MPC83XX_SDRAM config
variable is defined.

Signed-off-by: Mario Six 
---
 board/gdsys/mpc8308/sdram.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/board/gdsys/mpc8308/sdram.c b/board/gdsys/mpc8308/sdram.c
index 3eb0e37b7b5..2a77fed2702 100644
--- a/board/gdsys/mpc8308/sdram.c
+++ b/board/gdsys/mpc8308/sdram.c
@@ -11,6 +11,8 @@
  * board\freescale\mpc8315erdb\sdram.c
  */
 
+#ifndef CONFIG_MPC83XX_SDRAM
+
 #include 
 #include 
 #include 
@@ -81,3 +83,5 @@ int dram_init(void)
 
return 0;
 }
+
+#endif /* !CONFIG_MPC83XX_SDRAM */
-- 
2.20.1

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


[U-Boot] [PATCH 07/16] gdsys: Introduce GDSYS_LEGACY_DRIVERS

2019-03-29 Thread Mario Six
Future gdsys boards will switch from the legacy drivers in board/gdsys/common
to DM-based drivers.

Define a Kconfig option that disables the legacy drivers.

Signed-off-by: Mario Six 
---
 board/gdsys/common/adv7611.c   |  4 
 board/gdsys/common/ch7301.c|  4 
 board/gdsys/common/dp501.c |  4 
 board/gdsys/common/fanctrl.c   |  4 
 board/gdsys/common/fpga.c  |  4 
 board/gdsys/common/ioep-fpga.c |  4 
 board/gdsys/common/mclink.c|  4 
 board/gdsys/common/osd.c   |  4 
 board/gdsys/mpc8308/Kconfig| 14 ++
 board/gdsys/mpc8308/mpc8308.c  |  2 ++
 board/gdsys/p1022/Kconfig  | 10 ++
 include/gdsys_fpga.h   |  2 ++
 12 files changed, 60 insertions(+)

diff --git a/board/gdsys/common/adv7611.c b/board/gdsys/common/adv7611.c
index c416bf1dc42..06cdc05825b 100644
--- a/board/gdsys/common/adv7611.c
+++ b/board/gdsys/common/adv7611.c
@@ -4,6 +4,8 @@
  * Dirk Eibach, Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
  */
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
 #include 
 #include 
 
@@ -174,3 +176,5 @@ out:
 
return res;
 }
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/ch7301.c b/board/gdsys/common/ch7301.c
index 1234149f42c..5e42467651d 100644
--- a/board/gdsys/common/ch7301.c
+++ b/board/gdsys/common/ch7301.c
@@ -6,6 +6,8 @@
 
 /* Chrontel CH7301C DVI Transmitter */
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
 #include 
 #include 
 #include 
@@ -61,3 +63,5 @@ int ch7301_probe(unsigned screen, bool power)
 
return 0;
 }
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/dp501.c b/board/gdsys/common/dp501.c
index 69d4b8c3334..9ca69ebcbbe 100644
--- a/board/gdsys/common/dp501.c
+++ b/board/gdsys/common/dp501.c
@@ -6,6 +6,8 @@
 
 /* Parade Technologies Inc. DP501 DisplayPort DVI/HDMI Transmitter */
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
 #include 
 #include 
 #include 
@@ -155,3 +157,5 @@ int dp501_probe(unsigned screen, bool power)
 
return 0;
 }
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/fanctrl.c b/board/gdsys/common/fanctrl.c
index 5e776831dbb..27c875cbec0 100644
--- a/board/gdsys/common/fanctrl.c
+++ b/board/gdsys/common/fanctrl.c
@@ -4,6 +4,8 @@
  * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
  */
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
 #include 
 #include 
 
@@ -29,3 +31,5 @@ void init_fan_controller(u8 addr)
val = i2c_reg_read(addr, FAN_CONFIG) | 0x04;
i2c_reg_write(addr, FAN_CONFIG, val);
 }
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/fpga.c b/board/gdsys/common/fpga.c
index f189e5fbd11..5ba6613ed56 100644
--- a/board/gdsys/common/fpga.c
+++ b/board/gdsys/common/fpga.c
@@ -4,6 +4,8 @@
  * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
  */
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
 #include 
 #include 
 
@@ -22,3 +24,5 @@ int fpga_get_reg(u32 fpga, u16 *reg, off_t regoff, u16 *data)
 
return 0;
 }
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/ioep-fpga.c b/board/gdsys/common/ioep-fpga.c
index 8e105012479..91eec3ac7c1 100644
--- a/board/gdsys/common/ioep-fpga.c
+++ b/board/gdsys/common/ioep-fpga.c
@@ -4,6 +4,8 @@
  * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
  */
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
 #include 
 
 #include 
@@ -234,3 +236,5 @@ void ioep_fpga_print_info(unsigned int fpga)
 
printf(", %d video channel(s)\n", feature_video_channels);
 }
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/mclink.c b/board/gdsys/common/mclink.c
index bf89d4e2920..c43d24b26d4 100644
--- a/board/gdsys/common/mclink.c
+++ b/board/gdsys/common/mclink.c
@@ -4,6 +4,8 @@
  * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
  */
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
 #include 
 #include 
 #include 
@@ -134,3 +136,5 @@ int mclink_receive(u8 slave, u16 addr, u16 *data)
 
return 0;
 }
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
diff --git a/board/gdsys/common/osd.c b/board/gdsys/common/osd.c
index 392d0059da8..10c43291469 100644
--- a/board/gdsys/common/osd.c
+++ b/board/gdsys/common/osd.c
@@ -4,6 +4,8 @@
  * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
  */
 
+#ifdef CONFIG_GDSYS_LEGACY_DRIVERS
+
 #include 
 #include 
 #include 
@@ -497,3 +499,5 @@ U_BOOT_CMD(
"size_x(max. " __stringify(MAX_X_CHARS)
") size_y(max. " __stringify(MAX_Y_CHARS) ")\n"
 );
+
+#endif /* CONFIG_GDSYS_LEGACY_DRIVERS */
\ No newline at end of file
diff --git a/board/gdsys/mpc8308/Kconfig b/board/gdsys/mpc8308/Kconfig
index cad458ac710..222ab0d20a3 100644
--- a/board/gdsys/mpc8308/Kconfig
+++ b/board/gdsys/mpc8308/Kconfig
@@ -4,6 +4,13 @@ config GDSYS_LEGACY_OSD_CMDS
  Use the 'osdw', 'osdp', and 'osdsize' legacy commands required by
  gdsys devices.
 
+config

[U-Boot] [PATCH 08/16] gdsys: mpc8308: Add FPGA flavor option

2019-03-29 Thread Mario Six
More recent versions of IHS FPGAs feature a different memory layout.

Add a Kconfig option to differentiate between the legacy layout, and the
new layout (which is used on the upcoming "Gazerbeam" and later boards).

Signed-off-by: Mario Six 
---
 board/gdsys/mpc8308/Kconfig | 20 
 1 file changed, 20 insertions(+)

diff --git a/board/gdsys/mpc8308/Kconfig b/board/gdsys/mpc8308/Kconfig
index 222ab0d20a3..e6a47960547 100644
--- a/board/gdsys/mpc8308/Kconfig
+++ b/board/gdsys/mpc8308/Kconfig
@@ -71,7 +71,27 @@ config GDSYS_LEGACY_DRIVERS
 
 endif
 
+if TARGET_HRCON || TARGET_STRIDER
+
+choice
+   prompt "FPGA flavor selection"
+
+config SYS_FPGA_FLAVOR_LEGACY
+   bool "Legacy flavor"
+   help
+ This enables support for the gdsys pre-Gazerbeam FPGA memory layout.
+
+config SYS_FPGA_FLAVOR_GAZERBEAM
+   bool "Gazerbeam flavor"
+   help
+ This enables support for the gdsys FPGA memory layout of the
+ Gazerbeam board.
+
+endchoice
+
 config CMD_IOLOOP
bool "Enable 'ioloop' and 'ioreflect' commands"
help
  These commands provide FPGA tests.
+
+endif
-- 
2.20.1

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


[U-Boot] [PATCH 05/16] gdsys: mpc8308: Migrate SYS_FPGA{0, 1}_{BASE, SIZE} to Kconfig

2019-03-29 Thread Mario Six
Move CONFIG_SYS_FPGA0_BASE, CONFIG_SYS_FPGA0_SIZE, CONFIG_SYS_FPGA1_BASE, and
CONFIG_SYS_FPGA1_SIZE to Kconfig.

Signed-off-by: Mario Six 
---
 board/gdsys/mpc8308/Kconfig | 22 ++
 include/configs/hrcon.h |  8 
 include/configs/strider.h   |  8 
 3 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/board/gdsys/mpc8308/Kconfig b/board/gdsys/mpc8308/Kconfig
index 9d99f686923..cad458ac710 100644
--- a/board/gdsys/mpc8308/Kconfig
+++ b/board/gdsys/mpc8308/Kconfig
@@ -4,6 +4,28 @@ config GDSYS_LEGACY_OSD_CMDS
  Use the 'osdw', 'osdp', and 'osdsize' legacy commands required by
  gdsys devices.
 
+config SYS_FPGA0_BASE
+   hex
+   default E060
+   help
+ The base address of the first FPGA's register map.
+
+config SYS_FPGA0_SIZE
+   hex
+   default 1
+   help
+ The base address of the first FPGA's register map.
+
+config SYS_FPGA1_BASE
+   hex
+   help
+ The base address of the second FPGA's register map.
+
+config SYS_FPGA1_SIZE
+   hex
+   help
+ The base address of the second FPGA's register map.
+
 if TARGET_HRCON
 
 config SYS_BOARD
diff --git a/include/configs/hrcon.h b/include/configs/hrcon.h
index 8029ae9dd75..6e6c1714ce9 100644
--- a/include/configs/hrcon.h
+++ b/include/configs/hrcon.h
@@ -129,14 +129,6 @@
 #define CONFIG_SYS_FLASH_ERASE_TOUT6 /* Flash Erase Timeout (ms) */
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Flash Write Timeout (ms) */
 
-/*
- * FPGA
- */
-#define CONFIG_SYS_FPGA0_BASE  0xE060
-#define CONFIG_SYS_FPGA0_SIZE  1 /* FPGA size is 1M */
-
-
-#define CONFIG_SYS_FPGA_BASE(k)CONFIG_SYS_FPGA0_BASE
 #define CONFIG_SYS_FPGA_DONE(k)0x0010
 
 #define CONFIG_SYS_FPGA_COUNT  1
diff --git a/include/configs/strider.h b/include/configs/strider.h
index 22d255aabb8..8b942e3446a 100644
--- a/include/configs/strider.h
+++ b/include/configs/strider.h
@@ -127,14 +127,6 @@
 #define CONFIG_SYS_FLASH_ERASE_TOUT6 /* Flash Erase Timeout (ms) */
 #define CONFIG_SYS_FLASH_WRITE_TOUT500 /* Flash Write Timeout (ms) */
 
-/*
- * FPGA
- */
-#define CONFIG_SYS_FPGA0_BASE  0xE060
-#define CONFIG_SYS_FPGA0_SIZE  1 /* FPGA size is 1M */
-
-
-#define CONFIG_SYS_FPGA_BASE(k)CONFIG_SYS_FPGA0_BASE
 #define CONFIG_SYS_FPGA_DONE(k)0x0010
 
 #define CONFIG_SYS_FPGA_COUNT  1
-- 
2.20.1

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


[U-Boot] [PATCH 04/16] gdsys: mpc8308: Use shadow register for output GPIO values

2019-03-29 Thread Mario Six
Since the gpio output status on MPC8xxx cannot be read back, it has to
be buffered locally.

Signed-off-by: Dirk Eibach 
Signed-off-by: Mario Six 
---
 board/gdsys/mpc8308/hrcon.c   |  4 ++--
 board/gdsys/mpc8308/mpc8308.c | 19 +++
 board/gdsys/mpc8308/mpc8308.h |  3 +++
 board/gdsys/mpc8308/strider.c |  2 +-
 4 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/board/gdsys/mpc8308/hrcon.c b/board/gdsys/mpc8308/hrcon.c
index 79e3b25de8c..d14a28ec94d 100644
--- a/board/gdsys/mpc8308/hrcon.c
+++ b/board/gdsys/mpc8308/hrcon.c
@@ -287,8 +287,8 @@ void mpc8308_setup_hw(void)
/*
 * set "startup-finished"-gpios
 */
-   setbits_be32(>gpio[0].dir, (BIT(31 - 11) | BIT(31 - 12)));
-   setbits_be32(>gpio[0].dat, BIT(31 - 12));
+   setbits_be32(>gpio[0].dir, BIT(31 - 11) | BIT(31 - 12));
+   setbits_gpio0_out(BIT(31 - 12));
 }
 
 int mpc8308_get_fpga_done(uint fpga)
diff --git a/board/gdsys/mpc8308/mpc8308.c b/board/gdsys/mpc8308/mpc8308.c
index 9fe1d66c605..a53135b8fd0 100644
--- a/board/gdsys/mpc8308/mpc8308.c
+++ b/board/gdsys/mpc8308/mpc8308.c
@@ -24,6 +24,25 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* as gpio output status cannot be read back, we have to buffer it locally */
+u32 gpio0_out;
+
+void setbits_gpio0_out(u32 mask)
+{
+   immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+
+   gpio0_out |= mask;
+   out_be32(>gpio[0].dat, gpio0_out);
+}
+
+void clrbits_gpio0_out(u32 mask)
+{
+   immap_t *immr = (immap_t *)CONFIG_SYS_IMMR;
+
+   gpio0_out &= ~mask;
+   out_be32(>gpio[0].dat, gpio0_out);
+}
+
 int get_fpga_state(uint dev)
 {
return gd->arch.fpga_state[dev];
diff --git a/board/gdsys/mpc8308/mpc8308.h b/board/gdsys/mpc8308/mpc8308.h
index dc07d564eb5..1e4f24fb2ae 100644
--- a/board/gdsys/mpc8308/mpc8308.h
+++ b/board/gdsys/mpc8308/mpc8308.h
@@ -1,6 +1,9 @@
 #ifndef __MPC8308_H_
 #define __MPC8308_H_
 
+void setbits_gpio0_out(u32 mask);
+void clrbits_gpio0_out(u32 mask);
+
 /* functions to be provided by board implementation */
 void mpc8308_init(void);
 void mpc8308_set_fpga_reset(unsigned state);
diff --git a/board/gdsys/mpc8308/strider.c b/board/gdsys/mpc8308/strider.c
index b1997f453ae..1fdea675bda 100644
--- a/board/gdsys/mpc8308/strider.c
+++ b/board/gdsys/mpc8308/strider.c
@@ -343,7 +343,7 @@ void mpc8308_setup_hw(void)
 * set "startup-finished"-gpios
 */
setbits_be32(>gpio[0].dir, BIT(31 - 11) | BIT(31 - 12));
-   setbits_be32(>gpio[0].dat, BIT(31 - 12));
+   setbits_gpio0_out(BIT(31 - 12));
 }
 
 int mpc8308_get_fpga_done(uint fpga)
-- 
2.20.1

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


[U-Boot] [PATCH 03/16] gdsys: mpc8308: Fix style violations

2019-03-29 Thread Mario Six
Fix some style violations in the gdsys MPC8308 board files, and make the
code more readable.

Signed-off-by: Mario Six 
---
 board/gdsys/mpc8308/hrcon.c   | 55 ++-
 board/gdsys/mpc8308/mpc8308.c | 12 
 board/gdsys/mpc8308/strider.c | 49 ---
 3 files changed, 59 insertions(+), 57 deletions(-)

diff --git a/board/gdsys/mpc8308/hrcon.c b/board/gdsys/mpc8308/hrcon.c
index 2d709dee945..79e3b25de8c 100644
--- a/board/gdsys/mpc8308/hrcon.c
+++ b/board/gdsys/mpc8308/hrcon.c
@@ -35,11 +35,11 @@
 #define MAX_MUX_CHANNELS 2
 
 enum {
-   MCFPGA_DONE = 1 << 0,
-   MCFPGA_INIT_N = 1 << 1,
-   MCFPGA_PROGRAM_N = 1 << 2,
-   MCFPGA_UPDATE_ENABLE_N = 1 << 3,
-   MCFPGA_RESET_N = 1 << 4,
+   MCFPGA_DONE = BIT(0),
+   MCFPGA_INIT_N = BIT(1),
+   MCFPGA_PROGRAM_N = BIT(2),
+   MCFPGA_UPDATE_ENABLE_N = BIT(3),
+   MCFPGA_RESET_N = BIT(4),
 };
 
 enum {
@@ -47,7 +47,7 @@ enum {
GPIO_MDIO = 1 << 15,
 };
 
-unsigned int mclink_fpgacount;
+uint mclink_fpgacount;
 struct ihs_fpga *fpga_ptr[] = CONFIG_SYS_FPGA_PTR;
 
 struct {
@@ -107,7 +107,7 @@ int checkboard(void)
 
printf("HRCon %s", hw_type_cat ? "CAT" : "Fiber");
 
-   if (s != NULL) {
+   if (s) {
puts(", serial# ");
puts(s);
}
@@ -120,12 +120,11 @@ int checkboard(void)
 int last_stage_init(void)
 {
int slaves;
-   unsigned int k;
-   unsigned int mux_ch;
-   unsigned char mclink_controllers[] = { 0x3c, 0x3d, 0x3e };
+   uint k;
+   uchar mclink_controllers[] = { 0x3c, 0x3d, 0x3e };
u16 fpga_features;
bool hw_type_cat = pca9698_get_value(0x20, 20);
-   bool ch0_rgmii2_present = false;
+   bool ch0_rgmii2_present;
 
FPGA_GET_REG(0, fpga_features, _features);
 
@@ -137,16 +136,16 @@ int last_stage_init(void)
 
/* wait for FPGA done, then reset FPGA */
for (k = 0; k < ARRAY_SIZE(mclink_controllers); ++k) {
-   unsigned int ctr = 0;
+   uint ctr = 0;
 
if (i2c_probe(mclink_controllers[k]))
continue;
 
while (!(pca953x_get_val(mclink_controllers[k])
   & MCFPGA_DONE)) {
-   udelay(10);
+   mdelay(100);
if (ctr++ > 5) {
-   printf("no done for mclink_controller %d\n", k);
+   printf("no done for mclink_controller %u\n", k);
break;
}
}
@@ -159,8 +158,10 @@ int last_stage_init(void)
}
 
if (hw_type_cat) {
+   uint mux_ch;
int retval;
struct mii_dev *mdiodev = mdio_alloc();
+
if (!mdiodev)
return -ENOMEM;
strncpy(mdiodev->name, bb_miiphy_buses[0].name, MDIO_NAME_LEN);
@@ -179,7 +180,7 @@ int last_stage_init(void)
}
 
/* give slave-PLLs and Parade DP501 some time to be up and running */
-   udelay(50);
+   mdelay(500);
 
mclink_fpgacount = CONFIG_SYS_MCLINK_MAX;
slaves = mclink_probe();
@@ -207,6 +208,7 @@ int last_stage_init(void)
if (hw_type_cat) {
int retval;
struct mii_dev *mdiodev = mdio_alloc();
+
if (!mdiodev)
return -ENOMEM;
strncpy(mdiodev->name, bb_miiphy_buses[k].name,
@@ -233,17 +235,17 @@ int last_stage_init(void)
  * provide access to fpga gpios and controls (for I2C bitbang)
  * (these may look all too simple but make iocon.h much more readable)
  */
-void fpga_gpio_set(unsigned int bus, int pin)
+void fpga_gpio_set(uint bus, int pin)
 {
FPGA_SET_REG(bus >= 4 ? (bus - 4) : bus, gpio.set, pin);
 }
 
-void fpga_gpio_clear(unsigned int bus, int pin)
+void fpga_gpio_clear(uint bus, int pin)
 {
FPGA_SET_REG(bus >= 4 ? (bus - 4) : bus, gpio.clear, pin);
 }
 
-int fpga_gpio_get(unsigned int bus, int pin)
+int fpga_gpio_get(uint bus, int pin)
 {
u16 val;
 
@@ -252,7 +254,7 @@ int fpga_gpio_get(unsigned int bus, int pin)
return val & pin;
 }
 
-void fpga_control_set(unsigned int bus, int pin)
+void fpga_control_set(uint bus, int pin)
 {
u16 val;
 
@@ -260,7 +262,7 @@ void fpga_control_set(unsigned int bus, int pin)
FPGA_SET_REG(bus >= 4 ? (bus - 4) : bus, control, val | pin);
 }
 
-void fpga_control_clear(unsigned int bus, int pin)
+void fpga_control_clear(uint bus, int pin)
 {
u16 val;
 
@@ -273,7 +275,7 @@ void mpc8308_init(void)
pca9698_direction_output(0x20, 4, 1);
 }
 
-void mpc8308_set_fpga_reset(unsigned state)
+void mpc8308_set_fpg

[U-Boot] [PATCH 02/16] gdsys: Post ppc4xx removal cleanup

2019-03-29 Thread Mario Six
The ppc4xx architecture was removed, and with it several old gdsys 44x
boards, but some "debris" from these purged boards was left over.

This patch removes these remnants (mostly entries in Makefiles, some now
superfluous data structures and some now obsolete config variables from
the whitelist).

Signed-off-by: Mario Six 
---
 board/gdsys/common/Makefile   |   4 --
 board/gdsys/common/miiphybb.c | 127 --
 include/gdsys_fpga.h  |  96 -
 3 files changed, 227 deletions(-)
 delete mode 100644 board/gdsys/common/miiphybb.c

diff --git a/board/gdsys/common/Makefile b/board/gdsys/common/Makefile
index 9090933e345..ff8d6f49665 100644
--- a/board/gdsys/common/Makefile
+++ b/board/gdsys/common/Makefile
@@ -5,10 +5,6 @@
 
 obj-$(CONFIG_SYS_FPGA_COMMON) += fpga.o
 obj-$(CONFIG_CMD_IOLOOP) += cmd_ioloop.o
-obj-$(CONFIG_IO) += miiphybb.o
-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_TARGET_HRCON) += osd.o mclink.o dp501.o phy.o ioep-fpga.o 
fanctrl.o
 obj-$(CONFIG_TARGET_STRIDER) += mclink.o dp501.o phy.o ioep-fpga.o adv7611.o 
ch7301.o
diff --git a/board/gdsys/common/miiphybb.c b/board/gdsys/common/miiphybb.c
deleted file mode 100644
index 042835d6af6..000
--- a/board/gdsys/common/miiphybb.c
+++ /dev/null
@@ -1,127 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2010
- * Dirk Eibach,  Guntermann & Drunck GmbH, dirk.eib...@gdsys.cc
- */
-
-#include 
-#include 
-
-#include 
-
-struct io_bb_pinset {
-   int mdio;
-   int mdc;
-};
-
-static int io_bb_mii_init(struct bb_miiphy_bus *bus)
-{
-   return 0;
-}
-
-static int io_bb_mdio_active(struct bb_miiphy_bus *bus)
-{
-   struct io_bb_pinset *pins = bus->priv;
-
-   out_be32((void *)GPIO0_TCR,
-   in_be32((void *)GPIO0_TCR) | pins->mdio);
-
-   return 0;
-}
-
-static int io_bb_mdio_tristate(struct bb_miiphy_bus *bus)
-{
-   struct io_bb_pinset *pins = bus->priv;
-
-   out_be32((void *)GPIO0_TCR,
-   in_be32((void *)GPIO0_TCR) & ~pins->mdio);
-
-   return 0;
-}
-
-static int io_bb_set_mdio(struct bb_miiphy_bus *bus, int v)
-{
-   struct io_bb_pinset *pins = bus->priv;
-
-   if (v)
-   out_be32((void *)GPIO0_OR,
-   in_be32((void *)GPIO0_OR) | pins->mdio);
-   else
-   out_be32((void *)GPIO0_OR,
-   in_be32((void *)GPIO0_OR) & ~pins->mdio);
-
-   return 0;
-}
-
-static int io_bb_get_mdio(struct bb_miiphy_bus *bus, int *v)
-{
-   struct io_bb_pinset *pins = bus->priv;
-
-   *v = ((in_be32((void *)GPIO0_IR) & pins->mdio) != 0);
-
-   return 0;
-}
-
-static int io_bb_set_mdc(struct bb_miiphy_bus *bus, int v)
-{
-   struct io_bb_pinset *pins = bus->priv;
-
-   if (v)
-   out_be32((void *)GPIO0_OR,
-   in_be32((void *)GPIO0_OR) | pins->mdc);
-   else
-   out_be32((void *)GPIO0_OR,
-   in_be32((void *)GPIO0_OR) & ~pins->mdc);
-
-   return 0;
-}
-
-static int io_bb_delay(struct bb_miiphy_bus *bus)
-{
-   udelay(1);
-
-   return 0;
-}
-
-struct io_bb_pinset io_bb_pinsets[] = {
-   {
-   .mdio = CONFIG_SYS_MDIO_PIN,
-   .mdc = CONFIG_SYS_MDC_PIN,
-   },
-#ifdef CONFIG_SYS_GBIT_MII1_BUSNAME
-   {
-   .mdio = CONFIG_SYS_MDIO1_PIN,
-   .mdc = CONFIG_SYS_MDC1_PIN,
-   },
-#endif
-};
-
-struct bb_miiphy_bus bb_miiphy_buses[] = {
-   {
-   .name = CONFIG_SYS_GBIT_MII_BUSNAME,
-   .init = io_bb_mii_init,
-   .mdio_active = io_bb_mdio_active,
-   .mdio_tristate = io_bb_mdio_tristate,
-   .set_mdio = io_bb_set_mdio,
-   .get_mdio = io_bb_get_mdio,
-   .set_mdc = io_bb_set_mdc,
-   .delay = io_bb_delay,
-   .priv = _bb_pinsets[0],
-   },
-#ifdef CONFIG_SYS_GBIT_MII1_BUSNAME
-   {
-   .name = CONFIG_SYS_GBIT_MII1_BUSNAME,
-   .init = io_bb_mii_init,
-   .mdio_active = io_bb_mdio_active,
-   .mdio_tristate = io_bb_mdio_tristate,
-   .set_mdio = io_bb_set_mdio,
-   .get_mdio = io_bb_get_mdio,
-   .set_mdc = io_bb_set_mdc,
-   .delay = io_bb_delay,
-   .priv = _bb_pinsets[1],
-   },
-#endif
-};
-
-int bb_miiphy_buses_num = sizeof(bb_miiphy_buses) /
- sizeof(bb_miiphy_buses[0]);
diff --git a/include/gdsys_fpga.h b/include/gdsys_fpga.h
index e9fb4b88b5e..eae67012622 100644
--- a/include/gdsys_fpga.h
+++ b/include/gdsys_fpga.h
@@ -86,81 +86,6 @@ struct ihs_fpga {
 };
 #endif
 
-#ifdef CONFIG_IO
-struct ihs_fpga {
-   u16 reflection_low; /* 

[U-Boot] [PATCH 01/16] gdsys: phy: Adapt fixup_88e1518() to latest Release Notes

2019-03-29 Thread Mario Six
From: Dirk Eibach 

The initialization sequence in the newest release notes of the 88e1518
phy omits two commands.

Remove them from the sequence.

Signed-off-by: Dirk Eibach 
---
 board/gdsys/common/phy.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/board/gdsys/common/phy.c b/board/gdsys/common/phy.c
index c4b2256da3a..d40c08d9e94 100644
--- a/board/gdsys/common/phy.c
+++ b/board/gdsys/common/phy.c
@@ -45,8 +45,6 @@ struct mii_setupcmd fixup_88e1518[] = {
{ MIICMD_SET, 16, 0x214d },
{ MIICMD_SET, 17, 0xcc0c },
{ MIICMD_SET, 16, 0x2159 },
-   { MIICMD_SET, 22, 0x00fb },
-   { MIICMD_SET,  7, 0xc00d },
{ MIICMD_SET, 22, 0x },
 };
 
-- 
2.20.1

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


Re: [U-Boot] [PATCH] ihs_mdio: Use new regmap interface

2019-03-29 Thread Mario Six
On Thu, Jan 31, 2019 at 11:04 AM Simon Glass  wrote:
>
> On Mon, 28 Jan 2019 at 01:49, Mario Six  wrote:
> >
> > For the DM case, use the proper parameter for the regmap_init_mem call
> > (which is the ofnode, not the udevice).
> >
> > Signed-off-by: Mario Six 
> > ---
> >  board/gdsys/common/ihs_mdio.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
>
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [PATCH 2/2] gdsys_rxaui_ctrl: Use new regmap interface

2019-03-29 Thread Mario Six
On Mon, Jan 28, 2019 at 9:48 AM Mario Six  wrote:
>
> For the DM case, use the proper parameter for the regmap_init_mem call
> (which is the ofnode, not the udevice).
>
> Signed-off-by: Mario Six 
> ---
>  drivers/misc/gdsys_rxaui_ctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/gdsys_rxaui_ctrl.c b/drivers/misc/gdsys_rxaui_ctrl.c
> index f2c955b13d7..c56abce4d4c 100644
> --- a/drivers/misc/gdsys_rxaui_ctrl.c
> +++ b/drivers/misc/gdsys_rxaui_ctrl.c
> @@ -59,7 +59,7 @@ int gdsys_rxaui_ctrl_probe(struct udevice *dev)
>  {
> struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
>
> -   regmap_init_mem(dev, >map);
> +   regmap_init_mem(dev_ofnode(dev), >map);
>
> priv->state = false;
>
> --
> 2.20.1
>
>

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


Re: [U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state

2019-03-29 Thread Mario Six
On Mon, Jan 28, 2019 at 9:48 AM Mario Six  wrote:
>
> Make the gdsys_rxaui_ctrl polarity setting function return the old
> state to comply with the API requirements.
>
> Signed-off-by: Mario Six 
> ---
>  drivers/misc/gdsys_rxaui_ctrl.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/gdsys_rxaui_ctrl.c b/drivers/misc/gdsys_rxaui_ctrl.c
> index 9a63c329bcd..f2c955b13d7 100644
> --- a/drivers/misc/gdsys_rxaui_ctrl.c
> +++ b/drivers/misc/gdsys_rxaui_ctrl.c
> @@ -29,6 +29,7 @@ struct gdsys_rxaui_ctrl_regs {
>
>  struct gdsys_rxaui_ctrl_priv {
> struct regmap *map;
> +   bool state;
>  };
>
>  int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, bool val)
> @@ -36,6 +37,8 @@ int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, 
> bool val)
> struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
> u16 state;
>
> +   priv->state = !priv->state;
> +
> rxaui_ctrl_get(priv->map, ctrl_1, );
>
> if (val)
> @@ -45,7 +48,7 @@ int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, 
> bool val)
>
> rxaui_ctrl_set(priv->map, ctrl_1, state);
>
> -   return 0;
> +   return !priv->state;
>  }
>
>  static const struct misc_ops gdsys_rxaui_ctrl_ops = {
> @@ -58,6 +61,8 @@ int gdsys_rxaui_ctrl_probe(struct udevice *dev)
>
> regmap_init_mem(dev, >map);
>
> +   priv->state = false;
> +
> return 0;
>  }
>
> --
> 2.20.1
>
>

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


Re: [U-Boot] [PATCH 2/2] i2c: ihs: Improve error handling

2019-03-29 Thread Mario Six
On Thu, Feb 7, 2019 at 6:26 AM Heiko Schocher  wrote:
>
> Hello Mario,
>
> Am 28.01.2019 um 09:45 schrieb Mario Six:
> > Improve the error handling and reporting of the IHS I2C driver.
> >
> > Signed-off-by: Mario Six 
> > ---
> >   drivers/i2c/ihs_i2c.c | 67 +++
> >   1 file changed, 43 insertions(+), 24 deletions(-)
>
> Reviewed-by: Heiko Schocher 
>
> Thanks!
>
> 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
>

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


Re: [U-Boot] [PATCH 1/2] i2c: ihs: Get rid of fpgamap

2019-03-29 Thread Mario Six
On Thu, Feb 7, 2019 at 6:24 AM Heiko Schocher  wrote:
>
> Hello Mario,
>
> Am 28.01.2019 um 09:45 schrieb Mario Six:
> > Since the IHS I2C driver want upstream, the surrounding infrastructure
> > has changed quite a bit (notably, the fpgamap driver was replaced with a
> > regmap driver).
> >
> > Update the driver to work with these changes.
> >
> > Signed-off-by: Mario Six 
> > ---
> >   drivers/i2c/ihs_i2c.c | 57 +--
> >   1 file changed, 23 insertions(+), 34 deletions(-)
>
> Just one nitpick ... what happens if regmap_set/get
> return with an error, I see no error handling ...
> (But in the old version there is also none, so may this
>   can/should be added in a second step)
>
> Reviewed-by: Heiko Schocher 
>
> Thanks!
>
> This patch is assigned to you, so it is fine for me, if you
> pick it up.
>
> 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
>

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


Re: [U-Boot] [PATCH 2/2] cmd: binop: Use hex2bin

2019-03-29 Thread Mario Six
On Thu, Jan 31, 2019 at 11:04 AM Simon Glass  wrote:
>
> On Mon, 28 Jan 2019 at 01:44, Mario Six  wrote:
> >
> > Use the new hex2bin function in the binop command instead of converting
> > the data manually.
> >
> > Signed-off-by: Mario Six 
> > ---
> >  cmd/binop.c | 28 +++-
> >  1 file changed, 3 insertions(+), 25 deletions(-)
>
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [PATCH 1/2] cmd: binop: Use new environment api

2019-03-29 Thread Mario Six
On Thu, Jan 31, 2019 at 11:05 AM Simon Glass  wrote:
>
> On Mon, 28 Jan 2019 at 01:44, Mario Six  wrote:
> >
> > Since the binop command was introduced, the environment API was changed.
> > Use the new API to make the command work again.
> >
> > Signed-off-by: Mario Six 
> > ---
> >  cmd/binop.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
>
> Reviewed-by: Simon Glass 

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


Re: [U-Boot] [PATCH] mpc83xx_clk: Add enable method

2019-03-29 Thread Mario Six
On Mon, Jan 28, 2019 at 9:41 AM Mario Six  wrote:
>
> Some DM drivers have hardcoded clk_enable calls when handling
> clocks (for example the fsl_esdhc driver).
>
> To work with these drivers, add an enable method to the MCP83xx clock
> driver (which does nothing, because the clocks are always enabled).
>
> Signed-off-by: Mario Six 
> ---
>  drivers/clk/mpc83xx_clk.c | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/clk/mpc83xx_clk.c b/drivers/clk/mpc83xx_clk.c
> index 489004190eb..32d2db9edad 100644
> --- a/drivers/clk/mpc83xx_clk.c
> +++ b/drivers/clk/mpc83xx_clk.c
> @@ -275,6 +275,12 @@ static ulong mpc83xx_clk_get_rate(struct clk *clk)
> return priv->speed[clk->id];
>  }
>
> +static int mpc83xx_clk_enable(struct clk *clk)
> +{
> +   /* MPC83xx clocks are always enabled */
> +   return 0;
> +}
> +
>  int get_clocks(void)
>  {
> /* Empty implementation to keep the prototype in common.h happy */
> @@ -301,6 +307,7 @@ int get_serial_clock(void)
>  const struct clk_ops mpc83xx_clk_ops = {
> .request = mpc83xx_clk_request,
> .get_rate = mpc83xx_clk_get_rate,
> +   .enable = mpc83xx_clk_enable,
>  };
>
>  static const struct udevice_id mpc83xx_clk_match[] = {
> --
> 2.20.1
>
>

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


Re: [U-Boot] [PATCH] mpc83xx: Define _end symbol

2019-03-29 Thread Mario Six
On Mon, Jan 28, 2019 at 9:37 AM Mario Six  wrote:
>
> To support OF_EMBED, the MPC83xx architecture has to define the "_end"
> symbol to correctly access the appended DT.
>
> Fortunately, MPC8xx already defines the symbol, and the linker script is
> quite similar to that of MPC83xx, so copy this approach for MPC83xx.
>
> Signed-off-by: Mario Six 
> ---
>  arch/powerpc/cpu/mpc83xx/u-boot.lds | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/arch/powerpc/cpu/mpc83xx/u-boot.lds 
> b/arch/powerpc/cpu/mpc83xx/u-boot.lds
> index 37a13fd8c2a..d10f528da4c 100644
> --- a/arch/powerpc/cpu/mpc83xx/u-boot.lds
> +++ b/arch/powerpc/cpu/mpc83xx/u-boot.lds
> @@ -52,6 +52,12 @@ SECTIONS
>__ex_table : { *(__ex_table) }
>__stop___ex_table = .;
>
> +  /*
> +   * _end - This is end of u-boot.bin image.
> +   * dtb will be appended here to make u-boot-dtb.bin
> +   */
> +  _end = .;
> +
>. = ALIGN(4096);
>__init_begin = .;
>.text.init : { *(.text.init) }
> --
> 2.20.1
>
> ___
>

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


Re: [U-Boot] [PATCH] powerpc: Simplify processor.h

2019-03-29 Thread Mario Six
On Mon, Jan 28, 2019 at 9:34 AM Mario Six  wrote:
>
> Lots of stuff in processor.h was taken verbatim from the Linux kernel.
> It was never synced, so most of it was removed or changed in the kernel
> since it was imported.
>
> Remove all the stuff that is unused in the current U-Boot sources;
> should anybody feel the need to re-sync with the kernel, they can do it
> later on.
>
> Signed-off-by: Mario Six 
> ---
>  arch/powerpc/include/asm/processor.h | 120 ---
>  1 file changed, 120 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/processor.h 
> b/arch/powerpc/include/asm/processor.h
> index f97ce48cc27..e03ab21f59d 100644
> --- a/arch/powerpc/include/asm/processor.h
> +++ b/arch/powerpc/include/asm/processor.h
> @@ -1203,127 +1203,7 @@ int fsl_qoriq_dsp_core_to_cluster(unsigned int core);
>  #endif
>  #endif
>
> -
> -/* what kind of prep workstation we are */
> -extern int _prep_type;
> -/*
> - * This is used to identify the board type from a given PReP board
> - * vendor. Board revision is also made available.
> - */
> -extern unsigned char ucSystemType;
> -extern unsigned char ucBoardRev;
> -extern unsigned char ucBoardRevMaj, ucBoardRevMin;
> -
>  struct task_struct;
> -void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
> -void release_thread(struct task_struct *);
> -
> -/*
> - * Create a new kernel thread.
> - */
> -extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
> -
> -/*
> - * Bus types
> - */
> -#define EISA_bus 0
> -#define EISA_bus__is_a_macro /* for versions in ksyms.c */
> -#define MCA_bus 0
> -#define MCA_bus__is_a_macro /* for versions in ksyms.c */
> -
> -/* Lazy FPU handling on uni-processor */
> -extern struct task_struct *last_task_used_math;
> -extern struct task_struct *last_task_used_altivec;
> -
> -/*
> - * this is the minimum allowable io space due to the location
> - * of the io areas on prep (first one at 0x8000) but
> - * as soon as I get around to remapping the io areas with the BATs
> - * to match the mac we can raise this. -- Cort
> - */
> -#define TASK_SIZE  (0x8000UL)
> -
> -/* This decides where the kernel will search for a free chunk of vm
> - * space during mmap's.
> - */
> -#define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3)
> -
> -typedef struct {
> -   unsigned long seg;
> -} mm_segment_t;
> -
> -struct thread_struct {
> -   unsigned long   ksp;/* Kernel stack pointer */
> -   unsigned long   wchan;  /* Event task is sleeping on */
> -   struct pt_regs  *regs;  /* Pointer to saved register state */
> -   mm_segment_tfs; /* for get_fs() validation */
> -   void*pgdir; /* root of page-table tree */
> -   signed long last_syscall;
> -   double  fpr[32];/* Complete floating point set */
> -   unsigned long   fpscr_pad;  /* fpr ... fpscr must be contiguous */
> -   unsigned long   fpscr;  /* Floating point status */
> -#ifdef CONFIG_ALTIVEC
> -   vector128   vr[32]; /* Complete AltiVec set */
> -   vector128   vscr;   /* AltiVec status */
> -   unsigned long   vrsave;
> -#endif /* CONFIG_ALTIVEC */
> -};
> -
> -#define INIT_SP(sizeof(init_stack) + (unsigned long) 
> _stack)
> -
> -#define INIT_THREAD  { \
> -   INIT_SP, /* ksp */ \
> -   0, /* wchan */ \
> -   (struct pt_regs *)INIT_SP - 1, /* regs */ \
> -   KERNEL_DS, /*fs*/ \
> -   swapper_pg_dir, /* pgdir */ \
> -   0, /* last_syscall */ \
> -   {0}, 0, 0 \
> -}
> -
> -/*
> - * Note: the vm_start and vm_end fields here should *not*
> - * be in kernel space. (Could vm_end == vm_start perhaps?)
> - */
> -#define INIT_MMAP { _mm, 0, 0x1000, NULL, \
> -   PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, \
> -   1, NULL, NULL }
> -
> -/*
> - * Return saved PC of a blocked thread. For now, this is the "user" PC
> - */
> -static inline unsigned long thread_saved_pc(struct thread_struct *t)
> -{
> -   return (t->regs) ? t->regs->nip : 0;
> -}
> -
> -#define copy_segments(tsk, mm) do { } while (0)
> -#define release_segments(mm)   do { } while (0)
> -#define forget_segments()  do { } while (0)
> -
> -unsigned long get_wchan(struct task_struct *p);
> -
> -#define KSTK_EIP(tsk)  ((tsk)->thread.regs->nip)
> -#define KSTK_ESP(tsk)  ((tsk)->thread.regs->gpr[1])
> -
> -/*
> - * NOTE! The task struct and the stack go together
> - */
> 

Re: [U-Boot] [PATCH v3 01/60] mpc83xx: Introduce ARCH_MPC830*

2019-02-07 Thread Mario Six
On Mon, Jan 28, 2019 at 9:13 AM Mario Six  wrote:
>
> Hi York,
> On Tue, Jan 22, 2019 at 5:17 PM York Sun  wrote:
> >
> > On 1/21/19 12:19 AM, Mario Six wrote:
> > > Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options.
> > >
> > > Signed-off-by: Mario Six 
> > >
> > > ---
> >
> > I browse through the entire patch set. The patches look good. Since NXP
> > doesn't make new mpc83xx SoCs and I have no board to verify, I don't
> > comment on specific changes.
> >
> > There were many config macros which have been replace with hard-coded
> > value inline by you. That's OK. The original plan was to allow different
> > config but that didn't happen mostly.
> >
>
> Sounds good. Thanks for reviewing!
>
> > York
> >
> Best regards,
> Mario

Whole series applied to u-boot/mpc83xx/next.

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


[U-Boot] [PATCH] ihs_video_out: Fix error handling

2019-01-28 Thread Mario Six
The ihs_video_out driver's error handling is incorrect in two places
(one is a missing negation, and in one place a error should be ignored).

Fix these two instances.

Signed-off-by: Mario Six 
---
 drivers/video/ihs_video_out.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/ihs_video_out.c b/drivers/video/ihs_video_out.c
index 5cdf17aec14..0af7c2bf44a 100644
--- a/drivers/video/ihs_video_out.c
+++ b/drivers/video/ihs_video_out.c
@@ -238,8 +238,8 @@ int ihs_video_out_probe(struct udevice *dev)
int res;
 
res = regmap_init_mem(dev_ofnode(dev), >map);
-   if (!res) {
-   debug("%s: Could initialize regmap (err = %d)\n", dev->name,
+   if (res) {
+   debug("%s: Could not initialize regmap (err = %d)\n", dev->name,
  res);
return res;
}
@@ -322,7 +322,7 @@ int ihs_video_out_probe(struct udevice *dev)
}
 
res = display_enable(priv->video_tx, 8, );
-   if (res) {
+   if (res && res != -EIO) { /* Ignore missing DP sink error */
debug("%s: Could not enable the display (err = %d)\n",
  dev->name, res);
return res;
-- 
2.20.1

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


[U-Boot] [PATCH] ihs_mdio: Use new regmap interface

2019-01-28 Thread Mario Six
For the DM case, use the proper parameter for the regmap_init_mem call
(which is the ofnode, not the udevice).

Signed-off-by: Mario Six 
---
 board/gdsys/common/ihs_mdio.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/board/gdsys/common/ihs_mdio.c b/board/gdsys/common/ihs_mdio.c
index b17e8db91bf..f160a57cc2d 100644
--- a/board/gdsys/common/ihs_mdio.c
+++ b/board/gdsys/common/ihs_mdio.c
@@ -11,6 +11,7 @@
 #include 
 #else
 #include 
+#include 
 #include 
 #endif
 
@@ -28,7 +29,7 @@ static inline u16 read_reg(struct udevice *fpga, uint base, 
uint addr)
struct regmap *map;
u8 *ptr;
 
-   regmap_init_mem(fpga, );
+   regmap_init_mem(dev_ofnode(fpga), );
ptr = regmap_get_range(map, 0);
 
return in_le16((u16 *)(ptr + base + addr));
@@ -40,7 +41,7 @@ static inline void write_reg(struct udevice *fpga, uint base, 
uint addr,
struct regmap *map;
u8 *ptr;
 
-   regmap_init_mem(fpga, );
+   regmap_init_mem(dev_ofnode(fpga), );
ptr = regmap_get_range(map, 0);
 
out_le16((u16 *)(ptr + base + addr), val);
-- 
2.20.1

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


[U-Boot] [PATCH 2/2] gdsys_rxaui_ctrl: Use new regmap interface

2019-01-28 Thread Mario Six
For the DM case, use the proper parameter for the regmap_init_mem call
(which is the ofnode, not the udevice).

Signed-off-by: Mario Six 
---
 drivers/misc/gdsys_rxaui_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/gdsys_rxaui_ctrl.c b/drivers/misc/gdsys_rxaui_ctrl.c
index f2c955b13d7..c56abce4d4c 100644
--- a/drivers/misc/gdsys_rxaui_ctrl.c
+++ b/drivers/misc/gdsys_rxaui_ctrl.c
@@ -59,7 +59,7 @@ int gdsys_rxaui_ctrl_probe(struct udevice *dev)
 {
struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
 
-   regmap_init_mem(dev, >map);
+   regmap_init_mem(dev_ofnode(dev), >map);
 
priv->state = false;
 
-- 
2.20.1

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


[U-Boot] [PATCH 1/2] gdsys_rxaui_ctrl: Return old state

2019-01-28 Thread Mario Six
Make the gdsys_rxaui_ctrl polarity setting function return the old
state to comply with the API requirements.

Signed-off-by: Mario Six 
---
 drivers/misc/gdsys_rxaui_ctrl.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/gdsys_rxaui_ctrl.c b/drivers/misc/gdsys_rxaui_ctrl.c
index 9a63c329bcd..f2c955b13d7 100644
--- a/drivers/misc/gdsys_rxaui_ctrl.c
+++ b/drivers/misc/gdsys_rxaui_ctrl.c
@@ -29,6 +29,7 @@ struct gdsys_rxaui_ctrl_regs {
 
 struct gdsys_rxaui_ctrl_priv {
struct regmap *map;
+   bool state;
 };
 
 int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, bool val)
@@ -36,6 +37,8 @@ int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, 
bool val)
struct gdsys_rxaui_ctrl_priv *priv = dev_get_priv(dev);
u16 state;
 
+   priv->state = !priv->state;
+
rxaui_ctrl_get(priv->map, ctrl_1, );
 
if (val)
@@ -45,7 +48,7 @@ int gdsys_rxaui_set_polarity_inversion(struct udevice *dev, 
bool val)
 
rxaui_ctrl_set(priv->map, ctrl_1, state);
 
-   return 0;
+   return !priv->state;
 }
 
 static const struct misc_ops gdsys_rxaui_ctrl_ops = {
@@ -58,6 +61,8 @@ int gdsys_rxaui_ctrl_probe(struct udevice *dev)
 
regmap_init_mem(dev, >map);
 
+   priv->state = false;
+
return 0;
 }
 
-- 
2.20.1

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


[U-Boot] [PATCH 2/2] i2c: ihs: Improve error handling

2019-01-28 Thread Mario Six
Improve the error handling and reporting of the IHS I2C driver.

Signed-off-by: Mario Six 
---
 drivers/i2c/ihs_i2c.c | 67 +++
 1 file changed, 43 insertions(+), 24 deletions(-)

diff --git a/drivers/i2c/ihs_i2c.c b/drivers/i2c/ihs_i2c.c
index 5313490bf3a..f7b59d36f98 100644
--- a/drivers/i2c/ihs_i2c.c
+++ b/drivers/i2c/ihs_i2c.c
@@ -108,8 +108,10 @@ static int wait_for_int(bool read)
while (!(val & (I2CINT_ERROR_EV
   | (read ? I2CINT_RECEIVE_EV : I2CINT_TRANSMIT_EV {
udelay(10);
-   if (ctr++ > 5000)
-   return 1;
+   if (ctr++ > 5000) {
+   debug("%s: timed out\n", __func__);
+   return -ETIMEDOUT;
+   }
 #ifdef CONFIG_DM_I2C
ihs_i2c_get(priv->map, interrupt_status, );
 #else
@@ -117,7 +119,7 @@ static int wait_for_int(bool read)
 #endif
}
 
-   return (val & I2CINT_ERROR_EV) ? 1 : 0;
+   return (val & I2CINT_ERROR_EV) ? -EIO : 0;
 }
 
 #ifdef CONFIG_DM_I2C
@@ -130,6 +132,7 @@ static int ihs_i2c_transfer(uchar chip, uchar *buffer, int 
len, bool read,
 {
u16 val;
u16 data;
+   int res;
 #ifdef CONFIG_DM_I2C
struct ihs_i2c_priv *priv = dev_get_priv(dev);
 #endif
@@ -170,11 +173,16 @@ static int ihs_i2c_transfer(uchar chip, uchar *buffer, 
int len, bool read,
 #endif
 
 #ifdef CONFIG_DM_I2C
-   if (wait_for_int(dev, read))
+   res = wait_for_int(dev, read);
 #else
-   if (wait_for_int(read))
+   res = wait_for_int(read);
 #endif
-   return 1;
+   if (res) {
+   if (res == -ETIMEDOUT)
+   debug("%s: time out while waiting for event\n", 
__func__);
+
+   return res;
+   }
 
/* If we want to read, get the bytes from the mailbox */
if (read) {
@@ -198,19 +206,21 @@ static int ihs_i2c_send_buffer(uchar chip, u8 *data, int 
len, bool hold_bus,
   int read)
 #endif
 {
+   int res;
+
while (len) {
int transfer = min(len, 2);
bool is_last = len <= transfer;
 
 #ifdef CONFIG_DM_I2C
-   if (ihs_i2c_transfer(dev, chip, data, transfer, read,
-hold_bus ? false : is_last))
-   return 1;
+   res = ihs_i2c_transfer(dev, chip, data, transfer, read,
+  hold_bus ? false : is_last);
 #else
-   if (ihs_i2c_transfer(chip, data, transfer, read,
-hold_bus ? false : is_last))
-   return 1;
+   res = ihs_i2c_transfer(chip, data, transfer, read,
+  hold_bus ? false : is_last);
 #endif
+   if (res)
+   return res;
 
data += transfer;
len -= transfer;
@@ -241,14 +251,19 @@ static int ihs_i2c_access(struct i2c_adapter *adap, uchar 
chip, u8 *addr,
  int alen, uchar *buffer, int len, int read)
 #endif
 {
+   int res;
+
/* Don't hold the bus if length of data to send/receive is zero */
+   if (len <= 0)
+   return -EINVAL;
+
 #ifdef CONFIG_DM_I2C
-   if (len <= 0 || ihs_i2c_address(dev, chip, addr, alen, len))
-   return 1;
+   res = ihs_i2c_address(dev, chip, addr, alen, len);
 #else
-   if (len <= 0 || ihs_i2c_address(chip, addr, alen, len))
-   return 1;
+   res = ihs_i2c_address(chip, addr, alen, len);
 #endif
+   if (res)
+   return res;
 
 #ifdef CONFIG_DM_I2C
return ihs_i2c_send_buffer(dev, chip, buffer, len, false, read);
@@ -273,7 +288,7 @@ static int ihs_i2c_set_bus_speed(struct udevice *bus, uint 
speed)
struct ihs_i2c_priv *priv = dev_get_priv(bus);
 
if (speed != priv->speed && priv->speed != 0)
-   return 1;
+   return -EINVAL;
 
priv->speed = speed;
 
@@ -290,8 +305,8 @@ static int ihs_i2c_xfer(struct udevice *bus, struct i2c_msg 
*msg, int nmsgs)
 * actucal data) or one message (just data)
 */
if (nmsgs > 2 || nmsgs == 0) {
-   debug("%s: Only one or two messages are supported.", __func__);
-   return -1;
+   debug("%s: Only one or two messages are supported\n", __func__);
+   return -ENOTSUPP;
}
 
omsg = nmsgs == 1 ?  : msg;
@@ -311,9 +326,11 @@ static int ihs_i2c_probe_chip(struct udevice *bus, u32 
chip_addr,
  u32 chip_flags)
 {
uchar buffer[2];
+   int res;
 
-   if (ihs_i2c_transfer(bus, chip_addr, buffer, 0, I2COP_READ, true))
-   return 1;
+   res = ihs_i2c_transfer(bus, chip_addr, buffer, 0, I2COP_READ, true);
+  

[U-Boot] [PATCH 1/2] i2c: ihs: Get rid of fpgamap

2019-01-28 Thread Mario Six
Since the IHS I2C driver want upstream, the surrounding infrastructure
has changed quite a bit (notably, the fpgamap driver was replaced with a
regmap driver).

Update the driver to work with these changes.

Signed-off-by: Mario Six 
---
 drivers/i2c/ihs_i2c.c | 57 +--
 1 file changed, 23 insertions(+), 34 deletions(-)

diff --git a/drivers/i2c/ihs_i2c.c b/drivers/i2c/ihs_i2c.c
index 0922fe9bb10..5313490bf3a 100644
--- a/drivers/i2c/ihs_i2c.c
+++ b/drivers/i2c/ihs_i2c.c
@@ -8,8 +8,7 @@
 #include 
 #ifdef CONFIG_DM_I2C
 #include 
-#include 
-#include "../misc/gdsys_soc.h"
+#include 
 #else
 #include 
 #endif
@@ -18,18 +17,24 @@
 #ifdef CONFIG_DM_I2C
 struct ihs_i2c_priv {
uint speed;
-   phys_addr_t addr;
+   struct regmap *map;
 };
 
-enum {
-   REG_INTERRUPT_STATUS = 0x00,
-   REG_INTERRUPT_ENABLE_CONTROL = 0x02,
-   REG_WRITE_MAILBOX_EXT = 0x04,
-   REG_WRITE_MAILBOX = 0x06,
-   REG_READ_MAILBOX_EXT = 0x08,
-   REG_READ_MAILBOX = 0x0A,
+struct ihs_i2c_regs {
+   u16 interrupt_status;
+   u16 interrupt_enable_control;
+   u16 write_mailbox_ext;
+   u16 write_mailbox;
+   u16 read_mailbox_ext;
+   u16 read_mailbox;
 };
 
+#define ihs_i2c_set(map, member, val) \
+   regmap_set(map, struct ihs_i2c_regs, member, val)
+
+#define ihs_i2c_get(map, member, valp) \
+   regmap_get(map, struct ihs_i2c_regs, member, valp)
+
 #else /* !CONFIG_DM_I2C */
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -92,14 +97,10 @@ static int wait_for_int(bool read)
uint ctr = 0;
 #ifdef CONFIG_DM_I2C
struct ihs_i2c_priv *priv = dev_get_priv(dev);
-   struct udevice *fpga;
-
-   gdsys_soc_get_fpga(dev, );
 #endif
 
 #ifdef CONFIG_DM_I2C
-   fpgamap_read(fpga, priv->addr + REG_INTERRUPT_STATUS, ,
-FPGAMAP_SIZE_16);
+   ihs_i2c_get(priv->map, interrupt_status, );
 #else
I2C_GET_REG(interrupt_status, );
 #endif
@@ -110,8 +111,7 @@ static int wait_for_int(bool read)
if (ctr++ > 5000)
return 1;
 #ifdef CONFIG_DM_I2C
-   fpgamap_read(fpga, priv->addr + REG_INTERRUPT_STATUS, ,
-FPGAMAP_SIZE_16);
+   ihs_i2c_get(priv->map, interrupt_status, );
 #else
I2C_GET_REG(interrupt_status, );
 #endif
@@ -132,18 +132,13 @@ static int ihs_i2c_transfer(uchar chip, uchar *buffer, 
int len, bool read,
u16 data;
 #ifdef CONFIG_DM_I2C
struct ihs_i2c_priv *priv = dev_get_priv(dev);
-   struct udevice *fpga;
-
-   gdsys_soc_get_fpga(dev, );
 #endif
 
/* Clear interrupt status */
data = I2CINT_ERROR_EV | I2CINT_RECEIVE_EV | I2CINT_TRANSMIT_EV;
 #ifdef CONFIG_DM_I2C
-   fpgamap_write(fpga, priv->addr + REG_INTERRUPT_STATUS, ,
- FPGAMAP_SIZE_16);
-   fpgamap_read(fpga, priv->addr + REG_INTERRUPT_STATUS, ,
-FPGAMAP_SIZE_16);
+   ihs_i2c_set(priv->map, interrupt_status, data);
+   ihs_i2c_get(priv->map, interrupt_status, );
 #else
I2C_SET_REG(interrupt_status, data);
I2C_GET_REG(interrupt_status, );
@@ -156,8 +151,7 @@ static int ihs_i2c_transfer(uchar chip, uchar *buffer, int 
len, bool read,
if (len > 1)
val |= buffer[1] << 8;
 #ifdef CONFIG_DM_I2C
-   fpgamap_write(fpga, priv->addr + REG_WRITE_MAILBOX_EXT, ,
- FPGAMAP_SIZE_16);
+   ihs_i2c_set(priv->map, write_mailbox_ext, val);
 #else
I2C_SET_REG(write_mailbox_ext, val);
 #endif
@@ -170,8 +164,7 @@ static int ihs_i2c_transfer(uchar chip, uchar *buffer, int 
len, bool read,
   | (is_last ? 0 : I2CMB_HOLD_BUS);
 
 #ifdef CONFIG_DM_I2C
-   fpgamap_write(fpga, priv->addr + REG_WRITE_MAILBOX, ,
- FPGAMAP_SIZE_16);
+   ihs_i2c_set(priv->map, write_mailbox, data);
 #else
I2C_SET_REG(write_mailbox, data);
 #endif
@@ -186,8 +179,7 @@ static int ihs_i2c_transfer(uchar chip, uchar *buffer, int 
len, bool read,
/* If we want to read, get the bytes from the mailbox */
if (read) {
 #ifdef CONFIG_DM_I2C
-   fpgamap_read(fpga, priv->addr + REG_READ_MAILBOX_EXT, ,
-FPGAMAP_SIZE_16);
+   ihs_i2c_get(priv->map, read_mailbox_ext, );
 #else
I2C_GET_REG(read_mailbox_ext, );
 #endif
@@ -270,11 +262,8 @@ static int ihs_i2c_access(struct i2c_adapter *adap, uchar 
chip, u8 *addr,
 int ihs_i2c_probe(struct udevice *bus)
 {
struct ihs_i2c_priv *priv = dev_get_priv(bus);
-   int addr;
-
-   addr = dev_read_u32_default(bus, "reg", -1);
 
-   priv->addr = addr;
+   regmap_init_mem(dev_ofnode(bus), >map);
 
return 0;
 }
-- 
2.20.1

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


[U-Boot] [PATCH 2/2] cmd: binop: Use hex2bin

2019-01-28 Thread Mario Six
Use the new hex2bin function in the binop command instead of converting
the data manually.

Signed-off-by: Mario Six 
---
 cmd/binop.c | 28 +++-
 1 file changed, 3 insertions(+), 25 deletions(-)

diff --git a/cmd/binop.c b/cmd/binop.c
index be780bffd7b..116a2c0d554 100644
--- a/cmd/binop.c
+++ b/cmd/binop.c
@@ -2,6 +2,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -31,38 +32,15 @@ void write_to_env_var(char *varname, u8 *result, ulong len)
free(str_output);
 }
 
-void decode_hexstring(char *hexstr, u8 *result)
-{
-   int i;
-   int acc = 0;
-
-   for (i = 0; i < strlen(hexstr); ++i) {
-   char d = hexstr[i];
-   int value;
-
-   if (isdigit(d))
-   value = (d - '0');
-   else
-   value = (islower(d) ? toupper(d) : d) - 'A' + 10;
-
-   if (i % 2 == 0) {
-   acc = value * 16;
-   } else {
-   result[i / 2] = acc + value;
-   acc = 0;
-   }
-   }
-}
-
 void read_from_env_var(char *varname, u8 *result)
 {
char *str_value;
 
str_value = env_get(varname);
if (str_value)
-   decode_hexstring(str_value, result);
+   hex2bin(result, str_value, strlen(str_value) / 2);
else
-   decode_hexstring(varname, result);
+   hex2bin(result, varname, strlen(varname) / 2);
 }
 
 void read_from_mem(ulong addr, u8 *result, ulong len)
-- 
2.20.1

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


[U-Boot] [PATCH 1/2] cmd: binop: Use new environment api

2019-01-28 Thread Mario Six
Since the binop command was introduced, the environment API was changed.
Use the new API to make the command work again.

Signed-off-by: Mario Six 
---
 cmd/binop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/binop.c b/cmd/binop.c
index 787f7a26ead..be780bffd7b 100644
--- a/cmd/binop.c
+++ b/cmd/binop.c
@@ -26,7 +26,7 @@ void write_to_env_var(char *varname, u8 *result, ulong len)
str_ptr += 2;
}
*str_ptr = '\0';
-   setenv(varname, str_output);
+   env_set(varname, str_output);
 
free(str_output);
 }
@@ -58,7 +58,7 @@ void read_from_env_var(char *varname, u8 *result)
 {
char *str_value;
 
-   str_value = getenv(varname);
+   str_value = env_get(varname);
if (str_value)
decode_hexstring(str_value, result);
else
-- 
2.20.1

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


[U-Boot] [PATCH] mpc83xx_clk: Add enable method

2019-01-28 Thread Mario Six
Some DM drivers have hardcoded clk_enable calls when handling
clocks (for example the fsl_esdhc driver).

To work with these drivers, add an enable method to the MCP83xx clock
driver (which does nothing, because the clocks are always enabled).

Signed-off-by: Mario Six 
---
 drivers/clk/mpc83xx_clk.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/clk/mpc83xx_clk.c b/drivers/clk/mpc83xx_clk.c
index 489004190eb..32d2db9edad 100644
--- a/drivers/clk/mpc83xx_clk.c
+++ b/drivers/clk/mpc83xx_clk.c
@@ -275,6 +275,12 @@ static ulong mpc83xx_clk_get_rate(struct clk *clk)
return priv->speed[clk->id];
 }
 
+static int mpc83xx_clk_enable(struct clk *clk)
+{
+   /* MPC83xx clocks are always enabled */
+   return 0;
+}
+
 int get_clocks(void)
 {
/* Empty implementation to keep the prototype in common.h happy */
@@ -301,6 +307,7 @@ int get_serial_clock(void)
 const struct clk_ops mpc83xx_clk_ops = {
.request = mpc83xx_clk_request,
.get_rate = mpc83xx_clk_get_rate,
+   .enable = mpc83xx_clk_enable,
 };
 
 static const struct udevice_id mpc83xx_clk_match[] = {
-- 
2.20.1

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


[U-Boot] [PATCH] mpc83xx: Define _end symbol

2019-01-28 Thread Mario Six
To support OF_EMBED, the MPC83xx architecture has to define the "_end"
symbol to correctly access the appended DT.

Fortunately, MPC8xx already defines the symbol, and the linker script is
quite similar to that of MPC83xx, so copy this approach for MPC83xx.

Signed-off-by: Mario Six 
---
 arch/powerpc/cpu/mpc83xx/u-boot.lds | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/cpu/mpc83xx/u-boot.lds 
b/arch/powerpc/cpu/mpc83xx/u-boot.lds
index 37a13fd8c2a..d10f528da4c 100644
--- a/arch/powerpc/cpu/mpc83xx/u-boot.lds
+++ b/arch/powerpc/cpu/mpc83xx/u-boot.lds
@@ -52,6 +52,12 @@ SECTIONS
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
 
+  /*
+   * _end - This is end of u-boot.bin image.
+   * dtb will be appended here to make u-boot-dtb.bin
+   */
+  _end = .;
+
   . = ALIGN(4096);
   __init_begin = .;
   .text.init : { *(.text.init) }
-- 
2.20.1

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


[U-Boot] [PATCH] powerpc: Simplify processor.h

2019-01-28 Thread Mario Six
Lots of stuff in processor.h was taken verbatim from the Linux kernel.
It was never synced, so most of it was removed or changed in the kernel
since it was imported.

Remove all the stuff that is unused in the current U-Boot sources;
should anybody feel the need to re-sync with the kernel, they can do it
later on.

Signed-off-by: Mario Six 
---
 arch/powerpc/include/asm/processor.h | 120 ---
 1 file changed, 120 deletions(-)

diff --git a/arch/powerpc/include/asm/processor.h 
b/arch/powerpc/include/asm/processor.h
index f97ce48cc27..e03ab21f59d 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -1203,127 +1203,7 @@ int fsl_qoriq_dsp_core_to_cluster(unsigned int core);
 #endif
 #endif
 
-
-/* what kind of prep workstation we are */
-extern int _prep_type;
-/*
- * This is used to identify the board type from a given PReP board
- * vendor. Board revision is also made available.
- */
-extern unsigned char ucSystemType;
-extern unsigned char ucBoardRev;
-extern unsigned char ucBoardRevMaj, ucBoardRevMin;
-
 struct task_struct;
-void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
-void release_thread(struct task_struct *);
-
-/*
- * Create a new kernel thread.
- */
-extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
-
-/*
- * Bus types
- */
-#define EISA_bus 0
-#define EISA_bus__is_a_macro /* for versions in ksyms.c */
-#define MCA_bus 0
-#define MCA_bus__is_a_macro /* for versions in ksyms.c */
-
-/* Lazy FPU handling on uni-processor */
-extern struct task_struct *last_task_used_math;
-extern struct task_struct *last_task_used_altivec;
-
-/*
- * this is the minimum allowable io space due to the location
- * of the io areas on prep (first one at 0x8000) but
- * as soon as I get around to remapping the io areas with the BATs
- * to match the mac we can raise this. -- Cort
- */
-#define TASK_SIZE  (0x8000UL)
-
-/* This decides where the kernel will search for a free chunk of vm
- * space during mmap's.
- */
-#define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3)
-
-typedef struct {
-   unsigned long seg;
-} mm_segment_t;
-
-struct thread_struct {
-   unsigned long   ksp;/* Kernel stack pointer */
-   unsigned long   wchan;  /* Event task is sleeping on */
-   struct pt_regs  *regs;  /* Pointer to saved register state */
-   mm_segment_tfs; /* for get_fs() validation */
-   void*pgdir; /* root of page-table tree */
-   signed long last_syscall;
-   double  fpr[32];/* Complete floating point set */
-   unsigned long   fpscr_pad;  /* fpr ... fpscr must be contiguous */
-   unsigned long   fpscr;  /* Floating point status */
-#ifdef CONFIG_ALTIVEC
-   vector128   vr[32]; /* Complete AltiVec set */
-   vector128   vscr;   /* AltiVec status */
-   unsigned long   vrsave;
-#endif /* CONFIG_ALTIVEC */
-};
-
-#define INIT_SP(sizeof(init_stack) + (unsigned long) 
_stack)
-
-#define INIT_THREAD  { \
-   INIT_SP, /* ksp */ \
-   0, /* wchan */ \
-   (struct pt_regs *)INIT_SP - 1, /* regs */ \
-   KERNEL_DS, /*fs*/ \
-   swapper_pg_dir, /* pgdir */ \
-   0, /* last_syscall */ \
-   {0}, 0, 0 \
-}
-
-/*
- * Note: the vm_start and vm_end fields here should *not*
- * be in kernel space. (Could vm_end == vm_start perhaps?)
- */
-#define INIT_MMAP { _mm, 0, 0x1000, NULL, \
-   PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, \
-   1, NULL, NULL }
-
-/*
- * Return saved PC of a blocked thread. For now, this is the "user" PC
- */
-static inline unsigned long thread_saved_pc(struct thread_struct *t)
-{
-   return (t->regs) ? t->regs->nip : 0;
-}
-
-#define copy_segments(tsk, mm) do { } while (0)
-#define release_segments(mm)   do { } while (0)
-#define forget_segments()  do { } while (0)
-
-unsigned long get_wchan(struct task_struct *p);
-
-#define KSTK_EIP(tsk)  ((tsk)->thread.regs->nip)
-#define KSTK_ESP(tsk)  ((tsk)->thread.regs->gpr[1])
-
-/*
- * NOTE! The task struct and the stack go together
- */
-#define THREAD_SIZE (2*PAGE_SIZE)
-#define alloc_task_struct() \
-   ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
-#define free_task_struct(p)free_pages((unsigned long)(p),1)
-#define get_task_struct(tsk) atomic_inc(_map[MAP_NR(tsk)].count)
-
-/* in process.c - for early bootup debug -- Cort */
-int ll_printk(const char *, ...);
-void ll_puts(const char *);
-
-#define init_task  (init_task_union.task)
-#define init_stack (init_task_union.stack)
-
-/* In misc.c */
-void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
 
 #ifndef CONFIG_CPU_MPC83XX
 int prt_83xx_rsr(void);
-- 
2.20.1

___
U-Boot mailing list
U-Boot@list

Re: [U-Boot] [PATCH v3 01/60] mpc83xx: Introduce ARCH_MPC830*

2019-01-28 Thread Mario Six
Hi York,
On Tue, Jan 22, 2019 at 5:17 PM York Sun  wrote:
>
> On 1/21/19 12:19 AM, Mario Six wrote:
> > Replace CONFIG_MPC830* with proper CONFIG_ARCH_MPC830* Kconfig options.
> >
> > Signed-off-by: Mario Six 
> >
> > ---
>
> I browse through the entire patch set. The patches look good. Since NXP
> doesn't make new mpc83xx SoCs and I have no board to verify, I don't
> comment on specific changes.
>
> There were many config macros which have been replace with hard-coded
> value inline by you. That's OK. The original plan was to allow different
> config but that didn't happen mostly.
>

Sounds good. Thanks for reviewing!

> York
>
Best regards,
Mario
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 60/60] keymile: Factor out common includes again

2019-01-21 Thread Mario Six
Not that the Kconfig conversion of a lot of variables is done, we can
factor out the common include files for the keymile boards again (which
now contain hardly any #ifdef logic at all).

Signed-off-by: Mario Six 

---

v2 -> v3:
New in v3

---
 include/configs/km/km-mpc8309.h | 137 +
 include/configs/km/km-mpc832x.h |  91 +
 include/configs/km/km-mpc8360.h |  91 +
 include/configs/km/km-mpc83xx.h | 160 +++
 include/configs/kmcoge5ne.h | 262 +
 include/configs/kmeter1.h   | 258 +
 include/configs/kmopti2.h   | 286 +--
 include/configs/kmsupx5.h   | 277 +-
 include/configs/kmtegr1.h   | 331 +--
 include/configs/kmtepr2.h   | 278 +-
 include/configs/kmvect1.h   | 332 +---
 include/configs/suvd3.h | 278 +-
 include/configs/tuge1.h | 277 +-
 include/configs/tuxx1.h | 278 +-
 14 files changed, 500 insertions(+), 2836 deletions(-)
 create mode 100644 include/configs/km/km-mpc8309.h
 create mode 100644 include/configs/km/km-mpc832x.h
 create mode 100644 include/configs/km/km-mpc8360.h
 create mode 100644 include/configs/km/km-mpc83xx.h

diff --git a/include/configs/km/km-mpc8309.h b/include/configs/km/km-mpc8309.h
new file mode 100644
index 000..e89b7af0610
--- /dev/null
+++ b/include/configs/km/km-mpc8309.h
@@ -0,0 +1,137 @@
+/*
+ * High Level Configuration Options
+ */
+#define CONFIG_E3001   /* E300 family */
+#define CONFIG_QE  1   /* Has QE */
+
+#define CONFIG_KM_DEF_ARCH "arch=ppc_82xx\0"
+
+/*
+ * System Clock Setup
+ */
+#define CONFIG_83XX_CLKIN  6600
+#define CONFIG_SYS_CLK_FREQ6600
+#define CONFIG_83XX_PCICLK 6600
+
+/* 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
+
+#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 | \
+CSCONFIG_ODT_WR_ONLY_CURRENT | \
+CSCONFIG_ROW_BIT_13 | \
+CSCONF

[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


[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-ini

[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/

[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


[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
@@ 

[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 */
-#def

[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 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 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 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
i

[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 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;
+

[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
+

[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&q

[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


[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 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_VSC738

[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_

[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)

[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 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
--- a/arch/powerpc/cpu/m

[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/Kconf

[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 c

[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 

[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


[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
 CONF

[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


[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 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 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 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 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 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 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 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->c

[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 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 

[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


  1   2   3   4   5   6   7   8   9   10   >