[PATCH v6 04/13] dm: Introduce xxx_get_dma_range()

2021-01-12 Thread Nicolas Saenz Julienne
and to address spaces. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass Tested-by: Peter Robinson --- common/fdt_support.c | 73 +++ drivers/core/of_addr.c | 78 ++ drivers/core/ofnode.c | 9 + drivers/core

[PATCH v6 07/13] dm: test: Add test case for dev->dma_offset

2021-01-12 Thread Nicolas Saenz Julienne
Add test to validate dev->dma_offset is properly set on devices. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass Tested-by: Peter Robinson --- arch/sandbox/dts/test.dts | 4 configs/sandbox64_defconfig| 1 + configs/sandbox_defconfig |

Re: [PATCH 4/8] dm: Introduce xxx_get_dma_range()

2020-12-09 Thread Nicolas Saenz Julienne
On Wed, 2020-12-09 at 13:58 +0100, Matthias Brugger wrote: [...] > > + > > + /* switch to that node */ > > + parent = of_get_parent(dev); > > + if (!parent) { > > + printf("Found dma-ranges in root node, shoudln't happen\n"); > > + ret = -EINVAL; > > + goto out;

Re: [PATCH 4/8] dm: Introduce xxx_get_dma_range()

2020-12-09 Thread Nicolas Saenz Julienne
On Wed, 2020-12-09 at 17:30 +0100, Nicolas Saenz Julienne wrote: > On Wed, 2020-12-09 at 13:58 +0100, Matthias Brugger wrote: > [...] > > > + > > > + /* switch to that node */ > > > + parent = of_get_parent(dev); > > > + if (!parent) { > > &

[PATCH v2 1/8] rpi: Add identifier for the new RPi400

2020-12-10 Thread Nicolas Saenz Julienne
The Raspberry Pi Foundation released the new RPi400 which we want to detect, so we can enable Ethernet on it and know the correct device tree file name. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: - The RPi Foundation introduced a RPi400 specific device tree, so use

[PATCH v2 5/8] dm: Introduce DMA constraints into the core device model

2020-12-10 Thread Nicolas Saenz Julienne
initialization, parse it before the probe call an provide the DMA offset in 'struct udevice' for the address translation code to use it. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: - Update commit message so as to explain better the reasoning behind this drivers/core/device.c

[PATCH v2 2/8] rpi: Add identifier for the new CM4

2020-12-10 Thread Nicolas Saenz Julienne
when using custom ones. Signed-off-by: Nicolas Saenz Julienne --- board/raspberrypi/rpi/rpi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index b66698e4a9..abcf41a5a8 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board

[PATCH v2 6/8] dm: Introduce dev_phys_to_bus()/dev_bus_to_phys()

2020-12-10 Thread Nicolas Saenz Julienne
are not integrated into the device model. Signed-off-by: Nicolas Saenz Julienne --- include/phys2bus.h | 16 1 file changed, 16 insertions(+) diff --git a/include/phys2bus.h b/include/phys2bus.h index dc9b8e5a25..a380063af4 100644 --- a/include/phys2bus.h +++ b/include/phys2bus.h

[PATCH v2 4/8] dm: Introduce xxx_get_dma_range()

2020-12-10 Thread Nicolas Saenz Julienne
and to address spaces. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: - Fix wrong arguments in of_get_dma_range()'s call to of_translate_dma_address() - Fix build in SPL/TPL and no LIBFDT supprt - Add missing declaration in 'core/read.c' - Address Matthias' comments common

[PATCH v2 0/8] Raspberry Pi 400/Compute Module 4 support

2020-12-10 Thread Nicolas Saenz Julienne
()' - Fix some typos in commit messages - Change DTB file name for RPi400 - Address Matthias' comments Nicolas Saenz Julienne (8): rpi: Add identifier for the new RPi400 rpi: Add identifier for the new CM4 pci: pcie-brcmstb: Fix inbound window configurations dm: Introduce

[PATCH v2 8/8] mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()

2020-12-10 Thread Nicolas Saenz Julienne
This will allow us to use DM variants of phys_to_bus()/bus_to_phys() when relevant. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/sdhci.c | 7 --- include/mmc.h | 10 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc

[PATCH v2 7/8] xhci: translate virtual addresses into the bus's address space

2020-12-10 Thread Nicolas Saenz Julienne
xhci_virt_to_bus() and xhci_bus_to_virt() to cater with these limitations, and make sure we don't break non DM users. Signed-off-by: Nicolas Saenz Julienne --- drivers/usb/host/xhci-mem.c | 45 +++- drivers/usb/host/xhci-ring.c | 11 + drivers/usb/host/xhci.c

[PATCH v2 3/8] pci: pcie-brcmstb: Fix inbound window configurations

2020-12-10 Thread Nicolas Saenz Julienne
load operation, which is handled by the co-processor after u-boot has correctly configured the PCIe controller). Signed-off-by: Nicolas Saenz Julienne --- drivers/pci/pcie_brcmstb.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pci/pcie_brcmstb.c b

Re: [PATCH 1/8] rpi: Add identifier for the new RPi400

2020-12-01 Thread Nicolas Saenz Julienne
Hi Matthias, thanks for the review! On Tue, 2020-12-01 at 17:55 +0100, Matthias Brugger wrote: > > On 19/11/2020 18:48, Nicolas Saenz Julienne wrote: > > The Raspberry Pi Foundation released the new RPi400 which we want to > > detect, so we can enable Ethernet on it and know

Re: [PATCH 4/8] dm: Introduce xxx_get_dma_range()

2020-12-10 Thread Nicolas Saenz Julienne
Hi Peter, On Thu, 2020-12-10 at 17:03 +, Peter Robinson wrote: > Hi Nicolas, > > > On Thu, Nov 19, 2020 at 5:50 PM Nicolas Saenz Julienne > wrote: > > > > Add the follwing functions to get a specific device's DMA ranges: > >  - dev_get_dma_ra

Re: [PATCH v3 11/12] mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()

2020-12-21 Thread Nicolas Saenz Julienne
On Mon, 2020-12-21 at 09:47 -0700, Simon Glass wrote: > Hi Nicolas, > > On Mon, 21 Dec 2020 at 07:23, Nicolas Saenz Julienne > wrote: > > > > On Fri, 2020-12-18 at 19:28 -0700, Simon Glass wrote: > > > On Tue, 15 Dec 2020 at 10:23, Ni

[PATCH v5 06/13] dm: Introduce DMA constraints into the core device model

2020-12-23 Thread Nicolas Saenz Julienne
initialization, parse it before the probe call an provide the DMA offset in 'struct udevice' for the address translation code to use it. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v4: - Use macros to access dma_offset Changes since v3: - Comment functions

[PATCH v5 05/13] dm: test: Add test case for dev_get_dma_ranges()

2020-12-23 Thread Nicolas Saenz Julienne
Introduce some new nodes in sandbox's test device-tree and dm tests in order to validate dev_get_dma_range(). Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v3: - Use ut_assertok() instead of ut_assert(!func()) arch/sandbox/dts/test.dts | 17

[PATCH v5 03/13] pci: pcie-brcmstb: Fix inbound window configurations

2020-12-23 Thread Nicolas Saenz Julienne
load operation, which is handled by the co-processor after u-boot has correctly configured the PCIe controller). Signed-off-by: Nicolas Saenz Julienne --- drivers/pci/pcie_brcmstb.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pci/pcie_brcmstb.c b

[PATCH v5 00/13] Raspberry Pi 400/Compute Module 4 support

2020-12-23 Thread Nicolas Saenz Julienne
400 - Address Matthias' comments Nicolas Saenz Julienne (13): rpi: Add identifier for the new RPi400 rpi: Add identifier for the new CM4 pci: pcie-brcmstb: Fix inbound window configurations dm: Introduce xxx_get_dma_range() dm: test: Add test case for dev_get_dma_ranges() dm: Introduce D

[PATCH v5 02/13] rpi: Add identifier for the new CM4

2020-12-23 Thread Nicolas Saenz Julienne
when using custom ones. Signed-off-by: Nicolas Saenz Julienne --- board/raspberrypi/rpi/rpi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index b66698e4a9..abcf41a5a8 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board

[PATCH v5 01/13] rpi: Add identifier for the new RPi400

2020-12-23 Thread Nicolas Saenz Julienne
The Raspberry Pi Foundation released the new RPi400 which we want to detect, so we can enable Ethernet on it and know the correct device tree file name. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: - The RPi Foundation introduced a RPi400 specific device tree, so use

[PATCH v5 09/13] dm: test: Add test case for dev_phys_to_bus()/dev_bus_to_phys()

2020-12-23 Thread Nicolas Saenz Julienne
By reusing DT nodes already available in sandbox's test DT introduce a test to validate dev_phys_to_bus()/dev_bus_to_phys(). Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v3: - Use ut_assertok() instead of ut_assert(!func()) - Use ut_assert_addr() test/dm

[PATCH v5 10/13] xhci: translate virtual addresses into the bus's address space

2020-12-23 Thread Nicolas Saenz Julienne
xhci_virt_to_bus() and xhci_bus_to_virt() to cater with these limitations, and make sure we don't break non DM users. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass Reviewed-by: Stefan Roese --- Changes since v4: - Introduce macro to access ctrl->dev - No need to make c

[PATCH v5 08/13] dm: Introduce dev_phys_to_bus()/dev_bus_to_phys()

2020-12-23 Thread Nicolas Saenz Julienne
are not integrated into the device model. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass Reviewed-by: Stefan Roese --- Changes since v4: - Introduce macros for !DM case to make API usage cleaner Changes since v2: - Use CONFIG_DM_DMA include/phys2bus.h | 17 + 1 file

[PATCH v5 07/13] dm: test: Add test case for dev->dma_offset

2020-12-23 Thread Nicolas Saenz Julienne
Add test to validate dev->dma_offset is properly set on devices. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v3: - Use ut_assertok() instead of ut_assert(!func()) arch/sandbox/dts/test.dts | 4 configs/sandbox64_defconfig|

[PATCH v5 04/13] dm: Introduce xxx_get_dma_range()

