diff mbox series

[U-Boot,1/9] riscv: ax25: Create a simple-bus driver for the soc node

Message ID 20190319090750.8923-2-uboot@andestech.com
State Superseded
Delegated to: Andes
Headers show
Series AE350 SMP support RISC-V | expand

Commit Message

Andes March 19, 2019, 9:07 a.m. UTC
From: Rick Chen <rick@andestech.com>

To enumerate devices on the /soc/ node, create a "simple-bus"
driver to match "andestech,riscv-ae350-soc".

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
---
 arch/riscv/cpu/ax25/cpu.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Bin Meng March 20, 2019, 7:22 a.m. UTC | #1
Hi Rick,

On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
>
> From: Rick Chen <rick@andestech.com>
>
> To enumerate devices on the /soc/ node, create a "simple-bus"
> driver to match "andestech,riscv-ae350-soc".
>

Could we change the /soc/ node compatible string to "simple-bus"
instead? The QEMU 'virt' created a bad example and we should stop the
contamination.

> Signed-off-by: Rick Chen <rick@andestech.com>
> Cc: Greentime Hu <greentime@andestech.com>
> ---
>  arch/riscv/cpu/ax25/cpu.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>

Regards,
Bin
Rick Chen March 21, 2019, 6:49 a.m. UTC | #2
Hi Bin

Bin Meng <bmeng.cn@gmail.com> 於 2019年3月20日 週三 下午3:22寫道:
>
> Hi Rick,
>
> On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
> >
> > From: Rick Chen <rick@andestech.com>
> >
> > To enumerate devices on the /soc/ node, create a "simple-bus"
> > driver to match "andestech,riscv-ae350-soc".
> >
>
> Could we change the /soc/ node compatible string to "simple-bus"
> instead? The QEMU 'virt' created a bad example and we should stop the
> contamination.
>

Do you mean change the
.compatible = "andestech,riscv-ae350-soc",
as "simple-bus" ???

I don't understand it.
Can you explain more clearly

Thanks
Rick

> > Signed-off-by: Rick Chen <rick@andestech.com>
> > Cc: Greentime Hu <greentime@andestech.com>
> > ---
> >  arch/riscv/cpu/ax25/cpu.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
>
> Regards,
> Bin
Bin Meng March 21, 2019, 7:01 a.m. UTC | #3
Hi Rick,

On Thu, Mar 21, 2019 at 2:49 PM Rick Chen <rickchen36@gmail.com> wrote:
>
> Hi Bin
>
> Bin Meng <bmeng.cn@gmail.com> 於 2019年3月20日 週三 下午3:22寫道:
> >
> > Hi Rick,
> >
> > On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
> > >
> > > From: Rick Chen <rick@andestech.com>
> > >
> > > To enumerate devices on the /soc/ node, create a "simple-bus"
> > > driver to match "andestech,riscv-ae350-soc".
> > >
> >
> > Could we change the /soc/ node compatible string to "simple-bus"
> > instead? The QEMU 'virt' created a bad example and we should stop the
> > contamination.
> >
>
> Do you mean change the
> .compatible = "andestech,riscv-ae350-soc",
> as "simple-bus" ???

Yes, I mean changing the /soc/ node compatible string in
arch/riscv/dts/ae350_{32,64}.dts to "simpble-bus".

>
> I don't understand it.
> Can you explain more clearly
>

Regards,
Bin
Rick Chen March 21, 2019, 8:28 a.m. UTC | #4
Hi Bin

Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午3:01寫道:
>
> Hi Rick,
>
> On Thu, Mar 21, 2019 at 2:49 PM Rick Chen <rickchen36@gmail.com> wrote:
> >
> > Hi Bin
> >
> > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月20日 週三 下午3:22寫道:
> > >
> > > Hi Rick,
> > >
> > > On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
> > > >
> > > > From: Rick Chen <rick@andestech.com>
> > > >
> > > > To enumerate devices on the /soc/ node, create a "simple-bus"
> > > > driver to match "andestech,riscv-ae350-soc".
> > > >
> > >
> > > Could we change the /soc/ node compatible string to "simple-bus"
> > > instead? The QEMU 'virt' created a bad example and we should stop the
> > > contamination.
> > >
> >
> > Do you mean change the
> > .compatible = "andestech,riscv-ae350-soc",
> > as "simple-bus" ???
>
> Yes, I mean changing the /soc/ node compatible string in
> arch/riscv/dts/ae350_{32,64}.dts to "simpble-bus".
>

