I have some small update about this:
While I still cannot find a way to use the fdt
command, but I've found a way to build a my-board.c
file.
I'm not 100% sure it is running on boot.
I also have found a way to boot u-boot via OEM u-boot using tftp, it is probably not the best way but:
MT7986> tftpboot u-boot.bin #this is taken from the build_dir
MT7986> go 0x46000000
Another big question now is the following error: Warning: ethernet@15100000 (eth0) using random MAC address - 3e:a1:90:40:51:aa
. Now this should be possible to solve by passing an nvram cell to the eth driver so what I've done is to add the nodes to the u-boot dts:
ð {
mediatek,switch = "mt7531";
mediatek,gmac-id = <0>;
reset-gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
phy-mode = "sgmii";
status = "okay";
+ nvmem-cells = <&macaddr_factory_002a>;
+ nvmem-cell-names = "mac-address";
fixed-link {
speed = <1000>;
full-duplex;
};
};
...
...
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "bl2";
reg = <0x0 0x100000>;
};
partition@100000 {
label = "u-boot-env";
reg = <0x0100000 0x0080000>;
};
- partition@180000 {
+ factory: partition@180000 {
label = "factory";
reg = <0x180000 0x0200000>;
};
partition@380000 {
label = "fip";
reg = <0x380000 0x0200000>;
};
partition@540000 {
label = "zloader";
reg = <0x540000 0x0040000>;
read-only;
};
partition@580000 {
label = "ubi";
reg = <0x580000 0x1da80000>;
};
};
...
...
+&factory {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_factory_0004: macaddr@0004 {
+ reg = <0x0004 0x6>;
+ };
+
+ macaddr_factory_0024: macaddr@0024 {
+ reg = <0x0024 0x6>;
+ };
+
+ macaddr_factory_002a: macaddr@002a {
+ reg = <0x002a 0x6>;
+ };
+};
Unfortunatly this didnt seem to have solved the issue.
In fact I'm probably missing something to have it working, I have to find a proper way to print debug stuff.
But I have a find a way to properly enable debug yet.
Another thing that seems to be broken is the GPIO_HOG
feature by launching gpio status
:
EX5601>gpio status
Bank mt7986_pinctrl:
mt7986_pinctrl5: output: 1 [x] ethernet@15100000.reset-gpios
mt7986_pinctrl12: output: 1 [x] red_pwr.gpios
mt7986_pinctrl13: output: 0 [x] green_pwr.gpios
mt7986_pinctrl21: input: 1 [x] reset.gpios
EX5601>
What I've done to try to enable the gpios as inputs was to do, probably its not the right syntax?
+&gpio {
+ sfp_presence {
+ gpio-hog;
+ input;
+ gpios = <57 GPIO_ACTIVE_LOW>;
+ };
+
+ sfp_mux {
+ gpio-hog;
+ output-low;
+ gpios = <10 GPIO_ACTIVE_LOW>;
+ };
+};
I probably have to add a label so it can be picked up from the custom board.c
file.
I need the two gpios to be working so that I can load the correct DTO during boot.
If you guys have any suggestion I will accept them
You can find the full patch here:u-boot DTS