2020-12-23 Thread Nicolas Saenz Julienne
and to address spaces. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v2: - Return ENOENT instead of ENODEV - Refcount of nodes Changes since v1: - Fix wrong arguments in of_get_dma_range()'s call to of_translate_dma_address() - Fix build in SPL/TPL and no LIBFDT

[PATCH v5 11/13] mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()

2020-12-23 Thread Nicolas Saenz Julienne
This will allow us to use DM variants of phys_to_bus()/bus_to_phys() when relevant. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v4: - Introduce mmc->dev access macros to avoid ifdefs - No need to create mmc_phys_to_bus() Changes since v3: - Don't c

[PATCH v5 12/13] configs: rpi4: Enable DM_DMA across all RPi4 configurations

2020-12-23 Thread Nicolas Saenz Julienne
The DM_DMA option is needed in order to translate physical address into bus addresses on a per-device basis. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- configs/rpi_4_32b_defconfig | 1 + configs/rpi_4_defconfig | 1 + configs/rpi_arm64_defconfig | 1 + 3 files

[PATCH v5 13/13] video: arm: rpi: Add brcm,bcm2711-hdmi0 compatible

2020-12-23 Thread Nicolas Saenz Julienne
The 'brcm,bcm2711-hdmi0' compatible string is used on RPi4 instead of 'brcm,bcm2835-hdmi' since the IP core was upgraded (now called VC6 instead of VC4). This has no functional change as far as u-boot driver is concerned. So simply add the compatible string. Signed-off-by: Nicolas Saenz Julienne

Re: [PATCH v5 10/13] xhci: translate virtual addresses into the bus's address space

2020-12-24 Thread Nicolas Saenz Julienne
On Wed, 2020-12-23 at 19:55 +0100, Nicolas Saenz Julienne wrote: > So far we've been content with passing physical addresses when > configuring memory addresses into XHCI controllers, but not all > platforms have buses with transparent mappings. Specifically the > Raspberry Pi 4 mig

Re: [PATCH v3 04/12] dm: Introduce xxx_get_dma_range()

2020-12-21 Thread Nicolas Saenz Julienne
Hi Simon, thanks for the review. On Fri, 2020-12-18 at 19:28 -0700, Simon Glass wrote: > Hi Nicolas, > > On Tue, 15 Dec 2020 at 10:23, Nicolas Saenz Julienne > wrote: > > > > Add the following functions to get a specific device's DMA ranges:

Re: [PATCH v3 09/12] dm: test: Add test case for dev_phys_to_bus()/dev_bus_to_phys()

2020-12-21 Thread Nicolas Saenz Julienne
On Fri, 2020-12-18 at 19:28 -0700, Simon Glass wrote: > On Tue, 15 Dec 2020 at 10:23, Nicolas Saenz Julienne > wrote: > > > > By reusing DT nodes already available in sandbox's test DT introduce a > > test to validate dev_phys_to_bus()/dev_bus_to_phys(). > > &g

Re: [PATCH v3 11/12] mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()

2020-12-21 Thread Nicolas Saenz Julienne
On Fri, 2020-12-18 at 19:28 -0700, Simon Glass wrote: > On Tue, 15 Dec 2020 at 10:23, Nicolas Saenz Julienne > wrote: > > > > This will allow us to use DM variants of phys_to_bus()/bus_to_phys() > > when relevant. > > > > Signed-off-by: Nicolas Saenz Julien

Re: [PATCH v3 07/12] dm: test: Add test case for dev->dma_offset

2020-12-21 Thread Nicolas Saenz Julienne
On Fri, 2020-12-18 at 19:28 -0700, Simon Glass wrote: > On Tue, 15 Dec 2020 at 10:23, Nicolas Saenz Julienne > wrote: > > > > Add test to validate dev->dma_offset is properly set on devices. > > > > Signed-off-by: Nicolas Saenz Julienne > > --- >

Re: [PATCH v3 10/12] xhci: translate virtual addresses into the bus's address space

2020-12-21 Thread Nicolas Saenz Julienne
On Fri, 2020-12-18 at 19:28 -0700, Simon Glass wrote: > Hi Nicolas, > > On Tue, 15 Dec 2020 at 10:23, Nicolas Saenz Julienne > wrote: > > > > So far we've been content with passing physical addresses when > > configuring memory addresses into XHCI controllers,

[PATCH v3 05/12] dm: test: Add test case for dev_get_dma_ranges()

2020-12-15 Thread Nicolas Saenz Julienne
Introduce some new nodes in sandbox's test device-tree and dm tests in order to validate dev_get_dma_range(). Signed-off-by: Nicolas Saenz Julienne --- arch/sandbox/dts/test.dts | 17 ++ test/dm/Makefile | 1 + test/dm/read.c| 49

[PATCH v3 02/12] rpi: Add identifier for the new CM4

2020-12-15 Thread Nicolas Saenz Julienne
when using custom ones. Signed-off-by: Nicolas Saenz Julienne --- board/raspberrypi/rpi/rpi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index b66698e4a9..abcf41a5a8 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board

[PATCH v3 00/12] Raspberry Pi 400/Compute Module 4 support