So you mean we shall have only riscv simple bus driver.
We shall remove
U_BOOT_DRIVER(riscv_virtio_soc) in /arch/riscv/cpu/generic/cpu.c
U_BOOT_DRIVER(riscv_ae350_soc_ids) in /arch/riscv/cpu/ax25/cpu.c
and add
static const struct udevice_id riscv_simple_bus_ids[] = {
{
.compatible = "simple-bus",
},
{ }
};

U_BOOT_DRIVER(riscv_simple_bus_ids) = {
.name = "simple-bus",
.id = UCLASS_SIMPLE_BUS,
.of_match = riscv_simple_bus_ids,
.flags = DM_FLAG_PRE_RELOC,
};

Does it right ?

Rick

> >
> > I don't understand it.
> > Can you explain more clearly
> >
>
> Regards,
> Bin
Bin Meng March 21, 2019, 8:49 a.m. UTC | #5
Hi Rick,

On Thu, Mar 21, 2019 at 4:27 PM Rick Chen <rickchen36@gmail.com> wrote:
>
> Hi Bin
>
> Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午3:01寫道:
> >
> > Hi Rick,
> >
> > On Thu, Mar 21, 2019 at 2:49 PM Rick Chen <rickchen36@gmail.com> wrote:
> > >
> > > Hi Bin
> > >
> > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月20日 週三 下午3:22寫道:
> > > >
> > > > Hi Rick,
> > > >
> > > > On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
> > > > >
> > > > > From: Rick Chen <rick@andestech.com>
> > > > >
> > > > > To enumerate devices on the /soc/ node, create a "simple-bus"
> > > > > driver to match "andestech,riscv-ae350-soc".
> > > > >
> > > >
> > > > Could we change the /soc/ node compatible string to "simple-bus"
> > > > instead? The QEMU 'virt' created a bad example and we should stop the
> > > > contamination.
> > > >
> > >
> > > Do you mean change the
> > > .compatible = "andestech,riscv-ae350-soc",
> > > as "simple-bus" ???
> >
> > Yes, I mean changing the /soc/ node compatible string in
> > arch/riscv/dts/ae350_{32,64}.dts to "simpble-bus".
> >
>
> So you mean we shall have only riscv simple bus driver.
> We shall remove
> U_BOOT_DRIVER(riscv_virtio_soc) in /arch/riscv/cpu/generic/cpu.c
> U_BOOT_DRIVER(riscv_ae350_soc_ids) in /arch/riscv/cpu/ax25/cpu.c
> and add
> static const struct udevice_id riscv_simple_bus_ids[] = {
> {
> .compatible = "simple-bus",
> },
> { }
> };
>
> U_BOOT_DRIVER(riscv_simple_bus_ids) = {
> .name = "simple-bus",
> .id = UCLASS_SIMPLE_BUS,
> .of_match = riscv_simple_bus_ids,
> .flags = DM_FLAG_PRE_RELOC,
> };
>
> Does it right ?

No, you don't need add anything to the RISC-V codes. U-Boot provides a
simple-bus driver and all you need do is to use "simple-bus" in your
DTS files.

