platform/kernel/u-boot.git
3 years agoomap3_beagle: Finish current outstanding DM migrations
Tom Rini [Tue, 30 Jun 2020 19:02:27 +0000 (15:02 -0400)]
omap3_beagle: Finish current outstanding DM migrations

At this point in time we can now remove our legacy code and switch to
enabling DM for USB and Ethernet.

Cc: Derald D. Woods <woods.technical@gmail.com>
Cc: Adam Ford <aford173@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
3 years agoARM: da850-evm: Unify config options with Kconfig
Adam Ford [Mon, 29 Jun 2020 23:49:41 +0000 (18:49 -0500)]
ARM: da850-evm: Unify config options with Kconfig

There are two options that are currently whitelisted, but they
are redundant, because there are not necessary since Kconfig options
exist to basically state the same thing.

CONFIG_DIRECT_NOR_BOOT and CONFIG_USE_NOR are both set together and
only used by the da850 when booting from NOR, however the only time
CONFIG_MTD_NOR_FLASH is configured is when booting from NOR. Since
NOR doesn't need SPL, the options for SPL can be moved to a check for
building SPL instead of checking for NOR.

This patch removes the checks for these two config options and unifies
the checks around the Kconfig option of CONFIG_MTD_NOR_FLASH.

Since this board is the only board that uses these two config options,
they can be removed from the whitelist table.

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agoREADME: davinci: Clarify when SPL is used and the target devices.
Adam Ford [Mon, 29 Jun 2020 23:32:02 +0000 (18:32 -0500)]
README: davinci: Clarify when SPL is used and the target devices.

The documentation states that SPL is enabled in all config options
for the da850.  This incorrect, because devices booting from NOR
do not need the SPL to do the low level initializion because when
booting from NOR, the board is able to execute in place (XIP)

This also clarifies that SPL isn't only used for booting from SPI,
because it is also used for booting from MMC and NAND for those
devices supporting those boot options.

Signed-off-by: Adam Ford <aford173@gmail.com>
3 years agoarm: dts: k3-am65: Sync CPSW DT node from kernel
Vignesh Raghavendra [Mon, 6 Jul 2020 08:06:56 +0000 (13:36 +0530)]
arm: dts: k3-am65: Sync CPSW DT node from kernel

Sync CPSW DT node from kernel and move it out of -u-boot.dtsi file.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agoarm: dts: k3-j721e: Sync CPSW DT node from kernel
Vignesh Raghavendra [Mon, 6 Jul 2020 08:06:55 +0000 (13:36 +0530)]
arm: dts: k3-j721e: Sync CPSW DT node from kernel

Sync CPSW DT node from Kernel and move it out of -u-boot.dtsi file.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agonet: ti: am65-cpsw-nuss: Update driver to use kernel DT
Vignesh Raghavendra [Mon, 6 Jul 2020 08:06:54 +0000 (13:36 +0530)]
net: ti: am65-cpsw-nuss: Update driver to use kernel DT

Kernel DT has CPSW ports under ethernet-ports subnode. Update the driver
to look for the same.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agonet: ti: am65-cpsw-nuss: Set ALE default thread enable
Vignesh Raghavendra [Mon, 6 Jul 2020 08:06:53 +0000 (13:36 +0530)]
net: ti: am65-cpsw-nuss: Set ALE default thread enable

Force default thread to be used for RX as ALE is anyways set to Bypass
mode.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agonet: ti: am65-cpsw-nuss: Remove dead code
Vignesh Raghavendra [Mon, 6 Jul 2020 08:06:52 +0000 (13:36 +0530)]
net: ti: am65-cpsw-nuss: Remove dead code

MDIO node is not referenced further, therefore drop the dead code.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agodma: ti: k3-udma: Switch to k3_ringacc_request_rings_pair
Vignesh Raghavendra [Mon, 6 Jul 2020 07:56:27 +0000 (13:26 +0530)]
dma: ti: k3-udma: Switch to k3_ringacc_request_rings_pair

We only request ring pairs via K3 DMA driver, switch to use the new
k3_ringacc_request_rings_pair() to simplify the code.

As a good side effect, all boot stages now use exposed RING mode which
avoid maintaining proxy mode for 32 bit R5 core.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agodma: ti: k3-udma: Move RX descriptor ring entries to rflow struct
Vignesh Raghavendra [Mon, 6 Jul 2020 07:56:26 +0000 (13:26 +0530)]
dma: ti: k3-udma: Move RX descriptor ring entries to rflow struct

In K3 UDMA architecture, RX rings are associated with RX flows rather
than RX channels, therefore move the ring pointers to udma_rflow struct

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agodma: ti: k3-udma: Introduce udma_chan_config struct
Vignesh Raghavendra [Mon, 6 Jul 2020 07:56:25 +0000 (13:26 +0530)]
dma: ti: k3-udma: Introduce udma_chan_config struct

Encapsulate channel configuration in a separate struct so as to ease
resetting of these fields with memset() and also to increase readability
of the code.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agosoc: ti: k3-ringacc: Separate soc specific initialization
Vignesh Raghavendra [Mon, 6 Jul 2020 07:56:24 +0000 (13:26 +0530)]
soc: ti: k3-ringacc: Separate soc specific initialization

In preparation of adding more K3 SoCs, separate soc specific
initialization add a SoC specific initialization hook.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agosoc: ti: k3-ringacc: Add an API to request pair of rings
Vignesh Raghavendra [Mon, 6 Jul 2020 07:56:23 +0000 (13:26 +0530)]
soc: ti: k3-ringacc: Add an API to request pair of rings