2020-12-15 Thread Nicolas Saenz Julienne
- Address Matthias' comments Nicolas Saenz Julienne (12): rpi: Add identifier for the new RPi400 rpi: Add identifier for the new CM4 pci: pcie-brcmstb: Fix inbound window configurations dm: Introduce xxx_get_dma_range() dm: test: Add test case for dev_get_dma_ranges() dm: Introduce DMA

[PATCH v3 01/12] rpi: Add identifier for the new RPi400

2020-12-15 Thread Nicolas Saenz Julienne
The Raspberry Pi Foundation released the new RPi400 which we want to detect, so we can enable Ethernet on it and know the correct device tree file name. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: - The RPi Foundation introduced a RPi400 specific device tree, so use

[PATCH v3 10/12] xhci: translate virtual addresses into the bus's address space

2020-12-15 Thread Nicolas Saenz Julienne
xhci_virt_to_bus() and xhci_bus_to_virt() to cater with these limitations, and make sure we don't break non DM users. Signed-off-by: Nicolas Saenz Julienne --- drivers/usb/host/xhci-mem.c | 45 +++- drivers/usb/host/xhci-ring.c | 11 + drivers/usb/host/xhci.c

[PATCH v3 09/12] dm: test: Add test case for dev_phys_to_bus()/dev_bus_to_phys()

2020-12-15 Thread Nicolas Saenz Julienne
By reusing DT nodes already available in sandbox's test DT introduce a test to validate dev_phys_to_bus()/dev_bus_to_phys(). Signed-off-by: Nicolas Saenz Julienne --- test/dm/Makefile | 1 + test/dm/phys2bus.c | 36 2 files changed, 37 insertions

[PATCH v3 12/12] configs: rpi4: Enable DM_DMA across all RPi4 configurations

2020-12-15 Thread Nicolas Saenz Julienne
The DM_DMA option is needed in order to translate physical address into bus addresses on a per-device basis. Signed-off-by: Nicolas Saenz Julienne --- configs/rpi_4_32b_defconfig | 1 + configs/rpi_4_defconfig | 1 + configs/rpi_arm64_defconfig | 1 + 3 files changed, 3 insertions(+) diff

[PATCH v3 11/12] mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()

2020-12-15 Thread Nicolas Saenz Julienne
This will allow us to use DM variants of phys_to_bus()/bus_to_phys() when relevant. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/sdhci.c | 7 --- include/mmc.h | 10 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc

[PATCH v3 08/12] dm: Introduce dev_phys_to_bus()/dev_bus_to_phys()

2020-12-15 Thread Nicolas Saenz Julienne
are not integrated into the device model. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v2: - Use CONFIG_DM_DMA include/phys2bus.h | 16 1 file changed, 16 insertions(+) diff --git a/include/phys2bus.h b/include/phys2bus.h index dc9b8e5a25

[PATCH v3 04/12] dm: Introduce xxx_get_dma_range()

2020-12-15 Thread Nicolas Saenz Julienne
and to address spaces. Signed-off-by: Nicolas Saenz Julienne --- Changes since v2: - Return ENOENT instead of ENODEV - Refcount OF nodes Changes since v1: - Fix wrong arguments in of_get_dma_range()'s call to of_translate_dma_address() - Fix build in SPL/TPL and no LIBFDT supprt - Add missing

[PATCH v3 06/12] dm: Introduce DMA constraints into the core device model

2020-12-15 Thread Nicolas Saenz Julienne
initialization, parse it before the probe call an provide the DMA offset in 'struct udevice' for the address translation code to use it. Signed-off-by: Nicolas Saenz Julienne --- Changes since v2: - Return/Fail on error - Add config option - use ulong instead for u64 for dev->dma_offset Chan

[PATCH v3 07/12] dm: test: Add test case for dev->dma_offset

2020-12-15 Thread Nicolas Saenz Julienne
Add test to validate dev->dma_offset is properly set on devices. Signed-off-by: Nicolas Saenz Julienne --- arch/sandbox/dts/test.dts | 4 configs/sandbox64_defconfig| 1 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + conf

[PATCH v3 03/12] pci: pcie-brcmstb: Fix inbound window configurations

2020-12-15 Thread Nicolas Saenz Julienne
load operation, which is handled by the co-processor after u-boot has correctly configured the PCIe controller). Signed-off-by: Nicolas Saenz Julienne --- drivers/pci/pcie_brcmstb.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pci/pcie_brcmstb.c b

[PATCH v4 02/13] rpi: Add identifier for the new CM4

2020-12-22 Thread Nicolas Saenz Julienne
when using custom ones. Signed-off-by: Nicolas Saenz Julienne --- board/raspberrypi/rpi/rpi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index b66698e4a9..abcf41a5a8 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board

[PATCH v4 05/13] dm: test: Add test case for dev_get_dma_ranges()

2020-12-22 Thread Nicolas Saenz Julienne
Introduce some new nodes in sandbox's test device-tree and dm tests in order to validate dev_get_dma_range(). Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v3: - Use ut_assertok() instead of ut_assert(!func()) arch/sandbox/dts/test.dts | 17

[PATCH v4 03/13] pci: pcie-brcmstb: Fix inbound window configurations