Regards,
Bin
Rick Chen March 21, 2019, 9:01 a.m. UTC | #6
Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午4:49寫道:
>
> Hi Rick,
>
> On Thu, Mar 21, 2019 at 4:27 PM Rick Chen <rickchen36@gmail.com> wrote:
> >
> > Hi Bin
> >
> > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午3:01寫道:
> > >
> > > Hi Rick,
> > >
> > > On Thu, Mar 21, 2019 at 2:49 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > >
> > > > Hi Bin
> > > >
> > > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月20日 週三 下午3:22寫道:
> > > > >
> > > > > Hi Rick,
> > > > >
> > > > > On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
> > > > > >
> > > > > > From: Rick Chen <rick@andestech.com>
> > > > > >
> > > > > > To enumerate devices on the /soc/ node, create a "simple-bus"
> > > > > > driver to match "andestech,riscv-ae350-soc".
> > > > > >
> > > > >
> > > > > Could we change the /soc/ node compatible string to "simple-bus"
> > > > > instead? The QEMU 'virt' created a bad example and we should stop the
> > > > > contamination.
> > > > >
> > > >
> > > > Do you mean change the
> > > > .compatible = "andestech,riscv-ae350-soc",
> > > > as "simple-bus" ???
> > >
> > > Yes, I mean changing the /soc/ node compatible string in
> > > arch/riscv/dts/ae350_{32,64}.dts to "simpble-bus".
> > >
> >
> > So you mean we shall have only riscv simple bus driver.
> > We shall remove
> > U_BOOT_DRIVER(riscv_virtio_soc) in /arch/riscv/cpu/generic/cpu.c
> > U_BOOT_DRIVER(riscv_ae350_soc_ids) in /arch/riscv/cpu/ax25/cpu.c
> > and add
> > static const struct udevice_id riscv_simple_bus_ids[] = {
> > {
> > .compatible = "simple-bus",
> > },
> > { }
> > };
> >
> > U_BOOT_DRIVER(riscv_simple_bus_ids) = {
> > .name = "simple-bus",
> > .id = UCLASS_SIMPLE_BUS,
> > .of_match = riscv_simple_bus_ids,
> > .flags = DM_FLAG_PRE_RELOC,
> > };
> >
> > Does it right ?
>
> No, you don't need add anything to the RISC-V codes. U-Boot provides a
> simple-bus driver and all you need do is to use "simple-bus" in your
> DTS files.
>

But if I only use "simple-bus" in DTS file.
It will fail in syscon_get_first_range that can not get correct
information from reg.

> Regards,
> Bin
Bin Meng March 21, 2019, 9:16 a.m. UTC | #7
Hi Rick,

On Thu, Mar 21, 2019 at 5:00 PM Rick Chen <rickchen36@gmail.com> wrote:
>
> Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午4:49寫道:
> >
> > Hi Rick,
> >
> > On Thu, Mar 21, 2019 at 4:27 PM Rick Chen <rickchen36@gmail.com> wrote:
> > >
> > > Hi Bin
> > >
> > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午3:01寫道:
> > > >
> > > > Hi Rick,
> > > >
> > > > On Thu, Mar 21, 2019 at 2:49 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > >
> > > > > Hi Bin
> > > > >
> > > > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月20日 週三 下午3:22寫道:
> > > > > >
> > > > > > Hi Rick,
> > > > > >
> > > > > > On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
> > > > > > >
> > > > > > > From: Rick Chen <rick@andestech.com>
> > > > > > >
> > > > > > > To enumerate devices on the /soc/ node, create a "simple-bus"
> > > > > > > driver to match "andestech,riscv-ae350-soc".
> > > > > > >
> > > > > >
> > > > > > Could we change the /soc/ node compatible string to "simple-bus"
> > > > > > instead? The QEMU 'virt' created a bad example and we should stop the
> > > > > > contamination.
> > > > > >
> > > > >
> > > > > Do you mean change the
> > > > > .compatible = "andestech,riscv-ae350-soc",
> > > > > as "simple-bus" ???
> > > >
> > > > Yes, I mean changing the /soc/ node compatible string in
> > > > arch/riscv/dts/ae350_{32,64}.dts to "simpble-bus".
> > > >
> > >
> > > So you mean we shall have only riscv simple bus driver.
> > > We shall remove
> > > U_BOOT_DRIVER(riscv_virtio_soc) in /arch/riscv/cpu/generic/cpu.c
> > > U_BOOT_DRIVER(riscv_ae350_soc_ids) in /arch/riscv/cpu/ax25/cpu.c
> > > and add
> > > static const struct udevice_id riscv_simple_bus_ids[] = {
> > > {
> > > .compatible = "simple-bus",
> > > },
> > > { }
> > > };
> > >
> > > U_BOOT_DRIVER(riscv_simple_bus_ids) = {
> > > .name = "simple-bus",
> > > .id = UCLASS_SIMPLE_BUS,
> > > .of_match = riscv_simple_bus_ids,
> > > .flags = DM_FLAG_PRE_RELOC,
> > > };
> > >
> > > Does it right ?
> >
> > No, you don't need add anything to the RISC-V codes. U-Boot provides a
> > simple-bus driver and all you need do is to use "simple-bus" in your
> > DTS files.
> >
>
> But if I only use "simple-bus" in DTS file.
> It will fail in syscon_get_first_range that can not get correct
> information from reg.

Yes, we should fix "simple-bus" driver. See discussion in
https://patchwork.ozlabs.org/patch/1039493/