Add new API k3_ringacc_request_rings_pair() to request pair of rings at
once, as in the most case Rings are used with DMA channels which required
to request pair of rings - one to feed DMA with descriptors (TX/RX FDQ) and
one to receive completions (RX/TX CQ). This will allow to simplify Ringacc
API users.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agosoc: ti: k3-ringacc: Move state tracking variables under a struct
Vignesh Raghavendra [Mon, 6 Jul 2020 07:56:22 +0000 (13:26 +0530)]
soc: ti: k3-ringacc: Move state tracking variables under a struct

Move the free, occ, windex and rinfex under a struct.
We can use memset to zero them and it will allow a cleaner way to extend
the variables for duplex rings.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 years agoarm: dts: k3-am65/j721e: Sync DMA DT bindings from Kernel DT
Vignesh Raghavendra [Tue, 7 Jul 2020 08:13:35 +0000 (13:43 +0530)]
arm: dts: k3-am65/j721e: Sync DMA DT bindings from Kernel DT

Sync DT bindings from kernel DT and move them to out of -u-boot.dtsi
files.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
3 years agodma: ti: k3-udma: Update driver to use static endpoint Data
Vignesh Raghavendra [Tue, 7 Jul 2020 08:13:34 +0000 (13:43 +0530)]
dma: ti: k3-udma: Update driver to use static endpoint Data

Update driver to use static PSIL endpoint Data instead of DT. This will
allow DT bindings to be in sync with kernel's DT.

Note that this patch breaks networking and OSPI boot as driver changes
are not backward compatible with existing DT. Subsequent commit will
update the DT to make it compatible with updated driver.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
3 years agodma: ti: Add static PSIL endpoint information
Vignesh Raghavendra [Tue, 7 Jul 2020 08:13:33 +0000 (13:43 +0530)]
dma: ti: Add static PSIL endpoint information

Much of PSIL endpoint configuration for a given SoC can be known at
compile time, therefore pass them for platform specific data instead of
DT.

Add per SoC's specific PSIL endpoint data. This is to bring driver in
sync with upstream DT.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
3 years agoMerge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spi
Tom Rini [Sat, 11 Jul 2020 21:40:00 +0000 (17:40 -0400)]
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-spi

- Enable DM_SPI on siemens omap boards (Jagan)
- Dropped some non-dm supported omap3 boards (Jagan)
- Dropped non-dm code in omap3 spi driver (Jagan)
- Dropped non-dm code in kirkwood spi driver (Bhargav)

3 years agoMerge tag 'uniphier-v2020.10' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Sat, 11 Jul 2020 15:50:49 +0000 (11:50 -0400)]
Merge tag 'uniphier-v2020.10' of https://gitlab.denx.de/u-boot/custodians/u-boot-uniphier

UniPhier SoC updates for v2020.10

 - remove workaround for Cortex-A72

 - increase U-Boot proper size to 2MB

 - sync DT with Linux

 - add system bus controller driver

 - improve serial driver

 - add reset assertion to Denali NAND driver

3 years agoARM: uniphier: remove NAND reset code
Masahiro Yamada [Fri, 10 Jul 2020 13:31:27 +0000 (22:31 +0900)]
ARM: uniphier: remove NAND reset code