2020-12-22 Thread Nicolas Saenz Julienne
load operation, which is handled by the co-processor after u-boot has correctly configured the PCIe controller). Signed-off-by: Nicolas Saenz Julienne --- drivers/pci/pcie_brcmstb.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pci/pcie_brcmstb.c b

[PATCH v4 04/13] dm: Introduce xxx_get_dma_range()

2020-12-22 Thread Nicolas Saenz Julienne
and to address spaces. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v2: - Return ENOENT instead of ENODEV - Refcount of nodes Changes since v1: - Fix wrong arguments in of_get_dma_range()'s call to of_translate_dma_address() - Fix build in SPL/TPL and no LIBFDT

[PATCH v4 08/13] dm: Introduce dev_phys_to_bus()/dev_bus_to_phys()

2020-12-22 Thread Nicolas Saenz Julienne
are not integrated into the device model. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v2: - Use CONFIG_DM_DMA include/phys2bus.h | 16 1 file changed, 16 insertions(+) diff --git a/include/phys2bus.h b/include/phys2bus.h index dc9b8e5a25

[PATCH v4 07/13] dm: test: Add test case for dev->dma_offset

2020-12-22 Thread Nicolas Saenz Julienne
Add test to validate dev->dma_offset is properly set on devices. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v3: - Use ut_assertok() instead of ut_assert(!func()) arch/sandbox/dts/test.dts | 4 configs/sandbox64_defconfig|

[PATCH v4 09/13] dm: test: Add test case for dev_phys_to_bus()/dev_bus_to_phys()

2020-12-22 Thread Nicolas Saenz Julienne
By reusing DT nodes already available in sandbox's test DT introduce a test to validate dev_phys_to_bus()/dev_bus_to_phys(). Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v3: - Use ut_assertok() instead of ut_assert(!func()) - Use ut_assert_addr() test/dm

[PATCH v4 11/13] mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()

2020-12-22 Thread Nicolas Saenz Julienne
This will allow us to use DM variants of phys_to_bus()/bus_to_phys() when relevant. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v3 - Don't call phys_to_bus()/bus_to_phys(), we only support DM drivers/mmc/sdhci.c | 7 --- include/mmc.h | 10

[PATCH v4 06/13] dm: Introduce DMA constraints into the core device model

2020-12-22 Thread Nicolas Saenz Julienne
initialization, parse it before the probe call an provide the DMA offset in 'struct udevice' for the address translation code to use it. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v2: - Comment functions and struct variables - Correct typos Changes since v2

[PATCH v4 00/13] Raspberry Pi 400/Compute Module 4 support

2020-12-22 Thread Nicolas Saenz Julienne
all DM changes - Make code conditional with config option - Correct OF refcount - Add config changes - Address small changes as per reviews Changes since v1: - Fix some issues in 'dm: Introduce xxx_get_dma_range()' - Fix some typos in commit messages - Change DTB file name for RPi400 - Address Matthi

[PATCH v4 01/13] rpi: Add identifier for the new RPi400

2020-12-22 Thread Nicolas Saenz Julienne
The Raspberry Pi Foundation released the new RPi400 which we want to detect, so we can enable Ethernet on it and know the correct device tree file name. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: - The RPi Foundation introduced a RPi400 specific device tree, so use

[PATCH v4 10/13] xhci: translate virtual addresses into the bus's address space

2020-12-22 Thread Nicolas Saenz Julienne
xhci_virt_to_bus() and xhci_bus_to_virt() to cater with these limitations, and make sure we don't break non DM users. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- Changes since v3: - Don't call phys_to_bus()/bus_to_phys(), we only support DM drivers/usb/host/xhci-mem.c | 45

[PATCH v4 12/13] configs: rpi4: Enable DM_DMA across all RPi4 configurations

2020-12-22 Thread Nicolas Saenz Julienne
The DM_DMA option is needed in order to translate physical address into bus addresses on a per-device basis. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Simon Glass --- configs/rpi_4_32b_defconfig | 1 + configs/rpi_4_defconfig | 1 + configs/rpi_arm64_defconfig | 1 + 3 files

[PATCH v4 13/13] video: arm: rpi: Add brcm,bcm2711-hdmi0 compatible

2020-12-22 Thread Nicolas Saenz Julienne
The 'brcm,bcm2711-hdmi0' compatible string is used on RPi4 instead of 'brcm,bcm2835-hdmi' since the IP core was upgraded (now called VC6 instead of VC4). This has no functional change as far as u-boot driver is concerned. So simply add the compatible string. Signed-off-by: Nicolas Saenz Julienne

[PATCH 7/8] xhci: translate virtual addresses into the bus's address space

2020-11-19 Thread Nicolas Saenz Julienne
xhci_virt_to_bus() and xhci_bus_to_virt() to cater with these limitations and make sure we don't break non DM users. Signed-off-by: Nicolas Saenz Julienne --- drivers/usb/host/xhci-mem.c | 45 +++- drivers/usb/host/xhci-ring.c | 11 + drivers/usb/host/xhci.c

[PATCH 2/8] rpi: Add identifier for the new CM4