Regards,
Bin
Rick Chen April 10, 2019, 9:05 a.m. UTC | #8
Hi Bin and Lukas

Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午5:17寫道:
>
> Hi Rick,
>
> On Thu, Mar 21, 2019 at 5:00 PM Rick Chen <rickchen36@gmail.com> wrote:
> >
> > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午4:49寫道:
> > >
> > > Hi Rick,
> > >
> > > On Thu, Mar 21, 2019 at 4:27 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > >
> > > > Hi Bin
> > > >
> > > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午3:01寫道:
> > > > >
> > > > > Hi Rick,
> > > > >
> > > > > On Thu, Mar 21, 2019 at 2:49 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > > >
> > > > > > Hi Bin
> > > > > >
> > > > > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月20日 週三 下午3:22寫道:
> > > > > > >
> > > > > > > Hi Rick,
> > > > > > >
> > > > > > > On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
> > > > > > > >
> > > > > > > > From: Rick Chen <rick@andestech.com>
> > > > > > > >
> > > > > > > > To enumerate devices on the /soc/ node, create a "simple-bus"
> > > > > > > > driver to match "andestech,riscv-ae350-soc".
> > > > > > > >
> > > > > > >
> > > > > > > Could we change the /soc/ node compatible string to "simple-bus"
> > > > > > > instead? The QEMU 'virt' created a bad example and we should stop the
> > > > > > > contamination.
> > > > > > >
> > > > > >
> > > > > > Do you mean change the
> > > > > > .compatible = "andestech,riscv-ae350-soc",
> > > > > > as "simple-bus" ???
> > > > >
> > > > > Yes, I mean changing the /soc/ node compatible string in
> > > > > arch/riscv/dts/ae350_{32,64}.dts to "simpble-bus".
> > > > >
> > > >
> > > > So you mean we shall have only riscv simple bus driver.
> > > > We shall remove
> > > > U_BOOT_DRIVER(riscv_virtio_soc) in /arch/riscv/cpu/generic/cpu.c
> > > > U_BOOT_DRIVER(riscv_ae350_soc_ids) in /arch/riscv/cpu/ax25/cpu.c
> > > > and add
> > > > static const struct udevice_id riscv_simple_bus_ids[] = {
> > > > {
> > > > .compatible = "simple-bus",
> > > > },
> > > > { }
> > > > };
> > > >
> > > > U_BOOT_DRIVER(riscv_simple_bus_ids) = {
> > > > .name = "simple-bus",
> > > > .id = UCLASS_SIMPLE_BUS,
> > > > .of_match = riscv_simple_bus_ids,
> > > > .flags = DM_FLAG_PRE_RELOC,
> > > > };
> > > >
> > > > Does it right ?
> > >
> > > No, you don't need add anything to the RISC-V codes. U-Boot provides a
> > > simple-bus driver and all you need do is to use "simple-bus" in your
> > > DTS files.
> > >
> >
> > But if I only use "simple-bus" in DTS file.
> > It will fail in syscon_get_first_range that can not get correct
> > information from reg.
>
> Yes, we should fix "simple-bus" driver. See discussion in
> https://patchwork.ozlabs.org/patch/1039493/

The series has been pull into master by Tom.

Can you fix the "simple-bus" driver ASAP.
AE350 will encounter the problem as below with the latest u-boot-riscv

U-Boot 2019.04-rc4-07392-g48b90d9 (Apr 10 2019 - 16:27:39 +0800)

DRAM:  1 GiB
Cannot send IPI to hart 1
Relocation of secondary harts has failed, error -19
### ERROR ### Please RESET the board ###

Thanks
Rick

>
> Regards,
> Bin
Lukas Auer April 10, 2019, 9:21 a.m. UTC | #9
Hi Rick,

