2020-05-29 03:48:34

by Jiaxun Yang

[permalink] [raw]
Subject: [PATCH 0/3] MIPS: Loongson64: Initial LS7A PCH support

With this series, LS7A and Loongson-3A4000 is finally supported
note that this series should depend on irqchip support[1], which
is likely to get merged soon.

Thanks.

[1]: https://lkml.org/lkml/2020/5/16/72

Jiaxun Yang (3):
dt-bindings: mips: Document two Loongson generic boards
MIPS: Loongson64: DeviceTree for LS7A PCH
MIPS: Loongson64:Load LS7A dtbs

.../bindings/mips/loongson/devices.yaml | 8 +
arch/mips/boot/dts/loongson/Makefile | 5 +-
.../dts/loongson/loongson3-r4-package.dtsi | 74 +++++++
.../dts/loongson/loongson3_4core_ls7a.dts | 25 +++
.../boot/dts/loongson/loongson3_r4_ls7a.dts | 10 +
arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 185 ++++++++++++++++++
.../asm/mach-loongson64/builtin_dtbs.h | 2 +
arch/mips/loongson64/env.c | 56 +++---
8 files changed, 342 insertions(+), 23 deletions(-)
create mode 100644 arch/mips/boot/dts/loongson/loongson3-r4-package.dtsi
create mode 100644 arch/mips/boot/dts/loongson/loongson3_4core_ls7a.dts
create mode 100644 arch/mips/boot/dts/loongson/loongson3_r4_ls7a.dts
create mode 100644 arch/mips/boot/dts/loongson/ls7a-pch.dtsi

--
2.27.0.rc0


2020-05-29 03:48:35

by Jiaxun Yang

[permalink] [raw]
Subject: [PATCH 3/3] MIPS: Loongson64:Load LS7A dtbs

Load correct devicetree according to PRID and PCH type.

Signed-off-by: Jiaxun Yang <[email protected]>
---
arch/mips/loongson64/env.c | 56 +++++++++++++++++++++++---------------
1 file changed, 34 insertions(+), 22 deletions(-)

diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c
index d11bc346bbca..9b56f4a80b62 100644
--- a/arch/mips/loongson64/env.c
+++ b/arch/mips/loongson64/env.c
@@ -126,28 +126,6 @@ void __init prom_init_env(void)
loongson_sysconf.cores_per_node - 1) /
loongson_sysconf.cores_per_node;

- if ((read_c0_prid() & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64C) {
- switch (read_c0_prid() & PRID_REV_MASK) {
- case PRID_REV_LOONGSON3A_R1:
- case PRID_REV_LOONGSON3A_R2_0:
- case PRID_REV_LOONGSON3A_R2_1:
- case PRID_REV_LOONGSON3A_R3_0:
- case PRID_REV_LOONGSON3A_R3_1:
- loongson_fdt_blob = __dtb_loongson3_4core_rs780e_begin;
- break;
- case PRID_REV_LOONGSON3B_R1:
- case PRID_REV_LOONGSON3B_R2:
- loongson_fdt_blob = __dtb_loongson3_8core_rs780e_begin;
- break;
- default:
- break;
- }
- }
-
-
- if (!loongson_fdt_blob)
- pr_err("Failed to determine built-in Loongson64 dtb\n");
-
loongson_sysconf.pci_mem_start_addr = eirq_source->pci_mem_start_addr;
loongson_sysconf.pci_mem_end_addr = eirq_source->pci_mem_end_addr;
loongson_sysconf.pci_io_base = eirq_source->pci_io_start_addr;
@@ -198,4 +176,38 @@ void __init prom_init_env(void)
loongson_sysconf.bridgetype = RS780E;
loongson_sysconf.early_config = rs780e_early_config;
}
+
+ if ((read_c0_prid() & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64C) {
+ switch (read_c0_prid() & PRID_REV_MASK) {
+ case PRID_REV_LOONGSON3A_R1:
+ case PRID_REV_LOONGSON3A_R2_0:
+ case PRID_REV_LOONGSON3A_R2_1:
+ case PRID_REV_LOONGSON3A_R3_0:
+ case PRID_REV_LOONGSON3A_R3_1:
+ switch (loongson_sysconf.bridgetype) {
+ case RS780E:
+ loongson_fdt_blob = __dtb_loongson3_4core_rs780e_begin;
+ break;
+ case LS7A:
+ loongson_fdt_blob = __dtb_loongson3_4core_ls7a_begin;
+ break;
+ default:
+ break;
+ }
+ break;
+ case PRID_REV_LOONGSON3B_R1:
+ case PRID_REV_LOONGSON3B_R2:
+ if (loongson_sysconf.bridgetype == RS780E)
+ loongson_fdt_blob = __dtb_loongson3_8core_rs780e_begin;
+ break;
+ default:
+ break;
+ }
+ } else if ((read_c0_prid() & PRID_IMP_MASK) == PRID_IMP_LOONGSON_64G) {
+ if (loongson_sysconf.bridgetype == LS7A)
+ loongson_fdt_blob = __dtb_loongson3_r4_ls7a_begin;
+ }
+
+ if (!loongson_fdt_blob)
+ pr_err("Failed to determine built-in Loongson64 dtb\n");
}
--
2.27.0.rc0