Now that commit 3e57f879eee6 ("mtd: nand: raw: denali: Assert reset
before deassert") added the reset assertion, this code in the board
file is unneeded.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agomtd: nand: raw: denali: Wait for reset completion status
Ley Foon Tan [Fri, 10 Jul 2020 06:58:15 +0000 (14:58 +0800)]
mtd: nand: raw: denali: Wait for reset completion status

Fixed delay 200us is not working in certain platforms. Change to
poll for reset completion status to have more reliable reset process.

Controller will set the rst_comp bit in intr_status register after
controller has completed its reset and initialization process.

Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Radu Bacrau <radu.bacrau@intel.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agomtd: nand: raw: denali: Assert reset before deassert
Ley Foon Tan [Fri, 10 Jul 2020 06:58:14 +0000 (14:58 +0800)]
mtd: nand: raw: denali: Assert reset before deassert

Always put the controller in reset, then take it out of reset.
This is to make sure controller always in reset state in both SPL and
proper Uboot.

This is preparation for the next patch to poll for reset completion
(rst_comp) bit after reset.

Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Radu Bacrau <radu.bacrau@intel.com>
Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoserial: uniphier: enable FIFO
Masahiro Yamada [Thu, 9 Jul 2020 16:12:08 +0000 (01:12 +0900)]
serial: uniphier: enable FIFO

This UART controller is integrated with a FIFO. Enable it.

You can put the next character into the FIFO while the transmitter
is sending out the current character. This works slightly faster.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoserial: uniphier: flush transmitter before changing hardware settings
Masahiro Yamada [Thu, 9 Jul 2020 16:12:07 +0000 (01:12 +0900)]
serial: uniphier: flush transmitter before changing hardware settings

Ensure the transmitter is empty when chaining the baudrate or any
hardware settings. If a character is remaining in the transmitter,
the console will be garbled.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoserial: uniphier: use register macros instead of structure
Masahiro Yamada [Thu, 9 Jul 2020 16:12:06 +0000 (01:12 +0900)]
serial: uniphier: use register macros instead of structure

After all, I am not a big fan of using a structure to represent the
hardware register map.

You do not need to know the entire register map.

Add only necessary register macros.

Use FIELD_PREP() instead of maintaining a pair of shift and mask.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoARM: uniphier: remove sbc/ directory
Masahiro Yamada [Thu, 9 Jul 2020 06:08:20 +0000 (15:08 +0900)]
ARM: uniphier: remove sbc/ directory

Now that this directory contains only uniphier_sbc_boot_is_swapped(),
move it to boot-device.c and delete the sbc/ directory entirely.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agobus: uniphier-system-bus: move hardware init from board files
Masahiro Yamada [Thu, 9 Jul 2020 06:08:19 +0000 (15:08 +0900)]
bus: uniphier-system-bus: move hardware init from board files

Move the bus initialization code to this driver from board files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agobus: uniphier-system-bus: add UniPhier System Bus driver
Masahiro Yamada [Thu, 9 Jul 2020 06:08:18 +0000 (15:08 +0900)]
bus: uniphier-system-bus: add UniPhier System Bus driver

Since commit 1517126fdac2 ("ARM: uniphier: select DM_ETH"), DM-based
drivers/net/smc911x.c is compiled, but it is never probed because the
parent node lacks the DM-based driver.

I need a skeleton driver to populate child devices (but the next commit
will move more hardware settings to the this driver).

I put this to drivers/bus/uniphier-system-bus.c because this is the
same path as the driver in Linux kernel.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoARM: uniphier: remove support for NOR Flash on support card
Masahiro Yamada [Thu, 9 Jul 2020 06:08:17 +0000 (15:08 +0900)]
ARM: uniphier: remove support for NOR Flash on support card

I actually do not see this used these days because eMMC or NAND is used
for non-volatile devices. Dump the burden to maintain this crappy code.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoARM: uniphier: remove unused uniphier_sbc_init_admulti()
Masahiro Yamada [Thu, 9 Jul 2020 06:08:16 +0000 (15:08 +0900)]
ARM: uniphier: remove unused uniphier_sbc_init_admulti()

This was used by the old sLD3 SoC, the support of which was removed
by commit 00aa453ebf56 ("ARM: uniphier: remove sLD3 SoC support").

There is no more user of this function.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoARM: uniphier: fix build error when CONFIG_MICRO_SUPPORT_CARD=n
Masahiro Yamada [Thu, 9 Jul 2020 06:08:15 +0000 (15:08 +0900)]
ARM: uniphier: fix build error when CONFIG_MICRO_SUPPORT_CARD=n

If CONFIG_MICRO_SUPPORT_CARD is unset, the build fails due to
function redefinition.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoARM: uniphier: sync with Linux 5.8-rc4
Masahiro Yamada [Thu, 9 Jul 2020 06:08:14 +0000 (15:08 +0900)]
ARM: uniphier: sync with Linux 5.8-rc4

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoARM: uniphier: consolidate SoC select menu
Masahiro Yamada [Thu, 9 Jul 2020 06:08:13 +0000 (15:08 +0900)]
ARM: uniphier: consolidate SoC select menu

Currently, the supports for the following two ARMv7 SoC groups
are exclusive, because the boot ROM loads the SPL to a different
address:

 - LD4, sLD8                 (SPL is loaded at 0x00040000)
 - Pro4, Pro5, PXs2, LD6b    (SPL is loaded at 0x00100000)

This limitation exists only when CONFIG_SPL=y.

Instead of using crappy CONFIG options, checking SPL and SPL_TEXT_BASE
is cleaner.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoARM: uniphier: increase CONFIG_SYS_MONITOR_LEN to 2MB
Masahiro Yamada [Thu, 9 Jul 2020 06:08:12 +0000 (15:08 +0900)]
ARM: uniphier: increase CONFIG_SYS_MONITOR_LEN to 2MB

I increased the maximum U-Boot proper size from time to time, but
configs/uniphier_v7_defconfig hit the current limit 832KB.

Some historical info:

In the initial support, the max size was 512MB.

Commit 58d702274c09 ("ARM: uniphier: increase CONFIG_SYS_MONITOR_LEN")
increased it to 576KB, and commit 3ce5b1a8d86d ("ARM: uniphier: move
SPL stack address") moved the SPL stack location to avoid the memory
map conflict. It was the solution to increase the size without changing
the NOR boot image map.

commit 1a4bd3a095b2 ("ARM: uniphier: increase CONFIG_SYS_MONITOR_LEN
again") ended up with increasing the max size again, breaking the NOR
boot image map. The limit was set to 832KB, otherwise the SPL stack
would overwrite the U-Boot proper image:
 CONFIG_SPL_STACK - CONFIG_SYS_UBOOT_BASE + sizeof(struct image_header) = 0xd0000

To increase CONFIG_SYS_MONITOR_LEN even more, the SPL stack must be
moved somewhere. I put it back to the original location prior to
commit 3ce5b1a8d86d.

With this change, there is no more practical size limit.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoRevert "ARM: uniphier: add weird workaround code for LD20"
Masahiro Yamada [Thu, 9 Jul 2020 06:08:11 +0000 (15:08 +0900)]
Revert "ARM: uniphier: add weird workaround code for LD20"

This reverts commit 45f41c134baf5ff1bbf59d33027f6c79884fa4d9.

This weird workaround was the best I came up with at that time
to boot U-Boot from TF-A.

I noticed U-Boot successfully boots on LD20 (i.e. CA72 CPU) by using
the latest TF-A.

Specifically, since the following TF-A commit, U-Boot runs at EL2
instead of EL1, and this issue went away as a side-effect.

|commit f998a052fd94ea082833109f25b94ed5bfa24e8b
|Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|Date:   Thu Jul 25 10:57:38 2019 +0900
|
|    uniphier: run BL33 at EL2
|
|    All the SoCs in 64-bit UniPhier SoC family support EL2.
|
|    Just hard-code MODE_EL2 instead of using el_implemented() helper.
|
|    Change-Id: I7ab48002c5205bc8c013e1b46313b57d6c431db0
|    Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

However, if I reverted that, this problem would come back, presumably
because some EL1 code in U-Boot triggers this issue.

Now that commit f8ddd8cbb513 ("arm64: issue ISB after updating system
registers") fixed this issue properly, this weird workaround is no
longer needed irrespective of the exception level at which U-Boot runs.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
3 years agoMerge tag 'dm-pull-10jul20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Fri, 10 Jul 2020 20:22:57 +0000 (16:22 -0400)]
Merge tag 'dm-pull-10jul20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

of-platdata: better phandle and compatible-string support
patman support for Python3 on Ubuntu 14.04
new checkpatch check to avoid #ifdefs

3 years agoCI: show skipped Python tests
Heinrich Schuchardt [Fri, 10 Jul 2020 20:04:40 +0000 (22:04 +0200)]
CI: show skipped Python tests

Call pytest3 with argument -ra to display the reason why Python tests are
skipped.

The -r flag displays a test summary info for each test. -ra eliminates
this info for passed tests.

Pros an cons were discussed in:
https://lists.denx.de/pipermail/u-boot/2020-June/417090.html

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoMerge tag 'rpi-next-2020.10' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspb...
Tom Rini [Fri, 10 Jul 2020 18:31:22 +0000 (14:31 -0400)]
Merge tag 'rpi-next-2020.10' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspberrypi

- add support for PCI and XHCI for RPi4 (64 bit only)
- optionally reset XHCI device on registration
- enable USB_KEYBOARD for rpi_4_defconfig

3 years agoMerge branch '2020-08-10-arbitrary-virt-phys-mappings'
Tom Rini [Fri, 10 Jul 2020 18:30:46 +0000 (14:30 -0400)]
Merge branch '2020-08-10-arbitrary-virt-phys-mappings'

- Bring in Marek Szyprowski's series to allow for arbitrary
  virtual-physical address mappings.

3 years agoconfig: Enable support for the XHCI controller on RPI4 board
Marek Szyprowski [Wed, 3 Jun 2020 12:43:45 +0000 (14:43 +0200)]
config: Enable support for the XHCI controller on RPI4 board

This requires enabling BRCMSTB PCIe and XHCI_PCI drivers as well as PCI
and USB commands. To get it working one has to call the following commands:
"pci enum; usb start;", thus such commands have been added to the default
"preboot" environment variable. One has to update their environment if it
is already configured to get this feature working out of the box.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
3 years agorpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 32bit)
Marek Szyprowski [Wed, 3 Jun 2020 12:43:44 +0000 (14:43 +0200)]
rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 32bit)

Create a non-cacheable mapping for the 0x600000000 physical memory region,
where MMIO registers for the PCIe XHCI controller are instantiated by the
PCIe bridge. Due to 32bit limit in the CPU virtual address space in ARM
32bit mode, this region is mapped at 0xff800000 CPU virtual address.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
3 years agommc: bcm283x: fix int to pointer cast
Seung-Woo Kim [Wed, 3 Jun 2020 12:43:43 +0000 (14:43 +0200)]
mmc: bcm283x: fix int to pointer cast

On build with 32 bit, there is a warning for int-to-pointer-cast.
Fix the int to pointer cast by using uintptr_t.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
3 years agoarm: provide a function for boards init code to modify MMU virtual-physical map
Marek Szyprowski [Wed, 3 Jun 2020 12:43:42 +0000 (14:43 +0200)]
arm: provide a function for boards init code to modify MMU virtual-physical map

Provide function for setting arbitrary virtual-physical MMU mapping
and cache settings for the given region.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoarm: update comments to the common style
Marek Szyprowski [Wed, 3 Jun 2020 12:43:41 +0000 (14:43 +0200)]
arm: update comments to the common style

Update the comments in include/asm/system.h to the common style.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agopowerpc: move ADDR_MAP to Kconfig
Marek Szyprowski [Wed, 3 Jun 2020 12:43:40 +0000 (14:43 +0200)]
powerpc: move ADDR_MAP to Kconfig

Move ADDR_MAP related config options from include/configs/*.h to the
proper place in lib/Kconfig. This has been done using
./tools/moveconfig.py and manual inspection of the generated changes.
This is a preparation to use ADDR_MAP helper on ARM 32bit Raspberry Pi4
board for mapping the PCIe XHCI MMIO, which is above the 4GiB identity
mapping limit.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoconfig: Enable USB Keyboard support on RPi4
Nicolas Saenz Julienne [Tue, 5 May 2020 14:51:29 +0000 (16:51 +0200)]
config: Enable USB Keyboard support on RPi4

Supporting USB keyboards out of the box is both handy for development
and production. Notably if u-boot is used to boot into GRUB.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[mb: drop rpi_4_32b_defconfig hunk]
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agousb: xhci: Add reset controller support
Nicolas Saenz Julienne [Mon, 29 Jun 2020 16:37:25 +0000 (18:37 +0200)]
usb: xhci: Add reset controller support

Some atypical users of xhci might need to manually reset their xHCI
controller before starting the HCD setup. Check if a reset controller
device is available to the PCI bus and trigger a reset.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
[mb: squash fix to only build xhci_reset_hw() if CONFIG_DM_BUS]
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agoconfigs: Enable support for reset controllers on RPi4
Nicolas Saenz Julienne [Mon, 29 Jun 2020 16:37:24 +0000 (18:37 +0200)]
configs: Enable support for reset controllers on RPi4

This is required in order to access the reset controller used to
initialize the board's xHCI chip.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agoreset: Add Raspberry Pi 4 firmware reset controller
Nicolas Saenz Julienne [Mon, 29 Jun 2020 16:37:23 +0000 (18:37 +0200)]
reset: Add Raspberry Pi 4 firmware reset controller

Raspberry Pi 4's co-processor controls some of the board's HW
initialization process, but it's up to Linux to trigger it when
relevant. Introduce a reset controller capable of interfacing with
RPi4's co-processor that models these firmware initialization routines as
reset lines.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agoarm: rpi: Add function to trigger VL805's firmware load
Nicolas Saenz Julienne [Mon, 29 Jun 2020 16:37:22 +0000 (18:37 +0200)]
arm: rpi: Add function to trigger VL805's firmware load

On the Raspberry Pi 4, after a PCI reset, VL805's (a xHCI chip) firmware
may either be loaded directly from an EEPROM or, if not present, by the
SoC's VideCore (the SoC's co-processor). Introduce the function that
informs VideCore that VL805 may need its firmware loaded.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agoconfigs: Enable support for the XHCI controller on RPI4 board (ARM 64-bit)
Marek Szyprowski [Mon, 25 May 2020 11:39:59 +0000 (13:39 +0200)]
configs: Enable support for the XHCI controller on RPI4 board (ARM 64-bit)

This requires enabling BRCMSTB PCIe and XHCI_PCI drivers as well as PCI
and USB commands. To get it working one has to call the following commands:
"pci enum; usb start;", thus such commands have been added to the default
"preboot" environment variable. One has to update their environment if it
is already configured to get this feature working out of the box.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agopci: Add driver for Broadcom BCM2711 SoC PCIe controller
Sylwester Nawrocki [Mon, 25 May 2020 11:39:58 +0000 (13:39 +0200)]
pci: Add driver for Broadcom BCM2711 SoC PCIe controller

This patch adds basic driver PCI Express controller found on Broadcom
set-top-box SoCs, e.g. BCM2711.
The code is based on Linux upstream driver (pcie-brcmstb.c) with MSI
handling removed. The inbound access memory region is not currently
parsed from dma-ranges DT property and a fixed 3GB region is used.

The patch has been tested on RPI4 board, i.e. on BCM2711 SoC with VL805
USB Host Controller.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agopci: Add some PCI Express capability register offset definitions
Sylwester Nawrocki [Mon, 25 May 2020 11:39:57 +0000 (13:39 +0200)]
pci: Add some PCI Express capability register offset definitions

Add PCI Express capability definitions required by the Broadcom
STB PCIe controller driver.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agolinux/bitfield.h: Add primitives for manipulating bitfields both in host- and fixed...
Nicolas Saenz Julienne [Mon, 25 May 2020 11:39:56 +0000 (13:39 +0200)]
linux/bitfield.h: Add primitives for manipulating bitfields both in host- and fixed-endian

Imports Al Viro's original Linux commit 00b0c9b82663a, which contains
an in depth explanation and two fixes from Johannes Berg:
 e7d4a95da86e0 "bitfield: fix *_encode_bits()",
 37a3862e12382 "bitfield: add u8 helpers".

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
[s.nawrocki: added empty lines between functions and macros]
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
[mb: squash fix including byteorder.h]
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
3 years agodoc: driver-model: Update SPI migration status
Jagan Teki [Thu, 9 Jul 2020 15:53:58 +0000 (21:23 +0530)]
doc: driver-model: Update SPI migration status

All SPI drivers are converted to DM_SPI but 3 drivers
still operate in nondm mode for SPL due to footprint
constraints.

Update the migration status for it.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agospi: kirkwood: Drop nondm code
Bhargav Shah [Thu, 18 Jun 2020 17:45:13 +0000 (23:15 +0530)]
spi: kirkwood: Drop nondm code

Drop the nondm code from kirkwood_spi.c since there
is no board or any other code using for it.

Signed-off-by: Bhargav Shah <bhargavshah1988@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agodtoc: add test for cd-gpios
Walter Lozano [Thu, 25 Jun 2020 04:10:17 +0000 (01:10 -0300)]
dtoc: add test for cd-gpios

Add a test for dtoc taking into account the cd-gpios property.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodtoc: update dtb_platdata to support cd-gpios
Walter Lozano [Thu, 25 Jun 2020 04:10:16 +0000 (01:10 -0300)]
dtoc: update dtb_platdata to support cd-gpios

Currently dtoc does not support the property cd-gpios used to declare
the gpios for card detect in mmc.

This patch adds support to cd-gpios property.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoarm: dts: include gpio nodes for card detect
Walter Lozano [Thu, 25 Jun 2020 04:10:15 +0000 (01:10 -0300)]
arm: dts: include gpio nodes for card detect

Several MMC drivers use GPIO for card detection with cd-gpios property in
the MMC node pointing to a GPIO node. However, as U-Boot tries to save
space by keeping only required nodes using u-boot* properties, several
devices tree result in having only in the MMC node but not the GPIO node
associated to cd-gpios.

This patch, fixes several ocurrence of this issue.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Adam Ford <aford173@gmail.com> #da850-evm
3 years agodm: doc: update of-plat with new phandle support
Walter Lozano [Thu, 25 Jun 2020 04:10:14 +0000 (01:10 -0300)]
dm: doc: update of-plat with new phandle support

Update documentation to reflect the new phandle support when OF_PLATDATA
is used. Now phandles are implemented as pointers to U_BOOT_DEVICE,
which makes it possible to get a pointer to the actual device.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodtoc: extend dtoc to use struct driver_info when linking nodes
Walter Lozano [Thu, 25 Jun 2020 04:10:13 +0000 (01:10 -0300)]
dtoc: extend dtoc to use struct driver_info when linking nodes

In the current implementation, when dtoc parses a dtb to generate a struct
platdata it converts the information related to linked nodes as pointers
to struct platdata of destination nodes. By doing this, it makes
difficult to get pointer to udevices created based on these
information.

This patch extends dtoc to use struct driver_info when populating
information about linked nodes, which makes it easier to later get
the devices created. In this context, reimplement functions like
clk_get_by_index_platdata() which made use of the previous approach.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: Move section u_boot_list to make it RW
Walter Lozano [Thu, 25 Jun 2020 04:10:12 +0000 (01:10 -0300)]
sandbox: Move section u_boot_list to make it RW

In order to be able to update data in u_boot_list, move this section to
make it RW.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocore: extend struct driver_info to point to device
Walter Lozano [Thu, 25 Jun 2020 04:10:11 +0000 (01:10 -0300)]
core: extend struct driver_info to point to device

Currently when creating an U_BOOT_DEVICE entry a struct driver_info
is declared, which contains the data needed to instantiate the device.
However, the actual device is created at runtime and there is no proper
way to get the device based on its struct driver_info.

This patch extends struct driver_info adding a pointer to udevice which
is populated during the bind process, allowing to generate a set of
functions to get the device based on its struct driver_info.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocore: drop const for struct driver_info
Walter Lozano [Thu, 25 Jun 2020 04:10:10 +0000 (01:10 -0300)]
core: drop const for struct driver_info

In order to prepare for a new support of phandle when OF_PLATDATA is used
drop the const for struct driver_info as this struct will need to be
updated on runtime.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodm: doc: update of-plat with the support for driver aliases
Walter Lozano [Thu, 25 Jun 2020 04:10:09 +0000 (01:10 -0300)]
dm: doc: update of-plat with the support for driver aliases

Update the documentation with the support for driver aliases using
U_BOOT_DRIVER_ALIAS.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodtoc: add option to disable warnings
Walter Lozano [Thu, 25 Jun 2020 04:10:08 +0000 (01:10 -0300)]
dtoc: add option to disable warnings

As dtoc now performs checks for valid driver names, when running dtoc
tests several warnings arise as these tests don't use valid driver
names.

This patch adds an option to disable those warning, which is only
intended for running tests.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodtoc: add support to scan drivers
Walter Lozano [Fri, 3 Jul 2020 11:07:17 +0000 (08:07 -0300)]
dtoc: add support to scan drivers

Currently dtoc scans dtbs to convert them to struct platdata and
to generate U_BOOT_DEVICE entries. These entries need to be filled
with the driver name, but at this moment the information used is the
compatible name present in the dtb. This causes that only nodes with
a compatible name that matches a driver name generate a working
entry.

In order to improve this behaviour, this patch adds to dtoc the
capability of scan drivers source code to generate a list of valid driver
names and aliases. This allows to generate U_BOOT_DEVICE entries using
valid driver names and rise a warning in the case a name is not valid.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Open files in utf-8 mode:
Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agocore: add support for U_BOOT_DRIVER_ALIAS
Walter Lozano [Thu, 25 Jun 2020 04:10:06 +0000 (01:10 -0300)]
core: add support for U_BOOT_DRIVER_ALIAS

Currently when using OF_PLATDATA the binding between devices and drivers
is done trying to match the compatible string in the node with a driver
name. However, usually a single driver supports multiple compatible strings
which causes that only devices which its compatible string matches a
driver name get bound.

To overcome this issue, this patch adds the U_BOOT_DRIVER_ALIAS macro,
which generates no code at all, but allows an easy way to declare driver
name aliases. Thanks to this, dtoc could be improve to look for the driver
name based on its alias when it populates the U_BOOT_DEVICE entry.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodtoc: add missing code comments
Walter Lozano [Thu, 25 Jun 2020 04:10:05 +0000 (01:10 -0300)]
dtoc: add missing code comments

Add missing information about internal class members in order to make
the code easier to follow.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodrivers: rename drivers to match compatible string
Walter Lozano [Thu, 25 Jun 2020 04:10:04 +0000 (01:10 -0300)]
drivers: rename drivers to match compatible string

When using OF_PLATDATA, the bind process between devices and drivers
is performed trying to match compatible string with driver names.
However driver names are not strictly defined, and also there are different
names used when declaring a driver with U_BOOT_DRIVER, the name of the
symbol used in the linker list and the used in the struct driver_info.

In order to make things a bit more clear, rename the drivers names. This
will also help for further OF_PLATDATA improvements, such as checking
for valid driver names.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Add a fix for sandbox of-platdata to avoid using an invalid ANSI colour:
Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agotest/dm: fdtdec: Add tests for fdtdec_add_reserved_memory()
Bin Meng [Tue, 23 Jun 2020 05:55:49 +0000 (22:55 -0700)]
test/dm: fdtdec: Add tests for fdtdec_add_reserved_memory()

This adds a test case to test the functionality of the fdtdec API
fdtdec_add_reserved_memory().

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agotest/dm: fdtdec: Corect a typo in dm_test_fdtdec_set_carveout()
Bin Meng [Tue, 23 Jun 2020 05:55:48 +0000 (22:55 -0700)]
test/dm: fdtdec: Corect a typo in dm_test_fdtdec_set_carveout()

It should be "writable".

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agotest/dm: fdtdec: Add the missing gd declaration
Bin Meng [Tue, 23 Jun 2020 05:55:47 +0000 (22:55 -0700)]
test/dm: fdtdec: Add the missing gd declaration

Add DECLARE_GLOBAL_DATA_PTR since it is referenced in the test codes.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocmd: fdt: remove CMD_FDT_MAX_DUMP
Heinrich Schuchardt [Fri, 19 Jun 2020 17:45:55 +0000 (19:45 +0200)]
cmd: fdt: remove CMD_FDT_MAX_DUMP

When printing the device tree we want to get an output that can be used as
input for the device tree compiler. This requires that we do not write
bogus lines like

    pcie@10000000 {
            interrupt-map = * 0x4000127c [0x00000280];

For instance the QEMU virt device has a property interrupt-map with 640
bytes which exceeds CMD_FDT_MAX_DUMP=64.

So lets do away with the artificial limitation to 64 bytes.

As indicated in commit f0a29d43313c ("fdt: Limit printed hex in fdt print
and list commands") if a device tree contains binary blobs, it may still
be desirable to limit the output length. Provide environment variable
fdt_max_dump for this purpose.

Fixes: 5d927b428622 ("Kconfig: Drop CONFIG_CMD_FDT_MAX_DUMP")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolog: use BIT() instead of 1 <<
Heinrich Schuchardt [Wed, 17 Jun 2020 19:52:45 +0000 (21:52 +0200)]
log: use BIT() instead of 1 <<

Use the BIT() macro when creating a bitmask for the logging fields.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolog: don't show function by default
Heinrich Schuchardt [Wed, 17 Jun 2020 19:52:44 +0000 (21:52 +0200)]
log: don't show function by default

The name of the function emitting a log message may be of interest for a
developer but is distracting for normal users. See the example below:

    try_load_entry() Booting: Debian

Make the default format for log messages customizable. By default show
only the message text.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocheckpatch: Don't warn about PREFER_IF in headers/DT files
Simon Glass [Sun, 14 Jun 2020 16:54:08 +0000 (10:54 -0600)]
checkpatch: Don't warn about PREFER_IF in headers/DT files

This warning should only be displayed for C files. Fix it and update the
test.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Add tests for the rest of the checkpatch checks
Simon Glass [Sun, 14 Jun 2020 16:54:07 +0000 (10:54 -0600)]
patman: Add tests for the rest of the checkpatch checks

Finish off the tests for our small collection of checkpatch checks.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Decode output from the '--show-types' option
Simon Glass [Sun, 14 Jun 2020 16:54:06 +0000 (10:54 -0600)]
patman: Decode output from the '--show-types' option

Collect the 'checkpatch type' from each error, warning and check. Provide
this to patman and update the uclass test to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Add a test for the 'possible new uclass' check
Simon Glass [Sun, 14 Jun 2020 16:54:05 +0000 (10:54 -0600)]
patman: Add a test for the 'possible new uclass' check

It is quite likely that the number of U-Boot-specific tests in
checkpatch.pl will increase over time. We should have tests for these to
avoid undefined behaviour and bugs being introduced, which might cause
people to ignore the warnings.

Add a simple new class that can generate a patch with a single-line
addition in it. Use that to add a test for one of the checkpatch checks.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Rename test.py to test_checkpatch.py
Simon Glass [Sun, 14 Jun 2020 16:54:04 +0000 (10:54 -0600)]
patman: Rename test.py to test_checkpatch.py

These tests check checkpatch.pl operation and can server as our tests for
the U-Boot-specific updates to that script. Rename the file and update
comments to indicate this.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodm: core: Correct comment on uclass_id_foreach_dev()
Simon Glass [Sun, 14 Jun 2020 14:48:39 +0000 (08:48 -0600)]
dm: core: Correct comment on uclass_id_foreach_dev()

This parameter should be a struct uclass, not struct udevice. Correct it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-By: Michael Trimarchi <michael@amarulasolutions.com>
3 years agolog: uclass_get_name() depends on CONFIG_SPL_DM
Heinrich Schuchardt [Mon, 8 Jun 2020 16:04:22 +0000 (18:04 +0200)]
log: uclass_get_name() depends on CONFIG_SPL_DM

If CONFIG_SPL_DM=n and CONFIG_SPL_LOG=y a build error occurs:

ld.bfd: common/built-in.o: in function `log_get_cat_name':
common/log.c:48: undefined reference to `uclass_get_name'
make[1]: *** [scripts/Makefile.spl:422: spl/u-boot-spl] Error 1

Call uclass_get_name() only if DM is enabled.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: make RAM size configurable
Heinrich Schuchardt [Sun, 7 Jun 2020 16:47:35 +0000 (18:47 +0200)]
sandbox: make RAM size configurable

Up to now the RAM size of the sandbox is hard coded as 128 MiB. This does
not allow testing the correct handling of addresses outside the 32bit
range. 128 MiB is also rather small when tracing functions where the trace
is written to RAM.

Provide configuration variable CONFIG_SANDBOX_RAM_SIZE_MB to set the RAM
size in MiB. It defaults to 128 MiB with a minimum of 64 MiB.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Drop import of test_util in test_util
Simon Glass [Sun, 7 Jun 2020 12:45:50 +0000 (06:45 -0600)]
patman: Drop import of test_util in test_util

This module doesn't need to import itself. It causes problems on
very old Python 3 (e.g. 3.4.0). Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Avoid importing gitutil in settings
Simon Glass [Sun, 7 Jun 2020 12:45:49 +0000 (06:45 -0600)]
patman: Avoid importing gitutil in settings

Pass this module in so that settings does not need to import it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Stefan Bosch <stefan_b@posteo.net>
3 years agopatman: Pass in maintainer dirs to avoid and import
Simon Glass [Sun, 7 Jun 2020 12:45:48 +0000 (06:45 -0600)]
patman: Pass in maintainer dirs to avoid and import

Adjust the get_maintainer module to accept a list of directories to search
for the script. This avoids needing to import gitutil.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Stefan Bosch <stefan_b@posteo.net>
3 years agopatman: Use a dict in gitutil to avoid importing series
Simon Glass [Sun, 7 Jun 2020 12:45:47 +0000 (06:45 -0600)]
patman: Use a dict in gitutil to avoid importing series

Only a few members of this class are used and only in a test. To avoid
importing the module, convert the test to use a dict.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Stefan Bosch <stefan_b@posteo.net>
3 years agopatman: Avoid circular dependency between command and tools
Simon Glass [Sun, 7 Jun 2020 12:45:46 +0000 (06:45 -0600)]
patman: Avoid circular dependency between command and tools

This seems to cause problems in some cases. Split the dependency by
copying the code to command.

Reported-by: Stefan Bosch <stefan_b@posteo.net>
Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Drop unnecessary import in gitutil
Simon Glass [Sun, 7 Jun 2020 12:45:45 +0000 (06:45 -0600)]
patman: Drop unnecessary import in gitutil

The checkpatch module is not used, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Stefan Bosch <stefan_b@posteo.net>
3 years agosandbox: spi: sandbox_sf_state_name() is required
Heinrich Schuchardt [Sun, 7 Jun 2020 07:27:51 +0000 (09:27 +0200)]
sandbox: spi: sandbox_sf_state_name() is required

Compiling drivers/mtd/spi/sandbox.c fails when compiled with
CONFIG_LOG=n:

In file included from include/common.h:20,
                 from drivers/mtd/spi/sandbox.c:13:
drivers/mtd/spi/sandbox.c:295:15: error: format ‘%s’ expects argument of
type ‘char *’, but argument 7 has type ‘int’ [-Werror=format=]
  295 |   log_content(" cmd: transition to %s state\n",
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:37:21: note: in definition of macro ‘pr_fmt’
   37 | #define pr_fmt(fmt) fmt
      |                     ^~~
include/log.h:128:30: note: in expansion of macro ‘log_nop’
  128 | #define log_content(_fmt...) log_nop(LOG_CATEGORY, \
      |                              ^~~~~~~
drivers/mtd/spi/sandbox.c:295:3: note: in expansion of macro
‘log_content’
  295 |   log_content(" cmd: transition to %s state\n",
      |   ^~~~~~~~~~~
drivers/mtd/spi/sandbox.c:295:37: note: format string is defined here
  295 |   log_content(" cmd: transition to %s state\n",
      |                                    ~^
      |                                     |
      |                                     char *
      |                                    %d

Supply function sandbox_sf_state_name() independent of CONFIG_LOG.

Fixes: c3aed5db591e ("sandbox: spi: Add more logging")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agosandbox: handling out of memory
Heinrich Schuchardt [Thu, 4 Jun 2020 17:28:22 +0000 (19:28 +0200)]
sandbox: handling out of memory

assert() only works in debug mode. So checking a successful memory
allocation should not use assert().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agomtd: spi-nor: Enable QE bit for ISSI flash in case of SFDP
Pragnesh Patel [Sun, 21 Jun 2020 11:52:18 +0000 (17:22 +0530)]
mtd: spi-nor: Enable QE bit for ISSI flash in case of SFDP

Enable QE bit for ISSI flash chips.

QE enablement logic is similar to what Macronix
has, so reuse the existing code itself.

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agospi: add support for all spi modes with soft spi
Johannes Holland [Mon, 11 May 2020 13:22:26 +0000 (15:22 +0200)]
spi: add support for all spi modes with soft spi

The spi bitbanging driver did not implement all spi modes properly. Add
code to support all spi modes, honoring soft_spi_set_mode() and
defaulting to spi mode 0. Previously, CPHA was implemented inversely
(defaulting to CPHA=1) and CPOL=1 was hardcoded.

Signed-off-by: Johannes Holland <johannes.holland@infineon.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agoarm: Remove mx31pdk board
Jagan Teki [Wed, 8 Jul 2020 18:52:35 +0000 (00:22 +0530)]
arm: Remove mx31pdk board

DM, OF_CONTROL, DM_SPI and other driver model migration
deadlines are expired for this board.

Remove it.

Acked-by: Magnus Lilja <lilja.magnus@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agospi: omap3: Drop nondm code
Jagan Teki [Wed, 27 May 2020 12:56:36 +0000 (18:26 +0530)]
spi: omap3: Drop nondm code

Now all boards are using this omap3 spi driver in
dm model, so drop the nondm code.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agodb-88f6281-bp-nand: Enable DM_SPI/SPI_FLASH
Jagan Teki [Thu, 18 Jun 2020 17:45:15 +0000 (23:15 +0530)]
db-88f6281-bp-nand: Enable DM_SPI/SPI_FLASH

Enable DM_SPI, DM_SPI_FLASH for db-88f6281-bp-nand board.

Cc: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agoarm: Remove pengwyn board
Jagan Teki [Tue, 7 Jul 2020 15:54:00 +0000 (21:24 +0530)]
arm: Remove pengwyn board

OF_CONTROL, DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Cc: Lothar Felten <lothar.felten@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agoarm: Remove pepper board
Jagan Teki [Tue, 7 Jul 2020 15:51:52 +0000 (21:21 +0530)]
arm: Remove pepper board

OF_CONTROL, DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Cc: Ash Charles <ash@gumstix.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
3 years agoarm: Remove bav335x board
Jagan Teki [Tue, 7 Jul 2020 15:49:39 +0000 (21:19 +0530)]
arm: Remove bav335x board

OF_CONTROL, DM_SPI and other driver model migration deadlines
are expired for this board.

Remove it.

Cc: Gilles Gameiro <gilles@gigadevices.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>