Compare commits

...

190 Commits
f27 ... master

Author SHA1 Message Date
Peter Robinson 8e2560d851 add RNG driver for rpi4 2020-12-28 22:14:17 +00:00
Peter Robinson 9019d1f21b 2021.01 RC4, new rpi-400 patch
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2020-12-28 21:48:37 +00:00
Peter Robinson 459ca6d6b4 update rk3399 rng patch 2020-12-16 15:57:14 +00:00
Peter Robinson 43dd5ec40f add PineCube patch 2020-12-15 18:31:27 +00:00
Peter Robinson ce18c50c5d 2021.01 RC3, latest proposed RPi-400 patch, UEFI boot fixes 2020-12-15 18:07:49 +00:00
Javier Martinez Canillas 5fa2e9250c
Fix a "scan_dev_for_efi" not defined error
A previous commit dropped a NUL character at the end of scan_dev_for_dtb
definition and this caused scan_dev_for_efi to not be defined. Following
error is shown by U-Boot when trying to boot an EFI binary:

 Scanning mmc 0:2...
 ## Error: "scan_dev_for_efi" not defined
2020-12-14 09:59:39 +01:00
Peter Robinson 6623ecd526 more failures 2020-11-26 09:13:41 +00:00
Peter Robinson 87d65f314f temp drop a few more broken boards 2020-11-25 21:30:20 +00:00
Peter Robinson f8bd28f34b drop tegra devices for the momenet 2020-11-24 23:40:26 +00:00
Peter Robinson 1c8ae2917f add rpi400 patch 2020-11-24 10:48:10 +00:00
Peter Robinson 0d5a9f5f0b 2021.01 RC2
Latest Pinebook Pro display patches
Initial RPi-400 support patch
Update Fedora specific patches
2020-11-24 10:43:24 +00:00
Peter Robinson 63553e6b2a Disable rockchip offset patch for the moment 2020-11-10 13:22:57 +00:00
Peter Robinson 39205cc2da Fix Keyboard and USB-A ports on Pinebook Pro
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2020-11-10 10:25:30 +00:00
Peter Robinson 642bba9fd3 Latest Pinebook Pro display patches 2020-11-08 23:30:08 +00:00
Peter Robinson 2cf8c77ba4 Fix SPI on Rockchip devices 2020-11-08 23:08:27 +00:00
Peter Robinson 955b9471d4 tweak pine64 fix 2020-10-28 19:59:52 +00:00
Peter Robinson 244095cafc fix for upstream Allwinner network issues 2020-10-28 10:12:12 +00:00
Peter Robinson ecfe5a01c5 Fix kernel installs for non EBBR systems 2020-10-28 08:22:07 +00:00
Peter Robinson 2aca29e4a7 Rockchips fixes 2020-10-07 16:12:13 +01:00
Peter Robinson 68cd2ba55a 2020.10 2020-10-07 11:14:09 +01:00
Peter Robinson cfe13af2a5 Update Rock960 patch 2020-09-29 14:40:43 +01:00
Peter Robinson 569f76e54a fix USB starting for keyboard/storage 2020-09-29 10:51:39 +01:00
Peter Robinson 003e91fbfc Initial support for display output on Pinebook Pro 2020-09-27 17:20:39 +01:00
Peter Robinson 6513475170 2020.10 RC5 2020-09-22 12:52:02 +01:00
Peter Robinson 5bf1926b83 Fix pinephone dts compile fail 2020-09-09 11:20:31 +01:00
Peter Robinson e87d4e0670 Update to 2020.10 rc4 2020-09-09 11:04:11 +01:00
Peter Robinson 6d250131e6 add missing patch 2020-08-25 14:55:15 +01:00
Peter Robinson ac3269a2ff Enable a number of new Rockchip devices 2020-08-25 14:53:52 +01:00
Peter Robinson 609e2fbd01 Minor patch updates and cleanups 2020-08-19 15:55:37 +01:00
Peter Robinson 4a13ab93a8 2020.10 RC2 2020-08-10 22:23:45 +01:00
Peter Robinson 2410ac8a2a 2020.10 RC1 2020-07-28 09:16:30 +01:00
Tom Stellard 5efdbcf3bc Use make macros
https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
2020-07-14 14:36:26 +00:00
Peter Robinson 65f13a988e v2020.07 2020-07-06 21:37:55 +01:00
Peter Robinson b7b23dc611 drop omap3_pandora, no longer upstream 2020-06-24 10:13:08 +01:00
Peter Robinson 5037de6420 fix up move of docs 2020-06-23 23:37:35 +01:00
Peter Robinson f6357946c0 2020.07 RC5 2020-06-23 23:07:29 +01:00
Peter Robinson aea19bdfee Update various patches to latest upstream 2020-06-18 16:01:52 +01:00
Peter Robinson 599c805196 2020.07 RC4 2020-06-10 13:33:14 +01:00
Peter Robinson d5c5edbb72 2020.07 RC2 2020-05-12 23:33:51 +01:00
Peter Robinson 3e0e8cf1f3 Xilinx ZYNQ now has a single U-Boot for all boards 2020-04-30 09:04:51 +01:00
Peter Robinson e46467332f 2020.07 RC1 2020-04-29 23:07:34 +01:00
Peter Robinson 771c6cdcdb Initial pci/usb support for rpi4 2020-04-22 14:25:30 +01:00
Peter Robinson c5d796ffd3 Ship u-boot-rockchip.bin for SPI flash 2020-04-21 15:57:14 +01:00
Peter Robinson 37735d002b Fix ATF for new aarch64 devices 2020-04-20 23:58:44 +01:00
Peter Robinson 0ca7ebed9d Add missing patches for rockchips pbp 2020-04-20 22:53:57 +01:00
Peter Robinson 7b999dab42 Fixes for Rockchips devices 2020-04-20 22:30:59 +01:00
Peter Robinson da6fd9ebde Fix Wandboard board detection (rhbz 1825247) 2020-04-18 13:19:10 +01:00
Peter Robinson db65f1abec add missing patch 2020-04-14 10:44:13 +01:00
Peter Robinson 3084c0898a 2020.04 2020-04-14 10:17:48 +01:00
Peter Robinson d8c86a078c 2020.04 RC5 2020-04-07 09:49:18 +01:00
Peter Robinson 70d667ee29 Support RNG for random seed for KASLR on some Rockchip devices 2020-04-01 11:30:30 +01:00
Peter Robinson 4907bf064f Updates for NVIDIA Jetson platforms 2020-04-01 00:38:08 +01:00
Peter Robinson 0d270e1ab5 2020.04 RC4 2020-04-01 00:03:59 +01:00
Peter Robinson 21eea886b1 Fix ext4 alignment issue seen on some NXP i.MX devices 2020-03-26 11:28:23 +00:00
Peter Robinson 24b4862160 2020.04 RC3 2020-02-26 15:47:14 +00:00
Peter Robinson 2c4918a96d 2020.04 RC2 2020-02-13 11:09:39 +00:00
Peter Robinson b16faa89e5 Update genet NIC driver 2020-02-02 11:19:15 +00:00
Peter Robinson fbb777748c libretech_all_h3_it_h5 is aarch64 2020-01-30 13:15:36 +00:00
Peter Robinson 1ca87c8c29 2020.04 device updates, gcc 10 fix 2020-01-30 09:46:03 +00:00
Peter Robinson 85b5f80fcd v2020.04 rc1 2020-01-29 09:07:19 +00:00
Peter Robinson d332b4c202 imx6: fix for wandboard 2020-01-08 10:41:03 +00:00
Peter Robinson 24204bb7d0 disable gen of SPL bits for rk3328 series 2020-01-07 06:44:18 +00:00
Peter Robinson c3cc1521a1 disable gen of SPL bits for rk3328 series 2020-01-07 06:23:19 +00:00
Peter Robinson 376315c6bd drop fixes upstreamed 2020-01-07 05:57:09 +00:00
Peter Robinson 6420e73012 2020.01 2020-01-07 01:08:40 +00:00
Peter Robinson 7fa7ccdc72 2020.01 RC5 2019-12-17 07:47:42 +00:00
Peter Robinson 267ed26924 rpi fixes 2019-12-13 00:21:28 +00:00
Peter Robinson 0b08ed6c72 Khadas Edge and VIM, other fixes 2019-12-08 11:21:39 +00:00
Peter Robinson 88d70fd395 Fixes for AllWinner, Raspberry Pi, Rockchip, Xilinx ZynqMP 2019-12-03 23:27:51 +00:00
Peter Robinson b3d55ee9b8 drop dupelicate aarch64 install loop, cleanup aarch/arm file copy logic a little, drop smdkv310 from builds 2019-12-03 12:17:30 +00:00
Peter Robinson ed55f80394 2020.01 RC4 2019-12-03 08:47:22 +00:00
Peter Robinson 303500d679 roc-rk3399-pc -> roc-pc-rk3399 2019-11-19 11:08:01 +00:00
Peter Robinson 33f60458f6 2020.01 RC3 2019-11-19 09:22:48 +00:00
Peter Robinson 6e2ccb98b1 2020.01 RC2 2019-11-12 09:33:51 +00:00
Peter Robinson e76bd0ca44 build against ATF 2.2 2019-11-05 23:21:02 +00:00
Peter Robinson 7878d97fd4 2020.01 RC1, Initial migration to python3 2019-10-31 17:06:34 +00:00
Peter Robinson f8d3dfbeef Fixes for Rockchips rk3328 and rk3399 platforms 2019-10-09 18:14:48 +01:00
Peter Robinson 2f87ed820e 2019.10 2019-10-08 16:17:52 +01:00
Peter Robinson 7f0a3a4eaa 2019.10 RC4 2019-09-23 17:42:39 +01:00
Peter Robinson 13e776d8d6 Minor fixes 2019-09-11 10:34:41 +01:00
Peter Robinson 5786b075f8 fennec-rk3288 was dropped 2019-08-27 11:50:20 +01:00
Peter Robinson 2984010404 enable roc-rk3399-pc 2019-08-27 10:02:52 +01:00
Peter Robinson 28ed29c8ec easylogo was dropped 2019-08-27 09:09:56 +01:00
Peter Robinson ae1a05f516 2019.10 rc3 2019-08-27 08:19:50 +01:00
Peter Robinson f00e59665f Re-add accidentally dropped RPi4 patch 2019-08-26 17:11:19 +01:00
Peter Robinson 55487ddec2 fix build of Jetson Nano 2019-08-26 15:18:21 +01:00
Peter Robinson b054e6bb42 Temporarily disable Chrome devices due to unexpected retirement of vboot-utils, python2-pyelftools re-written in something else 2019-08-26 13:02:45 +01:00
Peter Robinson 268b040fc0 fixes to building 2019.10-rc2 2019-08-26 08:35:47 +01:00
Peter Robinson d66aef9a14 2019.10 RC2 2019-08-14 11:06:09 +01:00
Peter Robinson d1ce3181e9 fix crash on rpi4 with no display 2019-08-04 22:37:25 +01:00
Peter Robinson f215defee6 Rock960 fix, Iniital Raspberry Pi 4 support 2019-08-04 20:35:49 +01:00
Fedora Release Engineering 0b3a57d474 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-27 02:16:46 +00:00
Peter Robinson f2e16593da 2019.07, Rock64, Rock960 enhancements, cleanups 2019-07-09 00:18:59 +01:00
Peter Robinson d2929efe62 Fix build with explicit python2 2019-06-28 13:30:27 +01:00
Peter Robinson 194cb00fcb add some comments to some patches 2019-06-28 09:26:31 +01:00
Peter Robinson f995ddaa1b fix up patch listing 2019-06-18 12:18:55 +01:00
Peter Robinson c529a6c6e8 2019.07 RC4, Obsolete unused elf packages, new rk3399 devices 2019-06-18 12:12:09 +01:00
Peter Robinson 4f63e87d51 Build and ship pre built SD/SPI SPL bits for all rk3399 boards 2019-05-04 11:22:48 +01:00
Peter Robinson 178f1bba0f 2019.04, Fixes for AllWinner and NVIDIA Jetson devices 2019-04-18 15:53:13 +01:00
Peter Robinson 7f3f828546 Latest Tegra patch revision 2019-04-05 06:41:33 +01:00
Peter Robinson bd4cc382b4 Add ability to make creation of boot/dtb symlink configurable 2019-03-31 12:45:47 +01:00
Peter Robinson 5a26b77b90 Add config file check to see if we create kernel DT sym link to enable use of firmware DT 2019-03-30 01:09:06 +00:00
Peter Robinson d6082cf854 Minor UEFI fixes, Tegra Jetson TX series rebase 2019-03-27 15:54:54 +00:00
Peter Robinson dca146ee9f Tegra Jetson TX-series improvements 2019-03-20 11:39:59 +00:00
Peter Robinson 982620b114 2019.04 RC4 2019-03-19 10:53:38 +00:00
Peter Robinson 7456ce2f7a fix/update BananaPi board naming 2019-03-05 13:45:11 +00:00
Peter Robinson 445d67aa75 2019.04 RC3 2019-03-05 08:11:23 +00:00
Peter Robinson cb3945e319 add bananapi_m2_plus_h5 2019-03-02 11:38:36 +00:00
Peter Robinson 9823edcb94 2019.04 RC2 2019-02-19 09:01:34 +00:00
Peter Robinson 652ffd7e03 rebuild for new ATF snapshot 2019-02-09 20:01:18 +00:00
Peter Robinson 5c08e035b3 Disable turris_omnia as it fails build with gcc9 due to the SPL being oversize 2019-02-08 11:54:11 +00:00
Peter Robinson 8cce6b78d6 2019.04 RC1 2019-02-08 07:47:28 +00:00
Fedora Release Engineering c51339ee3e - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-03 10:37:43 +00:00
Peter Robinson 965068b7e0 2019.01 2019-01-15 07:03:28 +00:00
Peter Robinson 3e7633feba 2019.01 RC3 2019-01-08 06:28:06 +00:00
Peter Robinson ff742d18c6 add efi patch 2018-12-19 03:03:23 +00:00
Peter Robinson 8b18f846e5 2019.01 RC2 2018-12-18 13:56:46 +00:00
Peter Robinson 0af9e0dfb6 ATF tweaks and fixes, Enable amarula_a64_relic, nanopi_a64, puma-rk3399 2018-12-12 06:57:00 +00:00
Peter Robinson 7251616ca0 fix name of README.odroid-c2 file 2018-12-04 15:50:20 +00:00
Peter Robinson 1ecd9b94d2 2019.01 RC1, new devices 2018-12-04 15:40:35 +00:00
Peter Robinson 5856918f28 2018.11, Build with ATF 2.0, Fix Hummingboard and CuBox-i devices 2018-12-04 10:37:53 +00:00
Peter Robinson 1a5c77caf4 update docs for i.MX 2018-10-30 15:10:00 +00:00
Peter Robinson 6ce6803ef8 2018.11 RC3 2018-10-30 13:31:34 +00:00
Peter Robinson 5ffeca0670 update uefi patch 2018-10-30 11:38:52 +00:00
Pablo Greco 08c8c778c9 Support building in el7 with devtoolset-7 2018-10-02 16:45:05 -03:00
Peter Robinson c8edd47611 Rebase to Rock960 v3 patches, uEFI fixes, minor other tweaks 2018-10-02 20:30:36 +01:00
Peter Robinson f5a780f2f5 Update Rock960 patches, enable Rock960 Enterprise Edition (ficus) 2018-09-23 06:26:54 +01:00
Peter Robinson 05cb1fc645 remove obsolete patches 2018-09-14 20:00:03 +01:00
Peter Robinson 1cd358380e 2018.09 2018-09-11 08:48:44 +01:00
Peter Robinson ce842aae38 update Pine64 LTS patch 2018-09-05 17:01:21 +01:00
Peter Robinson 2489007525 add Pine64 LTS patch 2018-09-05 14:04:55 +01:00
Peter Robinson 93c0afec39 rebase tegra patches 2018-09-05 13:46:10 +01:00
Peter Robinson 4092671818 Add tegra patch 2018-09-04 18:51:09 +01:00
Peter Robinson 7a86b11d16 2018.09 RC3, Enable nanopi_neo_plus2, pine_h64, rock960-rk3399, a64-olinuxino, Build against new upstream AllWinner ATF support 2018-09-04 13:47:36 +01:00
Peter Robinson 2b2f1d49ca 2018.09 RC2, improve Jetson TX1, Enable OrangePi 1+ and Avnet Ultra96 2018-08-14 16:52:39 +01:00
Peter Robinson c2fad53872 2018.09 RC1 2018-07-31 12:16:10 +01:00
Fedora Release Engineering e053e4788e - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-14 08:07:04 +00:00
Peter Robinson 8ca4d6ca43 2018.07 2018-07-10 16:54:10 +01:00
Peter Robinson d0ecd187b5 drop upstreamed i.MX6 Solid Run patch 2018-07-03 10:55:36 +01:00
Peter Robinson 6048e76bc7 2018.07 RC3 2018-07-03 10:23:36 +01:00
Peter Robinson 53da82c18c 2018.07 RC2 2018-06-20 11:35:14 +01:00
Peter Robinson f99f9122c9 enable helios4, stop building highbank 2018-06-19 12:26:40 +01:00
Peter Robinson 177a339959 Update sunxi MMC patch series, Tegra Nyan patch, SolidRun i.MX6 SoM rev 1.5 patch 2018-06-08 04:35:34 +01:00
Peter Robinson 5eae64808d add new patch 2018-06-05 05:41:06 +01:00
Peter Robinson e91a3ca4a6 2018.07 RC1, Enable Turris Mox, BananaPi m2 Berry, some Libretech boards 2018-06-05 05:34:56 +01:00
Peter Robinson bed5e0645d add missing patch 2018-05-07 18:06:12 +01:00
Peter Robinson b408405112 2018.05 GA 2018-05-07 18:04:01 +01:00
Peter Robinson 853b8ad2d9 add sunxi mmc patch for A64 new mode 2018-05-02 12:06:19 +01:00
Peter Robinson faff36ceac Build Xilnix ZynqMP zcu100 (96boards Ultra96) 2018-05-02 11:04:07 +01:00
Peter Robinson 18c86f4d2a 2018.05 RC3 2018-05-01 14:47:57 +01:00
Peter Robinson d8dcaeaa21 uEFI improvements, Fixes for Rockchips rk33xx 64 bit devices, Build AllWinner 64 bit devices against new ATF 2018-04-26 17:36:41 +01:00
Peter Robinson c24d544f08 drop zcu100 for the moment, needs investigation 2018-04-17 23:36:17 +01:00
Peter Robinson a23bba7d6b Enable Raspberry Pi option to use firmware DT (again), Xilinx zcu100 (Ultra96) 2018-04-17 17:32:44 +01:00
Peter Robinson 9f78267f76 Enable some AllWinner tablets, sort boards 2018-04-17 11:38:07 +01:00
Peter Robinson 1e40ecdb5e u-boot 2018.05 rc2 2018-04-17 11:34:14 +01:00
Peter Robinson e6c2070280 2018.05 RC1 2018-04-08 09:04:57 +01:00
Peter Robinson ffcc253f44 Improvements for Raspberry Pi, AllWinner MMC perf, mvebu devices 2018-04-06 16:34:45 +01:00
Peter Robinson 7cac5dd637 Fix issue with certain MMC cards on Raspberry Pi 2018-03-20 01:25:33 +00:00
Peter Robinson d7be3592de Add support for Raspberry Pi 3+ 2018-03-16 06:09:09 +00:00
Peter Robinson 30f2e8f650 drop upstreamed RPi fixes 2018-03-13 15:16:09 +00:00
Peter Robinson 45ad967485 2018.03 GA 2018-03-13 15:13:47 +00:00
Peter Robinson d57c7e5938 support Jetson TX2 2018-03-09 16:20:53 +00:00
Peter Robinson 69973d4257 Fix for Raspberry Pi 2 boot 2018-03-08 18:18:08 +00:00
Peter Robinson 6deb24c1da Fixes for Raspberry Pi 3 boot, Minor kernel install fixes, Enable am335x_evm_usbspl for Beagle Pocket 2018-03-07 14:30:51 +00:00
Peter Robinson 64787aacdc 2018.03 RC4, DragonBoard patch rebase# 2018-03-06 10:18:40 +00:00
Peter Robinson 94d0fceff4 update changelog for 'Rebuild for new ATF 1.5 rc0 release' 2018-03-04 13:40:51 +00:00
Peter Robinson f59d42b013 Add support for SoM rev 1.5 to mx6cuboxi 2018-03-04 13:39:54 +00:00
Peter Robinson d61be86375 Build 64 bit Rockchips FIT images with ARM Trusted Firmware 2018-02-25 22:04:37 +00:00
Peter Robinson 7cba8b3f1b 2018.03 RC3 2018-02-20 23:24:29 +00:00
Peter Robinson 38866e02ba a few upstream fixes 2018-02-16 12:30:49 +00:00
Peter Robinson bcd4bd33cd Fix for GBps network on some AllWinner devices 2018-02-15 17:45:45 +00:00
Peter Robinson ddd1aa14bb 2018.03 RC2 2018-02-13 00:04:26 +00:00
Peter Robinson 5b6fc3bc15 Update uEFI patches 2018-02-07 12:41:43 +00:00
Peter Robinson ad338c0588 2018.03 RC1, initial rebase, most patches disabled for vanilla testing 2018-01-30 10:35:25 +00:00
Peter Robinson ffcdd29013 2018.01 GA, various Dragonboard fixes and rebases 2018-01-16 03:31:08 +00:00
Peter Robinson d09dfd414d 2018.01 RC3 2018-01-02 04:28:05 +00:00
Peter Robinson ad36d48b58 2018.01 RC2 2017-12-22 01:35:59 +00:00
Peter Robinson c158ae2d77 devicetree install script should just exit on non ARM 2017-11-28 11:00:21 +00:00
Peter Robinson 0f976adcdd Newer EFI loader fix patch, Fix static MAC on omap3/omap4 devices 2017-11-23 13:16:16 +00:00
Peter Robinson f9dc956b0c Add EFI loader fix 2017-11-21 12:30:37 +00:00
Peter Robinson e6b91d581b add patch to fix ftbfs 2017-11-16 15:02:32 +00:00
Peter Robinson c38aedf83a 2017.11 2017-11-15 08:09:50 +00:00
Peter Robinson 7d42f10ee5 2017.11 RC4 2017-11-07 10:08:57 +00:00
Peter Robinson 6a431010ff 2017.11 RC3 2017-11-04 12:21:38 +00:00
Peter Robinson 34cd2c20de Add a architecture check for the DT kernel setup 2017-11-04 12:17:35 +00:00
Peter Robinson 9eb7b5cad1 Update / rebase a couple of patches 2017-10-17 17:57:03 +01:00
Peter Robinson 051d54d9c8 rebase fdt patches and re-enable 2017-10-17 13:20:54 +01:00
Peter Robinson c09f014d7f add fdt fixes patch 2017-10-17 13:10:24 +01:00
Peter Robinson 405df49197 incorrect rockchips patch 2017-10-17 10:46:05 +01:00
Peter Robinson d1eb73c597 2017.11 RC2, rebase patch set 2017-10-17 10:43:37 +01:00
33 changed files with 4615 additions and 14197 deletions

View File

@ -0,0 +1,29 @@
From 1849ef423238aeb1732eb3b8e67eb46bc21401c7 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Thu, 10 Sep 2020 14:24:12 +0100
Subject: [PATCH] Fix BeagleAI detection
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
board/ti/am57xx/board.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 7809875510..3232812a97 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -527,8 +527,10 @@ void do_board_detect(void)
rc = ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
CONFIG_EEPROM_CHIP_ADDRESS);
- if (rc)
+ if (rc) {
printf("ti_i2c_eeprom_init failed %d\n", rc);
+ ti_i2c_eeprom_am_set("BBONE-AI", "A");
+ }
#ifdef CONFIG_SUPPORT_EMMC_BOOT
rc = board_bootmode_has_emmc();
--
2.26.2

View File