2020-11-19 Thread Nicolas Saenz Julienne
when using custom ones. Signed-off-by: Nicolas Saenz Julienne --- --- board/raspberrypi/rpi/rpi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index ce60a24352..4ffd23c6ac 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board

[PATCH 6/8] dm: Introduce dev_phys_to_bus()/dev_bus_to_phys()

2020-11-19 Thread Nicolas Saenz Julienne
These functions, instead of relying on hard-coded platform-specific address translations, make use of the DMA constraints provided by the DM core. This allows for per-device translations. Signed-off-by: Nicolas Saenz Julienne --- include/phys2bus.h | 16 1 file changed, 16

[PATCH 4/8] dm: Introduce xxx_get_dma_range()

2020-11-19 Thread Nicolas Saenz Julienne
and to address spaces. Signed-off-by: Nicolas Saenz Julienne --- common/fdt_support.c | 72 ++ drivers/core/of_addr.c | 68 +++ drivers/core/ofnode.c | 9 ++ drivers/core/read.c| 5 +++ include/dm/of_addr.h | 17

[PATCH 8/8] mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()

2020-11-19 Thread Nicolas Saenz Julienne
This will allow us to use DM variants of phys_to_bus()/bus_to_phys() when relevant. Signed-off-by: Nicolas Saenz Julienne --- drivers/mmc/sdhci.c | 7 --- include/mmc.h | 10 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc

[PATCH 0/8] Raspberry Pi 400/Compute Module 4 support

2020-11-19 Thread Nicolas Saenz Julienne
with u-boot's device/driver model so I might have made some sille assumptions. Sorry in advance. :) --- Nicolas Saenz Julienne (8): rpi: Add identifier for the new RPi400 rpi: Add identifier for the new CM4 pci: pcie-brcmstb: Fix inbound window configurations dm: Introduce xxx_get_dma_range

[PATCH 5/8] dm: Introduce DMA constraints into the core device model

2020-11-19 Thread Nicolas Saenz Julienne
udevice' for the DMA code to use it. Signed-off-by: Nicolas Saenz Julienne --- drivers/core/device.c | 24 include/dm/device.h | 1 + 2 files changed, 25 insertions(+) diff --git a/drivers/core/device.c b/drivers/core/device.c index 4b3dcb3b37..4255bea24d 100644

[PATCH 3/8] pci: pcie-brcmstb: Fix inbound window configurations

2020-11-19 Thread Nicolas Saenz Julienne
firmware load operation, which is handled by the co-processor after u-boot has correctly configured the PCIe controller). Signed-off-by: Nicolas Saenz Julienne --- drivers/pci/pcie_brcmstb.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/pci/pcie_brcmstb.c b

[PATCH 1/8] rpi: Add identifier for the new RPi400

2020-11-19 Thread Nicolas Saenz Julienne
compatible. Signed-off-by: Nicolas Saenz Julienne --- board/raspberrypi/rpi/rpi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 6b1fa5fc14..ce60a24352 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi

Re: [PATCH 2/8] rpi: Add identifier for the new CM4

2020-11-20 Thread Nicolas Saenz Julienne
On Thu, 2020-11-19 at 18:48 +0100, Nicolas Saenz Julienne wrote: > The Raspberry Pi Foundation released the new Compute Module 4which we > want to detect, so we can enable Ethernet on it and know the correct > device tree file name. > > Note that this sets the Ethernet optio

Re: [PATCH 7/8] xhci: translate virtual addresses into the bus's address space

2020-11-20 Thread Nicolas Saenz Julienne
On Fri, 2020-11-20 at 07:15 +0100, Stefan Roese wrote: > Hi Bin, > Hi Nicolas, > > On 20.11.20 01:31, Bin Meng wrote: > > +Stefan > > > > On Fri, Nov 20, 2020 at 1:49 AM Nicolas Saenz Julienne > > wrote: > > > So far we've been content with pass

Re: [PATCH v5 00/13] Raspberry Pi 400/Compute Module 4 support

2021-01-03 Thread Nicolas Saenz Julienne
Hi Peter, thanks for taking the time to test this, I'll send a new hopefully definitive version soon. On Tue, 2020-12-29 at 10:58 +, Peter Robinson wrote: > Hi Nicolas, > > With the xhci patch snippet the pci/xhci crash I was seeing is now gone. Yes that was unfortunate, I tested most

[PATCH 1/2] usb: xhci-pci: Add DM_FLAG_OS_PREPARE flag

2021-01-14 Thread Nicolas Saenz Julienne
The PCIe bus the controller is connected to might need to be removed prior the handover. Make sure xhci-pci is also removed so as to avoid unexpected timeouts or hangs. Signed-off-by: Nicolas Saenz Julienne --- drivers/usb/host/xhci-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 2/2] pci: brcmstb: Cleanup controller state before handover

2021-01-14 Thread Nicolas Saenz Julienne
chip. Signed-off-by: Nicolas Saenz Julienne --- drivers/pci/pcie_brcmstb.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/pci/pcie_brcmstb.c b/drivers/pci/pcie_brcmstb.c index bd645d7896..90225f6779 100644 --- a/drivers/pci/pcie_brcmstb.c +++ b/drivers/pci

[PATCH 0/2] Raspberry Pi 4 PCIe handover

