Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunxi: add support for FriendlyARM NanoPi R1 #2990

Closed
wants to merge 1 commit into from

Conversation

jayanta525
Copy link
Contributor

@jayanta525 jayanta525 commented May 4, 2020

Specification:

  • CPU: Allwinner H3, Quad-core Cortex-A7 Up to 1.2GHz
  • DDR3 RAM: 512MB/1GB
  • Network:
    • 10/100/1000M Ethernet x 1,
    • 10/100M Ethernet x 1
  • WiFi: 802.11b/g/n, with SMA antenna interface
  • USB Host: Type-A x2
  • MicroSD Slot x 1
  • MicroUSB: for OTG and power input
  • Debug Serial Port: 3Pin 2.54mm pitch pin-header
  • Power Supply: DC 5V/2A

Installation:

  • Write the image file to an SD Card with dd or any image burning tool
  • Boot NanoPi from the SD Card

The following features are working and tested:

  • Ethernet ports
    • 10/100/1000M Ethernet
    • 10/100M Ethernet
  • LED:
    • nanopi:red:status
    • nanopi:green:wan
    • nanopi:green:lan
  • KEY:
    • reset

Signed-off-by: Jayantajit Gogoi jayanta.gogoi525@gmail.com

@adschm
Copy link
Member

adschm commented May 4, 2020

This is a copy of #2987

Please don't open a new PR just for changes next time. The change should be pushed to the old PR, because otherwise we will loose all the discussion history.

@adschm adschm added needs changes target/sunxi pull request/issue for sunxi target labels May 4, 2020
@jayanta525
Copy link
Contributor Author

The old fork got deleted and all commits were lost. Had to make another fork.

@adschm
Copy link
Member

adschm commented May 4, 2020

The old fork got deleted and all commits were lost. Had to make another fork.

"got deleted" -> I assume you deleted it ... :-)

@jayanta525 Technically, it would have been possible. (Read about git rebase and git push -f.) However, it's waste of time to discuss that now. Please take care next time.

@jayanta525
Copy link
Contributor Author

Accidentally deleted the original branch the pull request was created of while trying to add support for nanopi-r2s.

Cleanup of everything, and little knowledge about git led to another pull request. Won't happen again.

DTS and uboot patch files are ported from armbian-kernel.

Build compiles successfully and nanopi-r1 boots with the image.

Everything works as expected.

@adschm
Copy link
Member

adschm commented May 5, 2020

Minor formal comment:

  • commit title: Add->add; remove dot at the end
  • Consider adding an empty line after "Specification" and "Installation", as well as inserting a space after and before the list-bullet-points for better reading.
  • "LED x 3" that's quite useless. Either name the purposes of the LEDs, or remove that line. Same for keys in commit message.

@adschm
Copy link
Member

adschm commented May 5, 2020

Your DTS seems to contain a lot of stuff that's in the DTSI as well (I only checked the directly included one, I assume similar cases may be found for the more remotely related files.

Please tidy that up.

@jayanta525 jayanta525 changed the title sunxi: Add support for NanoPi R1. sunxi: add support for NanoPi R1 May 5, 2020
@jayanta525 jayanta525 force-pushed the master branch 2 times, most recently from bdac7e2 to 27fb40d Compare May 6, 2020 07:59
@jayanta525 jayanta525 requested a review from adschm May 6, 2020 08:01
@adschm
Copy link
Member

adschm commented May 6, 2020

You'll make your life much easier if you use "git rebase" instead of merging.

Also have a look at "git rebase -i" for editing/squashing

@sbilly
Copy link

sbilly commented Jul 3, 2020

kernel print when booting.

[    0.002878] /cpus/cpu@0 missing clock-frequency property
[    0.002915] /cpus/cpu@1 missing clock-frequency property
[    0.002943] /cpus/cpu@2 missing clock-frequency property
[    0.002972] /cpus/cpu@3 missing clock-frequency property

add following to 062-ARM-dts-sun8i-add-support-for-Nano-Pi-R1-openwrt-master.patch fixed.

Index: linux-5.4.48/arch/arm/boot/dts/sun8i-h3.dtsi
===================================================================
--- linux-5.4.48.orig/arch/arm/boot/dts/sun8i-h3.dtsi
+++ linux-5.4.48/arch/arm/boot/dts/sun8i-h3.dtsi
@@ -78,6 +78,7 @@
                        clock-names = "cpu";
                        operating-points-v2 = <&cpu0_opp_table>;
                        #cooling-cells = <2>;