@ -0,0 +1,518 @@
From 25ce28126444900b7b3efef36c6b9d15a6ab9af1 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 28 Oct 2020 10:08:44 +0000
Subject: [PATCH] Fixes for AllWinner ethernet network interfaces
The upstream kernel in fixing stuff has broken stuff.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
arch/arm/dts/sun50i-a64-bananapi-m64.dts | 2 +-
arch/arm/dts/sun50i-a64-nanopi-a64.dts | 2 +-
arch/arm/dts/sun50i-a64-oceanic-5205-5inmfd.dts | 2 +-
arch/arm/dts/sun50i-a64-olinuxino.dts | 2 +-
arch/arm/dts/sun50i-a64-orangepi-win.dts | 2 +-
arch/arm/dts/sun50i-a64-pine64-plus.dts | 2 +-
arch/arm/dts/sun50i-a64-sopine-baseboard.dts | 2 +-
arch/arm/dts/sun50i-h5-libretech-all-h5-cc.dts | 2 +-
arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts | 2 +-
arch/arm/dts/sun50i-h5-nanopi-neo2.dts | 2 +-
arch/arm/dts/sun50i-h5-orangepi-pc2.dts | 2 +-
arch/arm/dts/sun50i-h5-orangepi-prime.dts | 2 +-
arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts | 2 +-
arch/arm/dts/sun50i-h6-beelink-gs1.dts | 2 +-
arch/arm/dts/sun50i-h6-pine-h64.dts | 2 +-
arch/arm/dts/sun7i-a20-bananapi-m1-plus.dts | 2 +-
arch/arm/dts/sun7i-a20-bananapi.dts | 2 +-
arch/arm/dts/sun7i-a20-bananapro.dts | 2 +-
arch/arm/dts/sun7i-a20-cubietruck.dts | 2 +-
arch/arm/dts/sun7i-a20-hummingbird.dts | 2 +-
arch/arm/dts/sun7i-a20-lamobo-r1.dts | 2 +-
arch/arm/dts/sun7i-a20-olimex-som-evb.dts | 2 +-
arch/arm/dts/sun7i-a20-olimex-som204-evb.dts | 2 +-
arch/arm/dts/sun7i-a20-olinuxino-lime2.dts | 2 +-
arch/arm/dts/sun7i-a20-orangepi-mini.dts | 2 +-
arch/arm/dts/sun7i-a20-orangepi.dts | 2 +-
arch/arm/dts/sun7i-a20-pcduino3-nano.dts | 2 +-
arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts | 2 +-
arch/arm/dts/sun8i-a83t-bananapi-m3.dts | 2 +-
arch/arm/dts/sun8i-a83t-cubietruck-plus.dts | 2 +-
arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts | 2 +-
arch/arm/dts/sun8i-h3-orangepi-plus.dts | 2 +-
arch/arm/dts/sun8i-h3-orangepi-plus2e.dts | 2 +-
arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts | 2 +-
arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts | 2 +-
arch/arm/dts/sunxi-bananapi-m2-plus.dtsi | 2 +-
36 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/arch/arm/dts/sun50i-a64-bananapi-m64.dts b/arch/arm/dts/sun50i-a64-bananapi-m64.dts
index ef1c90401b..e1c22aeb29 100644
--- a/arch/arm/dts/sun50i-a64-bananapi-m64.dts
+++ b/arch/arm/dts/sun50i-a64-bananapi-m64.dts
@@ -112,7 +112,7 @@
&emac {
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-handle = <&ext_rgmii_phy>;
phy-supply = <&reg_dc1sw>;
status = "okay";
diff --git a/arch/arm/dts/sun50i-a64-nanopi-a64.dts b/arch/arm/dts/sun50i-a64-nanopi-a64.dts
index 31884dbc88..03ebe3e44b 100644
--- a/arch/arm/dts/sun50i-a64-nanopi-a64.dts
+++ b/arch/arm/dts/sun50i-a64-nanopi-a64.dts
@@ -102,7 +102,7 @@
&emac {
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-handle = <&ext_rgmii_phy>;
phy-supply = <&reg_dcdc1>;
status = "okay";
diff --git a/arch/arm/dts/sun50i-a64-oceanic-5205-5inmfd.dts b/arch/arm/dts/sun50i-a64-oceanic-5205-5inmfd.dts
index 6a2154525d..94caf110ab 100644
--- a/arch/arm/dts/sun50i-a64-oceanic-5205-5inmfd.dts
+++ b/arch/arm/dts/sun50i-a64-oceanic-5205-5inmfd.dts
@@ -30,7 +30,7 @@
&emac {
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-handle = <&ext_rgmii_phy>;
phy-supply = <&reg_dc1sw>;
allwinner,tx-delay-ps = <600>;
diff --git a/arch/arm/dts/sun50i-a64-olinuxino.dts b/arch/arm/dts/sun50i-a64-olinuxino.dts
index f7a4bccaa5..2396d9b797 100644
--- a/arch/arm/dts/sun50i-a64-olinuxino.dts
+++ b/arch/arm/dts/sun50i-a64-olinuxino.dts
@@ -102,7 +102,7 @@
&emac {
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-handle = <&ext_rgmii_phy>;
phy-supply = <&reg_dcdc1>;
allwinner,tx-delay-ps = <600>;
diff --git a/arch/arm/dts/sun50i-a64-orangepi-win.dts b/arch/arm/dts/sun50i-a64-orangepi-win.dts
index b0c64f7579..5b5d4f31b6 100644
--- a/arch/arm/dts/sun50i-a64-orangepi-win.dts
+++ b/arch/arm/dts/sun50i-a64-orangepi-win.dts
@@ -127,7 +127,7 @@
&emac {
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-handle = <&ext_rgmii_phy>;
phy-supply = <&reg_gmac_3v3>;
status = "okay";
diff --git a/arch/arm/dts/sun50i-a64-pine64-plus.dts b/arch/arm/dts/sun50i-a64-pine64-plus.dts
index 24f1aac366..b09b4276f1 100644
--- a/arch/arm/dts/sun50i-a64-pine64-plus.dts
+++ b/arch/arm/dts/sun50i-a64-pine64-plus.dts
@@ -52,7 +52,7 @@
&emac {
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-txid";
phy-handle = <&ext_rgmii_phy>;
status = "okay";
};
diff --git a/arch/arm/dts/sun50i-a64-sopine-baseboard.dts b/arch/arm/dts/sun50i-a64-sopine-baseboard.dts
index 53fcc9098d..4a50a18128 100644
--- a/arch/arm/dts/sun50i-a64-sopine-baseboard.dts
+++ b/arch/arm/dts/sun50i-a64-sopine-baseboard.dts
@@ -95,7 +95,7 @@
&emac {
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-handle = <&ext_rgmii_phy>;
phy-supply = <&reg_dc1sw>;
status = "okay";
diff --git a/arch/arm/dts/sun50i-h5-libretech-all-h5-cc.dts b/arch/arm/dts/sun50i-h5-libretech-all-h5-cc.dts
index df1b9263ad..6e30a564c8 100644
--- a/arch/arm/dts/sun50i-h5-libretech-all-h5-cc.dts
+++ b/arch/arm/dts/sun50i-h5-libretech-all-h5-cc.dts
@@ -36,7 +36,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
/delete-property/ allwinner,leds-active-low;
status = "okay";
};
diff --git a/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
index 4f9ba53ffa..9d93fe1536 100644
--- a/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
+++ b/arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
@@ -96,7 +96,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
diff --git a/arch/arm/dts/sun50i-h5-nanopi-neo2.dts b/arch/arm/dts/sun50i-h5-nanopi-neo2.dts
index b059e20813..e8ab8c2df5 100644
--- a/arch/arm/dts/sun50i-h5-nanopi-neo2.dts
+++ b/arch/arm/dts/sun50i-h5-nanopi-neo2.dts
@@ -75,7 +75,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
diff --git a/arch/arm/dts/sun50i-h5-orangepi-pc2.dts b/arch/arm/dts/sun50i-h5-orangepi-pc2.dts
index 70b5f09984..6cc567ea99 100644
--- a/arch/arm/dts/sun50i-h5-orangepi-pc2.dts
+++ b/arch/arm/dts/sun50i-h5-orangepi-pc2.dts
@@ -118,7 +118,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
diff --git a/arch/arm/dts/sun50i-h5-orangepi-prime.dts b/arch/arm/dts/sun50i-h5-orangepi-prime.dts
index cb44bfa598..33ab44072e 100644
--- a/arch/arm/dts/sun50i-h5-orangepi-prime.dts
+++ b/arch/arm/dts/sun50i-h5-orangepi-prime.dts
@@ -124,7 +124,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
diff --git a/arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts b/arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts
index ef5ca64442..de448ca51e 100644
--- a/arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts
+++ b/arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts
@@ -69,7 +69,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
diff --git a/arch/arm/dts/sun50i-h6-beelink-gs1.dts b/arch/arm/dts/sun50i-h6-beelink-gs1.dts
index 0dc33c90dd..024035d36e 100644
--- a/arch/arm/dts/sun50i-h6-beelink-gs1.dts
+++ b/arch/arm/dts/sun50i-h6-beelink-gs1.dts
@@ -64,7 +64,7 @@
&emac {
pinctrl-names = "default";
pinctrl-0 = <&ext_rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-handle = <&ext_rgmii_phy>;
phy-supply = <&reg_aldo2>;
status = "okay";
diff --git a/arch/arm/dts/sun50i-h6-pine-h64.dts b/arch/arm/dts/sun50i-h6-pine-h64.dts
index 1898345183..13fbf26817 100644
--- a/arch/arm/dts/sun50i-h6-pine-h64.dts
+++ b/arch/arm/dts/sun50i-h6-pine-h64.dts
@@ -66,7 +66,7 @@
&emac {
pinctrl-names = "default";
pinctrl-0 = <&ext_rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-handle = <&ext_rgmii_phy>;
phy-supply = <&reg_aldo2>;
allwinner,rx-delay-ps = <200>;
diff --git a/arch/arm/dts/sun7i-a20-bananapi-m1-plus.dts b/arch/arm/dts/sun7i-a20-bananapi-m1-plus.dts
index e2bfe00588..4dbcad1343 100644
--- a/arch/arm/dts/sun7i-a20-bananapi-m1-plus.dts
+++ b/arch/arm/dts/sun7i-a20-bananapi-m1-plus.dts
@@ -130,7 +130,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_gmac_3v3>;
status = "okay";
diff --git a/arch/arm/dts/sun7i-a20-bananapi.dts b/arch/arm/dts/sun7i-a20-bananapi.dts
index 81bc85d398..33040c43bc 100644
--- a/arch/arm/dts/sun7i-a20-bananapi.dts
+++ b/arch/arm/dts/sun7i-a20-bananapi.dts
@@ -132,7 +132,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_gmac_3v3>;
status = "okay";
diff --git a/arch/arm/dts/sun7i-a20-bananapro.dts b/arch/arm/dts/sun7i-a20-bananapro.dts
index 0176e9de01..8a75545e22 100644
--- a/arch/arm/dts/sun7i-a20-bananapro.dts
+++ b/arch/arm/dts/sun7i-a20-bananapro.dts
@@ -110,7 +110,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_gmac_3v3>;
status = "okay";
diff --git a/arch/arm/dts/sun7i-a20-cubietruck.dts b/arch/arm/dts/sun7i-a20-cubietruck.dts
index 99f531b8d2..46a9f4669e 100644
--- a/arch/arm/dts/sun7i-a20-cubietruck.dts
+++ b/arch/arm/dts/sun7i-a20-cubietruck.dts
@@ -151,7 +151,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
phy1: ethernet-phy@1 {
diff --git a/arch/arm/dts/sun7i-a20-hummingbird.dts b/arch/arm/dts/sun7i-a20-hummingbird.dts
index fd0153f656..5c3d107094 100644
--- a/arch/arm/dts/sun7i-a20-hummingbird.dts
+++ b/arch/arm/dts/sun7i-a20-hummingbird.dts
@@ -101,7 +101,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_gmac_vdd>;
/* phy reset config */
snps,reset-gpio = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
diff --git a/arch/arm/dts/sun7i-a20-lamobo-r1.dts b/arch/arm/dts/sun7i-a20-lamobo-r1.dts
index f91e1bee44..8173d77c12 100644
--- a/arch/arm/dts/sun7i-a20-lamobo-r1.dts
+++ b/arch/arm/dts/sun7i-a20-lamobo-r1.dts
@@ -120,7 +120,7 @@
&gmac {
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_gmac_3v3>;
status = "okay";
/delete-property/#address-cells;
diff --git a/arch/arm/dts/sun7i-a20-olimex-som-evb.dts b/arch/arm/dts/sun7i-a20-olimex-som-evb.dts
index f0e6a96e57..f0c5160ff8 100644
--- a/arch/arm/dts/sun7i-a20-olimex-som-evb.dts
+++ b/arch/arm/dts/sun7i-a20-olimex-som-evb.dts
@@ -112,7 +112,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
phy1: ethernet-phy@1 {
diff --git a/arch/arm/dts/sun7i-a20-olimex-som204-evb.dts b/arch/arm/dts/sun7i-a20-olimex-som204-evb.dts
index 823aabce04..ff42708137 100644
--- a/arch/arm/dts/sun7i-a20-olimex-som204-evb.dts
+++ b/arch/arm/dts/sun7i-a20-olimex-som204-evb.dts
@@ -106,7 +106,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy3>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_vcc3v3>;
snps,reset-gpio = <&pio 0 17 GPIO_ACTIVE_HIGH>;
diff --git a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
index 4e1c590eb0..996201665b 100644
--- a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts
@@ -112,7 +112,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
phy1: ethernet-phy@1 {
diff --git a/arch/arm/dts/sun7i-a20-orangepi-mini.dts b/arch/arm/dts/sun7i-a20-orangepi-mini.dts
index 15881081ca..b80215c61c 100644
--- a/arch/arm/dts/sun7i-a20-orangepi-mini.dts
+++ b/arch/arm/dts/sun7i-a20-orangepi-mini.dts
@@ -121,7 +121,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_gmac_3v3>;
status = "okay";
diff --git a/arch/arm/dts/sun7i-a20-orangepi.dts b/arch/arm/dts/sun7i-a20-orangepi.dts
index d64de2e73a..66efb7d1ab 100644
--- a/arch/arm/dts/sun7i-a20-orangepi.dts
+++ b/arch/arm/dts/sun7i-a20-orangepi.dts
@@ -97,7 +97,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_gmac_3v3>;
status = "okay";
diff --git a/arch/arm/dts/sun7i-a20-pcduino3-nano.dts b/arch/arm/dts/sun7i-a20-pcduino3-nano.dts
index 538ea15fa3..205eaae44a 100644
--- a/arch/arm/dts/sun7i-a20-pcduino3-nano.dts
+++ b/arch/arm/dts/sun7i-a20-pcduino3-nano.dts
@@ -115,7 +115,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
phy1: ethernet-phy@1 {
diff --git a/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts b/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts
index c27e56091f..56cc5791c4 100644
--- a/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts
+++ b/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts
@@ -82,7 +82,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
phy1: ethernet-phy@1 {
diff --git a/arch/arm/dts/sun8i-a83t-bananapi-m3.dts b/arch/arm/dts/sun8i-a83t-bananapi-m3.dts
index eaff6fa401..2beafe3a31 100644
--- a/arch/arm/dts/sun8i-a83t-bananapi-m3.dts
+++ b/arch/arm/dts/sun8i-a83t-bananapi-m3.dts
@@ -123,7 +123,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_sw>;
phy-handle = <&rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
allwinner,rx-delay-ps = <700>;
allwinner,tx-delay-ps = <700>;
status = "okay";
diff --git a/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts b/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts
index 5dba4fc310..ecd9ff38a8 100644
--- a/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts
+++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts
@@ -160,7 +160,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_dldo4>;
phy-handle = <&rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
diff --git a/arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts b/arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts
index 4ba533b034..bc370d4ea1 100644
--- a/arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts
+++ b/arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts
@@ -96,7 +96,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
diff --git a/arch/arm/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/dts/sun8i-h3-orangepi-plus.dts
index 97f497854e..d05fa679dc 100644
--- a/arch/arm/dts/sun8i-h3-orangepi-plus.dts
+++ b/arch/arm/dts/sun8i-h3-orangepi-plus.dts
@@ -85,7 +85,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
diff --git a/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts b/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts
index 6dbf7b2e0c..b6ca45d18e 100644
--- a/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts
+++ b/arch/arm/dts/sun8i-h3-orangepi-plus2e.dts
@@ -67,7 +67,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
diff --git a/arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts
index c488aaacbd..9c20245eef 100644
--- a/arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -129,7 +129,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy-handle = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_dc1sw>;
status = "okay";
};
diff --git a/arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts
index 15c22b06fc..3ab6f47cea 100644
--- a/arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts
+++ b/arch/arm/dts/sun8i-v40-bananapi-m2-berry.dts
@@ -120,7 +120,7 @@
pinctrl-names = "default";
pinctrl-0 = <&gmac_rgmii_pins>;
phy-handle = <&phy1>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
phy-supply = <&reg_dc1sw>;
status = "okay";
};
diff --git a/arch/arm/dts/sunxi-bananapi-m2-plus.dtsi b/arch/arm/dts/sunxi-bananapi-m2-plus.dtsi
index 39263e74fb..8e5cb3b3fd 100644
--- a/arch/arm/dts/sunxi-bananapi-m2-plus.dtsi
+++ b/arch/arm/dts/sunxi-bananapi-m2-plus.dtsi
@@ -126,7 +126,7 @@
pinctrl-0 = <&emac_rgmii_pins>;
phy-supply = <&reg_gmac_3v3>;
phy-handle = <&ext_rgmii_phy>;
- phy-mode = "rgmii";
+ phy-mode = "rgmii-id";
status = "okay";
};
--
2.28.0

View File

@ -1,49 +0,0 @@
#!/bin/bash
COMMAND="$1"
KERNEL_VERSION="$2"
#BOOT_DIR_ABS="$3"
#KERNEL_IMAGE="$4"
# Setup a /boot/dtb -> /boot/dtb-$newest_kernel_version symlink so that
# u-boot can find the correct dtb to load.
#
# If invoked to 'add' a new kernel, find the newest based on `sort`ing
# the kernel versions dtb. If 'remove', then follow basically the same
# procedure but exclude the version currently being removed.
#
# The theory of operation here is that, while newer kernels may add new
# dtb nodes and fields, as upstreaming hw support for some particular
# device progresses, it should never make backward incompatible changes.
# So it should always be safe to use a newer dtb with an older kernel.
list_dtb_versions() {
excluded_version="$1"
for dtbdir in /boot/dtb-*; do
dtbver=${dtbdir#*-}
if [ "$dtbver" != "$excluded_version" ]; then
echo $dtbver
fi
done
}
setup_dtb_link() {
ver=`list_dtb_versions $1 | sort -r --sort=version | head -1`
if [ -h /boot/dtb ]; then
rm -f /boot/dtb
fi
ln -s dtb-$ver /boot/dtb
}
ret=0
case "$COMMAND" in
add)
setup_dtb_link
ret=$?
;;
remove)
setup_dtb_link $KERNEL_VERSION
ret=$?
;;
esac
exit $ret

View File

@ -1,194 +0,0 @@
From patchwork Fri Mar 31 22:31:26 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,v3,14/19] sunxi: 64-bit SoCs: introduce FIT generator script
From: Andre Przywara <andre.przywara@arm.com>
X-Patchwork-Id: 745831
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <1490999491-14899-15-git-send-email-andre.przywara@arm.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>,
Jagan Teki <jagan@openedev.com>, Simon Glass <sjg@chromium.org>,
Tom Rini <trini@konsulko.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>,
Michal Simek <michal.simek@xilinx.com>, u-boot@lists.denx.de,
Icenowy Zheng <icenowy@aosc.xyz>
Date: Fri, 31 Mar 2017 23:31:26 +0100
Now that the Makefile can call a generator script to build a more
advanced FIT image, let's use this feature to address the needs of
Allwinner boards with 64-bit SoCs (A64 and H5).
The (DTB stripped) U-Boot binary and the ATF are static, but we allow
an arbitrary number of supported device trees to be passed.
The script enters both a DT entry in the /images node and the respective
subnode in /configurations to support all listed DTBs.
This requires to copy the ARM Trusted Firmware build (bl31.bin) into
the U-Boot source directory (or to create a symlink to it).
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
board/sunxi/mksunxi_fit_atf.sh | 73 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
create mode 100755 board/sunxi/mksunxi_fit_atf.sh
diff --git a/board/sunxi/mksunxi_fit_atf.sh b/board/sunxi/mksunxi_fit_atf.sh
new file mode 100755
index 0000000..afa22e8
--- /dev/null
+++ b/board/sunxi/mksunxi_fit_atf.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+#
+# script to generate FIT image source for 64-bit sunxi boards with
+# ARM Trusted Firmware and multiple device trees (given on the command line)
+#
+# usage: $0 <dt_name> [<dt_name> [<dt_name] ...]
+
+cat << __HEADER_EOF
+/dts-v1/;
+
+/ {
+ description = "Configuration to load ATF before U-Boot";
+ #address-cells = <1>;
+
+ images {
+ uboot@1 {
+ description = "U-Boot (64-bit)";
+ data = /incbin/("u-boot-nodtb.bin");
+ type = "standalone";
+ arch = "arm64";
+ compression = "none";
+ load = <0x4a000000>;
+ };
+ atf@1 {
+ description = "ARM Trusted Firmware";
+ data = /incbin/("bl31.bin");
+ type = "firmware";
+ arch = "arm64";
+ compression = "none";
+ load = <0x44000>;
+ entry = <0x44000>;
+ };
+__HEADER_EOF
+
+cnt=1
+for dtname in $*
+do
+ cat << __FDT_IMAGE_EOF
+ fdt@$cnt {
+ description = "$(basename $dtname .dtb)";
+ data = /incbin/("$dtname");
+ type = "flat_dt";
+ compression = "none";
+ };
+__FDT_IMAGE_EOF
+ cnt=$((cnt+1))
+done
+
+cat << __CONF_HEADER_EOF
+ };
+ configurations {
+ default = "config@1";
+
+__CONF_HEADER_EOF
+
+cnt=1
+for dtname in $*
+do
+ cat << __CONF_SECTION_EOF
+ config@$cnt {
+ description = "$(basename $dtname .dtb)";
+ firmware = "uboot@1";
+ loadables = "atf@1";
+ fdt = "fdt@$cnt";
+ };
+__CONF_SECTION_EOF
+ cnt=$((cnt+1))
+done
+
+cat << __ITS_EOF
+ };
+};
+__ITS_EOF
From patchwork Fri Mar 31 22:31:28 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,v3,16/19] sunxi: enable automatic FIT build for 64-bit SoCs
From: Andre Przywara <andre.przywara@arm.com>
X-Patchwork-Id: 745840
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <1490999491-14899-17-git-send-email-andre.przywara@arm.com>
To: Maxime Ripard <maxime.ripard@free-electrons.com>,
Jagan Teki <jagan@openedev.com>, Simon Glass <sjg@chromium.org>,
Tom Rini <trini@konsulko.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>,
Michal Simek <michal.simek@xilinx.com>, u-boot@lists.denx.de,
Icenowy Zheng <icenowy@aosc.xyz>
Date: Fri, 31 Mar 2017 23:31:28 +0100
The Allwinner SoCs with 64-bit cores use an ARM Trusted Firmware binary,
which needs to be loaded alongside U-Boot proper.
Set the respective Kconfig options to let them select this feature and
also automatically build the FIT image.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
Kconfig | 1 +
board/sunxi/Kconfig | 4 ++++
include/configs/sunxi-common.h | 4 ++++
3 files changed, 9 insertions(+)
diff --git a/Kconfig b/Kconfig
index 5c82788..ffea4c3 100644
--- a/Kconfig
+++ b/Kconfig
@@ -252,6 +252,7 @@ config SPL_FIT_SOURCE
config SPL_FIT_GENERATOR
string ".its file generator script for U-Boot FIT image"
depends on SPL_FIT
+ default "board/sunxi/mksunxi_fit_atf.sh" if SPL_LOAD_FIT && ARCH_SUNXI
help
Specifies a (platform specific) script file to generate the FIT
source file used to build the U-Boot FIT image file. This gets
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 3e0e262..b629f3b 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -145,12 +145,16 @@ config MACH_SUN50I
select SUNXI_GEN_SUN6I
select SUNXI_HIGH_SRAM
select SUPPORT_SPL
+ select FIT
+ select SPL_LOAD_FIT
config MACH_SUN50I_H5
bool "sun50i (Allwinner H5)"
select ARM64
select MACH_SUNXI_H3_H5
select SUNXI_HIGH_SRAM
+ select FIT
+ select SPL_LOAD_FIT
endchoice
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index b7eb95e..1982063 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -32,6 +32,10 @@
# define CONFIG_MACH_TYPE_COMPAT_REV 1
#endif
+#ifdef CONFIG_ARM64
+#define CONFIG_BUILD_TARGET "u-boot.itb"
+#endif
+
/* Serial & console */
#define CONFIG_SYS_NS16550_SERIAL
/* ns16550 reg in the low bits of cpu reg */

45
AllWinner-PineTab.patch Normal file
View File

@ -0,0 +1,45 @@
From 6bf15552c2b6becb48ce7732120e0ddb2078cb1a Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Tue, 14 Apr 2020 09:53:07 +0100
Subject: [PATCH 9/9] initial pinetab support
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/pinetab_defconfig | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 configs/pinetab_defconfig
diff --git a/configs/pinetab_defconfig b/configs/pinetab_defconfig
new file mode 100644
index 0000000000..5b9620f3e5
--- /dev/null
+++ b/configs/pinetab_defconfig
@@ -0,0 +1,26 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_SPL=y
+CONFIG_MACH_SUN50I=y
+CONFIG_SUNXI_DRAM_LPDDR3_STOCK=y
+CONFIG_DRAM_CLK=552
+CONFIG_DRAM_ZQ=3881949
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
+CONFIG_R_I2C_ENABLE=y
+CONFIG_SPL_SPI_SUNXI=y
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_USE_PREBOOT=y
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pinetab"
+CONFIG_OF_LIST="sun50i-a64-pinetab"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_PWM=y
+CONFIG_PWM_SUNXI=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
--
2.26.0

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,75 @@
a64-olinuxino
amarula_a64_relic
bananapi_m2_plus_h5
bananapi_m64
dragonboard410c
dragonboard820c
espresso7420
evb-rk3328
evb-rk3399
ficus-rk3399
firefly-rk3399
geekbox
hikey
khadas-edge-captain-rk3399
khadas-edge-v-rk3399
khadas-edge-rk3399
khadas-vim
khadas-vim2
khadas-vim3
khadas-vim3l
libretech-ac
libretech_all_h3_cc_h5
libretech_all_h3_it_h5
libretech_all_h5_cc_h5
libretech-cc
mvebu_espressobin-88f3720
mvebu_mcbin-88f8040
nanopc-t4-rk3399
nanopi_a64
nanopi-k2
nanopi-m4-rk3399
nanopi-m4-2gb-rk3399
nanopi_neo2
nanopi-neo4-rk3399
nanopi_neo_plus2
odroid-c2
orangepi_lite2
orangepi_one_plus
orangepi_pc2
orangepi_prime
orangepi-rk3399
orangepi_win
orangepi_zero_plus
orangepi_zero_plus2
p212
p2371-2180
p2771-0000-500
p3450-0000
pine64-lts
pine64_plus
pinebook
pinebook-pro-rk3399
pinephone
pinetab
pine_h64
poplar
puma-rk3399
rock64-rk3328
rock960-rk3399
rock-pi-4-rk3399
rock-pi-4c-rk3399
rock-pi-e-rk3328
rock-pi-n10-rk3399pro
rockpro64-rk3399
roc-cc-rk3328
roc-pc-rk3399
roc-pc-mezzanine-rk3399
rpi_3
sheep-rk3368
rpi_4
rpi_arm64
sopine_baseboard
vexpress_aemv8a_dram
teres_i
turris_mox
vexpress_aemv8a_juno
vexpress_aemv8a_semi
xilinx_zynqmp_virt

View File

@ -6,22 +6,26 @@ A20-Olimex-SOM-EVB
A20-OLinuXino-Lime
A20-OLinuXino-Lime2
A20-OLinuXino_MICRO
am335x_boneblack
am335x_evm
am57xx_evm
Ampe_A76
apalis_imx6
arndale
Auxtek-T003
Auxtek-T004
ba10_tv_box
Bananapi
bananapi_m1_plus
bananapi_m2_berry
Bananapi_m2m
bananapi_m2_plus_h3
Bananapi_M2_Ultra
bananapi_m2_zero
Bananapro
chiliboard
CHIP
Chuwi_V7_CW0825
clearfog
cl-som-am57x
cm_fx6
Colombus
colorfly_e708_q1
@ -35,20 +39,27 @@ db-mv784mp-gp
difrnce_dit4350
dserve_dsrv9703c
evb-rk3229
fennec-rk3288
firefly-rk3288
highbank
helios4
Hummingbird_A31
Hyundai_A7HD
i12-tvbox
icnova-a20-swac
iNet_86VS
inet1
iNet_3F
iNet_3W
inet86dz
iNet_86VS
inet97fv2
inet98v_rev2
inet9f_rev03
inet_q972
Itead_Ibox_A20
jesurun_q5
jetson-tk1
kc1
Lamobo_R1
libretech_all_h3_cc_h2_plus
Linksprite_pcDuino
Linksprite_pcDuino3
Linksprite_pcDuino3_Nano
@ -76,7 +87,6 @@ novena
odroid
odroid-xu3
omap3_beagle
omap3_pandora
omap4_panda
omap5_uevm
Orangepi
@ -88,9 +98,11 @@ orangepi_pc
orangepi_pc_plus
orangepi_plus
orangepi_plus2e
orangepi_r1
orangepi_zero
origen
paz00
pinecube
polaroid_mid2809pxe04
pov_protab2_ips9
q8_a13_tablet
@ -101,23 +113,25 @@ qemu_arm
r7-tv-dongle
riotboard
rock
rock-pi-n8-rk3288
rock2
rpi_2
rpi_3_32b
rpi_4_32b
Sinlinx_SinA31s
Sinovoip_BPI_M2
Sinovoip_BPI_M2_Plus
Sinovoip_BPI_M3
smdkv310
stih410-b2260
stm32mp15_basic
sunxi_Gemei_G9
tbs_a711
tinker-rk3288
tinker-s-rk3288
trimslice
turris_omnia
udoo
udoo_neo
UTOO_P66
usbarmory
UTOO_P66
vexpress_ca15_tc2
vexpress_ca9x4
wandboard
@ -126,6 +140,4 @@ warp7
Wexler_TAB7200
Wits_Pro_A20_DKT
Yones_Toptech_BS1078_V2
zynq_microzed
zynq_zed
zynq_zybo
xilinx_zynq_virt

View File

@ -0,0 +1,135 @@
From 5cb3ca7ebd46c1983d0929b5ba027a03c1f5e51e Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 16 Dec 2020 15:22:34 +0000
Subject: [PATCH 1/2] arm: dts: rockchip: rk3399: enable rng at the SoC level
The rng is embedded in the SoC so enable it in the device tree
universally, the use of it can be controlled by enabling/disabling
at the device config level.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
arch/arm/dts/rk3399-evb-u-boot.dtsi | 4 ----
arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 4 ----
arch/arm/dts/rk3399-rockpro64-u-boot.dtsi | 4 ----
arch/arm/dts/rk3399-u-boot.dtsi | 2 +-
4 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/arch/arm/dts/rk3399-evb-u-boot.dtsi b/arch/arm/dts/rk3399-evb-u-boot.dtsi
index 8056dc843e..398b205ec2 100644
--- a/arch/arm/dts/rk3399-evb-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-evb-u-boot.dtsi
@@ -13,10 +13,6 @@
};
};
-&rng {
- status = "okay";
-};
-
&i2c0 {
u-boot,dm-pre-reloc;
};
diff --git a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi
index ded7db0aef..c3e866a779 100644
--- a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi
@@ -28,10 +28,6 @@
u-boot,dm-pre-reloc;
};
-&rng {
- status = "okay";
-};
-
&sdhci {
max-frequency = <25000000>;
u-boot,dm-pre-reloc;
diff --git a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
index 6317b47e41..37dff04adf 100644
--- a/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-rockpro64-u-boot.dtsi
@@ -15,10 +15,6 @@
};
};
-&rng {
- status = "okay";
-};
-
&spi1 {
spi_flash: flash@0 {
u-boot,dm-pre-reloc;
diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi
index ecd230c720..73922c328a 100644
--- a/arch/arm/dts/rk3399-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-u-boot.dtsi
@@ -32,7 +32,7 @@
rng: rng@ff8b8000 {
compatible = "rockchip,cryptov1-rng";
reg = <0x0 0xff8b8000 0x0 0x1000>;
- status = "disabled";
+ status = "okay";
};
dmc: dmc {
--
2.29.2
From 62093137fcbe760d009cf2757feda7ccf328fbb7 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 16 Dec 2020 15:37:21 +0000
Subject: [PATCH 2/2] configs: rk3399: enable rng on firefly/rock960/rockpro64
Enable the RNG on the Firefly, rock960 and RockPro64 devices
to enable KASLR on devices that support it.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/firefly-rk3399_defconfig | 2 ++
configs/rock960-rk3399_defconfig | 2 ++
configs/rockpro64-rk3399_defconfig | 2 ++
3 files changed, 6 insertions(+)
diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig
index c453b82dc5..cfbaae40aa 100644
--- a/configs/firefly-rk3399_defconfig
+++ b/configs/firefly-rk3399_defconfig
@@ -35,6 +35,8 @@ CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_ROCKCHIP=y
CONFIG_SF_DEFAULT_SPEED=20000000
CONFIG_DM_ETH=y
CONFIG_ETH_DESIGNWARE=y
diff --git a/configs/rock960-rk3399_defconfig b/configs/rock960-rk3399_defconfig
index 65dce3cd73..aadbc55f57 100644
--- a/configs/rock960-rk3399_defconfig
+++ b/configs/rock960-rk3399_defconfig
@@ -39,6 +39,8 @@ CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_ROCKCHIP=y
CONFIG_DM_ETH=y
CONFIG_NVME=y
CONFIG_PCI=y
diff --git a/configs/rockpro64-rk3399_defconfig b/configs/rockpro64-rk3399_defconfig
index 575b7a20d5..f78dfcc8f7 100644
--- a/configs/rockpro64-rk3399_defconfig
+++ b/configs/rockpro64-rk3399_defconfig
@@ -42,6 +42,8 @@ CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_ROCKCHIP=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_ROCKCHIP=y
CONFIG_SF_DEFAULT_BUS=1
CONFIG_SPI_FLASH_GIGADEVICE=y
CONFIG_DM_ETH=y
--
2.29.2

File diff suppressed because it is too large Load Diff

View File

@ -1,70 +0,0 @@
From patchwork Wed Oct 4 16:29:57 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] disk: part_dos: Use the original allocation scheme for the
SPL case
X-Patchwork-Submitter: Fabio Estevam <fabio.estevam@nxp.com>
X-Patchwork-Id: 821393
Message-Id: <1507134597-6831-1-git-send-email-fabio.estevam@nxp.com>
To: <trini@konsulko.com>
Cc: u-boot@lists.denx.de, pjones@redhat.com,
Fabio Estevam <fabio.estevam@nxp.com>
Date: Wed, 4 Oct 2017 13:29:57 -0300
From: Fabio Estevam <fabio.estevam@nxp.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Since commit ff98cb90514d ("part: extract MBR signature from partitions")
SPL boot on i.MX6 starts to fail:
U-Boot SPL 2017.09-00221-g0d6ab32 (Oct 02 2017 - 15:13:19)
Trying to boot from MMC1
(keep in loop)
Use the original allocation scheme for the SPL case, so that MX6 boards
can boot again.
This is a temporary solution to avoid the boot regression.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Rob Clark <robdclark@gmail.com>
---
Hi Tom,
I do not have time this week to further investigate and narrow down
this problem.
Using the old allocation scheme fixes the mx6 SPL boot problem.
disk/part_dos.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 1a36be0..6dd2c2d 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -89,6 +89,7 @@ static int test_block_type(unsigned char *buffer)
static int part_test_dos(struct blk_desc *dev_desc)
{
+#ifndef CONFIG_SPL_BUILD
ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz);
if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1)
@@ -102,6 +103,15 @@ static int part_test_dos(struct blk_desc *dev_desc)
dev_desc->sig_type = SIG_TYPE_MBR;
dev_desc->mbr_sig = mbr->unique_mbr_signature;
}
+#else
+ ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
+
+ if (blk_dread(dev_desc, 0, 1, (ulong *)buffer) != 1)
+ return -1;
+
+ if (test_block_type(buffer) != DOS_MBR)
+ return -1;
+#endif
return 0;
}

View File

@ -1,434 +0,0 @@
From patchwork Wed Sep 13 22:12:20 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,1/3] dm: video: Fix cache flushes
X-Patchwork-Submitter: Rob Clark <robdclark@gmail.com>
X-Patchwork-Id: 813662
X-Patchwork-Delegate: sjg@chromium.org
Message-Id: <20170913221227.21091-2-robdclark@gmail.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Date: Wed, 13 Sep 2017 18:12:20 -0400
From: Rob Clark <robdclark@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Content can come to screen via putc() and we cannot always rely on
updates ending with a puts(). This is the case with efi_console output
to vidconsole. Fixes corruption with Shell.efi.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
drivers/video/vidconsole-uclass.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index b5afd72227..e081d5a0ee 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -163,6 +163,7 @@ static void vidconsole_putc(struct stdio_dev *sdev, const char ch)
struct udevice *dev = sdev->priv;
vidconsole_put_char(dev, ch);
+ video_sync(dev->parent);
}
static void vidconsole_puts(struct stdio_dev *sdev, const char *s)
@@ -260,6 +261,8 @@ static int do_video_puts(cmd_tbl_t *cmdtp, int flag, int argc,
for (s = argv[1]; *s; s++)
vidconsole_put_char(dev, *s);
+ video_sync(dev->parent);
+
return 0;
}
From patchwork Wed Sep 13 22:12:21 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/3] dm: video: Add basic ANSI escape sequence support
X-Patchwork-Submitter: Rob Clark <robdclark@gmail.com>
X-Patchwork-Id: 813649
X-Patchwork-Delegate: sjg@chromium.org
Message-Id: <20170913221227.21091-3-robdclark@gmail.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Date: Wed, 13 Sep 2017 18:12:21 -0400
From: Rob Clark <robdclark@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Really just the subset that is needed by efi_console. Perhaps more will
be added later, for example color support would be useful to implement
efi_cout_set_attribute().
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
drivers/video/Kconfig | 8 +++
drivers/video/vidconsole-uclass.c | 109 ++++++++++++++++++++++++++++++++++++++
drivers/video/video-uclass.c | 4 +-
include/video.h | 7 +++
include/video_console.h | 11 ++++
5 files changed, 136 insertions(+), 3 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 082cc4a528..add156cb70 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -44,6 +44,14 @@ config VIDEO_BPP32
this option, such displays will not be supported and console output
will be empty.
+config VIDEO_ANSI
+ bool "Support ANSI escape sequences in video console"
+ depends on DM_VIDEO
+ default y if DM_VIDEO
+ help
+ Enable ANSI escape sequence decoding for a more fully functional
+ console.
+
config CONSOLE_NORMAL
bool "Support a simple text console"
depends on DM_VIDEO
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index e081d5a0ee..0a88cc0a42 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <linux/ctype.h>
#include <dm.h>
#include <video.h>
#include <video_console.h>
@@ -107,12 +108,120 @@ static void vidconsole_newline(struct udevice *dev)
video_sync(dev->parent);
}
+static char *parsenum(char *s, int *num)
+{
+ char *end;
+ *num = simple_strtol(s, &end, 10);
+ return end;
+}
+
+/*
+ * Process a character while accumulating an escape string. Chars are
+ * accumulated into escape_buf until the end of escape sequence is
+ * found, at which point the sequence is parsed and processed.
+ */
+static void vidconsole_escape_char(struct udevice *dev, char ch)
+{
+ struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
+
+ if (!IS_ENABLED(CONFIG_VIDEO_ANSI))
+ goto error;
+
+ /* Sanity checking for bogus ESC sequences: */
+ if (priv->escape_len >= sizeof(priv->escape_buf))
+ goto error;
+ if (priv->escape_len == 0 && ch != '[')
+ goto error;
+
+ priv->escape_buf[priv->escape_len++] = ch;
+
+ /*
+ * Escape sequences are terminated by a letter, so keep
+ * accumulating until we get one:
+ */
+ if (!isalpha(ch))
+ return;
+
+ /*
+ * clear escape mode first, otherwise things will get highly
+ * surprising if you hit any debug prints that come back to
+ * this console.
+ */
+ priv->escape = 0;
+
+ switch (ch) {
+ case 'H':
+ case 'f': {
+ int row, col;
+ char *s = priv->escape_buf;
+
+ /*
+ * Set cursor position: [%d;%df or [%d;%dH
+ */
+ s++; /* [ */
+ s = parsenum(s, &row);
+ s++; /* ; */
+ s = parsenum(s, &col);
+
+ priv->ycur = row * priv->y_charsize;
+ priv->xcur_frac = priv->xstart_frac +
+ VID_TO_POS(col * priv->x_charsize);
+
+ break;
+ }
+ case 'J': {
+ int mode;
+
+ /*
+ * Clear part/all screen:
+ * [J or [0J - clear screen from cursor down
+ * [1J - clear screen from cursor up
+ * [2J - clear entire screen
+ *
+ * TODO we really only handle entire-screen case, others
+ * probably require some additions to video-uclass (and
+ * are not really needed yet by efi_console)
+ */
+ parsenum(priv->escape_buf + 1, &mode);
+
+ if (mode == 2) {
+ video_clear(dev->parent);
+ video_sync(dev->parent);
+ priv->ycur = 0;
+ priv->xcur_frac = priv->xstart_frac;
+ } else {
+ debug("unsupported clear mode: %d\n", mode);
+ }
+ break;
+ }
+ default:
+ debug("unrecognized escape sequence: %*s\n",
+ priv->escape_len, priv->escape_buf);
+ }
+
+ return;
+
+error:
+ /* something went wrong, just revert to normal mode: */
+ priv->escape = 0;
+ return;
+}
+
int vidconsole_put_char(struct udevice *dev, char ch)
{
struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
int ret;
+ if (priv->escape) {
+ vidconsole_escape_char(dev, ch);
+ return 0;
+ }
+
switch (ch) {
+ case '\x1b':
+ priv->escape_len = 0;
+ priv->escape = 1;
+ break;
case '\a':
/* beep */
break;
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 3036e3a1f2..0163039821 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -87,7 +87,7 @@ int video_reserve(ulong *addrp)
return 0;
}
-static int video_clear(struct udevice *dev)
+void video_clear(struct udevice *dev)
{
struct video_priv *priv = dev_get_uclass_priv(dev);
@@ -100,8 +100,6 @@ static int video_clear(struct udevice *dev)
} else {
memset(priv->fb, priv->colour_bg, priv->fb_size);
}
-
- return 0;
}
/* Flush video activity to the caches */
diff --git a/include/video.h b/include/video.h
index 5b4e78b182..61ff653121 100644
--- a/include/video.h
+++ b/include/video.h
@@ -115,6 +115,13 @@ struct video_ops {
int video_reserve(ulong *addrp);
/**
+ * video_clear() - Clear a device's frame buffer to background color.
+ *
+ * @dev: Device to clear
+ */
+void video_clear(struct udevice *dev);
+
+/**
* video_sync() - Sync a device's frame buffer with its hardware
*
* Some frame buffers are cached or have a secondary frame buffer. This
diff --git a/include/video_console.h b/include/video_console.h
index 26047934da..9dce234bd9 100644
--- a/include/video_console.h
+++ b/include/video_console.h
@@ -29,6 +29,9 @@
* @xsize_frac: Width of the display in fractional units
* @xstart_frac: Left margin for the text console in fractional units
* @last_ch: Last character written to the text console on this line
+ * @escape: TRUE if currently accumulating an ANSI escape sequence
+ * @escape_len: Length of accumulated escape sequence so far
+ * @escape_buf: Buffer to accumulate escape sequence
*/
struct vidconsole_priv {
struct stdio_dev sdev;
@@ -42,6 +45,14 @@ struct vidconsole_priv {
int xsize_frac;
int xstart_frac;
int last_ch;
+ /*
+ * ANSI escape sequences are accumulated character by character,
+ * starting after the ESC char (0x1b) until the entire sequence
+ * is consumed at which point it is acted upon.
+ */
+ int escape;
+ int escape_len;
+ char escape_buf[32];
};
/**
From patchwork Wed Sep 13 22:12:22 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,3/3] dm: video: Add color ANSI escape sequence support
X-Patchwork-Submitter: Rob Clark <robdclark@gmail.com>
X-Patchwork-Id: 813661
X-Patchwork-Delegate: sjg@chromium.org
Message-Id: <20170913221227.21091-4-robdclark@gmail.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Date: Wed, 13 Sep 2017 18:12:22 -0400
From: Rob Clark <robdclark@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Note that this doesn't differentiate (due to lack of information in
video_priv) between different possible component orders for 32bpp.
But the main user at this point is efi_loader, and GOP expects xBGR
so any video drivers that this is incorrect for already have problems.
(Also, conveniently, this matches what simple-framebuffer bindings
expect for kernels that use the simple-framebuffer DT binding to
take over the bootloader display.)
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
drivers/video/vidconsole-uclass.c | 94 +++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 0a88cc0a42..820540b1bf 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -108,6 +108,41 @@ static void vidconsole_newline(struct udevice *dev)
video_sync(dev->parent);
}
+static const struct {
+ unsigned r;
+ unsigned g;
+ unsigned b;
+} colors[] = {
+ { 0x00, 0x00, 0x00 }, /* black */
+ { 0xff, 0x00, 0x00 }, /* red */
+ { 0x00, 0xff, 0x00 }, /* green */
+ { 0xff, 0xff, 0x00 }, /* yellow */
+ { 0x00, 0x00, 0xff }, /* blue */
+ { 0xff, 0x00, 0xff }, /* magenta */
+ { 0x00, 0xff, 0xff }, /* cyan */
+ { 0xff, 0xff, 0xff }, /* white */
+};
+
+static void set_color(struct video_priv *priv, unsigned idx, unsigned *c)
+{
+ switch (priv->bpix) {
+ case VIDEO_BPP16:
+ *c = ((colors[idx].r >> 3) << 0) |
+ ((colors[idx].g >> 2) << 5) |
+ ((colors[idx].b >> 3) << 11);
+ break;
+ case VIDEO_BPP32:
+ *c = 0xff000000 |
+ (colors[idx].r << 0) |
+ (colors[idx].g << 8) |
+ (colors[idx].b << 16);
+ break;
+ default:
+ /* unsupported, leave current color in place */
+ break;
+ }
+}
+
static char *parsenum(char *s, int *num)
{
char *end;
@@ -194,6 +229,65 @@ static void vidconsole_escape_char(struct udevice *dev, char ch)
}
break;
}
+ case 'm': {
+ struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent);
+ char *s = priv->escape_buf;
+ char *end = &priv->escape_buf[priv->escape_len];
+
+ /*
+ * Set graphics mode: [%d;...;%dm
+ *
+ * Currently only supports the color attributes:
+ *
+ * Foreground Colors:
+ *
+ * 30 Black
+ * 31 Red
+ * 32 Green
+ * 33 Yellow
+ * 34 Blue
+ * 35 Magenta
+ * 36 Cyan
+ * 37 White
+ *
+ * Background Colors:
+ *
+ * 40 Black
+ * 41 Red
+ * 42 Green
+ * 43 Yellow
+ * 44 Blue
+ * 45 Magenta
+ * 46 Cyan
+ * 47 White
+ */
+
+ s++; /* [ */
+ while (s < end) {
+ int val;
+
+ s = parsenum(s, &val);
+ s++;
+
+ switch (val) {
+ case 30 ... 37:
+ /* fg color */
+ set_color(vid_priv, val - 30,
+ (unsigned *)&vid_priv->colour_fg);
+ break;
+ case 40 ... 47:
+ /* bg color */
+ set_color(vid_priv, val - 40,
+ (unsigned *)&vid_priv->colour_bg);
+ break;
+ default:
+ /* unknown/unsupported */
+ break;
+ }
+ }
+
+ break;
+ }
default:
debug("unrecognized escape sequence: %*s\n",
priv->escape_len, priv->escape_buf);

View File

@ -1,53 +1,17 @@
From patchwork Tue Jun 20 21:55:25 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/2] board/db410c: fix fdt address
From: Rob Clark <robdclark@gmail.com>
X-Patchwork-Id: 778516
Message-Id: <20170620215525.10430-2-robdclark@gmail.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Nicolas Dechesne <nicolas.dechesne@linaro.org>,
Stephen Boyd <sboyd@codeaurora.org>
Date: Tue, 20 Jun 2017 17:55:25 -0400
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
Maybe there is a better way to not hardcode this? But at least with
the build of lk that I have, the fdt table is at 0x81e00000. I guess
there must be a more robust way to do this, since presumably lk when
booting the linux kernel directly somehow passes the fdt address.
include/configs/dragonboard410c.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
index 11c842d..3b9932d 100644
--- a/include/configs/dragonboard410c.h
+++ b/include/configs/dragonboard410c.h
@@ -105,7 +105,7 @@ REFLASH(dragonboard/u-boot.img, 8)\
"linux_image=Image\0" \
"kernel_addr_r=0x81000000\0"\
"fdtfile=apq8016-sbc.dtb\0" \
- "fdt_addr_r=0x83000000\0"\
+ "fdt_addr_r=0x81e00000\0"\
"ramdisk_addr_r=0x84000000\0"\
"scriptaddr=0x90000000\0"\
"pxefile_addr_r=0x90100000\0"\
From a2782063c8daf9000d131e85200bc631a16450b4 Mon Sep 17 00:00:00 2001
From 8b0274a733cd1ce39ad9ad18e1bd8efdd02a40b7 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Wed, 21 Jun 2017 14:21:15 -0400
Subject: [PATCH 01/23] WIP: fix usb
Subject: [PATCH 1/3] WIP: fix usb
---
common/usb_storage.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/usb_storage.c b/common/usb_storage.c
index df0b057308..b2a3ab49ec 100644
index d92ebb6eb19..9df3c3daaf4 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -996,7 +996,7 @@ static int usb_request_sense(struct scsi_cmd *srb, struct us_data *ss)
@@ -1016,7 +1016,7 @@ static int usb_request_sense(struct scsi_cmd *srb, struct us_data *ss)
static int usb_test_unit_ready(struct scsi_cmd *srb, struct us_data *ss)
{
@ -56,7 +20,7 @@ index df0b057308..b2a3ab49ec 100644
do {
memset(&srb->cmd[0], 0, 12);
@@ -1019,7 +1019,7 @@ static int usb_test_unit_ready(struct scsi_cmd *srb, struct us_data *ss)
@@ -1039,7 +1039,7 @@ static int usb_test_unit_ready(struct scsi_cmd *srb, struct us_data *ss)
if ((srb->sense_buf[2] == 0x02) &&
(srb->sense_buf[12] == 0x3a))
return -1;
@ -66,12 +30,12 @@ index df0b057308..b2a3ab49ec 100644
return -1;
--
2.13.3
2.19.1
From 40b06f8d422efc1d9674f081ef22445904c01f4f Mon Sep 17 00:00:00 2001
From 7bf41d74ca9d58bc2243b7688f8987c1d373ea56 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Mon, 3 Jul 2017 08:34:37 -0400
Subject: [PATCH 02/23] HACK: disable emmc
Subject: [PATCH 2/3] HACK: disable emmc
Hitting some timeout which makes boot take much longer. And
uefi/boot/rootfs partitions will be on sd-card or usb disk, etc,
@ -81,18 +45,18 @@ so we can just ignore emmc.
1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/dragonboard410c.dts b/arch/arm/dts/dragonboard410c.dts
index 7746622dda..0d3b7a35f4 100644
index fa348bc621e..bfe7f15d5ed 100644
--- a/arch/arm/dts/dragonboard410c.dts
+++ b/arch/arm/dts/dragonboard410c.dts
@@ -67,6 +67,7 @@
reg = <0x78d9000 0x400>;
@@ -106,6 +106,7 @@
#phy-cells = <0>;
};
+/*
sdhci@07824000 {
compatible = "qcom,sdhci-msm-v4";
reg = <0x7824900 0x11c 0x7824000 0x800>;
@@ -76,6 +77,7 @@
@@ -115,6 +116,7 @@
clock = <&clkc 0>;
clock-frequency = <100000000>;
};
@ -101,602 +65,51 @@ index 7746622dda..0d3b7a35f4 100644
sdhci@07864000 {
compatible = "qcom,sdhci-msm-v4";
--
2.13.3
2.19.1
From 03569f3ef44fd1208a68030c1740d7347bcf3fa3 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Fri, 23 Jun 2017 15:36:33 -0400
Subject: [PATCH 03/23] dm: core: also parse chosen node
This is the node that would contain, for example, the framebuffer setup
by an earlier stage.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
drivers/core/root.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/core/root.c b/drivers/core/root.c
index d691d6ff94..5e6b2da248 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -266,6 +266,26 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
for (offset = fdt_first_subnode(blob, offset);
offset > 0;
offset = fdt_next_subnode(blob, offset)) {
+ ofnode node = offset_to_ofnode(offset);
+
+ /* "chosen" node isn't a device itself but may contain some: */
+ if (strcmp(ofnode_get_name(node), "chosen") == 0) {
+ dm_dbg("parsing subnodes of \"chosen\"\n");
+
+ for (node = ofnode_first_subnode(node);
+ ofnode_valid(node);
+ node = ofnode_next_subnode(node)) {
+ dm_dbg("subnode: %s\n", ofnode_get_name(node));
+ err = lists_bind_fdt(parent, node, NULL);
+ if (err && !ret) {
+ ret = err;
+ dm_dbg("%s: ret=%d\n", ofnode_get_name(node), ret);
+ }
+ }
+
+ continue;
+ }
+
if (pre_reloc_only &&
!dm_fdt_pre_reloc(blob, offset))
continue;
@@ -273,7 +293,7 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
dm_dbg(" - ignoring disabled device\n");
continue;
}
- err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL);
+ err = lists_bind_fdt(parent, node, NULL);
if (err && !ret) {
ret = err;
debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL),
--
2.13.3
From 9f99ca35c96d4b564062bb86ddc62f7421632906 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Thu, 22 Jun 2017 16:17:00 -0400
Subject: [PATCH 04/23] video: simplefb
Not really qcom specific, but for now qcom/lk is the one firmware that
is (afaiu) setting up the appropriate dt node for pre-configured
display. Uses the generic simple-framebuffer DT bindings so this should
be useful on other platforms.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
drivers/video/Kconfig | 10 +++++++
drivers/video/Makefile | 2 +-
drivers/video/simplefb.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 82 insertions(+), 1 deletion(-)
create mode 100644 drivers/video/simplefb.c
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 61dfed8c06..8eb0359231 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -628,4 +628,14 @@ config VIDEO_DW_HDMI
rather requires a SoC-specific glue driver to call it), it
can not be enabled from the configuration menu.
+config VIDEO_SIMPLE
+ bool "Simple display driver for preconfigured display"
+ help
+ Enables a simple generic display driver which utilizes the
+ simple-framebuffer devicetree bindings.
+
+ This driver assumes that the display hardware has been initialized
+ before u-boot starts, and u-boot will simply render to the pre-
+ allocated frame buffer surface.
+
endmenu
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index ac5371f2ae..52f50f647b 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -57,7 +57,7 @@ obj-$(CONFIG_FORMIKE) += formike.o
obj-$(CONFIG_LG4573) += lg4573.o
obj-$(CONFIG_AM335X_LCD) += am335x-fb.o
obj-$(CONFIG_VIDEO_DW_HDMI) += dw_hdmi.o
-
+obj-$(CONFIG_VIDEO_SIMPLE) += simplefb.o
obj-${CONFIG_VIDEO_TEGRA124} += tegra124/
obj-${CONFIG_EXYNOS_FB} += exynos/
obj-${CONFIG_VIDEO_ROCKCHIP} += rockchip/
diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c
new file mode 100644
index 0000000000..035a9761b9
--- /dev/null
+++ b/drivers/video/simplefb.c
@@ -0,0 +1,71 @@
+/*
+ * (C) Copyright 2017 Rob Clark
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <fdtdec.h>
+#include <fdt_support.h>
+#include <video.h>
+
+static int simple_video_probe(struct udevice *dev)
+{
+ struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
+ struct video_priv *uc_priv = dev_get_uclass_priv(dev);
+ const void *blob = gd->fdt_blob;
+ const int node = dev_of_offset(dev);
+ const char *format;
+ fdt_addr_t base;
+ fdt_size_t size;
+
+ base = fdtdec_get_addr_size_auto_parent(blob, dev_of_offset(dev->parent),
+ node, "reg", 0, &size, false);
+ if (base == FDT_ADDR_T_NONE) {
+ debug("%s: Failed to decode memory region\n", __func__);
+ return -EINVAL;
+ }
+
+ debug("%s: base=%llx, size=%llu\n", __func__, base, size);
+
+ // TODO is there some way to reserve the framebuffer
+ // region so it isn't clobbered?
+ plat->base = base;
+ plat->size = size;
+
+ video_set_flush_dcache(dev, true);
+
+ debug("%s: Query resolution...\n", __func__);
+
+ uc_priv->xsize = fdtdec_get_uint(blob, node, "width", 0);
+ uc_priv->ysize = fdtdec_get_uint(blob, node, "height", 0);
+ uc_priv->rot = 0;
+
+ format = fdt_getprop(blob, node, "format", NULL);
+ debug("%s: %dx%d@%s\n", __func__, uc_priv->xsize, uc_priv->ysize, format);
+
+ if (strcmp(format, "r5g6b5") == 0) {
+ uc_priv->bpix = VIDEO_BPP16;
+ } else if (strcmp(format, "a8b8g8r8") == 0) {
+ uc_priv->bpix = VIDEO_BPP32;
+ } else {
+ printf("%s: invalid format: %s\n", __func__, format);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static const struct udevice_id simple_video_ids[] = {
+ { .compatible = "simple-framebuffer" },
+ { }
+};
+
+U_BOOT_DRIVER(simple_video) = {
+ .name = "simple_video",
+ .id = UCLASS_VIDEO,
+ .of_match = simple_video_ids,
+ .probe = simple_video_probe,
+ .flags = DM_FLAG_PRE_RELOC,
+};
--
2.13.3
From 1d6f9273461ba5afa7f04cb8ea00fd87272642f8 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Tue, 4 Jul 2017 09:16:08 -0400
Subject: [PATCH 05/23] video: add config option to skip framebuffer clear
The use-case is that the thing that loaded u-boot already put a splash
image on screen. And we want to preserve that until grub boot menu
takes over.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
drivers/video/Kconfig | 8 ++++++++
drivers/video/cfb_console.c | 3 ++-
drivers/video/video-uclass.c | 4 +++-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 8eb0359231..7b56b20344 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -98,6 +98,14 @@ config SYS_WHITE_ON_BLACK
better in low-light situations or to reduce eye strain in some
cases.
+config NO_FB_CLEAR
+ bool "Skip framebuffer clear"
+ help
+ If firmware (whatever loads u-boot) has already put a splash image
+ on screen, you might want to preserve it until whatever u-boots
+ loads takes over the screen. This, for example, can be used to
+ keep splash image on screen until grub graphical boot menu starts.
+
source "drivers/video/fonts/Kconfig"
config VIDCONSOLE_AS_LCD
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index f54802052e..85fa5b0cae 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -2091,7 +2091,8 @@ static int cfg_video_init(void)
}
eorx = fgx ^ bgx;
- video_clear();
+ if (!CONFIG_IS_ENABLED(NO_FB_CLEAR))
+ video_clear();
#ifdef CONFIG_VIDEO_LOGO
/* Plot the logo and get start point of console */
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 3036e3a1f2..dfa39b0d1b 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -199,7 +199,9 @@ static int video_post_probe(struct udevice *dev)
#else
priv->colour_bg = 0xffffff;
#endif
- video_clear(dev);
+
+ if (!CONFIG_IS_ENABLED(NO_FB_CLEAR))
+ video_clear(dev);
/*
* Create a text console device. For now we always do this, although
--
2.13.3
From d031c039a18b3a76a4ef16fb4ff8581a79f42fe3 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Thu, 3 Aug 2017 09:52:14 -0400
Subject: [PATCH 06/23] fdtdec: allow board to provide fdt for
CONFIG_OF_SEPARATE
Similar to CONFIG_OF_BOARD, but in this case the fdt is still built by
u-boot build. This allows the board to patch the fdt, etc.
In the specific case of dragonboard 410c, we pass the u-boot generated
fdt to the previous stage of bootloader (by embedding it in the
u-boot.img that is loaded by lk/aboot), which patches the fdt and passes
it back to u-boot.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
include/fdtdec.h | 3 ++-
lib/fdtdec.c | 45 ++++++++++++++++++++++++++-------------------
2 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 4a0947c626..b9acec735a 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -986,7 +986,8 @@ int fdtdec_setup(void);
/**
* Board-specific FDT initialization. Returns the address to a device tree blob.
- * Called when CONFIG_OF_BOARD is defined.
+ * Called when CONFIG_OF_BOARD is defined, or if CONFIG_OF_SEPARATE is defined
+ * and the board implements it.
*/
void *board_fdt_blob_setup(void);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index d2dbd0f122..07c458673c 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -1203,34 +1203,41 @@ int fdtdec_setup_memory_banksize(void)
}
#endif
-int fdtdec_setup(void)
+#ifdef CONFIG_OF_SEPARATE
+/*
+ * For CONFIG_OF_SEPARATE, the board may optionally implement this to
+ * provide and/or fixup the fdt.
+ */
+__weak void *board_fdt_blob_setup(void)
{
-#if CONFIG_IS_ENABLED(OF_CONTROL)
-# ifdef CONFIG_OF_EMBED
- /* Get a pointer to the FDT */
- gd->fdt_blob = __dtb_dt_begin;
-# elif defined CONFIG_OF_SEPARATE
-# ifdef CONFIG_SPL_BUILD
+ void *fdt_blob = NULL;
+#ifdef CONFIG_SPL_BUILD
/* FDT is at end of BSS unless it is in a different memory region */
if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
- gd->fdt_blob = (ulong *)&_image_binary_end;
+ fdt_blob = (ulong *)&_image_binary_end;
else
- gd->fdt_blob = (ulong *)&__bss_end;
+ fdt_blob = (ulong *)&__bss_end;
-# elif defined CONFIG_FIT_EMBED
- gd->fdt_blob = locate_dtb_in_fit(&_end);
+#elif defined CONFIG_FIT_EMBED
+ fdt_blob = locate_dtb_in_fit(&_end);
- if (gd->fdt_blob == NULL || gd->fdt_blob <= ((void *)&_end)) {
+ if (fdt_blob == NULL || fdt_blob <= ((void *)&_end))
puts("Failed to find proper dtb in embedded FIT Image\n");
- return -1;
- }
-
-# else
+#else
/* FDT is at end of image */
- gd->fdt_blob = (ulong *)&_end;
+ fdt_blob = (ulong *)&_end;
# endif
-# elif defined(CONFIG_OF_BOARD)
- /* Allow the board to override the fdt address. */
+ return fdt_blob;
+}
+#endif
+
+int fdtdec_setup(void)
+{
+#if CONFIG_IS_ENABLED(OF_CONTROL)
+# ifdef CONFIG_OF_EMBED
+ /* Get a pointer to the FDT */
+ gd->fdt_blob = __dtb_dt_begin;
+# elif defined(CONFIG_OF_SEPARATE) || defined(CONFIG_OF_BOARD)
gd->fdt_blob = board_fdt_blob_setup();
# elif defined(CONFIG_OF_HOSTFILE)
if (sandbox_read_fdt_from_file()) {
--
2.13.3
From 7f0491168cf31c9935dede6fb1f560ef33cfb739 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Fri, 23 Jun 2017 07:52:08 -0400
Subject: [PATCH 07/23] db410c: use fdt passed from lk
lk patches the fdt to set some device's MAC addresses and more
importantly to patch in the simple-framebuffer node that we want u-boot
to see.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
board/qualcomm/dragonboard410c/Makefile | 1 +
board/qualcomm/dragonboard410c/dragonboard410c.c | 8 ++++++
board/qualcomm/dragonboard410c/lowlevel_init.S | 36 ++++++++++++++++++++++++
3 files changed, 45 insertions(+)
create mode 100644 board/qualcomm/dragonboard410c/lowlevel_init.S
diff --git a/board/qualcomm/dragonboard410c/Makefile b/board/qualcomm/dragonboard410c/Makefile
index cd678088fa..5082383be4 100644
--- a/board/qualcomm/dragonboard410c/Makefile
+++ b/board/qualcomm/dragonboard410c/Makefile
@@ -5,4 +5,5 @@
#
obj-y := dragonboard410c.o
+obj-y += lowlevel_init.o
extra-y += head.o
diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
index 37d0b85e0e..1fa4dc1b15 100644
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
@@ -27,6 +27,14 @@ int dram_init_banksize(void)
return 0;
}
+extern unsigned long fw_dtb_pointer;
+
+void *board_fdt_blob_setup(void)
+{
+ if (fdt_magic(fw_dtb_pointer) != FDT_MAGIC)
+ return NULL;
+ return (void *)fw_dtb_pointer;
+}
int board_prepare_usb(enum usb_init_type type)
{
diff --git a/board/qualcomm/dragonboard410c/lowlevel_init.S b/board/qualcomm/dragonboard410c/lowlevel_init.S
new file mode 100644
index 0000000000..cdbd8e14db
--- /dev/null
+++ b/board/qualcomm/dragonboard410c/lowlevel_init.S
@@ -0,0 +1,36 @@
+/*
+ * (C) Copyright 2016
+ * Cédric Schieli <cschieli@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <config.h>
+
+.align 8
+.global fw_dtb_pointer
+fw_dtb_pointer:
+#ifdef CONFIG_ARM64
+ .dword 0x0
+#else
+ .word 0x0
+#endif
+
+/*
+ * Routine: save_boot_params (called after reset from start.S)
+ * Description: save ATAG/FDT address provided by the firmware at boot time
+ */
+
+.global save_boot_params
+save_boot_params:
+
+ /* The firmware provided ATAG/FDT address can be found in r2/x0 */
+#ifdef CONFIG_ARM64
+ adr x8, fw_dtb_pointer
+ str x0, [x8]
+#else
+ str r2, fw_dtb_pointer
+#endif
+
+ /* Returns */
+ b save_boot_params_ret
--
2.13.3
From 9999019fa74908218fd85a51f8c4b45231f9489a Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Wed, 19 Jul 2017 11:40:15 -0400
Subject: [PATCH 08/23] db410c: add reserved-memory node to dts
If lk lights up display and populates simple-framebuffer node, it will
also setup a reserved-memory node (needed by simplefb on linux). But
it isn't clever enough to cope when the reserved-memory node is not
present.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
arch/arm/dts/dragonboard410c.dts | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/dragonboard410c.dts b/arch/arm/dts/dragonboard410c.dts
index 0d3b7a35f4..a47b95264c 100644
--- a/arch/arm/dts/dragonboard410c.dts
+++ b/arch/arm/dts/dragonboard410c.dts
@@ -23,11 +23,16 @@
reg = <0 0x80000000 0 0x3da00000>;
};
+ reserved-memory {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+ };
+
chosen {
stdout-path = "/soc/serial@78b0000";
};
-
soc {
#address-cells = <0x1>;
#size-cells = <0x1>;
--
2.13.3
From 47f22a41df082c62411389ab5bf6e9ae26d93083 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Wed, 19 Jul 2017 10:39:12 -0400
Subject: [PATCH 13/23] usb: kbd: add missing \n
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
common/usb_kbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 703dd748f5..92d5e96d01 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -655,7 +655,7 @@ static int usb_kbd_remove(struct udevice *dev)
return 0;
err:
- printf("%s: warning, ret=%d", __func__, ret);
+ printf("%s: warning, ret=%d\n", __func__, ret);
return ret;
}
--
2.13.3
From 54997f67cc935704cab36025d98d27eaf5a4aa7c Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Mon, 26 Jun 2017 10:29:40 -0400
Subject: [PATCH 09/23] db410c: on aarch64 the fdtfile is in per-vendor
subdirectory
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
include/configs/dragonboard410c.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
index d9dc639aeb..626dff8dcd 100644
--- a/include/configs/dragonboard410c.h
+++ b/include/configs/dragonboard410c.h
@@ -104,7 +104,7 @@
"initrd_high=0xffffffffffffffff\0" \
"linux_image=Image\0" \
"kernel_addr_r=0x81000000\0"\
- "fdtfile=apq8016-sbc.dtb\0" \
+ "fdtfile=qcom/apq8016-sbc.dtb\0" \
"fdt_addr_r=0x81e00000\0"\
"ramdisk_addr_r=0x84000000\0"\
"scriptaddr=0x90000000\0"\
--
2.13.3
From 2bf6ff0703fa92755469d8f218a75b07008e9768 Mon Sep 17 00:00:00 2001
From 871fe802cf3ab593b9332c4f36ab2b3f179d51ae Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 18 Sep 2017 09:34:30 +0100
Subject: [PATCH] db410c: config updates
Date: Tue, 4 Sep 2018 12:21:59 +0100
Subject: [PATCH 3/3] add options for dm410c config
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/dragonboard410c_defconfig | 12 ++++++++++++
1 file changed, 12 insertions(+)
configs/dragonboard410c_defconfig | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index 2224b3850a..32efdfa46b 100644
index a55abaf8df5..4ece0cafbe4 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -10,6 +10,7 @@ CONFIG_BOOTARGS="console=ttyMSM0,115200n8"
CONFIG_SYS_PROMPT="dragonboard410c => "
# CONFIG_CMD_IMI is not set
# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_POWEROFF=y
CONFIG_CMD_MD5SUM=y
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_UNZIP=y
@@ -22,11 +23,14 @@ CONFIG_CMD_TIMER=y
CONFIG_CLK=y
CONFIG_MSM_GPIO=y
CONFIG_PM8916_GPIO=y
+CONFIG_DM_KEYBOARD=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
CONFIG_DM_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_MSM=y
+CONFIG_DM_ETH=y
+# CONFIG_NETDEVICES is not set
CONFIG_DM_PMIC=y
@@ -7,6 +7,8 @@ CONFIG_NR_DRAM_BANKS=1
# CONFIG_ANDROID_BOOT_IMAGE is not set
CONFIG_FIT=y
CONFIG_OF_BOARD_SETUP=y
+CONFIG_FAT_WRITE=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
CONFIG_MISC_INIT_R=y
# CONFIG_DISPLAY_CPUINFO is not set
# CONFIG_DISPLAY_BOARDINFO is not set
@@ -41,6 +43,13 @@ CONFIG_DM_PMIC=y
CONFIG_PMIC_PM8916=y
CONFIG_MSM_SERIAL=y
@@ -39,9 +43,17 @@ CONFIG_USB_EHCI_MSM=y
CONFIG_USB_ULPI_VIEWPORT=y
CONFIG_USB_ULPI=y
CONFIG_USB_STORAGE=y
CONFIG_SPMI_MSM=y
+CONFIG_DM_ETH=y
+CONFIG_DM_KEYBOARD=y
+CONFIG_DM_VIDEO=y
+# CONFG_VIDEO_BPP8 is not set
+CONFIG_NO_FB_CLEAR=y
+CONFIG_VIDEO_SIMPLE=y
+CONFIG_USB_KEYBOARD=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB=y
CONFIG_DM_USB=y
CONFIG_USB_EHCI_HCD=y
@@ -57,5 +66,6 @@ CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_ASIX88179=y
CONFIG_USB_ETHER_MCS7830=y
+CONFIG_USB_ETHER_RTL8152=y
CONFIG_USB_ETHER_SMSC95XX=y
+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
+CONFIG_DM_VIDEO=y
+# CONFIG_VIDEO_BPP8 is not set
+CONFIG_NO_FB_CLEAR=y
+CONFIG_VIDEO_SIMPLE=y
+CONFIG_FAT_WRITE=y
CONFIG_OF_LIBFDT_OVERLAY=y
--
2.13.5
2.19.1

View File

@ -1,111 +0,0 @@
From 8de891d0767aafb383b6f533b08a5c0b75b4718b Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 18 Sep 2017 15:48:32 +0100
Subject: [PATCH] arm: mvebu: enable generic distro boot config
Switch all of the mvebu boards to support disto generic booting
This will enable Fedora, Debian and other distros to support
mvebu systems easier. Tested on SolidRun ClearFog
Signed-off-by: Dennis Gilmore <dgilmore@redhat.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
include/configs/mv-common.h | 84 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 84 insertions(+)
diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
index 7c2bab2fc6..2819493fca 100644
--- a/include/configs/mv-common.h
+++ b/include/configs/mv-common.h
@@ -130,4 +130,88 @@
#define CONFIG_MTD_PARTITIONS
#endif
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+
+/*
+* 160M RAM (256M minimum minus 64MB heap + 32MB for u-boot, stack, fb, etc.
+* 32M uncompressed kernel, 16M compressed kernel, 1M fdt,
+* 1M script, 1M pxe and the ramdisk at the end.
+*/
+#define SDRAM_OFFSET(x) 0x0##x
+
+#define KERNEL_ADDR_R __stringify(SDRAM_OFFSET(2000000))
+#define FDT_ADDR_R __stringify(SDRAM_OFFSET(3000000))
+#define SCRIPT_ADDR_R __stringify(SDRAM_OFFSET(3100000))
+#define PXEFILE_ADDR_R __stringify(SDRAM_OFFSET(3200000))
+#define RAMDISK_ADDR_R __stringify(SDRAM_OFFSET(3300000))
+
+#define MEM_LAYOUT_ENV_SETTINGS \
+ "bootm_size=0xa000000\0" \
+ "kernel_addr_r=" KERNEL_ADDR_R "\0" \
+ "fdt_addr_r=" FDT_ADDR_R "\0" \
+ "scriptaddr=" SCRIPT_ADDR_R "\0" \
+ "pxefile_addr_r=" PXEFILE_ADDR_R "\0" \
+ "ramdisk_addr_r=" RAMDISK_ADDR_R "\0"
+
+#ifdef CONFIG_MMC
+#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
+#else
+#define BOOT_TARGET_DEVICES_MMC(func)
+#endif
+
+#ifdef CONFIG_CMD_SATA
+#define BOOT_TARGET_DEVICES_SATA(func) func(SATA, sata, 0) func(SATA, sata, 1)
+#define CONFIG_PREBOOT "sata init"
+#else
+#define BOOT_TARGET_DEVICES_SATA(func)
+#endif
+
+#ifdef CONFIG_USB_STORAGE
+#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
+#else
+#define BOOT_TARGET_DEVICES_USB(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+ BOOT_TARGET_DEVICES_MMC(func) \
+ BOOT_TARGET_DEVICES_SATA(func) \
+ BOOT_TARGET_DEVICES_USB(func) \
+ func(PXE, pxe, na)
+
+#include <config_distro_bootcmd.h>
+
+#ifdef CONFIG_USB_KEYBOARD
+#define CONSOLE_STDIN_SETTINGS \
+ "preboot=usb start\0" \
+ "stdin=serial,usbkbd\0"
+#else
+#define CONSOLE_STDIN_SETTINGS \
+ "stdin=serial\0"
+#endif
+
+#ifdef CONFIG_VIDEO
+#define CONSOLE_STDOUT_SETTINGS \
+ "stdout=serial,vga\0" \
+ "stderr=serial,vga\0"
+#else
+#define CONSOLE_STDOUT_SETTINGS \
+ "stdout=serial\0" \
+ "stderr=serial\0"
+#endif
+
+#define CONSOLE_ENV_SETTINGS \
+ CONSOLE_STDIN_SETTINGS \
+ CONSOLE_STDOUT_SETTINGS
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ CONSOLE_ENV_SETTINGS \
+ MEM_LAYOUT_ENV_SETTINGS \
+ "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+ "console=ttyS0,115200\0" \
+ BOOTENV
+#else /* ifndef CONFIG_SPL_BUILD */
+#define CONFIG_EXTRA_ENV_SETTINGS
+#endif
+
#endif /* _MV_COMMON_H */
--
2.13.5

View File

@ -1,240 +0,0 @@
From f349c5dc5ca2af90e026135b807668444ff23d84 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 6 Mar 2017 09:28:37 +0000
Subject: [PATCH 1/2] Initial Hummingboard 2 support
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 118 +++++++++++++++++++++++++++--------
1 file changed, 92 insertions(+), 26 deletions(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 285588d..5b187ff 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -37,6 +37,15 @@
DECLARE_GLOBAL_DATA_PTR;
+enum {
+ CUBOX,
+ HB1,
+ HB2,
+ HB2r15,
+};
+
+static int board_type;
+
#define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \
PAD_CTL_SRE_FAST | PAD_CTL_HYS)
@@ -48,6 +57,9 @@ DECLARE_GLOBAL_DATA_PTR;
#define ENET_PAD_CTRL (PAD_CTL_PUS_100K_UP | \
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
+#define ENET_PAD_CTRL_OD (PAD_CTL_PUS_100K_UP | \
+ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS | PAD_CTL_ODE)
+
#define ENET_PAD_CTRL_PD (PAD_CTL_PUS_100K_DOWN | \
PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS)
@@ -79,8 +91,11 @@ static iomux_v3_cfg_t const usdhc2_pads[] = {
static iomux_v3_cfg_t const hb_cbi_sense[] = {
/* These pins are for sensing if it is a CuBox-i or a HummingBoard */
- IOMUX_PADS(PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(UART_PAD_CTRL)),
- IOMUX_PADS(PAD_EIM_DA4__GPIO3_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_KEY_ROW1__GPIO4_IO09 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_EIM_DA4__GPIO3_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_CSI0_DAT14__GPIO6_IO00 | MUX_PAD_CTRL(UART_PAD_CTRL)),
+ IOMUX_PADS(PAD_CSI0_DAT18__GPIO6_IO04 | MUX_PAD_CTRL(UART_PAD_CTRL)),
};
static iomux_v3_cfg_t const usb_pads[] = {
@@ -92,8 +107,9 @@ static void setup_iomux_uart(void)
SETUP_IOMUX_PADS(uart1_pads);
}
-static struct fsl_esdhc_cfg usdhc_cfg[1] = {
+static struct fsl_esdhc_cfg usdhc_cfg[2] = {
{USDHC2_BASE_ADDR},
+ {USDHC3_BASE_ADDR},
};
int board_mmc_getcd(struct mmc *mmc)
@@ -103,16 +119,40 @@ int board_mmc_getcd(struct mmc *mmc)
int board_mmc_init(bd_t *bis)
{
- SETUP_IOMUX_PADS(usdhc2_pads);
- usdhc_cfg[0].esdhc_base = USDHC2_BASE_ADDR;
- usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
- gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk;
+ int ret;
+ u32 index = 0;
+
+ for (index = 0; index < CONFIG_SYS_FSL_USDHC_NUM; ++index) {
+ switch (index) {
+ case 0:
+ SETUP_IOMUX_PADS(usdhc2_pads);
+ usdhc_cfg[0].esdhc_base = USDHC2_BASE_ADDR;
+ usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
+ gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk;
+ break;
+ case 1:
+ SETUP_IOMUX_PADS(usdhc3_pads);
+ usdhc_cfg[1].esdhc_base = USDHC3_BASE_ADDR;
+ usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
+ gd->arch.sdhc_clk = usdhc_cfg[1].sdhc_clk;
+ break;
+ default:
+ printf("Warning: you configured more USDHC controllers"
+ "(%d) then supported by the board (%d)\n",
+ index + 1, CONFIG_SYS_FSL_USDHC_NUM);
+ return -EINVAL;
+ }
- return fsl_esdhc_initialize(bis, &usdhc_cfg[0]);
+ ret = fsl_esdhc_initialize(bis, &usdhc_cfg[index]);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
}
static iomux_v3_cfg_t const enet_pads[] = {
- IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL)),
+ IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO | MUX_PAD_CTRL(ENET_PAD_CTRL_OD)),
IOMUX_PADS(PAD_ENET_MDC__ENET_MDC | MUX_PAD_CTRL(ENET_PAD_CTRL)),
/* AR8035 reset */
IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | MUX_PAD_CTRL(ENET_PAD_CTRL_PD)),
@@ -328,41 +368,62 @@ int board_init(void)
return 0;
}
-static bool is_hummingboard(void)
+static int is_hummingboard(void)
{
- int val1, val2;
+ int val1, val2, val3, val4, val5;
SETUP_IOMUX_PADS(hb_cbi_sense);
gpio_direction_input(IMX_GPIO_NR(4, 9));
gpio_direction_input(IMX_GPIO_NR(3, 4));
+ gpio_direction_input(IMX_GPIO_NR(2, 8));
+ gpio_direction_input(IMX_GPIO_NR(6, 0));
+ gpio_direction_input(IMX_GPIO_NR(6, 4));
val1 = gpio_get_value(IMX_GPIO_NR(4, 9));
val2 = gpio_get_value(IMX_GPIO_NR(3, 4));
+ val3 = gpio_get_value(IMX_GPIO_NR(2, 8));
+ val4 = gpio_get_value(IMX_GPIO_NR(6, 0));
+ val5 = gpio_get_value(IMX_GPIO_NR(6, 4));
/*
* Machine selection -
- * Machine val1, val2
- * -------------------------
- * HB rev 3.x x 0
- * CBi 0 1
- * HB 1 1
+ * Machine val1, val2, val3
+ * -------------------------------
+ * HB2 x x 0
+ * HB rev 3.x x 0 x
+ * CBi 0 1 x
+ * HB 1 1 x
*/
- if (val2 == 0)
- return true;
- else if (val1 == 0)
- return false;
- else
- return true;
+ if (val3 == 0) {
+ board_type = HB2;
+ } else if (val2 == 0) {
+ board_type = HB1;
+ } else if (val1 == 0) {
+ board_type = CUBOX;
+ } else {
+ board_type = HB1;
+ }
+
+ if (val4 == 1 && val5 == 0)
+ board_type = HB2r15;
+
+ return board_type;
+
}
int checkboard(void)
{
- if (is_hummingboard())
+ switch (board_type) {
+ case HB2:
+ case HB2r15:
+ puts("Board: MX6 Hummingboard 2\n");
+ case HB1:
puts("Board: MX6 Hummingboard\n");
- else
+ case CUBOX:
puts("Board: MX6 Cubox-i\n");
+ }
return 0;
}
@@ -370,10 +431,15 @@ int checkboard(void)
int board_late_init(void)
{
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
- if (is_hummingboard())
+ switch (board_type) {
+ case HB2:
+ case HB2r15:
+ setenv("board_name", "HUMMINGBOARD2");
+ case HB1:
setenv("board_name", "HUMMINGBOARD");
- else
+ case CUBOX:
setenv("board_name", "CUBOXI");
+ }
if (is_mx6dq())
setenv("board_rev", "MX6Q");
--
2.9.3
From 039d4ce71df224d36f857519cc7a7f56568a75c3 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 6 Mar 2017 11:26:21 +0000
Subject: [PATCH 2/2] drop mmc init for the moment
---
board/solidrun/mx6cuboxi/mx6cuboxi.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c
index 5b187ff..50dcc09 100644
--- a/board/solidrun/mx6cuboxi/mx6cuboxi.c
+++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c
@@ -130,12 +130,6 @@ int board_mmc_init(bd_t *bis)
usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK);
gd->arch.sdhc_clk = usdhc_cfg[0].sdhc_clk;
break;
- case 1:
- SETUP_IOMUX_PADS(usdhc3_pads);
- usdhc_cfg[1].esdhc_base = USDHC3_BASE_ADDR;
- usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
- gd->arch.sdhc_clk = usdhc_cfg[1].sdhc_clk;
- break;
default:
printf("Warning: you configured more USDHC controllers"
"(%d) then supported by the board (%d)\n",
--
2.9.3

View File

@ -1,154 +0,0 @@
From af017eb82317dc88c1b23301d76466b389c2e007 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Tue, 13 Sep 2016 08:47:34 +0100
Subject: [PATCH] port utilite to distro generic boot commands
---
include/configs/cm_fx6.h | 115 ++++++++++++-----------------------------------
1 file changed, 29 insertions(+), 86 deletions(-)
diff --git a/include/configs/cm_fx6.h b/include/configs/cm_fx6.h
index c839b03..4dd501e 100644
--- a/include/configs/cm_fx6.h
+++ b/include/configs/cm_fx6.h
@@ -11,6 +11,7 @@
#ifndef __CONFIG_CM_FX6_H
#define __CONFIG_CM_FX6_H
+#include <config_distro_defaults.h>
#include "mx6_common.h"
/* Machine config */
@@ -78,101 +79,43 @@
#define CONFIG_ENV_SIZE (8 * 1024)
#define CONFIG_ENV_OFFSET (768 * 1024)
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+#include <config_distro_bootcmd.h>
+
+#ifdef CONFIG_AHCI
+#define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
+#else
+#define BOOT_TARGET_DEVICES_SCSI(func)
+#endif
+
+#define BOOT_TARGET_DEVICES(func) \
+ func(MMC, mmc, 2) \
+ BOOT_TARGET_DEVICES_SCSI(func) \
+ func(PXE, pxe, na) \
+ func(DHCP, dhcp, na)
+
#define CONFIG_EXTRA_ENV_SETTINGS \
"stdin=serial,usbkbd\0" \
"stdout=serial,vga\0" \
"stderr=serial,vga\0" \
"panel=HDMI\0" \
- "autoload=no\0" \
- "uImage=uImage-cm-fx6\0" \
- "zImage=zImage-cm-fx6\0" \
- "kernel=uImage-cm-fx6\0" \
- "script=boot.scr\0" \
- "dtb=cm-fx6.dtb\0" \
- "bootm_low=18000000\0" \
+ "dtb=imx6q-utilite-pro.dts\0" \
"loadaddr=0x10800000\0" \
"fdtaddr=0x11000000\0" \
+ "fdt_addr_r=0x18000000\0" \
+ "pxefile_addr_r=0x17f00000\0" \
+ "scriptaddr=0x17e00000\0" \
+ "kernel_addr_r=0x11000000\0" \
+ "ramdisk_addr_r=0x18100000\0" \
+ "bootm_size=0x20000000\0" \
"console=ttymxc3,115200\0" \
"ethprime=FEC0\0" \
- "video_hdmi=mxcfb0:dev=hdmi,1920x1080M-32@50,if=RGB32\0" \
- "video_dvi=mxcfb0:dev=dvi,1280x800M-32@50,if=RGB32\0" \
- "doboot=bootm ${loadaddr}\0" \
- "doloadfdt=false\0" \
- "mtdids=" MTDIDS_DEFAULT "\0" \
- "mtdparts=" MTDPARTS_DEFAULT "\0" \
- "setboottypez=setenv kernel ${zImage};" \
- "setenv doboot bootz ${loadaddr} - ${fdtaddr};" \
- "setenv doloadfdt true;\0" \
- "setboottypem=setenv kernel ${uImage};" \
- "setenv doboot bootm ${loadaddr};" \
- "setenv doloadfdt false;\0"\
- "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
- "sataroot=/dev/sda2 rw rootwait\0" \
- "nandroot=/dev/mtdblock4 rw\0" \
- "nandrootfstype=ubifs\0" \
- "mmcargs=setenv bootargs console=${console} root=${mmcroot} " \
- "${video} ${extrabootargs}\0" \
- "sataargs=setenv bootargs console=${console} root=${sataroot} " \
- "${video} ${extrabootargs}\0" \
- "nandargs=setenv bootargs console=${console} " \
- "root=${nandroot} " \
- "rootfstype=${nandrootfstype} " \
- "${video} ${extrabootargs}\0" \
- "nandboot=if run nandloadkernel; then " \
- "run nandloadfdt;" \
- "run setboottypem;" \
- "run storagebootcmd;" \
- "run setboottypez;" \
- "run storagebootcmd;" \
- "fi;\0" \
- "run_eboot=echo Starting EBOOT ...; "\
- "mmc dev 2 && " \
- "mmc rescan && mmc read 10042000 a 400 && go 10042000\0" \
- "loadscript=load ${storagetype} ${storagedev} ${loadaddr} ${script};\0"\
- "loadkernel=load ${storagetype} ${storagedev} ${loadaddr} ${kernel};\0"\
- "loadfdt=load ${storagetype} ${storagedev} ${fdtaddr} ${dtb};\0" \
- "bootscript=echo Running bootscript from ${storagetype} ...;" \
- "source ${loadaddr};\0" \
- "nandloadkernel=nand read ${loadaddr} 0 780000;\0" \
- "nandloadfdt=nand read ${fdtaddr} 780000 80000;\0" \
- "setupmmcboot=setenv storagetype mmc; setenv storagedev 2;\0" \
- "setupsataboot=setenv storagetype sata; setenv storagedev 0;\0" \
- "setupnandboot=setenv storagetype nand;\0" \
- "setupusbboot=setenv storagetype usb; setenv storagedev 0;\0" \
- "storagebootcmd=echo Booting from ${storagetype} ...;" \
- "run ${storagetype}args; run doboot;\0" \
- "trybootk=if run loadkernel; then " \
- "if ${doloadfdt}; then " \
- "run loadfdt;" \
- "fi;" \
- "run storagebootcmd;" \
- "fi;\0" \
- "trybootsmz=if run loadscript; then " \
- "run bootscript;" \
- "fi;" \
- "run setboottypem;" \
- "run trybootk;" \
- "run setboottypez;" \
- "run trybootk;\0"
-
-#define CONFIG_BOOTCOMMAND \
- "run setupmmcboot;" \
- "mmc dev ${storagedev};" \
- "if mmc rescan; then " \
- "run trybootsmz;" \
- "fi;" \
- "run setupusbboot;" \
- "if usb start; then "\
- "if run loadscript; then " \
- "run bootscript;" \
- "fi;" \
- "fi;" \
- "run setupsataboot;" \
- "if sata init; then " \
- "run trybootsmz;" \
- "fi;" \
- "run setupnandboot;" \
- "run nandboot;"
+ BOOTENV
+
+#else /* ifndef CONFIG_SPL_BUILD */
+#define CONFIG_EXTRA_ENV_SETTINGS
+#endif
#define CONFIG_PREBOOT "usb start;sf probe"
--
2.9.3

View File

@ -1,895 +0,0 @@
From patchwork Tue Sep 19 20:18:03 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot, v2,
1/6] pci: Add helper for implementing memory-mapped config space
accesses
X-Patchwork-Submitter: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
X-Patchwork-Id: 815808
Message-Id: <20170919201808.11433-2-tuomas.tynkkynen@iki.fi>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>
Date: Tue, 19 Sep 2017 23:18:03 +0300
From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
This sort of pattern for implementing memory-mapped PCI config space
accesses appears in U-Boot twice already, and a third user is coming up.
So add helper functions to avoid code duplication, similar to how Linux
has pci_generic_config_write and pci_generic_config_read.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
drivers/pci/pci-uclass.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
include/pci.h | 51 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 109 insertions(+)
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index 86df141d60..5a24eb6428 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -518,6 +518,64 @@ int pci_auto_config_devices(struct udevice *bus)
return sub_bus;
}
+int pci_generic_mmap_write_config(
+ struct udevice *bus,
+ int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp),
+ pci_dev_t bdf,
+ uint offset,
+ ulong value,
+ enum pci_size_t size)
+{
+ void *address;
+
+ if (addr_f(bus, bdf, offset, &address) < 0)
+ return 0;
+
+ switch (size) {
+ case PCI_SIZE_8:
+ writeb(value, address);
+ return 0;
+ case PCI_SIZE_16:
+ writew(value, address);
+ return 0;
+ case PCI_SIZE_32:
+ writel(value, address);
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
+int pci_generic_mmap_read_config(
+ struct udevice *bus,
+ int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp),
+ pci_dev_t bdf,
+ uint offset,
+ ulong *valuep,
+ enum pci_size_t size)
+{
+ void *address;
+
+ if (addr_f(bus, bdf, offset, &address) < 0) {
+ *valuep = pci_get_ff(size);
+ return 0;
+ }
+
+ switch (size) {
+ case PCI_SIZE_8:
+ *valuep = readb(address);
+ return 0;
+ case PCI_SIZE_16:
+ *valuep = readw(address);
+ return 0;
+ case PCI_SIZE_32:
+ *valuep = readl(address);
+ return 0;
+ default:
+ return -EINVAL;
+ }
+}
+
int dm_pci_hose_probe_bus(struct udevice *bus)
{
int sub_bus;
diff --git a/include/pci.h b/include/pci.h
index c8ef997d0d..7adc04301c 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -1086,6 +1086,57 @@ int pci_read_config32(pci_dev_t pcidev, int offset, u32 *valuep);
int pci_read_config16(pci_dev_t pcidev, int offset, u16 *valuep);
int pci_read_config8(pci_dev_t pcidev, int offset, u8 *valuep);
+/**
+ * pci_generic_mmap_write_config() - Generic helper for writing to
+ * memory-mapped PCI configuration space.
+ * @bus: Pointer to the PCI bus
+ * @addr_f: Callback for calculating the config space address
+ * @bdf: Identifies the PCI device to access
+ * @offset: The offset into the device's configuration space
+ * @value: The value to write
+ * @size: Indicates the size of access to perform
+ *
+ * Write the value @value of size @size from offset @offset within the
+ * configuration space of the device identified by the bus, device & function
+ * numbers in @bdf on the PCI bus @bus. The callback function @addr_f is
+ * responsible for calculating the CPU address of the respective configuration
+ * space offset.
+ *
+ * Return: 0 on success, else -EINVAL
+ */
+int pci_generic_mmap_write_config(
+ struct udevice *bus,
+ int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp),
+ pci_dev_t bdf,
+ uint offset,
+ ulong value,
+ enum pci_size_t size);
+
+/**
+ * pci_generic_mmap_read_config() - Generic helper for reading from
+ * memory-mapped PCI configuration space.
+ * @bus: Pointer to the PCI bus
+ * @addr_f: Callback for calculating the config space address
+ * @bdf: Identifies the PCI device to access
+ * @offset: The offset into the device's configuration space
+ * @valuep: A pointer at which to store the read value
+ * @size: Indicates the size of access to perform
+ *
+ * Read a value of size @size from offset @offset within the configuration
+ * space of the device identified by the bus, device & function numbers in @bdf
+ * on the PCI bus @bus. The callback function @addr_f is responsible for
+ * calculating the CPU address of the respective configuration space offset.
+ *
+ * Return: 0 on success, else -EINVAL
+ */
+int pci_generic_mmap_read_config(
+ struct udevice *bus,
+ int (*addr_f)(struct udevice *bus, pci_dev_t bdf, uint offset, void **addrp),
+ pci_dev_t bdf,
+ uint offset,
+ ulong *valuep,
+ enum pci_size_t size);
+
#ifdef CONFIG_DM_PCI_COMPAT
/* Compatibility with old naming */
static inline int pci_write_config_dword(pci_dev_t pcidev, int offset,
From patchwork Tue Sep 19 20:18:04 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot, v2, 2/6] pci: xilinx: Use pci_generic_mmap_{read,
write}_config()
X-Patchwork-Submitter: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
X-Patchwork-Id: 815813
Message-Id: <20170919201808.11433-3-tuomas.tynkkynen@iki.fi>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>
Date: Tue, 19 Sep 2017 23:18:04 +0300
From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Use the new helper function to avoid boilerplate in the driver.
Note that this changes __raw_writel et al. to writel. AFAICT this is
no problem because:
- The Linux driver for the same hardware uses the non-__raw variants as
well (via pci_generic_config_write()).
- This driver seems to be used only on MIPS so far, where the __raw and
non-__raw accessors are the same.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
drivers/pci/pcie_xilinx.c | 53 +++++++----------------------------------------
1 file changed, 7 insertions(+), 46 deletions(-)
diff --git a/drivers/pci/pcie_xilinx.c b/drivers/pci/pcie_xilinx.c
index 08e2e93445..d788552fed 100644
--- a/drivers/pci/pcie_xilinx.c
+++ b/drivers/pci/pcie_xilinx.c
@@ -43,7 +43,7 @@ static bool pcie_xilinx_link_up(struct xilinx_pcie *pcie)
/**
* pcie_xilinx_config_address() - Calculate the address of a config access
- * @pcie: Pointer to the PCI controller state
+ * @udev: Pointer to the PCI bus
* @bdf: Identifies the PCIe device to access
* @offset: The offset into the device's configuration space
* @paddress: Pointer to the pointer to write the calculates address to
@@ -57,9 +57,10 @@ static bool pcie_xilinx_link_up(struct xilinx_pcie *pcie)
*
* Return: 0 on success, else -ENODEV
*/
-static int pcie_xilinx_config_address(struct xilinx_pcie *pcie, pci_dev_t bdf,
+static int pcie_xilinx_config_address(struct udevice *udev, pci_dev_t bdf,
uint offset, void **paddress)
{
+ struct xilinx_pcie *pcie = dev_get_priv(udev);
unsigned int bus = PCI_BUS(bdf);
unsigned int dev = PCI_DEV(bdf);
unsigned int func = PCI_FUNC(bdf);
@@ -103,29 +104,8 @@ static int pcie_xilinx_read_config(struct udevice *bus, pci_dev_t bdf,
uint offset, ulong *valuep,
enum pci_size_t size)
{
- struct xilinx_pcie *pcie = dev_get_priv(bus);
- void *address;
- int err;
-
- err = pcie_xilinx_config_address(pcie, bdf, offset, &address);
- if (err < 0) {
- *valuep = pci_get_ff(size);
- return 0;
- }
-
- switch (size) {
- case PCI_SIZE_8:
- *valuep = __raw_readb(address);
- return 0;
- case PCI_SIZE_16:
- *valuep = __raw_readw(address);
- return 0;
- case PCI_SIZE_32:
- *valuep = __raw_readl(address);
- return 0;
- default:
- return -EINVAL;
- }
+ return pci_generic_mmap_read_config(bus, pcie_xilinx_config_address,
+ bdf, offset, valuep, size);
}
/**
@@ -146,27 +126,8 @@ static int pcie_xilinx_write_config(struct udevice *bus, pci_dev_t bdf,
uint offset, ulong value,
enum pci_size_t size)
{
- struct xilinx_pcie *pcie = dev_get_priv(bus);
- void *address;
- int err;
-
- err = pcie_xilinx_config_address(pcie, bdf, offset, &address);
- if (err < 0)
- return 0;
-
- switch (size) {
- case PCI_SIZE_8:
- __raw_writeb(value, address);
- return 0;
- case PCI_SIZE_16:
- __raw_writew(value, address);
- return 0;
- case PCI_SIZE_32:
- __raw_writel(value, address);
- return 0;
- default:
- return -EINVAL;
- }
+ return pci_generic_mmap_write_config(bus, pcie_xilinx_config_address,
+ bdf, offset, value, size);
}
/**
From patchwork Tue Sep 19 20:18:05 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot, v2, 3/6] pci: layerscape: Use pci_generic_mmap_{read,
write}_config
X-Patchwork-Submitter: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
X-Patchwork-Id: 815814
Message-Id: <20170919201808.11433-4-tuomas.tynkkynen@iki.fi>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>
Date: Tue, 19 Sep 2017 23:18:05 +0300
From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Use the new helpers to avoid boilerplate in the driver.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
drivers/pci/pcie_layerscape.c | 68 +++++++++++--------------------------------
1 file changed, 17 insertions(+), 51 deletions(-)
diff --git a/drivers/pci/pcie_layerscape.c b/drivers/pci/pcie_layerscape.c
index 610f85c4e8..0cb7f6d564 100644
--- a/drivers/pci/pcie_layerscape.c
+++ b/drivers/pci/pcie_layerscape.c
@@ -241,14 +241,19 @@ static int ls_pcie_addr_valid(struct ls_pcie *pcie, pci_dev_t bdf)
return 0;
}
-void *ls_pcie_conf_address(struct ls_pcie *pcie, pci_dev_t bdf,
- int offset)
+int ls_pcie_conf_address(struct udevice *bus, pci_dev_t bdf,
+ uint offset, void **paddress)
{
- struct udevice *bus = pcie->bus;
+ struct ls_pcie *pcie = dev_get_priv(bus);
u32 busdev;
- if (PCI_BUS(bdf) == bus->seq)
- return pcie->dbi + offset;
+ if (ls_pcie_addr_valid(pcie, bdf))
+ return -EINVAL;
+
+ if (PCI_BUS(bdf) == bus->seq) {
+ *paddress = pcie->dbi + offset;
+ return 0;
+ }
busdev = PCIE_ATU_BUS(PCI_BUS(bdf)) |
PCIE_ATU_DEV(PCI_DEV(bdf)) |
@@ -256,67 +261,28 @@ void *ls_pcie_conf_address(struct ls_pcie *pcie, pci_dev_t bdf,
if (PCI_BUS(bdf) == bus->seq + 1) {
ls_pcie_cfg0_set_busdev(pcie, busdev);
- return pcie->cfg0 + offset;
+ *paddress = pcie->cfg0 + offset;
} else {
ls_pcie_cfg1_set_busdev(pcie, busdev);
- return pcie->cfg1 + offset;
+ *paddress = pcie->cfg1 + offset;
}
+ return 0;
}
static int ls_pcie_read_config(struct udevice *bus, pci_dev_t bdf,
uint offset, ulong *valuep,
enum pci_size_t size)
{
- struct ls_pcie *pcie = dev_get_priv(bus);
- void *address;
-
- if (ls_pcie_addr_valid(pcie, bdf)) {
- *valuep = pci_get_ff(size);
- return 0;
- }
-
- address = ls_pcie_conf_address(pcie, bdf, offset);
-
- switch (size) {
- case PCI_SIZE_8:
- *valuep = readb(address);
- return 0;
- case PCI_SIZE_16:
- *valuep = readw(address);
- return 0;
- case PCI_SIZE_32:
- *valuep = readl(address);
- return 0;
- default:
- return -EINVAL;
- }
+ return pci_generic_mmap_read_config(bus, ls_pcie_conf_address,
+ bdf, offset, valuep, size);
}
static int ls_pcie_write_config(struct udevice *bus, pci_dev_t bdf,
uint offset, ulong value,
enum pci_size_t size)
{
- struct ls_pcie *pcie = dev_get_priv(bus);
- void *address;
-
- if (ls_pcie_addr_valid(pcie, bdf))
- return 0;
-
- address = ls_pcie_conf_address(pcie, bdf, offset);
-
- switch (size) {
- case PCI_SIZE_8:
- writeb(value, address);
- return 0;
- case PCI_SIZE_16:
- writew(value, address);
- return 0;
- case PCI_SIZE_32:
- writel(value, address);
- return 0;
- default:
- return -EINVAL;
- }
+ return pci_generic_mmap_write_config(bus, ls_pcie_conf_address,
+ bdf, offset, value, size);
}
/* Clear multi-function bit */
From patchwork Tue Sep 19 20:18:06 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot, v2,
4/6] PCI: Add driver for a 'pci-host-ecam-generic' host controller
X-Patchwork-Submitter: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
X-Patchwork-Id: 815817
Message-Id: <20170919201808.11433-5-tuomas.tynkkynen@iki.fi>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>
Date: Tue, 19 Sep 2017 23:18:06 +0300
From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
QEMU emulates such a device with '-machine virt,highmem=off' on ARM.
The 'highmem=off' part is required for things to work as the PCI code
in U-Boot doesn't seem to support 64-bit BARs.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---
v2:
- no 'default n'
- remove unnecessary non-DM struct field (inherited from the Xilinx driver)
- fix doc comment problems (inherited from the Xilinx driver)
- use the new generic memory mapped config space helpers
---
drivers/pci/Kconfig | 8 +++
drivers/pci/Makefile | 1 +
drivers/pci/pcie_ecam_generic.c | 143 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 152 insertions(+)
create mode 100644 drivers/pci/pcie_ecam_generic.c
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index e2a1c0a409..648dff7543 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -33,6 +33,14 @@ config PCI_PNP
help
Enable PCI memory and I/O space resource allocation and assignment.
+config PCIE_ECAM_GENERIC
+ bool "Generic ECAM-based PCI host controller support"
+ default n
+ depends on DM_PCI
+ help
+ Say Y here if you want to enable support for generic ECAM-based
+ PCIe host controllers, such as the one emulated by QEMU.
+
config PCIE_DW_MVEBU
bool "Enable Armada-8K PCIe driver (DesignWare core)"
default n
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index ad44e83996..5eb12efbf5 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_PCI) += pci.o pci_auto_old.o
endif
obj-$(CONFIG_PCI) += pci_auto_common.o pci_common.o
+obj-$(CONFIG_PCIE_ECAM_GENERIC) += pcie_ecam_generic.o
obj-$(CONFIG_FSL_PCI_INIT) += fsl_pci_init.o
obj-$(CONFIG_PCI_INDIRECT_BRIDGE) += pci_indirect.o
obj-$(CONFIG_PCI_GT64120) += pci_gt64120.o
diff --git a/drivers/pci/pcie_ecam_generic.c b/drivers/pci/pcie_ecam_generic.c
new file mode 100644
index 0000000000..2758f90de1
--- /dev/null
+++ b/drivers/pci/pcie_ecam_generic.c
@@ -0,0 +1,143 @@
+/*
+ * Generic PCIE host provided by e.g. QEMU
+ *
+ * Heavily based on drivers/pci/pcie_xilinx.c
+ *
+ * Copyright (C) 2016 Imagination Technologies
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <pci.h>
+
+#include <asm/io.h>
+
+/**
+ * struct generic_ecam_pcie - generic_ecam PCIe controller state
+ * @cfg_base: The base address of memory mapped configuration space
+ */
+struct generic_ecam_pcie {
+ void *cfg_base;
+};
+
+/**
+ * pci_generic_ecam_conf_address() - Calculate the address of a config access
+ * @bus: Pointer to the PCI bus
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @paddress: Pointer to the pointer to write the calculates address to
+ *
+ * Calculates the address that should be accessed to perform a PCIe
+ * configuration space access for a given device identified by the PCIe
+ * controller device @pcie and the bus, device & function numbers in @bdf. If
+ * access to the device is not valid then the function will return an error
+ * code. Otherwise the address to access will be written to the pointer pointed
+ * to by @paddress.
+ */
+static int pci_generic_ecam_conf_address(struct udevice *bus, pci_dev_t bdf,
+ uint offset, void **paddress)
+{
+ struct generic_ecam_pcie *pcie = dev_get_priv(bus);
+ void *addr;
+
+ addr = pcie->cfg_base;
+ addr += PCI_BUS(bdf) << 20;
+ addr += PCI_DEV(bdf) << 15;
+ addr += PCI_FUNC(bdf) << 12;
+ addr += offset;
+ *paddress = addr;
+
+ return 0;
+}
+
+/**
+ * pci_generic_ecam_read_config() - Read from configuration space
+ * @bus: Pointer to the PCI bus
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @valuep: A pointer at which to store the read value
+ * @size: Indicates the size of access to perform
+ *
+ * Read a value of size @size from offset @offset within the configuration
+ * space of the device identified by the bus, device & function numbers in @bdf
+ * on the PCI bus @bus.
+ */
+static int pci_generic_ecam_read_config(struct udevice *bus, pci_dev_t bdf,
+ uint offset, ulong *valuep,
+ enum pci_size_t size)
+{
+ return pci_generic_mmap_read_config(bus, pci_generic_ecam_conf_address,
+ bdf, offset, valuep, size);
+}
+
+/**
+ * pci_generic_ecam_write_config() - Write to configuration space
+ * @bus: Pointer to the PCI bus
+ * @bdf: Identifies the PCIe device to access
+ * @offset: The offset into the device's configuration space
+ * @value: The value to write
+ * @size: Indicates the size of access to perform
+ *
+ * Write the value @value of size @size from offset @offset within the
+ * configuration space of the device identified by the bus, device & function
+ * numbers in @bdf on the PCI bus @bus.
+ */
+static int pci_generic_ecam_write_config(struct udevice *bus, pci_dev_t bdf,
+ uint offset, ulong value,
+ enum pci_size_t size)
+{
+ return pci_generic_mmap_write_config(bus, pci_generic_ecam_conf_address,
+ bdf, offset, value, size);
+}
+
+/**
+ * pci_generic_ecam_ofdata_to_platdata() - Translate from DT to device state
+ * @dev: A pointer to the device being operated on
+ *
+ * Translate relevant data from the device tree pertaining to device @dev into
+ * state that the driver will later make use of. This state is stored in the
+ * device's private data structure.
+ *
+ * Return: 0 on success, else -EINVAL
+ */
+static int pci_generic_ecam_ofdata_to_platdata(struct udevice *dev)
+{
+ struct generic_ecam_pcie *pcie = dev_get_priv(dev);
+ struct fdt_resource reg_res;
+ DECLARE_GLOBAL_DATA_PTR;
+ int err;
+
+ err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
+ 0, &reg_res);
+ if (err < 0) {
+ error("\"reg\" resource not found\n");
+ return err;
+ }
+
+ pcie->cfg_base = map_physmem(reg_res.start,
+ fdt_resource_size(&reg_res),
+ MAP_NOCACHE);
+
+ return 0;
+}
+
+static const struct dm_pci_ops pci_generic_ecam_ops = {
+ .read_config = pci_generic_ecam_read_config,
+ .write_config = pci_generic_ecam_write_config,
+};
+
+static const struct udevice_id pci_generic_ecam_ids[] = {
+ { .compatible = "pci-host-ecam-generic" },
+ { }
+};
+
+U_BOOT_DRIVER(pci_generic_ecam) = {
+ .name = "pci_generic_ecam",
+ .id = UCLASS_PCI,
+ .of_match = pci_generic_ecam_ids,
+ .ops = &pci_generic_ecam_ops,
+ .ofdata_to_platdata = pci_generic_ecam_ofdata_to_platdata,
+ .priv_auto_alloc_size = sizeof(struct generic_ecam_pcie),
+};
From patchwork Tue Sep 19 20:18:07 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot, v2,
5/6] ARM: Add a new arch + board for QEMU's 'virt' machine
X-Patchwork-Submitter: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
X-Patchwork-Id: 815816
Message-Id: <20170919201808.11433-6-tuomas.tynkkynen@iki.fi>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>
Date: Tue, 19 Sep 2017 23:18:07 +0300
From: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
This board builds an U-Boot binary that is bootable with QEMU's 'virt'
machine on ARM. The minimal QEMU command line is:
qemu-system-arm -machine virt,highmem=off -bios u-boot.bin
(Note that the 'highmem=off' parameter to the 'virt' machine is required for
PCI to work in U-Boot.) This command line enables the following:
- u-boot.bin loaded and executing in the emulated flash at address 0x0
- A generated device tree blob placed at the start of RAM
- A freely configurable amount of RAM, described by the DTB
- A PL011 serial port, discoverable via the DTB
- An ARMv7 architected timer
- PSCI for rebooting the system
- A generic ECAM-based PCI host controller, discoverable via the DTB
Additionally, QEMU allows plugging a bunch of useful peripherals to the PCI bus.
The following ones are supported by both U-Boot and Linux:
- To add a Serial ATA disk via an Intel ICH9 AHCI controller, pass e.g.:
-drive if=none,file=disk.img,id=mydisk -device ich9-ahci,id=ahci -device ide-drive,drive=mydisk,bus=ahci.0
- To add an Intel E1000 network adapter, pass e.g.:
-net nic,model=e1000 -net user
- To add an EHCI-compliant USB host controller, pass e.g.:
-device usb-ehci,id=ehci
- To add a NVMe disk, pass e.g.:
-drive if=none,file=disk.img,id=mydisk -device nvme,drive=mydisk,serial=foo
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
---
v2:
- enable CONFIG_NVME
- alphasort correctly
- remove unnecessary gd declaration
- move board under board/emulation
- add MAINTAINERS
---
arch/arm/Kconfig | 10 +++++++
arch/arm/mach-qemu/Kconfig | 12 ++++++++
board/emulation/qemu-arm/MAINTAINERS | 6 ++++
board/emulation/qemu-arm/Makefile | 5 ++++
board/emulation/qemu-arm/qemu-arm.c | 33 ++++++++++++++++++++
configs/qemu_arm_defconfig | 28 +++++++++++++++++
include/configs/qemu-arm.h | 58 ++++++++++++++++++++++++++++++++++++
7 files changed, 152 insertions(+)
create mode 100644 arch/arm/mach-qemu/Kconfig
create mode 100644 board/emulation/qemu-arm/MAINTAINERS
create mode 100644 board/emulation/qemu-arm/Makefile
create mode 100644 board/emulation/qemu-arm/qemu-arm.c
create mode 100644 configs/qemu_arm_defconfig
create mode 100644 include/configs/qemu-arm.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 53eae8953e..1de5be7a72 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -630,6 +630,14 @@ config ARCH_MX5
select CPU_V7
select BOARD_EARLY_INIT_F
+config ARCH_QEMU
+ bool "QEMU Virtual Platform"
+ select CPU_V7
+ select ARCH_SUPPORT_PSCI
+ select DM
+ select DM_SERIAL
+ select OF_CONTROL
+
config ARCH_RMOBILE
bool "Renesas ARM SoCs"
select DM
@@ -1142,6 +1150,8 @@ source "arch/arm/mach-rmobile/Kconfig"
source "arch/arm/mach-meson/Kconfig"
+source "arch/arm/mach-qemu/Kconfig"
+
source "arch/arm/mach-rockchip/Kconfig"
source "arch/arm/mach-s5pc1xx/Kconfig"
diff --git a/arch/arm/mach-qemu/Kconfig b/arch/arm/mach-qemu/Kconfig
new file mode 100644
index 0000000000..3500b56cb0
--- /dev/null
+++ b/arch/arm/mach-qemu/Kconfig
@@ -0,0 +1,12 @@
+if ARCH_QEMU
+
+config SYS_VENDOR
+ default "emulation"
+
+config SYS_BOARD
+ default "qemu-arm"
+
+config SYS_CONFIG_NAME
+ default "qemu-arm"
+
+endif
diff --git a/board/emulation/qemu-arm/MAINTAINERS b/board/emulation/qemu-arm/MAINTAINERS
new file mode 100644
index 0000000000..a803061ff4
--- /dev/null
+++ b/board/emulation/qemu-arm/MAINTAINERS
@@ -0,0 +1,6 @@
+QEMU ARM 'VIRT' BOARD
+M: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
+S: Maintained
+F: board/emulation/qemu-arm/
+F: include/configs/qemu-arm.h
+F: configs/qemu_arm_defconfig
diff --git a/board/emulation/qemu-arm/Makefile b/board/emulation/qemu-arm/Makefile
new file mode 100644
index 0000000000..716a6e9c28
--- /dev/null
+++ b/board/emulation/qemu-arm/Makefile
@@ -0,0 +1,5 @@
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+
+obj-y += qemu-arm.o
diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c
new file mode 100644
index 0000000000..e29ba4630f
--- /dev/null
+++ b/board/emulation/qemu-arm/qemu-arm.c
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2017 Tuomas Tynkkynen
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+#include <common.h>
+#include <fdtdec.h>
+
+int board_init(void)
+{
+ return 0;
+}
+
+int dram_init(void)
+{
+ if (fdtdec_setup_memory_size() != 0)
+ return -EINVAL;
+
+ return 0;
+}
+
+int dram_init_banksize(void)
+{
+ fdtdec_setup_memory_banksize();
+
+ return 0;
+}
+
+void *board_fdt_blob_setup(void)
+{
+ /* QEMU loads a generated DTB for us at the start of RAM. */
+ return (void *)CONFIG_SYS_SDRAM_BASE;
+}
diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
new file mode 100644
index 0000000000..2a8594d472
--- /dev/null
+++ b/configs/qemu_arm_defconfig
@@ -0,0 +1,28 @@
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_ARCH_QEMU=y
+CONFIG_AHCI=y
+CONFIG_DISTRO_DEFAULTS=y
+# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_DISPLAY_BOARDINFO is not set
+# CONFIG_CMD_IMLS is not set
+CONFIG_CMD_PCI=y
+CONFIG_CMD_USB=y
+CONFIG_OF_BOARD=y
+CONFIG_AHCI_PCI=y
+CONFIG_BLK=y
+# CONFIG_MMC is not set
+CONFIG_DM_ETH=y
+CONFIG_E1000=y
+CONFIG_NVME=y
+CONFIG_PCI=y
+CONFIG_DM_PCI=y
+CONFIG_PCIE_ECAM_GENERIC=y
+CONFIG_SCSI=y
+CONFIG_DM_SCSI=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_PSCI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_PCI=y
diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h
new file mode 100644
index 0000000000..4376a24787
--- /dev/null
+++ b/include/configs/qemu-arm.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2017 Tuomas Tynkkynen
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <linux/sizes.h>
+
+/* Physical memory map */
+#define CONFIG_SYS_TEXT_BASE 0x00000000
+
+#define CONFIG_NR_DRAM_BANKS 1
+#define CONFIG_SYS_SDRAM_BASE 0x40000000
+
+/* The DTB generated by QEMU is placed at start of RAM, stay away from there */
+#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M)
+#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + SZ_2M)
+#define CONFIG_SYS_MALLOC_LEN SZ_16M
+
+/* QEMU's PL011 serial port is detected via FDT using the device model */
+#define CONFIG_PL01X_SERIAL
+
+/* QEMU implements a 62.5MHz architected timer */
+/* FIXME: can we rely on CNTFREQ instead of hardcoding this fact here? */
+#define CONFIG_SYS_ARCH_TIMER
+#define CONFIG_SYS_HZ 1000
+#define CONFIG_SYS_HZ_CLOCK 62500000
+
+/* For block devices, QEMU emulates an ICH9 AHCI controller over PCI */
+#define CONFIG_SYS_SCSI_MAX_SCSI_ID 6
+#define CONFIG_SCSI_AHCI
+#define CONFIG_LIBATA
+
+/* Environment options */
+#define CONFIG_ENV_SIZE SZ_64K
+
+#include <config_distro_defaults.h>
+
+#define BOOT_TARGET_DEVICES(func) \
+ func(SCSI, scsi, 0)
+
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_PREBOOT "pci enum"
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "fdt_high=0xffffffff\0" \
+ "initrd_high=0xffffffff\0" \
+ "fdt_addr=0x40000000\0" \
+ "scriptaddr=0x40200000\0" \
+ "pxefile_addr_r=0x40300000\0" \
+ "kernel_addr_r=0x40400000\0" \
+ "ramdisk_addr_r=0x44000000\0" \
+ BOOTENV
+
+#endif /* __CONFIG_H */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,450 @@
From patchwork Tue Dec 15 09:49:23 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: mbrugger <matthias.bgg@kernel.org>
X-Patchwork-Id: 1416366
X-Patchwork-Delegate: matthias.bgg@gmail.com
Return-Path: <u-boot-bounces@lists.denx.de>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de
(client-ip=85.214.62.61; helo=phobos.denx.de;
envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)
Authentication-Results: ozlabs.org;
dmarc=fail (p=none dis=none) header.from=kernel.org
Received: from phobos.denx.de (phobos.denx.de [85.214.62.61])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits))
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 4CwD58649Dz9s0b
for <incoming@patchwork.ozlabs.org>; Tue, 15 Dec 2020 20:49:53 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 4EC6082956;
Tue, 15 Dec 2020 10:49:42 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=kernel.org
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de
Received: by phobos.denx.de (Postfix, from userid 109)
id B1A738295E; Tue, 15 Dec 2020 10:49:40 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de
X-Spam-Level:
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id 38FB382955
for <u-boot@lists.denx.de>; Tue, 15 Dec 2020 10:49:37 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=kernel.org
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=matthias.bgg@kernel.org
From: matthias.bgg@kernel.org
Authentication-Results: mail.kernel.org;
dkim=permerror (bad message/signature format)
To: sughosh.ganu@linaro.org,
xypron.glpk@gmx.de
Cc: u-boot@lists.denx.de,
Matthias Brugger <mbrugger@suse.com>
Subject: [PATCH v2 1/2] rng: Add iProc RNG200 driver
Date: Tue, 15 Dec 2020 10:49:23 +0100
Message-Id: <20201215094924.30072-1-matthias.bgg@kernel.org>
X-Mailer: git-send-email 2.29.2
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de
X-Virus-Status: Clean
From: Matthias Brugger <mbrugger@suse.com>
Add support for random number generator RNG200.
This is for example found on RPi4.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
Changes in v2: None
drivers/rng/Kconfig | 6 ++
drivers/rng/Makefile | 1 +
drivers/rng/iproc_rng200.c | 186 +++++++++++++++++++++++++++++++++++++
3 files changed, 193 insertions(+)
create mode 100644 drivers/rng/iproc_rng200.c
diff --git a/drivers/rng/Kconfig b/drivers/rng/Kconfig
index 11001c8ae7..94915d45b3 100644
--- a/drivers/rng/Kconfig
+++ b/drivers/rng/Kconfig
@@ -46,4 +46,10 @@ config RNG_ROCKCHIP
Enable random number generator for rockchip.This driver is
support rng module of crypto v1 and crypto v2.
+config RNG_IPROC200
+ bool "Broadcom iProc RNG200 random number generator"
+ depends on DM_RNG
+ default n
+ help
+ Enable random number generator for RPI4.
endif
diff --git a/drivers/rng/Makefile b/drivers/rng/Makefile
index 8953406882..39f7ee3f03 100644
--- a/drivers/rng/Makefile
+++ b/drivers/rng/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_RNG_SANDBOX) += sandbox_rng.o
obj-$(CONFIG_RNG_MSM) += msm_rng.o
obj-$(CONFIG_RNG_STM32MP1) += stm32mp1_rng.o
obj-$(CONFIG_RNG_ROCKCHIP) += rockchip_rng.o
+obj-$(CONFIG_RNG_IPROC200) += iproc_rng200.o
diff --git a/drivers/rng/iproc_rng200.c b/drivers/rng/iproc_rng200.c
new file mode 100644
index 0000000000..1063f43953
--- /dev/null
+++ b/drivers/rng/iproc_rng200.c
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright 2020, Matthias Brugger <mbrugger@suse.com>
+ *
+ * Driver for Raspberry Pi hardware random number generator
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <linux/delay.h>
+#include <rng.h>
+#include <asm/io.h>
+
+#define usleep_range(a, b) udelay((b))
+
+#define RNG_CTRL_OFFSET 0x00
+#define RNG_CTRL_RNG_RBGEN_MASK 0x00001FFF
+#define RNG_CTRL_RNG_RBGEN_ENABLE 0x00000001
+#define RNG_CTRL_RNG_RBGEN_DISABLE 0x00000000
+
+#define RNG_SOFT_RESET_OFFSET 0x04
+#define RNG_SOFT_RESET 0x00000001
+
+#define RBG_SOFT_RESET_OFFSET 0x08
+#define RBG_SOFT_RESET 0x00000001
+
+#define RNG_INT_STATUS_OFFSET 0x18
+#define RNG_INT_STATUS_MASTER_FAIL_LOCKOUT_IRQ_MASK 0x80000000
+#define RNG_INT_STATUS_NIST_FAIL_IRQ_MASK 0x00000020
+
+#define RNG_FIFO_DATA_OFFSET 0x20
+
+#define RNG_FIFO_COUNT_OFFSET 0x24
+#define RNG_FIFO_COUNT_RNG_FIFO_COUNT_MASK 0x000000FF
+
+struct iproc_rng200_platdata {
+ fdt_addr_t base;
+};
+
+static void iproc_rng200_enable(struct iproc_rng200_platdata *pdata, bool enable)
+{
+ fdt_addr_t rng_base = pdata->base;
+ u32 val;
+
+ val = readl(rng_base + RNG_CTRL_OFFSET);
+ val &= ~RNG_CTRL_RNG_RBGEN_MASK;
+ if (enable)
+ val |= RNG_CTRL_RNG_RBGEN_ENABLE;
+ else
+ val &= ~RNG_CTRL_RNG_RBGEN_ENABLE;
+
+ writel(val, rng_base + RNG_CTRL_OFFSET);
+
+}
+
+static void iproc_rng200_restart(struct iproc_rng200_platdata *pdata)
+{
+ fdt_addr_t rng_base = pdata->base;
+ u32 val;
+
+ iproc_rng200_enable(pdata, false);
+
+ /* Clear all interrupt status */
+ writel(0xFFFFFFFFUL, rng_base + RNG_INT_STATUS_OFFSET);
+
+ /* Reset RNG and RBG */
+ val = readl(rng_base + RBG_SOFT_RESET_OFFSET);
+ val |= RBG_SOFT_RESET;
+ writel(val, rng_base + RBG_SOFT_RESET_OFFSET);
+
+ val = readl(rng_base + RNG_SOFT_RESET_OFFSET);
+ val |= RNG_SOFT_RESET;
+ writel(val, rng_base + RNG_SOFT_RESET_OFFSET);
+
+ val = readl(rng_base + RNG_SOFT_RESET_OFFSET);
+ val &= ~RNG_SOFT_RESET;
+ writel(val, rng_base + RNG_SOFT_RESET_OFFSET);
+
+ val = readl(rng_base + RBG_SOFT_RESET_OFFSET);
+ val &= ~RBG_SOFT_RESET;
+ writel(val, rng_base + RBG_SOFT_RESET_OFFSET);
+
+ iproc_rng200_enable(pdata, true);
+}
+
+static int iproc_rng200_read(struct udevice *dev, void *data, size_t len)
+{
+ struct iproc_rng200_platdata *priv = dev_get_platdata(dev);
+ char *buf = (char *)data;
+ u32 num_remaining = len;
+ u32 status;
+
+ #define MAX_RESETS_PER_READ 1
+ u32 num_resets = 0;
+
+ while (num_remaining > 0) {
+
+ /* Is RNG sane? If not, reset it. */
+ status = readl(priv->base + RNG_INT_STATUS_OFFSET);
+ if ((status & (RNG_INT_STATUS_MASTER_FAIL_LOCKOUT_IRQ_MASK |
+ RNG_INT_STATUS_NIST_FAIL_IRQ_MASK)) != 0) {
+
+ if (num_resets >= MAX_RESETS_PER_READ)
+ return len - num_remaining;
+
+ iproc_rng200_restart(priv);
+ num_resets++;
+ }
+
+ /* Are there any random numbers available? */
+ if ((readl(priv->base + RNG_FIFO_COUNT_OFFSET) &
+ RNG_FIFO_COUNT_RNG_FIFO_COUNT_MASK) > 0) {
+
+ if (num_remaining >= sizeof(u32)) {
+ /* Buffer has room to store entire word */
+ *(u32 *)buf = readl(priv->base +
+ RNG_FIFO_DATA_OFFSET);
+ buf += sizeof(u32);
+ num_remaining -= sizeof(u32);
+ } else {
+ /* Buffer can only store partial word */
+ u32 rnd_number = readl(priv->base +
+ RNG_FIFO_DATA_OFFSET);
+ memcpy(buf, &rnd_number, num_remaining);
+ buf += num_remaining;
+ num_remaining = 0;
+ }
+
+ } else {
+ /* Can wait, give others chance to run */
+ usleep_range(min(num_remaining * 10, 500U), 500);
+ }
+ }
+
+ return 0;
+}
+
+static int iproc_rng200_probe(struct udevice *dev)
+{
+ struct iproc_rng200_platdata *priv = dev_get_platdata(dev);
+
+ iproc_rng200_enable(priv, true);
+
+ return 0;
+}
+
+static int iproc_rng200_remove(struct udevice *dev)
+{
+ struct iproc_rng200_platdata *priv = dev_get_platdata(dev);
+
+ iproc_rng200_enable(priv, false);
+
+ return 0;
+}
+
+static int iproc_rng200_ofdata_to_platdata(struct udevice *dev)
+{
+ struct iproc_rng200_platdata *pdata = dev_get_platdata(dev);
+
+ pdata->base = dev_read_addr(dev);
+ if (!pdata->base)
+ return -ENODEV;
+
+ return 0;
+}
+
+static const struct dm_rng_ops iproc_rng200_ops = {
+ .read = iproc_rng200_read,
+};
+
+static const struct udevice_id iproc_rng200_rng_match[] = {
+ { .compatible = "brcm,bcm2711-rng200", },
+ { .compatible = "brcm,iproc-rng200", },
+ {},
+};
+
+U_BOOT_DRIVER(iproc_rng200_rng) = {
+ .name = "iproc_rng200-rng",
+ .id = UCLASS_RNG,
+ .of_match = iproc_rng200_rng_match,
+ .ops = &iproc_rng200_ops,
+ .probe = iproc_rng200_probe,
+ .remove = iproc_rng200_remove,
+ .platdata_auto_alloc_size = sizeof(struct iproc_rng200_platdata),
+ .ofdata_to_platdata = iproc_rng200_ofdata_to_platdata,
+};
From patchwork Tue Dec 15 09:49:24 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: mbrugger <matthias.bgg@kernel.org>
X-Patchwork-Id: 1416367
X-Patchwork-Delegate: matthias.bgg@gmail.com
Return-Path: <u-boot-bounces@lists.denx.de>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de
(client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;
envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)
Authentication-Results: ozlabs.org;
dmarc=fail (p=none dis=none) header.from=kernel.org
Received: from phobos.denx.de (phobos.denx.de
[IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest
SHA256)
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 4CwD5D4Gf2z9s0b
for <incoming@patchwork.ozlabs.org>; Tue, 15 Dec 2020 20:50:08 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id A25E782961;
Tue, 15 Dec 2020 10:49:46 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=fail (p=none dis=none) header.from=kernel.org
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de
Received: by phobos.denx.de (Postfix, from userid 109)
id 9EC418295C; Tue, 15 Dec 2020 10:49:41 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de
X-Spam-Level:
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,
SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id BCF5682956
for <u-boot@lists.denx.de>; Tue, 15 Dec 2020 10:49:38 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=pass (p=none dis=none) header.from=kernel.org
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=matthias.bgg@kernel.org
From: matthias.bgg@kernel.org
Authentication-Results: mail.kernel.org;
dkim=permerror (bad message/signature format)
To: sughosh.ganu@linaro.org,
xypron.glpk@gmx.de
Cc: u-boot@lists.denx.de,
Matthias Brugger <mbrugger@suse.com>
Subject: [PATCH v2 2/2] config: Enable iProc RNG200 driver in RPi4 configs
Date: Tue, 15 Dec 2020 10:49:24 +0100
Message-Id: <20201215094924.30072-2-matthias.bgg@kernel.org>
X-Mailer: git-send-email 2.29.2
In-Reply-To: <20201215094924.30072-1-matthias.bgg@kernel.org>
References: <20201215094924.30072-1-matthias.bgg@kernel.org>
MIME-Version: 1.0
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de
X-Virus-Status: Clean
From: Matthias Brugger <mbrugger@suse.com>
We find the iProc RNG200 in the Raspberry Pi 4. Add it to all it's
config so that it can be used.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
Changes in v2:
- fix defconfigs using savedefconfig (Heinrich)
configs/rpi_4_32b_defconfig | 2 ++
configs/rpi_4_defconfig | 2 ++
configs/rpi_arm64_defconfig | 2 ++
drivers/rng/iproc_rng200.c | 1 -
4 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig
index 5ddd838fd5..4039e46c81 100644
--- a/configs/rpi_4_32b_defconfig
+++ b/configs/rpi_4_32b_defconfig
@@ -36,6 +36,8 @@ CONFIG_PCI_BRCMSTB=y
CONFIG_PINCTRL=y
# CONFIG_PINCTRL_GENERIC is not set
CONFIG_DM_RESET=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_IPROC200=y
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
CONFIG_USB=y
CONFIG_DM_USB=y
diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
index 2590d0a696..46b6cc3046 100644
--- a/configs/rpi_4_defconfig
+++ b/configs/rpi_4_defconfig
@@ -36,6 +36,8 @@ CONFIG_PCI_BRCMSTB=y
CONFIG_PINCTRL=y
# CONFIG_PINCTRL_GENERIC is not set
CONFIG_DM_RESET=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_IPROC200=y
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
CONFIG_USB=y
CONFIG_DM_USB=y
diff --git a/configs/rpi_arm64_defconfig b/configs/rpi_arm64_defconfig
index 2639219a1a..b75144036d 100644
--- a/configs/rpi_arm64_defconfig
+++ b/configs/rpi_arm64_defconfig
@@ -33,6 +33,8 @@ CONFIG_PCI_BRCMSTB=y
CONFIG_PINCTRL=y
# CONFIG_PINCTRL_GENERIC is not set
CONFIG_DM_RESET=y
+CONFIG_DM_RNG=y
+CONFIG_RNG_IPROC200=y
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
CONFIG_USB=y
CONFIG_DM_USB=y
diff --git a/drivers/rng/iproc_rng200.c b/drivers/rng/iproc_rng200.c
index 1063f43953..378f6cf48d 100644
--- a/drivers/rng/iproc_rng200.c
+++ b/drivers/rng/iproc_rng200.c
@@ -50,7 +50,6 @@ static void iproc_rng200_enable(struct iproc_rng200_platdata *pdata, bool enable
val &= ~RNG_CTRL_RNG_RBGEN_ENABLE;
writel(val, rng_base + RNG_CTRL_OFFSET);
-
}
static void iproc_rng200_restart(struct iproc_rng200_platdata *pdata)

View File

@ -0,0 +1,11 @@
--- u-boot-2020.10/common/spl/Kconfig.orig 2020-10-07 12:08:54.972632715 +0100
+++ u-boot-2020.10/common/spl/Kconfig 2020-10-07 12:08:59.100672506 +0100
@@ -324,7 +324,7 @@
default 0x200 if ARCH_SOCFPGA || ARCH_AT91
default 0x300 if ARCH_ZYNQ || ARCH_KEYSTONE || OMAP34XX || OMAP44XX || \
OMAP54XX || AM33XX || AM43XX || ARCH_K3
- default 0x4000 if ARCH_ROCKCHIP
+ default 0x200 if ARCH_ROCKCHIP
default 0x822 if TARGET_SIFIVE_FU540
help
Address on the MMC to load U-Boot from, when the MMC is being used

View File

@ -0,0 +1,96 @@
From f10f94831450671a77f61fe413b4a57459963860 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 10 Aug 2020 22:20:29 +0100
Subject: [PATCH] rpi: Use firmware provided device tree
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/rpi_0_w_defconfig | 2 +-
configs/rpi_2_defconfig | 2 +-
configs/rpi_3_32b_defconfig | 2 +-
configs/rpi_3_b_plus_defconfig | 2 +-
configs/rpi_3_defconfig | 2 +-
configs/rpi_defconfig | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig
index bba5e12b12..0241f4c6d3 100644
--- a/configs/rpi_0_w_defconfig
+++ b/configs/rpi_0_w_defconfig
@@ -17,7 +17,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig
index 1c2bbb29ce..9573e475f4 100644
--- a/configs/rpi_2_defconfig
+++ b/configs/rpi_2_defconfig
@@ -17,7 +17,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig
index b8a3d17f43..252df994e6 100644
--- a/configs/rpi_3_32b_defconfig
+++ b/configs/rpi_3_32b_defconfig
@@ -18,7 +18,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
diff --git a/configs/rpi_3_b_plus_defconfig b/configs/rpi_3_b_plus_defconfig
index 4c361438fa..3b2996a2f9 100644
--- a/configs/rpi_3_b_plus_defconfig
+++ b/configs/rpi_3_b_plus_defconfig
@@ -18,7 +18,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig
index 9b281a4f15..1e9ee6122e 100644
--- a/configs/rpi_3_defconfig
+++ b/configs/rpi_3_defconfig
@@ -18,7 +18,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
index b5ad53c37b..223fc03275 100644
--- a/configs/rpi_defconfig
+++ b/configs/rpi_defconfig
@@ -17,7 +17,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
--
2.26.2

View File

@ -1 +1 @@
SHA512 (u-boot-2017.09.tar.bz2) = dff6e793f135e7d6cb9d85d6ef8e4aa7ed5c1e20eece4f434e8c0a6039eb75c3f2cb7bc550121b1f5a5709e943c7cc5d6d8590e05a47a6b0d0d8f05185fe7ec6
SHA512 (u-boot-2021.01-rc4.tar.bz2) = 6de2c60d02276f4eed31b5baf2d8239ad0af30c9d341339a4cd7fa0786068cb5faa1ab8bd0b4155e536962e1a4869906f60f1d2a1e50b0ed15e98c2e84d6a97b

File diff suppressed because it is too large Load Diff

View File

@ -1,541 +0,0 @@
From patchwork Fri Sep 22 07:26:27 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,1/9] sunxi: rename Bananapi M3 dts file name
X-Patchwork-Submitter: Chen-Yu Tsai <wens@csie.org>
X-Patchwork-Id: 817346
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20170922072635.32105-2-wens@csie.org>
To: u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>, Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Fri, 22 Sep 2017 15:26:27 +0800
From: Chen-Yu Tsai <wens@csie.org>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
The upstream (Linux) device tree file for the Bananapi M3 follows the
convention of using the well known brand name, instead of the vendor
name, for naming. The file was recently added to upstream in commit
359b5a1e1c2d ("ARM: sun8i: a83t: Add device tree for Sinovoip Bananapi
BPI-M3")
Rename the device tree file in U-boot to match.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/dts/Makefile | 4 ++--
.../{sun8i-a83t-sinovoip-bpi-m3.dts => sun8i-a83t-bananapi-m3.dts} | 0
configs/Sinovoip_BPI_M3_defconfig | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
rename arch/arm/dts/{sun8i-a83t-sinovoip-bpi-m3.dts => sun8i-a83t-bananapi-m3.dts} (100%)
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 762429c463d1..b7550104c340 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -307,8 +307,8 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \
sun8i-r16-parrot.dtb
dtb-$(CONFIG_MACH_SUN8I_A83T) += \
sun8i-a83t-allwinner-h8homlet-v2.dtb \
- sun8i-a83t-cubietruck-plus.dtb \
- sun8i-a83t-sinovoip-bpi-m3.dtb
+ sun8i-a83t-bananapi-m3.dtb \
+ sun8i-a83t-cubietruck-plus.dtb
dtb-$(CONFIG_MACH_SUN8I_H3) += \
sun8i-h2-plus-orangepi-zero.dtb \
sun8i-h3-bananapi-m2-plus.dtb \
diff --git a/arch/arm/dts/sun8i-a83t-sinovoip-bpi-m3.dts b/arch/arm/dts/sun8i-a83t-bananapi-m3.dts
similarity index 100%
rename from arch/arm/dts/sun8i-a83t-sinovoip-bpi-m3.dts
rename to arch/arm/dts/sun8i-a83t-bananapi-m3.dts
diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
index 04d81693ebd8..f321d94e04eb 100644
--- a/configs/Sinovoip_BPI_M3_defconfig
+++ b/configs/Sinovoip_BPI_M3_defconfig
@@ -13,7 +13,7 @@ CONFIG_USB0_ID_DET="PH11"
CONFIG_USB1_VBUS_PIN="PD24"
CONFIG_AXP_GPIO=y
CONFIG_SATAPWR="PD25"
-CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-sinovoip-bpi-m3"
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-bananapi-m3"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_CONSOLE_MUX=y
CONFIG_SPL=y
From patchwork Fri Sep 22 07:26:28 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,2/9] sunxi: Enable eMMC on Cubietruck Plus
X-Patchwork-Submitter: Chen-Yu Tsai <wens@csie.org>
X-Patchwork-Id: 817342
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20170922072635.32105-3-wens@csie.org>
To: u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>, Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Fri, 22 Sep 2017 15:26:28 +0800
From: Chen-Yu Tsai <wens@csie.org>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Set CONFIG_MMC_SUNXI_SLOT_EXTRA=2 to enable the eMMC controller to
access eMMC on the board.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
configs/Cubietruck_plus_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig
index 34444ec0bd09..3d999192cbc1 100644
--- a/configs/Cubietruck_plus_defconfig
+++ b/configs/Cubietruck_plus_defconfig
@@ -4,6 +4,7 @@ CONFIG_MACH_SUN8I_A83T=y
CONFIG_DRAM_CLK=672
CONFIG_DRAM_ZQ=15355
CONFIG_DRAM_ODT_EN=y
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE"
CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT"
CONFIG_USB0_ID_DET="PH11"
From patchwork Fri Sep 22 07:26:29 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,3/9] sunxi: Fix USB PHY control register offset for A83T
X-Patchwork-Submitter: Chen-Yu Tsai <wens@csie.org>
X-Patchwork-Id: 817341
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20170922072635.32105-4-wens@csie.org>
To: u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>, Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Fri, 22 Sep 2017 15:26:29 +0800
From: Chen-Yu Tsai <wens@csie.org>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
It was recently discovered that the USB PHY control register offset on
the A83T is 0x410 like on the A33, not 0x404. Fix it.
Fixes: 0c935acb9e5d ("sunxi: usb_phy: Add support for A83T USB PHYs")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/mach-sunxi/usb_phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-sunxi/usb_phy.c b/arch/arm/mach-sunxi/usb_phy.c
index 9bf0b5633d4a..3fbef0050e3f 100644
--- a/arch/arm/mach-sunxi/usb_phy.c
+++ b/arch/arm/mach-sunxi/usb_phy.c
@@ -19,7 +19,7 @@
#include <errno.h>
#define SUNXI_USB_PMU_IRQ_ENABLE 0x800
-#ifdef CONFIG_MACH_SUN8I_A33
+#if defined CONFIG_MACH_SUN8I_A33 || defined CONFIG_MACH_SUN8I_A83T
#define SUNXI_USB_CSR 0x410
#else
#define SUNXI_USB_CSR 0x404
From patchwork Fri Sep 22 07:26:30 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,4/9] sunxi: Switch MUSB to gadget mode on the Bananapi M3
X-Patchwork-Submitter: Chen-Yu Tsai <wens@csie.org>
X-Patchwork-Id: 817348
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20170922072635.32105-5-wens@csie.org>
To: u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>, Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Fri, 22 Sep 2017 15:26:30 +0800
From: Chen-Yu Tsai <wens@csie.org>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
The Bananapi M3 has a micro-USB OTG port. It supports both host and
gadget mode. Having the OTG port operate in gadget mode is more useful,
as we can use it for fastboot or Ethernet over USB.
The board has 2 other USB host ports that are supported. These can be
used for connecting peripherals.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
configs/Sinovoip_BPI_M3_defconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
index f321d94e04eb..e48983fc3310 100644
--- a/configs/Sinovoip_BPI_M3_defconfig
+++ b/configs/Sinovoip_BPI_M3_defconfig
@@ -27,5 +27,5 @@ CONFIG_AXP_DCDC5_VOLT=1200
CONFIG_AXP_DLDO3_VOLT=2500
CONFIG_AXP_SW_ON=y
CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_HOST=y
+CONFIG_USB_MUSB_GADGET=y
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
From patchwork Fri Sep 22 07:26:31 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot, 5/9] sunxi: Switch MUSB to gadget mode on the Cubietruck Plus
X-Patchwork-Submitter: Chen-Yu Tsai <wens@csie.org>
X-Patchwork-Id: 817344
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20170922072635.32105-6-wens@csie.org>
To: u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>, Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Fri, 22 Sep 2017 15:26:31 +0800
From: Chen-Yu Tsai <wens@csie.org>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
The Cubietruck Plus has a micro-USB OTG port. It supports both host and
gadget mode. Having the OTG port operate in gadget mode is more useful,
as we can use it for fastboot or Ethernet over USB.
The board has 2 other USB host ports that are supported. These can be
used for connecting peripherals.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
configs/Cubietruck_plus_defconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig
index 3d999192cbc1..3aefcc58413c 100644
--- a/configs/Cubietruck_plus_defconfig
+++ b/configs/Cubietruck_plus_defconfig
@@ -26,5 +26,5 @@ CONFIG_AXP_DLDO3_VOLT=2500
CONFIG_AXP_DLDO4_VOLT=3300
CONFIG_AXP_FLDO1_VOLT=1200
CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_HOST=y
+CONFIG_USB_MUSB_GADGET=y
CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
From patchwork Fri Sep 22 07:26:32 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,6/9] net: sun8i_emac: Support RX/TX delay chains
X-Patchwork-Submitter: Chen-Yu Tsai <wens@csie.org>
X-Patchwork-Id: 817350
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20170922072635.32105-7-wens@csie.org>
To: u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>, Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Fri, 22 Sep 2017 15:26:32 +0800
From: Chen-Yu Tsai <wens@csie.org>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
The EMAC syscon has configurable RX/TX delay chains for use with RGMII
PHYs.
This adds support for configuring them via device tree properties. The
property names and format were defined in Linux's dwmac-sun8i binding
that was merged at one point.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
drivers/net/sun8i_emac.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index 09bbb2cdb5ca..5fa1b4c170d7 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -56,6 +56,10 @@
#define H3_EPHY_SELECT BIT(15) /* 1: internal PHY, 0: external PHY */
#define SC_RMII_EN BIT(13)
+#define SC_TXDC_SHIFT 10
+#define SC_TXDC_MASK GENMASK(2, 0)
+#define SC_RXDC_SHIFT 5
+#define SC_RXDC_MASK GENMASK(4, 0)
#define SC_EPIT BIT(2) /* 1: RGMII, 0: MII */
#define SC_ETCS_MASK GENMASK(1, 0)
#define SC_ETCS_EXT_GMII 0x1
@@ -125,6 +129,8 @@ struct emac_eth_dev {
u32 addr;
u32 tx_slot;
bool use_internal_phy;
+ u32 tx_delay;
+ u32 rx_delay;
enum emac_variant variant;
void *mac_reg;
@@ -290,6 +296,12 @@ static int sun8i_emac_set_syscon(struct emac_eth_dev *priv)
if (priv->variant == H3_EMAC || priv->variant == A64_EMAC)
reg &= ~SC_RMII_EN;
+ /* Configure RX/TX delay chains */
+ reg &= ~(SC_RXDC_MASK << SC_RXDC_SHIFT);
+ reg &= ~(SC_TXDC_MASK << SC_TXDC_SHIFT);
+ reg |= (priv->rx_delay & SC_RXDC_MASK) << SC_RXDC_SHIFT;
+ reg |= (priv->tx_delay & SC_TXDC_MASK) << SC_TXDC_SHIFT;
+
switch (priv->interface) {
case PHY_INTERFACE_MODE_MII:
/* default */
@@ -836,6 +848,19 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
}
#endif
+ /* Get RX/TX delays for RGMII */
+ priv->rx_delay = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
+ "allwinner,rx-delay-ps", 0);
+ if (priv->rx_delay % 100 || priv->rx_delay > 3100)
+ debug("%s: invalid rx delay value\n", __func__);
+ priv->rx_delay /= 100;
+
+ priv->tx_delay = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev),
+ "allwinner,tx-delay-ps", 0);
+ if (priv->tx_delay % 100 || priv->tx_delay > 800)
+ debug("%s: invalid tx delay value\n", __func__);
+ priv->tx_delay /= 100;
+
return 0;
}
From patchwork Fri Sep 22 07:26:33 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,7/9] net: sun8i_emac: Fix build for non-H3/H5 SoCs
X-Patchwork-Submitter: Chen-Yu Tsai <wens@csie.org>
X-Patchwork-Id: 817349
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20170922072635.32105-8-wens@csie.org>
To: u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>, Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Fri, 22 Sep 2017 15:26:33 +0800
From: Chen-Yu Tsai <wens@csie.org>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Only the H3/H5 SoCs have an internal PHY and its related clock and
reset controls.
Use an #ifdef to guard the internal PHY control code block so it
can be built for other SoCs, such as the A83T or A64.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
---
drivers/net/sun8i_emac.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index 5fa1b4c170d7..0a98a04967da 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -616,6 +616,8 @@ static void sun8i_emac_board_setup(struct emac_eth_dev *priv)
{
struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+#ifdef CONFIG_MACH_SUNXI_H3_H5
+ /* Only H3/H5 have clock controls for internal EPHY */
if (priv->use_internal_phy) {
/* Set clock gating for ephy */
setbits_le32(&ccm->bus_gate4, BIT(AHB_GATE_OFFSET_EPHY));
@@ -623,6 +625,7 @@ static void sun8i_emac_board_setup(struct emac_eth_dev *priv)
/* Deassert EPHY */
setbits_le32(&ccm->ahb_reset2_cfg, BIT(AHB_RESET_OFFSET_EPHY));
}
+#endif
/* Set clock gating for emac */
setbits_le32(&ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_GMAC));
From patchwork Fri Sep 22 07:26:34 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,8/9] sunxi: Enable EMAC on the Cubietruck Plus
X-Patchwork-Submitter: Chen-Yu Tsai <wens@csie.org>
X-Patchwork-Id: 817345
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20170922072635.32105-9-wens@csie.org>
To: u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>, Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Fri, 22 Sep 2017 15:26:34 +0800
From: Chen-Yu Tsai <wens@csie.org>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
The Cubietruck Plus has an RTL8211E PHY connected to the EMAC using
RGMII. The PHY is powered by DLDO4 @ 3.3V, while the I/O pins are
powered by DLDO3 @ 2.5V.
This patch adds a U-boot specific dtsi file for the board adding
an enabled EMAC node, and enables the EMAC driver in the defconfig.
The binding used here is the old revision currently supported in
U-boot. There is no stable binding nor support in upstream Linux
at this time.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
.../arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi | 39 ++++++++++++++++++++++
configs/Cubietruck_plus_defconfig | 1 +
2 files changed, 40 insertions(+)
create mode 100644 arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi
diff --git a/arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi b/arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi
new file mode 100644
index 000000000000..b4e216c14264
--- /dev/null
+++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi
@@ -0,0 +1,39 @@
+#include "sunxi-u-boot.dtsi"
+
+/ {
+ aliases {
+ ethernet0 = &emac;
+ };
+
+ soc {
+ emac: ethernet@01c30000 {
+ compatible = "allwinner,sun8i-a83t-emac";
+ reg = <0x01c30000 0x2000>, <0x01c00030 0x4>;
+ reg-names = "emac", "syscon";
+ interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii_pins>;
+ phy-mode = "rgmii";
+ phy = <&phy1>;
+ status = "okay";
+
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ };
+ };
+ };
+};
+
+&pio {
+ rgmii_pins: rgmii_pins {
+ allwinner,pins = "PD8", "PD9", "PD10", "PD11",
+ "PD12", "PD13", "PD15",
+ "PD16", "PD17", "PD18", "PD19",
+ "PD20", "PD21", "PD22", "PD23";
+ allwinner,function = "emac";
+ allwinner,drive = <3>;
+ allwinner,pull = <0>;
+ };
+};
diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig
index 3aefcc58413c..ee8b901d0d08 100644
--- a/configs/Cubietruck_plus_defconfig
+++ b/configs/Cubietruck_plus_defconfig
@@ -22,6 +22,7 @@ CONFIG_SPL=y
# CONFIG_SPL_DOS_PARTITION is not set
# CONFIG_SPL_ISO_PARTITION is not set
# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_SUN8I_EMAC=y
CONFIG_AXP_DLDO3_VOLT=2500
CONFIG_AXP_DLDO4_VOLT=3300
CONFIG_AXP_FLDO1_VOLT=1200
From patchwork Fri Sep 22 07:26:35 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,9/9] sunxi: Enable EMAC on the Bananapi M3
X-Patchwork-Submitter: Chen-Yu Tsai <wens@csie.org>
X-Patchwork-Id: 817347
X-Patchwork-Delegate: jagannadh.teki@gmail.com
Message-Id: <20170922072635.32105-10-wens@csie.org>
To: u-boot@lists.denx.de
Cc: Joe Hershberger <joe.hershberger@ni.com>, Jagan Teki <jagan@openedev.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Fri, 22 Sep 2017 15:26:35 +0800
From: Chen-Yu Tsai <wens@csie.org>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
The Bananapi M3 has an RTL8211E PHY connected to the EMAC using
RGMII. The PHY is powered by DCDC1 through SW @ 3.3V.
This patch adds a U-boot specific dtsi file for the board adding
an enabled EMAC node, and enables the EMAC driver in the defconfig.
The binding used here is the old revision currently supported in
U-boot. There is no stable binding nor support in upstream Linux
at this time.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi | 41 +++++++++++++++++++++++++
configs/Sinovoip_BPI_M3_defconfig | 1 +
2 files changed, 42 insertions(+)
create mode 100644 arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi
diff --git a/arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi b/arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi
new file mode 100644
index 000000000000..9c7977e67b92
--- /dev/null
+++ b/arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi
@@ -0,0 +1,41 @@
+#include "sunxi-u-boot.dtsi"
+
+/ {
+ aliases {
+ ethernet0 = &emac;
+ };
+
+ soc {
+ emac: ethernet@01c30000 {
+ compatible = "allwinner,sun8i-a83t-emac";
+ reg = <0x01c30000 0x2000>, <0x01c00030 0x4>;
+ reg-names = "emac", "syscon";
+ interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&rgmii_pins>;
+ phy-mode = "rgmii";
+ phy = <&phy1>;
+ allwinner,rx-delay-ps = <700>;
+ allwinner,tx-delay-ps = <700>;
+ status = "okay";
+
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ };
+ };
+ };
+};
+
+&pio {
+ rgmii_pins: rgmii_pins {
+ allwinner,pins = "PD8", "PD9", "PD10", "PD11",
+ "PD12", "PD13", "PD15",
+ "PD16", "PD17", "PD18", "PD19",
+ "PD20", "PD21", "PD22", "PD23";
+ allwinner,function = "emac";
+ allwinner,drive = <3>;
+ allwinner,pull = <0>;
+ };
+};
diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
index e48983fc3310..efdf3c7396fd 100644
--- a/configs/Sinovoip_BPI_M3_defconfig
+++ b/configs/Sinovoip_BPI_M3_defconfig
@@ -23,6 +23,7 @@ CONFIG_SPL=y
# CONFIG_SPL_DOS_PARTITION is not set
# CONFIG_SPL_ISO_PARTITION is not set
# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_SUN8I_EMAC=y
CONFIG_AXP_DCDC5_VOLT=1200
CONFIG_AXP_DLDO3_VOLT=2500
CONFIG_AXP_SW_ON=y

View File

@ -0,0 +1,222 @@
From patchwork Wed Nov 18 10:27:17 2020
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Icenowy Zheng <icenowy@aosc.io>
X-Patchwork-Id: 1402159
X-Patchwork-Delegate: andre.przywara@arm.com
Return-Path: <u-boot-bounces@lists.denx.de>
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: ozlabs.org;
spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de
(client-ip=85.214.62.61; helo=phobos.denx.de;
envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)
Authentication-Results: ozlabs.org;
dmarc=none (p=none dis=none) header.from=aosc.io
Authentication-Results: ozlabs.org;
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=mymailcheap.com header.i=@mymailcheap.com
header.a=rsa-sha256 header.s=default header.b=YYrkSpBD;
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=aosc.io header.i=@aosc.io header.a=rsa-sha256
header.s=default header.b=o7lHQ4SZ;
dkim-atps=neutral
Received: from phobos.denx.de (phobos.denx.de [85.214.62.61])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (4096 bits))
(No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 4CbfCp3G62z9s1l
for <incoming@patchwork.ozlabs.org>; Wed, 18 Nov 2020 21:28:22 +1100 (AEDT)
Received: from h2850616.stratoserver.net (localhost [IPv6:::1])
by phobos.denx.de (Postfix) with ESMTP id 00D6D82304;
Wed, 18 Nov 2020 11:28:16 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=none (p=none dis=none) header.from=aosc.io
Authentication-Results: phobos.denx.de;
spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de
Authentication-Results: phobos.denx.de;
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=mymailcheap.com header.i=@mymailcheap.com
header.b="YYrkSpBD";
dkim=fail reason="signature verification failed" (1024-bit key;
unprotected) header.d=aosc.io header.i=@aosc.io header.b="o7lHQ4SZ";
dkim-atps=neutral
Received: by phobos.denx.de (Postfix, from userid 109)
id 2E5B282309; Wed, 18 Nov 2020 11:28:11 +0100 (CET)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de
X-Spam-Level:
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,
DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham
autolearn_force=no version=3.4.2
Received: from relay1.mymailcheap.com (relay1.mymailcheap.com
[144.217.248.100])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by phobos.denx.de (Postfix) with ESMTPS id EC082808F1
for <u-boot@lists.denx.de>; Wed, 18 Nov 2020 11:28:05 +0100 (CET)
Authentication-Results: phobos.denx.de;
dmarc=none (p=none dis=none) header.from=aosc.io
Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=icenowy@aosc.io
Received: from filter2.mymailcheap.com (filter2.mymailcheap.com
[91.134.140.82])
by relay1.mymailcheap.com (Postfix) with ESMTPS id 18A423F201;
Wed, 18 Nov 2020 10:27:59 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
by filter2.mymailcheap.com (Postfix) with ESMTP id 6377C2A7E9;
Wed, 18 Nov 2020 11:27:58 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mymailcheap.com;
s=default; t=1605695278;
bh=vA5tPn4fjpXJj/OQnRg+m708mrodc5u5TJSDVOSBnHo=;
h=From:To:Cc:Subject:Date:From;
b=YYrkSpBDGdpkLi16yGwNw7yMTXXW566rTdXX2RSRxCe6FylY99qiYDmZR+PZFqCX0
t3yDL0nO6zMKUvJVqZaTwsroyblAKNCaLz1AfCURNqCwohtJcIkDsegRYz9slzT9Qu
BQkTT6dosAIQFtAVrc48QBX38eHXMYreqkbHXz5g=
Received: from filter2.mymailcheap.com ([127.0.0.1])
by localhost (filter2.mymailcheap.com [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id eCMZCx2FVDgE; Wed, 18 Nov 2020 11:27:57 +0100 (CET)
Received: from mail20.mymailcheap.com (mail20.mymailcheap.com [51.83.111.147])
(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by filter2.mymailcheap.com (Postfix) with ESMTPS;
Wed, 18 Nov 2020 11:27:57 +0100 (CET)
Received: from [213.133.102.83] (ml.mymailcheap.com [213.133.102.83])
by mail20.mymailcheap.com (Postfix) with ESMTP id A597A400BE;
Wed, 18 Nov 2020 10:27:56 +0000 (UTC)
Authentication-Results: mail20.mymailcheap.com; dkim=pass (1024-bit key;
unprotected) header.d=aosc.io header.i=@aosc.io header.b="o7lHQ4SZ";
dkim-atps=neutral
AI-Spam-Status: Not processed
Received: from ice-e5v2.lan (unknown [59.41.160.51])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest
SHA256) (No client certificate requested)
by mail20.mymailcheap.com (Postfix) with ESMTPSA id 3B979400BE;
Wed, 18 Nov 2020 10:27:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aosc.io; s=default;
t=1605695270; bh=vA5tPn4fjpXJj/OQnRg+m708mrodc5u5TJSDVOSBnHo=;
h=From:To:Cc:Subject:Date:From;
b=o7lHQ4SZ+kcNlSGrF+USzZxRQhtIEcZFQPjvsiu+MiK+TTjArUzo5bRKHH0I4ZcDM
a4Ywg6IcctT99QEZGbRIHqhvjH6/Kvj4lWM77Bb0DrlHXfEdOj3LC7KiAF1vVGFfPI
0oTEacf71O2OWPmQBqEH/uaV/IiGI4rZvgWiMPkk=
From: Icenowy Zheng <icenowy@aosc.io>
To: Jagan Teki <jagan@amarulasolutions.com>,
Andre Przywara <andre.przywara@arm.com>,
Hans de Goede <hdegoede@redhat.com>
Cc: u-boot@lists.denx.de, linux-sunxi@googlegroups.com,
Icenowy Zheng <icenowy@aosc.io>
Subject: [PATCH v3] sunxi: add PineCube board
Date: Wed, 18 Nov 2020 18:27:17 +0800
Message-Id: <20201118102717.635129-1-icenowy@aosc.io>
X-Mailer: git-send-email 2.28.0
MIME-Version: 1.0
X-Rspamd-Queue-Id: A597A400BE
X-Spamd-Result: default: False [4.90 / 20.00]; RCVD_VIA_SMTP_AUTH(0.00)[];
ARC_NA(0.00)[]; R_DKIM_ALLOW(0.00)[aosc.io:s=default];
RECEIVED_SPAMHAUS_PBL(0.00)[59.41.160.51:received];
FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[];
R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[];
MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[aosc.io];
BROKEN_CONTENT_TYPE(1.50)[]; R_SPF_SOFTFAIL(0.00)[~all];
RCPT_COUNT_FIVE(0.00)[6]; ML_SERVERS(-3.10)[213.133.102.83];
DKIM_TRACE(0.00)[aosc.io:+]; MID_CONTAINS_FROM(1.00)[];
RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[];
MIME_TRACE(0.00)[0:+];
ASN(0.00)[asn:24940, ipnet:213.133.96.0/19, country:DE];
RCVD_COUNT_TWO(0.00)[2];
HFILTER_HELO_BAREIP(3.00)[213.133.102.83,1]
X-Rspamd-Server: mail20.mymailcheap.com
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: U-Boot discussion <u-boot.lists.denx.de>
List-Unsubscribe: <https://lists.denx.de/options/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>
List-Archive: <https://lists.denx.de/pipermail/u-boot/>
List-Post: <mailto:u-boot@lists.denx.de>
List-Help: <mailto:u-boot-request@lists.denx.de?subject=help>
List-Subscribe: <https://lists.denx.de/listinfo/u-boot>,
<mailto:u-boot-request@lists.denx.de?subject=subscribe>
Errors-To: u-boot-bounces@lists.denx.de
Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de
X-Virus-Status: Clean
PineCube is an IP camera development kit released by Pine64.
It comes with the following compoents:
- A mainboard with Sochip S3 SoC, a 16MByte SPI Flash, AXP209 PMIC,
a power-only microUSB connector, a USB Type-A connector, a 10/100Mbps
Ethernet port and FPC connectors for camera and daughter board.
- An OV5640-based camera module which is connected to the parallel CSI
bus of the mainboard.
- A daughterboard with several buttons, a SD slot, some IR LEDs, a
microphone and a speaker connector.
As the device tree is synchronized in a previous commit, just add it to
Makefile, create a new MAINTAINER item and provide a defconfig.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
Changes since v2:
- Add Makefile reference to DT.
Changes since v1:
- Dropped LDO3 quirk.
arch/arm/dts/Makefile | 1 +
board/sunxi/MAINTAINERS | 5 +++++
configs/pinecube_defconfig | 15 +++++++++++++++
3 files changed, 21 insertions(+)
create mode 100644 configs/pinecube_defconfig
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 7d1a369845..e6993733b0 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -587,6 +587,7 @@ dtb-$(CONFIG_MACH_SUN8I_R40) += \
sun8i-r40-bananapi-m2-ultra.dtb \
sun8i-v40-bananapi-m2-berry.dtb
dtb-$(CONFIG_MACH_SUN8I_V3S) += \
+ sun8i-s3-pinecube.dtb \
sun8i-v3s-licheepi-zero.dtb
dtb-$(CONFIG_MACH_SUN50I_H5) += \
sun50i-h5-bananapi-m2-plus.dtb \
diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS
index d3755ae41a..735801ae1d 100644
--- a/board/sunxi/MAINTAINERS
+++ b/board/sunxi/MAINTAINERS
@@ -440,6 +440,11 @@ M: Vasily Khoruzhick <anarsoul@gmail.com>
S: Maintained
F: configs/pinebook_defconfig
+PINECUBE BOARD:
+M: Icenowy Zheng <icenowy@aosc.io>
+S: Maintained
+F: configs/pinecube_defconfig
+
PINE64 BOARDS
M: Andre Przywara <andre.przywara@arm.com>
S: Maintained
diff --git a/configs/pinecube_defconfig b/configs/pinecube_defconfig
new file mode 100644
index 0000000000..a8c404f6b1
--- /dev/null
+++ b/configs/pinecube_defconfig
@@ -0,0 +1,15 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_SPL=y
+CONFIG_MACH_SUN8I_V3S=y
+CONFIG_SUNXI_DRAM_DDR3_1333=y
+CONFIG_DRAM_CLK=504
+CONFIG_DRAM_ODT_EN=y
+CONFIG_I2C0_ENABLE=y
+CONFIG_DEFAULT_DEVICE_TREE="sun8i-s3-pinecube"
+CONFIG_SPL_I2C_SUPPORT=y
+# CONFIG_NETDEVICES is not set
+CONFIG_AXP209_POWER=y
+CONFIG_AXP_DCDC2_VOLT=1250
+CONFIG_AXP_DCDC3_VOLT=3300
+CONFIG_CONS_INDEX=3

View File

@ -1,47 +1,60 @@
#global candidate rc4
%global candidate rc4
Name: uboot-tools
Version: 2017.09
Release: 4%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot
Name: uboot-tools
Version: 2021.01
Release: 0.4%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot
Source0: ftp://ftp.denx.de/pub/u-boot/u-boot-%{version}%{?candidate:-%{candidate}}.tar.bz2
Source1: arm-boards
Source2: arm-chromebooks
Source3: aarch64-boards
Source4: aarch64-chromebooks
Source5: 10-devicetree.install
Source0: ftp://ftp.denx.de/pub/u-boot/u-boot-%{version}%{?candidate:-%{candidate}}.tar.bz2
Source1: arm-boards
Source2: arm-chromebooks
Source3: aarch64-boards
Source4: aarch64-chromebooks
# Fedoraisms patches, general fixes
Patch1: uefi-vsprintf.patch
Patch2: uefi-improve-fat.patch
Patch3: uefi-efi_loader-enough-UEFI-for-standard-distro-boot.patch
Patch4: uefi-use-Fedora-specific-path-name.patch
Patch5: dm-video-enhancements-for-Shell.efi.patch
Patch6: usb-kbd-fixes.patch
Patch7: disk-part_dos-Use-the-original-allocation-scheme-for-the-SPL-case.patch
Patch8: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
Patch9: uefi-efi_loader-Fix-disk-dp-s-for-pre-DM-legacy-devices.patch
# Fedoraisms patches
# Needed to find DT on boot partition that's not the first partition
Patch1: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
# Needed due to issues with shim
Patch2: uefi-use-Fedora-specific-path-name.patch
# RPi - uses RPI firmware device tree for HAT support
Patch3: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
# Ajust the U-Boot offsets in SPL to take less space
#Patch4: rockchip-spl-u-boot-itb-offset.patch
# Board fixes and enablement
Patch10: dragonboard-fixes.patch
Patch11: qemu-machine-virt-ARM.patch
Patch12: sti-STiH410-B2260-support.patch
Patch13: bcm283x-device-tree-sources-to-Linux-4.14-state.patch
Patch14: sunxi-A83T-improvements.patch
# Patch14: mvebu-enable-generic-distro-boot-config.patch
# Patch15: mx6-Initial-Hummingboard-2-support.patch
Patch5: Raspberry-Pi-400-Compute-Module-4-support.patch
Patch6: rng-Add-iProc-RNG200-driver.patch
# AllWinner improvements
Patch10: AllWinner-PineTab.patch
Patch11: sunxi-add-PineCube-board.patch
Patch12: 0001-Fixes-for-AllWinner-ethernet-network-interfaces.patch
# TI fixes
Patch13: 0001-Fix-BeagleAI-detection.patch
# Rockchips improvements
Patch14: arm-rk3399-enable-rng-on-rock960-and-firefly3399.patch
Patch15: rk3399-Pinebook-pro-EDP-support.patch
BuildRequires: bc
BuildRequires: dtc
BuildRequires: gcc
BuildRequires: git
BuildRequires: openssl-devel
BuildRequires: make
# Requirements for building on el7
%if 0%{?rhel} == 7
BuildRequires: devtoolset-7-build
BuildRequires: devtoolset-7-binutils
BuildRequires: devtoolset-7-gcc
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-libfdt
%else
BuildRequires: gcc
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-libfdt
%endif
BuildRequires: flex bison
BuildRequires: openssl-devel
BuildRequires: SDL-devel
BuildRequires: swig
%ifarch %{arm} aarch64
@ -50,9 +63,7 @@ BuildRequires: vboot-utils
%ifarch aarch64
BuildRequires: arm-trusted-firmware-armv8
%endif
Requires: dtc
Requires: systemd
%description
This package contains a few U-Boot utilities - mkimage for creating boot images
@ -60,84 +71,70 @@ and fw_printenv/fw_setenv for manipulating the boot environment variables.
%ifarch aarch64
%package -n uboot-images-armv8
Summary: u-boot bootloader images for aarch64 boards
Requires: uboot-tools
Summary: U-Boot firmware images for aarch64 boards
BuildArch: noarch
%description -n uboot-images-armv8
u-boot bootloader binaries for aarch64 boards
U-Boot firmware binaries for aarch64 boards
%endif
%ifarch %{arm}
%package -n uboot-images-armv7
Summary: u-boot bootloader images for armv7 boards
Requires: uboot-tools
Summary: U-Boot firmware images for armv7 boards
BuildArch: noarch
%description -n uboot-images-armv7
u-boot bootloader binaries for armv7 boards
%endif
%ifarch %{arm} aarch64
%package -n uboot-images-elf
Summary: u-boot bootloader images for armv7 boards
Requires: uboot-tools
Obsoletes: uboot-images-qemu
Provides: uboot-images-qemu
%description -n uboot-images-elf
u-boot bootloader ELF binaries for use with qemu and other platforms
U-Boot firmware binaries for armv7 boards
%endif
%prep
%setup -q -n u-boot-%{version}%{?candidate:-%{candidate}}
git init
git config --global gc.auto 0
git config user.email "noone@example.com"
git config user.name "no one"
git add .
git commit -a -q -m "%{version} baseline"
git am %{patches} </dev/null
git config --unset user.email
git config --unset user.name
rm -rf .git
%autosetup -p1 -n u-boot-%{version}%{?candidate:-%{candidate}}
cp %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 .
%build
mkdir builds
%if 0%{?rhel} == 7
#Enabling DTS for .el7
%{?enable_devtoolset7:%{enable_devtoolset7}}
%endif
%ifarch aarch64 %{arm}
for board in $(cat %{_arch}-boards)
do
echo "Building board: $board"
mkdir builds/$(echo $board)/
# ATF selection, needs improving, suggestions of ATF SoC to Board matrix welcome
sun50i=(pine64_plus a64-olinuxino bananapi_m64 nanopi_a64 nanopi_neo2 orangepi_pc2 orangepi_prime orangepi_win orangepi_zero_plus2 sopine_baseboard)
sun50i=(a64-olinuxino amarula_a64_relic bananapi_m2_plus_h5 bananapi_m64 libretech_all_h3_cc_h5 nanopi_a64 nanopi_neo2 nanopi_neo_plus2 orangepi_pc2 orangepi_prime orangepi_win orangepi_zero_plus orangepi_zero_plus2 pine64-lts pine64_plus pinebook pinephone pinetab sopine_baseboard teres_i)
if [[ " ${sun50i[*]} " == *" $board "* ]]; then
echo "Board: $board using sun50iw1p1"
cp /usr/share/arm-trusted-firmware/sun50iw1p1/bl31.bin builds/$(echo $board)/
echo "Board: $board using sun50i_a64"
cp /usr/share/arm-trusted-firmware/sun50i_a64/* builds/$(echo $board)/
fi
rk3368=(geekbox sheep-rk3368)
if [[ " ${rk3368[*]} " == *" $board "* ]]; then
echo "Board: $board using rk3368"
cp /usr/share/arm-trusted-firmware/rk3368/bl31.bin builds/$(echo $board)/
sun50h6=(orangepi_lite2 orangepi_one_plus pine_h64)
if [[ " ${sun50h6[*]} " == *" $board "* ]]; then
echo "Board: $board using sun50i_h6"
cp /usr/share/arm-trusted-firmware/sun50i_h6/* builds/$(echo $board)/
fi
rk3399=(evb-rk3399 firefly-rk3399 puma-rk3399)
rk3328=(evb-rk3328 rock64-rk3328 rock-pi-e-rk3328 roc-cc-rk3328)
if [[ " ${rk3328[*]} " == *" $board "* ]]; then
echo "Board: $board using rk3328"
cp /usr/share/arm-trusted-firmware/rk3328/* builds/$(echo $board)/
fi
rk3399=(evb-rk3399 ficus-rk3399 firefly-rk3399 khadas-edge-captain-rk3399 khadas-edge-rk3399 khadas-edge-v-rk3399 nanopc-t4-rk3399 nanopi-m4-2gb-rk3399 nanopi-m4-rk3399 nanopi-neo4-rk3399 orangepi-rk3399 pinebook-pro-rk3399 puma-rk3399 rock960-rk3399 rock-pi-4c-rk3399 rock-pi-4-rk3399 rock-pi-n10-rk3399pro rockpro64-rk3399 roc-pc-mezzanine-rk3399 roc-pc-rk3399)
if [[ " ${rk3399[*]} " == *" $board "* ]]; then
echo "Board: $board using rk3399"
cp /usr/share/arm-trusted-firmware/rk3399/bl31.bin builds/$(echo $board)/
cp /usr/share/arm-trusted-firmware/rk3399/* builds/$(echo $board)/
fi
# End ATF
make $(echo $board)_defconfig O=builds/$(echo $board)/
make HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" %{?_smp_mflags} V=1 O=builds/$(echo $board)/
%make_build HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" O=builds/$(echo $board)/
done
%endif
make HOSTCC="gcc $RPM_OPT_FLAGS" %{?_smp_mflags} CROSS_COMPILE="" defconfig V=1 O=builds/
make HOSTCC="gcc $RPM_OPT_FLAGS" %{?_smp_mflags} CROSS_COMPILE="" tools-all V=1 O=builds/
%make_build HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" tools-only_defconfig O=builds/
%make_build HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" tools-all O=builds/
%install
mkdir -p $RPM_BUILD_ROOT%{_bindir}
@ -149,7 +146,7 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/
for board in $(cat %{_arch}-boards)
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
for file in spl/*spl.bin u-boot.bin u-boot.dtb u-boot-dtb.img u-boot.img u-boot.itb spl/sunxi-spl.bin
for file in u-boot.bin u-boot.dtb u-boot.img u-boot-dtb.img u-boot.itb u-boot-sunxi-with-spl.bin u-boot-rockchip.bin idbloader.img spl/boot.bin spl/sunxi-spl.bin
do
if [ -f builds/$(echo $board)/$(echo $file) ]; then
install -p -m 0644 builds/$(echo $board)/$(echo $file) $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
@ -162,7 +159,7 @@ done
for board in $(cat %{_arch}-boards)
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
for file in MLO SPL spl/arndale-spl.bin spl/origen-spl.bin spl/smdkv310-spl.bin spl/*spl.bin u-boot.bin u-boot.dtb u-boot-dtb-tegra.bin u-boot.img u-boot.imx u-boot-nodtb-tegra.bin u-boot-spl.kwb u-boot-sunxi-with-spl.bin
for file in MLO SPL spl/arndale-spl.bin spl/origen-spl.bin spl/*spl.bin u-boot.bin u-boot.dtb u-boot-dtb-tegra.bin u-boot.img u-boot.imx u-boot-spl.kwb u-boot-rockchip.bin u-boot-sunxi-with-spl.bin spl/boot.bin
do
if [ -f builds/$(echo $board)/$(echo $file) ]; then
install -p -m 0644 builds/$(echo $board)/$(echo $file) $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
@ -189,47 +186,7 @@ do
done
%endif
%ifarch aarch64
for board in $(cat %{_arch}-boards)
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
for file in MLO SPL spl/arndale-spl.bin spl/origen-spl.bin spl/smdkv310-spl.bin u-boot.bin u-boot.dtb u-boot-dtb-tegra.bin u-boot.img u-boot.imx u-boot-nodtb-tegra.bin u-boot-spl.kwb u-boot-sunxi-with-spl.bin
do
if [ -f builds/$(echo $board)/$(echo $file) ]; then
install -p -m 0644 builds/$(echo $board)/$(echo $file) $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
fi
done
done
%endif
# ELF binaries
%ifarch %{arm}
for board in vexpress_ca15_tc2 vexpress_ca9x4
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/elf/$(echo $board)/
for file in u-boot
do
if [ -f builds/$(echo $board)/$(echo $file) ]; then
install -p -m 0644 builds/$(echo $board)/$(echo $file) $RPM_BUILD_ROOT%{_datadir}/uboot/elf/$(echo $board)/
fi
done
done
%endif
%ifarch aarch64
for board in $(cat %{_arch}-boards)
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/elf/$(echo $board)/
for file in u-boot
do
if [ -f builds/$(echo $board)/$(echo $file) ]; then
install -p -m 0644 builds/$(echo $board)/$(echo $file) $RPM_BUILD_ROOT%{_datadir}/uboot/elf/$(echo $board)/
fi
done
done
%endif
for tool in bmp_logo dumpimage easylogo/easylogo env/fw_printenv fit_check_sign fit_info gdb/gdbcont gdb/gdbsend gen_eth_addr gen_ethaddr_crc img2srec mkenvimage mkimage mksunxiboot ncb proftool sunxi-spl-image-builder ubsha1 xway-swap-bytes
for tool in bmp_logo dumpimage env/fw_printenv fit_check_sign fit_info gdb/gdbcont gdb/gdbsend gen_eth_addr gen_ethaddr_crc img2srec mkenvimage mkimage mksunxiboot ncb proftool sunxi-spl-image-builder ubsha1 xway-swap-bytes
do
install -p -m 0755 builds/tools/$tool $RPM_BUILD_ROOT%{_bindir}
done
@ -240,13 +197,8 @@ install -p -m 0755 builds/tools/env/fw_printenv $RPM_BUILD_ROOT%{_bindir}
install -p -m 0644 tools/env/fw_env.config $RPM_BUILD_ROOT%{_sysconfdir}
# systemd kernel-install script for device tree
mkdir -p $RPM_BUILD_ROOT/lib/kernel/install.d/
install -p -m 0755 %{SOURCE5} $RPM_BUILD_ROOT/lib/kernel/install.d/
# Copy sone useful docs over
mkdir -p builds/docs
cp -p board/amlogic/odroid-c2/README builds/docs/README.odroid-c2
cp -p board/hisilicon/hikey/README builds/docs/README.hikey
cp -p board/hisilicon/hikey/README builds/docs/README.hikey
cp -p board/Marvell/db-88f6820-gp/README builds/docs/README.mvebu-db-88f6820
@ -263,154 +215,135 @@ cp -p board/warp/README builds/docs/README.warp
cp -p board/warp7/README builds/docs/README.warp7
%files
%doc README doc/README.imximage doc/README.kwbimage doc/README.distro doc/README.gpt
%doc doc/README.odroid doc/README.rockchip doc/README.efi doc/uImage.FIT doc/README.arm64
%doc README doc/README.kwbimage doc/README.distro doc/README.gpt
%doc doc/README.odroid doc/README.rockchip doc/uefi doc/uImage.FIT doc/arch/arm64.rst
%doc doc/README.chromium builds/docs/*
%doc doc/board/amlogic/ doc/board/rockchip/
%{_bindir}/*
%{_mandir}/man1/mkimage.1*
/lib/kernel/install.d/10-devicetree.install
%dir %{_datadir}/uboot/
%config(noreplace) %{_sysconfdir}/fw_env.config
%ifarch aarch64
%files -n uboot-images-armv8
%{_datadir}/uboot/*
%exclude %{_datadir}/uboot/elf
%endif
%ifarch %{arm}
%files -n uboot-images-armv7
%{_datadir}/uboot/*
%exclude %{_datadir}/uboot/elf
%endif
%ifarch %{arm} aarch64
%files -n uboot-images-elf
%{_datadir}/uboot/elf
%endif
%changelog
* Tue Oct 10 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-4
- Improve uEFI partition detection for some devices
* Sun Dec 27 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2021.01-0.4.rc4
- Update to 2021.01 RC4
- Latest RPi-400/CM4 support patch
* Thu Oct 5 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-3
- Fix regression in i.MX6 and omap4 devices
- Improve DT detection support on aarch64
- uEFI fixes and improvements
- ENable Sinovoip BPI devices
* Tue Dec 15 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2021.01-0.3.rc3
- Update to 2021.01 RC3
- Latest RPi-400/CM4 support patch
- Re-enable previously disabled device support
* Wed Sep 27 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-2
- Add patch to fix some uEFI console output
- Minor other tweaks
* Mon Dec 14 2020 Javier Martinez Canillas <javierm@redhat.com> - 2021.01-0.2.rc2
- Fix a "scan_dev_for_efi" not defined error
* Mon Sep 18 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-1
- 2017.09
* Sun Nov 22 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2021.01-0.1.rc2
- Update to 2021.01 RC2
- Latest Pinebook Pro display patches
- Initial RPi-400 support patch
- Update Fedora specific patches
* Tue Sep 12 2017 Than Ngo <than@redhat.com> - 2017.09-0.6.rc4
- fixed the check for rockchip rk3368 boards
* Sun Nov 8 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.10-3
- Fix SPI on Rockchip devices
- Latest Pinebook Pro display patches
- Fix Keyboard and USB-A ports on Pinebook Pro
* Tue Sep 5 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-0.5.rc4
- 2017.09 RC4
- Add qemu arm target config
* Wed Oct 28 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.10-2
- Fix kernel installs for non EBBR systems
- Fix for wired networks on some Allwinner devices
* Fri Aug 25 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-0.4.rc2
- Raspberry Pi and Allwinner fixes
- Enable some new devices
* Tue Oct 06 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.10-1
- Update to 2020.10
* Tue Aug 15 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-0.3.rc2
- 2017.09 RC2
* Sun Sep 27 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.10-0.6.rc5
- Initial support for display output on Pinebook Pro
* Thu Aug 3 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-0.2.rc1
- uEFI fixes
- DragonBoard 410c fixes
* Tue Sep 22 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.10-0.5.rc5
- Update to 2020.10 RC5
* Tue Aug 1 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.09-0.1.rc1
- 2017.09 RC1
- Initial patch rebase
* Wed Sep 09 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.10-0.4.rc4
- Update to 2020.10 RC4
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2017.07-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Aug 19 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.10-0.3.rc2
- Enable a number of new Rockchip devices
* Wed Jul 12 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.07-1
- 2017.07
* Mon Aug 10 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.10-0.2.rc2
- Update to 2020.10 RC2
* Thu Jul 6 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.07-0.3.rc3
- 2017.07 RC3
* Tue Jul 28 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.10-0.1.rc1
- 2020.10 RC1
* Tue Jun 20 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.07-0.2.rc2
- 2017.07 RC2
- Enable AllWinner: NanoPi M1+, NanoPi Neo2, SoPine baseboard, OrangePi Zero+2, OrangePi Win
- Enable Rockchips: GeekBox, Sheep
- Dragonboard fixes
- uEFI fixes
* Tue Jul 14 2020 Tom Stellard <tstellar@redhat.com> - 2020.07-2
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Tue Jun 6 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.07-0.1.rc1
- 2017.07 RC1
- Build BananaPi m64, OrangePi pc2, OrangePi Prime with ATF
* Mon Jul 06 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.07-1
- 2020.07 GA
* Mon May 29 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-02
- Add distro-boot support for ClearFog
- Add support for building a chained u-boot for nyan-big
* Tue Jun 23 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.07-0.5.rc5
- 2020.07 RC5
* Tue May 9 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-01
- 2017.05
* Thu Jun 18 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.07-0.4.rc4
- Update various patches to latest upstream
* Wed May 3 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-0.7.rc7
- 2017.05 RC3
* Wed Jun 10 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.07-0.3.rc4
- 2020.07 RC4
- Minor updates and other fixes
* Mon Apr 24 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-0.6.rc2
- Add SPL/ATF support for AllWinner A64 SoCs
- Ship u-boot elf binaries for all aarch64 devices
- Cleanups and spec updates
- Add some more docs/tools
* Tue May 12 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.07-0.2.rc2
- 2020.07 RC2
- Minor device updates
* Mon Apr 17 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-0.5.rc2
- Ship the elf u-boot binaries for aarch64
* Wed Apr 29 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.07-0.1.rc1
- 2020.07 RC1
* Mon Apr 17 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-0.4.rc2
- 2017.05 RC2
* Tue Apr 21 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.04-4
- Initial support for USB on Rasperry Pi 4
* Tue Apr 11 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-0.3.rc1
- Add support for STi STiH410
* Tue Apr 21 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.04-3
- Ship u-boot-rockchip.bin for SPI flash
* Wed Apr 5 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-0.2.rc1
- Build am335x_evm
* Mon Apr 20 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.04-2
- Fix ATF for new aarch64 devices
- Fix Wandboard board detection (rhbz 1825247)
- Fix mSD card on RockPro64
- Enable (inital) Pinebook Pro
* Wed Apr 5 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-0.1.rc1
- 2017.05 RC1
- Enable TinkerBoard and MacchiatoBIN
* Tue Apr 14 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2020.04-1
- 2020.04
* Mon Mar 20 2017 Jon Disnard <parasense@fedoraproject.org> 2017.03-2
- Pass --no-dynamic-linker for linkers newer than 2.26
- Add build dependency on gcc
* Tue Apr 7 2020 Peter Robinson <pbrobinson@fedoraproject.org> 2020.04-0.7-rc5
- 2020.04 RC5
* Mon Mar 13 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.03-1
- 2017.03
* Tue Mar 31 2020 Peter Robinson <pbrobinson@fedoraproject.org> 2020.04-0.6-rc4
- 2020.04 RC4
- Updates for NVIDIA Jetson platforms
- Support RNG for random seed for KASLR on some Rockchip devices
* Mon Mar 6 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.03-0.7.rc3
- Add support for SATA on Cubox-i and Hummingboard
- Add initial Hummingboard 2 (Gate/Edge) support
- Add initial Marvell ESPRESSOBin board support
* Thu Mar 26 2020 Peter Robinson <pbrobinson@fedoraproject.org> 2020.04-0.5-rc3
- Fix ext4 alignment issue seen on some NXP i.MX devices
* Tue Feb 28 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.03-0.6.rc3
- 2017.03 RC3
* Wed Feb 26 2020 Peter Robinson <pbrobinson@fedoraproject.org> 2020.04-0.4-rc3
- 2020.04 RC3
* Wed Feb 15 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.03-0.5.rc2
- Rebase OpenSSL 1.1 patches
* Thu Feb 13 2020 Peter Robinson <pbrobinson@fedoraproject.org> 2020.04-0.3-rc2
- 2020.04 RC2
* Mon Feb 13 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.03-0.4.rc2
- 2017.03 RC2
- Temporarily drop OpenSSL 1.1 patches (need rebase)
- Add fix for UDOO Neo distro boot
* Sun Feb 2 2020 Peter Robinson <pbrobinson@fedoraproject.org> 2020.04-0.2-rc1
- Update genet NIC driver
* Mon Feb 13 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.03-0.3.rc1
- Add patches to fix build against OpenSSL 1.1
* Wed Jan 29 2020 Peter Robinson <pbrobinson@fedoraproject.org> 2020.04-0.1-rc1
- 2020.04 RC1
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2017.03-0.2.rc1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Jan 31 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.03-0.1.rc1
- 2017.03 RC1
* Tue Jan 10 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.01-1
- 2017.01
* Tue Jan 7 2020 Peter Robinson <pbrobinson@fedoraproject.org> 2020.01-1
- 2020.01

View File

@ -1,7 +1,7 @@
From 0e68eb4f6fe96edcde4a39ba6e99ac330529b039 Mon Sep 17 00:00:00 2001
From cc3700b5c65494547308df395fe63166ff48a1e3 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Thu, 5 Oct 2017 08:40:22 +0100
Subject: [PATCH] distro: load FDT from any partition on boot device
Date: Tue, 24 Nov 2020 10:35:48 +0000
Subject: [PATCH 1/2] distro: load FDT from any partition on boot device
In the EFI_LOADER boot path, we were only checking the FAT partition
containing the EFI payload for dtb files. But this is somewhat of a
@ -20,20 +20,19 @@ can load the FDT based on selected kernel version location (which grub
knows) and SoC/board specific ${fdtfile} (which grub does not know).
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
include/config_distro_bootcmd.h | 34 +++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
include/config_distro_bootcmd.h | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 18da4ff737..63c7bbe29c 100644
index ff29ef5a905..769477cd80e 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -126,25 +126,37 @@
"fi\0" \
\
@@ -142,24 +142,37 @@
"load_efi_dtb=" \
- "load ${devtype} ${devnum}:${distro_bootpart} " \
- "${fdt_addr_r} ${prefix}${efi_fdtfile}\0" \
"load ${devtype} ${devnum}:${distro_bootpart} " \
"${fdt_addr_r} ${prefix}${efi_fdtfile}\0" \
+ "load ${devtype} ${devnum}:${dtb_devp} " \
+ "${fdt_addr_r} ${prefix}${efi_fdtfile} && " \
+ "run boot_efi_binary\0" \
@ -50,6 +49,7 @@ index 18da4ff737..63c7bbe29c 100644
- "run load_efi_dtb; " \
- "fi;" \
- "done;" \
- "run boot_efi_bootmgr;" \
+ "part list ${devtype} ${devnum} dtb_devplist; " \
+ "env exists dtb_devplist || setenv dtb_devplist " \
+ "${distro_bootpart}; " \
@ -66,17 +66,17 @@ index 18da4ff737..63c7bbe29c 100644
+ "fi;" \
+ "done; " \
+ "done; " \
+ "run boot_efi_binary\0" \
+ "run boot_efi_bootmgr\0" \
+ "scan_dev_for_efi=" \
"if test -e ${devtype} ${devnum}:${distro_bootpart} " \
"efi/fedora/"BOOTEFI_NAME"; then " \
"efi/boot/"BOOTEFI_NAME"; then " \
"echo Found EFI removable media binary " \
"efi/fedora/"BOOTEFI_NAME"; " \
"efi/boot/"BOOTEFI_NAME"; " \
- "run boot_efi_binary; " \
+ "run scan_dev_for_dtb; " \
"echo EFI LOAD FAILED: continuing...; " \
"fi; " \
"setenv efi_fdtfile\0"
--
2.14.2
2.29.2

View File

@ -1,185 +0,0 @@
From patchwork Sun Oct 8 15:33:08 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] efi_loader: Fix disk dp's for pre-DM/legacy devices
X-Patchwork-Submitter: Rob Clark <robdclark@gmail.com>
X-Patchwork-Id: 823012
Message-Id: <20171008153310.25350-1-robdclark@gmail.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>, =?utf-8?q?Andreas_F=C3=A4rbe?=
=?utf-8?q?r?= <afaerber@suse.de>
Date: Sun, 8 Oct 2017 11:33:08 -0400
From: Rob Clark <robdclark@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
This fixes an issue with OpenBSD's bootloader, and I think should also
fix a similar issue with grub2 on legacy devices. In the legacy case
we were creating disk objects for the partitions, but not also the
parent device.
Reported-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
lib/efi_loader/efi_disk.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index eb9ce772d1..47b487aa30 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -340,6 +340,8 @@ int efi_disk_register(void)
for (i = 0; i < 4; i++) {
struct blk_desc *desc;
char devname[32] = { 0 }; /* dp->str is u16[32] long */
+ disk_partition_t info;
+ int part = 1;
desc = blk_get_devnum_by_type(if_type, i);
if (!desc)
@@ -349,6 +351,15 @@ int efi_disk_register(void)
snprintf(devname, sizeof(devname), "%s%d",
if_typename, i);
+
+ /* add devices for each partition: */
+ while (!part_get_info(desc, part, &info)) {
+ efi_disk_add_dev(devname, if_typename, desc,
+ i, 0, part);
+ part++;
+ }
+
+ /* ... and add block device: */
efi_disk_add_dev(devname, if_typename, desc, i, 0, 0);
disks++;
From patchwork Tue Oct 10 02:55:26 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] efi_loader: search all possible disk partitions
X-Patchwork-Submitter: Jonathan Gray <jsg@jsg.id.au>
X-Patchwork-Id: 823664
X-Patchwork-Delegate: agraf@suse.de
Message-Id: <20171010025526.85329-1-jsg@jsg.id.au>
To: u-boot@lists.denx.de
Date: Tue, 10 Oct 2017 13:55:26 +1100
From: Jonathan Gray <jsg@jsg.id.au>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
When searching for partitions don't stop if a partition is not present
for a given partition number as there may be valid partitions after.
Search for up to MAX_SEARCH_PARTITIONS matching the other callers of
part_get_info().
This allows OpenBSD to boot via the efi_loader on rpi_3 again after
changes made after U-Boot 2017.09. With MBR partitioning OpenBSD will
by default use the fourth partition for the 0xA6 (OpenBSD) partition.
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
---
lib/efi_loader/efi_disk.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index 47b487aa30..6b192701a8 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -254,18 +254,19 @@ static int efi_disk_create_eltorito(struct blk_desc *desc,
#if CONFIG_IS_ENABLED(ISO_PARTITION)
char devname[32] = { 0 }; /* dp->str is u16[32] long */
disk_partition_t info;
- int part = 1;
+ int part;
if (desc->part_type != PART_TYPE_ISO)
return 0;
/* and devices for each partition: */
- while (!part_get_info(desc, part, &info)) {
+ for (part = 1; part <= MAX_SEARCH_PARTITIONS; part++) {
+ if (part_get_info(desc, part, &info))
+ continue;
snprintf(devname, sizeof(devname), "%s:%d", pdevname,
part);
efi_disk_add_dev(devname, if_typename, desc, diskid,
info.start, part);
- part++;
disks++;
}
@@ -299,15 +300,16 @@ int efi_disk_register(void)
struct blk_desc *desc = dev_get_uclass_platdata(dev);
const char *if_typename = dev->driver->name;
disk_partition_t info;
- int part = 1;
+ int part;
printf("Scanning disk %s...\n", dev->name);
/* add devices for each partition: */
- while (!part_get_info(desc, part, &info)) {
+ for (part = 1; part <= MAX_SEARCH_PARTITIONS; part++) {
+ if (part_get_info(desc, part, &info))
+ continue;
efi_disk_add_dev(dev->name, if_typename, desc,
desc->devnum, 0, part);
- part++;
}
/* ... and add block device: */
@@ -341,7 +343,7 @@ int efi_disk_register(void)
struct blk_desc *desc;
char devname[32] = { 0 }; /* dp->str is u16[32] long */
disk_partition_t info;
- int part = 1;
+ int part;
desc = blk_get_devnum_by_type(if_type, i);
if (!desc)
@@ -353,7 +355,9 @@ int efi_disk_register(void)
if_typename, i);
/* add devices for each partition: */
- while (!part_get_info(desc, part, &info)) {
+ for (part = 1; part <= MAX_SEARCH_PARTITIONS; part++) {
+ if (part_get_info(desc, part, &info))
+ continue;
efi_disk_add_dev(devname, if_typename, desc,
i, 0, part);
part++;
From patchwork Tue Oct 10 10:32:29 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] efi_loader: don't increment part twice per loop
X-Patchwork-Submitter: Jonathan Gray <jsg@jsg.id.au>
X-Patchwork-Id: 823787
Message-Id: <20171010103229.71768-1-jsg@jsg.id.au>
To: u-boot@lists.denx.de
Date: Tue, 10 Oct 2017 21:32:29 +1100
From: Jonathan Gray <jsg@jsg.id.au>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
Correct a mistake in the part number handling of
16a73b249d138fedeb188710533902ed7aac1ddc and only increment part once
per loop.
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
---
lib/efi_loader/efi_disk.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index 6b192701a8..e61dbc8058 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -360,7 +360,6 @@ int efi_disk_register(void)
continue;
efi_disk_add_dev(devname, if_typename, desc,
i, 0, part);
- part++;
}
/* ... and add block device: */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +1,50 @@
From 0b10d2ebcaf9244eba57790ede30fed6bc6c4223 Mon Sep 17 00:00:00 2001
From d8fcb72d566b0ebca1613555ac13c0798817487e Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 18 Sep 2017 09:24:37 +0100
Subject: [PATCH] use Fedora specific EFI path/name
Date: Tue, 24 Nov 2020 10:37:28 +0000
Subject: [PATCH 2/2] use Fedora specific EFI path/name
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
include/config_distro_bootcmd.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
include/config_distro_bootcmd.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index e0d0034ed3..18da4ff737 100644
index 769477cd80e..22ce3685758 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -88,7 +88,7 @@
@@ -92,9 +92,9 @@
#ifdef CONFIG_EFI_LOADER
#if defined(CONFIG_ARM64)
-#define BOOTEFI_NAME "bootaa64.efi"
+#define BOOTEFI_NAME "grubaa64.efi"
#elif defined(CONFIG_ARM)
#define BOOTEFI_NAME "bootarm.efi"
#endif
@@ -118,7 +118,7 @@
"bootefi bootmgr ${fdtcontroladdr};" \
"fi;" \
-#define BOOTEFI_NAME "bootarm.efi"
+#define BOOTEFI_NAME "grubarm.efi"
#elif defined(CONFIG_X86_RUN_32BIT)
#define BOOTEFI_NAME "bootia32.efi"
#elif defined(CONFIG_X86_RUN_64BIT)
@@ -132,7 +132,7 @@
\
"boot_efi_binary=" \
"load ${devtype} ${devnum}:${distro_bootpart} " \
- "${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; " \
+ "${kernel_addr_r} efi/fedora/"BOOTEFI_NAME"; " \
"if fdt addr ${fdt_addr_r}; then " \
"bootefi ${kernel_addr_r} ${fdt_addr_r};" \
"else " \
@@ -141,9 +141,9 @@
"fi;" \
"done;" \
"else " \
@@ -169,9 +169,9 @@
"run boot_efi_bootmgr\0" \
"scan_dev_for_efi=" \
"if test -e ${devtype} ${devnum}:${distro_bootpart} " \
- "efi/boot/"BOOTEFI_NAME"; then " \
+ "efi/fedora/"BOOTEFI_NAME"; then " \
+ "efi/fedora/"BOOTEFI_NAME"; then " \
"echo Found EFI removable media binary " \
- "efi/boot/"BOOTEFI_NAME"; " \
+ "efi/fedora/"BOOTEFI_NAME"; " \
"run boot_efi_binary; " \
+ "efi/fedora/"BOOTEFI_NAME"; " \
"run scan_dev_for_dtb; " \
"echo EFI LOAD FAILED: continuing...; " \
"fi; " \
--
2.13.5
2.29.2

View File

@ -1,544 +0,0 @@
From 4a85663ec7eddd955d22f1b0f34a9708eac82314 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Sat, 9 Sep 2017 06:47:39 -0400
Subject: [PATCH 002/105] kbuild: Enable -fshort-wchar
EFI_LOADER really wants UTF-16 strings (ie. %ls and L"string" are 16bit
chars instead of 32bit chars). But rather than enabling -fshort-wchar
conditionally if EFI_LOADER is enabled, it was deemed preferrable to
globally switch.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Makefile b/Makefile
index 8086f3c93e..8250b3409a 100644
--- a/Makefile
+++ b/Makefile
@@ -360,6 +360,7 @@ KBUILD_CPPFLAGS := -D__KERNEL__ -D__UBOOT__
KBUILD_CFLAGS := -Wall -Wstrict-prototypes \
-Wno-format-security \
-fno-builtin -ffreestanding
+KBUILD_CFLAGS += -fshort-wchar
KBUILD_AFLAGS := -D__ASSEMBLY__
# Read UBOOTRELEASE from include/config/uboot.release (if it exists)
--
2.13.5
From 78178bb0c9dfe2a91a636a411291d8bab50e8a7d Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Sat, 9 Sep 2017 06:47:40 -0400
Subject: [PATCH 003/105] lib: add some utf16 handling helpers
We'll eventually want these in a few places in efi_loader, and also
vsprintf.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
include/charset.h | 65 ++++++++++++++++++++++++++++
lib/Makefile | 1 +
lib/charset.c | 101 +++++++++++++++++++++++++++++++++++++++++++
lib/efi_loader/efi_console.c | 17 ++------
4 files changed, 170 insertions(+), 14 deletions(-)
create mode 100644 include/charset.h
create mode 100644 lib/charset.c
diff --git a/include/charset.h b/include/charset.h
new file mode 100644
index 0000000000..39279f746a
--- /dev/null
+++ b/include/charset.h
@@ -0,0 +1,65 @@
+/*
+ * charset conversion utils
+ *
+ * Copyright (c) 2017 Rob Clark
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __CHARSET_H_
+#define __CHARSET_H_
+
+#define MAX_UTF8_PER_UTF16 4
+
+/**
+ * utf16_strlen() - Get the length of an utf16 string
+ *
+ * Returns the number of 16 bit characters in an utf16 string, not
+ * including the terminating NULL character.
+ *
+ * @in the string to measure
+ * @return the string length
+ */
+size_t utf16_strlen(const uint16_t *in);
+
+/**
+ * utf16_strnlen() - Get the length of a fixed-size utf16 string.
+ *
+ * Returns the number of 16 bit characters in an utf16 string,
+ * not including the terminating NULL character, but at most
+ * 'count' number of characters. In doing this, utf16_strnlen()
+ * looks at only the first 'count' characters.
+ *
+ * @in the string to measure
+ * @count the maximum number of characters to count
+ * @return the string length, up to a maximum of 'count'
+ */
+size_t utf16_strnlen(const uint16_t *in, size_t count);
+
+/**
+ * utf16_strcpy() - UTF16 equivalent of strcpy()
+ */
+uint16_t *utf16_strcpy(uint16_t *dest, const uint16_t *src);
+
+/**
+ * utf16_strdup() - UTF16 equivalent of strdup()
+ */
+uint16_t *utf16_strdup(const uint16_t *s);
+
+/**
+ * utf16_to_utf8() - Convert an utf16 string to utf8
+ *
+ * Converts 'size' characters of the utf16 string 'src' to utf8
+ * written to the 'dest' buffer.
+ *
+ * NOTE that a single utf16 character can generate up to 4 utf8
+ * characters. See MAX_UTF8_PER_UTF16.
+ *
+ * @dest the destination buffer to write the utf8 characters
+ * @src the source utf16 string
+ * @size the number of utf16 characters to convert
+ * @return the pointer to the first unwritten byte in 'dest'
+ */
+uint8_t *utf16_to_utf8(uint8_t *dest, const uint16_t *src, size_t size);
+
+#endif /* __CHARSET_H_ */
diff --git a/lib/Makefile b/lib/Makefile
index da6a11aca3..15bba9eac2 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_OF_LIVE) += of_live.o
obj-$(CONFIG_CMD_DHRYSTONE) += dhry/
obj-$(CONFIG_AES) += aes.o
+obj-y += charset.o
obj-$(CONFIG_USB_TTY) += circbuf.o
obj-y += crc7.o
obj-y += crc8.o
diff --git a/lib/charset.c b/lib/charset.c
new file mode 100644
index 0000000000..ff76e88c77
--- /dev/null
+++ b/lib/charset.c
@@ -0,0 +1,101 @@
+/*
+ * charset conversion utils
+ *
+ * Copyright (c) 2017 Rob Clark
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <charset.h>
+#include <malloc.h>
+
+/*
+ * utf8/utf16 conversion mostly lifted from grub
+ */
+
+size_t utf16_strlen(const uint16_t *in)
+{
+ size_t i;
+ for (i = 0; in[i]; i++);
+ return i;
+}
+
+size_t utf16_strnlen(const uint16_t *in, size_t count)
+{
+ size_t i;
+ for (i = 0; count-- && in[i]; i++);
+ return i;
+}
+
+uint16_t *utf16_strcpy(uint16_t *dest, const uint16_t *src)
+{
+ uint16_t *tmp = dest;
+
+ while ((*dest++ = *src++) != '\0')
+ /* nothing */;
+ return tmp;
+
+}
+
+uint16_t *utf16_strdup(const uint16_t *s)
+{
+ uint16_t *new;
+ if (!s || !(new = malloc((utf16_strlen(s) + 1) * 2)))
+ return NULL;
+ utf16_strcpy(new, s);
+ return new;
+}
+
+/* Convert UTF-16 to UTF-8. */
+uint8_t *utf16_to_utf8(uint8_t *dest, const uint16_t *src, size_t size)
+{
+ uint32_t code_high = 0;
+
+ while (size--) {
+ uint32_t code = *src++;
+
+ if (code_high) {
+ if (code >= 0xDC00 && code <= 0xDFFF) {
+ /* Surrogate pair. */
+ code = ((code_high - 0xD800) << 10) + (code - 0xDC00) + 0x10000;
+
+ *dest++ = (code >> 18) | 0xF0;
+ *dest++ = ((code >> 12) & 0x3F) | 0x80;
+ *dest++ = ((code >> 6) & 0x3F) | 0x80;
+ *dest++ = (code & 0x3F) | 0x80;
+ } else {
+ /* Error... */
+ *dest++ = '?';
+ /* *src may be valid. Don't eat it. */
+ src--;
+ }
+
+ code_high = 0;
+ } else {
+ if (code <= 0x007F) {
+ *dest++ = code;
+ } else if (code <= 0x07FF) {
+ *dest++ = (code >> 6) | 0xC0;
+ *dest++ = (code & 0x3F) | 0x80;
+ } else if (code >= 0xD800 && code <= 0xDBFF) {
+ code_high = code;
+ continue;
+ } else if (code >= 0xDC00 && code <= 0xDFFF) {
+ /* Error... */
+ *dest++ = '?';
+ } else if (code < 0x10000) {
+ *dest++ = (code >> 12) | 0xE0;
+ *dest++ = ((code >> 6) & 0x3F) | 0x80;
+ *dest++ = (code & 0x3F) | 0x80;
+ } else {
+ *dest++ = (code >> 18) | 0xF0;
+ *dest++ = ((code >> 12) & 0x3F) | 0x80;
+ *dest++ = ((code >> 6) & 0x3F) | 0x80;
+ *dest++ = (code & 0x3F) | 0x80;
+ }
+ }
+ }
+
+ return dest;
+}
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 5ebce4b544..3fc82b8726 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <charset.h>
#include <efi_loader.h>
static bool console_size_queried;
@@ -138,20 +139,8 @@ static efi_status_t EFIAPI efi_cout_reset(
static void print_unicode_in_utf8(u16 c)
{
- char utf8[4] = { 0 };
- char *b = utf8;
-
- if (c < 0x80) {
- *(b++) = c;
- } else if (c < 0x800) {
- *(b++) = 192 + c / 64;
- *(b++) = 128 + c % 64;
- } else {
- *(b++) = 224 + c / 4096;
- *(b++) = 128 + c / 64 % 64;
- *(b++) = 128 + c % 64;
- }
-
+ char utf8[MAX_UTF8_PER_UTF16] = { 0 };
+ utf16_to_utf8((u8 *)utf8, &c, 1);
puts(utf8);
}
--
2.13.5
From 274325c50951dd16ad2a6f45e79dc062ad47011b Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Sat, 9 Sep 2017 06:47:41 -0400
Subject: [PATCH 004/105] vsprintf.c: add UTF-16 string (%ls) support
This is convenient for efi_loader which deals a lot with UTF-16. Only
enabled with CC_SHORT_WCHAR, leaving room to add a UTF-32 version when
CC_SHORT_WCHAR is not enabled.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
examples/api/Makefile | 1 +
lib/vsprintf.c | 30 ++++++++++++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/examples/api/Makefile b/examples/api/Makefile
index dab6398bab..87c15d0f68 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -34,6 +34,7 @@ EXT_COBJ-y += lib/div64.o
EXT_COBJ-y += lib/string.o
EXT_COBJ-y += lib/time.o
EXT_COBJ-y += lib/vsprintf.o
+EXT_COBJ-y += lib/charset.o
EXT_SOBJ-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o
ifeq ($(ARCH),arm)
EXT_SOBJ-$(CONFIG_USE_ARCH_MEMSET) += arch/arm/lib/memset.o
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 874a2951f7..97bed9d36d 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -17,6 +17,7 @@
#include <linux/ctype.h>
#include <common.h>
+#include <charset.h>
#include <div64.h>
#define noinline __attribute__((noinline))
@@ -270,6 +271,26 @@ static char *string(char *buf, char *end, char *s, int field_width,
return buf;
}
+static char *string16(char *buf, char *end, u16 *s, int field_width,
+ int precision, int flags)
+{
+ u16 *str = s ? s : L"<NULL>";
+ int utf16_len = utf16_strnlen(str, precision);
+ u8 utf8[utf16_len * MAX_UTF8_PER_UTF16];
+ int utf8_len, i;
+
+ utf8_len = utf16_to_utf8(utf8, str, utf16_len) - utf8;
+
+ if (!(flags & LEFT))
+ while (utf8_len < field_width--)
+ ADDCH(buf, ' ');
+ for (i = 0; i < utf8_len; ++i)
+ ADDCH(buf, utf8[i]);
+ while (utf8_len < field_width--)
+ ADDCH(buf, ' ');
+ return buf;
+}
+
#ifdef CONFIG_CMD_NET
static const char hex_asc[] = "0123456789abcdef";
#define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
@@ -528,8 +549,13 @@ repeat:
continue;
case 's':
- str = string(str, end, va_arg(args, char *),
- field_width, precision, flags);
+ if (qualifier == 'l' && !IS_ENABLED(CONFIG_SPL_BUILD)) {
+ str = string16(str, end, va_arg(args, u16 *),
+ field_width, precision, flags);
+ } else {
+ str = string(str, end, va_arg(args, char *),
+ field_width, precision, flags);
+ }
continue;
case 'p':
--
2.13.5
From 22ada0c8e6d50281af72176eecdfc356c794639c Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Sat, 9 Sep 2017 06:47:42 -0400
Subject: [PATCH 005/105] vsprintf.c: add GUID printing
This works (roughly) the same way as linux's, but we currently always
print lower-case (ie. we just keep %pUB and %pUL for compat with linux),
mostly just because that is what uuid_bin_to_str() supports.
%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
It will be used by a later efi_loader paths for efi variables and for
device-path-to-text protocol, and also quite useful for debug prints
of protocol GUIDs.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
examples/api/Makefile | 1 +
include/config_fallbacks.h | 1 +
lib/vsprintf.c | 46 ++++++++++++++++++++++++++++++++++++++++++++--
3 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/examples/api/Makefile b/examples/api/Makefile
index 87c15d0f68..899527267d 100644
--- a/examples/api/Makefile
+++ b/examples/api/Makefile
@@ -35,6 +35,7 @@ EXT_COBJ-y += lib/string.o
EXT_COBJ-y += lib/time.o
EXT_COBJ-y += lib/vsprintf.o
EXT_COBJ-y += lib/charset.o
+EXT_COBJ-$(CONFIG_LIB_UUID) += lib/uuid.o
EXT_SOBJ-$(CONFIG_PPC) += arch/powerpc/lib/ppcstring.o
ifeq ($(ARCH),arm)
EXT_SOBJ-$(CONFIG_USE_ARCH_MEMSET) += arch/arm/lib/memset.o
diff --git a/include/config_fallbacks.h b/include/config_fallbacks.h
index 46b7a2a6f2..2c4d43d672 100644
--- a/include/config_fallbacks.h
+++ b/include/config_fallbacks.h
@@ -58,6 +58,7 @@
#if (CONFIG_IS_ENABLED(PARTITION_UUIDS) || \
CONFIG_IS_ENABLED(EFI_PARTITION) || \
+ CONFIG_IS_ENABLED(EFI_LOADER) || \
defined(CONFIG_RANDOM_UUID) || \
defined(CONFIG_CMD_UUID) || \
defined(CONFIG_BOOTP_PXE)) && \
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 97bed9d36d..dd572d2868 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -18,6 +18,7 @@
#include <common.h>
#include <charset.h>
+#include <uuid.h>
#include <div64.h>
#define noinline __attribute__((noinline))
@@ -366,6 +367,40 @@ static char *ip4_addr_string(char *buf, char *end, u8 *addr, int field_width,
}
#endif
+#ifdef CONFIG_LIB_UUID
+/*
+ * This works (roughly) the same way as linux's, but we currently always
+ * print lower-case (ie. we just keep %pUB and %pUL for compat with linux),
+ * mostly just because that is what uuid_bin_to_str() supports.
+ *
+ * %pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
+ * %pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
+ */
+static char *uuid_string(char *buf, char *end, u8 *addr, int field_width,
+ int precision, int flags, const char *fmt)
+{
+ char uuid[UUID_STR_LEN + 1];
+ int str_format = UUID_STR_FORMAT_STD;
+
+ switch (*(++fmt)) {
+ case 'L':
+ case 'l':
+ str_format = UUID_STR_FORMAT_GUID;
+ break;
+ case 'B':
+ case 'b':
+ /* this is the default */
+ break;
+ default:
+ break;
+ }
+
+ uuid_bin_to_str(addr, uuid, str_format);
+
+ return string(buf, end, uuid, field_width, precision, flags);
+}
+#endif
+
/*
* Show a '%p' thing. A kernel extension is that the '%p' is followed
* by an extra set of alphanumeric characters that are extended format
@@ -399,8 +434,8 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
flags);
#endif
-#ifdef CONFIG_CMD_NET
switch (*fmt) {
+#ifdef CONFIG_CMD_NET
case 'a':
flags |= SPECIAL | ZEROPAD;
@@ -430,8 +465,15 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr,
precision, flags);
flags &= ~SPECIAL;
break;
- }
#endif
+#ifdef CONFIG_LIB_UUID
+ case 'U':
+ return uuid_string(buf, end, ptr, field_width, precision,
+ flags, fmt);
+#endif
+ default:
+ break;
+ }
flags |= SMALL;
if (field_width == -1) {
field_width = 2*sizeof(void *);
--
2.13.5
From 7e3e20560784b048ff19e90cd36b6680626b1ab3 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Sat, 9 Sep 2017 06:47:43 -0400
Subject: [PATCH 006/105] examples: add fallback memcpy
Solves build issue:
Building current source for 134 boards (12 threads, 1 job per thread)
arm: + lsxhl
+examples/api/vsprintf.o: In function `string16':
+lib/vsprintf.c:278: undefined reference to `memcpy'
+examples/api/uuid.o: In function `uuid_bin_to_str':
+lib/uuid.c:197: undefined reference to `memcpy'
+lib/uuid.c:199: undefined reference to `memcpy'
+make[3]: *** [examples/api/demo] Error 1
+make[2]: *** [examples/api] Error 2
+make[1]: *** [examples] Error 2
+make: *** [sub-make] Error 2
133 0 1 /134 sheevaplug
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
examples/api/glue.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/examples/api/glue.c b/examples/api/glue.c
index 8aabf32c89..575c1e55f3 100644
--- a/examples/api/glue.c
+++ b/examples/api/glue.c
@@ -416,3 +416,15 @@ void ub_display_clear(void)
{
syscall(API_DISPLAY_CLEAR, NULL);
}
+
+__weak void *memcpy(void *dest, const void *src, size_t size)
+{
+ unsigned char *dptr = dest;
+ const unsigned char *ptr = src;
+ const unsigned char *end = src + size;
+
+ while (ptr < end)
+ *dptr++ = *ptr++;
+
+ return dest;
+}
--
2.13.5

View File

@ -1,43 +1,19 @@
From patchwork Wed Sep 27 01:19:37 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] usb: kbd: Don't fail with iomux
X-Patchwork-Submitter: Rob Clark <robdclark@gmail.com>
X-Patchwork-Id: 818881
X-Patchwork-Delegate: marek.vasut@gmail.com
Message-Id: <20170927011939.6610-1-robdclark@gmail.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Date: Tue, 26 Sep 2017 21:19:37 -0400
From: Rob Clark <robdclark@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
From a49845f198af088c4e5e0019edbf519344d78c97 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Tue, 4 Dec 2018 15:29:14 +0000
Subject: [PATCH] usb kbd fixes
stdin might not be set, which would cause iomux_doenv() to fail
therefore causing probe_usb_keyboard() to fail. Furthermore if we do
have iomux enabled, the sensible thing (in terms of user experience)
would be to simply add ourselves to the list of stdin devices.
This fixes an issue with usbkbd on dragonboard410c with distro-
bootcmd, where stdin is not set (so stdinname is null).
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
Somehow this patch was dropped on the floor. I don't remember
which version # this is up to, search the list if you care. But
this is the latest. I only noticed it was missing because u-boot
crashes when you boot with usb-keyboard plugged in (at least on
db410c) without it. So someone please apply this patch before it
gets lost again.
common/usb_kbd.c | 46 +++++++++++++++++++++++++++++++---------------
common/usb_kbd.c | 66 +++++++++++++++++++++++++++++++++++------------
include/console.h | 2 --
2 files changed, 31 insertions(+), 17 deletions(-)
2 files changed, 50 insertions(+), 18 deletions(-)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index a323d72a36..4c3ad95fca 100644
index 020f0d4117f..47674ce4458 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -516,23 +516,39 @@ static int probe_usb_keyboard(struct usb_device *dev)
@@ -518,25 +518,59 @@ static int probe_usb_keyboard(struct usb_device *dev)
return error;
stdinname = env_get("stdin");
@ -68,18 +44,22 @@ index a323d72a36..4c3ad95fca 100644
+ error = iomux_doenv(stdin, stdinname);
+ free(newstdin);
+ if (error)
+ return error;
+ goto unregister_stdio;
+ } else {
+ /* Check if this is the standard input device. */
+ if (strcmp(stdinname, DEVNAME))
+ return 1;
+ if (strcmp(stdinname, DEVNAME)) {
+ error = -1;
+ goto unregister_stdio;
+ }
- /* Reassign the console */
- if (overwrite_console())
- return 1;
+ /* Reassign the console */
+ if (overwrite_console())
+ return 1;
+ if (overwrite_console()) {
+ error = -1;
+ goto unregister_stdio;
+ }
- error = console_assign(stdin, DEVNAME);
- if (error)
@ -87,85 +67,11 @@ index a323d72a36..4c3ad95fca 100644
-#endif
+ error = console_assign(stdin, DEVNAME);
+ if (error)
+ return error;
+ goto unregister_stdio;
+ }
return 0;
}
diff --git a/include/console.h b/include/console.h
index cea29ed6dc..7dfd36d7d1 100644
--- a/include/console.h
+++ b/include/console.h
@@ -57,8 +57,6 @@ int console_announce_r(void);
/*
* CONSOLE multiplexing.
*/
-#ifdef CONFIG_CONSOLE_MUX
#include <iomux.h>
-#endif
#endif
From patchwork Tue Oct 3 17:31:14 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] usb: kbd: Fix dangling pointers on probe fail
X-Patchwork-Submitter: Rob Clark <robdclark@gmail.com>
X-Patchwork-Id: 820970
Message-Id: <20171003173118.32645-1-robdclark@gmail.com>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Date: Tue, 3 Oct 2017 13:31:14 -0400
From: Rob Clark <robdclark@gmail.com>
List-Id: U-Boot discussion <u-boot.lists.denx.de>
If probe fails, we should unregister the stdio device, else we leave
dangling pointers to the parent 'struct usb_device'.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
I finally got around to debugging why things explode so badly without
fixing usb_kbd vs. iomux[1] (which this patch applies on top of).
[1] https://patchwork.ozlabs.org/patch/818881/
common/usb_kbd.c | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 4c3ad95fca..82ad93f6ca 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -535,22 +535,40 @@ static int probe_usb_keyboard(struct usb_device *dev)
error = iomux_doenv(stdin, stdinname);
free(newstdin);
if (error)
- return error;
+ goto unregister_stdio;
} else {
/* Check if this is the standard input device. */
- if (strcmp(stdinname, DEVNAME))
- return 1;
+ if (strcmp(stdinname, DEVNAME)) {
+ error = -1;
+ goto unregister_stdio;
+ }
/* Reassign the console */
- if (overwrite_console())
- return 1;
+ if (overwrite_console()) {
+ error = -1;
+ goto unregister_stdio;
+ }
error = console_assign(stdin, DEVNAME);
if (error)
- return error;
+ goto unregister_stdio;
}
return 0;
+
+ return 0;
+unregister_stdio:
+ /*
+ * If probe fails, the device will be removed.. leaving dangling
@ -177,8 +83,33 @@ index 4c3ad95fca..82ad93f6ca 100644
+ stdio_deregister(DEVNAME, 1);
+ return error;
+#else
+ return 0;
return 0;
+#endif
}
#ifndef CONFIG_DM_USB
#if !CONFIG_IS_ENABLED(DM_USB)
@@ -642,7 +676,7 @@ static int usb_kbd_remove(struct udevice *dev)
return 0;
err:
- printf("%s: warning, ret=%d", __func__, ret);
+ printf("%s: warning, ret=%d\n", __func__, ret);
return ret;
}
diff --git a/include/console.h b/include/console.h
index e935c601f12..6382ec8e0d6 100644
--- a/include/console.h
+++ b/include/console.h
@@ -56,8 +56,6 @@ int console_announce_r(void);
/*
* CONSOLE multiplexing.
*/
-#ifdef CONFIG_CONSOLE_MUX
#include <iomux.h>
-#endif
#endif
--
2.19.2