2021-01-14 Thread Nicolas Saenz Julienne
It's important for u-boot to properly reset RPi4's PCIe controller in order for Linux to run the board's USB firmware load rountines. --- Nicolas Saenz Julienne (2): usb: xhci-pci: Add DM_FLAG_OS_PREPARE flag pci: brcmstb: Cleanup controller state before handover drivers/pci/pcie_brcmstb.c

Re: [PATCH 0/2] Console/stdio use after free

2021-01-25 Thread Nicolas Saenz Julienne
Hi Andy, Simon On Wed, 2021-01-20 at 17:57 +0200, Andy Shevchenko wrote: > On Wed, Jan 20, 2021 at 4:05 PM Nicolas Saenz Julienne > wrote: > > > > With today's master, 70c2525c0d3c ('IOMUX: Stop dropped consoles') > > introduces a use after free in usb_kbd_remove(): &

Re: [PATCH 1/2] stdio: Introduce stdio_valid()

2021-01-25 Thread Nicolas Saenz Julienne
On Sat, 2021-01-23 at 19:03 -0700, Simon Glass wrote: > Hi Nicolas, > > On Wed, 20 Jan 2021 at 07:05, Nicolas Saenz Julienne > wrote: > > > > stdio_valid() will confirm that a struct stdio_dev pointer is indeed > > valid. > > > > Signed-off-by: N

Re: [PATCH 0/2] Console/stdio use after free

2021-01-20 Thread Nicolas Saenz Julienne
On Wed, 2021-01-20 at 07:18 -0700, Simon Glass wrote: > Hi Nicolas, > > On Wed, 20 Jan 2021 at 07:04, Nicolas Saenz Julienne > wrote: > > > > With today's master, 70c2525c0d3c ('IOMUX: Stop dropped consoles') > > introduces a use after free in usb_kbd_remove(): &g

Re: [PATCH] usb: xhci: Fix compare to use physical addresses in xhci_bulk_tx()

2021-01-15 Thread Nicolas Saenz Julienne
e by using the correct address types in the compare (both > physical in this case). > > Signed-off-by: Stefan Roese > Cc: Aaron Williams > Cc: Chandrakala Chavva > Cc: Ran Wang > Cc: Nicolas Saenz Julienne > Cc: Marek Vasut > Cc: Bin Meng > --- >  dri

Re: [PATCH] usb: xhci: Fix compare to use physical addresses in xhci_bulk_tx()

2021-01-15 Thread Nicolas Saenz Julienne
+Matthias, just so you're aware. On Fri, 2021-01-15 at 11:33 +0100, Stefan Roese wrote: > On 15.01.21 11:27, Nicolas Saenz Julienne wrote: > > On Fri, 2021-01-15 at 08:52 +0100, Stefan Roese wrote: > > > Testing with v2021.01 on MIPS Octeon has shown, that the latest patch &g

Re: [PATCH] usb: xhci: Fix compare to use physical addresses in xhci_bulk_tx()

2021-01-15 Thread Nicolas Saenz Julienne
+Matthias, just so you're aware. On Fri, 2021-01-15 at 11:33 +0100, Stefan Roese wrote: > On 15.01.21 11:27, Nicolas Saenz Julienne wrote: > > On Fri, 2021-01-15 at 08:52 +0100, Stefan Roese wrote: > > > Testing with v2021.01 on MIPS Octeon has shown, that the latest patch &g

Re: [PATCH v2 4/8] dm: Introduce xxx_get_dma_range()

2020-12-14 Thread Nicolas Saenz Julienne
On Sat, 2020-12-12 at 08:39 -0700, Simon Glass wrote: > Hi Nicolas, > > On Thu, 10 Dec 2020 at 04:39, Nicolas Saenz Julienne > wrote: > > > > Add the following functions to get a specific device's DMA ranges: > >  - dev_get_dma_range() > >  - ofnode_get

Re: [PATCH v1] usb: kbd: destroy device after console is stopped

2021-01-28 Thread Nicolas Saenz Julienne
> Fixes: 8a8348703081 ("dm: usb: Add a remove() method for USB keyboards") > Reported-by: Nicolas Saenz Julienne > Signed-off-by: Andy Shevchenko > --- > v2: Nicolas, can you test this one instead of yours? Sadly this doesn't seem to work, and breaks a bunch of other tests in t

Re: [PATCH v1] usb: kbd: destroy device after console is stopped

2021-02-03 Thread Nicolas Saenz Julienne
Andy, Tony, Sorry for my late reply, but I got a bad cold. On Thu, 2021-01-28 at 15:46 -0500, Tom Rini wrote: > On Thu, Jan 28, 2021 at 10:35:37PM +0200, Andy Shevchenko wrote: > > On Thu, Jan 28, 2021 at 06:19:56PM +0100, Nicolas Saenz Julienne wrote: > > > Hi Andy, > >

Re: [PATCH] rpi: limit size of the RAM to the multiple of the MMU_SECTION_SIZE

2021-02-03 Thread Nicolas Saenz Julienne
wski > --- Reviewed-by: Nicolas Saenz Julienne Regards, Nicolas signature.asc Description: This is a digitally signed message part

Re: [PATCH] ARM: bcm283x: change the virtual address of the XHCI PCI device base

2021-06-18 Thread nicolas saenz julienne
the XHCI PCI device. > > Signed-off-by: Marek Szyprowski > Reviewed-by: Jaehoon Chung > --- > This fixes the issue observed on ARM 32bit after upgrading the RPi4 > firmware files, described some time ago here: > https://lists.denx.de/pipermail/u-boot/2021-February/442317.html

[PATCH v2 0/2] Console/stdio use after free

2021-01-28 Thread Nicolas Saenz Julienne
: - Comment new function - Add comment stating this needs a proper fix Nicolas Saenz Julienne (2): stdio: Introduce stdio_valid() console: Don't start/stop console if stdio device invalid common/console.c| 9 + common/stdio.c | 11 +++ include/stdio_dev.h | 11

[PATCH v2 1/2] stdio: Introduce stdio_valid()

2021-01-28 Thread Nicolas Saenz Julienne
stdio_valid() will confirm that a struct stdio_dev pointer is indeed valid. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: - Properly document function common/stdio.c | 11 +++ include/stdio_dev.h | 11 +++ 2 files changed, 22 insertions(+) diff --git

[PATCH v2 2/2] console: Don't start/stop console if stdio device invalid

2021-01-28 Thread Nicolas Saenz Julienne
Don't start/stop an stdio device that might have been already freed. Signed-off-by: Nicolas Saenz Julienne Fixes: 70c2525c0d3c ("IOMUX: Stop dropped consoles") --- Changes since v1: - Add comment stating this should be properly fixed common/console.c | 9 + 1 file

[PATCH 1/2] stdio: Introduce stdio_valid()

2021-01-20 Thread Nicolas Saenz Julienne
stdio_valid() will confirm that a struct stdio_dev pointer is indeed valid. Signed-off-by: Nicolas Saenz Julienne --- common/stdio.c | 11 +++ include/stdio_dev.h | 1 + 2 files changed, 12 insertions(+) diff --git a/common/stdio.c b/common/stdio.c index abf9b1e915..69b7d2692d

[PATCH 0/2] Console/stdio use after free

2021-01-20 Thread Nicolas Saenz Julienne
, and console_stop() is called on the struct stdio_dev pointer that no longer exists. This series mitigates this by making sure the pointer is really a stdio device prior performing the stop operation. It's not ideal, but I couldn't figure out a nicer way to fix this. Regards, Nicolas --- Nicolas Saenz

[PATCH 2/2] console: Don't start/stop console if stdio device invalid

2021-01-20 Thread Nicolas Saenz Julienne
Don't start/stop an stdio device that might have been already freed. Signed-off-by: Nicolas Saenz Julienne Fixes: 70c2525c0d3c ("IOMUX: Stop dropped consoles") --- common/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/console.c b/common/console.c index

Re: [RFC] dev_phys_to_bus() and PCI

2021-03-15 Thread Nicolas Saenz Julienne
Hi Mark! On Sat, 2021-03-13 at 10:24 +0100, Mark Kettenis wrote: [...] > Fortunately Nicolas Saenz Julienne recently introduced > dev_phys_to_bus() and dev_bus_to_phys() interfaces to do this. Those > interfaces make use of a dma-ranges property in the device tree which > doesn't

Re: [RFC] dev_phys_to_bus() and PCI

2021-03-19 Thread Nicolas Saenz Julienne
Hi Mark, > Hi Nicolas, > > > On Sat, 2021-03-13 at 10:24 +0100, Mark Kettenis wrote: > > [...] > > > Fortunately Nicolas Saenz Julienne recently introduced > > > dev_phys_to_bus() and dev_bus_to_phys() interfaces to do this. Those > > > interfaces ma

Re: u-boot on RPi4 32bit - issue after upgrading the firmware

2021-02-25 Thread Nicolas Saenz Julienne
On Thu, 2021-02-25 at 11:43 +0100, Marek Szyprowski wrote: > Hi! > > Recently I've upgraded a video core firmware on my RPi4 and I've noticed > that u-boot in ARM 32bit mode stopped working properly or even randomly > crashes. I've bisected the firmware releases and the issue appears for > the

Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Nicolas Saenz Julienne
On Tue, 2021-02-23 at 10:25 +0100, Stefan Roese wrote: > Hi Nicolas, > > On 23.02.21 10:23, Nicolas Saenz Julienne wrote: > > On Tue, 2021-02-23 at 09:15 +0100, Stefan Roese wrote: > > > Hi Bin, > > > Hi Aaron, > > > > > > I've add

Re: [EXT] USB3 XHCI crashing with USB 3 hub on Octeon

2021-02-23 Thread Nicolas Saenz Julienne
On Tue, 2021-02-23 at 09:15 +0100, Stefan Roese wrote: > Hi Bin, > Hi Aaron, > > I've added Nicolas to Cc, as he also recently did some work on the > physical vs virtual addresses in the xHCI driver. > > On 23.02.21 09:07, Bin Meng wrote: > > Hi Aaron, > > > > On Tue, Feb 23, 2021 at 3:31 PM

<    1   2   3   >