On Wed, 2019-04-10 at 17:05 +0800, Rick Chen wrote:
> Hi Bin and Lukas
> 
> Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午5:17寫道:
> > Hi Rick,
> > 
> > On Thu, Mar 21, 2019 at 5:00 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午4:49寫道:
> > > > Hi Rick,
> > > > 
> > > > On Thu, Mar 21, 2019 at 4:27 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > > Hi Bin
> > > > > 
> > > > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午3:01寫道:
> > > > > > Hi Rick,
> > > > > > 
> > > > > > On Thu, Mar 21, 2019 at 2:49 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > > > > Hi Bin
> > > > > > > 
> > > > > > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月20日 週三 下午3:22寫道:
> > > > > > > > Hi Rick,
> > > > > > > > 
> > > > > > > > On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
> > > > > > > > > From: Rick Chen <rick@andestech.com>
> > > > > > > > > 
> > > > > > > > > To enumerate devices on the /soc/ node, create a "simple-bus"
> > > > > > > > > driver to match "andestech,riscv-ae350-soc".
> > > > > > > > > 
> > > > > > > > 
> > > > > > > > Could we change the /soc/ node compatible string to "simple-bus"
> > > > > > > > instead? The QEMU 'virt' created a bad example and we should stop the
> > > > > > > > contamination.
> > > > > > > > 
> > > > > > > 
> > > > > > > Do you mean change the
> > > > > > > .compatible = "andestech,riscv-ae350-soc",
> > > > > > > as "simple-bus" ???
> > > > > > 
> > > > > > Yes, I mean changing the /soc/ node compatible string in
> > > > > > arch/riscv/dts/ae350_{32,64}.dts to "simpble-bus".
> > > > > > 
> > > > > 
> > > > > So you mean we shall have only riscv simple bus driver.
> > > > > We shall remove
> > > > > U_BOOT_DRIVER(riscv_virtio_soc) in /arch/riscv/cpu/generic/cpu.c
> > > > > U_BOOT_DRIVER(riscv_ae350_soc_ids) in /arch/riscv/cpu/ax25/cpu.c
> > > > > and add
> > > > > static const struct udevice_id riscv_simple_bus_ids[] = {
> > > > > {
> > > > > .compatible = "simple-bus",
> > > > > },
> > > > > { }
> > > > > };
> > > > > 
> > > > > U_BOOT_DRIVER(riscv_simple_bus_ids) = {
> > > > > .name = "simple-bus",
> > > > > .id = UCLASS_SIMPLE_BUS,
> > > > > .of_match = riscv_simple_bus_ids,
> > > > > .flags = DM_FLAG_PRE_RELOC,
> > > > > };
> > > > > 
> > > > > Does it right ?
> > > > 
> > > > No, you don't need add anything to the RISC-V codes. U-Boot provides a
> > > > simple-bus driver and all you need do is to use "simple-bus" in your
> > > > DTS files.
> > > > 
> > > 
> > > But if I only use "simple-bus" in DTS file.
> > > It will fail in syscon_get_first_range that can not get correct
> > > information from reg.
> > 
> > Yes, we should fix "simple-bus" driver. See discussion in
> > https://patchwork.ozlabs.org/patch/1039493/
> 
> The series has been pull into master by Tom.
> 
> Can you fix the "simple-bus" driver ASAP.
> AE350 will encounter the problem as below with the latest u-boot-riscv
> 
> U-Boot 2019.04-rc4-07392-g48b90d9 (Apr 10 2019 - 16:27:39 +0800)
> 
> DRAM:  1 GiB
> Cannot send IPI to hart 1
> Relocation of secondary harts has failed, error -19
> ### ERROR ### Please RESET the board ###
> 

Yes, I will send the patch later today.

Thanks,
Lukas
Rick Chen April 10, 2019, 9:30 a.m. UTC | #10
Hi Lukas

Auer, Lukas <lukas.auer@aisec.fraunhofer.de> 於 2019年4月10日 週三 下午5:21寫道:
>
> Hi Rick,
>
> On Wed, 2019-04-10 at 17:05 +0800, Rick Chen wrote:
> > Hi Bin and Lukas
> >
> > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午5:17寫道:
> > > Hi Rick,
> > >
> > > On Thu, Mar 21, 2019 at 5:00 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午4:49寫道:
> > > > > Hi Rick,
> > > > >
> > > > > On Thu, Mar 21, 2019 at 4:27 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > > > Hi Bin
> > > > > >
> > > > > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月21日 週四 下午3:01寫道:
> > > > > > > Hi Rick,
> > > > > > >
> > > > > > > On Thu, Mar 21, 2019 at 2:49 PM Rick Chen <rickchen36@gmail.com> wrote:
> > > > > > > > Hi Bin
> > > > > > > >
> > > > > > > > Bin Meng <bmeng.cn@gmail.com> 於 2019年3月20日 週三 下午3:22寫道:
> > > > > > > > > Hi Rick,
> > > > > > > > >
> > > > > > > > > On Tue, Mar 19, 2019 at 5:11 PM Andes <uboot@andestech.com> wrote:
> > > > > > > > > > From: Rick Chen <rick@andestech.com>
> > > > > > > > > >
> > > > > > > > > > To enumerate devices on the /soc/ node, create a "simple-bus"
> > > > > > > > > > driver to match "andestech,riscv-ae350-soc".
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > Could we change the /soc/ node compatible string to "simple-bus"
> > > > > > > > > instead? The QEMU 'virt' created a bad example and we should stop the
> > > > > > > > > contamination.
> > > > > > > > >
> > > > > > > >
> > > > > > > > Do you mean change the
> > > > > > > > .compatible = "andestech,riscv-ae350-soc",
> > > > > > > > as "simple-bus" ???
> > > > > > >
> > > > > > > Yes, I mean changing the /soc/ node compatible string in
> > > > > > > arch/riscv/dts/ae350_{32,64}.dts to "simpble-bus".
> > > > > > >
> > > > > >
> > > > > > So you mean we shall have only riscv simple bus driver.
> > > > > > We shall remove
> > > > > > U_BOOT_DRIVER(riscv_virtio_soc) in /arch/riscv/cpu/generic/cpu.c
> > > > > > U_BOOT_DRIVER(riscv_ae350_soc_ids) in /arch/riscv/cpu/ax25/cpu.c
> > > > > > and add
> > > > > > static const struct udevice_id riscv_simple_bus_ids[] = {
> > > > > > {
> > > > > > .compatible = "simple-bus",
> > > > > > },
> > > > > > { }
> > > > > > };
> > > > > >
> > > > > > U_BOOT_DRIVER(riscv_simple_bus_ids) = {
> > > > > > .name = "simple-bus",
> > > > > > .id = UCLASS_SIMPLE_BUS,
> > > > > > .of_match = riscv_simple_bus_ids,
> > > > > > .flags = DM_FLAG_PRE_RELOC,
> > > > > > };
> > > > > >
> > > > > > Does it right ?
> > > > >
> > > > > No, you don't need add anything to the RISC-V codes. U-Boot provides a
> > > > > simple-bus driver and all you need do is to use "simple-bus" in your
> > > > > DTS files.
> > > > >
> > > >
> > > > But if I only use "simple-bus" in DTS file.
> > > > It will fail in syscon_get_first_range that can not get correct
> > > > information from reg.
> > >
> > > Yes, we should fix "simple-bus" driver. See discussion in
> > > https://patchwork.ozlabs.org/patch/1039493/
> >
> > The series has been pull into master by Tom.
> >
> > Can you fix the "simple-bus" driver ASAP.
> > AE350 will encounter the problem as below with the latest u-boot-riscv
> >
> > U-Boot 2019.04-rc4-07392-g48b90d9 (Apr 10 2019 - 16:27:39 +0800)
> >
> > DRAM:  1 GiB
> > Cannot send IPI to hart 1
> > Relocation of secondary harts has failed, error -19
> > ### ERROR ### Please RESET the board ###
> >
>
> Yes, I will send the patch later today.

Thanks a lot.

Sincerely,
Rick

>
> Thanks,
> Lukas
diff mbox series

Patch

diff --git a/arch/riscv/cpu/ax25/cpu.c b/arch/riscv/cpu/ax25/cpu.c
index 76689b2..e6e7404 100644
--- a/arch/riscv/cpu/ax25/cpu.c
+++ b/arch/riscv/cpu/ax25/cpu.c
@@ -7,6 +7,7 @@ 
 /* CPU specific code */
 #include <common.h>
 #include <asm/cache.h>
+#include <dm.h>
 
 /*
  * cleanup_before_linux() is called just before we call linux
@@ -25,3 +26,18 @@  int cleanup_before_linux(void)
 
 	return 0;
 }
+
+/* To enumerate devices on the /soc/ node, create a "simple-bus" driver */
+static const struct udevice_id riscv_ae350_soc_ids[] = {
+	{
+		.compatible = "andestech,riscv-ae350-soc",
+	},
+	{ }
+};
+
+U_BOOT_DRIVER(riscv_ae350_soc_ids) = {
+	.name = "andestech,riscv-ae350-soc",
+	.id = UCLASS_SIMPLE_BUS,
+	.of_match = riscv_ae350_soc_ids,
+	.flags = DM_FLAG_PRE_RELOC,
+};