public inbox for kernelnewbies@kernelnewbies.org
 help / color / mirror / Atom feed
From: "Chan Kim" <ckim@etri.re.kr>
To: <kernelnewbies@kernelnewbies.org>
Subject: RE: DTC compile error (simple-bus unit address format error for #address-cells = <2> case)
Date: Wed, 27 Oct 2021 20:57:39 +0900	[thread overview]
Message-ID: <00e701d7cb29$d74092f0$85c1b8d0$@etri.re.kr> (raw)
In-Reply-To: <00c301d7cb17$4afb52b0$e0f1f810$@etri.re.kr>


[-- Attachment #1.1: Type: text/plain, Size: 3326 bytes --]

Hi, 

I've found how to do it.

For you should add CONFIG_ARCH_VEXPRESS and ran 'make V=1 ARCH=arm64
CROSS_COMPILE=aarch64-none-elf- dtbs |& tee logx'

Dtbs for ARCH_VEXPRESS are generated in the dts directory. Then you can see
the command to make the dtb (in the logx file). 

Below is the command. Lots of options for the dtc.

 

mkdir -p arch/arm64/boot/dts/arm/ ; gcc -E
-Wp,-MD,arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d.pre.tmp -nostdinc
-I./scripts/dtc/include-prefixes -undef -D__DTS__ -x assembler-with-cpp -o
arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.dts.tmp
arch/arm64/boot/dts/arm/fvp-base-revc.dts ; ./scripts/dtc/dtc -O dtb -o
arch/arm64/boot/dts/arm/fvp-base-revc.dtb -b 0 -iarch/arm64/boot/dts/arm/
-i./scripts/dtc/include-prefixes -Wno-unit_address_vs_reg
-Wno-unit_address_format -Wno-avoid_unnecessary_addr_size -Wno-alias_paths
-Wno-graph_child_address -Wno-simple_bus_reg -Wno-unique_unit_address
-Wno-pci_device_reg  -d arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d.dtc.tmp
arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.dts.tmp ; cat
arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d.pre.tmp
arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d.dtc.tmp >
arch/arm64/boot/dts/arm/.fvp-base-revc.dtb.d

 

Thanks!

Chan Kim

 

From: Chan Kim <ckim@etri.re.kr> 
Sent: Wednesday, October 27, 2021 6:45 PM
To: kernelnewbies@kernelnewbies.org
Subject: DTC compile error (simple-bus unit address format error for
#address-cells = <2> case)

 

Hello all,

Below is a part of arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi in linux
kernel. This file is included by arch/arm64/boot/dts/arm/fvp-base-revc.dts.


 

/ {

    smb@8000000 {

        motherboard {

            arm,v2m-memory-map = "rs1";

            compatible = "arm,vexpress,v2m-p1", "simple-bus";

            #address-cells = <2>; /* SMB chipselect number and offset */

            #size-cells = <1>;

            #interrupt-cells = <1>;

            ranges;

 

            flash@0,00000000 {

                compatible = "arm,vexpress-flash", "cfi-flash";

                reg = <0 0x00000000 0x04000000>,

                      <4 0x00000000 0x04000000>;

                bank-width = <4>;

            };

 

            ethernet@2,02000000 {

                compatible = "smsc,lan91c111";

                reg = <2 0x02000000 0x10000>;

                interrupts = <15>;

            };

 

When I compile the fvp-base-revc.dts file 

(following this method to handle pre-processing :
https://stackoverflow.com/questions/50658326/device-tree-compiler-not-recogn
izes-c-syntax-for-include-files), it gives me error below.

 

arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi:20.21-25.6: Warning
(simple_bus_reg): /smb@8000000/motherboard/flash@0,00000000: simple-bus unit
address format error, expected "0"

arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi:27.24-31.6: Warning
(simple_bus_reg): /smb@8000000/motherboard/ethernet@2,02000000: simple-bus
unit address format error, expected "202000000"

 

The dtc is complaining about the address format `flash@0,00000000` or
`ethernet@2,02000000`. 

But because the #address-cells = <2>, the node address should be given by
chip select number and the offset (inside the chip select). 

How can I prevent this error? DTC version is 1.5.0.

 

Any help will be appreciated.

Thank you!

Chan Kim

 


[-- Attachment #1.2: Type: text/html, Size: 10450 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

      reply	other threads:[~2021-10-27 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27  9:44 DTC compile error (simple-bus unit address format error for #address-cells = <2> case) Chan Kim
2021-10-27 11:57 ` Chan Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00e701d7cb29$d74092f0$85c1b8d0$@etri.re.kr' \
    --to=ckim@etri.re.kr \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox