[PATCH] binman: fix default filename of u-boot-with-ucode-ptr in documentation

2019-12-13 Thread Masahiro Yamada
The suffix should be ".bin" instead of ".dtb" .

Signed-off-by: Masahiro Yamada 
Reviewed-by: Bin Meng 
---

 tools/binman/README.entries | 2 +-
 tools/binman/etype/u_boot_with_ucode_ptr.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/binman/README.entries b/tools/binman/README.entries
index 1099433521..26050da770 100644
--- a/tools/binman/README.entries
+++ b/tools/binman/README.entries
@@ -971,7 +971,7 @@ Entry: u-boot-with-ucode-ptr: U-Boot with embedded 
microcode pointer
 
 
 Properties / Entry arguments:
-- filename: Filename of u-boot-nodtb.dtb (default 'u-boot-nodtb.dtb')
+- filename: Filename of u-boot-nodtb.bin (default 'u-boot-nodtb.bin')
 - optional-ucode: boolean property to make microcode optional. If the
 u-boot.bin image does not include microcode, no error will
 be generated.
diff --git a/tools/binman/etype/u_boot_with_ucode_ptr.py 
b/tools/binman/etype/u_boot_with_ucode_ptr.py
index cb7dbc68db..960a5efeb4 100644
--- a/tools/binman/etype/u_boot_with_ucode_ptr.py
+++ b/tools/binman/etype/u_boot_with_ucode_ptr.py
@@ -18,7 +18,7 @@ class Entry_u_boot_with_ucode_ptr(Entry_blob):
 """U-Boot with embedded microcode pointer
 
 Properties / Entry arguments:
-- filename: Filename of u-boot-nodtb.dtb (default 'u-boot-nodtb.dtb')
+- filename: Filename of u-boot-nodtb.bin (default 'u-boot-nodtb.bin')
 - optional-ucode: boolean property to make microcode optional. If the
 u-boot.bin image does not include microcode, no error will
 be generated.
-- 
2.17.1



Re: [PATCH v2] cosmetic: Fix spelling and whitespace errors

2019-12-13 Thread Tom Hebb
On Thu, Dec 12, 2019 at 7:26 PM Kever Yang  wrote:
>
> Hi Thomas,
>
>  Could you add commit message for patch and split the patch into
> multi patches
>
> base on the module?
>

Hi Kever,

I think this already got merged, didn't it?

-Tom

>
> Thanks,
>
> - Kever
>
> On 2019/11/14 上午10:18, Thomas Hebb wrote:
> > Signed-off-by: Thomas Hebb 
> > ---
> >   Makefile|  2 +-
> >   README  | 16 +---
> >   arch/arm/cpu/armv8/sec_firmware.c   |  2 +-
> >   arch/arm/mach-rockchip/Kconfig  |  2 +-
> >   arch/arm/mach-rockchip/bootrom.c|  4 ++--
> >   arch/arm/mach-rockchip/rk3399/Kconfig   |  6 +++---
> >   arch/arm/mach-rockchip/spl-boot-order.c |  2 +-
> >   board/rockchip/evb_rk3399/README|  2 +-
> >   common/spl/Kconfig  |  6 +++---
> >   doc/README.SPL  |  2 +-
> >   doc/README.TPL  |  2 +-
> >   doc/uImage.FIT/source_file_format.txt   |  2 +-
> >   tools/binman/README |  2 +-
> >   tools/binman/README.entries |  4 ++--
> >   14 files changed, 28 insertions(+), 26 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 5c8c4c971f..c5d4bd533b 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1663,7 +1663,7 @@ u-boot.sym: u-boot FORCE
> >   # make sure no implicit rule kicks in
> >   $(sort $(u-boot-init) $(u-boot-main)): $(u-boot-dirs) ;
> >
> > -# Handle descending into subdirectories listed in $(vmlinux-dirs)
> > +# Handle descending into subdirectories listed in $(u-boot-dirs)
> >   # Preset locale variables to speed up the build process. Limit locale
> >   # tweaks to this spot to avoid wrong language settings when running
> >   # make menuconfig etc.
> > diff --git a/README b/README
> > index 1389e8ff12..d047b3b3dd 100644
> > --- a/README
> > +++ b/README
> > @@ -3082,14 +3082,16 @@ Low Level (hardware related) configuration options:
> >   instruction cache) is still performed.
> >
> >   - CONFIG_SPL_BUILD
> > - Modifies the behaviour of start.S when compiling a loader
> > - that is executed before the actual U-Boot. E.g. when
> > - compiling a NAND SPL.
> > + Set when the currently-running compilation is for an artifact
> > + that will end up in the SPL (as opposed to the TPL or U-Boot
> > + proper). Code that needs stage-specific behavior should check
> > + this.
> >
> >   - CONFIG_TPL_BUILD
> > - Modifies the behaviour of start.S  when compiling a loader
> > - that is executed after the SPL and before the actual U-Boot.
> > - It is loaded by the SPL.
> > + Set when the currently-running compilation is for an artifact
> > + that will end up in the TPL (as opposed to the SPL or U-Boot
> > + proper). Code that needs stage-specific behavior should check
> > + this.
> >
> >   - CONFIG_SYS_MPC85XX_NO_RESETVEC
> >   Only for 85xx systems. If this variable is specified, the 
> > section
> > @@ -3306,7 +3308,7 @@ Testing of U-Boot Modifications, Ports to New 
> > Hardware, etc.:
> >   If you have modified U-Boot sources (for instance added a new board
> >   or support for new devices, a new CPU, etc.) you are expected to
> >   provide feedback to the other developers. The feedback normally takes
> > -the form of a "patch", i. e. a context diff against a certain (latest
> > +the form of a "patch", i.e. a context diff against a certain (latest
> >   official or latest in the git repository) version of U-Boot sources.
> >
> >   But before you submit such a patch, please verify that your modifi-
> > diff --git a/arch/arm/cpu/armv8/sec_firmware.c 
> > b/arch/arm/cpu/armv8/sec_firmware.c
> > index 8dc0ac9266..4b3eb71cef 100644
> > --- a/arch/arm/cpu/armv8/sec_firmware.c
> > +++ b/arch/arm/cpu/armv8/sec_firmware.c
> > @@ -353,7 +353,7 @@ bool sec_firmware_support_hwrng(void)
> >   return true;
> >   #endif
> >   if (sec_firmware_addr & SEC_FIRMWARE_RUNNING) {
> > - return true;
> > + return true;
> >   }
> >
> >   return false;
> > diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> > index f5a80b4f0c..1b7f82f596 100644
> > --- a/arch/arm/mach-rockchip/Kconfig
> > +++ b/arch/arm/mach-rockchip/Kconfig
> > @@ -265,7 +265,7 @@ config TPL_ROCKCHIP_COMMON_BOARD
> > Rockchip SoCs have similar boot process, prefer to use TPL for DRAM
> > init and back to bootrom, and SPL as Trust ATF/U-Boot loader. TPL
> > common board is a basic TPL board init which can be shared for most
> > -   of SoCs to avoid copy-pase for different SoCs.
> > +   of SoCs to avoid copy-paste for different SoCs.
> >
> >   config ROCKCHIP_BOOT_MODE_REG
> >   hex "Rockchip boot mode flag register address"
> > diff --git 

Re: [PATCH] sysreset_mpc83xx: fix mcp83xx -> mpc83xx typo

2019-12-13 Thread Tom Rini
On Fri, Dec 13, 2019 at 03:47:58PM +, Rasmus Villemoes wrote:

> Signed-off-by: Rasmus Villemoes 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/1] mailmap: Update mail address for Boris Brezillon

2019-12-13 Thread Tom Rini
On Thu, Dec 12, 2019 at 06:07:49PM +0100, Heinrich Schuchardt wrote:

> Boris' email address has changed. Copy two entries from the Linux .mailmap
> file.
> 
> Boris confirmed the new email address:
> https://lists.denx.de/pipermail/u-boot/2019-December/393774.html
> 
> Cc: Boris Brezillon 
> Signed-off-by: Heinrich Schuchardt 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] dts: am335x-brsmarc1/xre1: insert phy_id again

2019-12-13 Thread Tom Rini
On Fri, Dec 13, 2019 at 08:12:45AM +0100, Hannes Schmelzer wrote:

> commit 3b3e8a37d36e
> ("arm: dts: am335x: sync cpsw/mdio/phy with latest linux - drop phy_id")
> 
> did sync with recent linux kernel and replaced therefore the 'phy_id'
> property with a phy-handle pointing to the mdio.
> 
> This is OK for linux, but introduces trouble with the already running
> vxWorks on this target.
> 
> So this commit here re-inerts the phy_id property beside the phy-handle
> property to be compatible with both.
> 
> Signed-off-by: Hannes Schmelzer 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH] doc: really get rid of Documentation/ directory

2019-12-13 Thread Tom Rini
On Thu, Dec 12, 2019 at 02:38:23PM +, Rasmus Villemoes wrote:

> Commit 656d8da9d2 (doc: Remove duplicated documentation directory) got
> rid of most of Documentation/. But there's still an obviously useless
> .gitignore left behind.
> 
> Also, there's a copy of the linux kernel's net/ethernet.txt binding
> imported from v5.0, while the existing one in doc/ is from 4.0-rc1. So
> replace the latter by the former, and making Documentation/ finally
> empty.
> 
> Signed-off-by: Rasmus Villemoes 
> Reviewed-by: Simon Goldschmidt 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/1] common: remove duplicate typedef for uchar

2019-12-13 Thread Tom Rini
On Tue, Dec 10, 2019 at 07:43:33AM +0100, Heinrich Schuchardt wrote:

> With commit 37db55b7e9db ("linux/types.h: fix typo unchar") we have a
> duplicate typedef for uchar. As linux/types.h is included in common.h we
> don't need another typedef for uchar there.
> 
> Fixes: 37db55b7e9db ("linux/types.h: fix typo unchar")
> Signed-off-by: Heinrich Schuchardt 
> Reviewed-by: Joe Hershberger 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 1/1] doc: fitImage: example of a signature node

2019-12-13 Thread Tom Rini
On Wed, Dec 11, 2019 at 10:45:50AM +0100, Heinrich Schuchardt wrote:

> Describe that a signature node can be added to a binary device tree using
> the mkimage tool.
> 
> Provide an example device tree node.
> 
> Signed-off-by: Heinrich Schuchardt 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [U-Boot] [PATCH v2] arm: ti: dra7: move BOOTP_DNS2 and PHY_TI in defconfig

2019-12-13 Thread Tom Rini
On Wed, Nov 20, 2019 at 09:13:26PM +0200, Grygorii Strashko wrote:

> Move BOOTP_DNS2 and PHY_TI from dra7xx_evm.h to
> dra7xx_evm_defconfig.
> 
> Signed-off-by: Grygorii Strashko 
> Reviewed-by: Lokesh Vutla 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


Re: [RFC PATCH 2/2] net: Add Support for GENET Ethernet controller

2019-12-13 Thread Florian Fainelli



On 12/13/2019 8:50 AM, Andre Przywara wrote:
>> +/* total number of Buffer Descriptors, same for Rx/Tx */
>> +#define TOTAL_DESC   256
>> +
>> +#define DEFAULT_Q0x10
> 
> I think that deserves a comment.
> Maybe Florian can comment on what this odd "queue 16" is really about? It 
> seems weird to support *17* queues and make the last one the default.

In the mode we operate (descriptor mode) this is the background/default
queue, I have no other explanation to provide than that, sorry if this
is a bit "compact". You could bring up the other priority queues, but
that seems pointless in u-boot.

> 
>> +
>> +/* Body(1500) + EH_SIZE(14) + VLANTAG(4) + BRCMTAG(6) + FCS(4) = 1528.
>> + * 1536 is multiple of 256 bytes
>> + */
>> +#define ENET_BRCM_TAG_LEN6
>> +#define ENET_PAD 8
>> +#define ENET_MAX_MTU_SIZE(ETH_DATA_LEN + ETH_HLEN + VLAN_HLEN + 
>> \
>> +  ENET_BRCM_TAG_LEN + ETH_FCS_LEN + 
>> ENET_PAD)
>> +
>> +/* Tx/Rx Dma Descriptor common bits*/
>> +#define DMA_EN   BIT(0)
>> +#define DMA_RING_BUF_EN_SHIFT0x01
>> +#define DMA_RING_BUF_EN_MASK 0x
>> +#define DMA_BUFLENGTH_MASK   0x0fff
>> +#define DMA_BUFLENGTH_SHIFT  16
>> +#define DMA_RING_SIZE_SHIFT  16
>> +#define DMA_OWN  0x8000
>> +#define DMA_EOP  0x4000
>> +#define DMA_SOP  0x2000
>> +#define DMA_WRAP 0x1000
>> +#define DMA_MAX_BURST_LENGTH 0x8
> 
> I think it deserves mentioning that this is the RPi4 specific value, all the 
> other GENET hardware can use 0x10 here. It looks to me like 0x8 is probably 
> safe for all to use, it would just be less efficient. But I guess we don't 
> care in U-Boot.

Correct.

> 
>> +/* Tx specific Dma descriptor bits */
>> +#define DMA_TX_UNDERRUN  0x0200
>> +#define DMA_TX_APPEND_CRC0x0040
>> +#define DMA_TX_OW_CRC0x0020
>> +#define DMA_TX_DO_CSUM   0x0010
>> +#define DMA_TX_QTAG_SHIFT7
>> +#define GENET_TDMA_REG_OFF   (0x4000 + \
>> +  TOTAL_DESC * DMA_DESC_SIZE)
>> +#define GENET_RDMA_REG_OFF   (0x2000 + \
>> +  TOTAL_DESC * DMA_DESC_SIZE)
>> +
>> +/* DMA rings size */
>> +#define DMA_RING_SIZE(0x40)
>> +#define DMA_RINGS_SIZE   (DMA_RING_SIZE * (DEFAULT_Q + 
>> 1))
>> +
>> +/* DMA Descriptor */
>> +#define DMA_DESC_LENGTH_STATUS   0x00
>> +#define DMA_DESC_ADDRESS_LO  0x04
>> +#define DMA_DESC_ADDRESS_HI  0x08
>> +#define DMA_DESC_SIZE0xc
>> +
>> +#define DMA_FC_THRESH_HI (TOTAL_DESC >> 4)
>> +#define DMA_FC_THRESH_LO 5
>> +#define DMA_XOFF_THRESHOLD_SHIFT 16
>> +
>> +#define TDMA_RING_REG_BASE(QUEUE_NUMBER) (GENET_TDMA_REG_OFF \
>> +   + (DMA_RING_SIZE * (QUEUE_NUMBER)))
> 
> So it seems like we are *always* using the default queue number. For improved 
> readability we could drop this parameter and hardcode this here, so that 
> users just need to use TDMA_RING_REG_BASE.

Agreed. If you were to use the other TX or RX queues, you would have to
incur additional configuration that is not worth the trouble here.

[snip]

>> +static void reset_umac(struct bcmgenet_eth_priv *priv)
> 
> What is the difference to the function above? The name is confusingly similar.

And so is the version in the kernel arguably. Note that Doug recently
made a fair amount of changes to how GENET is reset, you have some of
those changes with the loopback enabling, but please check you have the
latest programming sequence since this is a source of hard to debug
problems with the UniMAC receiver stuck/replicating packets incorrectly
if not properly reset.

[snip]

>> +static int _bcmgenet_gmac_eth_send(struct bcmgenet_eth_priv *priv, void 
>> *packet,
>> +   int len)
>> +{
>> +u32 size, len_stat, prod_index, cons;
>> +u32 tries = 100;
>> +
>> +void *desc_base = (priv->tx_desc_base + (priv->tx_index * 
>> DMA_DESC_SIZE));
>> +
>> +len_stat = (len << DMA_BUFLENGTH_SHIFT) | (0x3F << DMA_TX_QTAG_SHIFT);
>> +len_stat |= (DMA_TX_APPEND_CRC | DMA_SOP | DMA_EOP);
>> +
>> +prod_index = readl(priv->mac_reg + TDMA_RING_REG_BASE(DEFAULT_Q) + 
>> TDMA_PROD_INDEX);
>> +
>> +size = roundup(len, ARCH_DMA_MINALIGN);
> 
> I think more important than aligning the size is aligning the base.
> Not that it really matters architecturally ...

Agreed, and if your flush_dcache_range() is not able to figure out
whether it needs to span adjacent cachelines, it is mildy broken at that
point.

> 
>> +flush_dcache_range((ulong)packet, (ulong)packet + size);
>> +
>> +/* Set-up packet for 

Re: [RFC PATCH 2/2] net: Add Support for GENET Ethernet controller

2019-12-13 Thread Andre Przywara
On Fri, 13 Dec 2019 21:12:22 +0530
Amit Singh Tomar  wrote:

Hi Amit,

thanks for your work on this.
As I have seen versions of this code before, here just some quick things 
(mostly stylistic) that I spotted earlier.

> This patch adds driver for GENET Ethernet controller.
> 
> It has been tested(ping and tftp works for small files) on
> Raspberry Pi 4.

I am afraid that needs to be more elaborate. You could mention Broadcom, also 
that it's only for v5 of it. And that it's based on reverse engineering the 
Linux driver.
Text in the cover letter will not make it into the repo, so you should mention 
this here again.

> 
> Signed-off-by: Amit Singh Tomar 
> ---
>  configs/rpi_4_defconfig |   2 +
>  drivers/net/Kconfig |   7 +
>  drivers/net/Makefile|   1 +
>  drivers/net/bcmgenet.c  | 770 
> 
>  4 files changed, 780 insertions(+)
>  create mode 100644 drivers/net/bcmgenet.c
> 
> diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
> index 8cf1bb8..b0f9cf1 100644
> --- a/configs/rpi_4_defconfig
> +++ b/configs/rpi_4_defconfig
> @@ -24,6 +24,8 @@ CONFIG_DM_KEYBOARD=y
>  CONFIG_DM_MMC=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_BCM2835=y
> +CONFIG_DM_ETH=y

I am not sure that belongs into the individual defconfig file, I guess it 
should be in some Kconfig instead?

> +CONFIG_BCMGENET=y
>  CONFIG_PINCTRL=y
>  # CONFIG_PINCTRL_GENERIC is not set
>  # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index 142a2c6..999714d 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -136,6 +136,13 @@ config BCM6368_ETH
>   help
> This driver supports the BCM6368 Ethernet MAC.
>  
> +config BCMGENET
> + bool "BCMGENET V5 support"
> + depends on DM_ETH
> + select PHYLIB
> + help
> +   This driver supports the BCMGENET Ethernet MAC.

Again, please mention Broadcom, also the RPi4 here.

> +
>  config DWC_ETH_QOS
>   bool "Synopsys DWC Ethernet QOS device support"
>   depends on DM_ETH
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index 3099183..6e0a688 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -8,6 +8,7 @@ obj-$(CONFIG_AG7XXX) += ag7xxx.o
>  obj-$(CONFIG_ARMADA100_FEC) += armada100_fec.o
>  obj-$(CONFIG_BCM6348_ETH) += bcm6348-eth.o
>  obj-$(CONFIG_BCM6368_ETH) += bcm6368-eth.o
> +obj-$(CONFIG_BCMGENET) += bcmgenet.o
>  obj-$(CONFIG_DRIVER_AT91EMAC) += at91_emac.o
>  obj-$(CONFIG_DRIVER_AX88180) += ax88180.o
>  obj-$(CONFIG_BCM_SF2_ETH) += bcm-sf2-eth.o
> diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c
> new file mode 100644
> index 000..bad5ffb
> --- /dev/null
> +++ b/drivers/net/bcmgenet.c
> @@ -0,0 +1,770 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Ethernet driver for GENET controller found on RPI4.

Broadcom GENETv5.

And you could tell a bit about the history here, that it's based on the Linux 
driver, but limited to support v5 and do away with all the priority queues, etc.

> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/* Register definitions derived from Linux source */
> +#define SYS_REV_CTRL  0x00
> +
> +#define SYS_PORT_CTRL 0x04
> +#define PORT_MODE_EXT_GPHY3
> +
> +#define GENET_SYS_OFF 0x
> +#define SYS_RBUF_FLUSH_CTRL   (GENET_SYS_OFF  + 0x08)
> +#define SYS_TBUF_FLUSH_CTRL   (GENET_SYS_OFF  + 0x0C)
> +
> +#define GENET_EXT_OFF 0x0080
> +#define EXT_RGMII_OOB_CTRL   (GENET_EXT_OFF + 0x0C)
> +#define RGMII_MODE_EN_V123   BIT(0)
> +#define RGMII_LINK   BIT(4)
> +#define OOB_DISABLE  BIT(5)
> +#define RGMII_MODE_ENBIT(6)
> +#define ID_MODE_DIS  BIT(16)
> +
> +#define GENET_RBUF_OFF0x0300
> +#define RBUF_FLUSH_CTRL_V1(GENET_RBUF_OFF + 0x04)
> +#define RBUF_TBUF_SIZE_CTRL  (GENET_RBUF_OFF + 0xb4)
> +#define RBUF_CTRL(GENET_RBUF_OFF + 0x00)
> +#define RBUF_64B_EN  BIT(0)
> +#define RBUF_ALIGN_2BBIT(1)
> +#define RBUF_BAD_DIS BIT(2)

Thanks for aligning this - I guess it would be in an editor ;-)
But please try to use tabs consistently for indenting this.

> +
> +#define GENET_UMAC_OFF0x0800
> +#define UMAC_MIB_CTRL (GENET_UMAC_OFF + 0x580)
> +#define UMAC_MAX_FRAME_LEN(GENET_UMAC_OFF + 0x014)
> +#define UMAC_MAC0 (GENET_UMAC_OFF + 0x00C)
> +#define UMAC_MAC1 (GENET_UMAC_OFF + 0x010)
> +#define UMAC_CMD  (GENET_UMAC_OFF + 0x008)
> +#define MDIO_CMD   

[PATCH] sysreset_mpc83xx: fix mcp83xx -> mpc83xx typo

2019-12-13 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes 
---
 configs/gazerbeam_defconfig | 2 +-
 drivers/sysreset/Kconfig| 2 +-
 drivers/sysreset/Makefile   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configs/gazerbeam_defconfig b/configs/gazerbeam_defconfig
index 3a29bb1277..2d690245f1 100644
--- a/configs/gazerbeam_defconfig
+++ b/configs/gazerbeam_defconfig
@@ -181,7 +181,7 @@ CONFIG_DM_RESET=y
 CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
 CONFIG_SYSRESET=y
-CONFIG_SYSRESET_MCP83XX=y
+CONFIG_SYSRESET_MPC83XX=y
 CONFIG_TIMER=y
 CONFIG_MPC83XX_TIMER=y
 CONFIG_TPM_ATMEL_TWI=y
diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
index f565ae0310..44ced450f1 100644
--- a/drivers/sysreset/Kconfig
+++ b/drivers/sysreset/Kconfig
@@ -107,7 +107,7 @@ config SYSRESET_X86
help
  Reboot support for generic x86 processor reset.
 
-config SYSRESET_MCP83XX
+config SYSRESET_MPC83XX
bool "Enable support MPC83xx SoC family reboot driver"
help
  Reboot support for NXP MPC83xx SoCs.
diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
index cf01492295..1c5d38f43a 100644
--- a/drivers/sysreset/Makefile
+++ b/drivers/sysreset/Makefile
@@ -8,7 +8,7 @@ obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o
 obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
 obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
 obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o
-obj-$(CONFIG_SYSRESET_MCP83XX) += sysreset_mpc83xx.o
+obj-$(CONFIG_SYSRESET_MPC83XX) += sysreset_mpc83xx.o
 obj-$(CONFIG_SYSRESET_MICROBLAZE) += sysreset_microblaze.o
 obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o
 obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
-- 
2.23.0



[RFC PATCH 2/2] net: Add Support for GENET Ethernet controller

2019-12-13 Thread Amit Singh Tomar
This patch adds driver for GENET Ethernet controller.

It has been tested(ping and tftp works for small files) on
Raspberry Pi 4.

Signed-off-by: Amit Singh Tomar 
---
 configs/rpi_4_defconfig |   2 +
 drivers/net/Kconfig |   7 +
 drivers/net/Makefile|   1 +
 drivers/net/bcmgenet.c  | 770 
 4 files changed, 780 insertions(+)
 create mode 100644 drivers/net/bcmgenet.c

diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
index 8cf1bb8..b0f9cf1 100644
--- a/configs/rpi_4_defconfig
+++ b/configs/rpi_4_defconfig
@@ -24,6 +24,8 @@ CONFIG_DM_KEYBOARD=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_BCM2835=y
+CONFIG_DM_ETH=y
+CONFIG_BCMGENET=y
 CONFIG_PINCTRL=y
 # CONFIG_PINCTRL_GENERIC is not set
 # CONFIG_REQUIRE_SERIAL_CONSOLE is not set
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 142a2c6..999714d 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -136,6 +136,13 @@ config BCM6368_ETH
help
  This driver supports the BCM6368 Ethernet MAC.
 
+config BCMGENET
+   bool "BCMGENET V5 support"
+   depends on DM_ETH
+   select PHYLIB
+   help
+ This driver supports the BCMGENET Ethernet MAC.
+
 config DWC_ETH_QOS
bool "Synopsys DWC Ethernet QOS device support"
depends on DM_ETH
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 3099183..6e0a688 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -8,6 +8,7 @@ obj-$(CONFIG_AG7XXX) += ag7xxx.o
 obj-$(CONFIG_ARMADA100_FEC) += armada100_fec.o
 obj-$(CONFIG_BCM6348_ETH) += bcm6348-eth.o
 obj-$(CONFIG_BCM6368_ETH) += bcm6368-eth.o
+obj-$(CONFIG_BCMGENET) += bcmgenet.o
 obj-$(CONFIG_DRIVER_AT91EMAC) += at91_emac.o
 obj-$(CONFIG_DRIVER_AX88180) += ax88180.o
 obj-$(CONFIG_BCM_SF2_ETH) += bcm-sf2-eth.o
diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c
new file mode 100644
index 000..bad5ffb
--- /dev/null
+++ b/drivers/net/bcmgenet.c
@@ -0,0 +1,770 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Ethernet driver for GENET controller found on RPI4.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Register definitions derived from Linux source */
+#define SYS_REV_CTRL0x00
+
+#define SYS_PORT_CTRL   0x04
+#define PORT_MODE_EXT_GPHY  3
+
+#define GENET_SYS_OFF   0x
+#define SYS_RBUF_FLUSH_CTRL (GENET_SYS_OFF  + 0x08)
+#define SYS_TBUF_FLUSH_CTRL (GENET_SYS_OFF  + 0x0C)
+
+#define GENET_EXT_OFF   0x0080
+#define EXT_RGMII_OOB_CTRL   (GENET_EXT_OFF + 0x0C)
+#define RGMII_MODE_EN_V123   BIT(0)
+#define RGMII_LINK   BIT(4)
+#define OOB_DISABLE  BIT(5)
+#define RGMII_MODE_ENBIT(6)
+#define ID_MODE_DIS  BIT(16)
+
+#define GENET_RBUF_OFF  0x0300
+#define RBUF_FLUSH_CTRL_V1  (GENET_RBUF_OFF + 0x04)
+#define RBUF_TBUF_SIZE_CTRL  (GENET_RBUF_OFF + 0xb4)
+#define RBUF_CTRL(GENET_RBUF_OFF + 0x00)
+#define RBUF_64B_EN  BIT(0)
+#define RBUF_ALIGN_2BBIT(1)
+#define RBUF_BAD_DIS BIT(2)
+
+#define GENET_UMAC_OFF  0x0800
+#define UMAC_MIB_CTRL   (GENET_UMAC_OFF + 0x580)
+#define UMAC_MAX_FRAME_LEN  (GENET_UMAC_OFF + 0x014)
+#define UMAC_MAC0   (GENET_UMAC_OFF + 0x00C)
+#define UMAC_MAC1   (GENET_UMAC_OFF + 0x010)
+#define UMAC_CMD(GENET_UMAC_OFF + 0x008)
+#define MDIO_CMD(GENET_UMAC_OFF + 0x614)
+#define UMAC_TX_FLUSH   (GENET_UMAC_OFF + 0x334)
+#define MDIO_START_BUSY  BIT(29)
+#define MDIO_READ_FAIL   BIT(28)
+#define MDIO_RD  (2 << 26)
+#define MDIO_WR  BIT(26)
+#define MDIO_PMD_SHIFT   21
+#define MDIO_PMD_MASK0x1F
+#define MDIO_REG_SHIFT   16
+#define MDIO_REG_MASK0x1F
+
+#define CMD_TX_EN   BIT(0)
+#define CMD_RX_EN   BIT(1)
+#define UMAC_SPEED_10   0
+#define UMAC_SPEED_100  1
+#define UMAC_SPEED_1000 2
+#define UMAC_SPEED_2500 3
+#define CMD_SPEED_SHIFT 2
+#define CMD_SPEED_MASK  3
+#define CMD_SW_RESETBIT(13)
+#define CMD_LCL_LOOP_EN BIT(15)
+#define CMD_TX_EN   BIT(0)
+#define CMD_RX_EN   BIT(1)
+
+#define MIB_RESET_RXBIT(0)
+#define MIB_RESET_RUNT  BIT(1)
+#define MIB_RESET_TX   

[RFC PATCH 0/2] Ethernet driver for GENET

2019-12-13 Thread Amit Singh Tomar
Hi,

This is the RFC version of Ethernet driver Andre and I have been working on for 
sometime now.
MAC controller is based on Broadcom's GENETv5 IP.There is no documentation 
available for this controller
Publicly and it's derived lookig at the Linux source[1].

At the moment, ping works from RPI to host machine and TFTP for small files 
succeed but TFTP bigger
files is still an issue.

We would be greatful to get some feedback and help to get it working properly.

[1]: 
https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/broadcom/genet/bcmgenet.c

Amit Singh Tomar (2):
  rpi: Update memory map to accommodate scb devices
  net: Add Support for GENET Ethernet controller

 arch/arm/mach-bcm283x/init.c |   6 +-
 configs/rpi_4_defconfig  |   2 +
 drivers/net/Kconfig  |   7 +
 drivers/net/Makefile |   1 +
 drivers/net/bcmgenet.c   | 770 +++
 5 files changed, 783 insertions(+), 3 deletions(-)
 create mode 100644 drivers/net/bcmgenet.c

-- 
2.7.4



[RFC PATCH 1/2] rpi: Update memory map to accommodate scb devices

2019-12-13 Thread Amit Singh Tomar
Some of the devices(for instance, pcie and gnet controller) sitting on
SCB bus falls behind/below the memory range that we currenty have.

This patch updates the memory range to map those devices correctly.

Signed-off-by: Amit Singh Tomar 
---
 arch/arm/mach-bcm283x/init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-bcm283x/init.c b/arch/arm/mach-bcm283x/init.c
index 3b5f45b..9966d6c 100644
--- a/arch/arm/mach-bcm283x/init.c
+++ b/arch/arm/mach-bcm283x/init.c
@@ -42,9 +42,9 @@ static struct mm_region bcm2711_mem_map[] = {
.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
 PTE_BLOCK_INNER_SHARE
}, {
-   .virt = 0xfe00UL,
-   .phys = 0xfe00UL,
-   .size = 0x0180UL,
+   .virt = 0xfc00UL,
+   .phys = 0xfc00UL,
+   .size = 0x0380UL,
.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
 PTE_BLOCK_NON_SHARE |
 PTE_BLOCK_PXN | PTE_BLOCK_UXN
-- 
2.7.4



Re: want to confirm that include/configs/xilinx_zynqmp*.h files seem unused

2019-12-13 Thread Robert P. J. Day
On Fri, 13 Dec 2019, Michal Simek wrote:

> On 13. 12. 19 15:05, Robert P. J. Day wrote:
> >
> >   been a while since i wandered through the innards of u-boot so it's
> > possible this is a silly question.
> >
> >   was just placed on a project that involves a xilinx zynqmp-based
> > board, and need to upgrade the version of u-boot that's currently
> > being used. as part of my perusal, i did a quick grep to see what
> > existing boards were doing with any zynqmp-related header files, so i
> > did this from the top of the current tree:
> >
> > $ grep -r "include.*xilinx_zynqmp.*\.h" *
> > include/configs/xilinx_zynqmp_mini.h:#include 
> > include/configs/xilinx_zynqmp_mini_emmc.h:#include 
> > 
> > include/configs/xilinx_zynqmp_mini_qspi.h:#include 
> > 
> > include/configs/xilinx_zynqmp_mini_nand.h:#include 
> > 
> > $
> >
> >   i'm aware of the ongoing migration of content from
> > include/configs/*.h files to defconfig files, so the above seems to
> > suggest, given the circular inclusion of those header files with no
> > one else including them, that those files are no longer referenced.
> >
> >   my guess is that all that content was migrated to defconfigs but the
> > header files were simply left there. is that a fair conclusion, or
> > might there be something far more subtle i'm overlooking here?
>
> Nope.

> All of them are used as configuration for
> configs/xilinx_zynqmp_mini* configurations.

  ah, i think i see what i overlooked (like i said, it's been a while
since i poked around here). i wasn't sure how those header files could
be included if their actual names were not found in the source, until
i looked at (for example) xilinx_zynqmp_mini_qspi_defconfig, where i
saw the line:

  CONFIG_SYS_CONFIG_NAME="xilinx_zynqmp_mini_qspi"

which i now assume is used as part of the build to identify the header
file to be included, is that correct?

  oh, and there it is in arch/arm/mach-zynqmp/Kconfig:

  config SYS_CONFIG_NAME
string "Board configuration name"
default "xilinx_zynqmp"
help
  This option contains information about board configuration name.
  Based on this option include/configs/.h header
  will be used for board configuration.

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
 http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



Re: want to confirm that include/configs/xilinx_zynqmp*.h files seem unused

2019-12-13 Thread Michal Simek
On 13. 12. 19 15:05, Robert P. J. Day wrote:
> 
>   been a while since i wandered through the innards of u-boot so it's
> possible this is a silly question.
> 
>   was just placed on a project that involves a xilinx zynqmp-based
> board, and need to upgrade the version of u-boot that's currently
> being used. as part of my perusal, i did a quick grep to see what
> existing boards were doing with any zynqmp-related header files, so i
> did this from the top of the current tree:
> 
> $ grep -r "include.*xilinx_zynqmp.*\.h" *
> include/configs/xilinx_zynqmp_mini.h:#include 
> include/configs/xilinx_zynqmp_mini_emmc.h:#include 
> 
> include/configs/xilinx_zynqmp_mini_qspi.h:#include 
> 
> include/configs/xilinx_zynqmp_mini_nand.h:#include 
> 
> $
> 
>   i'm aware of the ongoing migration of content from
> include/configs/*.h files to defconfig files, so the above seems to
> suggest, given the circular inclusion of those header files with no
> one else including them, that those files are no longer referenced.
> 
>   my guess is that all that content was migrated to defconfigs but the
> header files were simply left there. is that a fair conclusion, or
> might there be something far more subtle i'm overlooking here?

Nope.
All of them are used as configuration for configs/xilinx_zynqmp_mini*
configurations.
But as I am looking at it SYS_MALLOC_LEN can be converted to Kconfig.

The rest - SYS_SDRAM_SIZE/BASE and SYS_INIT_SP_ADDR haven't been
converted yet. But patches welcome. Then we can remove _emmc, _qspi,
_nand configurations and keep just mini.h one till other stuff are
converted.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs




signature.asc
Description: OpenPGP digital signature


want to confirm that include/configs/xilinx_zynqmp*.h files seem unused

2019-12-13 Thread Robert P. J. Day


  been a while since i wandered through the innards of u-boot so it's
possible this is a silly question.

  was just placed on a project that involves a xilinx zynqmp-based
board, and need to upgrade the version of u-boot that's currently
being used. as part of my perusal, i did a quick grep to see what
existing boards were doing with any zynqmp-related header files, so i
did this from the top of the current tree:

$ grep -r "include.*xilinx_zynqmp.*\.h" *
include/configs/xilinx_zynqmp_mini.h:#include 
include/configs/xilinx_zynqmp_mini_emmc.h:#include 

include/configs/xilinx_zynqmp_mini_qspi.h:#include 

include/configs/xilinx_zynqmp_mini_nand.h:#include 

$

  i'm aware of the ongoing migration of content from
include/configs/*.h files to defconfig files, so the above seems to
suggest, given the circular inclusion of those header files with no
one else including them, that those files are no longer referenced.

  my guess is that all that content was migrated to defconfigs but the
header files were simply left there. is that a fair conclusion, or
might there be something far more subtle i'm overlooking here?

rday

-- 


Robert P. J. Day Ottawa, Ontario, CANADA
 http://crashcourse.ca

Twitter:   http://twitter.com/rpjday
LinkedIn:   http://ca.linkedin.com/in/rpjday



Re: [PATCH] clk: uclass: clk_get_by_name() must not be available if CONFIG_OF_PLATDATA is enabled

2019-12-13 Thread Lukasz Majewski
On Fri, 13 Dec 2019 12:38:43 +0100
Giulio Benetti  wrote:

> On 12/13/19 11:09 AM, Lukasz Majewski wrote:
> > On Fri, 13 Dec 2019 00:02:25 +0100
> > Giulio Benetti  wrote:
> >   
> >> Hi Lukasz,
> >>
> >> On 12/12/19 11:53 PM, Giulio Benetti wrote:  
> >>> clk_get_by_name() requires clk_get_by_id() that is not available
> >>> if CONFIG_OF_PLATDATA is defined, so move clk_get_by_name() into
> >>> #else condition of #if CONFIG_IS_ENABLED(OF_PLATDATA).
> >>>
> >>> Signed-off-by: Giulio Benetti
> >>>   
> >>
> >> I've already successfully executed a complete Travis with master
> >> and this patch applied:
> >> https://travis-ci.org/giuliobenetti/u-boot-imxrt/builds/624256888  
> > 
> > Is this a preparatory patch for some other work? Or is it just a
> > standalone fix?  
> 
> This is a standalone fix.
> 

Ok. Thanks for preparing it.

> Best regards




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de


pgpNo7GlmrmlP.pgp
Description: OpenPGP digital signature


Re: [PATCH v3 1/8] dm: rng: Add random number generator(rng) uclass

2019-12-13 Thread Ilias Apalodimas
On Fri, Dec 13, 2019 at 12:44:20PM +0530, Sughosh Ganu wrote:
> Add a uclass for reading a random number seed from a random number
> generator device.
> 
> Signed-off-by: Sughosh Ganu 
> Reviewed-by: Patrice Chotard 
> ---
>  drivers/Kconfig  |  2 ++
>  drivers/Makefile |  1 +
>  drivers/rng/Kconfig  |  7 +++
>  drivers/rng/Makefile |  6 ++
>  drivers/rng/rng-uclass.c | 23 +++
>  include/dm/uclass-id.h   |  1 +
>  include/rng.h| 30 ++
>  7 files changed, 70 insertions(+)
>  create mode 100644 drivers/rng/Kconfig
>  create mode 100644 drivers/rng/Makefile
>  create mode 100644 drivers/rng/rng-uclass.c
>  create mode 100644 include/rng.h
> 
> diff --git a/drivers/Kconfig b/drivers/Kconfig
> index 9d99ce0..e34a227 100644
> --- a/drivers/Kconfig
> +++ b/drivers/Kconfig
> @@ -90,6 +90,8 @@ source "drivers/remoteproc/Kconfig"
>  
>  source "drivers/reset/Kconfig"
>  
> +source "drivers/rng/Kconfig"
> +
>  source "drivers/rtc/Kconfig"
>  
>  source "drivers/scsi/Kconfig"
> diff --git a/drivers/Makefile b/drivers/Makefile
> index e977f19..6c619b1 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -115,4 +115,5 @@ obj-$(CONFIG_W1_EEPROM) += w1-eeprom/
>  
>  obj-$(CONFIG_MACH_PIC32) += ddr/microchip/
>  obj-$(CONFIG_DM_HWSPINLOCK) += hwspinlock/
> +obj-$(CONFIG_DM_RNG) += rng/
>  endif
> diff --git a/drivers/rng/Kconfig b/drivers/rng/Kconfig
> new file mode 100644
> index 000..dd44cc0
> --- /dev/null
> +++ b/drivers/rng/Kconfig
> @@ -0,0 +1,7 @@
> +config DM_RNG
> + bool "Driver support for Random Number Generator devices"
> + depends on DM
> + help
> +   Enable driver model for random number generator(rng) devices.
> +   This interface is used to initialise the rng device and to
> +   read the random seed from the device.
> diff --git a/drivers/rng/Makefile b/drivers/rng/Makefile
> new file mode 100644
> index 000..311705b
> --- /dev/null
> +++ b/drivers/rng/Makefile
> @@ -0,0 +1,6 @@
> +# SPDX-License-Identifier: GPL-2.0+
> +#
> +# Copyright (c) 2019, Linaro Limited
> +#
> +
> +obj-$(CONFIG_DM_RNG) += rng-uclass.o
> diff --git a/drivers/rng/rng-uclass.c b/drivers/rng/rng-uclass.c
> new file mode 100644
> index 000..b6af3b8
> --- /dev/null
> +++ b/drivers/rng/rng-uclass.c
> @@ -0,0 +1,23 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (c) 2019, Linaro Limited
> + */
> +
> +#include 
> +#include 
> +#include 
> +
> +int dm_rng_read(struct udevice *dev, void *buffer, size_t size)
> +{
> + const struct dm_rng_ops *ops = device_get_ops(dev);
> +
> + if (!ops->read)
> + return -ENOSYS;
> +
> + return ops->read(dev, buffer, size);
> +}
> +
> +UCLASS_DRIVER(rng) = {
> + .name = "rng",
> + .id = UCLASS_RNG,
> +};
> diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
> index 0c563d8..192202d 100644
> --- a/include/dm/uclass-id.h
> +++ b/include/dm/uclass-id.h
> @@ -86,6 +86,7 @@ enum uclass_id {
>   UCLASS_REGULATOR,   /* Regulator device */
>   UCLASS_REMOTEPROC,  /* Remote Processor device */
>   UCLASS_RESET,   /* Reset controller device */
> + UCLASS_RNG, /* Random Number Generator */
>   UCLASS_RTC, /* Real time clock device */
>   UCLASS_SCSI,/* SCSI device */
>   UCLASS_SERIAL,  /* Serial UART */
> diff --git a/include/rng.h b/include/rng.h
> new file mode 100644
> index 000..61d5da9
> --- /dev/null
> +++ b/include/rng.h
> @@ -0,0 +1,30 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (c) 2019, Linaro Limited
> + */
> +
> +#if !defined _RNG_H_
> +#define _RNG_H_
> +
> +#include 
> +
> +/**
> + * dm_rng_read() - read a random number seed from the rng device
> + * @buffer:  input buffer to put the read random seed into
> + * @size:number of bytes of random seed read
> + *
> + */
> +int dm_rng_read(struct udevice *dev, void *buffer, size_t size);
> +
> +/* struct dm_rng_ops - Operations for the hwrng uclass */
> +struct dm_rng_ops {
> + /**
> +  * @read() - read a random number seed
> +  *
> +  * @data:   input buffer to read the random seed
> +  * @max:total number of bytes to read
> +  */
> + int (*read)(struct udevice *dev, void *data, size_t max);
> +};
> +
> +#endif /* _RNG_H_ */
> -- 
> 2.7.4
> 

Tested-by: Ilias Apalodimas 


Re: [PATCH v3 8/8] virtio: rng: Add a random number generator(rng) driver

2019-12-13 Thread Ilias Apalodimas
On Fri, Dec 13, 2019 at 12:44:27PM +0530, Sughosh Ganu wrote:
> Add a driver for the virtio-rng device on the qemu platform. The
> device uses pci as a transport medium. The driver can be enabled with
> the following configs
> 
> CONFIG_VIRTIO
> CONFIG_DM_RNG
> CONFIG_VIRTIO_PCI
> CONFIG_VIRTIO_RNG
> 
> Signed-off-by: Sughosh Ganu 
> ---
> 
>  drivers/virtio/Kconfig |  6 
>  drivers/virtio/Makefile|  1 +
>  drivers/virtio/virtio-uclass.c |  1 +
>  drivers/virtio/virtio_rng.c| 72 
> ++
>  include/virtio.h   |  4 ++-
>  5 files changed, 83 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/virtio/virtio_rng.c
> 
> diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
> index a9d5fd0..2e3dd3b 100644
> --- a/drivers/virtio/Kconfig
> +++ b/drivers/virtio/Kconfig
> @@ -59,4 +59,10 @@ config VIRTIO_BLK
> This is the virtual block driver for virtio. It can be used with
> QEMU based targets.
>  
> +config VIRTIO_RNG
> +   bool "virtio rng driver"
> +   depends on VIRTIO
> +   help
> + This is the virtual random number generator driver. It can be used
> +  with Qemu based targets.
>  endmenu
> diff --git a/drivers/virtio/Makefile b/drivers/virtio/Makefile
> index 4579044..dc88809 100644
> --- a/drivers/virtio/Makefile
> +++ b/drivers/virtio/Makefile
> @@ -9,3 +9,4 @@ obj-$(CONFIG_VIRTIO_PCI) += virtio_pci_legacy.o 
> virtio_pci_modern.o
>  obj-$(CONFIG_VIRTIO_SANDBOX) += virtio_sandbox.o
>  obj-$(CONFIG_VIRTIO_NET) += virtio_net.o
>  obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o
> +obj-$(CONFIG_VIRTIO_RNG) += virtio_rng.o
> diff --git a/drivers/virtio/virtio-uclass.c b/drivers/virtio/virtio-uclass.c
> index 34397d7..436faa4 100644
> --- a/drivers/virtio/virtio-uclass.c
> +++ b/drivers/virtio/virtio-uclass.c
> @@ -24,6 +24,7 @@
>  static const char *const virtio_drv_name[VIRTIO_ID_MAX_NUM] = {
>   [VIRTIO_ID_NET] = VIRTIO_NET_DRV_NAME,
>   [VIRTIO_ID_BLOCK]   = VIRTIO_BLK_DRV_NAME,
> + [VIRTIO_ID_RNG] = VIRTIO_RNG_DRV_NAME,
>  };
>  
>  int virtio_get_config(struct udevice *vdev, unsigned int offset,
> diff --git a/drivers/virtio/virtio_rng.c b/drivers/virtio/virtio_rng.c
> new file mode 100644
> index 000..19a0cc1
> --- /dev/null
> +++ b/drivers/virtio/virtio_rng.c
> @@ -0,0 +1,72 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (c) 2019, Linaro Limited
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +struct virtio_rng_priv {
> + struct virtqueue *rng_vq;
> +};
> +
> +static int virtio_rng_read(struct udevice *dev, void *data, size_t len)
> +{
> + struct virtio_sg sg = { data, len };
> + struct virtio_sg *sgs[] = {  };
> + struct virtio_rng_priv *priv = dev_get_priv(dev);
> + unsigned int rsize;
> + int ret;
> +
> + ret = virtqueue_add(priv->rng_vq, sgs, 0, 1);
> + if (ret)
> + return ret;
> +
> + virtqueue_kick(priv->rng_vq);
> +
> + while (!virtqueue_get_buf(priv->rng_vq, ))
> + ;
> +
> + return rsize;
> +}
> +
> +static int virtio_rng_bind(struct udevice *dev)
> +{
> + struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(dev->parent);
> +
> + /* Indicate what driver features we support */
> + virtio_driver_features_init(uc_priv, NULL, 0, NULL, 0);
> +
> + return 0;
> +}
> +
> +static int virtio_rng_probe(struct udevice *dev)
> +{
> + struct virtio_rng_priv *priv = dev_get_priv(dev);
> + int ret;
> +
> + ret = virtio_find_vqs(dev, 1, >rng_vq);
> + if (ret < 0)
> + return ret;
> +
> + return 0;
> +}
> +
> +static const struct dm_rng_ops virtio_rng_ops = {
> + .read   = virtio_rng_read,
> +};
> +
> +U_BOOT_DRIVER(virtio_rng) = {
> + .name   = VIRTIO_RNG_DRV_NAME,
> + .id = UCLASS_RNG,
> + .bind   = virtio_rng_bind,
> + .probe  = virtio_rng_probe,
> + .remove = virtio_reset,
> + .ops= _rng_ops,
> + .priv_auto_alloc_size = sizeof(struct virtio_rng_priv),
> + .flags  = DM_FLAG_ACTIVE_DMA,
> +};
> diff --git a/include/virtio.h b/include/virtio.h
> index 654fdf1..561dcc3 100644
> --- a/include/virtio.h
> +++ b/include/virtio.h
> @@ -22,10 +22,12 @@
>  
>  #define VIRTIO_ID_NET1 /* virtio net */
>  #define VIRTIO_ID_BLOCK  2 /* virtio block */
> -#define VIRTIO_ID_MAX_NUM3
> +#define VIRTIO_ID_RNG4 /* virtio rng */
> +#define VIRTIO_ID_MAX_NUM5
>  
>  #define VIRTIO_NET_DRV_NAME  "virtio-net"
>  #define VIRTIO_BLK_DRV_NAME  "virtio-blk"
> +#define VIRTIO_RNG_DRV_NAME  "virtio-rng"
>  
>  /* Status byte for guest to report progress, and synchronize features */
>  
> -- 
> 2.7.4
> 

Tested-by: Ilias Apalodimas 


Re: [PATCH] clk: uclass: clk_get_by_name() must not be available if CONFIG_OF_PLATDATA is enabled

2019-12-13 Thread Giulio Benetti

On 12/13/19 11:09 AM, Lukasz Majewski wrote:

On Fri, 13 Dec 2019 00:02:25 +0100
Giulio Benetti  wrote:


Hi Lukasz,

On 12/12/19 11:53 PM, Giulio Benetti wrote:

clk_get_by_name() requires clk_get_by_id() that is not available if
CONFIG_OF_PLATDATA is defined, so move clk_get_by_name() into #else
condition of #if CONFIG_IS_ENABLED(OF_PLATDATA).

Signed-off-by: Giulio Benetti



I've already successfully executed a complete Travis with master and
this patch applied:
https://travis-ci.org/giuliobenetti/u-boot-imxrt/builds/624256888


Is this a preparatory patch for some other work? Or is it just a
standalone fix?


This is a standalone fix.

Best regards
--
Giulio Benetti
Benetti Engineering sas



Kind regards





Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de



Re: i.MX8MM-EVK Boot failure

2019-12-13 Thread Ricardo Salveti
Hi Fabio,

On Fri, Dec 13, 2019 at 6:44 AM Fabio Estevam  wrote:
>
> Hi Ricardo,
>
> On Thu, Dec 12, 2019 at 6:20 PM Ricardo Salveti  wrote:
>
> > Can you also confirm if mmc is working correctly on imx8mm evk?
>
> I don't have access to a imx8mm_evk at the moment, but does the change
> below help?
>
> --- a/configs/imx8mm_evk_defconfig
> +++ b/configs/imx8mm_evk_defconfig
> @@ -66,7 +66,7 @@ CONFIG_SYS_I2C_MXC_I2C2=y
>  CONFIG_SYS_I2C_MXC_I2C3=y
>  CONFIG_DM_MMC=y
>  CONFIG_SUPPORT_EMMC_BOOT=y
> -CONFIG_FSL_ESDHC_IMX=y
> +CONFIG_FSL_USDHC=y
>  CONFIG_PHYLIB=y
>  CONFIG_PHY_ATHEROS=y
>  CONFIG_DM_ETH=y

That ends up producing a bunch of build warnings, saying it now being redefined.

Will investigate a bit more and also try a few different sdcards I got.

Thanks,
-- 
Ricardo Salveti de Araujo


Re: [PATCH] clk: uclass: clk_get_by_name() must not be available if CONFIG_OF_PLATDATA is enabled

2019-12-13 Thread Lukasz Majewski
On Fri, 13 Dec 2019 00:02:25 +0100
Giulio Benetti  wrote:

> Hi Lukasz,
> 
> On 12/12/19 11:53 PM, Giulio Benetti wrote:
> > clk_get_by_name() requires clk_get_by_id() that is not available if
> > CONFIG_OF_PLATDATA is defined, so move clk_get_by_name() into #else
> > condition of #if CONFIG_IS_ENABLED(OF_PLATDATA).
> > 
> > Signed-off-by: Giulio Benetti
> >   
> 
> I've already successfully executed a complete Travis with master and 
> this patch applied:
> https://travis-ci.org/giuliobenetti/u-boot-imxrt/builds/624256888

Is this a preparatory patch for some other work? Or is it just a
standalone fix?

> 
> Kind regards




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lu...@denx.de


pgp15nbES4NY_.pgp
Description: OpenPGP digital signature


[GIT PULL] For socfpga-next

2019-12-13 Thread Tan, Ley Foon
Hi Marek

Please pull the following update for socfpga-next.

Thanks.

Regards
Ley Foon

The following changes since commit f412fa8c2b82eba609c0f4494bad0da38606aa77:

  configs: socfpga: fix building Stratix10 and Agilex (2019-12-13 01:58:15 
+0100)

are available in the Git repository at:

  https://github.com/lftan/u-boot.git for-marek-next

for you to fetch changes up to 9063341301cc9400c7673d369249b0ae8514a07d:

  ddr: socfpga: Enable ARM64 Non-Secure SDRAM ECC Access (2019-12-13 17:25:37 
+0800)


Thor Thayer (2):
  arm: socfpga: stratix10: Enable SMMU access
  ddr: socfpga: Enable ARM64 Non-Secure SDRAM ECC Access

 arch/arm/mach-socfpga/include/mach/firewall.h |  7 +++
 drivers/ddr/altera/sdram_agilex.c |  6 +++---
 drivers/ddr/altera/sdram_s10.c| 20 +---
 3 files changed, 27 insertions(+), 6 deletions(-)



Re: i.MX8MM-EVK Boot failure

2019-12-13 Thread Fabio Estevam
Hi Ricardo,

On Thu, Dec 12, 2019 at 6:20 PM Ricardo Salveti  wrote:

> Can you also confirm if mmc is working correctly on imx8mm evk?

I don't have access to a imx8mm_evk at the moment, but does the change
below help?

--- a/configs/imx8mm_evk_defconfig
+++ b/configs/imx8mm_evk_defconfig
@@ -66,7 +66,7 @@ CONFIG_SYS_I2C_MXC_I2C2=y
 CONFIG_SYS_I2C_MXC_I2C3=y
 CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
-CONFIG_FSL_ESDHC_IMX=y
+CONFIG_FSL_USDHC=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_ATHEROS=y
 CONFIG_DM_ETH=y


[PATCH] rockchip: px30-firefly add standalone dts

2019-12-13 Thread Kever Yang
Firefly Core-PX30-JD4 use UART2M1 while PX30 evb using UART2M0, the U-Boot
proper will use the dts setting to do the IOMUX init, and a separate dts
is needed for px30-firefly.

Signed-off-by: Kever Yang 
---

 arch/arm/dts/Makefile |   3 +-
 arch/arm/dts/px30-firefly-u-boot.dtsi |  84 
 arch/arm/dts/px30-firefly.dts | 531 ++
 configs/firefly-px30_defconfig|   4 +-
 4 files changed, 619 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/dts/px30-firefly-u-boot.dtsi
 create mode 100644 arch/arm/dts/px30-firefly.dts

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 3dc9c4d41c..68cad331d8 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -68,7 +68,8 @@ dtb-$(CONFIG_ARCH_OWL) += \
bubblegum_96.dtb
 
 dtb-$(CONFIG_ROCKCHIP_PX30) += \
-   px30-evb.dtb
+   px30-evb.dtb \
+   px30-firefly.dtb
 
 dtb-$(CONFIG_ROCKCHIP_RK3036) += \
rk3036-sdk.dtb
diff --git a/arch/arm/dts/px30-firefly-u-boot.dtsi 
b/arch/arm/dts/px30-firefly-u-boot.dtsi
new file mode 100644
index 00..bb782b4e2d
--- /dev/null
+++ b/arch/arm/dts/px30-firefly-u-boot.dtsi
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ */
+
+/ {
+   aliases {
+   mmc0 = 
+   mmc1 = 
+   };
+
+   chosen {
+   u-boot,spl-boot-order = , 
+   };
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   clock-frequency = <2400>;
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   clock-frequency = <2400>;
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+
+   /* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
+   u-boot,spl-fifo-mode;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+
+   /* mmc to sram can't do dma, prevent aborts transferring TF-A parts */
+   u-boot,spl-fifo-mode;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+   status = "okay";
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
+
+ {
+   u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/px30-firefly.dts b/arch/arm/dts/px30-firefly.dts
new file mode 100644
index 00..c0a8e3009a
--- /dev/null
+++ b/arch/arm/dts/px30-firefly.dts
@@ -0,0 +1,531 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 Fuzhou Rockchip Electronics Co., Ltd
+ */
+
+/dts-v1/;
+#include 
+#include 
+#include 
+#include "px30.dtsi"
+
+/ {
+   model = "Firefly Core-PX30-JD4";
+   compatible = "rockchip,px30-firefly", "rockchip,px30";
+
+   chosen {
+   stdout-path = "serial2:115200n8";
+   };
+
+   adc-keys {
+   compatible = "adc-keys";
+   io-channels = < 2>;
+   io-channel-names = "buttons";
+   keyup-threshold-microvolt = <180>;
+   poll-interval = <100>;
+
+   esc-key {
+   label = "esc";
+   linux,code = ;
+   press-threshold-microvolt = <131>;
+   };
+
+   home-key {
+   label = "home";
+   linux,code = ;
+   press-threshold-microvolt = <624000>;
+   };
+
+   menu-key {
+   label = "menu";
+   linux,code = ;
+   press-threshold-microvolt = <987000>;
+   };
+
+   vol-down-key {
+   label = "volume down";
+   linux,code = ;
+   press-threshold-microvolt = <30>;
+   };
+
+   vol-up-key {
+   label = "volume up";
+   linux,code = ;
+   press-threshold-microvolt = <17000>;
+   };
+   };
+
+   backlight: backlight {
+   compatible = "pwm-backlight";
+   pwms = < 0 25000 0>;
+   power-supply = <_lcd>;
+   };
+
+   emmc_pwrseq: emmc-pwrseq {
+   compatible = "mmc-pwrseq-emmc";
+   pinctrl-0 = <_reset>;
+   pinctrl-names = "default";
+   reset-gpios = < RK_PB3 GPIO_ACTIVE_HIGH>;
+   };
+
+   sdio_pwrseq: sdio-pwrseq {
+   compatible = "mmc-pwrseq-simple";
+   pinctrl-names = "default";
+   pinctrl-0 = <_enable_h>;
+
+   /*
+* On the module itself this is one of these (depending
+* on the actual card populated):
+* - SDIO_RESET_L_WL_REG_ON
+* - PDN (power down when low)
+*/
+   

Re: [PATCH v8 02/17] i2c: designware: Add Apollo Lake support

2019-12-13 Thread Bin Meng
Hi Simon,

On Fri, Dec 13, 2019 at 10:48 AM Simon Glass  wrote:
>
> Hi Bin,
>
> On Tue, 10 Dec 2019 at 21:28, Simon Glass  wrote:
> >
> > For Apollo Lake we need to take the I2C bus controller out of reset before
> > using this. Add this functionality to the driver.
> >
> > Signed-off-by: Simon Glass 
> > Reviewed-by: Heiko Schocher 
> > Reviewed-by: Bin Meng 
> > ---
> >
> > Changes in v8:
> > - Add .data in compatible array
> >
> > Changes in v7: None
> > Changes in v6:
> > - Add .driver_data in the designware_pci_supported array
> > - Add a comment about VANILLA
> > - Move lpss_reset_release() to this commit
> >
> > Changes in v5:
> > - Drop unrelated change metioned by Heiko
> >
> > Changes in v4:
> > - apollolake -> Apollo Lake
> >
> > Changes in v3:
> > - Add a weak function to avoid errors on other platforms
> >
> > Changes in v2: None
> >
> >  drivers/i2c/designware_i2c_pci.c | 25 +
> >  1 file changed, 25 insertions(+)
>
> I think that is the last of the changes for this serial, but please
> let me know if anything needs adjusting.
>
> Also Tom has set up a -next tree now!
>

Yes, I noticed this -next tree. I will apply the series and send PR to
u-boot/next.

Regards,
Bin


arm: imx6: configure NoC on i.MX6DQP

2019-12-13 Thread Bernhard Messerklinger
Hi Stefano, Filip,

I found this patch on the mailing list: 
https://patchwork.ozlabs.org/patch/670208/

As far as I can see this patch never made it to mainline.
I have tested and reviewed the patch and it works for me.
With this patch my i.MX6QP DDR3 NoC configuration works fine.

What is the current state of the patch?
Is anyone still working on it?
If no, what would I have to do to get it mainline?

Regards,
Bernhard