2020-05-29 04:17:05

by Huacai Chen

[permalink] [raw]
Subject: Re: [PATCH 0/3] MIPS: Loongson64: Initial LS7A PCH support

Hi, Jiaxun,

On Fri, May 29, 2020 at 11:45 AM Jiaxun Yang <[email protected]> wrote:
>
> With this series, LS7A and Loongson-3A4000 is finally supported
> note that this series should depend on irqchip support[1], which
> is likely to get merged soon.
>
> Thanks.
>
> [1]: https://lkml.org/lkml/2020/5/16/72
>
> Jiaxun Yang (3):
> dt-bindings: mips: Document two Loongson generic boards
> MIPS: Loongson64: DeviceTree for LS7A PCH
> MIPS: Loongson64:Load LS7A dtbs
>
> .../bindings/mips/loongson/devices.yaml | 8 +
> arch/mips/boot/dts/loongson/Makefile | 5 +-
> .../dts/loongson/loongson3-r4-package.dtsi | 74 +++++++
> .../dts/loongson/loongson3_4core_ls7a.dts | 25 +++
> .../boot/dts/loongson/loongson3_r4_ls7a.dts | 10 +
> arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 185 ++++++++++++++++++
> .../asm/mach-loongson64/builtin_dtbs.h | 2 +
> arch/mips/loongson64/env.c | 56 +++---
> 8 files changed, 342 insertions(+), 23 deletions(-)
> create mode 100644 arch/mips/boot/dts/loongson/loongson3-r4-package.dtsi
> create mode 100644 arch/mips/boot/dts/loongson/loongson3_4core_ls7a.dts
> create mode 100644 arch/mips/boot/dts/loongson/loongson3_r4_ls7a.dts
> create mode 100644 arch/mips/boot/dts/loongson/ls7a-pch.dtsi
I think the naming can be like this: Old processor (Loongson 3A R1~R3)
use loongson64c_ prefix instead of loongson3, new processor (Loongson
3A R4) use loongson64g_ prefix instead of loongson3_r4, and
Loongson-2K use loongson64r_ prefix, this makes them consistent with
their PRID definitions.

>
> --
> 2.27.0.rc0
>

2020-05-29 04:39:15

by Jiaxun Yang

[permalink] [raw]
Subject: Re: [PATCH 0/3] MIPS: Loongson64: Initial LS7A PCH support



于 2020年5月29日 GMT+08:00 下午12:13:36, Huacai Chen <[email protected]> 写到:
>Hi, Jiaxun,
>
>On Fri, May 29, 2020 at 11:45 AM Jiaxun Yang <[email protected]> wrote:
>>
>> With this series, LS7A and Loongson-3A4000 is finally supported
>> note that this series should depend on irqchip support[1], which
>> is likely to get merged soon.
>>
>> Thanks.
>>
>> [1]: https://lkml.org/lkml/2020/5/16/72
>>
>> Jiaxun Yang (3):
>> dt-bindings: mips: Document two Loongson generic boards
>> MIPS: Loongson64: DeviceTree for LS7A PCH
>> MIPS: Loongson64:Load LS7A dtbs
>>
>> .../bindings/mips/loongson/devices.yaml | 8 +
>> arch/mips/boot/dts/loongson/Makefile | 5 +-
>> .../dts/loongson/loongson3-r4-package.dtsi | 74 +++++++
>> .../dts/loongson/loongson3_4core_ls7a.dts | 25 +++
>> .../boot/dts/loongson/loongson3_r4_ls7a.dts | 10 +
>> arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 185 ++++++++++++++++++
>> .../asm/mach-loongson64/builtin_dtbs.h | 2 +
>> arch/mips/loongson64/env.c | 56 +++---
>> 8 files changed, 342 insertions(+), 23 deletions(-)
>> create mode 100644 arch/mips/boot/dts/loongson/loongson3-r4-package.dtsi
>> create mode 100644 arch/mips/boot/dts/loongson/loongson3_4core_ls7a.dts
>> create mode 100644 arch/mips/boot/dts/loongson/loongson3_r4_ls7a.dts
>> create mode 100644 arch/mips/boot/dts/loongson/ls7a-pch.dtsi
>I think the naming can be like this: Old processor (Loongson 3A R1~R3)
>use loongson64c_ prefix instead of loongson3, new processor (Loongson
>3A R4) use loongson64g_ prefix instead of loongson3_r4, and
>Loongson-2K use loongson64r_ prefix, this makes them consistent with
>their PRID definitions.


DeviceTree bindings have stable ABI. Although they're currently
only used internally in Kernel. I don't think it's a good idea
to rename existing bindings.

Also, Loongson64C/64G/64R never came to a part of Loongson's
official naming. I doubt if end users will recognize these names.

I'd prefer keep naming as is. It's really not a big deal.

Thanks.


>
>>
>> --
>> 2.27.0.rc0
>>

--
Jiaxun Yang

2020-05-29 09:50:10

by Huacai Chen

[permalink] [raw]
Subject: Re: [PATCH 0/3] MIPS: Loongson64: Initial LS7A PCH support

Hi, Jiaxun,

On Fri, May 29, 2020 at 12:37 PM Jiaxun Yang <[email protected]> wrote:
>
>
>
> 于 2020年5月29日 GMT+08:00 下午12:13:36, Huacai Chen <[email protected]> 写到:
> >Hi, Jiaxun,
> >
> >On Fri, May 29, 2020 at 11:45 AM Jiaxun Yang <[email protected]> wrote:
> >>
> >> With this series, LS7A and Loongson-3A4000 is finally supported
> >> note that this series should depend on irqchip support[1], which
> >> is likely to get merged soon.
> >>
> >> Thanks.
> >>
> >> [1]: https://lkml.org/lkml/2020/5/16/72
> >>
> >> Jiaxun Yang (3):
> >> dt-bindings: mips: Document two Loongson generic boards
> >> MIPS: Loongson64: DeviceTree for LS7A PCH
> >> MIPS: Loongson64:Load LS7A dtbs
> >>
> >> .../bindings/mips/loongson/devices.yaml | 8 +
> >> arch/mips/boot/dts/loongson/Makefile | 5 +-
> >> .../dts/loongson/loongson3-r4-package.dtsi | 74 +++++++
> >> .../dts/loongson/loongson3_4core_ls7a.dts | 25 +++
> >> .../boot/dts/loongson/loongson3_r4_ls7a.dts | 10 +
> >> arch/mips/boot/dts/loongson/ls7a-pch.dtsi | 185 ++++++++++++++++++
> >> .../asm/mach-loongson64/builtin_dtbs.h | 2 +
> >> arch/mips/loongson64/env.c | 56 +++---
> >> 8 files changed, 342 insertions(+), 23 deletions(-)
> >> create mode 100644 arch/mips/boot/dts/loongson/loongson3-r4-package.dtsi
> >> create mode 100644 arch/mips/boot/dts/loongson/loongson3_4core_ls7a.dts
> >> create mode 100644 arch/mips/boot/dts/loongson/loongson3_r4_ls7a.dts
> >> create mode 100644 arch/mips/boot/dts/loongson/ls7a-pch.dtsi
> >I think the naming can be like this: Old processor (Loongson 3A R1~R3)
> >use loongson64c_ prefix instead of loongson3, new processor (Loongson
> >3A R4) use loongson64g_ prefix instead of loongson3_r4, and
> >Loongson-2K use loongson64r_ prefix, this makes them consistent with
> >their PRID definitions.
>
>
> DeviceTree bindings have stable ABI. Although they're currently
> only used internally in Kernel. I don't think it's a good idea
> to rename existing bindings.
I think consistency is important, and this renaming doesn't break anything.

>
> Also, Loongson64C/64G/64R never came to a part of Loongson's
> official naming. I doubt if end users will recognize these names.
>
> I'd prefer keep naming as is. It's really not a big deal.
>
> Thanks.
>
>
> >
> >>
> >> --
> >> 2.27.0.rc0
> >>
>
> --
> Jiaxun Yang