+                       clock-frequency = <1296000000>;
                };

                cpu1: cpu@1 {
@@ -88,6 +89,7 @@
                        clock-names = "cpu";
                        operating-points-v2 = <&cpu0_opp_table>;
                        #cooling-cells = <2>;
+                       clock-frequency = <1296000000>;
                };

                cpu2: cpu@2 {
@@ -98,6 +100,7 @@
                        clock-names = "cpu";
                        operating-points-v2 = <&cpu0_opp_table>;
                        #cooling-cells = <2>;
+                       clock-frequency = <1296000000>;
                };

                cpu3: cpu@3 {
@@ -108,6 +111,7 @@
                        clock-names = "cpu";
                        operating-points-v2 = <&cpu0_opp_table>;
                        #cooling-cells = <2>;
+                       clock-frequency = <1296000000>;
                };
        };
 

@jayanta525
Copy link
Contributor Author

@sbilly

  • added, rebased and forced-pushed.

@1715173329
Copy link
Member

Anything update?

@hauke
Copy link
Member

hauke commented Oct 11, 2020

Why are the kernel and the u-boot device tree file different? We should try to use the same file for both.

@jayanta525
Copy link
Contributor Author

Hello @hauke, thanks for the review. This PR is outdated and needs to be updated and rebased. I will do that ASAP.

@jayanta525
Copy link
Contributor Author

@sbilly , can you help me out by testing some builds with new uboot and kernel?

@hauke
Copy link
Member

hauke commented Oct 11, 2020

Could you also rename the patches, because these number are now already used by the board added in #3297 .

@sbilly
Copy link

sbilly commented Oct 12, 2020

@sbilly , can you help me out by testing some builds with new uboot and kernel?

sure. which commit?

@jayanta525
Copy link
Contributor Author

@sbilly the latest forced-pushed commit.

@sbilly
Copy link

sbilly commented Oct 12, 2020

@sbilly the latest forced-pushed commit.

I'll test it in few days.

@jayanta525
Copy link
Contributor Author

@hauke @adschm Updated the DTS with that of the schematics and rebased to the latest master.

  • Regarding u-boot device tree, I have kept it as small as possible, adding only the EMAC RGMII, EMMC, and one USB2.0.
  • Wireless card over SDIO isn't added in u-boot device tree.
  • USB_OTG controller isn't enabled in the kernel device tree.
  • dmesg here: https://paste.ubuntu.com/p/hG5BYws8PJ/

Tested and Working:

  • 1000Mbit EMAC
  • 100Mbit rtl8152 over USB2.0
  • 2x Type-A USB2.0
  • AP6212 Wireless with brcmfmac-firmware-43430-sdio
  • 3x LED (Status/LAN/WAN)

@hauke
Copy link
Member

hauke commented Oct 13, 2020

I would prefer if you keep the kernel and the u-boot device tree files more or less the same.

Are you planning to add support for this board into upstream U-Boot and Linux kernel?

@jayanta525
Copy link
Contributor Author

jayanta525 commented Oct 13, 2020

@hauke

No, this board is pretty old 2019 Q1, and with 100M LAN port, it's unlikely it will attract new buyers, and it's successor NanoPi R2S is already sent for upstream.

The device tree files for both kernel and u-boot are the same, just that u-boot doesn't have the wireless node and one extra USB2.0. IMHO it's not necessary to have the extra USB2.0 and wireless in u-boot.

Updated.

Specification:

- CPU: Allwinner H3, Quad-core Cortex-A7 Up to 1.2GHz
- DDR3 RAM: 512MB/1GB
- Network:
    10/100/1000M Ethernet x 1,
    10/100M Ethernet x 1
- WiFi: 802.11b/g/n, with SMA antenna interface
- USB Host: Type-A x2
- MicroSD Slot x 1
- MicroUSB: for OTG and power input
- Debug Serial Port: 3Pin 2.54mm pitch pin-header
- LED:
    nanopi:red:status
    nanopi:green:wan
    nanopi:green:lan
- KEY:
    reset
- Power Supply: DC 5V/2A

Installation:

- Write the image to SD Card with dd
- Boot NanoPi from the SD Card

Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
@jayanta525
Copy link
Contributor Author

@hauke Updated, u-boot and kernel now uses the same device tree.

@sbilly
Copy link

sbilly commented Oct 14, 2020

jayanta525@ac64bea It's seem good to me. @jayanta525

boot log: https://paste.ubuntu.com/p/jYpnFs23J6/

@hauke
Copy link
Member

hauke commented Oct 18, 2020

Thank you, I applied the patches to master.

I removed the 300-sunxi-h3-suppress-clock-frequency-warning.patch patch, I am not sure if this is correct. Could you please send this upstream so it gets integrated into the upstream Linux kernel.

It would also be nice if you could send these patches to upstream Linux and U-Boot.

@hauke hauke closed this Oct 18, 2020
@jayanta525 jayanta525 deleted the master branch January 19, 2021 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs changes target/sunxi pull request/issue for sunxi target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants