From 6901278ef0312344b96a79e68ac77bb831e35eca Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Thu, 6 Feb 2020 21:45:40 +0800 Subject: [PATCH] kernel: bump to 4.14.169, 4.19.101 (#2963) * kernel: bump to 4.14.169, 4.19.101 * uboot: update to latest * mediatek: bump to v4.19 * ath79: switch to wpad * Revert 'grub2: update to latest' --- include/kernel-version.mk | 8 +- include/u-boot.mk | 2 +- include/version.mk | 9 +- package/base-files/files/bin/config_generate | 8 +- package/base-files/files/usr/lib/os-release | 16 +- package/base-files/image-config.in | 2 +- package/boot/apex/Makefile | 62 - .../boot/apex/patches/001-compile_fix.patch | 20 - .../100-openwrt_nslu2_armeb_config.patch | 23 - .../120-openwrt_nslu2_16mb_armeb_config.patch | 23 - .../140-openwrt_fsg3_armeb_config.patch | 23 - .../apex/patches/150-limit_ram_to_64mb.patch | 22 - .../160-openwrt_nas100d_armeb_config.patch | 20 - .../boot/arm-trusted-firmware-mvebu/Makefile | 112 ++ .../boot/arm-trusted-firmware-sunxi/Makefile | 12 +- package/boot/at91bootstrap/Makefile | 51 +- package/boot/fconfig/Makefile | 7 - package/boot/grub2/common.mk | 10 +- ...ix-packed-not-aligned-error-on-GCC-8.patch | 71 - ...-verifiers-Blocklist-fallout-cleanup.patch | 31 + .../grub2/patches/100-grub_setup_root.patch | 12 +- ...-disable-gettext-check-macro-version.patch | 13 - .../grub2/patches/200-fix-gets-removal.patch | 16 - .../grub2/patches/300-CVE-2015-8370.patch | 4 +- .../grub2/patches/400-R_X86_64_PLT32.patch | 75 - package/boot/kexec-tools/Makefile | 3 +- package/boot/kexec-tools/files/kdump.init | 2 +- package/boot/rbcfg/Makefile | 2 +- package/boot/tfa-layerscape/Makefile | 161 ++ .../patches/001-fiptool-hostbuild-fixes.patch | 71 + ...ix-a-makefile-bug-that-will-use-defa.patch | 30 + ...ix-create_pbl-and-byte_swap-host-bui.patch | 60 + .../patches/023-musl-compat.patch | 13 + package/boot/uboot-at91/Makefile | 51 +- .../patches/001-fix-Wformat-security.patch | 13 + package/boot/uboot-envtools/Makefile | 8 +- package/boot/uboot-envtools/files/ar71xx | 5 + package/boot/uboot-envtools/files/ath79 | 31 +- package/boot/uboot-envtools/files/imx6 | 4 +- package/boot/uboot-envtools/files/mvebu | 3 + package/boot/uboot-envtools/files/ramips | 18 +- .../uboot-envtools/files/uboot-envtools.sh | 2 +- .../uboot-envtools/patches/001-compile.patch | 6 +- package/boot/uboot-fritz4040/Makefile | 39 +- package/boot/uboot-imx6/Makefile | 11 +- ...s-Make-the-boot-process-more-generic.patch | 123 ++ .../patches/100-wandboard-enable-fit.patch | 6 +- .../patches/110-mx6cuboxi-mmc-fallback.patch | 10 +- package/boot/uboot-kirkwood/Makefile | 4 +- .../patches/007-nsa310-uboot-generic.patch | 15 +- .../patches/008-nsa325-uboot-generic.patch | 26 +- .../patches/010-pogoplug_v4.patch | 23 +- .../uboot-kirkwood/patches/110-dockstar.patch | 10 +- .../uboot-kirkwood/patches/120-iconnect.patch | 7 +- .../uboot-kirkwood/patches/130-ib62x0.patch | 8 +- .../patches/140-pogoplug_e02.patch | 8 +- .../patches/150-goflexhome.patch | 8 +- .../patches/200-openwrt-config.patch | 54 +- .../boot/uboot-layerscape-armv8_32b/Makefile | 84 - package/boot/uboot-layerscape/Makefile | 30 +- .../files/ls1012ardb-uEnv.txt | 2 +- .../files/ls1043ardb-uEnv.txt | 2 +- .../files/ls1046ardb-uEnv.txt | 2 +- .../files/ls1088ardb-uEnv.txt | 2 +- .../files/ls2088ardb-uEnv.txt | 2 +- ...I_NOR_BOOTCOMMAND-of-ls1046ardb-for-.patch | 28 + ...I_NOR_BOOTCOMMAND-of-ls1012afrwy-for.patch | 28 + ...I_NOR_BOOTCOMMAND-of-ls1012ardb-for-.patch | 28 + package/boot/uboot-mvebu/Makefile | 17 +- ...add_support_for_macronix_mx25u12835f.patch | 10 + ...mada-37xx.h_increase_max_gunzip_size.patch | 13 + package/boot/uboot-mxs/Makefile | 4 +- .../patches/001-add-i2se-duckbill.patch | 52 +- package/boot/uboot-omap/Makefile | 29 +- package/boot/uboot-omap/files/boot.scr.txt | 9 + .../boot/uboot-omap/files/uEnv-default.txt | 8 - .../patches/101-disable-thumb-omap3.patch | 14 - .../uboot-omap/patches/102-minify-spl.patch | 44 - .../patches/103-disable-fat-write-spl.patch | 27 - .../104-omap3-overo-enable-thumb.patch | 18 - ...6550-bugfix-ns16550-fifo-not-enabled.patch | 309 --- .../boot/uboot-oxnas/src/tools/mkox820crc.c | 3 + package/boot/uboot-sunxi/Makefile | 99 +- .../003-add-theobroma-a31-pangolin.patch | 12 +- .../patches/062-A20-improve-gmac-upload.patch | 8 +- .../063-fix-lime2-revK-add-micrel-PHY.patch | 44 + .../100-sun6i-alternate-on-UART2.patch | 2 +- .../101-sun6i-support-console-on-UART2.patch | 4 +- ...2-sunxi-make_CONS_INDEX-configurable.patch | 2 +- ...-environment-for-dtc-binary-location.patch | 2 +- .../patches/210-sunxi-deactivate-binman.patch | 4 +- .../patches/221-compatible-old-dtc.patch | 2 +- .../230-disable-axp209-on-a13-olinuxino.diff | 19 + ...ge-Pi-Zero-Plus-Fix-SdCard-detection.patch | 28 + .../250-Sinovoip-BPI-M2-Ultra-defconfig.patch | 25 + ...Sync-OTG-and-HCI-nodes-from-Linux-DT.patch | 63 - ...0-sunxi-Add-support-for-Orange-Pi-R1.patch | 179 -- .../400-ARM-dts-orange-pi-zero-plus.patch | 222 --- package/boot/uboot-xburst/Makefile | 88 - .../0001-qi_lb60-add-nand-spl-support.patch | 894 --------- ...qi_lb60-add-software-usbboot-support.patch | 916 --------- .../patches/0003-add-mmc-support.patch | 1664 ----------------- ...dd-more-boot-options-F1-F2-F3-F4-M-S.patch | 200 -- .../0005-add-nanonote-lcd-support.patch | 847 --------- .../patches/0006-enable-silent-console.patch | 60 - package/boot/uboot-zynq/Makefile | 4 +- ...q-dts-add-spi-flash-node-to-zedboard.patch | 38 - ...nq-add-support-for-the-zybo-z7-board.patch | 499 ----- ...ad-mac-address-from-SPI-flash-memory.patch | 50 +- .../patches/210-link-libcrypto-static.patch | 6 +- package/boot/yamonenv/Makefile | 41 - .../patches/001-yamonenv_mtd_partition.patch | 11 - package/kernel/linux/modules/hwmon.mk | 15 + scripts/download.pl | 18 +- scripts/json_add_image_info.py | 1179 +----------- ...-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch | 39 - ...-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch | 39 - ...0v2.dts => ar7161_netgear_wndr3700-v2.dts} | 4 +- .../ath79/dts/qca9531_comfast_cf-e560ac.dts | 174 ++ .../generic/base-files/etc/board.d/01_leds | 7 + .../generic/base-files/etc/board.d/02_network | 17 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 4 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 7 + target/linux/ath79/generic/target.mk | 2 +- target/linux/ath79/image/generic.mk | 18 +- target/linux/ath79/nand/target.mk | 2 +- .../910-unaligned_access_hacks.patch | 2 +- ...ct-JEDEC-incompatible-w25q128-using-.patch | 2 +- ...ct-JEDEC-incompatible-w25q128-using-.patch | 2 +- .../209-b44-register-adm-switch.patch | 6 +- .../patches-4.19/210-b44_phy_fix.patch | 2 +- .../patches-4.19/831-old_gpio_wdt.patch | 2 +- ...p-unused-and-broken-DSP-platform-dev.patch | 203 -- ...p-unused-and-broken-DSP-platform-dev.patch | 203 -- ...ow_offload-handle-netdevice-events-f.patch | 4 +- ...-helper-for-MACs-which-support-asym-.patch | 2 +- ...-helper-for-set_pauseparam-for-Asym-.patch | 2 +- ...t-phy-Stop-with-excessive-soft-reset.patch | 2 +- ...-net-phy-add-core-phylib-sfp-support.patch | 6 +- ...-matching-all-ones-clause-45-PHY-IDs.patch | 4 +- ...etfilter-connmark-introduce-savedscp.patch | 100 - ...lter-connmark-introduce-set-dscpmark.patch | 124 ++ .../702-phy_add_aneg_done_function.patch | 2 +- .../661-use_fq_codel_by_default.patch | 4 +- .../702-phy_add_aneg_done_function.patch | 2 +- ...r-add-support-for-Gigadevice-GD25D05.patch | 29 + .../pending-4.14/630-packet_socket_type.patch | 16 +- ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 14 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 2 +- ...detach-callback-to-struct-phy_driver.patch | 2 +- ...r-add-support-for-Gigadevice-GD25D05.patch | 29 + .../pending-4.19/630-packet_socket_type.patch | 16 +- ...w_table-add-hardware-offload-support.patch | 14 +- ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 14 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 +- ...detach-callback-to-struct-phy_driver.patch | 2 +- ...or-enable-4B-opcodes-for-mx25l25635f.patch | 8 +- ...or-enable-4B-opcodes-for-mx25l25635f.patch | 8 +- ...rt-adjusting-OPP-voltages-at-runtime.patch | 2 +- ...e-voltage-tolerance-when-adjusting-t.patch | 4 +- .../202-core-linux-support-layerscape.patch | 42 +- .../811-clock-support-layerscape.patch | 2 +- .../812-flexspi-support-layerscape.patch | 4 +- .../820-sec-support-layerscape.patch | 2 +- target/linux/mediatek/Makefile | 2 +- .../arch/arm64/boot/dts/mediatek/mt7622.dtsi | 11 + .../mediatek/image/gen_mt7623_emmc_img.sh | 2 +- target/linux/mediatek/image/mt7622.mk | 14 +- target/linux/mediatek/image/mt7623.mk | 14 +- target/linux/mediatek/image/mt7629.mk | 1 - .../mt7622/base-files/etc/board.d/02_network | 29 + .../mt7622/base-files/lib/upgrade/platform.sh | 26 + .../base-files/etc/board.d/02_network | 13 +- .../base-files/lib/preinit/07_set_iface_mac | 2 +- .../base-files/lib/preinit/79_move_config | 0 .../base-files/lib/upgrade/platform.sh | 40 +- target/linux/mediatek/mt7623/config-4.19 | 515 +++++ target/linux/mediatek/mt7629/target.mk | 1 - .../patches-4.14/0052-net-phy-add-FC.patch | 2 +- .../mediatek/patches-4.14/0064-dts.patch | 462 ----- ...ediatek-add-support-of-mt2701-mt2712.patch | 20 +- ...e-hs400_tune_response-only-for-mt817.patch | 8 +- ...3-mmc-mediatek-add-pad_tune0-support.patch | 38 +- ...add-async-fifo-and-data-tune-support.patch | 24 +- ...-mmc-mediatek-add-busy_check-support.patch | 12 +- ...-stop_clk-fix-and-enhance_rx-support.patch | 26 +- ...iatek-add-support-of-source_cg-clock.patch | 12 +- ...58-mmc-mediatek-add-latch-ck-support.patch | 6 +- ...rove-eMMC-hs400-mode-read-performanc.patch | 10 +- ...fer-to-use-rise-edge-latching-for-cm.patch | 2 +- ...9-thermal-mtk-Cleanup-unused-defines.patch | 2 +- ...-mediatek-add-support-for-MT7622-SoC.patch | 2 +- ...-mediatek-add-support-for-MT7622-SoC.patch | 2 +- .../0227-arm-dts-Add-Unielec-U7623-DTS.patch | 12 +- .../0002-eth-fix-dsa-support.patch | 34 + .../0227-arm-dts-Add-Unielec-U7623-DTS.patch | 8 +- .../0228-arm-dts-bpir2-fix-console.patch | 10 + ...or-support-mtd-name-from-device-tree.patch | 4 +- ...d-spi-nor-add-w25q256-3b-mode-switch.patch | 10 +- ...spi-nor-w25q256-respect-default-mode.patch | 2 +- ...or-enable-4B-opcodes-for-mx25l25635f.patch | 8 +- ...s-allwinner-A64-Restore-EMAC-changes.patch | 2 +- ...ner-add-snps-dwmac-mdio-compatible-t.patch | 2 +- ...arm64-dts-allwinner-a64-Add-watchdog.patch | 2 +- ...80-arm64-allwinner-a64-add-SPI-nodes.patch | 4 +- 205 files changed, 2683 insertions(+), 9417 deletions(-) delete mode 100644 package/boot/apex/Makefile delete mode 100644 package/boot/apex/patches/001-compile_fix.patch delete mode 100644 package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch delete mode 100644 package/boot/apex/patches/120-openwrt_nslu2_16mb_armeb_config.patch delete mode 100644 package/boot/apex/patches/140-openwrt_fsg3_armeb_config.patch delete mode 100644 package/boot/apex/patches/150-limit_ram_to_64mb.patch delete mode 100644 package/boot/apex/patches/160-openwrt_nas100d_armeb_config.patch create mode 100644 package/boot/arm-trusted-firmware-mvebu/Makefile delete mode 100644 package/boot/grub2/patches/0008-Fix-packed-not-aligned-error-on-GCC-8.patch create mode 100644 package/boot/grub2/patches/001-verifiers-Blocklist-fallout-cleanup.patch delete mode 100644 package/boot/grub2/patches/101-disable-gettext-check-macro-version.patch delete mode 100644 package/boot/grub2/patches/200-fix-gets-removal.patch delete mode 100644 package/boot/grub2/patches/400-R_X86_64_PLT32.patch create mode 100644 package/boot/tfa-layerscape/Makefile create mode 100644 package/boot/tfa-layerscape/patches/001-fiptool-hostbuild-fixes.patch create mode 100644 package/boot/tfa-layerscape/patches/002-plat-nxp-tools-fix-a-makefile-bug-that-will-use-defa.patch create mode 100644 package/boot/tfa-layerscape/patches/003-plat-nxp-tools-fix-create_pbl-and-byte_swap-host-bui.patch create mode 100644 package/boot/uboot-ar71xx/patches/023-musl-compat.patch create mode 100644 package/boot/uboot-at91/patches/001-fix-Wformat-security.patch create mode 100644 package/boot/uboot-imx6/patches/0001-imx6-apalis-Make-the-boot-process-more-generic.patch delete mode 100644 package/boot/uboot-layerscape-armv8_32b/Makefile create mode 100644 package/boot/uboot-layerscape/patches/0001-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1046ardb-for-.patch create mode 100644 package/boot/uboot-layerscape/patches/0002-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1012afrwy-for.patch create mode 100644 package/boot/uboot-layerscape/patches/0003-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1012ardb-for-.patch create mode 100644 package/boot/uboot-mvebu/patches/100-add_support_for_macronix_mx25u12835f.patch create mode 100644 package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch create mode 100644 package/boot/uboot-omap/files/boot.scr.txt delete mode 100644 package/boot/uboot-omap/files/uEnv-default.txt delete mode 100644 package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch delete mode 100644 package/boot/uboot-omap/patches/102-minify-spl.patch delete mode 100644 package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch delete mode 100644 package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch delete mode 100644 package/boot/uboot-omap/patches/105-serial-ns16550-bugfix-ns16550-fifo-not-enabled.patch create mode 100644 package/boot/uboot-sunxi/patches/063-fix-lime2-revK-add-micrel-PHY.patch create mode 100644 package/boot/uboot-sunxi/patches/230-disable-axp209-on-a13-olinuxino.diff create mode 100644 package/boot/uboot-sunxi/patches/240-sun50i-h5-Orange-Pi-Zero-Plus-Fix-SdCard-detection.patch create mode 100644 package/boot/uboot-sunxi/patches/250-Sinovoip-BPI-M2-Ultra-defconfig.patch delete mode 100644 package/boot/uboot-sunxi/patches/310-sunxi-h3-Sync-OTG-and-HCI-nodes-from-Linux-DT.patch delete mode 100644 package/boot/uboot-sunxi/patches/320-sunxi-Add-support-for-Orange-Pi-R1.patch delete mode 100644 package/boot/uboot-sunxi/patches/400-ARM-dts-orange-pi-zero-plus.patch delete mode 100644 package/boot/uboot-xburst/Makefile delete mode 100644 package/boot/uboot-xburst/patches/0001-qi_lb60-add-nand-spl-support.patch delete mode 100644 package/boot/uboot-xburst/patches/0002-qi_lb60-add-software-usbboot-support.patch delete mode 100644 package/boot/uboot-xburst/patches/0003-add-mmc-support.patch delete mode 100644 package/boot/uboot-xburst/patches/0004-add-more-boot-options-F1-F2-F3-F4-M-S.patch delete mode 100644 package/boot/uboot-xburst/patches/0005-add-nanonote-lcd-support.patch delete mode 100644 package/boot/uboot-xburst/patches/0006-enable-silent-console.patch delete mode 100644 package/boot/uboot-zynq/patches/020-v2018.09-arm-zynq-dts-add-spi-flash-node-to-zedboard.patch delete mode 100644 package/boot/uboot-zynq/patches/025-v2018.09-arm-zynq-add-support-for-the-zybo-z7-board.patch delete mode 100644 package/boot/yamonenv/Makefile delete mode 100644 package/boot/yamonenv/patches/001-yamonenv_mtd_partition.patch mode change 100644 => 100755 scripts/json_add_image_info.py delete mode 100644 target/linux/apm821xx/patches-4.14/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch delete mode 100644 target/linux/apm821xx/patches-4.19/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch rename target/linux/ath79/dts/{ar7161_netgear_wndr3700v2.dts => ar7161_netgear_wndr3700-v2.dts} (85%) create mode 100644 target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts delete mode 100644 target/linux/brcm63xx/patches-4.14/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch delete mode 100644 target/linux/brcm63xx/patches-4.19/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch delete mode 100644 target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-savedscp.patch create mode 100644 target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-set-dscpmark.patch create mode 100644 target/linux/generic/pending-4.14/481-mtd-spi-nor-add-support-for-Gigadevice-GD25D05.patch create mode 100644 target/linux/generic/pending-4.19/481-mtd-spi-nor-add-support-for-Gigadevice-GD25D05.patch create mode 100755 target/linux/mediatek/mt7622/base-files/etc/board.d/02_network create mode 100755 target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh rename target/linux/mediatek/{ => mt7623}/base-files/etc/board.d/02_network (62%) rename target/linux/mediatek/{ => mt7623}/base-files/lib/preinit/07_set_iface_mac (97%) rename target/linux/mediatek/{ => mt7623}/base-files/lib/preinit/79_move_config (100%) rename target/linux/mediatek/{ => mt7623}/base-files/lib/upgrade/platform.sh (50%) create mode 100644 target/linux/mediatek/mt7623/config-4.19 create mode 100644 target/linux/mediatek/patches-4.19/0002-eth-fix-dsa-support.patch create mode 100644 target/linux/mediatek/patches-4.19/0228-arm-dts-bpir2-fix-console.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index e7ebf5efc..ea8f04135 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -7,12 +7,12 @@ ifdef CONFIG_TESTING_KERNEL endif LINUX_VERSION-4.9 = .208 -LINUX_VERSION-4.14 = .167 -LINUX_VERSION-4.19 = .98 +LINUX_VERSION-4.14 = .169 +LINUX_VERSION-4.19 = .101 LINUX_KERNEL_HASH-4.9.208 = b7ad1c9841d671d026c55a4c91c77205f8b488ca5f980f838591c68662e0525a -LINUX_KERNEL_HASH-4.14.167 = 2bb78fc7a902faf4f5dad47fdbc2f4bf3df3cf9b41f408e7260f36656659fe43 -LINUX_KERNEL_HASH-4.19.98 = 91feb13bc22d60d69596ab1d01dfecbec13ef70f00c89a483e0733af94dd2937 +LINUX_KERNEL_HASH-4.14.169 = d88ea97993c56b1fa0b0a05061bcde476c6be4fc3bb2de8bd97a8f8ff7278249 +LINUX_KERNEL_HASH-4.19.101 = be26156abdb38ac0576a34a235ef456bb8ca67fbbe56fc6649b8d069159f8bc4 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/include/u-boot.mk b/include/u-boot.mk index babb76497..9ba9c5096 100644 --- a/include/u-boot.mk +++ b/include/u-boot.mk @@ -3,7 +3,7 @@ PKG_NAME ?= u-boot ifndef PKG_SOURCE_PROTO PKG_SOURCE = $(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL = \ - http://sources.lede-project.org \ + https://sources.openwrt.org \ ftp://ftp.denx.de/pub/u-boot endif diff --git a/include/version.mk b/include/version.mk index 8ef0a7e65..32483c101 100644 --- a/include/version.mk +++ b/include/version.mk @@ -42,16 +42,16 @@ VERSION_MANUFACTURER:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER)) VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt) VERSION_MANUFACTURER_URL:=$(call qstrip,$(CONFIG_VERSION_MANUFACTURER_URL)) -VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),http://openwrt.org/) +VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),https://openwrt.org/) VERSION_BUG_URL:=$(call qstrip,$(CONFIG_VERSION_BUG_URL)) -VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),http://bugs.openwrt.org/) +VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),https://bugs.openwrt.org/) VERSION_HOME_URL:=$(call qstrip,$(CONFIG_VERSION_HOME_URL)) -VERSION_HOME_URL:=$(if $(VERSION_HOME_URL),$(VERSION_HOME_URL),http://openwrt.org/) +VERSION_HOME_URL:=$(if $(VERSION_HOME_URL),$(VERSION_HOME_URL),https://openwrt.org/) VERSION_SUPPORT_URL:=$(call qstrip,$(CONFIG_VERSION_SUPPORT_URL)) -VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),http://forum.lede-project.org/) +VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),https://forum.openwrt.org/) VERSION_PRODUCT:=$(call qstrip,$(CONFIG_VERSION_PRODUCT)) VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic) @@ -108,4 +108,3 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \ -e 's,%s,$(call sed_escape,$(VERSION_SUPPORT_URL)),g' \ -e 's,%P,$(call sed_escape,$(VERSION_PRODUCT)),g' \ -e 's,%h,$(call sed_escape,$(VERSION_HWREV)),g' - diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index df221cc26..ea04d17d0 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -244,10 +244,10 @@ generate_static_system() { set system.ntp='timeserver' set system.ntp.enabled='1' set system.ntp.enable_server='0' - add_list system.ntp.server='0.openwrt.pool.ntp.org' - add_list system.ntp.server='1.openwrt.pool.ntp.org' - add_list system.ntp.server='2.openwrt.pool.ntp.org' - add_list system.ntp.server='3.openwrt.pool.ntp.org' + add_list system.ntp.server='ntp1.aliyun.com' + add_list system.ntp.server='time1.cloud.tencent.com' + add_list system.ntp.server='time.ustc.edu.cn' + add_list system.ntp.server='pool.ntp.org' EOF if json_is_a system object; then diff --git a/package/base-files/files/usr/lib/os-release b/package/base-files/files/usr/lib/os-release index 121041256..c39913d54 100644 --- a/package/base-files/files/usr/lib/os-release +++ b/package/base-files/files/usr/lib/os-release @@ -8,11 +8,11 @@ HOME_URL="%u" BUG_URL="%b" SUPPORT_URL="%s" BUILD_ID="%R" -LEDE_BOARD="%S" -LEDE_ARCH="%A" -LEDE_TAINTS="%t" -LEDE_DEVICE_MANUFACTURER="%M" -LEDE_DEVICE_MANUFACTURER_URL="%m" -LEDE_DEVICE_PRODUCT="%P" -LEDE_DEVICE_REVISION="%h" -LEDE_RELEASE="%D %V %C" +OPENWRT_BOARD="%S" +OPENWRT_ARCH="%A" +OPENWRT_TAINTS="%t" +OPENWRT_DEVICE_MANUFACTURER="%M" +OPENWRT_DEVICE_MANUFACTURER_URL="%m" +OPENWRT_DEVICE_PRODUCT="%P" +OPENWRT_DEVICE_REVISION="%h" +OPENWRT_RELEASE="%D %V %C" diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index cf2cfd1d4..3432db525 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -183,7 +183,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "http://downloads.lede-project.org/snapshots" + default "http://downloads.openwrt.org/snapshots" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile deleted file mode 100644 index 64c242680..000000000 --- a/package/boot/apex/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# -# Copyright (C) 2006-2011 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=apex -PKG_VERSION:=1.6.9 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://downloads.openwrt.org/sources/ -PKG_HASH:=1d2bc04c2c6bb3d2d6c1916b6dc559cda2b1ecb045d7801fd49af6af4234abeb -PKG_TARGETS:=bin - -include $(INCLUDE_DIR)/package.mk - -export GCC_HONOUR_COPTS=s - -define Package/apex - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_ixp4xx - DEFAULT:=y - TITLE:=Boot loader for NSLU2, FSG3, NAS100D and others -endef - -define build_apex - $(MAKE) -C $(PKG_BUILD_DIR) \ - ARCH=arm \ - $(1)_config - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(TARGET_CONFIGURE_OPTS) \ - KBUILD_HAVE_NLS=no \ - ARCH=arm \ - clean all - $(INSTALL_BIN) $(PKG_BUILD_DIR)/apex.bin $(PKG_BUILD_DIR)/out/apex-$(2).bin -endef - -define Build/Compile - $(INSTALL_DIR) $(PKG_BUILD_DIR)/out - $(call build_apex,slugos-nslu2-armeb,nslu2-armeb) - $(call build_apex,slugos-nslu2-16mb-armeb,nslu2-16mb-armeb) - $(call build_apex,slugos-fsg3-armeb,fsg3-armeb) - $(call build_apex,slugos-nas100d-armeb,nas100d-armeb) -endef - -define Package/apex/install - $(INSTALL_DIR) $(STAGING_DIR)/apex - $(CP) $(PKG_BUILD_DIR)/out/*.bin $(1)/ -endef - -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/out/*.bin $(STAGING_DIR_IMAGE)/ -endef - -$(eval $(call BuildPackage,apex)) diff --git a/package/boot/apex/patches/001-compile_fix.patch b/package/boot/apex/patches/001-compile_fix.patch deleted file mode 100644 index 8a25de657..000000000 --- a/package/boot/apex/patches/001-compile_fix.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -444,7 +444,7 @@ ifeq ($(config-targets),1) - include $(srctree)/src/arch-$(SRCARCH)/Makefile - export KBUILD_DEFCONFIG - --config %config: scripts_basic outputmakefile FORCE -+%config: scripts_basic outputmakefile FORCE - $(Q)mkdir -p include/linux include/config - $(Q)$(MAKE) $(build)=scripts/kconfig $@ - -@@ -1585,7 +1585,7 @@ endif - $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) - - # Modules --/ %/: prepare scripts FORCE -+%/: prepare scripts FORCE - $(cmd_crmodverdir) - $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ - $(build)=$(build-dir) diff --git a/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch b/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch deleted file mode 100644 index d598ff328..000000000 --- a/package/boot/apex/patches/100-openwrt_nslu2_armeb_config.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/src/mach-ixp42x/slugos-nslu2-armeb_config -+++ b/src/mach-ixp42x/slugos-nslu2-armeb_config -@@ -19,7 +19,7 @@ CONFIG_EXPERIMENTAL=y - # - # General Setup - # --CONFIG_TARGET_DESCRIPTION="SlugOS NSLU2 (bigendian)" -+CONFIG_TARGET_DESCRIPTION="OpenWrt NSLU2 (8MiB Flash)" - CONFIG_CROSS_COMPILE="" - CONFIG_AEABI=y - # CONFIG_DRIVER_LONG_LONG_SIZE is not set -@@ -163,9 +163,9 @@ CONFIG_ENV_REGION_KERNEL_ALT="fis://kern - # Overrides - # - CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y --CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" -+CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" - CONFIG_ENV_DEFAULT_CMDLINE_ALT_P=y --CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" -+CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" - # CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set - # CONFIG_ENV_DEFAULT_STARTUP_ALT_P is not set - CONFIG_USES_NOR_BOOTFLASH=y diff --git a/package/boot/apex/patches/120-openwrt_nslu2_16mb_armeb_config.patch b/package/boot/apex/patches/120-openwrt_nslu2_16mb_armeb_config.patch deleted file mode 100644 index 5e7ecee27..000000000 --- a/package/boot/apex/patches/120-openwrt_nslu2_16mb_armeb_config.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/src/mach-ixp42x/slugos-nslu2-16mb-armeb_config -+++ b/src/mach-ixp42x/slugos-nslu2-16mb-armeb_config -@@ -19,7 +19,7 @@ CONFIG_EXPERIMENTAL=y - # - # General Setup - # --CONFIG_TARGET_DESCRIPTION="SlugOS NSLU2/BE (16MiB Flash)" -+CONFIG_TARGET_DESCRIPTION="OpenWrt NSLU2 (16MiB Flash)" - CONFIG_CROSS_COMPILE="" - CONFIG_AEABI=y - # CONFIG_DRIVER_LONG_LONG_SIZE is not set -@@ -163,9 +163,9 @@ CONFIG_ENV_REGION_KERNEL_ALT="fis://kern - # Overrides - # - CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y --CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" -+CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" - CONFIG_ENV_DEFAULT_CMDLINE_ALT_P=y --CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock4 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" -+CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock4 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" - # CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set - # CONFIG_ENV_DEFAULT_STARTUP_ALT_P is not set - CONFIG_USES_NOR_BOOTFLASH=y diff --git a/package/boot/apex/patches/140-openwrt_fsg3_armeb_config.patch b/package/boot/apex/patches/140-openwrt_fsg3_armeb_config.patch deleted file mode 100644 index fc0e8b9f3..000000000 --- a/package/boot/apex/patches/140-openwrt_fsg3_armeb_config.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/src/mach-ixp42x/slugos-fsg3-armeb_config -+++ b/src/mach-ixp42x/slugos-fsg3-armeb_config -@@ -17,7 +17,7 @@ CONFIG_EXPERIMENTAL=y - # - # General Setup - # --CONFIG_TARGET_DESCRIPTION="SlugOS FSG3/BE" -+CONFIG_TARGET_DESCRIPTION="OpenWrt FSG3" - CONFIG_CROSS_COMPILE="" - CONFIG_AEABI=y - CONFIG_CC_OPTIMIZE_FOR_SIZE=y -@@ -148,9 +148,9 @@ CONFIG_ENV_REGION_KERNEL_ALT="fis://kern - # Overrides - # - CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y --CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/sda1 rootdelay=10 console=ttyS0,115200" -+CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/sda1 rootdelay=10 console=ttyS0,115200 init=/etc/preinit noinitrd" - CONFIG_ENV_DEFAULT_CMDLINE_ALT_P=y --CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/sda2 rootdelay=10 console=ttyS0,115200" -+CONFIG_ENV_DEFAULT_CMDLINE_ALT="root=/dev/mtdblock2 rootfstype=squashfs console=ttyS0,115200 init=/etc/preinit noinitrd" - # CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set - # CONFIG_ENV_DEFAULT_STARTUP_ALT_P is not set - CONFIG_USES_NOR_BOOTFLASH=y diff --git a/package/boot/apex/patches/150-limit_ram_to_64mb.patch b/package/boot/apex/patches/150-limit_ram_to_64mb.patch deleted file mode 100644 index 3e178166e..000000000 --- a/package/boot/apex/patches/150-limit_ram_to_64mb.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/src/mach-ixp42x/slugos-nslu2-armeb_config -+++ b/src/mach-ixp42x/slugos-nslu2-armeb_config -@@ -137,7 +137,7 @@ CONFIG_AUTOBOOT_DELAY=10 - CONFIG_ENV_STARTUP_KERNEL_COPY=y - # CONFIG_ENV_REGION_KERNEL_SWAP is not set - CONFIG_ENV_STARTUP_PREFIX_P=y --CONFIG_ENV_STARTUP_PREFIX="sdram-init; memscan -u 0+256m" -+CONFIG_ENV_STARTUP_PREFIX="sdram-init; memscan -u 0+64m" - - # - # Regions ---- a/src/mach-ixp42x/slugos-nslu2-16mb-armeb_config -+++ b/src/mach-ixp42x/slugos-nslu2-16mb-armeb_config -@@ -137,7 +137,7 @@ CONFIG_AUTOBOOT_DELAY=10 - CONFIG_ENV_STARTUP_KERNEL_COPY=y - # CONFIG_ENV_REGION_KERNEL_SWAP is not set - CONFIG_ENV_STARTUP_PREFIX_P=y --CONFIG_ENV_STARTUP_PREFIX="sdram-init; memscan -u 0+256m" -+CONFIG_ENV_STARTUP_PREFIX="sdram-init; memscan -u 0+64m" - - # - # Regions diff --git a/package/boot/apex/patches/160-openwrt_nas100d_armeb_config.patch b/package/boot/apex/patches/160-openwrt_nas100d_armeb_config.patch deleted file mode 100644 index e19096485..000000000 --- a/package/boot/apex/patches/160-openwrt_nas100d_armeb_config.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/src/mach-ixp42x/slugos-nas100d-armeb_config -+++ b/src/mach-ixp42x/slugos-nas100d-armeb_config -@@ -19,7 +19,7 @@ CONFIG_EXPERIMENTAL=y - # - # General Setup - # --CONFIG_TARGET_DESCRIPTION="SlugOS NAS100D/BE" -+CONFIG_TARGET_DESCRIPTION="OpenWrt NAS100D" - CONFIG_CROSS_COMPILE="" - CONFIG_AEABI=y - # CONFIG_DRIVER_LONG_LONG_SIZE is not set -@@ -158,7 +158,7 @@ CONFIG_ENV_REGION_KERNEL="fis://kernel" - # Overrides - # - CONFIG_ENV_DEFAULT_CMDLINE_OVERRIDE=y --CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock2 rootfstype=jffs2 console=ttyS0,115200 init=/linuxrc" -+CONFIG_ENV_DEFAULT_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 console=ttyS0,115200 init=/etc/preinit noinitrd" - # CONFIG_ENV_DEFAULT_STARTUP_OVERRIDE is not set - CONFIG_USES_NOR_BOOTFLASH=y - CONFIG_RELOCATE_SIMPLE=y diff --git a/package/boot/arm-trusted-firmware-mvebu/Makefile b/package/boot/arm-trusted-firmware-mvebu/Makefile new file mode 100644 index 000000000..a2b34555a --- /dev/null +++ b/package/boot/arm-trusted-firmware-mvebu/Makefile @@ -0,0 +1,112 @@ +# +# Copyright (C) 2019 Sartura Ltd. +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=arm-trusted-firmware-mvebu +PKG_VERSION:=2.2 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE:=$(PKG_NAME)-$(PKG_RELEASE).tar.xz +PKG_SOURCE_URL:=https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git +PKG_SOURCE_DATE:=2019-10-22 +PKG_SOURCE_VERSION:=a04808c16cfc126d9fe572ae7c4b5a3d39de5796 +PKG_MIRROR_HASH:=ff93aad67227ca96db54e92288f61b4ff3abbaad291fc88ad95c29cd3dd3588c + +PKG_MAINTAINER:=Vladimir Vid + +include $(INCLUDE_DIR)/package.mk + +define Package/arm-trusted-firmware-mvebu + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=ARM Trusted Firmware for mvebu devices +endef + +define Package/arm-trusted-firmware-mvebu/uDPU +$(call Package/arm-trusted-firmware-mvebu) + BOARDNAME:=uDPU + TITLE:=ARM Trusted Firmware for Methode uDPU + DEPENDS:=+u-boot-uDPU + UBOOT:=uDPU + CLOCKSPRESET:=CPU_1000_DDR_800 + PLAT:=a3700 +endef + +A3700_UTILS_NAME:=a3700-utils +A3700_UTILS_RELEASE:=18.12.1 +A3700_UTILS_SOURCE=$(A3700_UTILS_NAME)-$(A3700_UTILS_RELEASE).tar.bz2 + +define Download/a3700-utils + FILE:=$(A3700_UTILS_SOURCE) + PROTO:=git + URL:=https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git + VERSION:=e6bb176fb9936d9160e53ae09275000dc6440686 + MIRROR_HASH:=c3edf71cbf1fc2e5482d36e36a34c79d682d2c87fdfb909b4dc6327a171e7bd4 + SUBDIR:=$(A3700_UTILS_NAME) +endef + +MV_DDR_NAME:=mv-ddr-marvell +MV_DDR_RELEASE:=mainline +MV_DDR_SOURCE:=$(MV_DDR_NAME)-$(MV_DDR_RELEASE).tar.bz2 + +define Download/mv-ddr-marvell + FILE:=$(MV_DDR_SOURCE) + PROTO:=git + URL:=https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git + VERSION:=a881467ef0f0185e6570dd0483023fde93cbb5f5 + MIRROR_HASH:=19f34817616c583b2b5f2612705857cf2120f6c2132355217899b1403c3fd336 + SUBDIR:=$(MV_DDR_NAME) +endef + +LINARO_NAME:=gcc-linaro +LINARO_RELEASE:=6 +LINARO_VERSION:=5.0-2018.12-$(HOST_ARCH)_arm-linux-gnueabi +LINARO_SOURCE=$(LINARO_NAME)-$(LINARO_RELEASE).$(LINARO_VERSION).tar.xz + +define Download/gcc-linaro + FILE:=$(LINARO_SOURCE) + URL:=https://releases.linaro.org/components/toolchain/binaries/latest-$(LINARO_RELEASE)/arm-linux-gnueabi/ + HASH:=2d4a92d6c8b384ae404b2e02c1c412e3ec18f9b714135acf046b2b1b510e9ace +endef + +define Build/Prepare + # Download sources + $(eval $(call Download,a3700-utils)) + $(eval $(call Download,mv-ddr-marvell)) + $(eval $(call Download,gcc-linaro)) + + rm -rf $(PKG_BUILD_DIR) + $(TAR) -C $(BUILD_DIR) -xf $(DL_DIR)/$(PKG_SOURCE) + + mkdir -p $(STAGING_DIR_IMAGE) + $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(A3700_UTILS_SOURCE) + $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(MV_DDR_SOURCE) + $(TAR) -C $(STAGING_DIR_IMAGE) -xf $(DL_DIR)/$(LINARO_SOURCE) +endef + +TARGET_CFLAGS = "" + +MAKE_VARS= \ + CROSS_COMPILE="$(TARGET_CROSS)" + +MAKE_FLAGS = \ + CROSS_CM3=$(STAGING_DIR_IMAGE)/$(LINARO_NAME)-$(LINARO_RELEASE).$(LINARO_VERSION)/bin/arm-linux-gnueabi- \ + BL33=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.bin \ + MV_DDR_PATH=$(STAGING_DIR_IMAGE)/$(MV_DDR_NAME) \ + WTP=$(STAGING_DIR_IMAGE)/$(A3700_UTILS_NAME) \ + CLOCKSPRESET=$(CLOCKSPRESET) \ + PLAT=$(PLAT) \ + all \ + fip + +define Build/InstallDev + $(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/flash-image.bin $(BIN_DIR)/u-boot-$(BOARDNAME)/ +endef + +$(eval $(call BuildPackage,arm-trusted-firmware-mvebu/uDPU)) diff --git a/package/boot/arm-trusted-firmware-sunxi/Makefile b/package/boot/arm-trusted-firmware-sunxi/Makefile index 7bd042bda..0211e5e03 100644 --- a/package/boot/arm-trusted-firmware-sunxi/Makefile +++ b/package/boot/arm-trusted-firmware-sunxi/Makefile @@ -11,10 +11,10 @@ PKG_NAME:=arm-trusted-firmware-sunxi PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=https://github.com/apritzel/arm-trusted-firmware -PKG_SOURCE_DATE:=2018-02-10 -PKG_SOURCE_VERSION:=c9f55c023164a6c8c49f70f7ac6c68c626839d6f -PKG_MIRROR_HASH:=94b5338592cf0bcc353b55da5fdd62c91ae8e6263822f73724cb72ecde3dbbf9 +PKG_SOURCE_URL=https://github.com/ARM-software/arm-trusted-firmware +PKG_SOURCE_DATE:=2018-10-02 +PKG_SOURCE_VERSION:=dbc8d9496ead9ecdd7c2a276b542a4fbbbf64027 +PKG_MIRROR_HASH:=c81521a27b86f606e927b4e346286540b862828c8d49292eae1f5c6adfc24001 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=license.md @@ -37,12 +37,12 @@ MAKE_VARS = \ CROSS_COMPILE="$(TARGET_CROSS)" MAKE_FLAGS += \ - PLAT=sun50iw1p1 \ + PLAT=sun50i_a64 \ bl31 define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/build/sun50iw1p1/release/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin + $(CP) $(PKG_BUILD_DIR)/build/sun50i_a64/release/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin endef define Package/arm-trusted-firmware-sunxi/install diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile index 22afd1ec4..c4edddf84 100644 --- a/package/boot/at91bootstrap/Makefile +++ b/package/boot/at91bootstrap/Makefile @@ -9,13 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=at91bootstrap -PKG_VERSION:=v3.8.10 +PKG_VERSION:=v3.8.12 PKG_RELEASE:= PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git -PKG_SOURCE_VERSION:=04efa5500d60a0211d14b6ee60df7ce0a828704d - +PKG_SOURCE_VERSION:=28e15d07e9f24efb04b87bb0baa211a0c5640ef1 PKG_BUILD_DIR = \ $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) @@ -28,85 +27,99 @@ define AT91Bootstrap/Default AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin endef +define AT91Bootstrap/at91sam9x5eknf_uboot + NAME:=AT91Bootstrap for AT91SAM9X5-EK board (NandFlash) + BUILD_SUBTARGET:=sam9x + BUILD_DEVICES:=at91sam9x25ek at91sam9x35ek +endef + +define AT91Bootstrap/at91sam9x5eksd_uboot + NAME:=AT91Bootstrap for AT91SAM9X5-EK board (SDcard) + BUILD_SUBTARGET:=sam9x + BUILD_DEVICES:=at91sam9x25ek at91sam9x35ek +endef + define AT91Bootstrap/sama5d2_xplaineddf_uboot TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SPI Flash) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d2_xplained endef define AT91Bootstrap/sama5d2_xplaineddf_qspi_uboot TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (QSPI Flash) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d2_xplained endef define AT91Bootstrap/sama5d2_xplainedsd_uboot TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SDcard/EMMC) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d2_xplained endef define AT91Bootstrap/sama5d3_xplainednf_uboot TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (Nand Flash) - BUILD_SUBTARGET:=sama5d3 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d3_xplained endef define AT91Bootstrap/sama5d3_xplainedsd_uboot TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (SDcard) - BUILD_SUBTARGET:=sama5d3 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d3_xplained endef define AT91Bootstrap/sama5d4_xplainednf_uboot_secure TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (Nand Flash) - BUILD_SUBTARGET:=sama5d4 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d4_xplained endef define AT91Bootstrap/sama5d4_xplaineddf_uboot_secure TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SPI Flash) - BUILD_SUBTARGET:=sama5d4 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d4_xplained endef define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SDcard) - BUILD_SUBTARGET:=sama5d4 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d4_xplained endef define AT91Bootstrap/sama5d27_som1_eksd_uboot TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (SDcard0) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d27_som1_ek endef define AT91Bootstrap/sama5d27_som1_eksd1_uboot TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (SDcard1) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d27_som1_ek endef define AT91Bootstrap/sama5d27_som1_ekqspi_uboot TITLE:=AT91Bootstrap for SAMA5D27 SOM1 Ek (QSPI Flash) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d27_som1_ek endef define AT91Bootstrap/sama5d2_ptc_eknf_uboot TITLE:=AT91Bootstrap for SAMA5D2 PTC EK (Nand Flash) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d2_ptc_ek endef define AT91Bootstrap/sama5d2_ptc_eksd_uboot TITLE:=AT91Bootstrap for SAMA5D2 PTC EK (SDCard) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d2_ptc_ek endef AT91BOOTSTRAP_TARGETS := \ + at91sam9x5eknf_uboot \ + at91sam9x5eksd_uboot \ sama5d2_xplaineddf_uboot \ sama5d2_xplaineddf_qspi_uboot \ sama5d2_xplainedsd_uboot \ @@ -115,9 +128,9 @@ AT91BOOTSTRAP_TARGETS := \ sama5d4_xplainednf_uboot_secure \ sama5d4_xplaineddf_uboot_secure \ sama5d4_xplainedsd_uboot_secure \ - sama5d27_som1_eksd_uboot \ - sama5d27_som1_ekqspi_uboot \ - sama5d2_ptc_eknf_uboot \ + sama5d27_som1_eksd1_uboot \ + sama5d27_som1_ekqspi_uboot \ + sama5d2_ptc_eknf_uboot \ sama5d2_ptc_eksd_uboot define Build/Compile diff --git a/package/boot/fconfig/Makefile b/package/boot/fconfig/Makefile index d82fa8db9..9b806fe97 100644 --- a/package/boot/fconfig/Makefile +++ b/package/boot/fconfig/Makefile @@ -30,13 +30,6 @@ define Package/fconfig/description displays and (if writable) also edits the RedBoot configuration. endef -define Build/Configure -endef - -define Build/Compile - $(call Build/Compile/Default) -endef - define Package/fconfig/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/fconfig $(1)/usr/sbin/ diff --git a/package/boot/grub2/common.mk b/package/boot/grub2/common.mk index 1b9ee2f4f..82a987b99 100644 --- a/package/boot/grub2/common.mk +++ b/package/boot/grub2/common.mk @@ -8,13 +8,14 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk +PKG_NAME:=grub PKG_CPE_ID:=cpe:/a:gnu:grub2 -PKG_VERSION:=2.02 -PKG_RELEASE:=3 +PKG_VERSION:=2.04 +PKG_RELEASE:=1 -PKG_SOURCE:=grub-$(PKG_VERSION).tar.xz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/grub -PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f +PKG_HASH:=e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d PKG_FIXUP:=autoreconf HOST_BUILD_PARALLEL:=1 @@ -71,4 +72,3 @@ define Host/Configure $(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in $(Host/Configure/Default) endef - diff --git a/package/boot/grub2/patches/0008-Fix-packed-not-aligned-error-on-GCC-8.patch b/package/boot/grub2/patches/0008-Fix-packed-not-aligned-error-on-GCC-8.patch deleted file mode 100644 index c9a9884b1..000000000 --- a/package/boot/grub2/patches/0008-Fix-packed-not-aligned-error-on-GCC-8.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001 -From: Michael Chang -Date: Mon, 26 Mar 2018 16:52:34 +0800 -Subject: Fix packed-not-aligned error on GCC 8 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When building with GCC 8, there are several errors regarding packed-not-aligned. - -./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned] - -This patch fixes the build error by cleaning up the ambiguity of placing -aligned structure in a packed one. In "struct grub_btrfs_time" and "struct -grub_gpt_part_type", the aligned attribute seems to be superfluous, and also -has to be packed, to ensure the structure is bit-to-bit mapped to the format -laid on disk. I think we could blame to copy and paste error here for the -mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as -the name suggests. :) - -Signed-off-by: Michael Chang -Tested-by: Michael Chang -Tested-by: Paul Menzel -Reviewed-by: Daniel Kiper ---- - grub-core/fs/btrfs.c | 2 +- - include/grub/efiemu/runtime.h | 2 +- - include/grub/gpt_partition.h | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c -index 4849c1ceb..be195448d 100644 ---- a/grub-core/fs/btrfs.c -+++ b/grub-core/fs/btrfs.c -@@ -175,7 +175,7 @@ struct grub_btrfs_time - { - grub_int64_t sec; - grub_uint32_t nanosec; --} __attribute__ ((aligned (4))); -+} GRUB_PACKED; - - struct grub_btrfs_inode - { -diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h -index 9b6b729f4..36d2dedf4 100644 ---- a/include/grub/efiemu/runtime.h -+++ b/include/grub/efiemu/runtime.h -@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel - - struct efi_variable - { -- grub_efi_guid_t guid; -+ grub_efi_packed_guid_t guid; - grub_uint32_t namelen; - grub_uint32_t size; - grub_efi_uint32_t attributes; -diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h -index 1b32f6725..9668a68c3 100644 ---- a/include/grub/gpt_partition.h -+++ b/include/grub/gpt_partition.h -@@ -28,7 +28,7 @@ struct grub_gpt_part_type - grub_uint16_t data2; - grub_uint16_t data3; - grub_uint8_t data4[8]; --} __attribute__ ((aligned(8))); -+} GRUB_PACKED; - typedef struct grub_gpt_part_type grub_gpt_part_type_t; - - #define GRUB_GPT_PARTITION_TYPE_EMPTY \ --- -cgit v1.1-33-g03f6 diff --git a/package/boot/grub2/patches/001-verifiers-Blocklist-fallout-cleanup.patch b/package/boot/grub2/patches/001-verifiers-Blocklist-fallout-cleanup.patch new file mode 100644 index 000000000..74d68a6cd --- /dev/null +++ b/package/boot/grub2/patches/001-verifiers-Blocklist-fallout-cleanup.patch @@ -0,0 +1,31 @@ +From: David Michael +Date: Fri, 5 Jul 2019 07:45:59 -0400 +Subject: [PATCH] verifiers: Blocklist fallout cleanup + +Blocklist fallout cleanup after commit 5c6f9bc15 (generic/blocklist: Fix +implicit declaration of function grub_file_filter_disable_compression()). + +Signed-off-by: David Michael +Reviewed-by: Daniel Kiper +--- + +--- a/grub-core/osdep/generic/blocklist.c ++++ b/grub-core/osdep/generic/blocklist.c +@@ -59,7 +59,7 @@ grub_install_get_blocklist (grub_device_ + + grub_disk_cache_invalidate_all (); + +- file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | FILE_TYPE_NO_DECOMPRESS); ++ file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | GRUB_FILE_TYPE_NO_DECOMPRESS); + if (file) + { + if (grub_file_size (file) != core_size) +@@ -116,7 +116,7 @@ grub_install_get_blocklist (grub_device_ + + grub_file_t file; + /* Now read the core image to determine where the sectors are. */ +- file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | FILE_TYPE_NO_DECOMPRESS); ++ file = grub_file_open (core_path_dev, GRUB_FILE_TYPE_NONE | GRUB_FILE_TYPE_NO_DECOMPRESS); + if (! file) + grub_util_error ("%s", grub_errmsg); + diff --git a/package/boot/grub2/patches/100-grub_setup_root.patch b/package/boot/grub2/patches/100-grub_setup_root.patch index f053ba95e..df671bc9d 100644 --- a/package/boot/grub2/patches/100-grub_setup_root.patch +++ b/package/boot/grub2/patches/100-grub_setup_root.patch @@ -17,7 +17,7 @@ int force; int fs_probe; int allow_floppy; -@@ -178,6 +181,13 @@ argp_parser (int key, char *arg, struct argp_state *state) +@@ -178,6 +181,13 @@ argp_parser (int key, char *arg, struct arguments->dev_map = xstrdup (arg); break; @@ -42,7 +42,7 @@ --- a/util/setup.c +++ b/util/setup.c -@@ -247,13 +247,12 @@ identify_partmap (grub_disk_t disk __attribute__ ((unused)), +@@ -252,13 +252,12 @@ identify_partmap (grub_disk_t disk __att void SETUP (const char *dir, const char *boot_file, const char *core_file, @@ -55,8 +55,8 @@ char *boot_img, *core_img, *boot_path; - char *root = 0; size_t boot_size, core_size; - #ifdef GRUB_SETUP_BIOS grub_uint16_t core_sectors; + grub_device_t root_dev = 0, dest_dev, core_dev; @@ -307,7 +306,10 @@ SETUP (const char *dir, core_dev = dest_dev; @@ -80,7 +80,7 @@ continue; --- a/include/grub/util/install.h +++ b/include/grub/util/install.h -@@ -184,13 +184,13 @@ grub_install_get_image_target (const char *arg); +@@ -191,13 +191,13 @@ grub_install_get_image_target (const cha void grub_util_bios_setup (const char *dir, const char *boot_file, const char *core_file, @@ -98,7 +98,7 @@ --- a/util/grub-install.c +++ b/util/grub-install.c -@@ -1673,7 +1673,7 @@ main (int argc, char *argv[]) +@@ -1712,7 +1712,7 @@ main (int argc, char *argv[]) /* Now perform the installation. */ if (install_bootsector) grub_util_bios_setup (platdir, "boot.img", "core.img", @@ -107,7 +107,7 @@ fs_probe, allow_floppy, add_rs_codes); break; } -@@ -1699,7 +1699,7 @@ main (int argc, char *argv[]) +@@ -1738,7 +1738,7 @@ main (int argc, char *argv[]) /* Now perform the installation. */ if (install_bootsector) grub_util_sparc_setup (platdir, "boot.img", "core.img", diff --git a/package/boot/grub2/patches/101-disable-gettext-check-macro-version.patch b/package/boot/grub2/patches/101-disable-gettext-check-macro-version.patch deleted file mode 100644 index 4b850ed2a..000000000 --- a/package/boot/grub2/patches/101-disable-gettext-check-macro-version.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/po/Makefile.in.in b/po/Makefile.in.in -index 3619458..060e0db 100644 ---- a/po/Makefile.in.in -+++ b/po/Makefile.in.in -@@ -97,7 +97,7 @@ CATALOGS = @CATALOGS@ - mv t-$@ $@ - - --all: check-macro-version all-@USE_NLS@ -+all: all-@USE_NLS@ - - all-yes: stamp-po - all-no: diff --git a/package/boot/grub2/patches/200-fix-gets-removal.patch b/package/boot/grub2/patches/200-fix-gets-removal.patch deleted file mode 100644 index 737fb975b..000000000 --- a/package/boot/grub2/patches/200-fix-gets-removal.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- a/grub-core/gnulib/stdio.in.h -+++ b/grub-core/gnulib/stdio.in.h -@@ -695,13 +695,6 @@ _GL_WARN_ON_USE (getline, "getline is un - # endif - #endif - --/* It is very rare that the developer ever has full control of stdin, -- so any use of gets warrants an unconditional warning; besides, C11 -- removed it. */ --#undef gets --#if HAVE_RAW_DECL_GETS --#endif -- - - #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ - struct obstack; diff --git a/package/boot/grub2/patches/300-CVE-2015-8370.patch b/package/boot/grub2/patches/300-CVE-2015-8370.patch index eb7919639..22f6c9092 100644 --- a/package/boot/grub2/patches/300-CVE-2015-8370.patch +++ b/package/boot/grub2/patches/300-CVE-2015-8370.patch @@ -33,8 +33,8 @@ Signed-off-by: Ismael Ripoll-Ripoll break; } -- if (key == '\b') -+ if (key == '\b' && cur_len) +- if (key == GRUB_TERM_BACKSPACE) ++ if (key == GRUB_TERM_BACKSPACE && cur_len) { if (cur_len) { diff --git a/package/boot/grub2/patches/400-R_X86_64_PLT32.patch b/package/boot/grub2/patches/400-R_X86_64_PLT32.patch deleted file mode 100644 index 2c65cb78a..000000000 --- a/package/boot/grub2/patches/400-R_X86_64_PLT32.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 02702bdfe14d8a04643a45b03715f734ae34dbac Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" -Date: Sat, 17 Feb 2018 06:47:28 -0800 -Subject: x86-64: Treat R_X86_64_PLT32 as R_X86_64_PC32 - -Starting from binutils commit bd7ab16b4537788ad53521c45469a1bdae84ad4a: - -https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bd7ab16b4537788ad53521c45469a1bdae84ad4a - -x86-64 assembler generates R_X86_64_PLT32, instead of R_X86_64_PC32, for -32-bit PC-relative branches. Grub2 should treat R_X86_64_PLT32 as -R_X86_64_PC32. - -Signed-off-by: H.J. Lu -Reviewed-by: Daniel Kiper - -Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=842c390469e2c2e10b5aa36700324cd3bde25875 -Last-Update: 2018-07-30 - -Patch-Name: R_X86_64_PLT32.patch ---- - grub-core/efiemu/i386/loadcore64.c | 1 + - grub-core/kern/x86_64/dl.c | 1 + - util/grub-mkimagexx.c | 1 + - util/grub-module-verifier.c | 1 + - 4 files changed, 4 insertions(+) - -diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c -index e49d0b6ff..18facf47f 100644 ---- a/grub-core/efiemu/i386/loadcore64.c -+++ b/grub-core/efiemu/i386/loadcore64.c -@@ -98,6 +98,7 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - err = grub_efiemu_write_value (addr, - *addr32 + rel->r_addend - + sym.off -diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c -index 440690673..3a73e6e6c 100644 ---- a/grub-core/kern/x86_64/dl.c -+++ b/grub-core/kern/x86_64/dl.c -@@ -70,6 +70,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - { - grub_int64_t value; - value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value - -diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c -index e63f148e4..f20255a28 100644 ---- a/util/grub-mkimagexx.c -+++ b/util/grub-mkimagexx.c -@@ -832,6 +832,7 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, - break; - - case R_X86_64_PC32: -+ case R_X86_64_PLT32: - { - grub_uint32_t *t32 = (grub_uint32_t *) target; - *t32 = grub_host_to_target64 (grub_target_to_host32 (*t32) -diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c -index 9179285a5..a79271f66 100644 ---- a/util/grub-module-verifier.c -+++ b/util/grub-module-verifier.c -@@ -19,6 +19,7 @@ struct grub_module_verifier_arch archs[] = { - -1 - }, (int[]){ - R_X86_64_PC32, -+ R_X86_64_PLT32, - -1 - } - }, diff --git a/package/boot/kexec-tools/Makefile b/package/boot/kexec-tools/Makefile index ca4183986..269345aa9 100644 --- a/package/boot/kexec-tools/Makefile +++ b/package/boot/kexec-tools/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kexec-tools PKG_VERSION:=2.0.16 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec @@ -25,7 +25,6 @@ define Package/kexec-tools/Default SECTION:=utils CATEGORY:=Utilities URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/ - MAINTAINER:=Florian Fainelli endef define Package/kexec-tools diff --git a/package/boot/kexec-tools/files/kdump.init b/package/boot/kexec-tools/files/kdump.init index 6a6a94c07..095504715 100755 --- a/package/boot/kexec-tools/files/kdump.init +++ b/package/boot/kexec-tools/files/kdump.init @@ -1,7 +1,7 @@ #!/bin/sh /etc/rc.common START=41 -STOP=98 +STOP=90 EXTRA_COMMANDS="status" EXTRA_HELP=" status Print crashkernel status" diff --git a/package/boot/rbcfg/Makefile b/package/boot/rbcfg/Makefile index 9d9b97524..55e0ea749 100644 --- a/package/boot/rbcfg/Makefile +++ b/package/boot/rbcfg/Makefile @@ -21,7 +21,7 @@ define Package/rbcfg CATEGORY:=Utilities SUBMENU:=Boot Loaders TITLE:=RouterBOOT configuration tool - DEPENDS:=@TARGET_ar71xx + DEPENDS:=@(TARGET_ar71xx||TARGET_ath79) endef define Package/rbcfg/description diff --git a/package/boot/tfa-layerscape/Makefile b/package/boot/tfa-layerscape/Makefile new file mode 100644 index 000000000..a34c52bc3 --- /dev/null +++ b/package/boot/tfa-layerscape/Makefile @@ -0,0 +1,161 @@ +# +# Copyright 2019 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tfa-layerscape +PKG_VERSION:=lsdk-1903 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf +PKG_SOURCE_VERSION:=7e34aebe658c7c3439d2d68b0ce6b9776e8e6996 +PKG_MIRROR_HASH:=9cf0bc32fa589a0ee7c48c87898679e645341f29da1253d0ba5d2e82c6ea074d +PKG_BUILD_DEPENDS:=uboot-layerscape tfa-layerscape/host + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/tfa-layerscape/Config + define Package/tfa-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=$(2) + DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw-$(1) + HIDDEN:=1 + VARIANT:=$(1) + BIN_BL2:=$(3) + BIN_FIP:=$(4) + endef +endef + +define Package/tfa-layerscape/Install + define Package/tfa-$(1)/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(BIN_BL2) $(STAGING_DIR_IMAGE)/$(1)-bl2.pbl + $(CP) $(PKG_BUILD_DIR)/$(BIN_FIP) $(STAGING_DIR_IMAGE)/$(1)-fip.bin + endef +endef + +define Build/Compile + $(eval $(Package/tfa-layerscape/$(BUILD_VARIANT))) \ + $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) \ + fip pbl PLAT=$(PLAT) BOOT_MODE=$(BOOT_MODE) \ + RCW=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-rcw.bin \ + BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.bin \ + FIPTOOL=$(STAGING_DIR_HOST)/bin/tfa-fiptool \ + CREATE_PBL=$(STAGING_DIR_HOST)/bin/tfa-create-pbl \ + BYTE_SWAP=$(STAGING_DIR_HOST)/bin/tfa-byte-swap +endef + +HOST_CFLAGS += -Wall -Werror -pedantic -std=c99 +define Host/Compile + $(MAKE) -C \ + $(HOST_BUILD_DIR)/tools/fiptool \ + CFLAGS="$(HOST_CFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS)" + $(MAKE) -C \ + $(HOST_BUILD_DIR)/plat/nxp/tools \ + CFLAGS="$(HOST_CFLAGS)" +endef + +define Host/Install + $(INSTALL_BIN) $(HOST_BUILD_DIR)/tools/fiptool/fiptool $(STAGING_DIR_HOST)/bin/tfa-fiptool + $(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/create_pbl $(STAGING_DIR_HOST)/bin/tfa-create-pbl + $(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/byte_swap $(STAGING_DIR_HOST)/bin/tfa-byte-swap +endef + +define Package/tfa-layerscape/ls1012ardb + TITLE:=NXP LS1012ARDB Trusted Firmware + PLAT:=ls1012ardb + BOOT_MODE:=qspi + BIN_BL2:=build/ls1012ardb/release/bl2_qspi.pbl + BIN_FIP:=build/ls1012ardb/release/fip.bin +endef + +define Package/tfa-layerscape/ls1012afrwy + TITLE:=NXP LS1012AFRWY Trusted Firmware + PLAT:=ls1012afrwy + BOOT_MODE:=qspi + BIN_BL2:=build/ls1012afrwy/release/bl2_qspi.pbl + BIN_FIP:=build/ls1012afrwy/release/fip.bin +endef + +define Package/tfa-layerscape/ls1043ardb + TITLE:=NXP LS1043ARDB Trusted Firmware + PLAT:=ls1043ardb + BOOT_MODE:=nor + BIN_BL2:=build/ls1043ardb/release/bl2_nor.pbl + BIN_FIP:=build/ls1043ardb/release/fip.bin +endef + +define Package/tfa-layerscape/ls1043ardb-sdboot + TITLE:=NXP LS1043ARDB SD Boot Trusted Firmware + PLAT:=ls1043ardb + BOOT_MODE:=sd + BIN_BL2:=build/ls1043ardb/release/bl2_sd.pbl + BIN_FIP:=build/ls1043ardb/release/fip.bin +endef + +define Package/tfa-layerscape/ls1046ardb + TITLE:=NXP LS1046ARDB Trusted Firmware + PLAT:=ls1046ardb + BOOT_MODE:=qspi + BIN_BL2:=build/ls1046ardb/release/bl2_qspi.pbl + BIN_FIP:=build/ls1046ardb/release/fip.bin +endef + +define Package/tfa-layerscape/ls1046ardb-sdboot + TITLE:=NXP LS1046ARDB SD Boot Trusted Firmware + PLAT:=ls1046ardb + BOOT_MODE:=sd + BIN_BL2:=build/ls1046ardb/release/bl2_sd.pbl + BIN_FIP:=build/ls1046ardb/release/fip.bin +endef + +define Package/tfa-layerscape/ls1088ardb + TITLE:=NXP LS1088ARDB Trusted Firmware + PLAT:=ls1088ardb + BOOT_MODE:=qspi + BIN_BL2:=build/ls1088ardb/release/bl2_qspi.pbl + BIN_FIP:=build/ls1088ardb/release/fip.bin +endef + +define Package/tfa-layerscape/ls1088ardb-sdboot + TITLE:=NXP LS1088ARDB SD Boot Trusted Firmware + PLAT:=ls1088ardb + BOOT_MODE:=sd + BIN_BL2:=build/ls1088ardb/release/bl2_sd.pbl + BIN_FIP:=build/ls1088ardb/release/fip.bin +endef + +define Package/tfa-layerscape/ls2088ardb + TITLE:=NXP LS2088ARDB Trusted Firmware + PLAT:=ls2088ardb + BOOT_MODE:=nor + BIN_BL2:=build/ls2088ardb/release/bl2_nor.pbl + BIN_FIP:=build/ls2088ardb/release/fip.bin +endef + +TFAS := \ + ls1012ardb \ + ls1012afrwy \ + ls1043ardb \ + ls1043ardb-sdboot \ + ls1046ardb \ + ls1046ardb-sdboot \ + ls1088ardb \ + ls1088ardb-sdboot \ + ls2088ardb + +$(eval $(call HostBuild)) +$(foreach tfa,$(TFAS), \ + $(eval $(Package/tfa-layerscape/$(tfa))) \ + $(eval $(call Package/tfa-layerscape/Config,$(tfa),$(TITLE),$(BIN_BL2),$(BIN_FIP))) \ + $(eval $(call Package/tfa-layerscape/Install,$(tfa))) \ + $(eval $(call BuildPackage,tfa-$(tfa))) \ +) diff --git a/package/boot/tfa-layerscape/patches/001-fiptool-hostbuild-fixes.patch b/package/boot/tfa-layerscape/patches/001-fiptool-hostbuild-fixes.patch new file mode 100644 index 000000000..0567e5869 --- /dev/null +++ b/package/boot/tfa-layerscape/patches/001-fiptool-hostbuild-fixes.patch @@ -0,0 +1,71 @@ +--- a/Makefile ++++ b/Makefile +@@ -448,10 +448,6 @@ endif + CRTTOOLPATH ?= tools/cert_create + CRTTOOL ?= ${CRTTOOLPATH}/cert_create${BIN_EXT} + +-# Variables for use with Firmware Image Package +-FIPTOOLPATH ?= tools/fiptool +-FIPTOOL ?= ${FIPTOOLPATH}/fiptool${BIN_EXT} +- + ################################################################################ + # Include BL specific makefiles + ################################################################################ +@@ -661,14 +657,12 @@ endif + clean: + @echo " CLEAN" + $(call SHELL_REMOVE_DIR,${BUILD_PLAT}) +- ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean + ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean + + realclean distclean: + @echo " REALCLEAN" + $(call SHELL_REMOVE_DIR,${BUILD_BASE}) + $(call SHELL_DELETE_ALL, ${CURDIR}/cscope.*) +- ${Q}${MAKE} --no-print-directory -C ${FIPTOOLPATH} clean + ${Q}${MAKE} PLAT=${PLAT} --no-print-directory -C ${CRTTOOLPATH} clean + + checkcodebase: locate-checkpatch +@@ -717,7 +711,7 @@ certificates: ${CRT_DEPS} ${CRTTOOL} + @${ECHO_BLANK_LINE} + endif + +-${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} ${FIPTOOL} ++${BUILD_PLAT}/${FIP_NAME}: ${FIP_DEPS} + ${Q}${FIPTOOL} create ${FIP_ARGS} $@ + ${Q}${FIPTOOL} info $@ + @${ECHO_BLANK_LINE} +@@ -733,21 +727,16 @@ fwu_certificates: ${FWU_CRT_DEPS} ${CRTT + @${ECHO_BLANK_LINE} + endif + +-${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} ${FIPTOOL} ++${BUILD_PLAT}/${FWU_FIP_NAME}: ${FWU_FIP_DEPS} + ${Q}${FIPTOOL} create ${FWU_FIP_ARGS} $@ + ${Q}${FIPTOOL} info $@ + @${ECHO_BLANK_LINE} + @echo "Built $@ successfully" + @${ECHO_BLANK_LINE} + +-fiptool: ${FIPTOOL} + fip: ${BUILD_PLAT}/${FIP_NAME} + fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME} + +-.PHONY: ${FIPTOOL} +-${FIPTOOL}: +- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${FIPTOOLPATH} +- + cscope: + @echo " CSCOPE" + ${Q}find ${CURDIR} -name "*.[chsS]" > cscope.files +--- a/tools/fiptool/Makefile ++++ b/tools/fiptool/Makefile +@@ -37,7 +37,7 @@ all: ${PROJECT} fip_create + + ${PROJECT}: ${OBJECTS} Makefile + @echo " LD $@" +- ${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS} ++ ${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS} $(LDFLAGS) + @${ECHO_BLANK_LINE} + @echo "Built $@ successfully" + @${ECHO_BLANK_LINE} diff --git a/package/boot/tfa-layerscape/patches/002-plat-nxp-tools-fix-a-makefile-bug-that-will-use-defa.patch b/package/boot/tfa-layerscape/patches/002-plat-nxp-tools-fix-a-makefile-bug-that-will-use-defa.patch new file mode 100644 index 000000000..92825310e --- /dev/null +++ b/package/boot/tfa-layerscape/patches/002-plat-nxp-tools-fix-a-makefile-bug-that-will-use-defa.patch @@ -0,0 +1,30 @@ +From 65e9a722b44bf28b98fe25b3b174761b47ec7dbd Mon Sep 17 00:00:00 2001 +From: Biwen Li +Date: Mon, 1 Apr 2019 13:41:55 +0800 +Subject: [PATCH 2/3] plat/nxp/tools: fix a makefile bug that will use default + implicit rules + +The patch fix a makefile bug that will use default implicit rules, +because do not have explicit rules for the destination files. + +Signed-off-by: Biwen Li +--- + plat/nxp/tools/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plat/nxp/tools/Makefile b/plat/nxp/tools/Makefile +index 2095294b..0082a0be 100644 +--- a/plat/nxp/tools/Makefile ++++ b/plat/nxp/tools/Makefile +@@ -53,7 +53,7 @@ ${PROJECT_2}: ${OBJECTS_2} Makefile + @echo "Built $@ successfully" + @${ECHO_BLANK_LINE} + +-%.o: %.c %.h Makefile ++%.o: %.c Makefile + @echo " CC $<" + ${Q}${HOSTCC} -c ${CPPFLAGS} ${CFLAGS} ${INCLUDE_PATHS} $< -o $@ + +-- +2.17.1 + diff --git a/package/boot/tfa-layerscape/patches/003-plat-nxp-tools-fix-create_pbl-and-byte_swap-host-bui.patch b/package/boot/tfa-layerscape/patches/003-plat-nxp-tools-fix-create_pbl-and-byte_swap-host-bui.patch new file mode 100644 index 000000000..ce4d9c48b --- /dev/null +++ b/package/boot/tfa-layerscape/patches/003-plat-nxp-tools-fix-create_pbl-and-byte_swap-host-bui.patch @@ -0,0 +1,60 @@ +From 8a458876013991fe2f288bbe4694264b16c3b9e9 Mon Sep 17 00:00:00 2001 +From: Biwen Li +Date: Fri, 26 Jul 2019 15:44:10 +0800 +Subject: [PATCH 3/3] plat/nxp/tools: fix create_pbl and byte_swap host build + +Not compile create_pbl and byte_swap in the process of cross compilation + +Signed-off-by: Biwen Li +--- + plat/nxp/tools/pbl_ch2.mk | 3 --- + plat/nxp/tools/pbl_ch3.mk | 5 ----- + 2 files changed, 8 deletions(-) + +diff --git a/plat/nxp/tools/pbl_ch2.mk b/plat/nxp/tools/pbl_ch2.mk +index afa43520..ff624dd9 100644 +--- a/plat/nxp/tools/pbl_ch2.mk ++++ b/plat/nxp/tools/pbl_ch2.mk +@@ -20,8 +20,6 @@ ifeq ($(RCW),"") + else + # Generate header for bl2.bin + $(Q)$(CST_DIR)/create_hdr_isbc --in ${BUILD_PLAT}/bl2.bin --out ${BUILD_PLAT}/hdr_bl2 ${BL2_INPUT_FILE} +- # Compile create_pbl tool +- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};\ + # Add bl2.bin to RCW + ${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE}\ + -o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl ;\ +@@ -43,7 +41,6 @@ ifeq ($(RCW),"") + ${Q}echo "Platform ${PLAT} requires rcw file. Please set RCW to point to the right RCW file for boot mode ${BOOT_MODE}" + else + # -a option appends the image for Chassis 3 devices in case of non secure boot +- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH}; + ${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE} \ + -o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl ; + # Swapping of RCW is required for QSPi Chassis 2 devices +diff --git a/plat/nxp/tools/pbl_ch3.mk b/plat/nxp/tools/pbl_ch3.mk +index 944ae3bb..9aa8f635 100644 +--- a/plat/nxp/tools/pbl_ch3.mk ++++ b/plat/nxp/tools/pbl_ch3.mk +@@ -27,9 +27,6 @@ else + # Generate header for bl2.bin + $(Q)$(CST_DIR)/create_hdr_isbc --in ${BUILD_PLAT}/bl2.bin --out ${BUILD_PLAT}/hdr_bl2 ${BL2_INPUT_FILE} + +- # Compile create_pbl tool +- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH};\ +- + # Add Block Copy command for bl2.bin to RCW + ${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE}\ + -o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl -f ${BL2_SRC_OFFSET};\ +@@ -57,8 +54,6 @@ else #SECURE_BOOT + ifeq ($(RCW),"") + ${Q}echo "Platform ${PLAT} requires rcw file. Please set RCW to point to the right RCW file for boot mode ${BOOT_MODE}" + else +- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" --no-print-directory -C ${PLAT_TOOL_PATH}; +- + # Add Block Copy command and populate boot loc ptrfor bl2.bin to RCW + ${CREATE_PBL} -r ${RCW} -i ${BUILD_PLAT}/bl2.bin -b ${BOOT_MODE} -c ${SOC_NUM} -d ${BL2_BASE} -e ${BL2_BASE} \ + -o ${BUILD_PLAT}/bl2_${BOOT_MODE}.pbl -f ${BL2_SRC_OFFSET}; +-- +2.17.1 + diff --git a/package/boot/uboot-ar71xx/patches/023-musl-compat.patch b/package/boot/uboot-ar71xx/patches/023-musl-compat.patch new file mode 100644 index 000000000..1dacc993e --- /dev/null +++ b/package/boot/uboot-ar71xx/patches/023-musl-compat.patch @@ -0,0 +1,13 @@ +--- a/include/compiler.h 2018-08-29 ++++ b/include/compiler.h 2018-08-29 +@@ -46,6 +46,10 @@ extern int errno; + #ifdef __linux__ + # include + # include ++#ifndef __GLIBC__ ++typedef unsigned long ulong; ++typedef unsigned int uint; ++#endif + #elif defined(__MACH__) || defined(__FreeBSD__) + # include + typedef unsigned long ulong; diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile index f0a4ba56c..547b72f8d 100644 --- a/package/boot/uboot-at91/Makefile +++ b/package/boot/uboot-at91/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=linux4sam_5.8 +PKG_VERSION:=linux4sam_6.0 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/linux4sam/u-boot-at91.git -PKG_SOURCE_VERSION:=59f202622154f82e708a6ca2bf86350a5c1b2d33 +PKG_SOURCE_VERSION:=1e7d2e5973c1fb780e55e28a801c6c574158ac14 include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk @@ -26,13 +26,21 @@ endef define U-Boot/at91sam9m10g45ek_nandflash NAME:=AT91SAM9M10G45-EK board (NandFlash) - BUILD_SUBTARGET:=legacy + BUILD_SUBTARGET:=sam9x BUILD_DEVICES:=at91sam9m10g45ek endef define U-Boot/at91sam9x5ek_nandflash NAME:=AT91SAM9X5-EK board (NandFlash) - BUILD_SUBTARGET:=legacy + BUILD_SUBTARGET:=sam9x + BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek \ + at91sam9g35ek at91sam9x25ek \ + at91sam9x35ek +endef + +define U-Boot/at91sam9x5ek_mmc + NAME:=AT91SAM9X5-EK board (SDcard) + BUILD_SUBTARGET:=sam9x BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek \ at91sam9g35ek at91sam9x25ek \ at91sam9x35ek @@ -40,73 +48,74 @@ endef define U-Boot/sama5d3_xplained_nandflash NAME:=SAMA5D3 Xplained board (NandFlash) - BUILD_SUBTARGET:=sama5d3 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d3_xplained endef define U-Boot/sama5d3_xplained_mmc NAME:=SAMA5D3 Xplained board (SDcard) - BUILD_SUBTARGET:=sama5d3 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d3_xplained endef define U-Boot/sama5d2_xplained_spiflash NAME:=SAMA5D2 Xplained board (SPI Flash) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d2_xplained endef define U-Boot/sama5d2_xplained_mmc NAME:=SAMA5D2 Xplained board (SDcard/EMMC) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d2_xplained endef define U-Boot/sama5d4_xplained_spiflash NAME:=SAMA5D4 Xplained board (SPI Flash) - BUILD_SUBTARGET:=sama5d4 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d4_xplained endef define U-Boot/sama5d4_xplained_mmc NAME:=SAMA5D4 Xplained board (SDcard) - BUILD_SUBTARGET:=sama5d4 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d4_xplained endef define U-Boot/sama5d4_xplained_nandflash NAME:=SAMA5D4 Xplained board (NandFlash) - BUILD_SUBTARGET:=sama5d4 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d4_xplained endef -define U-Boot/sama5d27_som1_ek_mmc - NAME:=SAMA5D27 SOM1 Ek (SDCard) - BUILD_SUBTARGET:=sama5d2 +define U-Boot/sama5d27_som1_ek_mmc1 + NAME:=SAMA5D27 SOM1 Ek (SDCard1) + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d27_som1_ek endef -define U-Boot/sama5d27_som1_ek_spiflash +define U-Boot/sama5d27_som1_ek_qspiflash NAME:=SAMA5D27 SOM1 Ek (QSPI Flash) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d27_som1_ek endef define U-Boot/sama5d2_ptc_ek_nandflash NAME:=SAMA5D2 PTC Ek (Nand Flash) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d2_ptc_ek endef define U-Boot/sama5d2_ptc_ek_mmc NAME:=SAMA5D2 PTC Ek (SDCard) - BUILD_SUBTARGET:=sama5d2 + BUILD_SUBTARGET:=sama5 BUILD_DEVICES:=at91-sama5d2_ptc_ek endef UBOOT_TARGETS := \ at91sam9m10g45ek_nandflash \ at91sam9x5ek_nandflash \ + at91sam9x5ek_mmc \ sama5d3_xplained_nandflash \ sama5d3_xplained_mmc \ sama5d2_xplained_mmc \ @@ -114,15 +123,15 @@ UBOOT_TARGETS := \ sama5d4_xplained_mmc \ sama5d4_xplained_spiflash \ sama5d4_xplained_nandflash\ - sama5d27_som1_ek_mmc \ - sama5d27_som1_ek_spiflash \ + sama5d27_som1_ek_mmc1 \ + sama5d27_som1_ek_qspiflash \ sama5d2_ptc_ek_nandflash \ sama5d2_ptc_ek_mmc define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ CROSS_COMPILE=$(TARGET_CROSS) \ - DTC=$(LINUX_DIR)/scripts/dtc/dtc \ + DTC=$(PKG_BUILD_DIR)/scripts/dtc/dtc \ KCFLAGS="$(filter-out -fstack-protector \ -mfloat-abi=hard, $(TARGET_CFLAGS)) -mfloat-abi=soft" endef diff --git a/package/boot/uboot-at91/patches/001-fix-Wformat-security.patch b/package/boot/uboot-at91/patches/001-fix-Wformat-security.patch new file mode 100644 index 000000000..18f9af742 --- /dev/null +++ b/package/boot/uboot-at91/patches/001-fix-Wformat-security.patch @@ -0,0 +1,13 @@ +diff --git a/cmd/version.c b/cmd/version.c +index b2fffe9..bcbbeb1 100644 +--- a/cmd/version.c ++++ b/cmd/version.c +@@ -18,7 +18,7 @@ static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) + { + char buf[DISPLAY_OPTIONS_BANNER_LENGTH]; + +- printf(display_options_get_banner(false, buf, sizeof(buf))); ++ printf("%s",display_options_get_banner(false, buf, sizeof(buf))); + #ifdef CC_VERSION_STRING + puts(CC_VERSION_STRING "\n"); + #endif diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 15579e966..1c6b78971 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -9,16 +9,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot -PKG_VERSION:=2018.03 -PKG_RELEASE:=3 +PKG_VERSION:=2019.07 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_SUBDIR:=$(PKG_DISTNAME)-$(PKG_VERSION) PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_DISTNAME)-$(PKG_VERSION) PKG_SOURCE_URL:=https://git.denx.de/u-boot.git -PKG_SOURCE_VERSION:=f95ab1fb6e37f0601f397091bb011edf7a98b890 -PKG_MIRROR_HASH:=b50d8b6fe0d90b92c8c147457b1b4c2ed1cdb03191085cfc57fdad77c0bfffab +PKG_SOURCE_VERSION:=e5aee22e4be75e75a854ab64503fc80598bc2004 +PKG_MIRROR_HASH:=58c1ecaf901b6bf65c5e872b5449b642694ae5acebf61f91f0d4bc20b4c654b7 PKG_BUILD_DEPENDS:=fstools diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx index bc415e3b8..9625c6bdd 100644 --- a/package/boot/uboot-envtools/files/ar71xx +++ b/package/boot/uboot-envtools/files/ar71xx @@ -85,6 +85,11 @@ dr342|\ dr531) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000" ;; +gl-ar150|\ +gl-domino|\ +gl-mifi) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" + ;; rambutan) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ubootenv_add_uci_config "/dev/mtd1" "0x100000" "0x20000" "0x20000" diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index f7fad079c..15bd9ffb6 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -13,16 +13,25 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in -buffalo,wzr-hp-ag300h) - ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" - ;; +alfa-network,ap121f|\ buffalo,bhr-4grv2|\ engenius,ecb1750|\ +etactica,eg200|\ +glinet,gl-ar300m-lite|\ glinet,gl-ar300m-nand|\ glinet,gl-ar300m-nor|\ +glinet,gl-ar300m16|\ +glinet,gl-ar750s-nor|\ +glinet,gl-ar750s-nor-nand|\ librerouter,librerouter-v1|\ netgear,ex6400|\ netgear,ex7300|\ +netgear,wndr4300-v2|\ +netgear,wndr4500-v3|\ +netgear,wnr1000-v2|\ +netgear,wnr2000-v3|\ +netgear,wnr2200-8m|\ +netgear,wnr2200-16m|\ netgear,wnr612-v2|\ ocedo,koala|\ ocedo,raccoon|\ @@ -32,9 +41,23 @@ yuncore,a782|\ yuncore,xd4200) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; -netgear,wndr3700) +buffalo,wzr-hp-ag300h) + ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" + ;; +glinet,gl-ar150) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x8000" "0x10000" + ;; +netgear,wndr3700|\ +netgear,wndr3700-v2) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x10000" ;; +netgear,wndr3700-v4|\ +netgear,wndr4300) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000" + ;; +qihoo,c301) + ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" + ;; esac config_load ubootenv diff --git a/package/boot/uboot-envtools/files/imx6 b/package/boot/uboot-envtools/files/imx6 index fb05f1334..330efb283 100644 --- a/package/boot/uboot-envtools/files/imx6 +++ b/package/boot/uboot-envtools/files/imx6 @@ -24,8 +24,8 @@ apalis*) ubootenv_add_uci_config /dev/mtd1 0x80000 0x20000 0x40000 else # board boots from microSD - ubootenv_add_uci_config /dev/mmcblk0 0xb1400 0x20000 0x20000 - ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000 0x20000 + ubootenv_add_uci_config /dev/mmcblk0 0xb1400 0x20000 + ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000 fi ;; wandboard) diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index c2e746d95..7902384a3 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -36,6 +36,9 @@ linksys,rango|\ linksys,venom) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ;; +methode,udpu) + ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000" + ;; esac config_load ubootenv diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 01171ead1..ade55dd1c 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -20,17 +20,17 @@ alfa-network,r36m-e4g|\ alfa-network,tube-e4g) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000" ;; -all0256n-4M|\ -all0256n-8M|\ -all5002) +allnet,all0256n-4m|\ +allnet,all0256n-8m|\ +allnet,all5002) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; -linkits7688|\ -miwifi-nano|\ -sk-wb8|\ -wsr-1166|\ -wsr-600|\ -zbt-wg2626) +buffalo,wsr-1166dhp|\ +buffalo,wsr-600dhp|\ +mediatek,linkit-smart-7688|\ +samknows,whitebox-v8|\ +xiaomi,miwifi-nano|\ +zbtlink,zbt-wg2626) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" ;; xiaomi,mir3p|\ diff --git a/package/boot/uboot-envtools/files/uboot-envtools.sh b/package/boot/uboot-envtools/files/uboot-envtools.sh index e21b28367..9218bc4e3 100644 --- a/package/boot/uboot-envtools/files/uboot-envtools.sh +++ b/package/boot/uboot-envtools/files/uboot-envtools.sh @@ -31,6 +31,6 @@ ubootenv_add_app_config() { config_get envsize "$1" envsize config_get secsize "$1" secsize config_get numsec "$1" numsec - echo "$dev $offset $envsize $secsize $numsec" >>/etc/fw_env.config + grep -q "^[[:space:]]*${dev}[[:space:]]*${offset}" /etc/fw_env.config || echo "$dev $offset $envsize $secsize $numsec" >>/etc/fw_env.config } diff --git a/package/boot/uboot-envtools/patches/001-compile.patch b/package/boot/uboot-envtools/patches/001-compile.patch index 098772f55..5413aa4a4 100644 --- a/package/boot/uboot-envtools/patches/001-compile.patch +++ b/package/boot/uboot-envtools/patches/001-compile.patch @@ -1,6 +1,6 @@ --- a/tools/env/Makefile +++ b/tools/env/Makefile -@@ -10,6 +10,13 @@ +@@ -8,6 +8,13 @@ # with "CC" here for the maximum code reuse of scripts/Makefile.host. override HOSTCC = $(CC) @@ -12,5 +12,5 @@ +endif + # Compile for a hosted environment on the target - HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \ - -idirafter $(srctree)/tools/env \ + HOST_EXTRACFLAGS = -I$(srctree)/tools \ + $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \ diff --git a/package/boot/uboot-fritz4040/Makefile b/package/boot/uboot-fritz4040/Makefile index 3d8c8fb4b..213058176 100644 --- a/package/boot/uboot-fritz4040/Makefile +++ b/package/boot/uboot-fritz4040/Makefile @@ -10,9 +10,9 @@ include $(INCLUDE_DIR)/kernel.mk PKG_SOURCE_URL:=https://github.com/chunkeey/FritzBox-4040-UBOOT PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=5da78cca60814ea31065a50376d9c905425b03a1 -PKG_SOURCE_DATE:=2018-12-09 -PKG_MIRROR_HASH:=ff7bc2498de1066dde24d7ef68e440c3847244a5b8bb35ce4275e3918f230aa3 +PKG_SOURCE_VERSION:=f92be9d783b1210c020d5d6129e210a94bb7e290 +PKG_SOURCE_DATE:=2019-10-19 +PKG_MIRROR_HASH:=e40a7f624b1758b276f81c765ef1da568c595b8bd54568b9cceca7d170ebc612 PKG_RELEASE:=1 @@ -21,11 +21,29 @@ include $(INCLUDE_DIR)/package.mk define U-Boot/Default BUILD_TARGET:=ipq40xx - UBOOT_IMAGE:=uboot-fritz4040.bin + BUILD_SUBTARGET:=generic + UBOOT_BOARD:=$(1) + UBOOT_IMAGE:=uboot-$(1).bin +endef + +define U-Boot/fritz1200 + NAME:=FritzRepeater 1200 + BUILD_DEVICES:=avm_fritzrepeater-1200 +endef + +define U-Boot/fritz3000 + NAME:=FritzRepeater 3000 + BUILD_DEVICES:=avm_fritzrepeater-3000 endef define U-Boot/fritz4040 NAME:=FritzBox 4040 + BUILD_DEVICES:=avm_fritzbox-4040 +endef + +define U-Boot/fritz7530 + NAME:=FritzBox 7530 + BUILD_DEVICES:=avm_fritzbox-7530 endef UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes @@ -34,14 +52,19 @@ export DTC define Build/Configure $(Build/Configure/U-Boot) - $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c - $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c + $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c -lz + $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c ln -sf $(STAGING_DIR_HOST)/bin/lzma $(PKG_BUILD_DIR)/fritz endef define Build/Compile $(Build/Compile/U-Boot) - (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh;) + (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh $(UBOOT_BOARD);) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(UBOOT_IMAGE) endef define Package/u-boot/install @@ -49,6 +72,6 @@ define Package/u-boot/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/upload-to-f4040.sh $(1)/ endef -UBOOT_TARGETS := fritz4040 +UBOOT_TARGETS := fritz1200 fritz3000 fritz4040 fritz7530 $(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-imx6/Makefile b/package/boot/uboot-imx6/Makefile index 3eba249bf..193a35d27 100644 --- a/package/boot/uboot-imx6/Makefile +++ b/package/boot/uboot-imx6/Makefile @@ -7,10 +7,10 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=2018.03 +PKG_VERSION:=2019.04 PKG_RELEASE:=1 -PKG_HASH:=7e7477534409d5368eb1371ffde6820f0f79780a1a1f676161c48442cb303dfd +PKG_HASH:=76b7772d156b3ddd7644c8a1736081e55b78828537ff714065d21dbade229bef include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk @@ -20,6 +20,12 @@ define U-Boot/Default UBOOT_IMAGE:=u-boot.imx endef +define U-Boot/apalis_imx6 + NAME:=Toradex Apalis + UBOOT_IMAGE:=SPL u-boot.img u-boot-with-spl.imx + UBOOT_MAKE_FLAGS:=SPL u-boot.img u-boot-with-spl.imx +endef + define U-Boot/mx6cuboxi NAME:=SolidRun Cubox-i boards UBOOT_IMAGE:=SPL u-boot.img @@ -62,6 +68,7 @@ define U-Boot/wandboard endef UBOOT_TARGETS := \ + apalis_imx6 \ mx6cuboxi \ mx6sabresd \ nitrogen6dl \ diff --git a/package/boot/uboot-imx6/patches/0001-imx6-apalis-Make-the-boot-process-more-generic.patch b/package/boot/uboot-imx6/patches/0001-imx6-apalis-Make-the-boot-process-more-generic.patch new file mode 100644 index 000000000..4de8ede39 --- /dev/null +++ b/package/boot/uboot-imx6/patches/0001-imx6-apalis-Make-the-boot-process-more-generic.patch @@ -0,0 +1,123 @@ +From 42cc2cffb6d550fbb21dad033d2564d4da571015 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= +Date: Sat, 1 Dec 2018 12:46:37 +0100 +Subject: [PATCH] imx6: apalis: Make the boot process more generic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +I'm preparing support for Apalis imx6 boards in OpenWrt and I've ended +up with quite huge patchset against upstream U-Boot 2018.03, so I'm +trying to propose more generic way of boot process handling. + +In OpenWrt we usually have kernel, dtbs and U-Boot boot script in boot +partition with ext4fs, so for some use cases it would be handy to be +able to replace some of the files in the boot partion, that's why I've +added write support to the ext4. + +I've added `set_blkcnt` environment variable which is needed for every +`mmc write` command as we need to always specify size in block count. +This is copy&pasted from official Toradex's flashing scripts, so all the +credits for this work belongs to them. + +Currently the rootfs location is passed via mmcblk number and the +problem with this approach is that the mmcblk number for the boot device +changes depending on the kernel version and imx6 SoC type. In order to +avoid such issues, use the UUID method to specify the rootfs location. + +I've added new boot sequence, where we first try to load and run boot +script defined in the new `script` variable, so the boot process could +be more generic and overridden by the distro. When the boot script isn't +loaded, it will use the previous boot sequence so it should be backward +compatible. + +For the recovery purposes and better end user experience I've added boot +from SDP as the last boot command if every other boot option fails. I +plan to use SDP as official flashing/recovery procedure in OpenWrt for +Apalis imx6 boards. + +I've copy&pasted almost everything from the `f086812a mx6sxsabresd: Use +PARTUUID to specify the rootfs location` commit, so credits for the rest +of this patch belongs to Fabio. + +Cc: Stefan Agner +Cc: Max Krummenacher +Signed-off-by: Petr Štetiar +--- + configs/apalis_imx6_defconfig | 2 ++ + include/configs/apalis_imx6.h | 26 +++++++++++++++++++++----- + 2 files changed, 23 insertions(+), 5 deletions(-) + +--- a/configs/apalis_imx6_defconfig ++++ b/configs/apalis_imx6_defconfig +@@ -40,6 +40,7 @@ CONFIG_CMD_DFU=y + CONFIG_CMD_GPIO=y + CONFIG_CMD_I2C=y + CONFIG_CMD_MMC=y ++CONFIG_CMD_PART=y + CONFIG_CMD_USB=y + CONFIG_CMD_USB_SDP=y + CONFIG_CMD_USB_MASS_STORAGE=y +@@ -49,6 +50,7 @@ CONFIG_CMD_PING=y + CONFIG_CMD_BMP=y + CONFIG_CMD_CACHE=y + CONFIG_CMD_EXT4=y ++CONFIG_CMD_EXT4_WRITE=y + CONFIG_CMD_FAT=y + CONFIG_CMD_FS_GENERIC=y + CONFIG_ENV_IS_IN_MMC=y +--- a/include/configs/apalis_imx6.h ++++ b/include/configs/apalis_imx6.h +@@ -138,9 +138,9 @@ + "imx6q-colibri-cam-eval-v3.dtb fat 0 1" + + #define EMMC_BOOTCMD \ +- "emmcargs=ip=off root=/dev/mmcblk0p2 rw,noatime rootfstype=ext3 " \ ++ "emmcargs=ip=off root=PARTUUID=${uuid} rw,noatime rootfstype=ext3 " \ + "rootwait\0" \ +- "emmcboot=run setup; " \ ++ "emmcboot=run setup; run finduuid;" \ + "setenv bootargs ${defargs} ${emmcargs} ${setupargs} " \ + "${vidargs}; echo Booting from internal eMMC chip...; " \ + "run emmcdtbload; load mmc 0:1 ${kernel_addr_r} " \ +@@ -197,10 +197,17 @@ + #define FDT_FILE "imx6q-apalis_v1_0-eval.dtb" + #endif + #define CONFIG_EXTRA_ENV_SETTINGS \ +- "bootcmd=run emmcboot ; echo ; echo emmcboot failed ; " \ ++ "script=boot.scr\0" \ ++ "finduuid=part uuid mmc 0:2 uuid\0" \ ++ "loadbootscript=" \ ++ "load mmc 0:1 ${loadaddr} ${script};\0" \ ++ "bootscript=echo Running bootscript from mmc ...; " \ ++ "source\0" \ ++ "bootcmd_default=run emmcboot ; echo ; echo emmcboot failed ; " \ + "run nfsboot ; echo ; echo nfsboot failed ; " \ + "usb start ;" \ +- "setenv stdout serial,vga ; setenv stdin serial,usbkbd\0" \ ++ "setenv stdout serial,vga ; setenv stdin serial,usbkbd;" \ ++ "sdp 0\0" \ + "boot_file=uImage\0" \ + "console=ttymxc0\0" \ + "defargs=enable_wait_mode=off vmalloc=400M\0" \ +@@ -228,7 +235,16 @@ + "vidargs=mxc_hdmi.only_cea=1 " \ + "video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 " \ + "video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off " \ +- "fbmem=32M\0 " ++ "fbmem=32M\0 " \ ++ "set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200\0" ++ ++#define CONFIG_BOOTCOMMAND \ ++ "mmc dev 0;" \ ++ "if run loadbootscript; then " \ ++ "run bootscript; " \ ++ "else " \ ++ "run bootcmd_default; " \ ++ "fi; " + + /* Miscellaneous configurable options */ + #undef CONFIG_SYS_CBSIZE +-- +1.9.1 + diff --git a/package/boot/uboot-imx6/patches/100-wandboard-enable-fit.patch b/package/boot/uboot-imx6/patches/100-wandboard-enable-fit.patch index 6bfcc1ff7..2fd207e11 100644 --- a/package/boot/uboot-imx6/patches/100-wandboard-enable-fit.patch +++ b/package/boot/uboot-imx6/patches/100-wandboard-enable-fit.patch @@ -1,6 +1,6 @@ --- a/configs/wandboard_defconfig +++ b/configs/wandboard_defconfig -@@ -27,7 +27,7 @@ CONFIG_CMD_I2C=y +@@ -30,7 +30,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_SATA=y CONFIG_CMD_USB=y @@ -8,8 +8,8 @@ +# CONFIG_CMD_CACHE is not set CONFIG_CMD_EXT4_WRITE=y CONFIG_ENV_IS_IN_MMC=y - CONFIG_DM=y -@@ -39,3 +39,5 @@ CONFIG_USB_STORAGE=y + CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y +@@ -44,3 +44,5 @@ CONFIG_USB=y CONFIG_VIDEO=y # CONFIG_VIDEO_SW_CURSOR is not set CONFIG_OF_LIBFDT=y diff --git a/package/boot/uboot-imx6/patches/110-mx6cuboxi-mmc-fallback.patch b/package/boot/uboot-imx6/patches/110-mx6cuboxi-mmc-fallback.patch index 0883eb7b2..2b2fde5ec 100644 --- a/package/boot/uboot-imx6/patches/110-mx6cuboxi-mmc-fallback.patch +++ b/package/boot/uboot-imx6/patches/110-mx6cuboxi-mmc-fallback.patch @@ -1,7 +1,7 @@ --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c -@@ -334,6 +334,12 @@ int board_init(void) - return ret; +@@ -290,6 +290,12 @@ static void setup_iomux_enet(void) + udelay(100); } +void board_boot_order(u32 *spl_boot_list) @@ -10,12 +10,12 @@ + spl_boot_list[1] = BOOT_DEVICE_MMC1; +} + - static bool is_hummingboard(void) + int board_phy_config(struct phy_device *phydev) { - int val1, val2; + if (phydev->drv->config) --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c -@@ -136,7 +136,7 @@ int g_dnl_bind_fixup(struct usb_device_d +@@ -176,7 +176,7 @@ int g_dnl_bind_fixup(struct usb_device_d /* called from spl_mmc to see type of boot mode for storage (RAW or FAT) */ u32 spl_boot_mode(const u32 boot_device) { diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index e724bdf61..4ce1485a1 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -7,10 +7,10 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=2018.03 +PKG_VERSION:=2019.01 PKG_RELEASE:=1 -PKG_HASH:=7e7477534409d5368eb1371ffde6820f0f79780a1a1f676161c48442cb303dfd +PKG_HASH:=50bd7e5a466ab828914d080d5f6a432345b500e8fba1ad3b7b61e95e60d51c22 include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch index 264c16074..25d252d13 100644 --- a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch +++ b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch @@ -35,14 +35,14 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in config TARGET_NSA310S bool "Zyxel NSA310S" -@@ -80,6 +83,7 @@ source "board/raidsonic/ib62x0/Kconfig" +@@ -86,6 +89,7 @@ source "board/raidsonic/ib62x0/Kconfig" source "board/Seagate/dockstar/Kconfig" source "board/Seagate/goflexhome/Kconfig" source "board/Seagate/nas220/Kconfig" +source "board/zyxel/nsa310/Kconfig" source "board/zyxel/nsa310s/Kconfig" - - endif + source "board/alliedtelesis/SBx81LIFKW/Kconfig" + source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" --- /dev/null +++ b/board/zyxel/nsa310/Kconfig @@ -0,0 +1,12 @@ @@ -505,16 +505,19 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in +#endif /* __NSA310_H */ --- /dev/null +++ b/configs/nsa310_defconfig -@@ -0,0 +1,37 @@ +@@ -0,0 +1,40 @@ +CONFIG_ARM=y +CONFIG_KIRKWOOD=y +CONFIG_SYS_TEXT_BASE=0x600000 +CONFIG_TARGET_NSA310=y +CONFIG_IDENT_STRING="\nZyXEL NSA310 1-Bay Power Media Server" ++CONFIG_NR_DRAM_BANKS=2 +CONFIG_BOOTDELAY=3 +CONFIG_SYS_PROMPT="NSA310> " +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set ++CONFIG_MVGBE=y ++CONFIG_MII=y +CONFIG_SYS_NS16550=y +CONFIG_CMD_FDT=y +CONFIG_OF_LIBFDT=y @@ -545,7 +548,7 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in +CONFIG_SYS_LONGHELP=y --- /dev/null +++ b/include/configs/nsa310.h -@@ -0,0 +1,119 @@ +@@ -0,0 +1,117 @@ +/* Copyright (C) 2015-2016 bodhi + * + * Based on @@ -654,8 +657,6 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in + */ +#define CONFIG_JFFS2_NAND +#define CONFIG_JFFS2_LZO -+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ -+#define CONFIG_MTD_PARTITIONS + +/* + * Date Time diff --git a/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch index 0ce3fe02e..d0bef45f8 100644 --- a/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch +++ b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch @@ -1,22 +1,23 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -62,6 +62,9 @@ config TARGET_NSA310 - config TARGET_NSA310S - bool "Zyxel NSA310S" - +@@ -68,6 +68,9 @@ config TARGET_SBx81LIFKW + config TARGET_SBx81LIFXCAT + bool "Allied Telesis SBx81GP24/SBx81GT24" + +config TARGET_NSA325 + bool "Zyxel NSA325 board" + endchoice - + config SYS_SOC -@@ -85,5 +88,6 @@ source "board/Seagate/goflexhome/Kconfig +@@ -91,6 +94,7 @@ source "board/Seagate/goflexhome/Kconfig source "board/Seagate/nas220/Kconfig" source "board/zyxel/nsa310/Kconfig" source "board/zyxel/nsa310s/Kconfig" +source "board/zyxel/nsa325/Kconfig" - - endif + source "board/alliedtelesis/SBx81LIFKW/Kconfig" + source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" + --- /dev/null +++ b/board/zyxel/nsa325/Kconfig @@ -0,0 +1,12 @@ @@ -488,16 +489,19 @@ +#endif /* __NSA325_H */ --- /dev/null +++ b/configs/nsa325_defconfig -@@ -0,0 +1,37 @@ +@@ -0,0 +1,40 @@ +CONFIG_ARM=y +CONFIG_KIRKWOOD=y +CONFIG_SYS_TEXT_BASE=0x600000 +CONFIG_TARGET_NSA325=y +CONFIG_IDENT_STRING="\nZyXEL NSA325 2-Bay Power Media Server" ++CONFIG_NR_DRAM_BANKS=2 +CONFIG_BOOTDELAY=3 +CONFIG_SYS_PROMPT="NSA325> " +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set ++CONFIG_MVGBE=y ++CONFIG_MII=y +CONFIG_SYS_NS16550=y +CONFIG_CMD_FDT=y +CONFIG_OF_LIBFDT=y @@ -528,7 +532,7 @@ +CONFIG_SYS_LONGHELP=y --- /dev/null +++ b/include/configs/nsa325.h -@@ -0,0 +1,122 @@ +@@ -0,0 +1,120 @@ +/* + * (C) Copyright 2016 bodhi + * @@ -638,8 +642,6 @@ + */ +#define CONFIG_JFFS2_NAND +#define CONFIG_JFFS2_LZO -+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ -+#define CONFIG_MTD_PARTITIONS + +/* + * Date Time diff --git a/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch b/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch index 568c8bf5f..8aed96ad1 100644 --- a/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch +++ b/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch @@ -10,7 +10,7 @@ config TARGET_DNS325 bool "dns325 Board" -@@ -77,6 +80,7 @@ source "board/Marvell/guruplug/Kconfig" +@@ -83,6 +86,7 @@ source "board/Marvell/guruplug/Kconfig" source "board/Marvell/sheevaplug/Kconfig" source "board/buffalo/lsxl/Kconfig" source "board/cloudengines/pogo_e02/Kconfig" @@ -20,7 +20,7 @@ source "board/keymile/km_arm/Kconfig" --- a/arch/arm/mach-kirkwood/include/mach/kw88f6192.h +++ b/arch/arm/mach-kirkwood/include/mach/kw88f6192.h -@@ -16,6 +16,6 @@ +@@ -15,6 +15,6 @@ #define KW_REGS_PHY_BASE KW88F6192_REGS_PHYS_BASE /* TCLK Core Clock defination */ @@ -30,7 +30,7 @@ #endif /* _CONFIG_KW88F6192_H */ --- a/arch/arm/mach-kirkwood/include/mach/mpp.h +++ b/arch/arm/mach-kirkwood/include/mach/mpp.h -@@ -217,10 +217,12 @@ +@@ -216,10 +216,12 @@ #define MPP33_GPIO MPP( 33, 0x0, 1, 1, 0, 1, 1, 1 ) #define MPP33_TDM_DTX MPP( 33, 0x2, 0, 1, 0, 0, 1, 1 ) #define MPP33_GE1_13 MPP( 33, 0x3, 0, 0, 0, 1, 1, 1 ) @@ -532,16 +532,19 @@ +#endif /* __POGOPLUGV4_H */ --- /dev/null +++ b/configs/pogoplugv4_defconfig -@@ -0,0 +1,40 @@ +@@ -0,0 +1,43 @@ +CONFIG_ARM=y +CONFIG_KIRKWOOD=y +CONFIG_SYS_TEXT_BASE=0x600000 +CONFIG_TARGET_POGOPLUGV4=y +CONFIG_SYS_PROMPT="pogoplugv4> " +CONFIG_IDENT_STRING="\nPogoplug V4" ++CONFIG_NR_DRAM_BANKS=2 +CONFIG_BOOTDELAY=3 +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set ++CONFIG_MVGBE=y ++CONFIG_MII=y +CONFIG_SYS_NS16550=y +CONFIG_CMD_FDT=y +CONFIG_OF_LIBFDT=y @@ -575,7 +578,7 @@ +CONFIG_SYS_LONGHELP=y --- a/drivers/gpio/kw_gpio.c +++ b/drivers/gpio/kw_gpio.c -@@ -148,3 +148,36 @@ void kw_gpio_set_blink(unsigned pin, int +@@ -147,3 +147,36 @@ void kw_gpio_set_blink(unsigned pin, int /* Set blinking. */ __set_blinking(pin, blink); } @@ -621,7 +624,7 @@ +obj-$(CONFIG_KIRKWOOD_MMC) += kirkwood_mmc.o obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o - obj-$(CONFIG_MMC_UNIPHIER) += uniphier-sd.o + obj-$(CONFIG_MMC_UNIPHIER) += tmio-common.o uniphier-sd.o --- /dev/null +++ b/drivers/mmc/kirkwood_mmc.c @@ -0,0 +1,482 @@ @@ -1109,8 +1112,8 @@ +} --- a/include/configs/mv-common.h +++ b/include/configs/mv-common.h -@@ -117,4 +117,10 @@ - #define CONFIG_MTD_PARTITIONS +@@ -77,4 +77,10 @@ + #define CONFIG_SYS_MAX_NAND_DEVICE 1 #endif +/* @@ -1122,7 +1125,7 @@ #endif /* _MV_COMMON_H */ --- /dev/null +++ b/include/configs/pogoplugv4.h -@@ -0,0 +1,129 @@ +@@ -0,0 +1,127 @@ +/* + * Copyright (C) 2014-2016 bodhi + * Based on @@ -1229,8 +1232,6 @@ + */ +#define CONFIG_JFFS2_NAND +#define CONFIG_JFFS2_LZO -+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ -+#define CONFIG_MTD_PARTITIONS + +/* + * SATA diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch b/package/boot/uboot-kirkwood/patches/110-dockstar.patch index ff2c33877..f060c33c6 100644 --- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch +++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch @@ -1,6 +1,6 @@ --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -18,6 +18,7 @@ +@@ -17,6 +17,7 @@ #define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ #define CONFIG_KW88F6281 1 /* SOC Name */ #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ @@ -8,7 +8,7 @@ /* * mv-common.h should be defined after CMD configs since it used them -@@ -36,27 +37,22 @@ +@@ -35,27 +36,22 @@ * it has to be rounded to sector size */ #define CONFIG_ENV_SIZE 0x20000 /* 128k */ @@ -46,12 +46,12 @@ * Ethernet Driver configuration --- a/configs/dockstar_defconfig +++ b/configs/dockstar_defconfig -@@ -16,7 +16,7 @@ CONFIG_CMD_PING=y - CONFIG_CMD_EXT2=y +@@ -18,7 +18,7 @@ CONFIG_CMD_PING=y CONFIG_CMD_FAT=y CONFIG_CMD_JFFS2=y + CONFIG_CMD_MTDPARTS=y -CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1m(uboot),-(root)" +CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)" CONFIG_CMD_UBI=y CONFIG_ISO_PARTITION=y - CONFIG_ENV_IS_IN_NAND=y + CONFIG_OF_CONTROL=y diff --git a/package/boot/uboot-kirkwood/patches/120-iconnect.patch b/package/boot/uboot-kirkwood/patches/120-iconnect.patch index 114aa1559..e7acf1a27 100644 --- a/package/boot/uboot-kirkwood/patches/120-iconnect.patch +++ b/package/boot/uboot-kirkwood/patches/120-iconnect.patch @@ -1,6 +1,6 @@ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -44,24 +44,22 @@ +@@ -42,24 +42,22 @@ #define CONFIG_ENV_SECT_SIZE 0x20000 #endif #define CONFIG_ENV_SIZE 0x20000 @@ -32,7 +32,7 @@ * Ethernet driver configuration --- a/configs/iconnect_defconfig +++ b/configs/iconnect_defconfig -@@ -10,12 +10,13 @@ CONFIG_SYS_PROMPT="iconnect => " +@@ -11,13 +11,14 @@ CONFIG_SYS_PROMPT="iconnect => " CONFIG_CMD_NAND=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set @@ -42,8 +42,9 @@ CONFIG_CMD_EXT2=y CONFIG_CMD_FAT=y CONFIG_CMD_JFFS2=y + CONFIG_CMD_MTDPARTS=y -CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0x80000@0x0(uboot),0x20000@0x80000(uboot_env),-@0xa0000(rootfs)" +CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)" CONFIG_CMD_UBI=y CONFIG_ISO_PARTITION=y - CONFIG_ENV_IS_IN_NAND=y + CONFIG_OF_CONTROL=y diff --git a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch index 269cf7336..2327c4a91 100644 --- a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch +++ b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch @@ -1,6 +1,6 @@ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -49,21 +49,15 @@ +@@ -47,21 +47,15 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ @@ -29,12 +29,12 @@ * Ethernet driver configuration --- a/configs/ib62x0_defconfig +++ b/configs/ib62x0_defconfig -@@ -19,7 +19,7 @@ CONFIG_CMD_PING=y - CONFIG_CMD_EXT2=y +@@ -21,7 +21,7 @@ CONFIG_CMD_PING=y CONFIG_CMD_FAT=y CONFIG_CMD_JFFS2=y + CONFIG_CMD_MTDPARTS=y -CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),-@0x100000(root)" +CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)" CONFIG_CMD_UBI=y CONFIG_ISO_PARTITION=y - CONFIG_ENV_IS_IN_NAND=y + CONFIG_OF_CONTROL=y diff --git a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch index 26217fadd..69e21e60f 100644 --- a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch +++ b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch @@ -1,6 +1,6 @@ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -44,23 +44,23 @@ +@@ -42,23 +42,23 @@ #endif #define CONFIG_ENV_SIZE 0x20000 /* 128k */ @@ -36,11 +36,11 @@ * Ethernet Driver configuration --- a/configs/pogo_e02_defconfig +++ b/configs/pogo_e02_defconfig -@@ -16,6 +16,7 @@ CONFIG_CMD_PING=y - CONFIG_CMD_EXT2=y +@@ -18,6 +18,7 @@ CONFIG_CMD_PING=y CONFIG_CMD_FAT=y CONFIG_CMD_JFFS2=y + CONFIG_CMD_MTDPARTS=y +CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)" CONFIG_CMD_UBI=y CONFIG_ISO_PARTITION=y - CONFIG_ENV_IS_IN_NAND=y + CONFIG_OF_CONTROL=y diff --git a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch index 2104b67b5..854a1800c 100644 --- a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch +++ b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch @@ -1,6 +1,6 @@ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -69,17 +69,15 @@ +@@ -66,17 +66,15 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ @@ -24,12 +24,12 @@ * Ethernet Driver configuration --- a/configs/goflexhome_defconfig +++ b/configs/goflexhome_defconfig -@@ -21,7 +21,7 @@ CONFIG_CMD_EXT4=y - CONFIG_CMD_FAT=y +@@ -23,7 +23,7 @@ CONFIG_CMD_EXT4=y CONFIG_CMD_JFFS2=y + CONFIG_CMD_MTDPARTS=y CONFIG_MTDIDS_DEFAULT="nand0=orion_nand" -CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)" +CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1m(uboot),255m(ubi)" CONFIG_CMD_UBI=y CONFIG_ISO_PARTITION=y - CONFIG_ENV_IS_IN_NAND=y + CONFIG_OF_CONTROL=y diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index 6400e5bb6..f26675182 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,8 +1,8 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -94,4 +94,7 @@ source "board/zyxel/nsa310/Kconfig" - source "board/zyxel/nsa310s/Kconfig" - source "board/zyxel/nsa325/Kconfig" +@@ -102,4 +102,7 @@ source "board/zyxel/nsa310/Kconfig" + source "board/alliedtelesis/SBx81LIFKW/Kconfig" + source "board/alliedtelesis/SBx81LIFXCAT/Kconfig" +config SECOND_STAGE + bool "OpenWrt second stage hack" @@ -10,16 +10,16 @@ endif --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -68,4 +68,6 @@ - #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ - #define CONFIG_MTD_PARTITIONS +@@ -65,4 +65,6 @@ + * File system + */ +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_DOCKSTAR_H */ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -87,4 +87,6 @@ +@@ -85,4 +85,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ @@ -28,9 +28,9 @@ #endif /* _CONFIG_IB62x0_H */ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -76,4 +76,6 @@ - #define CONFIG_MTD_DEVICE - #define CONFIG_MTD_PARTITIONS +@@ -72,4 +72,6 @@ + * File system + */ +#include "openwrt-kirkwood-common.h" + @@ -71,25 +71,25 @@ +#endif /* __OPENWRT_KIRKWOOD_COMMON_H */ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -76,4 +76,6 @@ - #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ - #define CONFIG_MTD_PARTITIONS +@@ -72,4 +72,6 @@ + * File system + */ +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_POGO_E02_H */ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -101,4 +101,6 @@ - #define CONFIG_RTC_MV - #endif /* CONFIG_CMD_DATE */ +@@ -91,4 +91,6 @@ + #define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET + #endif /*CONFIG_MVSATA_IDE*/ +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_GOFLEXHOME_H */ --- a/include/configs/nsa310.h +++ b/include/configs/nsa310.h -@@ -116,4 +116,6 @@ +@@ -114,4 +114,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ @@ -98,10 +98,10 @@ #endif /* _CONFIG_NSA310_H */ --- a/configs/dockstar_defconfig +++ b/configs/dockstar_defconfig -@@ -26,3 +26,8 @@ CONFIG_USB=y +@@ -31,3 +31,8 @@ CONFIG_USB=y + CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y - CONFIG_OF_LIBFDT=y +CONFIG_CMD_BOOTZ=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y @@ -109,10 +109,10 @@ +CONFIG_LZO=y --- a/configs/goflexhome_defconfig +++ b/configs/goflexhome_defconfig -@@ -32,3 +32,8 @@ CONFIG_USB=y +@@ -40,3 +40,8 @@ CONFIG_USB=y + CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y - CONFIG_OF_LIBFDT=y +CONFIG_CMD_BOOTZ=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y @@ -120,24 +120,22 @@ +CONFIG_LZO=y --- a/configs/ib62x0_defconfig +++ b/configs/ib62x0_defconfig -@@ -29,5 +29,8 @@ CONFIG_SYS_NS16550=y +@@ -35,4 +35,7 @@ CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y -CONFIG_LZMA=y - CONFIG_OF_LIBFDT=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_LZMA=y +CONFIG_LZO=y --- a/configs/iconnect_defconfig +++ b/configs/iconnect_defconfig -@@ -25,5 +25,9 @@ CONFIG_SYS_NS16550=y +@@ -31,4 +31,8 @@ CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y -CONFIG_LZMA=y - CONFIG_OF_LIBFDT=y +CONFIG_CMD_BOOTZ=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y @@ -145,7 +143,7 @@ +CONFIG_LZO=y --- a/configs/nsa310_defconfig +++ b/configs/nsa310_defconfig -@@ -32,6 +32,9 @@ CONFIG_CMD_UBI=y +@@ -35,6 +35,9 @@ CONFIG_CMD_UBI=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y @@ -157,10 +155,10 @@ CONFIG_SYS_LONGHELP=y --- a/configs/pogo_e02_defconfig +++ b/configs/pogo_e02_defconfig -@@ -26,3 +26,8 @@ CONFIG_USB=y +@@ -31,3 +31,8 @@ CONFIG_USB=y + CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_STORAGE=y - CONFIG_OF_LIBFDT=y +CONFIG_CMD_BOOTZ=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y diff --git a/package/boot/uboot-layerscape-armv8_32b/Makefile b/package/boot/uboot-layerscape-armv8_32b/Makefile deleted file mode 100644 index c2b6e75b0..000000000 --- a/package/boot/uboot-layerscape-armv8_32b/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -# -# Copyright (C) 2016 Jiang Yutang -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=uboot-layerscape-armv8_32b -PKG_VERSION:=lsdk-1806 -PKG_RELEASE:=1 - -# Layerscape ARMv8 platforms use 64-bit u-boot to support both 32-bit and 64-bit -# kernel/rootfs. Since OpenWrt could only provide 32-bit toolchain for 32-bit targets, -# 64-bit u-boot images git tree is provided here whose source code actually is -# uboot-layerscape's source code. -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/yangbolu1991/u-boot-lede.git -PKG_SOURCE_VERSION:=a2a01facee0918bf724b4f0aec6746e2f1271519 -PKG_MIRROR_HASH:=5fcb58c14cdc934793ff315e178ad1d9d2ff55fcaac394b48ec116d1b11ca324 - -include $(INCLUDE_DIR)/package.mk - -define Package/uboot-layerscape-armv8_32b/Config - define Package/u-boot-$(1)-image - SECTION:=boot - CATEGORY:=Boot Loaders - TITLE:=$(2) - DEPENDS:=@TARGET_layerscape_armv8_32b - CONFIG:=$(3) - ENV_SIZE:=$(4) - endef -endef - -define Package/uboot-layerscape-armv8_32b/ls1012ardb - TITLE:=U-Boot image for NXP LS1012ARDB - CONFIG:=ls1012ardb-uboot.bin - ENV_SIZE:=0x40000 -endef - -define Package/uboot-layerscape-armv8_32b/ls1012afrwy - TITLE:=U-Boot image for NXP LS1012FRWY - CONFIG:=ls1012afrwy-uboot.bin - ENV_SIZE:=0x10000 -endef - -define Package/uboot-layerscape-armv8_32b/ls1043ardb - TITLE:=U-Boot image for NXP LS1043ARDB - CONFIG:=ls1043ardb-uboot.bin - ENV_SIZE:=0x20000 -endef - -define Package/uboot-layerscape-armv8_32b/ls1046ardb - TITLE:=U-Boot image for NXP LS1046ARDB - CONFIG:=ls1046ardb-uboot.bin - ENV_SIZE:=0x2000 -endef - -define Build/Compile -endef - -define Package/uboot-layerscape-armv8_32b/Install - define Package/u-boot-$(1)-image/install - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/$(CONFIG) $(STAGING_DIR_IMAGE)/ - $(PKG_BUILD_DIR)/tools/mkenvimage -s $(ENV_SIZE) \ - -o $(STAGING_DIR_IMAGE)/$(1)-uboot-env.bin \ - ../uboot-layerscape/files/$(1)-uEnv.txt - endef -endef - -UBOOTS := \ - ls1012ardb \ - ls1012afrwy \ - ls1043ardb \ - ls1046ardb - -$(foreach u,$(UBOOTS), \ - $(eval $(Package/uboot-layerscape-armv8_32b/$(u))) \ - $(eval $(call Package/uboot-layerscape-armv8_32b/Config,$(u),$(TITLE),$(CONFIG),$(ENV_SIZE))) \ - $(eval $(call Package/uboot-layerscape-armv8_32b/Install,$(u))) \ - $(eval $(call BuildPackage,u-boot-$(u)-image)) \ -) diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index 911d9696e..ddf71bd98 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-layerscape -PKG_VERSION:=lsdk-1806 +PKG_VERSION:=lsdk-1903 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot -PKG_SOURCE_VERSION:=b3f98d438eefd1b355efdec0b50af5813ff8d0e1 -PKG_MIRROR_HASH:=59e35957055658e7fdefb16b92f954356985a8191942d93f254861c75c47b32b +PKG_SOURCE_VERSION:=80b2d2bc4cab0a8363c9b7eba8064b1795f12670 +PKG_MIRROR_HASH:=5c467af40b4479f0ea16697ab54602bed815a23212293184943dca8a3a406d5c include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk @@ -29,52 +29,52 @@ endef define U-Boot/ls1012ardb NAME:=NXP LS1012ARDB - UBOOT_CONFIG:=ls1012ardb_qspi + UBOOT_CONFIG:=ls1012ardb_tfa ENV_SIZE:=0x40000 endef define U-Boot/ls1012afrwy NAME:=NXP LS1012AFRWY - UBOOT_CONFIG:=ls1012afrwy_qspi + UBOOT_CONFIG:=ls1012afrwy_tfa ENV_SIZE:=0x10000 endef define U-Boot/ls1043ardb NAME:=NXP LS1043ARDB - ENV_SIZE:=0x20000 + UBOOT_CONFIG:=ls1043ardb_tfa endef define U-Boot/ls1043ardb-sdboot NAME:=NXP LS1043ARDB SD Card Boot - UBOOT_CONFIG:=ls1043ardb_sdcard - UBOOT_IMAGE:=u-boot-with-spl-pbl.bin + UBOOT_CONFIG:=ls1043ardb_tfa endef + define U-Boot/ls1046ardb NAME:=NXP LS1046ARDB - UBOOT_CONFIG:=ls1046ardb_qspi + UBOOT_CONFIG:=ls1046ardb_tfa endef define U-Boot/ls1046ardb-sdboot NAME:=NXP LS1046ARDB SD Card Boot - UBOOT_CONFIG:=ls1046ardb_sdcard - UBOOT_IMAGE:=u-boot-with-spl-pbl.bin + UBOOT_CONFIG:=ls1046ardb_tfa endef + define U-Boot/ls1088ardb NAME:=NXP LS1088ARDB - UBOOT_CONFIG:=ls1088ardb_qspi + UBOOT_CONFIG:=ls1088ardb_tfa endef + define U-Boot/ls1088ardb-sdboot NAME:=NXP LS1088ARDB SD Card Boot - UBOOT_CONFIG:=ls1088ardb_sdcard_qspi - UBOOT_IMAGE:=u-boot-with-spl.bin + UBOOT_CONFIG:=ls1088ardb_tfa endef define U-Boot/ls2088ardb NAME:=NXP LS2088ARDB - UBOOT_CONFIG:=ls2080ardb + UBOOT_CONFIG:=ls2088ardb_tfa endef define U-Boot/ls1021atwr diff --git a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt index 32419dd33..b5faeb255 100644 --- a/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1012ardb-uEnv.txt @@ -3,6 +3,6 @@ loadaddr=0x81000000 fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=9 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.quadspi:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(ubifs) +bootargs=ubi.mtd=8 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.quadspi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(ubifs) bootcmd=echo starting openwrt ...;pfe stop;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt index c78bfe009..b040cffdb 100644 --- a/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1043ardb-uEnv.txt @@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto nor_boot=cp.b 60f00000 $fdtaddr 100000;cp.b 61000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock8 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=60000000.nor:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(rootfs) bootcmd=echo starting openwrt ...;run nor_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt index fecb8fd70..ad3a3d6c3 100644 --- a/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1046ardb-uEnv.txt @@ -4,6 +4,6 @@ fdt_high=0xffffffffffffffff initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=10 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.quadspi:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(ubifs) +bootargs=ubi.mtd=9 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.quadspi:1m(bl2),4m(fip),1m(u-boot-env),3m(reserved-1),256k(fman),5888k(reserved-2),1m(dtb),16m(kernel),32m(ubifs) bootcmd=echo starting openwrt ...;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt index 1bcd7019c..eb2c443b3 100644 --- a/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls1088ardb-uEnv.txt @@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto mc_init=sf probe 0:0;sf read 80000000 a00000 300000;sf read 80300000 e00000 100000;fsl_mc start mc 80000000 80300000;sf read 80400000 d00000 100000;fsl_mc apply dpl 80400000 qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr -bootargs=ubi.mtd=11 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.quadspi:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(ubifs) +bootargs=ubi.mtd=10 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=20c0000.quadspi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(ubifs) bootcmd=echo starting openwrt ...;run mc_init;run qspi_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt b/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt index f3b672554..31e937ffc 100644 --- a/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt +++ b/package/boot/uboot-layerscape/files/ls2088ardb-uEnv.txt @@ -5,6 +5,6 @@ initrd_high=0xffffffffffffffff hwconfig=fsl_ddr:bank_intlv=auto mc_init=fsl_mc start mc 580a00000 580e00000;fsl_mc apply dpl 580d00000 nor_boot=cp.b 580f00000 $fdtaddr 100000;cp.b 581000000 $loadaddr 1000000;bootm $loadaddr - $fdtaddr -bootargs=root=/dev/mtdblock10 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(rcw),2m(u-boot),1m(u-boot-env),2m(ppa),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs) +bootargs=root=/dev/mtdblock9 rootfstype=squashfs,jffs2 noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 mtdparts=580000000.nor:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(mc),1m(dpl),1m(dpc),1m(dtb),16m(kernel),32m(rootfs) bootcmd=echo starting openwrt ...;run mc_init;run nor_boot bootdelay=3 diff --git a/package/boot/uboot-layerscape/patches/0001-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1046ardb-for-.patch b/package/boot/uboot-layerscape/patches/0001-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1046ardb-for-.patch new file mode 100644 index 000000000..d315c08f3 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0001-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1046ardb-for-.patch @@ -0,0 +1,28 @@ +From 51f860f8293d834497c6f7f810fa4650cd82f9ac Mon Sep 17 00:00:00 2001 +From: Biwen Li +Date: Sat, 13 Apr 2019 14:21:47 +0800 +Subject: [PATCH] modify macro QSPI_NOR_BOOTCOMMAND of ls1046ardb for openwrt + +Signed-off-by: Biwen Li +--- + include/configs/ls1046ardb.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h +index cc1f5f5f55..925e717e4b 100644 +--- a/include/configs/ls1046ardb.h ++++ b/include/configs/ls1046ardb.h +@@ -217,8 +217,8 @@ + #ifndef SPL_NO_MISC + #undef CONFIG_BOOTCOMMAND + #ifdef CONFIG_TFABOOT +-#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \ +- "env exists secureboot && esbc_halt;;" ++#define QSPI_NOR_BOOTCOMMAND "echo (from QSPI_NOR_BOOTCOMMAND) starting openwrt; " \ ++ "run qspi_boot;" + #define SD_BOOTCOMMAND "run distro_bootcmd;run sd_bootcmd; " \ + "env exists secureboot && esbc_halt;" + #else +-- +2.17.1 + diff --git a/package/boot/uboot-layerscape/patches/0002-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1012afrwy-for.patch b/package/boot/uboot-layerscape/patches/0002-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1012afrwy-for.patch new file mode 100644 index 000000000..cb75d0e1a --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0002-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1012afrwy-for.patch @@ -0,0 +1,28 @@ +From 2999d128bef554da5ca7a553dfe1c31061df9c5c Mon Sep 17 00:00:00 2001 +From: Biwen Li +Date: Sun, 14 Apr 2019 13:36:52 +0800 +Subject: [PATCH] modify macro QSPI_NOR_BOOTCOMMAND of ls1012afrwy for openwrt + +Signed-off-by: Biwen Li +--- + include/configs/ls1012afrwy.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/configs/ls1012afrwy.h b/include/configs/ls1012afrwy.h +index 12e6437a05..900752970e 100644 +--- a/include/configs/ls1012afrwy.h ++++ b/include/configs/ls1012afrwy.h +@@ -122,8 +122,8 @@ + #undef CONFIG_BOOTCOMMAND + #ifdef CONFIG_TFABOOT + #undef QSPI_NOR_BOOTCOMMAND +-#define QSPI_NOR_BOOTCOMMAND "pfe stop; run distro_bootcmd; run sd_bootcmd; "\ +- "env exists secureboot && esbc_halt;" ++#define QSPI_NOR_BOOTCOMMAND "echo (from QSPI_NOR_BOOTCOMMAND) starting openwrt ...; "\ ++ "pfe stop; run sd_boot;" + #else + #define CONFIG_BOOTCOMMAND "pfe stop; run distro_bootcmd; run sd_bootcmd; "\ + "env exists secureboot && esbc_halt;" +-- +2.17.1 + diff --git a/package/boot/uboot-layerscape/patches/0003-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1012ardb-for-.patch b/package/boot/uboot-layerscape/patches/0003-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1012ardb-for-.patch new file mode 100644 index 000000000..a4f21dfba --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0003-modify-macro-QSPI_NOR_BOOTCOMMAND-of-ls1012ardb-for-.patch @@ -0,0 +1,28 @@ +From 805c60e930a946560b52dfa83dd8e5fbdf2da15b Mon Sep 17 00:00:00 2001 +From: Biwen Li +Date: Sun, 14 Apr 2019 13:39:13 +0800 +Subject: [PATCH] modify macro QSPI_NOR_BOOTCOMMAND of ls1012ardb for openwrt + +Signed-off-by: Biwen Li +--- + include/configs/ls1012ardb.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h +index f6640fa499..51a2192c56 100644 +--- a/include/configs/ls1012ardb.h ++++ b/include/configs/ls1012ardb.h +@@ -115,8 +115,8 @@ + #undef CONFIG_BOOTCOMMAND + #ifdef CONFIG_TFABOOT + #undef QSPI_NOR_BOOTCOMMAND +-#define QSPI_NOR_BOOTCOMMAND "pfe stop; run distro_bootcmd; run qspi_bootcmd; "\ +- "env exists secureboot && esbc_halt;" ++#define QSPI_NOR_BOOTCOMMAND "echo (from QSPI_NOR_BOOTCOMMAND) starting openwrt ...; "\ ++ "pfe stop; run qspi_boot;" + #else + #define CONFIG_BOOTCOMMAND "pfe stop; run distro_bootcmd; run qspi_bootcmd; "\ + "env exists secureboot && esbc_halt;" +-- +2.17.1 + diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 61547acb2..d171daa71 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -8,10 +8,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2018.03 +PKG_VERSION:=2019.04 PKG_RELEASE:=1 -PKG_HASH:=7e7477534409d5368eb1371ffde6820f0f79780a1a1f676161c48442cb303dfd +PKG_HASH:=76b7772d156b3ddd7644c8a1736081e55b78828537ff714065d21dbade229bef include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk @@ -24,13 +24,20 @@ endef define U-Boot/clearfog NAME:=SolidRun ClearFog A1 - BUILD_DEVICES:=armada-388-clearfog-base armada-388-clearfog-pro + BUILD_DEVICES:=solidrun_clearfog-base-a1 solidrun_clearfog-pro-a1 BUILD_SUBTARGET:=cortexa9 UBOOT_IMAGE:=u-boot-spl.kwb endef +define U-Boot/uDPU + NAME:=Methode uDPU + BUILD_DEVICES:=methode_udpu + BUILD_SUBTARGET:=cortexa53 +endef + UBOOT_TARGETS:= \ - clearfog + clearfog \ + uDPU Build/Exports:=$(Host/Exports) @@ -44,7 +51,7 @@ endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot-spl.kwb + $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) endef $(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-mvebu/patches/100-add_support_for_macronix_mx25u12835f.patch b/package/boot/uboot-mvebu/patches/100-add_support_for_macronix_mx25u12835f.patch new file mode 100644 index 000000000..79b1b66e7 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/100-add_support_for_macronix_mx25u12835f.patch @@ -0,0 +1,10 @@ +--- a/drivers/mtd/spi/spi-nor-ids.c ++++ b/drivers/mtd/spi/spi-nor-ids.c +@@ -136,6 +136,7 @@ const struct flash_info spi_nor_ids[] = + { INFO("mx25u1635e", 0xc22535, 0, 64 * 1024, 32, SECT_4K) }, + { INFO("mx25u6435f", 0xc22537, 0, 64 * 1024, 128, SECT_4K) }, + { INFO("mx25l12805d", 0xc22018, 0, 64 * 1024, 256, 0) }, ++ { INFO("mx25u12835f", 0xc22538, 0, 64 * 1024, 256, SECT_4K) }, + { INFO("mx25l12855e", 0xc22618, 0, 64 * 1024, 256, 0) }, + { INFO("mx25l25635e", 0xc22019, 0, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("mx25u25635f", 0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) }, diff --git a/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch b/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch new file mode 100644 index 000000000..580270a70 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/120-mvebu_armada-37xx.h_increase_max_gunzip_size.patch @@ -0,0 +1,13 @@ +Increase max gunzip size in mvebu_armada-37xx.h. +This is required in order to boot itb images. + +--- a/include/configs/mvebu_armada-37xx.h ++++ b/include/configs/mvebu_armada-37xx.h +@@ -12,6 +12,7 @@ + + /* additions for new ARM relocation support */ + #define CONFIG_SYS_SDRAM_BASE 0x00000000 ++#define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */ + + #define CONFIG_NR_DRAM_BANKS 1 + diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile index cd26704cb..04d3f15f9 100644 --- a/package/boot/uboot-mxs/Makefile +++ b/package/boot/uboot-mxs/Makefile @@ -8,10 +8,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2018.09 +PKG_VERSION:=2019.10 PKG_RELEASE:=1 -PKG_HASH:=839bf23cfe8ce613a77e583a60375179d0ad324e92c82fbdd07bebf0fd142268 +PKG_HASH:=8d6d6070739522dd236cba7055b8736bfe92b4fac0ea18ad809829ca79667014 include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch b/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch index e5d3484d8..c7b8fd63e 100644 --- a/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch +++ b/package/boot/uboot-mxs/patches/001-add-i2se-duckbill.patch @@ -1,6 +1,6 @@ -From 7b919a74c562ca33ae28c9214f225a79b57209e4 Mon Sep 17 00:00:00 2001 +From 821d083ae4cfb795eab385eda43a20cdc8c3cacd Mon Sep 17 00:00:00 2001 From: Michael Heimpold -Date: Thu, 13 Sep 2018 21:40:19 +0200 +Date: Sun, 3 Nov 2019 00:50:21 +0100 Subject: [PATCH] arm: mxs: add support for I2SE's Duckbill boards The Duckbill devices are small, pen-drive sized boards based on @@ -32,9 +32,9 @@ Signed-off-by: Stefan Wahren board/i2se/duckbill/Makefile | 10 ++ board/i2se/duckbill/duckbill.c | 186 ++++++++++++++++++++++++++++++++ board/i2se/duckbill/iomux.c | 156 +++++++++++++++++++++++++++ - configs/duckbill_defconfig | 38 +++++++ + configs/duckbill_defconfig | 40 +++++++ include/configs/duckbill.h | 179 ++++++++++++++++++++++++++++++ - 8 files changed, 595 insertions(+) + 8 files changed, 597 insertions(+) create mode 100644 board/i2se/duckbill/Kconfig create mode 100644 board/i2se/duckbill/MAINTAINERS create mode 100644 board/i2se/duckbill/Makefile @@ -43,6 +43,8 @@ Signed-off-by: Stefan Wahren create mode 100644 configs/duckbill_defconfig create mode 100644 include/configs/duckbill.h +diff --git a/arch/arm/mach-imx/mxs/Kconfig b/arch/arm/mach-imx/mxs/Kconfig +index 68072d5a1f..82aaa3ef76 100644 --- a/arch/arm/mach-imx/mxs/Kconfig +++ b/arch/arm/mach-imx/mxs/Kconfig @@ -50,6 +50,10 @@ config TARGET_APX4DEVKIT @@ -64,6 +66,9 @@ Signed-off-by: Stefan Wahren source "board/ppcag/bg0900/Kconfig" source "board/schulercontrol/sc_sps_1/Kconfig" source "board/technologic/ts4600/Kconfig" +diff --git a/board/i2se/duckbill/Kconfig b/board/i2se/duckbill/Kconfig +new file mode 100644 +index 0000000000..98c1e4689f --- /dev/null +++ b/board/i2se/duckbill/Kconfig @@ -0,0 +1,15 @@ @@ -82,6 +87,9 @@ Signed-off-by: Stefan Wahren + default "duckbill" + +endif +diff --git a/board/i2se/duckbill/MAINTAINERS b/board/i2se/duckbill/MAINTAINERS +new file mode 100644 +index 0000000000..5496baa330 --- /dev/null +++ b/board/i2se/duckbill/MAINTAINERS @@ -0,0 +1,6 @@ @@ -91,12 +99,15 @@ Signed-off-by: Stefan Wahren +F: board/i2se/duckbill/ +F: include/configs/duckbill.h +F: configs/duckbill_defconfig +diff --git a/board/i2se/duckbill/Makefile b/board/i2se/duckbill/Makefile +new file mode 100644 +index 0000000000..0079eb413c --- /dev/null +++ b/board/i2se/duckbill/Makefile @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0+ +# -+# (C) Copyright 2014-2018 ++# (C) Copyright 2014-2019 +# Michael Heimpold, mhei@heimpold.de. + +ifndef CONFIG_SPL_BUILD @@ -104,6 +115,9 @@ Signed-off-by: Stefan Wahren +else +obj-y := iomux.o +endif +diff --git a/board/i2se/duckbill/duckbill.c b/board/i2se/duckbill/duckbill.c +new file mode 100644 +index 0000000000..f93c372611 --- /dev/null +++ b/board/i2se/duckbill/duckbill.c @@ -0,0 +1,186 @@ @@ -111,7 +125,7 @@ Signed-off-by: Stefan Wahren +/* + * I2SE Duckbill board + * -+ * (C) Copyright 2014-2018 Michael Heimpold ++ * (C) Copyright 2014-2019 Michael Heimpold + */ + +#include @@ -293,6 +307,9 @@ Signed-off-by: Stefan Wahren + + return 0; +} +diff --git a/board/i2se/duckbill/iomux.c b/board/i2se/duckbill/iomux.c +new file mode 100644 +index 0000000000..1db3c52c34 --- /dev/null +++ b/board/i2se/duckbill/iomux.c @@ -0,0 +1,156 @@ @@ -300,7 +317,7 @@ Signed-off-by: Stefan Wahren +/* + * I2SE Duckbill IOMUX setup + * -+ * Copyright (C) 2013-2018 Michael Heimpold ++ * Copyright (C) 2013-2019 Michael Heimpold + */ + +#include @@ -452,9 +469,12 @@ Signed-off-by: Stefan Wahren + else + mxs_iomux_setup_multiple_pads(iomux_setup_v1, ARRAY_SIZE(iomux_setup_v1)); +} +diff --git a/configs/duckbill_defconfig b/configs/duckbill_defconfig +new file mode 100644 +index 0000000000..5a8c561b4e --- /dev/null +++ b/configs/duckbill_defconfig -@@ -0,0 +1,38 @@ +@@ -0,0 +1,40 @@ +CONFIG_ARM=y +CONFIG_ARCH_MX28=y +CONFIG_SYS_TEXT_BASE=0x40002000 @@ -463,8 +483,9 @@ Signed-off-by: Stefan Wahren +CONFIG_SPL_LIBGENERIC_SUPPORT=y +CONFIG_TARGET_DUCKBILL=y +CONFIG_SPL_SERIAL_SUPPORT=y -+CONFIG_SPL=y +CONFIG_NR_DRAM_BANKS=1 ++CONFIG_SPL=y ++CONFIG_SPL_TEXT_BASE=0x00001000 +CONFIG_BOOTDELAY=1 +CONFIG_SYS_CONSOLE_IS_IN_ENV=y +CONFIG_VERSION_VARIABLE=y @@ -488,17 +509,21 @@ Signed-off-by: Stefan Wahren +CONFIG_CMD_FS_GENERIC=y +CONFIG_DOS_PARTITION=y +CONFIG_ENV_IS_IN_MMC=y ++CONFIG_MXS_GPIO=y +CONFIG_MMC_MXS=y +CONFIG_MII=y +CONFIG_CONS_INDEX=0 +CONFIG_OF_LIBFDT=y +# CONFIG_EFI_LOADER is not set +diff --git a/include/configs/duckbill.h b/include/configs/duckbill.h +new file mode 100644 +index 0000000000..e7fce8843e --- /dev/null +++ b/include/configs/duckbill.h @@ -0,0 +1,179 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* -+ * Copyright (C) 2014-2018 Michael Heimpold ++ * Copyright (C) 2014-2019 Michael Heimpold + * + */ +#ifndef __CONFIGS_DUCKBILL_H__ @@ -613,7 +638,7 @@ Signed-off-by: Stefan Wahren + "mmcroot=/dev/mmcblk0p2\0" \ + "mmcargs=setenv bootargs console=${console},${baudrate} " \ + "root=${mmcroot} " \ -+ "rootwait bootsys=${bootsys} panic=1\0" \ ++ "rootwait bootsys=${bootsys} panic=1 ${extraargs}\0" \ + "loadimage=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} /boot/${image}\0" \ + "loadfdt=ext4load mmc ${mmcdev}:${mmcpart} ${fdt_addr} /boot/${fdt_file}\0" \ + "mmcboot=echo Booting from mmc ...; " \ @@ -636,7 +661,7 @@ Signed-off-by: Stefan Wahren + "nfsroot=/\0" \ + "netargs=setenv bootargs console=${console},${baudrate} " \ + "root=/dev/nfs " \ -+ "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ ++ "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp ${extraargs}\0" \ + "netboot=echo Booting from net ...; " \ + "run netargs; " \ + "if test ${ip_dyn} = yes; then " \ @@ -675,3 +700,6 @@ Signed-off-by: Stefan Wahren +#include + +#endif /* __CONFIGS_DUCKBILL_H__ */ +-- +2.17.1 + diff --git a/package/boot/uboot-omap/Makefile b/package/boot/uboot-omap/Makefile index 69f234d18..70c8af1dc 100644 --- a/package/boot/uboot-omap/Makefile +++ b/package/boot/uboot-omap/Makefile @@ -8,10 +8,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2017.01 -PKG_RELEASE:=3 +PKG_VERSION:=2019.10 +PKG_RELEASE:=1 -PKG_HASH:=6c425175f93a4bcf2ec9faf5658ef279633dbd7856a293d95bd1ff516528ecf2 +PKG_HASH:=8d6d6070739522dd236cba7055b8736bfe92b4fac0ea18ad809829ca79667014 include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk @@ -19,7 +19,6 @@ include $(INCLUDE_DIR)/package.mk define U-Boot/Default BUILD_TARGET:=omap UBOOT_IMAGE:=u-boot.img MLO - UENV:=default endef define U-Boot/omap4_panda @@ -27,14 +26,9 @@ define U-Boot/omap4_panda BUILD_DEVICES:=ti_omap4-panda endef -define U-Boot/am335x_boneblack - NAME:=TI AM335x BeagleBone Black - BUILD_DEVICES:=ti_am335x-bone-black -endef - define U-Boot/am335x_evm NAME:=AM335x EVM - BUILD_DEVICES:=ti_am335x-evm + BUILD_DEVICES:=ti_am335x-evm ti_am335x-bone-black endef define U-Boot/omap3_overo @@ -46,12 +40,19 @@ define U-Boot/omap3_beagle BUILD_DEVICES:=ti_omap3-beagle endef -UBOOT_TARGETS:=omap4_panda am335x_evm omap3_overo omap3_beagle am335x_boneblack +UBOOT_TARGETS:=omap4_panda am335x_evm omap3_overo omap3_beagle define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES) - $(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)/ - $(CP) ./files/uEnv-$(UENV).txt $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)/uEnv.txt + $(foreach device,$(BUILD_DEVICES), \ + $(INSTALL_DIR) $(STAGING_DIR_IMAGE)/$(device) + ) + $(foreach device,$(BUILD_DEVICES), \ + $(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(STAGING_DIR_IMAGE)/$(device)/ + ) + $(foreach device,$(BUILD_DEVICES), \ + mkimage -C none -A arm -T script -d ./files/boot.scr.txt \ + $(STAGING_DIR_IMAGE)/$(device)/boot.scr + ) endef $(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-omap/files/boot.scr.txt b/package/boot/uboot-omap/files/boot.scr.txt new file mode 100644 index 000000000..a97684b0e --- /dev/null +++ b/package/boot/uboot-omap/files/boot.scr.txt @@ -0,0 +1,9 @@ +if test -z "${devnum}"; then + setenv devnum 0 +fi + +setenv bootargs console=${console} root=/dev/mmcblk${devnum}p2 rootwait + +load mmc ${devnum}:1 ${loadaddr} /zImage \ +&& load mmc ${devnum}:1 ${fdtaddr} /dtbs/${fdtfile} \ +&& bootz ${loadaddr} - ${fdtaddr} diff --git a/package/boot/uboot-omap/files/uEnv-default.txt b/package/boot/uboot-omap/files/uEnv-default.txt deleted file mode 100644 index 3584e4379..000000000 --- a/package/boot/uboot-omap/files/uEnv-default.txt +++ /dev/null @@ -1,8 +0,0 @@ -bootpart=0:1 -bootdir=/ -bootfile=zImage -fdtdir=/dtbs -uenvcmd=run loadfdt; run loadimage; run uenvbootargs ; bootz ${loadaddr} - ${fdtaddr} -loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile} -devtype=mmc -uenvbootargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 diff --git a/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch b/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch deleted file mode 100644 index 8a3b024fe..000000000 --- a/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: u-boot-2017.01/include/configs/ti_omap3_common.h -=================================================================== ---- u-boot-2017.01.orig/include/configs/ti_omap3_common.h -+++ u-boot-2017.01/include/configs/ti_omap3_common.h -@@ -80,4 +80,9 @@ - /* Now bring in the rest of the common code. */ - #include - -+/* beagleboard doesnt boot with thumb */ -+#ifdef CONFIG_SYS_THUMB_BUILD -+#undef CONFIG_SYS_THUMB_BUILD -+#endif -+ - #endif /* __CONFIG_TI_OMAP3_COMMON_H__ */ diff --git a/package/boot/uboot-omap/patches/102-minify-spl.patch b/package/boot/uboot-omap/patches/102-minify-spl.patch deleted file mode 100644 index 66f6b6b59..000000000 --- a/package/boot/uboot-omap/patches/102-minify-spl.patch +++ /dev/null @@ -1,44 +0,0 @@ -Index: u-boot-2017.01/configs/omap3_beagle_defconfig -=================================================================== ---- u-boot-2017.01.orig/configs/omap3_beagle_defconfig -+++ u-boot-2017.01/configs/omap3_beagle_defconfig -@@ -7,7 +7,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y - CONFIG_VERSION_VARIABLE=y - CONFIG_SPL=y - CONFIG_SPL_MTD_SUPPORT=y --CONFIG_SPL_OS_BOOT=y -+# CONFIG_SPL_EXT_SUPPORT is not set - # CONFIG_CMD_IMLS is not set - CONFIG_CMD_ASKENV=y - # CONFIG_CMD_FLASH is not set -Index: u-boot-2017.01/common/Makefile -=================================================================== ---- u-boot-2017.01.orig/common/Makefile -+++ u-boot-2017.01/common/Makefile -@@ -174,8 +174,11 @@ obj-$(CONFIG_CMDLINE) += cli_simple.o - obj-y += cli.o - obj-$(CONFIG_CMDLINE) += cli_readline.o - obj-$(CONFIG_CMD_DFU) += dfu.o -+ -+ifndef CONFIG_SPL_BUILD - obj-y += command.o - obj-y += s_record.o - obj-y += xyzModem.o -+endif - - CFLAGS_env_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null) -Index: u-boot-2017.01/cmd/Makefile -=================================================================== ---- u-boot-2017.01.orig/cmd/Makefile -+++ u-boot-2017.01/cmd/Makefile -@@ -161,7 +161,10 @@ endif # !CONFIG_SPL_BUILD - - obj-$(CONFIG_CMD_BLOB) += blob.o - -+ -+# ifndef CONFIG_SPL_BUILD - # core command - obj-y += nvedit.o -+# endif # !CONFIG_SPL_BUILD - - obj-$(CONFIG_ARCH_MVEBU) += mvebu/ diff --git a/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch b/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch deleted file mode 100644 index 89b02044d..000000000 --- a/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch +++ /dev/null @@ -1,27 +0,0 @@ -Index: u-boot-2017.01/fs/fat/Makefile -=================================================================== ---- u-boot-2017.01.orig/fs/fat/Makefile -+++ u-boot-2017.01/fs/fat/Makefile -@@ -4,8 +4,8 @@ - # - - obj-$(CONFIG_FS_FAT) := fat.o --obj-$(CONFIG_FAT_WRITE):= fat_write.o - - ifndef CONFIG_SPL_BUILD -+obj-$(CONFIG_FAT_WRITE):= fat_write.o - obj-$(CONFIG_FS_FAT) += file.o - endif -Index: u-boot-2017.01/fs/fat/fat.c -=================================================================== ---- u-boot-2017.01.orig/fs/fat/fat.c -+++ u-boot-2017.01/fs/fat/fat.c -@@ -163,7 +163,7 @@ static void get_name(dir_entry *dirent, - } - - static int flush_dirty_fat_buffer(fsdata *mydata); --#if !defined(CONFIG_FAT_WRITE) -+#if !defined(CONFIG_FAT_WRITE) || defined(CONFIG_SPL_BUILD) - /* Stub for read only operation */ - int flush_dirty_fat_buffer(fsdata *mydata) - { diff --git a/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch b/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch deleted file mode 100644 index ca928c996..000000000 --- a/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch +++ /dev/null @@ -1,18 +0,0 @@ -Index: u-boot-2017.01/include/configs/omap3_overo.h -=================================================================== ---- u-boot-2017.01.orig/include/configs/omap3_overo.h -+++ u-boot-2017.01/include/configs/omap3_overo.h -@@ -11,6 +11,13 @@ - #define CONFIG_NAND - - #include -+ -+/* try to enable thumb - unknown if it's working -+ * but otherwise it's too big for spl */ -+#ifndef CONFIG_SYS_THUMB_BUILD -+#define CONFIG_SYS_THUMB_BUILD -+#endif -+ - /* - * We are only ever GP parts and will utilize all of the "downloaded image" - * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB). diff --git a/package/boot/uboot-omap/patches/105-serial-ns16550-bugfix-ns16550-fifo-not-enabled.patch b/package/boot/uboot-omap/patches/105-serial-ns16550-bugfix-ns16550-fifo-not-enabled.patch deleted file mode 100644 index 513efaf74..000000000 --- a/package/boot/uboot-omap/patches/105-serial-ns16550-bugfix-ns16550-fifo-not-enabled.patch +++ /dev/null @@ -1,309 +0,0 @@ -From 17fa032671f7981628fe16b30399638842a4b1bb Mon Sep 17 00:00:00 2001 -From: Heiko Schocher -Date: Wed, 18 Jan 2017 08:05:49 +0100 -Subject: [PATCH] serial, ns16550: bugfix: ns16550 fifo not enabled - -commit: 65f83802b7a5b "serial: 16550: Add getfcr accessor" -breaks u-boot commandline working with long commands -sending to the board. - -Since the above patch, you have to setup the fcr register. - -For board/archs which enable OF_PLATDATA, the new field -fcr in struct ns16550_platdata is not filled with a -default value ... - -This leads in not setting up the uarts fifo, which ends -in problems, when you send long commands to u-boots -commandline. - -Detected this issue with automated tbot tests on am335x -based shc board. - -The error does not popup, if you type commands. You need -to copy&paste a long command to u-boots commandshell -(or send a long command with tbot) - -Possible boards/plattforms with problems: -./arch/arm/cpu/arm926ejs/lpc32xx/devices.c -./arch/arm/mach-tegra/board.c -./board/overo/overo.c -./board/quipos/cairo/cairo.c -./board/logicpd/omap3som/omap3logic.c -./board/logicpd/zoom1/zoom1.c -./board/timll/devkit8000/devkit8000.c -./board/lg/sniper/sniper.c -./board/ti/beagle/beagle.c -./drivers/serial/serial_rockchip.c - -Signed-off-by: Heiko Schocher -Signed-off-by: Ladislav Michl -Tested-by: Adam Ford -Reviewed-by: Tom Rini ---- - arch/arm/cpu/arm926ejs/lpc32xx/devices.c | 12 ++++++++---- - arch/arm/mach-omap2/am33xx/board.c | 18 ++++++++++++------ - arch/arm/mach-tegra/board.c | 1 + - board/isee/igep00x0/igep00x0.c | 3 ++- - board/lg/sniper/sniper.c | 3 ++- - board/logicpd/omap3som/omap3logic.c | 3 ++- - board/logicpd/zoom1/zoom1.c | 3 ++- - board/overo/overo.c | 3 ++- - board/quipos/cairo/cairo.c | 3 ++- - board/ti/beagle/beagle.c | 3 ++- - board/timll/devkit8000/devkit8000.c | 3 ++- - drivers/serial/ns16550.c | 9 +++------ - drivers/serial/serial_rockchip.c | 1 + - include/ns16550.h | 5 +++++ - 14 files changed, 46 insertions(+), 24 deletions(-) - -diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/devices.c b/arch/arm/cpu/arm926ejs/lpc32xx/devices.c -index 399b07c5420a..f744398ca7ad 100644 ---- a/arch/arm/cpu/arm926ejs/lpc32xx/devices.c -+++ b/arch/arm/cpu/arm926ejs/lpc32xx/devices.c -@@ -45,10 +45,14 @@ void lpc32xx_uart_init(unsigned int uart_id) - - #if !CONFIG_IS_ENABLED(OF_CONTROL) - static const struct ns16550_platdata lpc32xx_uart[] = { -- { .base = UART3_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -- { .base = UART4_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -- { .base = UART5_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -- { .base = UART6_BASE, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -+ { .base = UART3_BASE, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, -+ { .base = UART4_BASE, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, -+ { .base = UART5_BASE, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, -+ { .base = UART6_BASE, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, - }; - - #if defined(CONFIG_LPC32XX_HSUART) -diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c -index 73824df18fa7..190310fd0079 100644 ---- a/arch/arm/mach-omap2/am33xx/board.c -+++ b/arch/arm/mach-omap2/am33xx/board.c -@@ -40,14 +40,20 @@ DECLARE_GLOBAL_DATA_PTR; - - #if !CONFIG_IS_ENABLED(OF_CONTROL) - static const struct ns16550_platdata am33xx_serial[] = { -- { .base = CONFIG_SYS_NS16550_COM1, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -+ { .base = CONFIG_SYS_NS16550_COM1, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, - # ifdef CONFIG_SYS_NS16550_COM2 -- { .base = CONFIG_SYS_NS16550_COM2, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -+ { .base = CONFIG_SYS_NS16550_COM2, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, - # ifdef CONFIG_SYS_NS16550_COM3 -- { .base = CONFIG_SYS_NS16550_COM3, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -- { .base = CONFIG_SYS_NS16550_COM4, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -- { .base = CONFIG_SYS_NS16550_COM5, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -- { .base = CONFIG_SYS_NS16550_COM6, .reg_shift = 2, .clock = CONFIG_SYS_NS16550_CLK }, -+ { .base = CONFIG_SYS_NS16550_COM3, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, -+ { .base = CONFIG_SYS_NS16550_COM4, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, -+ { .base = CONFIG_SYS_NS16550_COM5, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, -+ { .base = CONFIG_SYS_NS16550_COM6, .reg_shift = 2, -+ .clock = CONFIG_SYS_NS16550_CLK, .fcr = UART_FCR_DEFVAL, }, - # endif - # endif - }; -diff --git a/arch/arm/mach-tegra/board.c b/arch/arm/mach-tegra/board.c -index 3d1d26d13d13..b3a041b539af 100644 ---- a/arch/arm/mach-tegra/board.c -+++ b/arch/arm/mach-tegra/board.c -@@ -219,6 +219,7 @@ static struct ns16550_platdata ns16550_com1_pdata = { - .base = CONFIG_SYS_NS16550_COM1, - .reg_shift = 2, - .clock = CONFIG_SYS_NS16550_CLK, -+ .fcr = UART_FCR_DEFVAL, - }; - - U_BOOT_DEVICE(ns16550_com1) = { -diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c -index ae7959b1eb6e..5a3498f570a6 100644 ---- a/board/isee/igep00x0/igep00x0.c -+++ b/board/isee/igep00x0/igep00x0.c -@@ -32,7 +32,8 @@ DECLARE_GLOBAL_DATA_PTR; - static const struct ns16550_platdata igep_serial = { - .base = OMAP34XX_UART3, - .reg_shift = 2, -- .clock = V_NS16550_CLK -+ .clock = V_NS16550_CLK, -+ .fcr = UART_FCR_DEFVAL, - }; - - U_BOOT_DEVICE(igep_uart) = { -diff --git a/board/lg/sniper/sniper.c b/board/lg/sniper/sniper.c -index 0662449c3875..b2b8f8861f11 100644 ---- a/board/lg/sniper/sniper.c -+++ b/board/lg/sniper/sniper.c -@@ -31,7 +31,8 @@ const omap3_sysinfo sysinfo = { - static const struct ns16550_platdata serial_omap_platdata = { - .base = OMAP34XX_UART3, - .reg_shift = 2, -- .clock = V_NS16550_CLK -+ .clock = V_NS16550_CLK, -+ .fcr = UART_FCR_DEFVAL, - }; - - U_BOOT_DEVICE(sniper_serial) = { -diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c -index 21b3fdcf49cf..b2fcc28f8b4b 100644 ---- a/board/logicpd/omap3som/omap3logic.c -+++ b/board/logicpd/omap3som/omap3logic.c -@@ -49,7 +49,8 @@ DECLARE_GLOBAL_DATA_PTR; - static const struct ns16550_platdata omap3logic_serial = { - .base = OMAP34XX_UART1, - .reg_shift = 2, -- .clock = V_NS16550_CLK -+ .clock = V_NS16550_CLK, -+ .fcr = UART_FCR_DEFVAL, - }; - - U_BOOT_DEVICE(omap3logic_uart) = { -diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c -index 2821ee22674f..0fad23af62f6 100644 ---- a/board/logicpd/zoom1/zoom1.c -+++ b/board/logicpd/zoom1/zoom1.c -@@ -47,7 +47,8 @@ static const u32 gpmc_lab_enet[] = { - static const struct ns16550_platdata zoom1_serial = { - .base = OMAP34XX_UART3, - .reg_shift = 2, -- .clock = V_NS16550_CLK -+ .clock = V_NS16550_CLK, -+ .fcr = UART_FCR_DEFVAL, - }; - - U_BOOT_DEVICE(zoom1_uart) = { -diff --git a/board/overo/overo.c b/board/overo/overo.c -index 40f13e5876cc..5e447262bcfd 100644 ---- a/board/overo/overo.c -+++ b/board/overo/overo.c -@@ -70,7 +70,8 @@ static struct { - static const struct ns16550_platdata overo_serial = { - .base = OMAP34XX_UART3, - .reg_shift = 2, -- .clock = V_NS16550_CLK -+ .clock = V_NS16550_CLK, -+ .fcr = UART_FCR_DEFVAL, - }; - - U_BOOT_DEVICE(overo_uart) = { -diff --git a/board/quipos/cairo/cairo.c b/board/quipos/cairo/cairo.c -index 77e4482906f0..793aa9023150 100644 ---- a/board/quipos/cairo/cairo.c -+++ b/board/quipos/cairo/cairo.c -@@ -93,7 +93,8 @@ void get_board_mem_timings(struct board_sdrc_timings *timings) - static const struct ns16550_platdata cairo_serial = { - .base = OMAP34XX_UART2, - .reg_shift = 2, -- .clock = V_NS16550_CLK -+ .clock = V_NS16550_CLK, -+ .fcr = UART_FCR_DEFVAL, - }; - - U_BOOT_DEVICE(cairo_uart) = { -diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c -index cfdab3e34253..23c79333a223 100644 ---- a/board/ti/beagle/beagle.c -+++ b/board/ti/beagle/beagle.c -@@ -75,7 +75,8 @@ static struct { - static const struct ns16550_platdata beagle_serial = { - .base = OMAP34XX_UART3, - .reg_shift = 2, -- .clock = V_NS16550_CLK -+ .clock = V_NS16550_CLK, -+ .fcr = UART_FCR_DEFVAL, - }; - - U_BOOT_DEVICE(beagle_uart) = { -diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c -index f785dbe6d732..b2f060b2ddbf 100644 ---- a/board/timll/devkit8000/devkit8000.c -+++ b/board/timll/devkit8000/devkit8000.c -@@ -48,7 +48,8 @@ static u32 gpmc_net_config[GPMC_MAX_REG] = { - static const struct ns16550_platdata devkit8000_serial = { - .base = OMAP34XX_UART3, - .reg_shift = 2, -- .clock = V_NS16550_CLK -+ .clock = V_NS16550_CLK, -+ .fcr = UART_FCR_DEFVAL, - }; - - U_BOOT_DEVICE(devkit8000_uart) = { -diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c -index 9b423a591d8a..2df4a1f04fe5 100644 ---- a/drivers/serial/ns16550.c -+++ b/drivers/serial/ns16550.c -@@ -20,9 +20,6 @@ DECLARE_GLOBAL_DATA_PTR; - #define UART_LCRVAL UART_LCR_8N1 /* 8 data, 1 stop, no parity */ - #define UART_MCRVAL (UART_MCR_DTR | \ - UART_MCR_RTS) /* RTS/DTR */ --#define UART_FCRVAL (UART_FCR_FIFO_EN | \ -- UART_FCR_RXSR | \ -- UART_FCR_TXSR) /* Clear & enable FIFOs */ - - #ifndef CONFIG_DM_SERIAL - #ifdef CONFIG_SYS_NS16550_PORT_MAPPED -@@ -138,7 +135,7 @@ static u32 ns16550_getfcr(NS16550_t port) - #else - static u32 ns16550_getfcr(NS16550_t port) - { -- return UART_FCRVAL; -+ return UART_FCR_DEFVAL; - } - #endif - -@@ -275,7 +272,7 @@ static inline void _debug_uart_init(void) - CONFIG_BAUDRATE); - serial_dout(&com_port->ier, CONFIG_SYS_NS16550_IER); - serial_dout(&com_port->mcr, UART_MCRVAL); -- serial_dout(&com_port->fcr, UART_FCRVAL); -+ serial_dout(&com_port->fcr, UART_FCR_DEFVAL); - - serial_dout(&com_port->lcr, UART_LCR_BKSE | UART_LCRVAL); - serial_dout(&com_port->dll, baud_divisor & 0xff); -@@ -440,7 +437,7 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev) - return -EINVAL; - } - -- plat->fcr = UART_FCRVAL; -+ plat->fcr = UART_FCR_DEFVAL; - if (port_type == PORT_JZ4780) - plat->fcr |= UART_FCR_UME; - -diff --git a/drivers/serial/serial_rockchip.c b/drivers/serial/serial_rockchip.c -index 6bac95a414ce..c06afc58f7ea 100644 ---- a/drivers/serial/serial_rockchip.c -+++ b/drivers/serial/serial_rockchip.c -@@ -27,6 +27,7 @@ static int rockchip_serial_probe(struct udevice *dev) - plat->plat.base = plat->dtplat.reg[0]; - plat->plat.reg_shift = plat->dtplat.reg_shift; - plat->plat.clock = plat->dtplat.clock_frequency; -+ plat->plat.fcr = UART_FCR_DEFVAL; - dev->platdata = &plat->plat; - - return ns16550_serial_probe(dev); -diff --git a/include/ns16550.h b/include/ns16550.h -index 7c9703683109..5fcbcd2e74e3 100644 ---- a/include/ns16550.h -+++ b/include/ns16550.h -@@ -121,6 +121,11 @@ typedef struct NS16550 *NS16550_t; - /* Ingenic JZ47xx specific UART-enable bit. */ - #define UART_FCR_UME 0x10 - -+/* Clear & enable FIFOs */ -+#define UART_FCR_DEFVAL (UART_FCR_FIFO_EN | \ -+ UART_FCR_RXSR | \ -+ UART_FCR_TXSR) -+ - /* - * These are the definitions for the Modem Control Register - */ --- -2.17.0 - diff --git a/package/boot/uboot-oxnas/src/tools/mkox820crc.c b/package/boot/uboot-oxnas/src/tools/mkox820crc.c index d100191f2..873706245 100644 --- a/package/boot/uboot-oxnas/src/tools/mkox820crc.c +++ b/package/boot/uboot-oxnas/src/tools/mkox820crc.c @@ -84,6 +84,7 @@ int main(int argc, char **argv) if (status != file_length) { printf("Failed to load image\n"); + free(executable); return -ENOENT; } @@ -111,6 +112,7 @@ int main(int argc, char **argv) status = lseek(in_file, 0, SEEK_SET); if (status != 0) { printf("failed to rewind\n"); + free(executable); return 1; } len = write(in_file, &img_header, sizeof(img_header)); @@ -118,6 +120,7 @@ int main(int argc, char **argv) len = write(in_file, executable, file_length); assert(len == file_length); close(in_file); + free(executable); return 0; } diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index 1728cc2f1..eef4c56f5 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2018.05 +PKG_VERSION:=2019.01 -PKG_HASH:=4da13c2a6139a78cc08608f21fd4741db27eda336cfad7ab8264fda923b9c048 +PKG_HASH:=50bd7e5a466ab828914d080d5f6a432345b500e8fba1ad3b7b61e95e60d51c22 PKG_MAINTAINER:=Zoltan HERPAI @@ -28,67 +28,67 @@ endef define U-Boot/A10-OLinuXino-Lime BUILD_SUBTARGET:=cortexa8 NAME:=A10 OLinuXino LIME - BUILD_DEVICES:=sun4i-a10-olinuxino-lime + BUILD_DEVICES:=olimex_a10-olinuxino-lime endef define U-Boot/A13-OLinuXino BUILD_SUBTARGET:=cortexa8 NAME:=A13 OlinuXino - BUILD_DEVICES:=sun5i-a13-olinuxino + BUILD_DEVICES:=olimex_a13-olinuxino endef define U-Boot/A20-OLinuXino-Lime BUILD_SUBTARGET:=cortexa7 NAME:=A20 OLinuXino LIME - BUILD_DEVICES:=sun7i-a20-olinuxino-lime + BUILD_DEVICES:=olimex_a20-olinuxino-lime endef define U-Boot/A20-OLinuXino-Lime2 BUILD_SUBTARGET:=cortexa7 NAME:=A20 OLinuXino LIME2 - BUILD_DEVICES:=sun7i-a20-olinuxino-lime2 + BUILD_DEVICES:=olimex_a20-olinuxino-lime2 endef define U-Boot/A20-OLinuXino-Lime2-eMMC BUILD_SUBTARGET:=cortexa7 NAME:=A20 OLinuXino LIME2 eMMC - BUILD_DEVICES:=sun7i-a20-olinuxino-lime2-emmc + BUILD_DEVICES:=olimex_a20-olinuxino-lime2-emmc endef define U-Boot/A20-OLinuXino_MICRO BUILD_SUBTARGET:=cortexa7 NAME:=A20 OLinuXino MICRO - BUILD_DEVICES:=sun7i-a20-olinuxino-micro + BUILD_DEVICES:=olimex_a20-olinuxino-micro endef define U-Boot/Bananapi BUILD_SUBTARGET:=cortexa7 NAME:=Bananapi - BUILD_DEVICES:=sun7i-a20-bananapi + BUILD_DEVICES:=lemaker_bananapi endef define U-Boot/Bananapro BUILD_SUBTARGET:=cortexa7 NAME:=Bananapro - BUILD_DEVICES:=sun7i-a20-bananapro + BUILD_DEVICES:=lemaker_bananapro endef define U-Boot/Cubieboard BUILD_SUBTARGET:=cortexa8 NAME:=Cubieboard - BUILD_DEVICES:=sun4i-a10-cubieboard + BUILD_DEVICES:=cubietech_a10-cubieboard endef define U-Boot/Cubieboard2 BUILD_SUBTARGET:=cortexa7 NAME:=Cubieboard2 - BUILD_DEVICES:=sun7i-a20-cubieboard2 + BUILD_DEVICES:=cubietech_cubieboard2 endef define U-Boot/Cubietruck BUILD_SUBTARGET:=cortexa7 NAME:=Cubietruck - BUILD_DEVICES:=sun7i-a20-cubietruck + BUILD_DEVICES:=cubietech_cubietruck endef define U-Boot/Hummingbird_A31 @@ -99,79 +99,97 @@ endef define U-Boot/Marsboard_A10 BUILD_SUBTARGET:=cortexa8 NAME:=Marsboard - BUILD_DEVICES:=sun4i-a10-marsboard + BUILD_DEVICES:=marsboard_a10-marsboard endef define U-Boot/Mele_M9 BUILD_SUBTARGET:=cortexa7 NAME:=Mele M9 (A31) - BUILD_DEVICES:=sun6i-a31-m9 + BUILD_DEVICES:=mele_m9 endef define U-Boot/OLIMEX_A13_SOM BUILD_SUBTARGET:=cortexa8 NAME:=Olimex A13 SOM - BUILD_DEVICES:=sun5i-a13-olimex-som + BUILD_DEVICES:=olimex_a13-olimex-som endef define U-Boot/Linksprite_pcDuino BUILD_SUBTARGET:=cortexa8 NAME:=Linksprite pcDuino - BUILD_DEVICES:=sun4i-a10-pcduino + BUILD_DEVICES:=linksprite_a10-pcduino endef define U-Boot/Linksprite_pcDuino3 BUILD_SUBTARGET:=cortexa7 NAME:=Linksprite pcDuino3 - BUILD_DEVICES:=sun7i-a20-pcduino3 + BUILD_DEVICES:=linksprite_pcduino3 endef define U-Boot/Lamobo_R1 BUILD_SUBTARGET:=cortexa7 NAME:=Lamobo R1 - BUILD_DEVICES:=sun7i-a20-lamobo-r1 + BUILD_DEVICES:=lamobo_lamobo-r1 endef define U-Boot/nanopi_m1_plus BUILD_SUBTARGET:=cortexa7 NAME:=NanoPi M1 Plus (H3) - BUILD_DEVICES:=sun8i-h3-nanopi-m1-plus + BUILD_DEVICES:=friendlyarm_nanopi-m1-plus +endef + +define U-Boot/nanopi_neo_air + BUILD_SUBTARGET:=cortexa7 + NAME:=U-Boot for NanoPi NEO Air (H3) + BUILD_DEVICES:=friendlyarm_nanopi-neo-air endef define U-Boot/nanopi_neo BUILD_SUBTARGET:=cortexa7 NAME:=U-Boot for NanoPi NEO (H3) - BUILD_DEVICES:=sun8i-h3-nanopi-neo + BUILD_DEVICES:=friendlyarm_nanopi-neo endef define U-Boot/orangepi_r1 BUILD_SUBTARGET:=cortexa7 NAME:=Orange Pi R1 (H2+) - BUILD_DEVICES:=sun8i-h2-plus-orangepi-r1 + BUILD_DEVICES:=xunlong_orangepi-r1 endef define U-Boot/orangepi_zero BUILD_SUBTARGET:=cortexa7 NAME:=Orange Pi Zero (H2+) - BUILD_DEVICES:=sun8i-h2-plus-orangepi-zero + BUILD_DEVICES:=xunlong_orangepi-zero +endef + +define U-Boot/orangepi_one + BUILD_SUBTARGET:=cortexa7 + NAME:=Orange Pi One (H3) + BUILD_DEVICES:=xunlong_orangepi-one endef define U-Boot/orangepi_pc BUILD_SUBTARGET:=cortexa7 NAME:=Orange Pi PC (H3) - BUILD_DEVICES:=sun8i-h3-orangepi-pc + BUILD_DEVICES:=xunlong_orangepi-pc +endef + +define U-Boot/orangepi_pc_plus + BUILD_SUBTARGET:=cortexa7 + NAME:=Orange Pi PC Plus (H3) + BUILD_DEVICES:=xunlong_orangepi-pc-plus endef define U-Boot/orangepi_plus BUILD_SUBTARGET:=cortexa7 NAME:=Orange Pi Plus (H3) - BUILD_DEVICES:=sun8i-h3-orangepi-plus + BUILD_DEVICES:=xunlong_orangepi-plus endef define U-Boot/orangepi_2 BUILD_SUBTARGET:=cortexa7 NAME:=Orange Pi 2 (H3) - BUILD_DEVICES:=sun8i-h3-orangepi-2 + BUILD_DEVICES:=xunlong_orangepi-2 endef define U-Boot/pangolin @@ -183,7 +201,7 @@ endef define U-Boot/nanopi_neo_plus2 BUILD_SUBTARGET:=cortexa53 NAME:=NanoPi NEO Plus2 (H5) - BUILD_DEVICES:=sun50i-h5-nanopi-neo-plus2 + BUILD_DEVICES:=friendlyarm_nanopi-neo-plus2 DEPENDS:=+PACKAGE_u-boot-nanopi_neo_plus2:arm-trusted-firmware-sunxi UENV:=a64 endef @@ -191,7 +209,7 @@ endef define U-Boot/nanopi_neo2 BUILD_SUBTARGET:=cortexa53 NAME:=NanoPi NEO2 (H5) - BUILD_DEVICES:=sun50i-h5-nanopi-neo2 + BUILD_DEVICES:=friendlyarm_nanopi-neo2 DEPENDS:=+PACKAGE_u-boot-nanopi_neo2:arm-trusted-firmware-sunxi UENV:=a64 endef @@ -199,15 +217,21 @@ endef define U-Boot/pine64_plus BUILD_SUBTARGET:=cortexa53 NAME:=Pine64 Plus A64 - BUILD_DEVICES:=sun50i-a64-pine64-plus + BUILD_DEVICES:=pine64_pine64-plus DEPENDS:=+PACKAGE_u-boot-pine64_plus:arm-trusted-firmware-sunxi UENV:=a64 endef +define U-Boot/Sinovoip_BPI_M2_Plus + BUILD_SUBTARGET:=cortexa7 + NAME:=Bananapi M2 Plus + BUILD_DEVICES:=sinovoip_bananapi-m2-plus +endef + define U-Boot/sopine_baseboard BUILD_SUBTARGET:=cortexa53 NAME:=Sopine Baseboard - BUILD_DEVICES:=sun50i-a64-sopine-baseboard + BUILD_DEVICES:=pine64_sopine-baseboard DEPENDS:=+PACKAGE_u-boot-sopine_baseboard:arm-trusted-firmware-sunxi UENV:=a64 endef @@ -216,7 +240,7 @@ endef define U-Boot/orangepi_zero_plus BUILD_SUBTARGET:=cortexa53 NAME:=Xunlong Orange Pi Zero Plus - BUILD_DEVICES:=sun50i-h5-orangepi-zero-plus + BUILD_DEVICES:=xunlong_orangepi-zero-plus DEPENDS:=+PACKAGE_u-boot-orangepi_zero_plus:arm-trusted-firmware-sunxi UENV:=a64 endef @@ -224,11 +248,17 @@ endef define U-Boot/orangepi_pc2 BUILD_SUBTARGET:=cortexa53 NAME:=Xunlong Orange Pi PC2 - BUILD_DEVICES:=sun50i-h5-orangepi-pc2 + BUILD_DEVICES:=xunlong_orangepi-pc2 DEPENDS:=+PACKAGE_u-boot-orangepi_pc2:arm-trusted-firmware-sunxi UENV:=a64 endef +define U-Boot/Sinovoip_BPI_M2_Ultra + BUILD_SUBTARGET:=cortexa7 + NAME:=Bananapi M2 Ultra + BUILD_DEVICES:=lemaker_bananapi-m2-ultra +endef + UBOOT_TARGETS := \ A10-OLinuXino-Lime \ A13-OLinuXino \ @@ -250,16 +280,21 @@ UBOOT_TARGETS := \ Lamobo_R1 \ nanopi_m1_plus \ nanopi_neo \ + nanopi_neo_air \ nanopi_neo_plus2 \ nanopi_neo2 \ orangepi_zero \ orangepi_r1 \ + orangepi_one \ orangepi_pc \ + orangepi_pc_plus \ orangepi_plus \ orangepi_2 \ orangepi_pc2 \ pangolin \ pine64_plus \ + Sinovoip_BPI_M2_Plus \ + Sinovoip_BPI_M2_Ultra \ sopine_baseboard \ orangepi_zero_plus diff --git a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch index 6501cca6d..899bcb129 100644 --- a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch +++ b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch @@ -1,6 +1,6 @@ --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -290,6 +290,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ +@@ -313,6 +313,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ sun6i-a31-m9.dtb \ sun6i-a31-mele-a1000g-quad.dtb \ sun6i-a31-mixtile-loftq.dtb \ @@ -10,19 +10,17 @@ sun6i-a31s-inet-q972.dtb \ --- a/arch/arm/dts/sun6i-a31.dtsi +++ b/arch/arm/dts/sun6i-a31.dtsi -@@ -679,6 +679,13 @@ - allwinner,pull = ; +@@ -641,6 +641,11 @@ + function = "lcd0"; }; + i2c3_pins_a: i2c3@0 { + allwinner,pins = "PB5", "PB6"; + allwinner,function = "i2c3"; -+ allwinner,drive = ; -+ allwinner,pull = ; + }; + mmc0_pins_a: mmc0@0 { - allwinner,pins = "PF0", "PF1", "PF2", + pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5"; --- /dev/null +++ b/arch/arm/dts/sun6i-a31-pangolin.dts @@ -360,7 +358,7 @@ +CONFIG_SUNXI_SPI=y --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig -@@ -836,6 +836,14 @@ config VIDEO_LCD_PANEL_I2C_SCL +@@ -875,6 +875,14 @@ config VIDEO_LCD_PANEL_I2C_SCL Set the SCL pin for the LCD i2c interface. This takes a string in the format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. diff --git a/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch b/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch index 6dbcb1071..a1caf18a1 100644 --- a/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch +++ b/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch @@ -2,11 +2,11 @@ --- a/configs/A20-OLinuXino-Lime2_defconfig +++ b/configs/A20-OLinuXino-Lime2_defconfig -@@ -22,6 +22,7 @@ CONFIG_DFU_RAM=y - CONFIG_ETH_DESIGNWARE=y +@@ -25,6 +25,7 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_RGMII=y + CONFIG_MII=y CONFIG_SUN7I_GMAC=y +CONFIG_GMAC_TX_DELAY=1 CONFIG_AXP_ALDO3_VOLT=2800 - CONFIG_AXP_ALDO4_VOLT=2800 - CONFIG_SCSI=y + CONFIG_AXP_ALDO3_VOLT_SLOPE_08=y + CONFIG_AXP_ALDO3_INRUSH_QUIRK=y diff --git a/package/boot/uboot-sunxi/patches/063-fix-lime2-revK-add-micrel-PHY.patch b/package/boot/uboot-sunxi/patches/063-fix-lime2-revK-add-micrel-PHY.patch new file mode 100644 index 000000000..9ea064253 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/063-fix-lime2-revK-add-micrel-PHY.patch @@ -0,0 +1,44 @@ +--- a/configs/A20-OLinuXino-Lime2-eMMC_defconfig ++++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig +@@ -8,6 +8,8 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2 + CONFIG_USB0_VBUS_PIN="PC17" + CONFIG_USB0_VBUS_DET="PH5" + CONFIG_I2C1_ENABLE=y ++CONFIG_PHY_MICREL=y ++CONFIG_PHY_MICREL_KSZ90X1=y + CONFIG_SATAPWR="PC3" + CONFIG_AHCI=y + CONFIG_NR_DRAM_BANKS=1 +--- a/configs/A20-OLinuXino-Lime2_defconfig ++++ b/configs/A20-OLinuXino-Lime2_defconfig +@@ -7,6 +7,8 @@ CONFIG_MMC0_CD_PIN="PH1" + CONFIG_USB0_VBUS_PIN="PC17" + CONFIG_USB0_VBUS_DET="PH5" + CONFIG_I2C1_ENABLE=y ++CONFIG_PHY_MICREL=y ++CONFIG_PHY_MICREL_KSZ90X1=y + CONFIG_SATAPWR="PC3" + CONFIG_AHCI=y + CONFIG_NR_DRAM_BANKS=1 +--- a/drivers/net/phy/micrel_ksz90x1.c ++++ b/drivers/net/phy/micrel_ksz90x1.c +@@ -13,6 +13,8 @@ + #include + #include + #include ++#include ++#include + + /* + * KSZ9021 - KSZ9031 common +@@ -329,6 +331,10 @@ static int ksz9031_phy_extwrite(struct p + static int ksz9031_config(struct phy_device *phydev) + { + int ret; ++ struct sunxi_ccm_reg *const ccm = ++ (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; ++ ++ setbits_le32(&ccm->gmac_clk_cfg, CCM_GMAC_CTRL_TX_CLK_DELAY(4)); + + ret = ksz9031_of_config(phydev); + if (ret) diff --git a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch index b3d9ba040..8bab22051 100644 --- a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch @@ -6,7 +6,7 @@ Subject: sun6i: define alternate-function for UART2 on GPG --- a/arch/arm/include/asm/arch-sunxi/gpio.h +++ b/arch/arm/include/asm/arch-sunxi/gpio.h -@@ -185,6 +185,7 @@ enum sunxi_gpio_number { +@@ -186,6 +186,7 @@ enum sunxi_gpio_number { #define SUN6I_GPG_SDC1 2 #define SUN8I_GPG_SDC1 2 #define SUN6I_GPG_TWI3 2 diff --git a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch index e6ff8ce28..b92269084 100644 --- a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch @@ -6,7 +6,7 @@ Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) --- a/arch/arm/mach-sunxi/board.c +++ b/arch/arm/mach-sunxi/board.c -@@ -123,6 +123,10 @@ static int gpio_init(void) +@@ -127,6 +127,10 @@ static int gpio_init(void) sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG_UART1); sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG_UART1); sunxi_gpio_set_pull(SUNXI_GPG(4), SUNXI_GPIO_PULL_UP); @@ -19,7 +19,7 @@ Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN8I_GPB_UART2); --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h -@@ -256,6 +256,8 @@ extern int soft_i2c_gpio_scl; +@@ -258,6 +258,8 @@ extern int soft_i2c_gpio_scl; #endif #elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I) #define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200" diff --git a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch index 083933e06..4e35d582f 100644 --- a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch +++ b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch @@ -6,7 +6,7 @@ Subject: ARM: sunxi: Make CONS_INDEX configurable --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig -@@ -500,6 +500,14 @@ config SYS_BOARD +@@ -538,6 +538,14 @@ config SYS_BOARD config SYS_SOC default "sunxi" diff --git a/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch index 2c63ad322..12f47259c 100644 --- a/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch +++ b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch @@ -17,7 +17,7 @@ Cc: Simon Glass --- a/tools/fit_image.c +++ b/tools/fit_image.c -@@ -649,9 +649,14 @@ static int fit_handle_file(struct image_ +@@ -656,9 +656,14 @@ static int fit_handle_file(struct image_ } *cmd = '\0'; } else if (params->datafile) { diff --git a/package/boot/uboot-sunxi/patches/210-sunxi-deactivate-binman.patch b/package/boot/uboot-sunxi/patches/210-sunxi-deactivate-binman.patch index 24b863411..d86097858 100644 --- a/package/boot/uboot-sunxi/patches/210-sunxi-deactivate-binman.patch +++ b/package/boot/uboot-sunxi/patches/210-sunxi-deactivate-binman.patch @@ -12,7 +12,7 @@ old way of generating images. --- a/Makefile +++ b/Makefile -@@ -1215,8 +1215,10 @@ endif +@@ -1344,8 +1344,10 @@ endif ifneq ($(CONFIG_ARCH_SUNXI),) ifeq ($(CONFIG_ARM64),) @@ -27,7 +27,7 @@ old way of generating images. $(call if_changed,cat) --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig -@@ -711,7 +711,6 @@ config ARCH_SOCFPGA +@@ -842,7 +842,6 @@ config ARCH_SOCFPGA config ARCH_SUNXI bool "Support sunxi (Allwinner) SoCs" diff --git a/package/boot/uboot-sunxi/patches/221-compatible-old-dtc.patch b/package/boot/uboot-sunxi/patches/221-compatible-old-dtc.patch index 947a1ab05..4056d9800 100644 --- a/package/boot/uboot-sunxi/patches/221-compatible-old-dtc.patch +++ b/package/boot/uboot-sunxi/patches/221-compatible-old-dtc.patch @@ -7,7 +7,7 @@ dtc from kernel 4.9. --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include -@@ -172,6 +172,11 @@ ld-version = $(shell $(LD) --version | $ +@@ -173,6 +173,11 @@ ld-version = $(shell $(LD) --version | $ # Usage: $(call ld-ifversion, -ge, 22252, y) ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4)) diff --git a/package/boot/uboot-sunxi/patches/230-disable-axp209-on-a13-olinuxino.diff b/package/boot/uboot-sunxi/patches/230-disable-axp209-on-a13-olinuxino.diff new file mode 100644 index 000000000..9ce6adeb3 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/230-disable-axp209-on-a13-olinuxino.diff @@ -0,0 +1,19 @@ +--- a/configs/A13-OLinuXino_defconfig ++++ b/configs/A13-OLinuXino_defconfig +@@ -7,7 +7,6 @@ CONFIG_DRAM_EMR1=0 + CONFIG_MMC0_CD_PIN="PG0" + CONFIG_USB0_VBUS_DET="PG1" + CONFIG_USB1_VBUS_PIN="PG11" +-CONFIG_AXP_GPIO=y + # CONFIG_VIDEO_HDMI is not set + CONFIG_VIDEO_VGA_VIA_LCD=y + CONFIG_VIDEO_VGA_VIA_LCD_FORCE_SYNC_ACTIVE_HIGH=y +@@ -24,7 +23,7 @@ CONFIG_CMD_USB_MASS_STORAGE=y + CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino" + CONFIG_DFU_RAM=y + CONFIG_FASTBOOT_CMD_OEM_FORMAT=y +-CONFIG_AXP_ALDO3_VOLT=3300 ++CONFIG_SUNXI_NO_PMIC=y + CONFIG_CONS_INDEX=2 + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_MUSB_GADGET=y diff --git a/package/boot/uboot-sunxi/patches/240-sun50i-h5-Orange-Pi-Zero-Plus-Fix-SdCard-detection.patch b/package/boot/uboot-sunxi/patches/240-sun50i-h5-Orange-Pi-Zero-Plus-Fix-SdCard-detection.patch new file mode 100644 index 000000000..2feab7675 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/240-sun50i-h5-Orange-Pi-Zero-Plus-Fix-SdCard-detection.patch @@ -0,0 +1,28 @@ +From ad320d4d6ad03af5ff730546113d53a47ef6a22e Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 13 Jan 2019 17:05:09 +0100 +Subject: [PATCH] sun50i: h5: Orange Pi Zero Plus: Fix SdCard detection + +The Detection pin is at PF6 and not at PH13 like defined before. I +checked the schematics and now I am am not seeing this error message any +more: +Loading Environment from FAT... Card did not respond to voltage select! + +Fixes: 76d69eb01de ("sun50i: h5: Add initial Orange Pi Zero Plus support") +Signed-off-by: Hauke Mehrtens +--- + configs/orangepi_zero_plus_defconfig | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/configs/orangepi_zero_plus_defconfig ++++ b/configs/orangepi_zero_plus_defconfig +@@ -4,8 +4,7 @@ CONFIG_SPL=y + CONFIG_MACH_SUN50I_H5=y + CONFIG_DRAM_CLK=624 + CONFIG_DRAM_ZQ=3881977 +-CONFIG_MMC0_CD_PIN="PH13" +-CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++CONFIG_MMC0_CD_PIN="PF6" + CONFIG_NR_DRAM_BANKS=1 + # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set + # CONFIG_CMD_FLASH is not set diff --git a/package/boot/uboot-sunxi/patches/250-Sinovoip-BPI-M2-Ultra-defconfig.patch b/package/boot/uboot-sunxi/patches/250-Sinovoip-BPI-M2-Ultra-defconfig.patch new file mode 100644 index 000000000..94606aa84 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/250-Sinovoip-BPI-M2-Ultra-defconfig.patch @@ -0,0 +1,25 @@ +--- /dev/null ++++ b/configs/Sinovoip_BPI_M2_Ultra_defconfig +@@ -0,0 +1,22 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL=y ++CONFIG_MACH_SUN8I_R40=y ++CONFIG_DRAM_CLK=576 ++CONFIG_DRAM_ZQ=3881979 ++CONFIG_MACPWR="PA17" ++CONFIG_MMC0_CD_PIN="PH13" ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++CONFIG_AHCI=y ++CONFIG_NR_DRAM_BANKS=1 ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_SPL_I2C_SUPPORT=y ++# CONFIG_CMD_FLASH is not set ++CONFIG_DEFAULT_DEVICE_TREE="sun8i-r40-bananapi-m2-ultra" ++CONFIG_SCSI_AHCI=y ++CONFIG_RGMII=y ++CONFIG_SUN8I_EMAC=y ++CONFIG_AXP_DLDO4_VOLT=2500 ++CONFIG_AXP_ELDO3_VOLT=1200 ++CONFIG_SCSI=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/package/boot/uboot-sunxi/patches/310-sunxi-h3-Sync-OTG-and-HCI-nodes-from-Linux-DT.patch b/package/boot/uboot-sunxi/patches/310-sunxi-h3-Sync-OTG-and-HCI-nodes-from-Linux-DT.patch deleted file mode 100644 index 97aad7879..000000000 --- a/package/boot/uboot-sunxi/patches/310-sunxi-h3-Sync-OTG-and-HCI-nodes-from-Linux-DT.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 96c04aab58e351fa9ed7e95783018d6dbf60768f Mon Sep 17 00:00:00 2001 -From: Jun Nie -Date: Mon, 7 May 2018 13:03:40 +0530 -Subject: sunxi: h3: Sync OTG and HCI nodes from Linux DT - -Allwinner H3 have a dual-routed USB PHY0 -- routed to either OHCI/EHCI -or MUSB controller. - -Signed-off-by: Jun Nie -Reviewed-by: Jagan Teki -Acked-by: Jun Nie ---- - arch/arm/dts/sun8i-h3.dtsi | 32 ++++++++++++++++++++++++++++++++ - 1 file changed, 32 insertions(+) - ---- a/arch/arm/dts/sun8i-h3.dtsi -+++ b/arch/arm/dts/sun8i-h3.dtsi -@@ -219,6 +219,19 @@ - #size-cells = <0>; - }; - -+ usb_otg: usb@1c19000 { -+ compatible = "allwinner,sun8i-h3-musb"; -+ reg = <0x01c19000 0x400>; -+ clocks = <&ccu CLK_BUS_OTG>; -+ resets = <&ccu RST_BUS_OTG>; -+ interrupts = ; -+ interrupt-names = "mc"; -+ phys = <&usbphy 0>; -+ phy-names = "usb"; -+ extcon = <&usbphy 0>; -+ status = "disabled"; -+ }; -+ - usbphy: phy@01c19400 { - compatible = "allwinner,sun8i-h3-usb-phy"; - reg = <0x01c19400 0x2c>, -@@ -251,6 +264,25 @@ - #phy-cells = <1>; - }; - -+ ehci0: usb@1c1a000 { -+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; -+ reg = <0x01c1a000 0x100>; -+ interrupts = ; -+ clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>; -+ resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; -+ status = "disabled"; -+ }; -+ -+ ohci0: usb@1c1a400 { -+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; -+ reg = <0x01c1a400 0x100>; -+ interrupts = ; -+ clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>, -+ <&ccu CLK_USB_OHCI0>; -+ resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>; -+ status = "disabled"; -+ }; -+ - ehci1: usb@01c1b000 { - compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; - reg = <0x01c1b000 0x100>; diff --git a/package/boot/uboot-sunxi/patches/320-sunxi-Add-support-for-Orange-Pi-R1.patch b/package/boot/uboot-sunxi/patches/320-sunxi-Add-support-for-Orange-Pi-R1.patch deleted file mode 100644 index 97c476946..000000000 --- a/package/boot/uboot-sunxi/patches/320-sunxi-Add-support-for-Orange-Pi-R1.patch +++ /dev/null @@ -1,179 +0,0 @@ -From fd3736abbe57a819312c8df96d14ec396b074581 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 26 Sep 2017 22:16:59 +0200 -Subject: sun8i: h2: Add initial Orange Pi R1 - -Orange Pi R1 is an open-source single-board computer using the -Allwinner H2+ SOC. - -H2+ Orange Pi R1 has - - Quad-core Cortex-A7 - - 256MB DDR3 - - micrSD slot - - 128MBit SPI Nor flash - - Debug TTL UART - - 100MBit/s Ethernet (H2+) - - 100MBit/s Ethernet (RTL8152B) - - Wifi (RTL8189ETV) - - USB 2.0 OTG + power supply -This board is very similar to the Orange Pi Zero. - -The device tree file is copied from the Linux kernel 4.18. - -Signed-off-by: Hauke Mehrtens ---- - arch/arm/dts/Makefile | 1 + - arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts | 101 +++++++++++++++++++++++++++++ - board/sunxi/MAINTAINERS | 5 ++ - configs/orangepi_r1_defconfig | 16 +++++ - 4 files changed, 123 insertions(+) - create mode 100644 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts - create mode 100644 configs/orangepi_r1_defconfig - ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -350,6 +350,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ - sun8i-a83t-cubietruck-plus.dtb \ - sun8i-a83t-tbs-a711.dts - dtb-$(CONFIG_MACH_SUN8I_H3) += \ -+ sun8i-h2-plus-orangepi-r1.dtb \ - sun8i-h2-plus-orangepi-zero.dtb \ - sun8i-h3-bananapi-m2-plus.dtb \ - sun8i-h3-libretech-all-h3-cc.dtb \ ---- /dev/null -+++ b/arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts -@@ -0,0 +1,101 @@ -+/* -+ * Copyright (C) 2017 Icenowy Zheng -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* Orange Pi R1 is based on Orange Pi Zero design */ -+#include "sun8i-h2-plus-orangepi-zero.dts" -+ -+/ { -+ model = "Xunlong Orange Pi R1"; -+ compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus"; -+ -+ /delete-node/ reg_vcc_wifi; -+ -+ /* -+ * Ths pin of this regulator is the same with the Wi-Fi extra -+ * regulator on the original Zero. However it's used for USB -+ * Ethernet rather than the Wi-Fi now. -+ */ -+ reg_vcc_usb_eth: reg-vcc-usb-ethernet { -+ compatible = "regulator-fixed"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-usb-ethernet"; -+ enable-active-high; -+ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ aliases { -+ ethernet1 = &rtl8189etv; -+ }; -+}; -+ -+/* -+&spi0 { -+ status = "okay"; -+ -+ flash@0 { -+ compatible = "mxicy,mx25l12805d", "jedec,spi-nor"; -+ }; -+}; -+*/ -+ -+&ohci1 { -+ /* -+ * RTL8152B USB-Ethernet adapter is connected to USB1, -+ * and it's a USB 2.0 device. So the OHCI1 controller -+ * can be left disabled. -+ */ -+ status = "disabled"; -+}; -+ -+&mmc1 { -+ vmmc-supply = <®_vcc3v3>; -+ vqmmc-supply = <®_vcc3v3>; -+ -+ rtl8189etv: sdio_wifi@1 { -+ reg = <1>; -+ }; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_vcc_usb_eth>; -+}; ---- a/board/sunxi/MAINTAINERS -+++ b/board/sunxi/MAINTAINERS -@@ -342,6 +342,11 @@ M: Jagan Teki -+S: Maintained -+F: configs/orangepi_r1_defconfig -+ - PINE64 BOARDS - M: Andre Przywara - S: Maintained ---- /dev/null -+++ b/configs/orangepi_r1_defconfig -@@ -0,0 +1,16 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_SUNXI=y -+CONFIG_SPL=y -+CONFIG_MACH_SUN8I_H3=y -+CONFIG_DRAM_CLK=624 -+CONFIG_DRAM_ZQ=3881979 -+CONFIG_DRAM_ODT_EN=y -+# CONFIG_VIDEO_DE2 is not set -+CONFIG_SPL_SPI_SUNXI=y -+CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-r1" -+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set -+CONFIG_CONSOLE_MUX=y -+# CONFIG_CMD_FLASH is not set -+CONFIG_SUN8I_EMAC=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/package/boot/uboot-sunxi/patches/400-ARM-dts-orange-pi-zero-plus.patch b/package/boot/uboot-sunxi/patches/400-ARM-dts-orange-pi-zero-plus.patch deleted file mode 100644 index e1e16d6f3..000000000 --- a/package/boot/uboot-sunxi/patches/400-ARM-dts-orange-pi-zero-plus.patch +++ /dev/null @@ -1,222 +0,0 @@ -From fd576a3c594ee2356b50a0738403e5cef094935a Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sat, 9 Jun 2018 15:16:42 +0200 -Subject: sun50i: h5: Add initial Orange Pi Zero Plus support - -Orange Pi Zero Plus is an open-source single-board computer -using the Allwinner H5 SOC. - -H5 Orangepi Zero Plus has - - Quad-core Cortex-A53 - - 512MB DDR3 - - micrSD slot - - 16MBit SPI Nor flash - - Debug TTL UART - - 1GBit/s Ethernet (RTL8211E) - - Wifi (RTL8189FTV) - - USB 2.0 Host - - USB 2.0 OTG + power supply - -The device tree file is copied from the Linux kernel 4.18. - -Signed-off-by: Hauke Mehrtens ---- - arch/arm/dts/Makefile | 1 + - arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts | 145 ++++++++++++++++++++++++++ - board/sunxi/MAINTAINERS | 5 + - configs/orangepi_zero_plus_defconfig | 16 +++ - 4 files changed, 167 insertions(+) - create mode 100644 arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts - create mode 100644 configs/orangepi_zero_plus_defconfig - ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -372,6 +372,7 @@ dtb-$(CONFIG_MACH_SUN8I_V3S) += \ - dtb-$(CONFIG_MACH_SUN50I_H5) += \ - sun50i-h5-nanopi-neo2.dtb \ - sun50i-h5-nanopi-neo-plus2.dtb \ -+ sun50i-h5-orangepi-zero-plus.dtb \ - sun50i-h5-orangepi-pc2.dtb \ - sun50i-h5-orangepi-prime.dtb \ - sun50i-h5-orangepi-zero-plus2.dtb ---- /dev/null -+++ b/arch/arm/dts/sun50i-h5-orangepi-zero-plus.dts -@@ -0,0 +1,145 @@ -+/* -+ * Copyright (C) 2016 ARM Ltd. -+ * Copyright (C) 2018 Hauke Mehrtens -+ * -+ * SPDX-License-Identifier: (GPL-2.0+ OR X11) -+ */ -+ -+/dts-v1/; -+#include "sun50i-h5.dtsi" -+ -+#include -+#include -+#include -+ -+/ { -+ model = "Xunlong Orange Pi Zero Plus"; -+ compatible = "xunlong,orangepi-zero-plus", "allwinner,sun50i-h5"; -+ -+ reg_vcc3v3: vcc3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; -+ -+ aliases { -+ ethernet0 = &emac; -+ ethernet1 = &rtl8189ftv; -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ pwr { -+ label = "orangepi:green:pwr"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */ -+ default-state = "on"; -+ }; -+ -+ status { -+ label = "orangepi:red:status"; -+ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */ -+ }; -+ }; -+ -+ reg_gmac_3v3: gmac-3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "gmac-3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ startup-delay-us = <100000>; -+ enable-active-high; -+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ -+ }; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&emac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emac_rgmii_pins>; -+ phy-supply = <®_gmac_3v3>; -+ phy-handle = <&ext_rgmii_phy>; -+ phy-mode = "rgmii"; -+ status = "okay"; -+}; -+ -+&external_mdio { -+ ext_rgmii_phy: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ }; -+}; -+ -+&mmc0 { -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ -+ status = "okay"; -+}; -+ -+&mmc1 { -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ non-removable; -+ status = "okay"; -+ -+ /* -+ * Explicitly define the sdio device, so that we can add an ethernet -+ * alias for it (which e.g. makes u-boot set a mac-address). -+ */ -+ rtl8189ftv: sdio_wifi@1 { -+ reg = <1>; -+ }; -+}; -+ -+/* -+&spi0 { -+ status = "okay"; -+ -+ flash@0 { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ compatible = "mxicy,mx25l1606e", "winbond,w25q128"; -+ reg = <0>; -+ spi-max-frequency = <40000000>; -+ }; -+}; -+*/ -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usb_otg { -+ dr_mode = "peripheral"; -+ status = "okay"; -+}; -+ -+&usbphy { -+ /* USB Type-A ports' VBUS is always on */ -+ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */ -+ status = "okay"; -+}; ---- a/board/sunxi/MAINTAINERS -+++ b/board/sunxi/MAINTAINERS -@@ -327,6 +327,11 @@ M: Icenowy Zheng - S: Maintained - F: configs/orangepi_zero_defconfig - -+ORANGEPI ZERO PLUS BOARD -+M: Hauke Mehrtens -+S: Maintained -+F: configs/orangepi_zero_plus_defconfig -+ - ORANGEPI ZERO PLUS 2 BOARD - M: Jagan Teki - S: Maintained ---- /dev/null -+++ b/configs/orangepi_zero_plus_defconfig -@@ -0,0 +1,16 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_SUNXI=y -+CONFIG_SPL=y -+CONFIG_MACH_SUN50I_H5=y -+CONFIG_DRAM_CLK=624 -+CONFIG_DRAM_ZQ=3881977 -+CONFIG_MMC0_CD_PIN="PH13" -+CONFIG_MMC_SUNXI_SLOT_EXTRA=2 -+CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-zero-plus" -+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set -+# CONFIG_CMD_FLASH is not set -+# CONFIG_SPL_DOS_PARTITION is not set -+# CONFIG_SPL_EFI_PARTITION is not set -+CONFIG_SUN8I_EMAC=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/package/boot/uboot-xburst/Makefile b/package/boot/uboot-xburst/Makefile deleted file mode 100644 index 413289a7f..000000000 --- a/package/boot/uboot-xburst/Makefile +++ /dev/null @@ -1,88 +0,0 @@ -# -# Copyright (C) 2010 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=u-boot -PKG_VERSION:=2012.10-rc2 -PKG_RELEASE:=1 - -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=6d094cafa7ecea8b671fbdcd21130b6a4f5744fc47dd263e101ed5d3629dffd4 -PKG_TARGETS:=bin - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -include $(INCLUDE_DIR)/package.mk - -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= -endef - -define uboot/qi_lb60 - TITLE:=U-boot for the qi_lb60 board -endef - -UBOOTS:=qi_lb60 - -define Package/uboot/template -define Package/uboot-xburst-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_xburst - TITLE:=$(2) - URL:=http://www.denx.de/wiki/UBoot/WebHome - VARIANT:=$(1) -endef -endef - -define BuildUbootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/template -define Package/uboot-xburst-$(1)/install - $(CP) $(PKG_BUILD_DIR)/u-boot-xburst.bin $(BIN_DIR)/$(2) - rmdir $$(1) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(u)-u-boot.bin)) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUbootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-xburst-$(u))) \ -) diff --git a/package/boot/uboot-xburst/patches/0001-qi_lb60-add-nand-spl-support.patch b/package/boot/uboot-xburst/patches/0001-qi_lb60-add-nand-spl-support.patch deleted file mode 100644 index e77024352..000000000 --- a/package/boot/uboot-xburst/patches/0001-qi_lb60-add-nand-spl-support.patch +++ /dev/null @@ -1,894 +0,0 @@ -From 0329cf7965956a5a7044827e0ce88ae8d5150e54 Mon Sep 17 00:00:00 2001 -From: Xiangfu -Date: Fri, 12 Oct 2012 09:46:58 +0800 -Subject: [PATCH 1/6] qi_lb60: add nand spl support - - The JZ4740 CPU can load 8KB from two different addresses: - 1. the normal area up to 8KB starting from NAND flash address 0x00000000 - 2. the backup area up to 8KB starting from NAND flash address 0x00002000 - -Signed-off-by: Xiangfu ---- - Makefile | 12 +++ - arch/mips/cpu/xburst/Makefile | 7 +- - arch/mips/cpu/xburst/cpu.c | 4 + - arch/mips/cpu/xburst/jz4740.c | 82 +++++++---------- - arch/mips/cpu/xburst/spl/Makefile | 47 ++++++++++ - arch/mips/cpu/xburst/spl/start.S | 63 +++++++++++++ - board/qi/qi_lb60/Makefile | 4 + - board/qi/qi_lb60/qi_lb60-spl.c | 30 +++++++ - board/qi/qi_lb60/qi_lb60.c | 8 +- - board/qi/qi_lb60/u-boot-spl.lds | 61 +++++++++++++ - drivers/mtd/nand/jz4740_nand.c | 39 ++++++++- - include/configs/qi_lb60.h | 175 ++++++++++++++++++------------------- - 12 files changed, 386 insertions(+), 146 deletions(-) - create mode 100644 arch/mips/cpu/xburst/spl/Makefile - create mode 100644 arch/mips/cpu/xburst/spl/start.S - create mode 100644 board/qi/qi_lb60/qi_lb60-spl.c - create mode 100644 board/qi/qi_lb60/u-boot-spl.lds - -diff --git a/Makefile b/Makefile -index 34d9075..a22778e 100644 ---- a/Makefile -+++ b/Makefile -@@ -393,6 +393,10 @@ ALL-y += $(obj)u-boot-nodtb-tegra.bin - endif - endif - -+ifeq ($(CPU),xburst) -+ALL-y += $(obj)u-boot-xburst.bin -+endif -+ - all: $(ALL-y) $(SUBDIR_EXAMPLES) - - $(obj)u-boot.dtb: $(obj)u-boot -@@ -506,6 +510,14 @@ $(obj)u-boot-nodtb-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin - endif - endif - -+ifeq ($(CPU),xburst) -+$(obj)u-boot-xburst.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin -+ dd if=$(obj)spl/u-boot-spl.bin of=$(obj)spl/u-boot-pad.bin conv=sync bs=8192 count=1 -+ dd if=$(obj)spl/u-boot-spl.bin of=$(obj)spl/u-boot-pad.bin conv=sync,notrunc oflag=append bs=8192 count=1 -+ tr '\0' '\377' < /dev/zero | dd of=$(obj)spl/u-boot-pad.bin conv=sync,notrunc oflag=append bs=16384 count=1 -+ cat $(obj)spl/u-boot-pad.bin u-boot.bin > $@ -+endif -+ - ifeq ($(CONFIG_SANDBOX),y) - GEN_UBOOT = \ - cd $(LNDIR) && $(CC) $(SYMS) -T $(obj)u-boot.lds \ -diff --git a/arch/mips/cpu/xburst/Makefile b/arch/mips/cpu/xburst/Makefile -index b1f2ae4..ec35e55 100644 ---- a/arch/mips/cpu/xburst/Makefile -+++ b/arch/mips/cpu/xburst/Makefile -@@ -24,9 +24,12 @@ include $(TOPDIR)/config.mk - - LIB = $(obj)lib$(CPU).o - -+COBJS-y = cpu.o jz_serial.o -+ -+ifneq ($(CONFIG_SPL_BUILD),y) - START = start.o --SOBJS-y = --COBJS-y = cpu.o timer.o jz_serial.o -+COBJS-y += timer.o -+endif - - COBJS-$(CONFIG_JZ4740) += jz4740.o - -diff --git a/arch/mips/cpu/xburst/cpu.c b/arch/mips/cpu/xburst/cpu.c -index ddcbfaa..1432838 100644 ---- a/arch/mips/cpu/xburst/cpu.c -+++ b/arch/mips/cpu/xburst/cpu.c -@@ -42,6 +42,8 @@ - : \ - : "i" (op), "R" (*(unsigned char *)(addr))) - -+#ifndef CONFIG_SPL_BUILD -+ - void __attribute__((weak)) _machine_restart(void) - { - struct jz4740_wdt *wdt = (struct jz4740_wdt *)JZ4740_WDT_BASE; -@@ -109,6 +111,8 @@ void invalidate_dcache_range(ulong start_addr, ulong stop) - cache_op(Hit_Invalidate_D, addr); - } - -+#endif -+ - void flush_icache_all(void) - { - u32 addr, t = 0; -diff --git a/arch/mips/cpu/xburst/jz4740.c b/arch/mips/cpu/xburst/jz4740.c -index c0b9817..8816aa3 100644 ---- a/arch/mips/cpu/xburst/jz4740.c -+++ b/arch/mips/cpu/xburst/jz4740.c -@@ -32,31 +32,19 @@ int disable_interrupts(void) - return 0; - } - --/* -- * PLL output clock = EXTAL * NF / (NR * NO) -- * NF = FD + 2, NR = RD + 2 -- * NO = 1 (if OD = 0), NO = 2 (if OD = 1 or 2), NO = 4 (if OD = 3) -- */ - void pll_init(void) - { - struct jz4740_cpm *cpm = (struct jz4740_cpm *)JZ4740_CPM_BASE; - -- register unsigned int cfcr, plcr1; -- int n2FR[33] = { -- 0, 0, 1, 2, 3, 0, 4, 0, 5, 0, 0, 0, 6, 0, 0, 0, -- 7, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, -- 9 -- }; -- int div[5] = {1, 3, 3, 3, 3}; /* divisors of I:S:P:L:M */ -- int nf, pllout2; -+ register unsigned int cfcr, plcr; -+ unsigned int nf, pllout2; - - cfcr = CPM_CPCCR_CLKOEN | -- CPM_CPCCR_PCS | -- (n2FR[div[0]] << CPM_CPCCR_CDIV_BIT) | -- (n2FR[div[1]] << CPM_CPCCR_HDIV_BIT) | -- (n2FR[div[2]] << CPM_CPCCR_PDIV_BIT) | -- (n2FR[div[3]] << CPM_CPCCR_MDIV_BIT) | -- (n2FR[div[4]] << CPM_CPCCR_LDIV_BIT); -+ (0 << CPM_CPCCR_CDIV_BIT) | -+ (2 << CPM_CPCCR_HDIV_BIT) | -+ (2 << CPM_CPCCR_PDIV_BIT) | -+ (2 << CPM_CPCCR_MDIV_BIT) | -+ (2 << CPM_CPCCR_LDIV_BIT); - - pllout2 = (cfcr & CPM_CPCCR_PCS) ? - CONFIG_SYS_CPU_SPEED : (CONFIG_SYS_CPU_SPEED / 2); -@@ -65,15 +53,18 @@ void pll_init(void) - writel(pllout2 / 48000000 - 1, &cpm->uhccdr); - - nf = CONFIG_SYS_CPU_SPEED * 2 / CONFIG_SYS_EXTAL; -- plcr1 = ((nf - 2) << CPM_CPPCR_PLLM_BIT) | /* FD */ -+ plcr = ((nf - 2) << CPM_CPPCR_PLLM_BIT) | /* FD */ - (0 << CPM_CPPCR_PLLN_BIT) | /* RD=0, NR=2 */ - (0 << CPM_CPPCR_PLLOD_BIT) | /* OD=0, NO=1 */ -- (0x20 << CPM_CPPCR_PLLST_BIT) | /* PLL stable time */ -+ (0x32 << CPM_CPPCR_PLLST_BIT) | /* PLL stable time */ - CPM_CPPCR_PLLEN; /* enable PLL */ - - /* init PLL */ - writel(cfcr, &cpm->cpccr); -- writel(plcr1, &cpm->cppcr); -+ writel(plcr, &cpm->cppcr); -+ -+ while (!(readl(&cpm->cppcr) & CPM_CPPCR_PLLS)) -+ ; - } - - void sdram_init(void) -@@ -92,26 +83,12 @@ void sdram_init(void) - 2 << EMC_DMCR_TCL_BIT /* CAS latency is 3 */ - }; - -- int div[] = {1, 2, 3, 4, 6, 8, 12, 16, 24, 32}; -- - cpu_clk = CONFIG_SYS_CPU_SPEED; -- mem_clk = cpu_clk * div[__cpm_get_cdiv()] / div[__cpm_get_mdiv()]; -+ mem_clk = 84000000; - - writel(0, &emc->bcr); /* Disable bus release */ - writew(0, &emc->rtcsr); /* Disable clock for counting */ - -- /* Fault DMCR value for mode register setting*/ --#define SDRAM_ROW0 11 --#define SDRAM_COL0 8 --#define SDRAM_BANK40 0 -- -- dmcr0 = ((SDRAM_ROW0 - 11) << EMC_DMCR_RA_BIT) | -- ((SDRAM_COL0 - 8) << EMC_DMCR_CA_BIT) | -- (SDRAM_BANK40 << EMC_DMCR_BA_BIT) | -- (SDRAM_BW16 << EMC_DMCR_BW_BIT) | -- EMC_DMCR_EPIN | -- cas_latency_dmcr[((SDRAM_CASL == 3) ? 1 : 0)]; -- - /* Basic DMCR value */ - dmcr = ((SDRAM_ROW - 11) << EMC_DMCR_RA_BIT) | - ((SDRAM_COL - 8) << EMC_DMCR_CA_BIT) | -@@ -128,31 +105,31 @@ void sdram_init(void) - if (tmp > 11) - tmp = 11; - dmcr |= (tmp - 4) << EMC_DMCR_TRAS_BIT; -- tmp = SDRAM_RCD / ns; - -+ tmp = SDRAM_RCD / ns; - if (tmp > 3) - tmp = 3; - dmcr |= tmp << EMC_DMCR_RCD_BIT; -- tmp = SDRAM_TPC / ns; - -+ tmp = SDRAM_TPC / ns; - if (tmp > 7) - tmp = 7; - dmcr |= tmp << EMC_DMCR_TPC_BIT; -- tmp = SDRAM_TRWL / ns; - -+ tmp = SDRAM_TRWL / ns; - if (tmp > 3) - tmp = 3; - dmcr |= tmp << EMC_DMCR_TRWL_BIT; -- tmp = (SDRAM_TRAS + SDRAM_TPC) / ns; - -+ tmp = (SDRAM_TRAS + SDRAM_TPC) / ns; - if (tmp > 14) - tmp = 14; - dmcr |= ((tmp + 1) >> 1) << EMC_DMCR_TRC_BIT; - - /* SDRAM mode value */ -- sdmode = EMC_SDMR_BT_SEQ | -- EMC_SDMR_OM_NORMAL | -- EMC_SDMR_BL_4 | -+ sdmode = EMC_SDMR_BT_SEQ | -+ EMC_SDMR_OM_NORMAL | -+ EMC_SDMR_BL_4 | - cas_latency_sdmr[((SDRAM_CASL == 3) ? 1 : 0)]; - - /* Stage 1. Precharge all banks by writing SDMR with DMCR.MRSET=0 */ -@@ -172,8 +149,8 @@ void sdram_init(void) - if (tmp > 0xff) - tmp = 0xff; - writew(tmp, &emc->rtcor); -+ - writew(0, &emc->rtcnt); -- /* Divisor is 64, CKO/64 */ - writew(EMC_RTCSR_CKS_64, &emc->rtcsr); - - /* Wait for number of auto-refresh cycles */ -@@ -182,13 +159,17 @@ void sdram_init(void) - ; - - /* Stage 3. Mode Register Set */ -+ dmcr0 = (11 << EMC_DMCR_RA_BIT) | -+ (8 << EMC_DMCR_CA_BIT) | -+ (0 << EMC_DMCR_BA_BIT) | -+ EMC_DMCR_EPIN | -+ (SDRAM_BW16 << EMC_DMCR_BW_BIT) | -+ cas_latency_dmcr[((SDRAM_CASL == 3) ? 1 : 0)]; - writel(dmcr0 | EMC_DMCR_RFSH | EMC_DMCR_MRSET, &emc->dmcr); - writeb(0, JZ4740_EMC_SDMR0 | sdmode); - - /* Set back to basic DMCR value */ - writel(dmcr | EMC_DMCR_RFSH | EMC_DMCR_MRSET, &emc->dmcr); -- -- /* everything is ok now */ - } - - DECLARE_GLOBAL_DATA_PTR; -@@ -232,9 +213,10 @@ void rtc_init(void) - phys_size_t initdram(int board_type) - { - struct jz4740_emc *emc = (struct jz4740_emc *)JZ4740_EMC_BASE; -- u32 dmcr; -- u32 rows, cols, dw, banks; -- ulong size; -+ -+ unsigned int dmcr; -+ unsigned int rows, cols, dw, banks; -+ unsigned long size; - - dmcr = readl(&emc->dmcr); - rows = 11 + ((dmcr & EMC_DMCR_RA_MASK) >> EMC_DMCR_RA_BIT); -diff --git a/arch/mips/cpu/xburst/spl/Makefile b/arch/mips/cpu/xburst/spl/Makefile -new file mode 100644 -index 0000000..f45e8c8 ---- /dev/null -+++ b/arch/mips/cpu/xburst/spl/Makefile -@@ -0,0 +1,47 @@ -+# -+# Copyright (C) 2011 Xiangfu Liu -+# -+# See file CREDITS for list of people who contributed to this -+# project. -+# -+# This program is free software; you can redistribute it and/or -+# modify it under the terms of the GNU General Public License as -+# published by the Free Software Foundation; either version 2 of -+# the License, or (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+# MA 02111-1307 USA -+# -+ -+include $(TOPDIR)/config.mk -+ -+LIB = $(obj)lib$(CPU).o -+ -+START = start.o -+SOBJS-y = -+COBJS-y = -+ -+SRCS := $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c) -+OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) -+START := $(addprefix $(obj),$(START)) -+ -+all: $(obj).depend $(START) $(LIB) -+ -+$(LIB): $(OBJS) -+ $(call cmd_link_o_target, $(OBJS)) -+ -+######################################################################### -+ -+# defines $(obj).depend target -+include $(SRCTREE)/rules.mk -+ -+sinclude $(obj).depend -+ -+######################################################################### -diff --git a/arch/mips/cpu/xburst/spl/start.S b/arch/mips/cpu/xburst/spl/start.S -new file mode 100644 -index 0000000..e31c4c8 ---- /dev/null -+++ b/arch/mips/cpu/xburst/spl/start.S -@@ -0,0 +1,63 @@ -+/* -+ * Copyright (c) 2010 Xiangfu Liu -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 3 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+ .set noreorder -+ -+ .globl _start -+ .text -+_start: -+ .word JZ4740_NANDBOOT_CFG /* fetched during NAND Boot */ -+reset: -+ /* -+ * STATUS register -+ * CU0=UM=EXL=IE=0, BEV=ERL=1, IP2~7=1 -+ */ -+ li t0, 0x0040FC04 -+ mtc0 t0, CP0_STATUS -+ /* -+ * CAUSE register -+ * IV=1, use the specical interrupt vector (0x200) -+ */ -+ li t1, 0x00800000 -+ mtc0 t1, CP0_CAUSE -+ -+ bal 1f -+ nop -+ .word _GLOBAL_OFFSET_TABLE_ -+1: -+ move gp, ra -+ lw t1, 0(ra) -+ move gp, t1 -+ -+ la sp, 0x80004000 -+ la t9, nand_spl_boot -+ j t9 -+ nop -diff --git a/board/qi/qi_lb60/Makefile b/board/qi/qi_lb60/Makefile -index 5dae11b..e399246 100644 ---- a/board/qi/qi_lb60/Makefile -+++ b/board/qi/qi_lb60/Makefile -@@ -22,7 +22,11 @@ include $(TOPDIR)/config.mk - - LIB = $(obj)lib$(BOARD).o - -+ifeq ($(CONFIG_SPL_BUILD),y) -+COBJS := $(BOARD)-spl.o -+else - COBJS := $(BOARD).o -+endif - - SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) - OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) -diff --git a/board/qi/qi_lb60/qi_lb60-spl.c b/board/qi/qi_lb60/qi_lb60-spl.c -new file mode 100644 -index 0000000..3fe3fa3 ---- /dev/null -+++ b/board/qi/qi_lb60/qi_lb60-spl.c -@@ -0,0 +1,30 @@ -+/* -+ * Authors: Xiangfu Liu -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 3 of the License, or (at your option) any later version. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+void nand_spl_boot(void) -+{ -+ __gpio_as_sdram_16bit_4720(); -+ __gpio_as_uart0(); -+ __gpio_jtag_to_uart0(); -+ -+ serial_init(); -+ -+ pll_init(); -+ sdram_init(); -+ -+ nand_init(); -+ -+ puts("\nQi LB60 SPL: Starting U-Boot ...\n"); -+ nand_boot(); -+} -diff --git a/board/qi/qi_lb60/qi_lb60.c b/board/qi/qi_lb60/qi_lb60.c -index d975209..3bd4e2f 100644 ---- a/board/qi/qi_lb60/qi_lb60.c -+++ b/board/qi/qi_lb60/qi_lb60.c -@@ -1,5 +1,5 @@ - /* -- * Authors: Xiangfu Liu -+ * Authors: Xiangfu Liu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License -@@ -97,8 +97,10 @@ int board_early_init_f(void) - /* U-Boot common routines */ - int checkboard(void) - { -- printf("Board: Qi LB60 (Ingenic XBurst Jz4740 SoC, Speed %ld MHz)\n", -- gd->cpu_clk / 1000000); -+ printf("Board: Qi LB60 (Ingenic XBurst Jz4740 SoC)\n"); -+ printf(" CPU: %ld\n", gd->cpu_clk); -+ printf(" MEM: %ld\n", gd->mem_clk); -+ printf(" DEV: %ld\n", gd->dev_clk); - - return 0; - } -diff --git a/board/qi/qi_lb60/u-boot-spl.lds b/board/qi/qi_lb60/u-boot-spl.lds -new file mode 100644 -index 0000000..930537f ---- /dev/null -+++ b/board/qi/qi_lb60/u-boot-spl.lds -@@ -0,0 +1,61 @@ -+/* -+ * (C) Copyright 2012 Xiangfu Liu -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ */ -+ -+OUTPUT_FORMAT("elf32-tradlittlemips", "elf32-tradlittlemips", "elf32-tradlittlemips") -+ -+OUTPUT_ARCH(mips) -+ENTRY(_start) -+SECTIONS -+{ -+ . = 0x80000000; -+ . = ALIGN(4); -+ .text : -+ { -+ *(.text) -+ } -+ -+ . = ALIGN(4); -+ .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } -+ -+ . = ALIGN(4); -+ .data : { *(.data) } -+ -+ . = ALIGN(4); -+ .sdata : { *(.sdata) } -+ -+ _gp = ALIGN(16); -+ -+ __got_start = .; -+ .got : { *(.got) } -+ __got_end = .; -+ -+ . = .; -+ __u_boot_cmd_start = .; -+ .u_boot_cmd : { *(.u_boot_cmd) } -+ __u_boot_cmd_end = .; -+ -+ uboot_end_data = .; -+ num_got_entries = (__got_end - __got_start) >> 2; -+ -+ . = ALIGN(4); -+ .sbss : { *(.sbss) } -+ .bss : { *(.bss) } -+ uboot_end = .; -+} -+ASSERT(uboot_end <= 0x80002000, "NAND bootstrap too big"); -diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c -index 3ec34f3..24a4921 100644 ---- a/drivers/mtd/nand/jz4740_nand.c -+++ b/drivers/mtd/nand/jz4740_nand.c -@@ -15,6 +15,9 @@ - #include - #include - -+#ifdef CONFIG_SPL_BUILD -+#define printf(s) puts(s) -+#endif - #define JZ_NAND_DATA_ADDR ((void __iomem *)0xB8000000) - #define JZ_NAND_CMD_ADDR (JZ_NAND_DATA_ADDR + 0x8000) - #define JZ_NAND_ADDR_ADDR (JZ_NAND_DATA_ADDR + 0x10000) -@@ -176,7 +179,7 @@ static int jz_nand_rs_correct_data(struct mtd_info *mtd, u_char *dat, - for (k = 0; k < 9; k++) - writeb(read_ecc[k], &emc->nfpar[k]); - } -- /* Set PRDY */ -+ - writel(readl(&emc->nfecr) | EMC_NFECR_PRDY, &emc->nfecr); - - /* Wait for completion */ -@@ -184,7 +187,7 @@ static int jz_nand_rs_correct_data(struct mtd_info *mtd, u_char *dat, - status = readl(&emc->nfints); - } while (!(status & EMC_NFINTS_DECF)); - -- /* disable ecc */ -+ /* Disable ECC */ - writel(readl(&emc->nfecr) & ~EMC_NFECR_ECCE, &emc->nfecr); - - /* Check decoding */ -@@ -192,7 +195,7 @@ static int jz_nand_rs_correct_data(struct mtd_info *mtd, u_char *dat, - return 0; - - if (status & EMC_NFINTS_UNCOR) { -- printf("uncorrectable ecc\n"); -+ printf("JZ4740 uncorrectable ECC\n"); - return -1; - } - -@@ -230,6 +233,32 @@ static int jz_nand_rs_correct_data(struct mtd_info *mtd, u_char *dat, - return errcnt; - } - -+#ifdef CONFIG_SPL_BUILD -+static void jz_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) -+{ -+ int i; -+ struct nand_chip *this = mtd->priv; -+ -+#if (JZ4740_NANDBOOT_CFG == JZ4740_NANDBOOT_B16R3) || \ -+ (JZ4740_NANDBOOT_CFG == JZ4740_NANDBOOT_B16R2) -+ for (i = 0; i < len; i += 2) -+ buf[i] = readw(this->IO_ADDR_R); -+#elif (JZ4740_NANDBOOT_CFG == JZ4740_NANDBOOT_B8R3) || \ -+ (JZ4740_NANDBOOT_CFG == JZ4740_NANDBOOT_B8R2) -+ for (i = 0; i < len; i++) -+ buf[i] = readb(this->IO_ADDR_R); -+#else -+ #error JZ4740_NANDBOOT_CFG not defined or wrong -+#endif -+} -+ -+static uint8_t jz_nand_read_byte(struct mtd_info *mtd) -+{ -+ struct nand_chip *this = mtd->priv; -+ return readb(this->IO_ADDR_R); -+} -+#endif -+ - /* - * Main initialization routine - */ -@@ -254,6 +283,10 @@ int board_nand_init(struct nand_chip *nand) - nand->ecc.size = CONFIG_SYS_NAND_ECCSIZE; - nand->ecc.bytes = CONFIG_SYS_NAND_ECCBYTES; - nand->ecc.layout = &qi_lb60_ecclayout_2gb; -+#ifdef CONFIG_SPL_BUILD -+ nand->read_byte = jz_nand_read_byte; -+ nand->read_buf = jz_nand_read_buf; -+#endif - nand->chip_delay = 50; - nand->options = NAND_USE_FLASH_BBT; - -diff --git a/include/configs/qi_lb60.h b/include/configs/qi_lb60.h -index 4bb5bbc..7bff444 100644 ---- a/include/configs/qi_lb60.h -+++ b/include/configs/qi_lb60.h -@@ -1,5 +1,5 @@ - /* -- * Authors: Xiangfu Liu -+ * Authors: Xiangfu Liu - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License -@@ -14,7 +14,6 @@ - #define CONFIG_SYS_LITTLE_ENDIAN - #define CONFIG_JZSOC /* Jz SoC */ - #define CONFIG_JZ4740 /* Jz4740 SoC */ --#define CONFIG_NAND_JZ4740 - - #define CONFIG_SYS_CPU_SPEED 336000000 /* CPU clock: 336 MHz */ - #define CONFIG_SYS_EXTAL 12000000 /* EXTAL freq: 12 MHz */ -@@ -24,24 +23,43 @@ - #define CONFIG_SYS_UART_BASE JZ4740_UART0_BASE /* Base of the UART channel */ - #define CONFIG_BAUDRATE 57600 - -+#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAUL) -+#define CONFIG_BOOTDELAY 0 -+#define CONFIG_BOOTARGS "mem=32M console=tty0 console=ttyS0,57600n8 ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw rootwait" -+#define CONFIG_BOOTCOMMAND "nand read 0x80600000 0x400000 0x280000;bootm" -+ -+/* -+ * Miscellaneous configurable options -+ */ -+#define CONFIG_SYS_SDRAM_BASE 0x80000000 /* Cached addr */ -+#define CONFIG_SYS_INIT_SP_OFFSET 0x400000 -+#define CONFIG_SYS_LOAD_ADDR 0x80600000 -+#define CONFIG_SYS_MEMTEST_START 0x80100000 -+#define CONFIG_SYS_MEMTEST_END 0x80A00000 -+#define CONFIG_SYS_TEXT_BASE 0x80100000 -+#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE -+ -+#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024) -+#define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) -+ -+#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ -+#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) -+ -+#define CONFIG_SYS_LONGHELP -+#define CONFIG_SYS_MAXARGS 16 -+#define CONFIG_SYS_PROMPT "NanoNote# " -+ - #define CONFIG_SKIP_LOWLEVEL_INIT - #define CONFIG_BOARD_EARLY_INIT_F - #define CONFIG_SYS_NO_FLASH - #define CONFIG_SYS_FLASH_BASE 0 /* init flash_base as 0 */ --#define CONFIG_ENV_OVERWRITE -- --#define CONFIG_BOOTP_MASK (CONFIG_BOOTP_DEFAUL) --#define CONFIG_BOOTDELAY 0 --#define CONFIG_BOOTARGS "mem=32M console=tty0 console=ttyS0,57600n8 ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw rootwait" --#define CONFIG_BOOTCOMMAND "nand read 0x80600000 0x400000 0x200000;bootm" - - /* -- * Command line configuration. -+ * Command line configuration - */ - #define CONFIG_CMD_BOOTD /* bootd */ - #define CONFIG_CMD_CONSOLE /* coninfo */ - #define CONFIG_CMD_ECHO /* echo arguments */ -- - #define CONFIG_CMD_LOADB /* loadb */ - #define CONFIG_CMD_LOADS /* loads */ - #define CONFIG_CMD_MEMORY /* md mm nm mw cp cmp crc base loop mtest */ -@@ -58,45 +76,16 @@ - #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */ - - /* -- * Miscellaneous configurable options -- */ --#define CONFIG_SYS_MAXARGS 16 --#define CONFIG_SYS_LONGHELP --#define CONFIG_SYS_PROMPT "NanoNote# " --#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ --#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) -- --#define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024) --#define CONFIG_SYS_BOOTPARAMS_LEN (128 * 1024) -- --#define CONFIG_SYS_SDRAM_BASE 0x80000000 /* Cached addr */ --#define CONFIG_SYS_INIT_SP_OFFSET 0x400000 --#define CONFIG_SYS_LOAD_ADDR 0x80600000 --#define CONFIG_SYS_MEMTEST_START 0x80100000 --#define CONFIG_SYS_MEMTEST_END 0x80800000 -- --/* -- * Environment -+ * NAND driver configuration - */ --#define CONFIG_ENV_IS_IN_NAND /* use NAND for environment vars */ -- --#define CONFIG_SYS_NAND_5_ADDR_CYCLE --/* -- * if board nand flash is 1GB, set to 1 -- * if board nand flash is 2GB, set to 2 -- * for change the PAGE_SIZE and BLOCK_SIZE -- * will delete when there is no 1GB flash -- */ --#define NANONOTE_NAND_SIZE 2 -- --#define CONFIG_SYS_NAND_PAGE_SIZE (2048 * NANONOTE_NAND_SIZE) --#define CONFIG_SYS_NAND_BLOCK_SIZE (256 * NANONOTE_NAND_SIZE << 10) --/* nand bad block was marked at this page in a block, start from 0 */ -+#define CONFIG_NAND_JZ4740 -+#define CONFIG_SYS_NAND_PAGE_SIZE 4096 -+#define CONFIG_SYS_NAND_BLOCK_SIZE (512 << 10) -+/* NAND bad block was marked at this page in a block, start from 0 */ - #define CONFIG_SYS_NAND_BADBLOCK_PAGE 127 - #define CONFIG_SYS_NAND_PAGE_COUNT 128 - #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0 --/* ECC offset position in oob area, default value is 6 if it isn't defined */ --#define CONFIG_SYS_NAND_ECC_POS (6 * NANONOTE_NAND_SIZE) -+#define CONFIG_SYS_NAND_ECC_POS 12 - #define CONFIG_SYS_NAND_ECCSIZE 512 - #define CONFIG_SYS_NAND_ECCBYTES 9 - #define CONFIG_SYS_NAND_ECCPOS \ -@@ -115,10 +104,9 @@ - #define CONFIG_SYS_ONENAND_BASE CONFIG_SYS_NAND_BASE - #define CONFIG_SYS_MAX_NAND_DEVICE 1 - #define CONFIG_SYS_NAND_SELECT_DEVICE 1 /* nand driver supports mutipl.*/ --#define CONFIG_NAND_SPL_TEXT_BASE 0x80000000 - - /* -- * IPL (Initial Program Loader, integrated inside CPU) -+ * IPL (Initial Program Loader, integrated inside Ingenic Xburst JZ4740 CPU) - * Will load first 8k from NAND (SPL) into cache and execute it from there. - * - * SPL (Secondary Program Loader) -@@ -130,77 +118,88 @@ - * NUB (NAND U-Boot) - * This NAND U-Boot (NUB) is a special U-Boot version which can be started - * from RAM. Therefore it mustn't (re-)configure the SDRAM controller. -- * - */ -+ -+/* -+ * NAND SPL configuration -+ */ -+#define CONFIG_SPL -+#define CONFIG_SPL_LIBGENERIC_SUPPORT -+#define CONFIG_SPL_LIBCOMMON_SUPPORT -+#define CONFIG_SPL_NAND_LOAD -+#define CONFIG_SPL_NAND_SIMPLE -+#define CONFIG_SPL_NAND_SUPPORT -+#define CONFIG_SPL_TEXT_BASE 0x80000000 -+#define CONFIG_SPL_START_S_PATH "arch/mips/cpu/xburst/spl" -+ -+#define CONFIG_SYS_NAND_5_ADDR_CYCLE -+#define CONFIG_SYS_NAND_HW_ECC_OOBFIRST -+#define JZ4740_NANDBOOT_CFG JZ4740_NANDBOOT_B8R3 -+ - #define CONFIG_SYS_NAND_U_BOOT_DST 0x80100000 /* Load NUB to this addr */ - #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_NAND_U_BOOT_DST --/* Start NUB from this addr*/ -+ /* Start NUB from this addr */ -+#define CONFIG_SYS_NAND_U_BOOT_OFFS (32 << 10) /* Offset of NUB */ -+#define CONFIG_SYS_NAND_U_BOOT_SIZE (256 << 10) /* Size of NUB */ - - /* -- * Define the partitioning of the NAND chip (only RAM U-Boot is needed here) -+ * Environment configuration - */ --#define CONFIG_SYS_NAND_U_BOOT_OFFS (256 << 10) /* Offset to RAM U-Boot image */ --#define CONFIG_SYS_NAND_U_BOOT_SIZE (512 << 10) /* Size of RAM U-Boot image */ -- -+#define CONFIG_ENV_OVERWRITE -+#define CONFIG_ENV_IS_IN_NAND - #define CONFIG_ENV_SIZE (4 << 10) - #define CONFIG_ENV_OFFSET \ - (CONFIG_SYS_NAND_BLOCK_SIZE + CONFIG_SYS_NAND_U_BOOT_SIZE) - #define CONFIG_ENV_OFFSET_REDUND \ - (CONFIG_ENV_OFFSET + CONFIG_SYS_NAND_BLOCK_SIZE) - --#define CONFIG_SYS_TEXT_BASE 0x80100000 --#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE -- - /* -- * SDRAM Info. -+ * CPU cache configuration - */ --#define CONFIG_NR_DRAM_BANKS 1 -+#define CONFIG_SYS_DCACHE_SIZE 16384 -+#define CONFIG_SYS_ICACHE_SIZE 16384 -+#define CONFIG_SYS_CACHELINE_SIZE 32 - - /* -- * Cache Configuration -+ * SDRAM configuration - */ --#define CONFIG_SYS_DCACHE_SIZE 16384 --#define CONFIG_SYS_ICACHE_SIZE 16384 --#define CONFIG_SYS_CACHELINE_SIZE 32 -+#define CONFIG_NR_DRAM_BANKS 1 -+ -+#define SDRAM_BW16 1 /* Data bus width: 0-32bit, 1-16bit */ -+#define SDRAM_BANK4 1 /* Banks each chip: 0-2bank, 1-4bank */ -+#define SDRAM_ROW 13 /* Row address: 11 to 13 */ -+#define SDRAM_COL 9 /* Column address: 8 to 12 */ -+#define SDRAM_CASL 2 /* CAS latency: 2 or 3 */ -+#define SDRAM_TRAS 45 /* RAS# Active Time */ -+#define SDRAM_RCD 20 /* RAS# to CAS# Delay */ -+#define SDRAM_TPC 20 /* RAS# Precharge Time */ -+#define SDRAM_TRWL 7 /* Write Latency Time */ -+#define SDRAM_TREF 15625 /* Refresh period: 8192 cycles/64ms */ - - /* -- * GPIO definition -+ * GPIO configuration - */ --#define GPIO_LCD_CS (2 * 32 + 21) --#define GPIO_AMP_EN (3 * 32 + 4) -+#define GPIO_LCD_CS (2 * 32 + 21) -+#define GPIO_AMP_EN (3 * 32 + 4) - --#define GPIO_SDPW_EN (3 * 32 + 2) --#define GPIO_SD_DETECT (3 * 32 + 0) -+#define GPIO_SDPW_EN (3 * 32 + 2) -+#define GPIO_SD_DETECT (3 * 32 + 0) - --#define GPIO_BUZZ_PWM (3 * 32 + 27) --#define GPIO_USB_DETECT (3 * 32 + 28) -+#define GPIO_BUZZ_PWM (3 * 32 + 27) -+#define GPIO_USB_DETECT (3 * 32 + 28) - --#define GPIO_AUDIO_POP (1 * 32 + 29) --#define GPIO_COB_TEST (1 * 32 + 30) -+#define GPIO_AUDIO_POP (1 * 32 + 29) -+#define GPIO_COB_TEST (1 * 32 + 30) - - #define GPIO_KEYOUT_BASE (2 * 32 + 10) --#define GPIO_KEYIN_BASE (3 * 32 + 18) --#define GPIO_KEYIN_8 (3 * 32 + 26) -+#define GPIO_KEYIN_BASE (3 * 32 + 18) -+#define GPIO_KEYIN_8 (3 * 32 + 26) - --#define GPIO_SD_CD_N GPIO_SD_DETECT /* SD Card insert detect */ -+#define GPIO_SD_CD_N GPIO_SD_DETECT /* SD Card insert detect */ - #define GPIO_SD_VCC_EN_N GPIO_SDPW_EN /* SD Card Power Enable */ - - #define SPEN GPIO_LCD_CS /* LCDCS :Serial command enable */ - #define SPDA (2 * 32 + 22) /* LCDSCL:Serial command clock input */ - #define SPCK (2 * 32 + 23) /* LCDSDA:Serial command data input */ - --/* SDRAM paramters */ --#define SDRAM_BW16 1 /* Data bus width: 0-32bit, 1-16bit */ --#define SDRAM_BANK4 1 /* Banks each chip: 0-2bank, 1-4bank */ --#define SDRAM_ROW 13 /* Row address: 11 to 13 */ --#define SDRAM_COL 9 /* Column address: 8 to 12 */ --#define SDRAM_CASL 2 /* CAS latency: 2 or 3 */ -- --/* SDRAM Timings, unit: ns */ --#define SDRAM_TRAS 45 /* RAS# Active Time */ --#define SDRAM_RCD 20 /* RAS# to CAS# Delay */ --#define SDRAM_TPC 20 /* RAS# Precharge Time */ --#define SDRAM_TRWL 7 /* Write Latency Time */ --#define SDRAM_TREF 15625 /* Refresh period: 8192 cycles/64ms */ -- - #endif --- -1.7.9.5 - diff --git a/package/boot/uboot-xburst/patches/0002-qi_lb60-add-software-usbboot-support.patch b/package/boot/uboot-xburst/patches/0002-qi_lb60-add-software-usbboot-support.patch deleted file mode 100644 index feaf297b7..000000000 --- a/package/boot/uboot-xburst/patches/0002-qi_lb60-add-software-usbboot-support.patch +++ /dev/null @@ -1,916 +0,0 @@ -From fa51192b912d296b8eec10f7d44c6c17eb1dd368 Mon Sep 17 00:00:00 2001 -From: Xiangfu -Date: Fri, 12 Oct 2012 09:47:39 +0800 -Subject: [PATCH 2/6] qi_lb60: add software usbboot support - - JZ4740 CPU have a internal ROM have such kind of code, that make - JZ4740 can boot from USB - - usbboot.S can downloads user program from the USB port to internal - SRAM and branches to the internal SRAM to execute the program - -Signed-off-by: Xiangfu ---- - board/qi/qi_lb60/Makefile | 1 + - board/qi/qi_lb60/qi_lb60-spl.c | 20 + - board/qi/qi_lb60/usbboot.S | 838 ++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 859 insertions(+) - create mode 100644 board/qi/qi_lb60/usbboot.S - -diff --git a/board/qi/qi_lb60/Makefile b/board/qi/qi_lb60/Makefile -index e399246..6dd8c6f 100644 ---- a/board/qi/qi_lb60/Makefile -+++ b/board/qi/qi_lb60/Makefile -@@ -23,6 +23,7 @@ include $(TOPDIR)/config.mk - LIB = $(obj)lib$(BOARD).o - - ifeq ($(CONFIG_SPL_BUILD),y) -+SOBJS := usbboot.o - COBJS := $(BOARD)-spl.o - else - COBJS := $(BOARD).o -diff --git a/board/qi/qi_lb60/qi_lb60-spl.c b/board/qi/qi_lb60/qi_lb60-spl.c -index 3fe3fa3..aea459c 100644 ---- a/board/qi/qi_lb60/qi_lb60-spl.c -+++ b/board/qi/qi_lb60/qi_lb60-spl.c -@@ -12,6 +12,24 @@ - #include - #include - -+#define KEY_U_OUT (32 * 2 + 16) -+#define KEY_U_IN (32 * 3 + 19) -+ -+extern void usb_boot(void); -+ -+static void check_usb_boot(void) -+{ -+ __gpio_as_input(KEY_U_IN); -+ __gpio_enable_pull(KEY_U_IN); -+ __gpio_as_output(KEY_U_OUT); -+ __gpio_clear_pin(KEY_U_OUT); -+ -+ if (!__gpio_get_pin(KEY_U_IN)) { -+ puts("[U] pressed, goto USBBOOT mode\n"); -+ usb_boot(); -+ } -+} -+ - void nand_spl_boot(void) - { - __gpio_as_sdram_16bit_4720(); -@@ -23,6 +41,8 @@ void nand_spl_boot(void) - pll_init(); - sdram_init(); - -+ check_usb_boot(); -+ - nand_init(); - - puts("\nQi LB60 SPL: Starting U-Boot ...\n"); -diff --git a/board/qi/qi_lb60/usbboot.S b/board/qi/qi_lb60/usbboot.S -new file mode 100644 -index 0000000..c872266 ---- /dev/null -+++ b/board/qi/qi_lb60/usbboot.S -@@ -0,0 +1,838 @@ -+/* -+ * for jz4740 usb boot -+ * -+ * Copyright (c) 2009 Author: -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ */ -+ .set noreorder -+ .globl usb_boot -+ .text -+ -+/* -+ * Both NAND and USB boot load data to D-Cache first, then transfer -+ * data from D-Cache to I-Cache, and jump to execute the code in I-Cache. -+ * So init caches first and then dispatch to a proper boot routine. -+ */ -+ -+.macro load_addr reg addr -+ li \reg, 0x80000000 -+ addiu \reg, \reg, \addr -+ la $2, usbboot_begin -+ subu \reg, \reg, $2 -+.endm -+ -+usb_boot: -+ /* Initialize PLL: set ICLK to 84MHz and HCLK to 42MHz. */ -+ la $9, 0xB0000000 /* CPCCR: Clock Control Register */ -+ la $8, 0x42041110 /* I:S:M:P=1:2:2:2 */ -+ sw $8, 0($9) -+ -+ la $9, 0xB0000010 /* CPPCR: PLL Control Register */ -+ la $8, 0x06000120 /* M=12 N=0 D=0 CLK=12*(M+2)/(N+2) */ -+ sw $8, 0($9) -+ -+ mtc0 $0, $26 /* CP0_ERRCTL, restore WST reset state */ -+ nop -+ -+ mtc0 $0, $16 /* CP0_CONFIG */ -+ nop -+ -+ /* Relocate code to beginning of the ram */ -+ -+ la $2, usbboot_begin -+ la $3, usbboot_end -+ li $4, 0x80000000 -+ -+1: -+ lw $5, 0($2) -+ sw $5, 0($4) -+ addiu $2, $2, 4 -+ bne $2, $3, 1b -+ addiu $4, $4, 4 -+ -+ li $2, 0x80000000 -+ ori $3, $2, 0 -+ addiu $3, $3, usbboot_end -+ la $4, usbboot_begin -+ subu $3, $3, $4 -+ -+ -+2: -+ cache 0x0, 0($2) /* Index_Invalidate_I */ -+ cache 0x1, 0($2) /* Index_Writeback_Inv_D */ -+ addiu $2, $2, 32 -+ subu $4, $3, $2 -+ bgtz $4, 2b -+ nop -+ -+ load_addr $3, usb_boot_return -+ -+ jr $3 -+ -+usbboot_begin: -+ -+init_caches: -+ li $2, 3 /* cacheable for kseg0 access */ -+ mtc0 $2, $16 /* CP0_CONFIG */ -+ nop -+ -+ li $2, 0x20000000 /* enable idx-store-data cache insn */ -+ mtc0 $2, $26 /* CP0_ERRCTL */ -+ -+ ori $2, $28, 0 /* start address */ -+ ori $3, $2, 0x3fe0 /* end address, total 16KB */ -+ mtc0 $0, $28, 0 /* CP0_TAGLO */ -+ mtc0 $0, $28, 1 /* CP0_DATALO */ -+cache_clear_a_line: -+ cache 0x8, 0($2) /* Index_Store_Tag_I */ -+ cache 0x9, 0($2) /* Index_Store_Tag_D */ -+ bne $2, $3, cache_clear_a_line -+ addiu $2, $2, 32 /* increment CACHE_LINE_SIZE */ -+ -+ ori $2, $28, 0 /* start address */ -+ ori $3, $2, 0x3fe0 /* end address, total 16KB */ -+ la $4, 0x1ffff000 /* physical address and 4KB page mask */ -+cache_alloc_a_line: -+ and $5, $2, $4 -+ ori $5, $5, 1 /* V bit of the physical tag */ -+ mtc0 $5, $28, 0 /* CP0_TAGLO */ -+ cache 0x8, 0($2) /* Index_Store_Tag_I */ -+ cache 0x9, 0($2) /* Index_Store_Tag_D */ -+ bne $2, $3, cache_alloc_a_line -+ addiu $2, $2, 32 /* increment CACHE_LINE_SIZE */ -+ -+ nop -+ nop -+ nop -+ /* -+ * Transfer data from dcache to icache, then jump to icache. -+ * Input parameters: -+ * $19: data length in bytes -+ * $20: jump target address -+ */ -+xfer_d2i: -+ -+ ori $8, $20, 0 -+ addu $9, $8, $19 /* total 16KB */ -+ -+1: -+ cache 0x0, 0($8) /* Index_Invalidate_I */ -+ cache 0x1, 0($8) /* Index_Writeback_Inv_D */ -+ bne $8, $9, 1b -+ addiu $8, $8, 32 -+ -+ /* flush write-buffer */ -+ sync -+ -+ /* Invalidate BTB */ -+ mfc0 $8, $16, 7 /* CP0_CONFIG */ -+ nop -+ ori $8, 2 -+ mtc0 $8, $16, 7 -+ nop -+ -+ /* Overwrite config to disable ram initalisation */ -+ li $2, 0xff -+ sb $2, 20($20) -+ -+ jalr $20 -+ nop -+ -+icache_return: -+ /* User code can return to here after executing itself in -+ icache, by jumping to $31. */ -+ b usb_boot_return -+ nop -+ -+ -+usb_boot_return: -+ /* Enable the USB PHY */ -+ la $9, 0xB0000024 /* CPM_SCR */ -+ lw $8, 0($9) -+ ori $8, 0x40 /* USBPHY_ENABLE */ -+ sw $8, 0($9) -+ -+ /* Initialize USB registers */ -+ la $27, 0xb3040000 /* USB registers base address */ -+ -+ sb $0, 0x0b($27) /* INTRUSBE: disable common USB interrupts */ -+ sh $0, 0x06($27) /* INTRINE: disable EPIN interrutps */ -+ sh $0, 0x08($27) /* INTROUTE: disable EPOUT interrutps */ -+ -+ li $9, 0x61 -+ sb $9, 0x01($27) /* POWER: HSENAB | SUSPENDM | SOFTCONN */ -+ -+ /* Initialize USB states */ -+ li $22, 0 /* set EP0 to IDLE state */ -+ li $23, 1 /* no data stage */ -+ -+ /* Main loop of polling the usb commands */ -+usb_command_loop: -+ lbu $9, 0x0a($27) /* read INTRUSB */ -+ andi $9, 0x04 /* check USB_INTR_RESET */ -+ beqz $9, check_intr_ep0in -+ nop -+ -+ /* 1. Handle USB reset interrupt */ -+handle_reset_intr: -+ lbu $9, 0x01($27) /* read POWER */ -+ andi $9, 0x10 /* test HS_MODE */ -+ bnez $9, _usb_set_maxpktsize -+ li $9, 512 /* max packet size of HS mode */ -+ li $9, 64 /* max packet size of FS mode */ -+ -+_usb_set_maxpktsize: -+ li $8, 1 -+ sb $8, 0x0e($27) /* set INDEX 1 */ -+ -+ sh $9, 0x10($27) /* INMAXP */ -+ sb $0, 0x13($27) /* INCSRH */ -+ sh $9, 0x14($27) /* OUTMAXP */ -+ sb $0, 0x17($27) /* OUTCSRH */ -+ -+_usb_flush_fifo: -+ li $8, 0x48 /* INCSR_CDT && INCSR_FF */ -+ sb $8, 0x12($27) /* INCSR */ -+ li $8, 0x90 /* OUTCSR_CDT && OUTCSR_FF */ -+ sb $8, 0x16($27) /* OUTCSR */ -+ -+ li $22, 0 /* set EP0 to IDLE state */ -+ li $23, 1 /* no data stage */ -+ -+ /* 2. Check and handle EP0 interrupt */ -+check_intr_ep0in: -+ lhu $10, 0x02($27) /* read INTRIN */ -+ andi $9, $10, 0x1 /* check EP0 interrupt */ -+ beqz $9, check_intr_ep1in -+ nop -+ -+handle_ep0_intr: -+ sb $0, 0x0e($27) /* set INDEX 0 */ -+ lbu $11, 0x12($27) /* read CSR0 */ -+ -+ andi $9, $11, 0x04 /* check SENTSTALL */ -+ beqz $9, _ep0_setupend -+ nop -+ -+_ep0_sentstall: -+ andi $9, $11, 0xdb -+ sb $9, 0x12($27) /* clear SENDSTALL and SENTSTALL */ -+ li $22, 0 /* set EP0 to IDLE state */ -+ -+_ep0_setupend: -+ andi $9, $11, 0x10 /* check SETUPEND */ -+ beqz $9, ep0_idle_state -+ nop -+ -+ ori $9, $11, 0x80 -+ sb $9, 0x12($27) /* set SVDSETUPEND */ -+ li $22, 0 /* set EP0 to IDLE state */ -+ -+ep0_idle_state: -+ bnez $22, ep0_tx_state -+ nop -+ -+ /* 2.1 Handle EP0 IDLE state interrupt */ -+ andi $9, $11, 0x01 /* check OUTPKTRDY */ -+ beqz $9, check_intr_ep1in -+ nop -+ -+ /* Read 8-bytes setup packet from the FIFO */ -+ lw $25, 0x20($27) /* first word of setup packet */ -+ lw $26, 0x20($27) /* second word of setup packet */ -+ -+ andi $9, $25, 0x60 /* bRequestType & USB_TYPE_MASK */ -+ beqz $9, _ep0_std_req -+ nop -+ -+ /* 2.1.1 Vendor-specific setup request */ -+_ep0_vend_req: -+ li $22, 0 /* set EP0 to IDLE state */ -+ li $23, 1 /* NoData = 1 */ -+ -+ andi $9, $25, 0xff00 /* check bRequest */ -+ srl $9, $9, 8 -+ beqz $9, __ep0_get_cpu_info -+ sub $8, $9, 0x1 -+ beqz $8, __ep0_set_data_address -+ sub $8, $9, 0x2 -+ beqz $8, __ep0_set_data_length -+ sub $8, $9, 0x3 -+ beqz $8, __ep0_flush_caches -+ sub $8, $9, 0x4 -+ beqz $8, __ep0_prog_start1 -+ sub $8, $9, 0x5 -+ beqz $8, __ep0_prog_start2 -+ nop -+ b _ep0_idle_state_fini /* invalid request */ -+ nop -+ -+__ep0_get_cpu_info: -+ load_addr $20, cpu_info_data /* data pointer to transfer */ -+ li $21, 8 /* bytes left to transfer */ -+ li $22, 1 /* set EP0 to TX state */ -+ li $23, 0 /* NoData = 0 */ -+ -+ b _ep0_idle_state_fini -+ nop -+ -+__ep0_set_data_address: -+ li $9, 0xffff0000 -+ and $9, $25, $9 -+ andi $8, $26, 0xffff -+ or $20, $9, $8 /* data address of next transfer */ -+ -+ b _ep0_idle_state_fini -+ nop -+ -+__ep0_set_data_length: -+ li $9, 0xffff0000 -+ and $9, $25, $9 -+ andi $8, $26, 0xffff -+ or $21, $9, $8 /* data length of next transfer */ -+ -+ li $9, 0x48 /* SVDOUTPKTRDY and DATAEND */ -+ sb $9, 0x12($27) /* CSR0 */ -+ -+ /* We must write packet to FIFO before EP1-IN interrupt here. */ -+ b handle_epin1_intr -+ nop -+ -+__ep0_flush_caches: -+ /* Flush dcache and invalidate icache. */ -+ li $8, 0x80000000 -+ addi $9, $8, 0x3fe0 /* total 16KB */ -+ -+1: -+ cache 0x0, 0($8) /* Index_Invalidate_I */ -+ cache 0x1, 0($8) /* Index_Writeback_Inv_D */ -+ bne $8, $9, 1b -+ addiu $8, $8, 32 -+ -+ /* flush write-buffer */ -+ sync -+ -+ /* Invalidate BTB */ -+ mfc0 $8, $16, 7 /* CP0_CONFIG */ -+ nop -+ ori $8, 2 -+ mtc0 $8, $16, 7 -+ nop -+ -+ b _ep0_idle_state_fini -+ nop -+ -+__ep0_prog_start1: -+ li $9, 0x48 /* SVDOUTPKTRDY and DATAEND */ -+ sb $9, 0x12($27) /* CSR0 */ -+ -+ li $9, 0xffff0000 -+ and $9, $25, $9 -+ andi $8, $26, 0xffff -+ or $20, $9, $8 /* target address */ -+ -+ b xfer_d2i -+ li $19, 0x2000 /* 16KB data length */ -+ -+__ep0_prog_start2: -+ li $9, 0x48 /* SVDOUTPKTRDY and DATAEND */ -+ sb $9, 0x12($27) /* CSR0 */ -+ -+ li $9, 0xffff0000 -+ and $9, $25, $9 -+ andi $8, $26, 0xffff -+ or $20, $9, $8 /* target address */ -+ -+ jalr $20 /* jump, and place the return address in $31 */ -+ nop -+ -+__ep0_prog_start2_return: -+/* User code can return to here after executing itself, by jumping to $31 */ -+ b usb_boot_return -+ nop -+ -+ /* 2.1.2 Standard setup request */ -+_ep0_std_req: -+ andi $12, $25, 0xff00 /* check bRequest */ -+ srl $12, $12, 8 -+ sub $9, $12, 0x05 /* check USB_REQ_SET_ADDRESS */ -+ bnez $9, __ep0_req_set_config -+ nop -+ -+ /* Handle USB_REQ_SET_ADDRESS */ -+__ep0_req_set_addr: -+ srl $9, $25, 16 /* get wValue */ -+ sb $9, 0x0($27) /* set FADDR */ -+ li $23, 1 /* NoData = 1 */ -+ b _ep0_idle_state_fini -+ nop -+ -+__ep0_req_set_config: -+ sub $9, $12, 0x09 /* check USB_REQ_SET_CONFIGURATION */ -+ bnez $9, __ep0_req_get_desc -+ nop -+ -+ /* Handle USB_REQ_SET_CONFIGURATION */ -+ li $23, 1 /* NoData = 1 */ -+ b _ep0_idle_state_fini -+ nop -+ -+__ep0_req_get_desc: -+ sub $9, $12, 0x06 /* check USB_REQ_GET_DESCRIPTOR */ -+ bnez $9, _ep0_idle_state_fini -+ li $23, 1 /* NoData = 1 */ -+ -+ /* Handle USB_REQ_GET_DESCRIPTOR */ -+ li $23, 0 /* NoData = 0 */ -+ -+ srl $9, $25, 24 /* wValue >> 8 */ -+ sub $8, $9, 0x01 /* check USB_DT_DEVICE */ -+ beqz $8, ___ep0_get_dev_desc -+ srl $21, $26, 16 /* get wLength */ -+ sub $8, $9, 0x02 /* check USB_DT_CONFIG */ -+ beqz $8, ___ep0_get_conf_desc -+ sub $8, $9, 0x03 /* check USB_DT_STRING */ -+ beqz $8, ___ep0_get_string_desc -+ sub $8, $9, 0x06 /* check USB_DT_DEVICE_QUALIFIER */ -+ beqz $8, ___ep0_get_dev_qualifier -+ nop -+ b _ep0_idle_state_fini -+ nop -+ -+___ep0_get_dev_desc: -+ load_addr $20, device_desc /* data pointer */ -+ li $22, 1 /* set EP0 to TX state */ -+ sub $8, $21, 18 -+ blez $8, _ep0_idle_state_fini /* wLength <= 18 */ -+ nop -+ li $21, 18 /* max length of device_desc */ -+ b _ep0_idle_state_fini -+ nop -+ -+___ep0_get_dev_qualifier: -+ load_addr $20, dev_qualifier /* data pointer */ -+ li $22, 1 /* set EP0 to TX state */ -+ sub $8, $21, 10 -+ blez $8, _ep0_idle_state_fini /* wLength <= 10 */ -+ nop -+ li $21, 10 /* max length of dev_qualifier */ -+ b _ep0_idle_state_fini -+ nop -+ -+___ep0_get_conf_desc: -+ load_addr $20, config_desc_fs /* data pointer of FS mode */ -+ lbu $8, 0x01($27) /* read POWER */ -+ andi $8, 0x10 /* test HS_MODE */ -+ beqz $8, ___ep0_get_conf_desc2 -+ nop -+ load_addr $20, config_desc_hs /* data pointer of HS mode */ -+ -+___ep0_get_conf_desc2: -+ li $22, 1 /* set EP0 to TX state */ -+ sub $8, $21, 32 -+ blez $8, _ep0_idle_state_fini /* wLength <= 32 */ -+ nop -+ li $21, 32 /* max length of config_desc */ -+ b _ep0_idle_state_fini -+ nop -+ -+___ep0_get_string_desc: -+ li $22, 1 /* set EP0 to TX state */ -+ -+ srl $9, $25, 16 /* wValue & 0xff */ -+ andi $9, 0xff -+ -+ sub $8, $9, 1 -+ beqz $8, ___ep0_get_string_manufacture -+ sub $8, $9, 2 -+ beqz $8, ___ep0_get_string_product -+ nop -+ -+___ep0_get_string_lang_ids: -+ load_addr $20, string_lang_ids /* data pointer */ -+ b _ep0_idle_state_fini -+ li $21, 4 /* data length */ -+ -+___ep0_get_string_manufacture: -+ load_addr $20, string_manufacture /* data pointer */ -+ b _ep0_idle_state_fini -+ li $21, 16 /* data length */ -+ -+___ep0_get_string_product: -+ load_addr $20, string_product /* data pointer */ -+ b _ep0_idle_state_fini -+ li $21, 46 /* data length */ -+ -+_ep0_idle_state_fini: -+ li $9, 0x40 /* SVDOUTPKTRDY */ -+ beqz $23, _ep0_idle_state_fini2 -+ nop -+ ori $9, $9, 0x08 /* DATAEND */ -+_ep0_idle_state_fini2: -+ sb $9, 0x12($27) /* CSR0 */ -+ beqz $22, check_intr_ep1in -+ nop -+ -+ /* 2.2 Handle EP0 TX state interrupt */ -+ep0_tx_state: -+ sub $9, $22, 1 -+ bnez $9, check_intr_ep1in -+ nop -+ -+ sub $9, $21, 64 /* max packetsize */ -+ blez $9, _ep0_tx_state2 /* data count <= 64 */ -+ ori $19, $21, 0 -+ li $19, 64 -+ -+_ep0_tx_state2: -+ beqz $19, _ep0_tx_state3 /* send ZLP */ -+ ori $18, $19, 0 /* record bytes to be transferred */ -+ sub $21, $21, $19 /* decrement data count */ -+ -+_ep0_fifo_write_loop: -+ lbu $9, 0($20) /* read data */ -+ sb $9, 0x20($27) /* load FIFO */ -+ sub $19, $19, 1 /* decrement counter */ -+ bnez $19, _ep0_fifo_write_loop -+ addi $20, $20, 1 /* increment data pointer */ -+ -+ sub $9, $18, 64 /* max packetsize */ -+ beqz $9, _ep0_tx_state4 -+ nop -+ -+_ep0_tx_state3: -+ /* transferred bytes < max packetsize */ -+ li $9, 0x0a /* set INPKTRDY and DATAEND */ -+ sb $9, 0x12($27) /* CSR0 */ -+ li $22, 0 /* set EP0 to IDLE state */ -+ b check_intr_ep1in -+ nop -+ -+_ep0_tx_state4: -+ /* transferred bytes == max packetsize */ -+ li $9, 0x02 /* set INPKTRDY */ -+ sb $9, 0x12($27) /* CSR0 */ -+ b check_intr_ep1in -+ nop -+ -+ /* 3. Check and handle EP1 BULK-IN interrupt */ -+check_intr_ep1in: -+ andi $9, $10, 0x2 /* check EP1 IN interrupt */ -+ beqz $9, check_intr_ep1out -+ nop -+ -+handle_epin1_intr: -+ li $9, 1 -+ sb $9, 0x0e($27) /* set INDEX 1 */ -+ lbu $9, 0x12($27) /* read INCSR */ -+ -+ andi $8, $9, 0x2 /* check INCSR_FFNOTEMPT */ -+ bnez $8, _epin1_tx_state4 -+ nop -+ -+_epin1_write_fifo: -+ lhu $9, 0x10($27) /* get INMAXP */ -+ sub $8, $21, $9 -+ blez $8, _epin1_tx_state1 /* bytes left <= INMAXP */ -+ ori $19, $21, 0 -+ ori $19, $9, 0 -+ -+_epin1_tx_state1: -+ beqz $19, _epin1_tx_state4 /* No data */ -+ nop -+ -+ sub $21, $21, $19 /* decrement data count */ -+ -+ srl $5, $19, 2 /* # of word */ -+ andi $6, $19, 0x3 /* # of byte */ -+ beqz $5, _epin1_tx_state2 -+ nop -+ -+_epin1_fifo_write_word: -+ lw $9, 0($20) /* read data from source address */ -+ sw $9, 0x24($27) /* write FIFO */ -+ sub $5, $5, 1 /* decrement counter */ -+ bnez $5, _epin1_fifo_write_word -+ addiu $20, $20, 4 /* increment dest address */ -+ -+_epin1_tx_state2: -+ beqz $6, _epin1_tx_state3 -+ nop -+ -+_epin1_fifo_write_byte: -+ lbu $9, 0($20) /* read data from source address */ -+ sb $9, 0x24($27) /* write FIFO */ -+ sub $6, $6, 1 /* decrement counter */ -+ bnez $6, _epin1_fifo_write_byte -+ addiu $20, $20, 1 /* increment dest address */ -+ -+_epin1_tx_state3: -+ li $9, 0x1 -+ sb $9, 0x12($27) /* INCSR, set INPKTRDY */ -+ -+_epin1_tx_state4: -+ /* 4. Check and handle EP1 BULK-OUT interrupt */ -+check_intr_ep1out: -+ lhu $9, 0x04($27) /* read INTROUT */ -+ andi $9, 0x2 -+ beqz $9, check_status_next -+ nop -+ -+handle_epout1_intr: -+ li $9, 1 -+ sb $9, 0x0e($27) /* set INDEX 1 */ -+ -+ lbu $9, 0x16($27) /* read OUTCSR */ -+ andi $9, 0x1 /* check OUTPKTRDY */ -+ beqz $9, check_status_next -+ nop -+ -+_epout1_read_fifo: -+ lhu $19, 0x18($27) /* read OUTCOUNT */ -+ srl $5, $19, 2 /* # of word */ -+ andi $6, $19, 0x3 /* # of byte */ -+ beqz $5, _epout1_rx_state1 -+ nop -+ -+_epout1_fifo_read_word: -+ lw $9, 0x24($27) /* read FIFO */ -+ sw $9, 0($20) /* store to dest address */ -+ sub $5, $5, 1 /* decrement counter */ -+ bnez $5, _epout1_fifo_read_word -+ addiu $20, $20, 4 /* increment dest address */ -+ -+_epout1_rx_state1: -+ beqz $6, _epout1_rx_state2 -+ nop -+ -+_epout1_fifo_read_byte: -+ lbu $9, 0x24($27) /* read FIFO */ -+ sb $9, 0($20) /* store to dest address */ -+ sub $6, $6, 1 /* decrement counter */ -+ bnez $6, _epout1_fifo_read_byte -+ addiu $20, $20, 1 /* increment dest address */ -+ -+_epout1_rx_state2: -+ sb $0, 0x16($27) /* clear OUTPKTRDY */ -+ -+check_status_next: -+ b usb_command_loop -+ nop -+ -+/* Device/Configuration/Interface/Endpoint/String Descriptors */ -+ -+ .align 2 -+device_desc: -+ .byte 0x12 /* bLength */ -+ .byte 0x01 /* bDescriptorType */ -+ .byte 0x00 /* bcdUSB */ -+ .byte 0x02 /* bcdUSB */ -+ .byte 0x00 /* bDeviceClass */ -+ .byte 0x00 /* bDeviceSubClass */ -+ .byte 0x00 /* bDeviceProtocol */ -+ .byte 0x40 /* bMaxPacketSize0 */ -+ .byte 0x1a /* idVendor */ -+ .byte 0x60 /* idVendor */ -+ .byte 0x40 /* idProduct */ -+ .byte 0x47 /* idProduct */ -+ .byte 0x00 /* bcdDevice */ -+ .byte 0x01 /* bcdDevice */ -+ .byte 0x01 /* iManufacturer */ -+ .byte 0x02 /* iProduct */ -+ .byte 0x00 /* iSerialNumber */ -+ .byte 0x01 /* bNumConfigurations */ -+ -+ .align 2 -+dev_qualifier: -+ .byte 0x0a /* bLength */ -+ .byte 0x06 /* bDescriptorType */ -+ .byte 0x00 /* bcdUSB */ -+ .byte 0x02 /* bcdUSB */ -+ .byte 0x00 /* bDeviceClass */ -+ .byte 0x00 /* bDeviceSubClass */ -+ .byte 0x00 /* bDeviceProtocol */ -+ .byte 0x40 /* bMaxPacketSize0 */ -+ .byte 0x01 /* bNumConfigurations */ -+ .byte 0x00 /* bRESERVED */ -+ -+ .align 2 -+config_desc_hs: -+ .byte 0x09 /* bLength */ -+ .byte 0x02 /* bDescriptorType */ -+ .byte 0x20 /* wTotalLength */ -+ .byte 0x00 /* wTotalLength */ -+ .byte 0x01 /* bNumInterfaces */ -+ .byte 0x01 /* bConfigurationValue */ -+ .byte 0x00 /* iConfiguration */ -+ .byte 0xc0 /* bmAttributes */ -+ .byte 0x01 /* MaxPower */ -+intf_desc_hs: -+ .byte 0x09 /* bLength */ -+ .byte 0x04 /* bDescriptorType */ -+ .byte 0x00 /* bInterfaceNumber */ -+ .byte 0x00 /* bAlternateSetting */ -+ .byte 0x02 /* bNumEndpoints */ -+ .byte 0xff /* bInterfaceClass */ -+ .byte 0x00 /* bInterfaceSubClass */ -+ .byte 0x50 /* bInterfaceProtocol */ -+ .byte 0x00 /* iInterface */ -+ep1_desc_hs: -+ .byte 0x07 /* bLength */ -+ .byte 0x05 /* bDescriptorType */ -+ .byte 0x01 /* bEndpointAddress */ -+ .byte 0x02 /* bmAttributes */ -+ .byte 0x00 /* wMaxPacketSize */ -+ .byte 0x02 /* wMaxPacketSize */ -+ .byte 0x00 /* bInterval */ -+ep2_desc_hs: -+ .byte 0x07 /* bLength */ -+ .byte 0x05 /* bDescriptorType */ -+ .byte 0x81 /* bEndpointAddress */ -+ .byte 0x02 /* bmAttributes */ -+ .byte 0x00 /* wMaxPacketSize */ -+ .byte 0x02 /* wMaxPacketSize */ -+ .byte 0x00 /* bInterval */ -+ -+ .align 2 -+config_desc_fs: -+ .byte 0x09 /* bLength */ -+ .byte 0x02 /* bDescriptorType */ -+ .byte 0x20 /* wTotalLength */ -+ .byte 0x00 /* wTotalLength */ -+ .byte 0x01 /* bNumInterfaces */ -+ .byte 0x01 /* bConfigurationValue */ -+ .byte 0x00 /* iConfiguration */ -+ .byte 0xc0 /* bmAttributes */ -+ .byte 0x01 /* MaxPower */ -+intf_desc_fs: -+ .byte 0x09 /* bLength */ -+ .byte 0x04 /* bDescriptorType */ -+ .byte 0x00 /* bInterfaceNumber */ -+ .byte 0x00 /* bAlternateSetting */ -+ .byte 0x02 /* bNumEndpoints */ -+ .byte 0xff /* bInterfaceClass */ -+ .byte 0x00 /* bInterfaceSubClass */ -+ .byte 0x50 /* bInterfaceProtocol */ -+ .byte 0x00 /* iInterface */ -+ep1_desc_fs: -+ .byte 0x07 /* bLength */ -+ .byte 0x05 /* bDescriptorType */ -+ .byte 0x01 /* bEndpointAddress */ -+ .byte 0x02 /* bmAttributes */ -+ .byte 0x40 /* wMaxPacketSize */ -+ .byte 0x00 /* wMaxPacketSize */ -+ .byte 0x00 /* bInterval */ -+ep2_desc_fs: -+ .byte 0x07 /* bLength */ -+ .byte 0x05 /* bDescriptorType */ -+ .byte 0x81 /* bEndpointAddress */ -+ .byte 0x02 /* bmAttributes */ -+ .byte 0x40 /* wMaxPacketSize */ -+ .byte 0x00 /* wMaxPacketSize */ -+ .byte 0x00 /* bInterval */ -+ -+ .align 2 -+string_lang_ids: -+ .byte 0x04 -+ .byte 0x03 -+ .byte 0x09 -+ .byte 0x04 -+ -+ .align 2 -+string_manufacture: -+ .byte 0x10 -+ .byte 0x03 -+ .byte 0x49 -+ .byte 0x00 -+ .byte 0x6e -+ .byte 0x00 -+ .byte 0x67 -+ .byte 0x00 -+ .byte 0x65 -+ .byte 0x00 -+ .byte 0x6e -+ .byte 0x00 -+ .byte 0x69 -+ .byte 0x00 -+ .byte 0x63 -+ .byte 0x00 -+ -+ .align 2 -+string_product: -+ .byte 0x2e -+ .byte 0x03 -+ .byte 0x4a -+ .byte 0x00 -+ .byte 0x5a -+ .byte 0x00 -+ .byte 0x34 -+ .byte 0x00 -+ .byte 0x37 -+ .byte 0x00 -+ .byte 0x34 -+ .byte 0x00 -+ .byte 0x30 -+ .byte 0x00 -+ .byte 0x20 -+ .byte 0x00 -+ .byte 0x55 -+ .byte 0x00 -+ .byte 0x53 -+ .byte 0x00 -+ .byte 0x42 -+ .byte 0x00 -+ .byte 0x20 -+ .byte 0x00 -+ .byte 0x42 -+ .byte 0x00 -+ .byte 0x6f -+ .byte 0x00 -+ .byte 0x6f -+ .byte 0x00 -+ .byte 0x74 -+ .byte 0x00 -+ .byte 0x20 -+ .byte 0x00 -+ .byte 0x44 -+ .byte 0x00 -+ .byte 0x65 -+ .byte 0x00 -+ .byte 0x76 -+ .byte 0x00 -+ .byte 0x69 -+ .byte 0x00 -+ .byte 0x63 -+ .byte 0x00 -+ .byte 0x65 -+ .byte 0x00 -+ -+ .align 2 -+cpu_info_data: -+ .byte 0x4a -+ .byte 0x5a -+ .byte 0x34 -+ .byte 0x37 -+ .byte 0x34 -+ .byte 0x30 -+ .byte 0x56 -+ .byte 0x31 -+usbboot_end: -+ -+ .set reorder --- -1.7.9.5 - diff --git a/package/boot/uboot-xburst/patches/0003-add-mmc-support.patch b/package/boot/uboot-xburst/patches/0003-add-mmc-support.patch deleted file mode 100644 index e9baa7c37..000000000 --- a/package/boot/uboot-xburst/patches/0003-add-mmc-support.patch +++ /dev/null @@ -1,1664 +0,0 @@ -From bd36739e77669e8df45c38f6acfe2cea511534d9 Mon Sep 17 00:00:00 2001 -From: Xiangfu -Date: Wed, 10 Oct 2012 18:19:41 +0800 -Subject: [PATCH 3/6] add mmc support - ---- - arch/mips/include/asm/jz4740.h | 166 ++++++ - board/qi/qi_lb60/qi_lb60.c | 9 +- - drivers/mmc/Makefile | 1 + - drivers/mmc/jz_mmc.c | 1179 ++++++++++++++++++++++++++++++++++++++++ - drivers/mmc/jz_mmc.h | 176 ++++++ - include/configs/qi_lb60.h | 9 + - include/mmc.h | 40 ++ - 7 files changed, 1578 insertions(+), 2 deletions(-) - create mode 100644 drivers/mmc/jz_mmc.c - create mode 100644 drivers/mmc/jz_mmc.h - -diff --git a/arch/mips/include/asm/jz4740.h b/arch/mips/include/asm/jz4740.h -index 7a7cfff..68287fb 100644 ---- a/arch/mips/include/asm/jz4740.h -+++ b/arch/mips/include/asm/jz4740.h -@@ -1146,5 +1146,171 @@ extern void sdram_init(void); - extern void calc_clocks(void); - extern void rtc_init(void); - -+/************************************************************************* -+ * MSC -+ *************************************************************************/ -+#define REG8(addr) *((volatile u8 *)(addr)) -+#define REG16(addr) *((volatile u16 *)(addr)) -+#define REG32(addr) *((volatile u32 *)(addr)) -+ -+#define CPM_BASE 0xB0000000 -+#define CPM_CPCCR (CPM_BASE+0x00) -+#define CPM_MSCCDR (CPM_BASE+0x68) -+#define REG_CPM_MSCCDR REG32(CPM_MSCCDR) -+#define REG_CPM_CPCCR REG32(CPM_CPCCR) -+ -+#define MSC_BASE 0xB0021000 -+ -+#define MSC_STRPCL (MSC_BASE + 0x000) -+#define MSC_STAT (MSC_BASE + 0x004) -+#define MSC_CLKRT (MSC_BASE + 0x008) -+#define MSC_CMDAT (MSC_BASE + 0x00C) -+#define MSC_RESTO (MSC_BASE + 0x010) -+#define MSC_RDTO (MSC_BASE + 0x014) -+#define MSC_BLKLEN (MSC_BASE + 0x018) -+#define MSC_NOB (MSC_BASE + 0x01C) -+#define MSC_SNOB (MSC_BASE + 0x020) -+#define MSC_IMASK (MSC_BASE + 0x024) -+#define MSC_IREG (MSC_BASE + 0x028) -+#define MSC_CMD (MSC_BASE + 0x02C) -+#define MSC_ARG (MSC_BASE + 0x030) -+#define MSC_RES (MSC_BASE + 0x034) -+#define MSC_RXFIFO (MSC_BASE + 0x038) -+#define MSC_TXFIFO (MSC_BASE + 0x03C) -+ -+#define REG_MSC_STRPCL REG16(MSC_STRPCL) -+#define REG_MSC_STAT REG32(MSC_STAT) -+#define REG_MSC_CLKRT REG16(MSC_CLKRT) -+#define REG_MSC_CMDAT REG32(MSC_CMDAT) -+#define REG_MSC_RESTO REG16(MSC_RESTO) -+#define REG_MSC_RDTO REG16(MSC_RDTO) -+#define REG_MSC_BLKLEN REG16(MSC_BLKLEN) -+#define REG_MSC_NOB REG16(MSC_NOB) -+#define REG_MSC_SNOB REG16(MSC_SNOB) -+#define REG_MSC_IMASK REG16(MSC_IMASK) -+#define REG_MSC_IREG REG16(MSC_IREG) -+#define REG_MSC_CMD REG8(MSC_CMD) -+#define REG_MSC_ARG REG32(MSC_ARG) -+#define REG_MSC_RES REG16(MSC_RES) -+#define REG_MSC_RXFIFO REG32(MSC_RXFIFO) -+#define REG_MSC_TXFIFO REG32(MSC_TXFIFO) -+ -+/* MSC Clock and Control Register (MSC_STRPCL) */ -+ -+#define MSC_STRPCL_EXIT_MULTIPLE (1 << 7) -+#define MSC_STRPCL_EXIT_TRANSFER (1 << 6) -+#define MSC_STRPCL_START_READWAIT (1 << 5) -+#define MSC_STRPCL_STOP_READWAIT (1 << 4) -+#define MSC_STRPCL_RESET (1 << 3) -+#define MSC_STRPCL_START_OP (1 << 2) -+#define MSC_STRPCL_CLOCK_CONTROL_BIT 0 -+#define MSC_STRPCL_CLOCK_CONTROL_MASK (0x3 << MSC_STRPCL_CLOCK_CONTROL_BIT) -+ #define MSC_STRPCL_CLOCK_CONTROL_STOP (0x1 << MSC_STRPCL_CLOCK_CONTROL_BIT) /* Stop MMC/SD clock */ -+ #define MSC_STRPCL_CLOCK_CONTROL_START (0x2 << MSC_STRPCL_CLOCK_CONTROL_BIT) /* Start MMC/SD clock */ -+ -+/* MSC Status Register (MSC_STAT) */ -+ -+#define MSC_STAT_IS_RESETTING (1 << 15) -+#define MSC_STAT_SDIO_INT_ACTIVE (1 << 14) -+#define MSC_STAT_PRG_DONE (1 << 13) -+#define MSC_STAT_DATA_TRAN_DONE (1 << 12) -+#define MSC_STAT_END_CMD_RES (1 << 11) -+#define MSC_STAT_DATA_FIFO_AFULL (1 << 10) -+#define MSC_STAT_IS_READWAIT (1 << 9) -+#define MSC_STAT_CLK_EN (1 << 8) -+#define MSC_STAT_DATA_FIFO_FULL (1 << 7) -+#define MSC_STAT_DATA_FIFO_EMPTY (1 << 6) -+#define MSC_STAT_CRC_RES_ERR (1 << 5) -+#define MSC_STAT_CRC_READ_ERROR (1 << 4) -+#define MSC_STAT_CRC_WRITE_ERROR_BIT 2 -+#define MSC_STAT_CRC_WRITE_ERROR_MASK (0x3 << MSC_STAT_CRC_WRITE_ERROR_BIT) -+ #define MSC_STAT_CRC_WRITE_ERROR_NO (0 << MSC_STAT_CRC_WRITE_ERROR_BIT) /* No error on transmission of data */ -+ #define MSC_STAT_CRC_WRITE_ERROR (1 << MSC_STAT_CRC_WRITE_ERROR_BIT) /* Card observed erroneous transmission of data */ -+ #define MSC_STAT_CRC_WRITE_ERROR_NOSTS (2 << MSC_STAT_CRC_WRITE_ERROR_BIT) /* No CRC status is sent back */ -+#define MSC_STAT_TIME_OUT_RES (1 << 1) -+#define MSC_STAT_TIME_OUT_READ (1 << 0) -+ -+/* MSC Bus Clock Control Register (MSC_CLKRT) */ -+ -+#define MSC_CLKRT_CLK_RATE_BIT 0 -+#define MSC_CLKRT_CLK_RATE_MASK (0x7 << MSC_CLKRT_CLK_RATE_BIT) -+ #define MSC_CLKRT_CLK_RATE_DIV_1 (0x0 << MSC_CLKRT_CLK_RATE_BIT) /* CLK_SRC */ -+ #define MSC_CLKRT_CLK_RATE_DIV_2 (0x1 << MSC_CLKRT_CLK_RATE_BIT) /* 1/2 of CLK_SRC */ -+ #define MSC_CLKRT_CLK_RATE_DIV_4 (0x2 << MSC_CLKRT_CLK_RATE_BIT) /* 1/4 of CLK_SRC */ -+ #define MSC_CLKRT_CLK_RATE_DIV_8 (0x3 << MSC_CLKRT_CLK_RATE_BIT) /* 1/8 of CLK_SRC */ -+ #define MSC_CLKRT_CLK_RATE_DIV_16 (0x4 << MSC_CLKRT_CLK_RATE_BIT) /* 1/16 of CLK_SRC */ -+ #define MSC_CLKRT_CLK_RATE_DIV_32 (0x5 << MSC_CLKRT_CLK_RATE_BIT) /* 1/32 of CLK_SRC */ -+ #define MSC_CLKRT_CLK_RATE_DIV_64 (0x6 << MSC_CLKRT_CLK_RATE_BIT) /* 1/64 of CLK_SRC */ -+ #define MSC_CLKRT_CLK_RATE_DIV_128 (0x7 << MSC_CLKRT_CLK_RATE_BIT) /* 1/128 of CLK_SRC */ -+ -+/* MSC Command Sequence Control Register (MSC_CMDAT) */ -+ -+#define MSC_CMDAT_IO_ABORT (1 << 11) -+#define MSC_CMDAT_BUS_WIDTH_BIT 9 -+#define MSC_CMDAT_BUS_WIDTH_MASK (0x3 << MSC_CMDAT_BUS_WIDTH_BIT) -+#define MSC_CMDAT_BUS_WIDTH_1BIT (0x0 << MSC_CMDAT_BUS_WIDTH_BIT) -+#define MSC_CMDAT_BUS_WIDTH_4BIT (0x2 << MSC_CMDAT_BUS_WIDTH_BIT) -+#define MSC_CMDAT_DMA_EN (1 << 8) -+#define MSC_CMDAT_INIT (1 << 7) -+#define MSC_CMDAT_BUSY (1 << 6) -+#define MSC_CMDAT_STREAM_BLOCK (1 << 5) -+#define MSC_CMDAT_WRITE (1 << 4) -+#define MSC_CMDAT_READ (0 << 4) -+#define MSC_CMDAT_DATA_EN (1 << 3) -+#define MSC_CMDAT_RESPONSE_BIT 0 -+#define MSC_CMDAT_RESPONSE_MASK (0x7 << MSC_CMDAT_RESPONSE_BIT) -+#define MSC_CMDAT_RESPONSE_NONE (0x0 << MSC_CMDAT_RESPONSE_BIT) -+#define MSC_CMDAT_RESPONSE_R1 (0x1 << MSC_CMDAT_RESPONSE_BIT) -+#define MSC_CMDAT_RESPONSE_R2 (0x2 << MSC_CMDAT_RESPONSE_BIT) -+#define MSC_CMDAT_RESPONSE_R3 (0x3 << MSC_CMDAT_RESPONSE_BIT) -+#define MSC_CMDAT_RESPONSE_R4 (0x4 << MSC_CMDAT_RESPONSE_BIT) -+#define MSC_CMDAT_RESPONSE_R5 (0x5 << MSC_CMDAT_RESPONSE_BIT) -+#define MSC_CMDAT_RESPONSE_R6 (0x6 << MSC_CMDAT_RESPONSE_BIT) -+ -+/* MSC Interrupts Mask Register (MSC_IMASK) */ -+#define MSC_IMASK_SDIO (1 << 7) -+#define MSC_IMASK_TXFIFO_WR_REQ (1 << 6) -+#define MSC_IMASK_RXFIFO_RD_REQ (1 << 5) -+#define MSC_IMASK_END_CMD_RES (1 << 2) -+#define MSC_IMASK_PRG_DONE (1 << 1) -+#define MSC_IMASK_DATA_TRAN_DONE (1 << 0) -+ -+ -+/* MSC Interrupts Status Register (MSC_IREG) */ -+#define MSC_IREG_SDIO (1 << 7) -+#define MSC_IREG_TXFIFO_WR_REQ (1 << 6) -+#define MSC_IREG_RXFIFO_RD_REQ (1 << 5) -+#define MSC_IREG_END_CMD_RES (1 << 2) -+#define MSC_IREG_PRG_DONE (1 << 1) -+#define MSC_IREG_DATA_TRAN_DONE (1 << 0) -+ -+static __inline__ unsigned int __cpm_get_pllout2(void) -+{ -+ if (REG_CPM_CPCCR & CPM_CPCCR_PCS) -+ return __cpm_get_pllout(); -+ else -+ return __cpm_get_pllout()/2; -+} -+ -+static inline void __cpm_select_msc_clk(int sd) -+{ -+ unsigned int pllout2 = __cpm_get_pllout2(); -+ unsigned int div = 0; -+ -+ if (sd) { -+ div = pllout2 / 24000000; -+ } -+ else { -+ div = pllout2 / 16000000; -+ } -+ -+ REG_CPM_MSCCDR = div - 1; -+} -+#define __msc_reset() \ -+do { \ -+ REG_MSC_STRPCL = MSC_STRPCL_RESET; \ -+ while (REG_MSC_STAT & MSC_STAT_IS_RESETTING); \ -+} while (0) -+ - #endif /* !__ASSEMBLY__ */ - #endif /* __JZ4740_H__ */ -diff --git a/board/qi/qi_lb60/qi_lb60.c b/board/qi/qi_lb60/qi_lb60.c -index 3bd4e2f..a2ba648 100644 ---- a/board/qi/qi_lb60/qi_lb60.c -+++ b/board/qi/qi_lb60/qi_lb60.c -@@ -40,8 +40,13 @@ static void gpio_init(void) - __gpio_clear_pin(GPIO_KEYOUT_BASE + i); - } - -- __gpio_as_input(GPIO_KEYIN_8); -- __gpio_enable_pull(GPIO_KEYIN_8); -+ if (__gpio_get_pin(GPIO_KEYIN_BASE + 2) == 0){ -+ printf("[S] pressed, enable UART0\n"); -+ __gpio_as_uart0(); -+ } else { -+ __gpio_as_input(GPIO_KEYIN_8); -+ __gpio_enable_pull(GPIO_KEYIN_8); -+ } - - /* enable the TP4, TP5 as UART0 */ - __gpio_jtag_to_uart0(); -diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile -index 565ba6a..3c717b1 100644 ---- a/drivers/mmc/Makefile -+++ b/drivers/mmc/Makefile -@@ -47,6 +47,7 @@ COBJS-$(CONFIG_SDHCI) += sdhci.o - COBJS-$(CONFIG_S5P_SDHCI) += s5p_sdhci.o - COBJS-$(CONFIG_SH_MMCIF) += sh_mmcif.o - COBJS-$(CONFIG_TEGRA_MMC) += tegra_mmc.o -+COBJS-$(CONFIG_JZ4740_MMC) += jz_mmc.o - - COBJS := $(COBJS-y) - SRCS := $(COBJS:.o=.c) -diff --git a/drivers/mmc/jz_mmc.c b/drivers/mmc/jz_mmc.c -new file mode 100644 -index 0000000..642cecc ---- /dev/null -+++ b/drivers/mmc/jz_mmc.c -@@ -0,0 +1,1179 @@ -+/* -+ * (C) Copyright 2003 -+ * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include "jz_mmc.h" -+ -+static int sd2_0 = 0; -+static int mmc_ready = 0; -+static int use_4bit; /* Use 4-bit data bus */ -+/* -+ * MMC Events -+ */ -+#define MMC_EVENT_NONE 0x00 /* No events */ -+#define MMC_EVENT_RX_DATA_DONE 0x01 /* Rx data done */ -+#define MMC_EVENT_TX_DATA_DONE 0x02 /* Tx data done */ -+#define MMC_EVENT_PROG_DONE 0x04 /* Programming is done */ -+ -+ -+#define MMC_IRQ_MASK() \ -+do { \ -+ REG_MSC_IMASK = 0xffff; \ -+ REG_MSC_IREG = 0xffff; \ -+} while (0) -+ -+/* -+ * GPIO definition -+ */ -+#if defined(CONFIG_SAKC) -+ -+#define __msc_init_io() \ -+do { \ -+ __gpio_as_input(GPIO_SD_CD_N); \ -+} while (0) -+ -+#else -+#define __msc_init_io() \ -+do { \ -+ __gpio_as_output(GPIO_SD_VCC_EN_N); \ -+ __gpio_as_input(GPIO_SD_CD_N); \ -+} while (0) -+ -+#define __msc_enable_power() \ -+do { \ -+ __gpio_clear_pin(GPIO_SD_VCC_EN_N); \ -+} while (0) -+ -+#define __msc_disable_power() \ -+do { \ -+ __gpio_set_pin(GPIO_SD_VCC_EN_N); \ -+} while (0) -+ -+#endif /* CONFIG_SAKE */ -+ -+#define __msc_card_detected() \ -+({ \ -+ int detected = 1; \ -+ __gpio_as_input(GPIO_SD_CD_N); \ -+ __gpio_disable_pull(GPIO_SD_CD_N); \ -+ if (!__gpio_get_pin(GPIO_SD_CD_N)) \ -+ detected = 0; \ -+ detected; \ -+}) -+ -+/* -+ * Local functions -+ */ -+ -+extern int -+fat_register_device(block_dev_desc_t *dev_desc, int part_no); -+ -+static block_dev_desc_t mmc_dev; -+ -+block_dev_desc_t * mmc_get_dev(int dev) -+{ -+ return ((block_dev_desc_t *)&mmc_dev); -+} -+ -+/* Stop the MMC clock and wait while it happens */ -+static inline int jz_mmc_stop_clock(void) -+{ -+ int timeout = 1000; -+ -+ REG_MSC_STRPCL = MSC_STRPCL_CLOCK_CONTROL_STOP; -+ -+ while (timeout && (REG_MSC_STAT & MSC_STAT_CLK_EN)) { -+ timeout--; -+ if (timeout == 0) -+ return MMC_ERROR_TIMEOUT; -+ udelay(1); -+ } -+ return MMC_NO_ERROR; -+} -+ -+/* Start the MMC clock and operation */ -+static inline int jz_mmc_start_clock(void) -+{ -+ REG_MSC_STRPCL = MSC_STRPCL_CLOCK_CONTROL_START | MSC_STRPCL_START_OP; -+ return MMC_NO_ERROR; -+} -+ -+static inline u32 jz_mmc_calc_clkrt(int is_sd, u32 rate) -+{ -+ u32 clkrt = 0; -+ u32 clk_src = is_sd ? 24000000 : 16000000; -+ -+ while (rate < clk_src) { -+ clkrt ++; -+ clk_src >>= 1; -+ } -+ -+ return clkrt; -+} -+ -+/* Set the MMC clock frequency */ -+void jz_mmc_set_clock(int sd, u32 rate) -+{ -+ jz_mmc_stop_clock(); -+ -+ /* Select clock source of MSC */ -+ __cpm_select_msc_clk(sd); -+ -+ /* Set clock dividor of MSC */ -+ REG_MSC_CLKRT = jz_mmc_calc_clkrt(sd, rate); -+} -+ -+static int jz_mmc_check_status(struct mmc_request *request) -+{ -+ u32 status = REG_MSC_STAT; -+ -+ /* Checking for response or data timeout */ -+ if (status & (MSC_STAT_TIME_OUT_RES | MSC_STAT_TIME_OUT_READ)) { -+ printf("MMC/SD timeout, MMC_STAT 0x%x CMD %d\n", status, request->cmd); -+ return MMC_ERROR_TIMEOUT; -+ } -+ -+ /* Checking for CRC error */ -+ if (status & (MSC_STAT_CRC_READ_ERROR | MSC_STAT_CRC_WRITE_ERROR | MSC_STAT_CRC_RES_ERR)) { -+ printf("MMC/CD CRC error, MMC_STAT 0x%x\n", status); -+ return MMC_ERROR_CRC; -+ } -+ -+ return MMC_NO_ERROR; -+} -+ -+/* Obtain response to the command and store it to response buffer */ -+static void jz_mmc_get_response(struct mmc_request *request) -+{ -+ int i; -+ u8 *buf; -+ u32 data; -+ -+ debug("fetch response for request %d, cmd %d\n", -+ request->rtype, request->cmd); -+ -+ buf = request->response; -+ request->result = MMC_NO_ERROR; -+ -+ switch (request->rtype) { -+ case RESPONSE_R1: case RESPONSE_R1B: case RESPONSE_R6: -+ case RESPONSE_R3: case RESPONSE_R4: case RESPONSE_R5: -+ { -+ data = REG_MSC_RES; -+ buf[0] = (data >> 8) & 0xff; -+ buf[1] = data & 0xff; -+ data = REG_MSC_RES; -+ buf[2] = (data >> 8) & 0xff; -+ buf[3] = data & 0xff; -+ data = REG_MSC_RES; -+ buf[4] = data & 0xff; -+ -+ debug("request %d, response [%02x %02x %02x %02x %02x]\n", -+ request->rtype, buf[0], buf[1], buf[2], buf[3], buf[4]); -+ break; -+ } -+ case RESPONSE_R2_CID: case RESPONSE_R2_CSD: -+ { -+ for (i = 0; i < 16; i += 2) { -+ data = REG_MSC_RES; -+ buf[i] = (data >> 8) & 0xff; -+ buf[i+1] = data & 0xff; -+ } -+ debug("request %d, response [", request->rtype); -+#if CONFIG_MMC_DEBUG_VERBOSE > 2 -+ if (g_mmc_debug >= 3) { -+ int n; -+ for (n = 0; n < 17; n++) -+ printk("%02x ", buf[n]); -+ printk("]\n"); -+ } -+#endif -+ break; -+ } -+ case RESPONSE_NONE: -+ debug("No response\n"); -+ break; -+ -+ default: -+ debug("unhandled response type for request %d\n", request->rtype); -+ break; -+ } -+} -+ -+static int jz_mmc_receive_data(struct mmc_request *req) -+{ -+ u32 stat, timeout, data, cnt; -+ u8 *buf = req->buffer; -+ u32 wblocklen = (u32)(req->block_len + 3) >> 2; /* length in word */ -+ -+ timeout = 0x3ffffff; -+ -+ while (timeout) { -+ timeout--; -+ stat = REG_MSC_STAT; -+ -+ if (stat & MSC_STAT_TIME_OUT_READ) -+ return MMC_ERROR_TIMEOUT; -+ else if (stat & MSC_STAT_CRC_READ_ERROR) -+ return MMC_ERROR_CRC; -+ else if (!(stat & MSC_STAT_DATA_FIFO_EMPTY) -+ || (stat & MSC_STAT_DATA_FIFO_AFULL)) { -+ /* Ready to read data */ -+ break; -+ } -+ udelay(1); -+ } -+ if (!timeout) -+ return MMC_ERROR_TIMEOUT; -+ -+ /* Read data from RXFIFO. It could be FULL or PARTIAL FULL */ -+ cnt = wblocklen; -+ while (cnt) { -+ data = REG_MSC_RXFIFO; -+ { -+ *buf++ = (u8)(data >> 0); -+ *buf++ = (u8)(data >> 8); -+ *buf++ = (u8)(data >> 16); -+ *buf++ = (u8)(data >> 24); -+ } -+ cnt --; -+ while (cnt && (REG_MSC_STAT & MSC_STAT_DATA_FIFO_EMPTY)) -+ ; -+ } -+ return MMC_NO_ERROR; -+} -+ -+static int jz_mmc_transmit_data(struct mmc_request *req) -+{ -+#if 0 -+ u32 nob = req->nob; -+ u32 wblocklen = (u32)(req->block_len + 3) >> 2; /* length in word */ -+ u8 *buf = req->buffer; -+ u32 *wbuf = (u32 *)buf; -+ u32 waligned = (((u32)buf & 0x3) == 0); /* word aligned ? */ -+ u32 stat, timeout, data, cnt; -+ -+ for (nob; nob >= 1; nob--) { -+ timeout = 0x3FFFFFF; -+ -+ while (timeout) { -+ timeout--; -+ stat = REG_MSC_STAT; -+ -+ if (stat & (MSC_STAT_CRC_WRITE_ERROR | MSC_STAT_CRC_WRITE_ERROR_NOSTS)) -+ return MMC_ERROR_CRC; -+ else if (!(stat & MSC_STAT_DATA_FIFO_FULL)) { -+ /* Ready to write data */ -+ break; -+ } -+ -+ udelay(1); -+ } -+ -+ if (!timeout) -+ return MMC_ERROR_TIMEOUT; -+ -+ /* Write data to TXFIFO */ -+ cnt = wblocklen; -+ while (cnt) { -+ while (REG_MSC_STAT & MSC_STAT_DATA_FIFO_FULL) -+ ; -+ -+ if (waligned) { -+ REG_MSC_TXFIFO = *wbuf++; -+ } -+ else { -+ data = *buf++ | (*buf++ << 8) | (*buf++ << 16) | (*buf++ << 24); -+ REG_MSC_TXFIFO = data; -+ } -+ -+ cnt--; -+ } -+ } -+#endif -+ return MMC_NO_ERROR; -+} -+ -+ -+/* -+ * Name: int jz_mmc_exec_cmd() -+ * Function: send command to the card, and get a response -+ * Input: struct mmc_request *req : MMC/SD request -+ * Output: 0: right >0: error code -+ */ -+int jz_mmc_exec_cmd(struct mmc_request *request) -+{ -+ u32 cmdat = 0, events = 0; -+ int retval, timeout = 0x3fffff; -+ -+ /* Indicate we have no result yet */ -+ request->result = MMC_NO_RESPONSE; -+ if (request->cmd == MMC_CIM_RESET) { -+ /* On reset, 1-bit bus width */ -+ use_4bit = 0; -+ -+ /* Reset MMC/SD controller */ -+ __msc_reset(); -+ -+ /* On reset, drop MMC clock down */ -+ jz_mmc_set_clock(0, MMC_CLOCK_SLOW); -+ -+ /* On reset, stop MMC clock */ -+ jz_mmc_stop_clock(); -+ } -+ if (request->cmd == MMC_CMD_SEND_OP_COND) { -+ debug("Have an MMC card\n"); -+ /* always use 1bit for MMC */ -+ use_4bit = 0; -+ } -+ if (request->cmd == SET_BUS_WIDTH) { -+ if (request->arg == 0x2) { -+ printf("Use 4-bit bus width\n"); -+ use_4bit = 1; -+ } else { -+ printf("Use 1-bit bus width\n"); -+ use_4bit = 0; -+ } -+ } -+ -+ /* stop clock */ -+ jz_mmc_stop_clock(); -+ -+ /* mask all interrupts */ -+ REG_MSC_IMASK = 0xffff; -+ -+ /* clear status */ -+ REG_MSC_IREG = 0xffff; -+ -+ /* use 4-bit bus width when possible */ -+ if (use_4bit) -+ cmdat |= MSC_CMDAT_BUS_WIDTH_4BIT; -+ -+ /* Set command type and events */ -+ switch (request->cmd) { -+ /* MMC core extra command */ -+ case MMC_CIM_RESET: -+ cmdat |= MSC_CMDAT_INIT; /* Initialization sequence sent prior to command */ -+ break; -+ -+ /* bc - broadcast - no response */ -+ case MMC_CMD_GO_IDLE_STATE: -+ case MMC_CMD_SET_DSR: -+ break; -+ -+ /* bcr - broadcast with response */ -+ case MMC_CMD_SEND_OP_COND: -+ case MMC_CMD_ALL_SEND_CID: -+ case MMC_GO_IRQ_STATE: -+ break; -+ -+ /* adtc - addressed with data transfer */ -+ case MMC_READ_DAT_UNTIL_STOP: -+ case MMC_CMD_READ_SINGLE_BLOCK: -+ case MMC_CMD_READ_MULTIPLE_BLOCK: -+ case SD_CMD_APP_SEND_SCR: -+ cmdat |= MSC_CMDAT_DATA_EN | MSC_CMDAT_READ; -+ events = MMC_EVENT_RX_DATA_DONE; -+ break; -+ -+ case MMC_WRITE_DAT_UNTIL_STOP: -+ case MMC_CMD_WRITE_SINGLE_BLOCK: -+ case MMC_CMD_WRITE_MULTIPLE_BLOCK: -+ case MMC_PROGRAM_CID: -+ case MMC_PROGRAM_CSD: -+ case MMC_SEND_WRITE_PROT: -+ case MMC_GEN_CMD: -+ case MMC_LOCK_UNLOCK: -+ cmdat |= MSC_CMDAT_DATA_EN | MSC_CMDAT_WRITE; -+ events = MMC_EVENT_TX_DATA_DONE | MMC_EVENT_PROG_DONE; -+ -+ break; -+ -+ case MMC_CMD_STOP_TRANSMISSION: -+ events = MMC_EVENT_PROG_DONE; -+ break; -+ -+ /* ac - no data transfer */ -+ default: -+ break; -+ } -+ -+ /* Set response type */ -+ switch (request->rtype) { -+ case RESPONSE_NONE: -+ break; -+ -+ case RESPONSE_R1B: -+ cmdat |= MSC_CMDAT_BUSY; -+ /*FALLTHRU*/ -+ case RESPONSE_R1: -+ cmdat |= MSC_CMDAT_RESPONSE_R1; -+ break; -+ case RESPONSE_R2_CID: -+ case RESPONSE_R2_CSD: -+ cmdat |= MSC_CMDAT_RESPONSE_R2; -+ break; -+ case RESPONSE_R3: -+ cmdat |= MSC_CMDAT_RESPONSE_R3; -+ break; -+ case RESPONSE_R4: -+ cmdat |= MSC_CMDAT_RESPONSE_R4; -+ break; -+ case RESPONSE_R5: -+ cmdat |= MSC_CMDAT_RESPONSE_R5; -+ break; -+ case RESPONSE_R6: -+ cmdat |= MSC_CMDAT_RESPONSE_R6; -+ break; -+ default: -+ break; -+ } -+ -+ /* Set command index */ -+ if (request->cmd == MMC_CIM_RESET) { -+ REG_MSC_CMD = MMC_CMD_GO_IDLE_STATE; -+ } else { -+ REG_MSC_CMD = request->cmd; -+ } -+ -+ /* Set argument */ -+ REG_MSC_ARG = request->arg; -+ -+ /* Set block length and nob */ -+ if (request->cmd == SD_CMD_APP_SEND_SCR) { /* get SCR from DataFIFO */ -+ REG_MSC_BLKLEN = 8; -+ REG_MSC_NOB = 1; -+ } else { -+ REG_MSC_BLKLEN = request->block_len; -+ REG_MSC_NOB = request->nob; -+ } -+ -+ /* Set command */ -+ REG_MSC_CMDAT = cmdat; -+ -+ debug("Send cmd %d cmdat: %x arg: %x resp %d\n", request->cmd, -+ cmdat, request->arg, request->rtype); -+ -+ /* Start MMC/SD clock and send command to card */ -+ jz_mmc_start_clock(); -+ -+ /* Wait for command completion */ -+ while (timeout-- && !(REG_MSC_STAT & MSC_STAT_END_CMD_RES)) -+ ; -+ -+ if (timeout == 0) -+ return MMC_ERROR_TIMEOUT; -+ -+ REG_MSC_IREG = MSC_IREG_END_CMD_RES; /* clear flag */ -+ -+ /* Check for status */ -+ retval = jz_mmc_check_status(request); -+ if (retval) { -+ return retval; -+ } -+ -+ /* Complete command with no response */ -+ if (request->rtype == RESPONSE_NONE) { -+ return MMC_NO_ERROR; -+ } -+ -+ /* Get response */ -+ jz_mmc_get_response(request); -+ -+ /* Start data operation */ -+ if (events & (MMC_EVENT_RX_DATA_DONE | MMC_EVENT_TX_DATA_DONE)) { -+ if (events & MMC_EVENT_RX_DATA_DONE) { -+ if (request->cmd == SD_CMD_APP_SEND_SCR) { -+ /* SD card returns SCR register as data. -+ MMC core expect it in the response buffer, -+ after normal response. */ -+ request->buffer = (u8 *)((u32)request->response + 5); -+ } -+ jz_mmc_receive_data(request); -+ } -+ -+ if (events & MMC_EVENT_TX_DATA_DONE) { -+ jz_mmc_transmit_data(request); -+ } -+ -+ /* Wait for Data Done */ -+ while (!(REG_MSC_IREG & MSC_IREG_DATA_TRAN_DONE)) -+ ; -+ REG_MSC_IREG = MSC_IREG_DATA_TRAN_DONE; /* clear status */ -+ } -+ -+ /* Wait for Prog Done event */ -+ if (events & MMC_EVENT_PROG_DONE) { -+ while (!(REG_MSC_IREG & MSC_IREG_PRG_DONE)) -+ ; -+ REG_MSC_IREG = MSC_IREG_PRG_DONE; /* clear status */ -+ } -+ -+ /* Command completed */ -+ -+ return MMC_NO_ERROR; /* return successfully */ -+} -+ -+int mmc_block_read(u8 *dst, ulong src, ulong len) -+{ -+ -+ struct mmc_request request; -+ struct mmc_response_r1 r1; -+ int retval = 0; -+ -+ if (len == 0) -+ goto exit; -+ -+ mmc_simple_cmd(&request, MMC_CMD_SEND_STATUS, mmcinfo.rca, RESPONSE_R1); -+ retval = mmc_unpack_r1(&request, &r1, 0); -+ if (retval && (retval != MMC_ERROR_STATE_MISMATCH)) -+ goto exit; -+ -+ mmc_simple_cmd(&request, MMC_CMD_SET_BLOCKLEN, len, RESPONSE_R1); -+ if (retval = mmc_unpack_r1(&request, &r1, 0)) -+ goto exit; -+ -+ if (!sd2_0) -+ src *= mmcinfo.block_len; -+ -+ mmc_send_cmd(&request, MMC_CMD_READ_SINGLE_BLOCK, src, 1, len, RESPONSE_R1, dst); -+ if (retval = mmc_unpack_r1(&request, &r1, 0)) -+ goto exit; -+ -+exit: -+ return retval; -+} -+ -+ulong mmc_bread(int dev_num, ulong blkstart, ulong blkcnt, ulong *dst) -+{ -+ if (!mmc_ready) { -+ printf("Please initial the MMC first\n"); -+ return -1; -+ } -+ -+ int i = 0; -+ ulong dst_tmp = dst; -+ -+ for (i = 0; i < blkcnt; i++) { -+ if ((mmc_block_read((uchar *)(dst_tmp), blkstart, mmcinfo.block_len)) < 0) -+ return -1; -+ -+ dst_tmp += mmcinfo.block_len; -+ blkstart++; -+ } -+ -+ return i; -+} -+ -+int mmc_select_card(void) -+{ -+ struct mmc_request request; -+ struct mmc_response_r1 r1; -+ int retval; -+ -+ mmc_simple_cmd(&request, MMC_CMD_SELECT_CARD, mmcinfo.rca, RESPONSE_R1B); -+ retval = mmc_unpack_r1(&request, &r1, 0); -+ if (retval) { -+ return retval; -+ } -+ -+ if (mmcinfo.sd) { -+ mmc_simple_cmd(&request, MMC_CMD_APP_CMD, mmcinfo.rca, RESPONSE_R1); -+ retval = mmc_unpack_r1(&request,&r1,0); -+ if (retval) { -+ return retval; -+ } -+#if defined(MMC_BUS_WIDTH_1BIT) -+ mmc_simple_cmd(&request, SET_BUS_WIDTH, 1, RESPONSE_R1); -+#else -+ mmc_simple_cmd(&request, SET_BUS_WIDTH, 2, RESPONSE_R1); -+#endif -+ retval = mmc_unpack_r1(&request,&r1,0); -+ if (retval) { -+ return retval; -+ } -+ } -+ return 0; -+} -+ -+/* -+ * Configure card -+ */ -+static void mmc_configure_card(void) -+{ -+ u32 rate; -+ -+ /* Get card info */ -+ if (sd2_0) -+ mmcinfo.block_num = (mmcinfo.csd.c_size + 1) << 10; -+ else -+ mmcinfo.block_num = (mmcinfo.csd.c_size + 1) * (1 << (mmcinfo.csd.c_size_mult + 2)); -+ -+ mmcinfo.block_len = 1 << mmcinfo.csd.read_bl_len; -+ -+ mmc_dev.if_type = IF_TYPE_SD; -+ mmc_dev.part_type = PART_TYPE_DOS; -+ mmc_dev.dev = 0; -+ mmc_dev.lun = 0; -+ mmc_dev.type = 0; -+ mmc_dev.blksz = mmcinfo.block_len; -+ mmc_dev.lba = mmcinfo.block_num; -+ mmc_dev.removable = 0; -+ -+ printf("%s Detected: %lu blocks of %lu bytes\n", -+ sd2_0 == 1 ? "SDHC" : "SD", -+ mmc_dev.lba, -+ mmc_dev.blksz); -+ -+ /* Fix the clock rate */ -+ rate = mmc_tran_speed(mmcinfo.csd.tran_speed); -+ if (rate < MMC_CLOCK_SLOW) -+ rate = MMC_CLOCK_SLOW; -+ if ((mmcinfo.sd == 0) && (rate > MMC_CLOCK_FAST)) -+ rate = MMC_CLOCK_FAST; -+ if ((mmcinfo.sd) && (rate > SD_CLOCK_FAST)) -+ rate = SD_CLOCK_FAST; -+ -+ debug("%s: block_len=%d block_num=%d rate=%d\n", -+ __func__, mmcinfo.block_len, mmcinfo.block_num, rate); -+ -+ jz_mmc_set_clock(mmcinfo.sd, rate); -+} -+ -+/* -+ * State machine routines to initialize card(s) -+ */ -+ -+/* -+ CIM_SINGLE_CARD_ACQ (frequency at 400 kHz) -+ --- Must enter from GO_IDLE_STATE --- -+ 1. SD_SEND_OP_COND (SD Card) [CMD55] + [CMD41] -+ 2. SEND_OP_COND (Full Range) [CMD1] {optional} -+ 3. SEND_OP_COND (Set Range ) [CMD1] -+ If busy, delay and repeat step 2 -+ 4. ALL_SEND_CID [CMD2] -+ If timeout, set an error (no cards found) -+ 5. SET_RELATIVE_ADDR [CMD3] -+ 6. SEND_CSD [CMD9] -+ 7. SET_DSR [CMD4] Only call this if (csd.dsr_imp). -+ 8. Set clock frequency (check available in csd.tran_speed) -+ */ -+ -+#define MMC_INIT_DOING 0 -+#define MMC_INIT_PASSED 1 -+#define MMC_INIT_FAILED 2 -+ -+static int mmc_init_card_state(struct mmc_request *request) -+{ -+ struct mmc_response_r1 r1; -+ struct mmc_response_r3 r3; -+ int retval; -+ int ocr = 0x40300000; -+ int limit_41 = 0; -+ -+ switch (request->cmd) { -+ case MMC_CMD_GO_IDLE_STATE: /* No response to parse */ -+ if (mmcinfo.sd) -+ mmc_simple_cmd(request, 8, 0x1aa, RESPONSE_R1); -+ else -+ mmc_simple_cmd(request, MMC_CMD_SEND_OP_COND, MMC_OCR_ARG, RESPONSE_R3); -+ break; -+ -+ case 8: -+ retval = mmc_unpack_r1(request,&r1,mmcinfo.state); -+ mmc_simple_cmd(request, MMC_CMD_APP_CMD, 0, RESPONSE_R1); -+ break; -+ -+ case MMC_CMD_APP_CMD: -+ retval = mmc_unpack_r1(request,&r1,mmcinfo.state); -+ if (retval & (limit_41 < 100)) { -+ debug("%s: unable to MMC_APP_CMD error=%d (%s)\n", -+ __func__, retval, mmc_result_to_string(retval)); -+ limit_41++; -+ mmc_simple_cmd(request, SD_CMD_APP_SEND_OP_COND, ocr, RESPONSE_R3); -+ } else if (limit_41 < 100) { -+ limit_41++; -+ mmc_simple_cmd(request, SD_CMD_APP_SEND_OP_COND, ocr, RESPONSE_R3); -+ } else{ -+ /* reset the card to idle*/ -+ mmc_simple_cmd(request, MMC_CMD_GO_IDLE_STATE, 0, RESPONSE_NONE); -+ mmcinfo.sd = 0; -+ } -+ break; -+ -+ case SD_CMD_APP_SEND_OP_COND: -+ retval = mmc_unpack_r3(request, &r3); -+ if (retval) { -+ debug("%s: try MMC card\n", __func__); -+ mmc_simple_cmd(request, SD_CMD_APP_SEND_OP_COND, MMC_OCR_ARG, RESPONSE_R3); -+ break; -+ } -+ -+ debug("%s: read ocr value = 0x%08x\n", __func__, r3.ocr); -+ -+ if(!(r3.ocr & MMC_CARD_BUSY || ocr == 0)){ -+ udelay(50000); -+ mmc_simple_cmd(request, MMC_CMD_APP_CMD, 0, RESPONSE_R1); -+ } else { -+ mmcinfo.sd = 1; /* SD Card ready */ -+ mmcinfo.state = CARD_STATE_READY; -+ mmc_simple_cmd(request, MMC_CMD_ALL_SEND_CID, 0, RESPONSE_R2_CID); -+ } -+ break; -+ -+ case MMC_CMD_SEND_OP_COND: -+ retval = mmc_unpack_r3(request, &r3); -+ if (retval) { -+ debug("%s: failed SEND_OP_COND error=%d (%s)\n", -+ __func__, retval, mmc_result_to_string(retval)); -+ return MMC_INIT_FAILED; -+ } -+ -+ debug("%s: read ocr value = 0x%08x\n", __func__, r3.ocr); -+ if (!(r3.ocr & MMC_CARD_BUSY)) { -+ mmc_simple_cmd(request, MMC_CMD_SEND_OP_COND, MMC_OCR_ARG, RESPONSE_R3); -+ } else { -+ mmcinfo.sd = 0; /* MMC Card ready */ -+ mmcinfo.state = CARD_STATE_READY; -+ mmc_simple_cmd(request, MMC_CMD_ALL_SEND_CID, 0, RESPONSE_R2_CID); -+ } -+ break; -+ -+ case MMC_CMD_ALL_SEND_CID: -+ retval = mmc_unpack_cid( request, &mmcinfo.cid ); -+ /*FIXME:ignore CRC error for CMD2/CMD9/CMD10 */ -+ if ( retval && (retval != MMC_ERROR_CRC)) { -+ debug("mmc_init_card_state: unable to ALL_SEND_CID error=%d (%s)\n", -+ retval, mmc_result_to_string(retval)); -+ return MMC_INIT_FAILED; -+ } -+ mmcinfo.state = CARD_STATE_IDENT; -+ if(mmcinfo.sd) -+ mmc_simple_cmd(request, MMC_CMD_SET_RELATIVE_ADDR, 0, RESPONSE_R6); -+ else -+ mmc_simple_cmd(request, MMC_CMD_SET_RELATIVE_ADDR, ID_TO_RCA(mmcinfo.id) << 16, RESPONSE_R1); -+ break; -+ -+ case MMC_CMD_SET_RELATIVE_ADDR: -+ if (mmcinfo.sd) { -+ retval = mmc_unpack_r6(request, &r1, mmcinfo.state, &mmcinfo.rca); -+ mmcinfo.rca = mmcinfo.rca << 16; -+ debug("%s: Get RCA from SD: 0x%04x Status: %x\n", -+ __func__, mmcinfo.rca, r1.status); -+ } else { -+ retval = mmc_unpack_r1(request,&r1,mmcinfo.state); -+ mmcinfo.rca = ID_TO_RCA(mmcinfo.id) << 16; -+ } -+ if (retval) { -+ debug("%s: unable to SET_RELATIVE_ADDR error=%d (%s)\n", -+ __func__, retval, mmc_result_to_string(retval)); -+ return MMC_INIT_FAILED; -+ } -+ -+ mmcinfo.state = CARD_STATE_STBY; -+ mmc_simple_cmd(request, MMC_CMD_SEND_CSD, mmcinfo.rca, RESPONSE_R2_CSD); -+ -+ break; -+ -+ case MMC_CMD_SEND_CSD: -+ retval = mmc_unpack_csd(request, &mmcinfo.csd); -+ mmc_ready = 1; -+ /*FIXME:ignore CRC error for CMD2/CMD9/CMD10 */ -+ if (retval && (retval != MMC_ERROR_CRC)) { -+ debug("%s: unable to SEND_CSD error=%d (%s)\n", -+ __func__, retval, mmc_result_to_string(retval)); -+ return MMC_INIT_FAILED; -+ } -+ if (mmcinfo.csd.dsr_imp) { -+ debug("%s: driver doesn't support setting DSR\n", __func__); -+ } -+ mmc_configure_card(); -+ return MMC_INIT_PASSED; -+ -+ default: -+ debug("%s: error! Illegal last cmd %d\n", __func__, request->cmd); -+ return MMC_INIT_FAILED; -+ } -+ -+ return MMC_INIT_DOING; -+} -+ -+int mmc_init_card(void) -+{ -+ struct mmc_request request; -+ int retval; -+ -+ mmc_simple_cmd(&request, MMC_CIM_RESET, 0, RESPONSE_NONE); /* reset card */ -+ mmc_simple_cmd(&request, MMC_CMD_GO_IDLE_STATE, 0, RESPONSE_NONE); -+ mmcinfo.sd = 1; /* assuming a SD card */ -+ -+ while ((retval = mmc_init_card_state(&request)) == MMC_INIT_DOING) -+ ; -+ -+ if (retval == MMC_INIT_PASSED) -+ return MMC_NO_ERROR; -+ else -+ return MMC_NO_RESPONSE; -+} -+ -+int mmc_legacy_init(int verbose) -+{ -+ if (!__msc_card_detected()) -+ return 1; -+ -+ /* Step-1: init GPIO */ -+ __gpio_as_msc(); -+ __msc_init_io(); -+ -+ /* Step-2: turn on power of card */ -+#if !defined(CONFIG_SAKC) -+ __msc_enable_power(); -+#endif -+ -+ /* Step-3: Reset MSC Controller. */ -+ __msc_reset(); -+ -+ /* Step-3: mask all IRQs. */ -+ MMC_IRQ_MASK(); -+ -+ /* Step-4: stop MMC/SD clock */ -+ jz_mmc_stop_clock(); -+ mmc_init_card(); -+ mmc_select_card(); -+ -+ mmc_dev.block_read = mmc_bread; -+ fat_register_device(&mmc_dev,1); /* partitions start counting with 1 */ -+ -+ return 0; -+} -+ -+/* -+ * Debugging functions -+ */ -+static char * mmc_result_strings[] = { -+ "NO_RESPONSE", -+ "NO_ERROR", -+ "ERROR_OUT_OF_RANGE", -+ "ERROR_ADDRESS", -+ "ERROR_BLOCK_LEN", -+ "ERROR_ERASE_SEQ", -+ "ERROR_ERASE_PARAM", -+ "ERROR_WP_VIOLATION", -+ "ERROR_CARD_IS_LOCKED", -+ "ERROR_LOCK_UNLOCK_FAILED", -+ "ERROR_COM_CRC", -+ "ERROR_ILLEGAL_COMMAND", -+ "ERROR_CARD_ECC_FAILED", -+ "ERROR_CC", -+ "ERROR_GENERAL", -+ "ERROR_UNDERRUN", -+ "ERROR_OVERRUN", -+ "ERROR_CID_CSD_OVERWRITE", -+ "ERROR_STATE_MISMATCH", -+ "ERROR_HEADER_MISMATCH", -+ "ERROR_TIMEOUT", -+ "ERROR_CRC", -+ "ERROR_DRIVER_FAILURE", -+}; -+ -+char * mmc_result_to_string(int i) -+{ -+ return mmc_result_strings[i+1]; -+} -+ -+static char * card_state_strings[] = { -+ "empty", -+ "idle", -+ "ready", -+ "ident", -+ "stby", -+ "tran", -+ "data", -+ "rcv", -+ "prg", -+ "dis", -+}; -+ -+static inline char * card_state_to_string(int i) -+{ -+ return card_state_strings[i+1]; -+} -+ -+/* -+ * Utility functions -+ */ -+ -+#define PARSE_U32(_buf,_index) \ -+ (((u32)_buf[_index]) << 24) | (((u32)_buf[_index+1]) << 16) | \ -+ (((u32)_buf[_index+2]) << 8) | ((u32)_buf[_index+3]); -+ -+#define PARSE_U16(_buf,_index) \ -+ (((u16)_buf[_index]) << 8) | ((u16)_buf[_index+1]); -+ -+int mmc_unpack_csd(struct mmc_request *request, struct mmc_csd *csd) -+{ -+ u8 *buf = request->response; -+ int num = 0; -+ -+ if (request->result) -+ return request->result; -+ -+ if (buf[0] != 0x3f) -+ return MMC_ERROR_HEADER_MISMATCH; -+ -+ csd->csd_structure = (buf[1] & 0xc0) >> 6; -+ if (csd->csd_structure) -+ sd2_0 = 1; -+ else -+ sd2_0 = 0; -+ -+ switch (csd->csd_structure) { -+ case 0 :/* Version 1.01-1.10 -+ * Version 2.00/Standard Capacity */ -+ csd->taac = buf[2]; -+ csd->nsac = buf[3]; -+ csd->tran_speed = buf[4]; -+ csd->ccc = (((u16)buf[5]) << 4) | ((buf[6] & 0xf0) >> 4); -+ csd->read_bl_len = buf[6] & 0x0f; -+ /* for support 2GB card*/ -+ if (csd->read_bl_len >= 10) -+ { -+ num = csd->read_bl_len - 9; -+ csd->read_bl_len = 9; -+ } -+ -+ csd->read_bl_partial = (buf[7] & 0x80) ? 1 : 0; -+ csd->write_blk_misalign = (buf[7] & 0x40) ? 1 : 0; -+ csd->read_blk_misalign = (buf[7] & 0x20) ? 1 : 0; -+ csd->dsr_imp = (buf[7] & 0x10) ? 1 : 0; -+ csd->c_size = ((((u16)buf[7]) & 0x03) << 10) | (((u16)buf[8]) << 2) | (((u16)buf[9]) & 0xc0) >> 6; -+ -+ if (num) -+ csd->c_size = csd->c_size << num; -+ -+ -+ csd->vdd_r_curr_min = (buf[9] & 0x38) >> 3; -+ csd->vdd_r_curr_max = buf[9] & 0x07; -+ csd->vdd_w_curr_min = (buf[10] & 0xe0) >> 5; -+ csd->vdd_w_curr_max = (buf[10] & 0x1c) >> 2; -+ csd->c_size_mult = ((buf[10] & 0x03) << 1) | ((buf[11] & 0x80) >> 7); -+ csd->sector_size = (buf[11] & 0x7c) >> 2; -+ csd->erase_grp_size = ((buf[11] & 0x03) << 3) | ((buf[12] & 0xe0) >> 5); -+ csd->wp_grp_size = buf[12] & 0x1f; -+ csd->wp_grp_enable = (buf[13] & 0x80) ? 1 : 0; -+ csd->default_ecc = (buf[13] & 0x60) >> 5; -+ csd->r2w_factor = (buf[13] & 0x1c) >> 2; -+ csd->write_bl_len = ((buf[13] & 0x03) << 2) | ((buf[14] & 0xc0) >> 6); -+ if (csd->write_bl_len >= 10) -+ csd->write_bl_len = 9; -+ -+ csd->write_bl_partial = (buf[14] & 0x20) ? 1 : 0; -+ csd->file_format_grp = (buf[15] & 0x80) ? 1 : 0; -+ csd->copy = (buf[15] & 0x40) ? 1 : 0; -+ csd->perm_write_protect = (buf[15] & 0x20) ? 1 : 0; -+ csd->tmp_write_protect = (buf[15] & 0x10) ? 1 : 0; -+ csd->file_format = (buf[15] & 0x0c) >> 2; -+ csd->ecc = buf[15] & 0x03; -+ break; -+ case 1 : /* Version 2.00/High Capacity */ -+ csd->taac = 0; -+ csd->nsac = 0; -+ csd->tran_speed = buf[4]; -+ csd->ccc = (((u16)buf[5]) << 4) | ((buf[6] & 0xf0) >> 4); -+ -+ csd->read_bl_len = 9; -+ csd->read_bl_partial = 0; -+ csd->write_blk_misalign = 0; -+ csd->read_blk_misalign = 0; -+ csd->dsr_imp = (buf[7] & 0x10) ? 1 : 0; -+ csd->c_size = ((((u16)buf[8]) & 0x3f) << 16) | (((u16)buf[9]) << 8) | ((u16)buf[10]) ; -+ csd->sector_size = 0x7f; -+ csd->erase_grp_size = 0; -+ csd->wp_grp_size = 0; -+ csd->wp_grp_enable = 0; -+ csd->default_ecc = (buf[13] & 0x60) >> 5; -+ csd->r2w_factor = 4;/* Unused */ -+ csd->write_bl_len = 9; -+ -+ csd->write_bl_partial = 0; -+ csd->file_format_grp = 0; -+ csd->copy = (buf[15] & 0x40) ? 1 : 0; -+ csd->perm_write_protect = (buf[15] & 0x20) ? 1 : 0; -+ csd->tmp_write_protect = (buf[15] & 0x10) ? 1 : 0; -+ csd->file_format = 0; -+ csd->ecc = buf[15] & 0x03; -+ } -+ -+ return 0; -+} -+ -+int mmc_unpack_r1(struct mmc_request *request, struct mmc_response_r1 *r1, enum card_state state) -+{ -+ u8 *buf = request->response; -+ -+ if (request->result) -+ return request->result; -+ -+ r1->cmd = buf[0]; -+ r1->status = PARSE_U32(buf,1); -+ -+ debug("mmc_unpack_r1: cmd=%d status=%08x\n", r1->cmd, r1->status); -+ -+ if (R1_STATUS(r1->status)) { -+ if (r1->status & R1_OUT_OF_RANGE) return MMC_ERROR_OUT_OF_RANGE; -+ if (r1->status & R1_ADDRESS_ERROR) return MMC_ERROR_ADDRESS; -+ if (r1->status & R1_BLOCK_LEN_ERROR) return MMC_ERROR_BLOCK_LEN; -+ if (r1->status & R1_ERASE_SEQ_ERROR) return MMC_ERROR_ERASE_SEQ; -+ if (r1->status & R1_ERASE_PARAM) return MMC_ERROR_ERASE_PARAM; -+ if (r1->status & R1_WP_VIOLATION) return MMC_ERROR_WP_VIOLATION; -+ /*if (r1->status & R1_CARD_IS_LOCKED) return MMC_ERROR_CARD_IS_LOCKED; */ -+ if (r1->status & R1_LOCK_UNLOCK_FAILED) return MMC_ERROR_LOCK_UNLOCK_FAILED; -+ if (r1->status & R1_COM_CRC_ERROR) return MMC_ERROR_COM_CRC; -+ if (r1->status & R1_ILLEGAL_COMMAND) return MMC_ERROR_ILLEGAL_COMMAND; -+ if (r1->status & R1_CARD_ECC_FAILED) return MMC_ERROR_CARD_ECC_FAILED; -+ if (r1->status & R1_CC_ERROR) return MMC_ERROR_CC; -+ if (r1->status & R1_ERROR) return MMC_ERROR_GENERAL; -+ if (r1->status & R1_UNDERRUN) return MMC_ERROR_UNDERRUN; -+ if (r1->status & R1_OVERRUN) return MMC_ERROR_OVERRUN; -+ if (r1->status & R1_CID_CSD_OVERWRITE) return MMC_ERROR_CID_CSD_OVERWRITE; -+ } -+ -+ if (buf[0] != request->cmd) -+ return MMC_ERROR_HEADER_MISMATCH; -+ -+ /* This should be last - it's the least dangerous error */ -+ -+ return 0; -+} -+ -+int mmc_unpack_scr(struct mmc_request *request, struct mmc_response_r1 *r1, enum card_state state, u32 *scr) -+{ -+ u8 *buf = request->response; -+ if (request->result) -+ return request->result; -+ -+ *scr = PARSE_U32(buf, 5); /* Save SCR returned by the SD Card */ -+ return mmc_unpack_r1(request, r1, state); -+ -+} -+ -+int mmc_unpack_r6(struct mmc_request *request, struct mmc_response_r1 *r1, enum card_state state, int *rca) -+{ -+ u8 *buf = request->response; -+ -+ if (request->result) -+ return request->result; -+ -+ *rca = PARSE_U16(buf,1); /* Save RCA returned by the SD Card */ -+ -+ *(buf+1) = 0; -+ *(buf+2) = 0; -+ -+ return mmc_unpack_r1(request, r1, state); -+} -+ -+int mmc_unpack_cid(struct mmc_request *request, struct mmc_cid *cid) -+{ -+ int i; -+ u8 *buf = request->response; -+ -+ if (request->result) -+ return request->result; -+ -+ cid->mid = buf[1]; -+ cid->oid = PARSE_U16(buf,2); -+ for (i = 0 ; i < 5 ; i++) -+ cid->pnm[i] = buf[4+i]; -+ cid->pnm[6] = 0; -+ cid->prv = buf[10]; -+ cid->psn = PARSE_U32(buf,10); -+ cid->mdt = buf[15]; -+ -+ printf("Man %02x OEM 0x%04x \"%s\" %d.%d 0x%08x " -+ "Date %02u/%04u\n", -+ cid->mid, -+ cid->oid, -+ cid->pnm, -+ cid->prv >> 4, -+ cid->prv & 0xf, -+ cid->psn, -+ cid->mdt & 0xf, -+ (cid->mdt >> 4) + 2000); -+ -+ if (buf[0] != 0x3f) -+ return MMC_ERROR_HEADER_MISMATCH; -+ return 0; -+} -+ -+int mmc_unpack_r3(struct mmc_request *request, struct mmc_response_r3 *r3) -+{ -+ u8 *buf = request->response; -+ -+ if (request->result) -+ return request->result; -+ -+ r3->ocr = PARSE_U32(buf,1); -+ debug("mmc_unpack_r3: ocr=%08x\n", r3->ocr); -+ -+ if (buf[0] != 0x3f) return MMC_ERROR_HEADER_MISMATCH; -+ return 0; -+} -+ -+#define KBPS 1 -+#define MBPS 1000 -+ -+static u32 ts_exp[] = { 100*KBPS, 1*MBPS, 10*MBPS, 100*MBPS, 0, 0, 0, 0 }; -+static u32 ts_mul[] = { 0, 1000, 1200, 1300, 1500, 2000, 2500, 3000, -+ 3500, 4000, 4500, 5000, 5500, 6000, 7000, 8000 }; -+ -+u32 mmc_tran_speed(u8 ts) -+{ -+ u32 rate = ts_exp[(ts & 0x7)] * ts_mul[(ts & 0x78) >> 3]; -+ -+ if (rate <= 0) { -+ debug("%s: error - unrecognized speed 0x%02x\n", __func__, ts); -+ return 1; -+ } -+ -+ return rate; -+} -+ -+void mmc_send_cmd(struct mmc_request *request, int cmd, u32 arg, -+ u16 nob, u16 block_len, enum mmc_rsp_t rtype, u8 *buffer) -+{ -+ request->cmd = cmd; -+ request->arg = arg; -+ request->rtype = rtype; -+ request->nob = nob; -+ request->block_len = block_len; -+ request->buffer = buffer; -+ request->cnt = nob * block_len; -+ -+ jz_mmc_exec_cmd(request); -+} -diff --git a/drivers/mmc/jz_mmc.h b/drivers/mmc/jz_mmc.h -new file mode 100644 -index 0000000..936c514 ---- /dev/null -+++ b/drivers/mmc/jz_mmc.h -@@ -0,0 +1,176 @@ -+/* -+ * linux/drivers/mmc/jz_mmc.h -+ * -+ * Author: Vladimir Shebordaev, Igor Oblakov -+ * Copyright: MontaVista Software Inc. -+ * -+ * $Id: jz_mmc.h,v 1.3 2007-06-15 08:04:20 jlwei Exp $ -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License version 2 as -+ * published by the Free Software Foundation. -+ */ -+#ifndef __MMC_JZMMC_H__ -+#define __MMC_JZMMC_H__ -+ -+#define ID_TO_RCA(x) ((x)+1) -+#define MMC_OCR_ARG 0x00ff8000 /* Argument of OCR */ -+ -+/* Standard MMC/SD clock speeds */ -+#define MMC_CLOCK_SLOW 400000 /* 400 kHz for initial setup */ -+#define MMC_CLOCK_FAST 20000000 /* 20 MHz for maximum for normal operation */ -+#define SD_CLOCK_FAST 24000000 /* 24 MHz for SD Cards */ -+ -+/* Use negative numbers to disambiguate */ -+#define MMC_CIM_RESET -1 -+#define SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ -+ -+#define R1_OUT_OF_RANGE (1 << 31) /* er, c */ -+#define R1_ADDRESS_ERROR (1 << 30) /* erx, c */ -+#define R1_BLOCK_LEN_ERROR (1 << 29) /* er, c */ -+#define R1_ERASE_SEQ_ERROR (1 << 28) /* er, c */ -+#define R1_ERASE_PARAM (1 << 27) /* ex, c */ -+#define R1_WP_VIOLATION (1 << 26) /* erx, c */ -+#define R1_CARD_IS_LOCKED (1 << 25) /* sx, a */ -+#define R1_LOCK_UNLOCK_FAILED (1 << 24) /* erx, c */ -+#define R1_COM_CRC_ERROR (1 << 23) /* er, b */ -+#define R1_ILLEGAL_COMMAND (1 << 22) /* er, b */ -+#define R1_CARD_ECC_FAILED (1 << 21) /* ex, c */ -+#define R1_CC_ERROR (1 << 20) /* erx, c */ -+#define R1_ERROR (1 << 19) /* erx, c */ -+#define R1_UNDERRUN (1 << 18) /* ex, c */ -+#define R1_OVERRUN (1 << 17) /* ex, c */ -+#define R1_CID_CSD_OVERWRITE (1 << 16) /* erx, c, CID/CSD overwrite */ -+#define R1_WP_ERASE_SKIP (1 << 15) /* sx, c */ -+#define R1_CARD_ECC_DISABLED (1 << 14) /* sx, a */ -+#define R1_ERASE_RESET (1 << 13) /* sr, c */ -+#define R1_STATUS(x) (x & 0xFFFFE000) -+ -+#define MMC_CARD_BUSY 0x80000000 /* Card Power up status bit */ -+ -+#define MMC_PROGRAM_CID 26 /* adtc R1 */ -+#define MMC_PROGRAM_CSD 27 /* adtc R1 */ -+ -+#define MMC_GO_IRQ_STATE 40 /* bcr R5 */ -+#define MMC_GEN_CMD 56 /* adtc [0] RD/WR R1b */ -+#define MMC_LOCK_UNLOCK 42 /* adtc R1b */ -+#define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ -+#define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ -+#define MMC_SEND_WRITE_PROT 30 /* adtc [31:0] wpdata addr R1 */ -+ -+ -+enum mmc_result_t { -+ MMC_NO_RESPONSE = -1, -+ MMC_NO_ERROR = 0, -+ MMC_ERROR_OUT_OF_RANGE, -+ MMC_ERROR_ADDRESS, -+ MMC_ERROR_BLOCK_LEN, -+ MMC_ERROR_ERASE_SEQ, -+ MMC_ERROR_ERASE_PARAM, -+ MMC_ERROR_WP_VIOLATION, -+ MMC_ERROR_CARD_IS_LOCKED, -+ MMC_ERROR_LOCK_UNLOCK_FAILED, -+ MMC_ERROR_COM_CRC, -+ MMC_ERROR_ILLEGAL_COMMAND, -+ MMC_ERROR_CARD_ECC_FAILED, -+ MMC_ERROR_CC, -+ MMC_ERROR_GENERAL, -+ MMC_ERROR_UNDERRUN, -+ MMC_ERROR_OVERRUN, -+ MMC_ERROR_CID_CSD_OVERWRITE, -+ MMC_ERROR_STATE_MISMATCH, -+ MMC_ERROR_HEADER_MISMATCH, -+ MMC_ERROR_TIMEOUT, -+ MMC_ERROR_CRC, -+ MMC_ERROR_DRIVER_FAILURE, -+}; -+ -+enum card_state { -+ CARD_STATE_EMPTY = -1, -+ CARD_STATE_IDLE = 0, -+ CARD_STATE_READY = 1, -+ CARD_STATE_IDENT = 2, -+ CARD_STATE_STBY = 3, -+ CARD_STATE_TRAN = 4, -+ CARD_STATE_DATA = 5, -+ CARD_STATE_RCV = 6, -+ CARD_STATE_PRG = 7, -+ CARD_STATE_DIS = 8, -+}; -+ -+enum mmc_rsp_t { -+ RESPONSE_NONE = 0, -+ RESPONSE_R1 = 1, -+ RESPONSE_R1B = 2, -+ RESPONSE_R2_CID = 3, -+ RESPONSE_R2_CSD = 4, -+ RESPONSE_R3 = 5, -+ RESPONSE_R4 = 6, -+ RESPONSE_R5 = 7, -+ RESPONSE_R6 = 8, -+}; -+ -+struct mmc_response_r1 { -+ u8 cmd; -+ u32 status; -+}; -+ -+struct mmc_response_r3 { -+ u32 ocr; -+}; -+ -+/* the information structure of MMC/SD Card */ -+struct mmc_info { -+ int id; /* Card index */ -+ int sd; /* MMC or SD card */ -+ int rca; /* RCA */ -+ u32 scr; /* SCR 63:32*/ -+ int flags; /* Ejected, inserted */ -+ enum card_state state; /* empty, ident, ready, whatever */ -+ -+ /* Card specific information */ -+ struct mmc_cid cid; -+ struct mmc_csd csd; -+ u32 block_num; -+ u32 block_len; -+ u32 erase_unit; -+}; -+ -+struct mmc_info mmcinfo; -+ -+struct mmc_request { -+ int index; /* Slot index - used for CS lines */ -+ int cmd; /* Command to send */ -+ u32 arg; /* Argument to send */ -+ enum mmc_rsp_t rtype; /* Response type expected */ -+ -+ /* Data transfer (these may be modified at the low level) */ -+ u16 nob; /* Number of blocks to transfer*/ -+ u16 block_len; /* Block length */ -+ u8 *buffer; /* Data buffer */ -+ u32 cnt; /* Data length, for PIO */ -+ -+ /* Results */ -+ u8 response[18]; /* Buffer to store response - CRC is optional */ -+ enum mmc_result_t result; -+}; -+ -+char * mmc_result_to_string(int); -+int mmc_unpack_csd(struct mmc_request *request, struct mmc_csd *csd); -+int mmc_unpack_r1(struct mmc_request *request, struct mmc_response_r1 *r1, enum card_state state); -+int mmc_unpack_r6(struct mmc_request *request, struct mmc_response_r1 *r1, enum card_state state, int *rca); -+int mmc_unpack_scr(struct mmc_request *request, struct mmc_response_r1 *r1, enum card_state state, u32 *scr); -+int mmc_unpack_cid(struct mmc_request *request, struct mmc_cid *cid); -+int mmc_unpack_r3(struct mmc_request *request, struct mmc_response_r3 *r3); -+ -+void mmc_send_cmd(struct mmc_request *request, int cmd, u32 arg, -+ u16 nob, u16 block_len, enum mmc_rsp_t rtype, u8 *buffer); -+u32 mmc_tran_speed(u8 ts); -+void jz_mmc_set_clock(int sd, u32 rate); -+ -+static inline void mmc_simple_cmd(struct mmc_request *request, int cmd, u32 arg, enum mmc_rsp_t rtype) -+{ -+ mmc_send_cmd( request, cmd, arg, 0, 0, rtype, 0); -+} -+ -+#endif /* __MMC_JZMMC_H__ */ -diff --git a/include/configs/qi_lb60.h b/include/configs/qi_lb60.h -index 7bff444..7b33be0 100644 ---- a/include/configs/qi_lb60.h -+++ b/include/configs/qi_lb60.h -@@ -31,6 +31,15 @@ - /* - * Miscellaneous configurable options - */ -+#define CONFIG_JZ4740_MMC -+#define CONFIG_MMC 1 -+#define CONFIG_FAT 1 -+#define CONFIG_DOS_PARTITION 1 -+#define CONFIG_CMD_MMC -+#define CONFIG_CMD_FAT -+#define CONFIG_CMD_EXT2 -+ -+ - #define CONFIG_SYS_SDRAM_BASE 0x80000000 /* Cached addr */ - #define CONFIG_SYS_INIT_SP_OFFSET 0x400000 - #define CONFIG_SYS_LOAD_ADDR 0x80600000 -diff --git a/include/mmc.h b/include/mmc.h -index a13e2bd..3c4761c 100644 ---- a/include/mmc.h -+++ b/include/mmc.h -@@ -283,4 +283,44 @@ struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode); - int mmc_legacy_init(int verbose); - #endif - -+struct mmc_csd -+{ -+ u8 csd_structure:2, -+ spec_vers:4, -+ rsvd1:2; -+ u8 taac; -+ u8 nsac; -+ u8 tran_speed; -+ u16 ccc:12, -+ read_bl_len:4; -+ u32 c_size:22; -+ u64 read_bl_partial:1, -+ write_blk_misalign:1, -+ read_blk_misalign:1, -+ dsr_imp:1, -+ rsvd2:2, -+ vdd_r_curr_min:3, -+ vdd_r_curr_max:3, -+ vdd_w_curr_min:3, -+ vdd_w_curr_max:3, -+ c_size_mult:3, -+ sector_size:5, -+ erase_grp_size:5, -+ wp_grp_size:5, -+ wp_grp_enable:1, -+ default_ecc:2, -+ r2w_factor:3, -+ write_bl_len:4, -+ write_bl_partial:1, -+ rsvd3:5; -+ u8 file_format_grp:1, -+ copy:1, -+ perm_write_protect:1, -+ tmp_write_protect:1, -+ file_format:2, -+ ecc:2; -+ u8 crc:7; -+ u8 one:1; -+}; -+ - #endif /* _MMC_H_ */ --- -1.7.9.5 - diff --git a/package/boot/uboot-xburst/patches/0004-add-more-boot-options-F1-F2-F3-F4-M-S.patch b/package/boot/uboot-xburst/patches/0004-add-more-boot-options-F1-F2-F3-F4-M-S.patch deleted file mode 100644 index 73e03243c..000000000 --- a/package/boot/uboot-xburst/patches/0004-add-more-boot-options-F1-F2-F3-F4-M-S.patch +++ /dev/null @@ -1,200 +0,0 @@ -From c52b6168979d03fc31205444c3278c537787472a Mon Sep 17 00:00:00 2001 -From: Xiangfu -Date: Wed, 10 Oct 2012 18:39:55 +0800 -Subject: [PATCH 4/6] add more boot options(F1/F2/F3/F4/M/S) - ---- - arch/mips/include/asm/global_data.h | 3 +++ - arch/mips/lib/bootm.c | 17 ++++++++++++++++- - board/qi/qi_lb60/qi_lb60.c | 26 +++++++++++++++++++++++--- - common/main.c | 21 +++++++++++++++++++-- - include/configs/qi_lb60.h | 32 ++++++++++++++++++++++++++++++++ - 5 files changed, 93 insertions(+), 6 deletions(-) - -diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h -index 6e2cdc7..cd03d7e 100644 ---- a/arch/mips/include/asm/global_data.h -+++ b/arch/mips/include/asm/global_data.h -@@ -59,6 +59,9 @@ typedef struct global_data { - unsigned long env_valid; /* Checksum of Environment valid? */ - void **jt; /* jump table */ - char env_buf[32]; /* buffer for getenv() before reloc. */ -+#if defined(CONFIG_NANONOTE) -+ unsigned long boot_option; -+#endif - } gd_t; - - #include -diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c -index 608c1a7..e00416b 100644 ---- a/arch/mips/lib/bootm.c -+++ b/arch/mips/lib/bootm.c -@@ -47,10 +47,25 @@ int do_bootm_linux(int flag, int argc, char * const argv[], - bootm_headers_t *images) - { - void (*theKernel) (int, char **, char **, int *); -- char *commandline = getenv("bootargs"); -+ char *commandline; - char env_buf[12]; - char *cp; - -+#if defined(CONFIG_NANONOTE) -+ if (gd->boot_option & BOOT_FROM_MEMCARD) -+ commandline = getenv ("bootargsfromsd"); -+ else if (gd->boot_option & BOOT_WITH_F1) -+ commandline = getenv ("bootargsf1"); -+ else if (gd->boot_option & BOOT_WITH_F2) -+ commandline = getenv ("bootargsf2"); -+ else if (gd->boot_option & BOOT_WITH_F3) -+ commandline = getenv ("bootargsf3"); -+ else if (gd->boot_option & BOOT_WITH_F4) -+ commandline = getenv ("bootargsf4"); -+ else -+#endif -+ commandline = getenv ("bootargs"); -+ - if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) - return 1; - -diff --git a/board/qi/qi_lb60/qi_lb60.c b/board/qi/qi_lb60/qi_lb60.c -index a2ba648..d622219 100644 ---- a/board/qi/qi_lb60/qi_lb60.c -+++ b/board/qi/qi_lb60/qi_lb60.c -@@ -15,7 +15,7 @@ DECLARE_GLOBAL_DATA_PTR; - - static void gpio_init(void) - { -- unsigned int i; -+ unsigned int i, j; - - /* Initialize NAND Flash Pins */ - __gpio_as_nand(); -@@ -42,14 +42,34 @@ static void gpio_init(void) - - if (__gpio_get_pin(GPIO_KEYIN_BASE + 2) == 0){ - printf("[S] pressed, enable UART0\n"); -+ gd->boot_option |= BOOT_WITH_ENABLE_UART; - __gpio_as_uart0(); - } else { - __gpio_as_input(GPIO_KEYIN_8); - __gpio_enable_pull(GPIO_KEYIN_8); - } - -- /* enable the TP4, TP5 as UART0 */ -- __gpio_jtag_to_uart0(); -+ if (__gpio_get_pin(GPIO_KEYIN_BASE + 3) == 0) { -+ printf("[M] pressed, boot from memory card\n"); -+ gd->boot_option |= BOOT_FROM_MEMCARD; -+ __gpio_jtag_to_uart0(); -+ } -+ -+ for (j = 0; j < 4; j++) { -+ for (i = 0; i < 4; i++) -+ __gpio_set_pin(GPIO_KEYOUT_BASE + i); -+ -+ __gpio_clear_pin(GPIO_KEYOUT_BASE + j); -+ -+ if (__gpio_get_pin(GPIO_KEYIN_BASE) == 0) { -+ printf("[F%d] pressed", (j + 1)); -+ gd->boot_option |= (1 << (j + 2)); -+ /* BOOT_WITH_F1 (1 << 2) */ -+ /* BOOT_WITH_F2 (1 << 3) */ -+ /* BOOT_WITH_F3 (1 << 4) */ -+ /* BOOT_WITH_F4 (1 << 5) */ -+ } -+ } - - __gpio_as_output(GPIO_AUDIO_POP); - __gpio_set_pin(GPIO_AUDIO_POP); -diff --git a/common/main.c b/common/main.c -index 9507cec..dbfb7ca 100644 ---- a/common/main.c -+++ b/common/main.c -@@ -355,7 +355,11 @@ void main_loop (void) - #if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) - s = getenv ("bootdelay"); - bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY; -- -+#if defined(CONFIG_NANONOTE) -+ DECLARE_GLOBAL_DATA_PTR; -+ if (gd->boot_option & BOOT_WITH_ENABLE_UART) -+ bootdelay = 3; -+# endif - debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay); - - #if defined(CONFIG_MENU_SHOW) -@@ -379,7 +383,20 @@ void main_loop (void) - } - else - #endif /* CONFIG_BOOTCOUNT_LIMIT */ -- s = getenv ("bootcmd"); -+#if defined(CONFIG_NANONOTE) -+ if (gd->boot_option & BOOT_FROM_MEMCARD) -+ s = getenv ("bootcmdfromsd"); -+ else if (gd->boot_option & BOOT_WITH_F1) -+ s = getenv ("bootcmdf1"); -+ else if (gd->boot_option & BOOT_WITH_F2) -+ s = getenv ("bootcmdf2"); -+ else if (gd->boot_option & BOOT_WITH_F3) -+ s = getenv ("bootcmdf3"); -+ else if (gd->boot_option & BOOT_WITH_F4) -+ s = getenv ("bootcmdf4"); -+ else -+#endif -+ s = getenv ("bootcmd"); - - debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : ""); - -diff --git a/include/configs/qi_lb60.h b/include/configs/qi_lb60.h -index 7b33be0..52b370c 100644 ---- a/include/configs/qi_lb60.h -+++ b/include/configs/qi_lb60.h -@@ -31,6 +31,7 @@ - /* - * Miscellaneous configurable options - */ -+#define CONFIG_NANONOTE - #define CONFIG_JZ4740_MMC - #define CONFIG_MMC 1 - #define CONFIG_FAT 1 -@@ -39,6 +40,37 @@ - #define CONFIG_CMD_FAT - #define CONFIG_CMD_EXT2 - -+#define CONFIG_CMD_UBIFS -+#define CONFIG_CMD_UBI -+#define CONFIG_MTD_PARTITIONS -+#define CONFIG_MTD_DEVICE -+#define CONFIG_CMD_MTDPARTS -+#define CONFIG_CMD_UBI -+#define CONFIG_CMD_UBIFS -+#define CONFIG_LZO -+#define CONFIG_RBTREE -+ -+#define MTDIDS_DEFAULT "nand0=jz4740-nand" -+#define MTDPARTS_DEFAULT "mtdparts=jz4740-nand:4M@0(uboot)ro,4M@4M(kernel)ro,512M@8M(rootfs)ro,-(data)ro" -+ -+#define BOOT_FROM_MEMCARD 1 -+#define BOOT_WITH_ENABLE_UART (1 << 1) /* Vaule for global_data.h gd->boot_option */ -+#define BOOT_WITH_F1 (1 << 2) -+#define BOOT_WITH_F2 (1 << 3) -+#define BOOT_WITH_F3 (1 << 4) -+#define BOOT_WITH_F4 (1 << 5) -+ -+#define CONFIG_EXTRA_ENV_SETTINGS \ -+ "bootcmdfromsd=mmc init; ext2load mmc 0 0x80600000 /boot/uImage; bootm;\0" \ -+ "bootargsfromsd=mem=32M console=tty0 console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p1 rw rootwait\0" \ -+ "bootcmdf1=mmc init; ext2load mmc 0:1 0x80600000 /boot/uImage; bootm;\0" \ -+ "bootargsf1=mem=32M console=tty0 console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p1 rw rootwait\0" \ -+ "bootcmdf2=mmc init; ext2load mmc 0:2 0x80600000 /boot/uImage; bootm;\0" \ -+ "bootargsf2=mem=32M console=tty0 console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p2 rw rootwait\0" \ -+ "bootcmdf3=mmc init; ext2load mmc 0:3 0x80600000 /boot/uImage; bootm;\0" \ -+ "bootargsf3=mem=32M console=tty0 console=ttyS0,57600n8 rootfstype=ext2 root=/dev/mmcblk0p3 rw rootwait\0" \ -+ "bootcmdf4=mtdparts default;ubi part rootfs;ubifsmount rootfs;ubifsload 0x80600000 /boot/uImage; bootm;\0" \ -+ "bootargsf4=mem=32M console=tty0 console=ttyS0,57600n8 ubi.mtd=2 rootfstype=ubifs root=ubi0:rootfs rw rootwait" - - #define CONFIG_SYS_SDRAM_BASE 0x80000000 /* Cached addr */ - #define CONFIG_SYS_INIT_SP_OFFSET 0x400000 --- -1.7.9.5 - diff --git a/package/boot/uboot-xburst/patches/0005-add-nanonote-lcd-support.patch b/package/boot/uboot-xburst/patches/0005-add-nanonote-lcd-support.patch deleted file mode 100644 index 2c550f720..000000000 --- a/package/boot/uboot-xburst/patches/0005-add-nanonote-lcd-support.patch +++ /dev/null @@ -1,847 +0,0 @@ -From ca8c5216cfd3ad3fda9867ed2d157ae5a209834b Mon Sep 17 00:00:00 2001 -From: Xiangfu -Date: Wed, 10 Oct 2012 22:05:27 +0800 -Subject: [PATCH 5/6] add nanonote lcd support - ---- - arch/mips/include/asm/global_data.h | 1 + - arch/mips/include/asm/jz4740.h | 90 ++++++++ - arch/mips/lib/board.c | 6 + - common/lcd.c | 9 +- - drivers/video/Makefile | 1 + - drivers/video/nanonote_gpm940b0.c | 400 +++++++++++++++++++++++++++++++++++ - drivers/video/nanonote_gpm940b0.h | 135 ++++++++++++ - include/configs/qi_lb60.h | 7 + - include/lcd.h | 52 ++++- - 9 files changed, 697 insertions(+), 4 deletions(-) - create mode 100644 drivers/video/nanonote_gpm940b0.c - create mode 100644 drivers/video/nanonote_gpm940b0.h - -diff --git a/arch/mips/include/asm/global_data.h b/arch/mips/include/asm/global_data.h -index cd03d7e..7cec2de 100644 ---- a/arch/mips/include/asm/global_data.h -+++ b/arch/mips/include/asm/global_data.h -@@ -44,6 +44,7 @@ typedef struct global_data { - unsigned long per_clk; /* Peripheral bus clock */ - unsigned long mem_clk; /* Memory bus clock */ - unsigned long dev_clk; /* Device clock */ -+ unsigned long fb_base; /* base address of framebuffer */ - /* "static data" needed by most of timer.c */ - unsigned long tbl; - unsigned long lastinc; -diff --git a/arch/mips/include/asm/jz4740.h b/arch/mips/include/asm/jz4740.h -index 68287fb..13724a2 100644 ---- a/arch/mips/include/asm/jz4740.h -+++ b/arch/mips/include/asm/jz4740.h -@@ -1312,5 +1312,95 @@ do { \ - while (REG_MSC_STAT & MSC_STAT_IS_RESETTING); \ - } while (0) - -+/************************************************************************* -+ * LCD (LCD Controller) -+ *************************************************************************/ -+#define REG32(addr) *((volatile u32 *)(addr)) -+ -+#define CPM_BASE 0xB0000000 -+#define CPM_CPCCR (CPM_BASE+0x00) -+#define REG_CPM_CPCCR REG32(CPM_CPCCR) -+ -+#define LCD_BASE 0xB3050000 -+#define LCD_CFG (LCD_BASE + 0x00) /* LCD Configure Register */ -+#define LCD_VSYNC (LCD_BASE + 0x04) /* Vertical Synchronize Register */ -+#define LCD_HSYNC (LCD_BASE + 0x08) /* Horizontal Synchronize Register */ -+#define LCD_VAT (LCD_BASE + 0x0c) /* Virtual Area Setting Register */ -+#define LCD_DAH (LCD_BASE + 0x10) /* Display Area Horizontal Start/End Point */ -+#define LCD_DAV (LCD_BASE + 0x14) /* Display Area Vertical Start/End Point */ -+#define LCD_PS (LCD_BASE + 0x18) /* PS Signal Setting */ -+#define LCD_CLS (LCD_BASE + 0x1c) /* CLS Signal Setting */ -+#define LCD_SPL (LCD_BASE + 0x20) /* SPL Signal Setting */ -+#define LCD_REV (LCD_BASE + 0x24) /* REV Signal Setting */ -+#define LCD_CTRL (LCD_BASE + 0x30) /* LCD Control Register */ -+#define LCD_STATE (LCD_BASE + 0x34) /* LCD Status Register */ -+#define LCD_IID (LCD_BASE + 0x38) /* Interrupt ID Register */ -+#define LCD_DA0 (LCD_BASE + 0x40) /* Descriptor Address Register 0 */ -+#define LCD_SA0 (LCD_BASE + 0x44) /* Source Address Register 0 */ -+#define LCD_FID0 (LCD_BASE + 0x48) /* Frame ID Register 0 */ -+#define LCD_CMD0 (LCD_BASE + 0x4c) /* DMA Command Register 0 */ -+#define LCD_DA1 (LCD_BASE + 0x50) /* Descriptor Address Register 1 */ -+#define LCD_SA1 (LCD_BASE + 0x54) /* Source Address Register 1 */ -+#define LCD_FID1 (LCD_BASE + 0x58) /* Frame ID Register 1 */ -+#define LCD_CMD1 (LCD_BASE + 0x5c) /* DMA Command Register 1 */ -+ -+#define REG_LCD_CFG REG32(LCD_CFG) -+#define REG_LCD_VSYNC REG32(LCD_VSYNC) -+#define REG_LCD_HSYNC REG32(LCD_HSYNC) -+#define REG_LCD_VAT REG32(LCD_VAT) -+#define REG_LCD_DAH REG32(LCD_DAH) -+#define REG_LCD_DAV REG32(LCD_DAV) -+#define REG_LCD_PS REG32(LCD_PS) -+#define REG_LCD_CLS REG32(LCD_CLS) -+#define REG_LCD_SPL REG32(LCD_SPL) -+#define REG_LCD_REV REG32(LCD_REV) -+#define REG_LCD_CTRL REG32(LCD_CTRL) -+#define REG_LCD_STATE REG32(LCD_STATE) -+#define REG_LCD_IID REG32(LCD_IID) -+#define REG_LCD_DA0 REG32(LCD_DA0) -+#define REG_LCD_SA0 REG32(LCD_SA0) -+#define REG_LCD_FID0 REG32(LCD_FID0) -+#define REG_LCD_CMD0 REG32(LCD_CMD0) -+#define REG_LCD_DA1 REG32(LCD_DA1) -+#define REG_LCD_SA1 REG32(LCD_SA1) -+#define REG_LCD_FID1 REG32(LCD_FID1) -+#define REG_LCD_CMD1 REG32(LCD_CMD1) -+ -+#define LCD_CTRL_BPP_BIT 0 /* Bits Per Pixel */ -+#define LCD_CTRL_BPP_MASK (0x07 << LCD_CTRL_BPP_BIT) -+ #define LCD_CTRL_BPP_1 (0 << LCD_CTRL_BPP_BIT) /* 1 bpp */ -+ #define LCD_CTRL_BPP_2 (1 << LCD_CTRL_BPP_BIT) /* 2 bpp */ -+ #define LCD_CTRL_BPP_4 (2 << LCD_CTRL_BPP_BIT) /* 4 bpp */ -+ #define LCD_CTRL_BPP_8 (3 << LCD_CTRL_BPP_BIT) /* 8 bpp */ -+ #define LCD_CTRL_BPP_16 (4 << LCD_CTRL_BPP_BIT) /* 15/16 bpp */ -+ #define LCD_CTRL_BPP_18_24 (5 << LCD_CTRL_BPP_BIT) /* 18/24/32 bpp */ -+ -+#define LCD_CTRL_BST_BIT 28 /* Burst Length Selection */ -+#define LCD_CTRL_BST_MASK (0x03 << LCD_CTRL_BST_BIT) -+ #define LCD_CTRL_BST_4 (0 << LCD_CTRL_BST_BIT) /* 4-word */ -+ #define LCD_CTRL_BST_8 (1 << LCD_CTRL_BST_BIT) /* 8-word */ -+ #define LCD_CTRL_BST_16 (2 << LCD_CTRL_BST_BIT) /* 16-word */ -+#define LCD_CTRL_RGB565 (0 << 27) /* RGB565 mode */ -+#define LCD_CTRL_RGB555 (1 << 27) /* RGB555 mode */ -+#define LCD_CTRL_OFUP (1 << 26) /* Output FIFO underrun protection enable */ -+#define LCD_CTRL_FRC_BIT 24 /* STN FRC Algorithm Selection */ -+#define LCD_CTRL_FRC_MASK (0x03 << LCD_CTRL_FRC_BIT) -+ #define LCD_CTRL_FRC_16 (0 << LCD_CTRL_FRC_BIT) /* 16 grayscale */ -+ #define LCD_CTRL_FRC_4 (1 << LCD_CTRL_FRC_BIT) /* 4 grayscale */ -+ #define LCD_CTRL_FRC_2 (2 << LCD_CTRL_FRC_BIT) /* 2 grayscale */ -+ -+#define CPM_LPCDR (CPM_BASE+0x64) -+#define CPM_CLKGR (CPM_BASE+0x20) -+#define REG_CPM_LPCDR REG32(CPM_LPCDR) -+#define REG_CPM_CLKGR REG32(CPM_CLKGR) -+ -+#define __cpm_start_tcu() (REG_CPM_CLKGR &= ~CPM_CLKGR_TCU) -+#define __cpm_stop_lcd() (REG_CPM_CLKGR |= CPM_CLKGR_LCD) -+#define __cpm_set_pixdiv(v) \ -+ (REG_CPM_LPCDR = (REG_CPM_LPCDR & ~CPM_LPCDR_PIXDIV_MASK) | ((v) << (CPM_LPCDR_PIXDIV_BIT))) -+#define __cpm_set_ldiv(v) \ -+ (REG_CPM_CPCCR = (REG_CPM_CPCCR & ~CPM_CPCCR_LDIV_MASK) | ((v) << (CPM_CPCCR_LDIV_BIT))) -+#define __cpm_start_lcd() (REG_CPM_CLKGR &= ~CPM_CLKGR_LCD) -+ - #endif /* !__ASSEMBLY__ */ - #endif /* __JZ4740_H__ */ -diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c -index b14b33e..c2e64d9 100644 ---- a/arch/mips/lib/board.c -+++ b/arch/mips/lib/board.c -@@ -172,6 +172,12 @@ void board_init_f(ulong bootflag) - addr &= ~(4096 - 1); - debug("Top of RAM usable for U-Boot at: %08lx\n", addr); - -+#ifdef CONFIG_LCD -+ /* reserve memory for LCD display (always full pages) */ -+ addr = lcd_setmem (addr); -+ gd->fb_base = addr; -+#endif /* CONFIG_LCD */ -+ - /* Reserve memory for U-Boot code, data & bss - * round down to next 16 kB limit - */ -diff --git a/common/lcd.c b/common/lcd.c -index b6be800..af1281a 100644 ---- a/common/lcd.c -+++ b/common/lcd.c -@@ -263,6 +263,13 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, int count) - lcd_color_fg : lcd_color_bg; - bits <<= 1; - } -+#elif LCD_BPP == LCD_COLOR32 -+ uint *m = (uint *)d; -+ for (c=0; c<32; ++c) { -+ *m++ = (bits & 0x80) ? -+ lcd_color_fg : lcd_color_bg; -+ bits <<= 1; -+ } - #endif - } - #if LCD_BPP == LCD_MONOCHROME -@@ -509,7 +516,7 @@ static inline ushort *configuration_get_cmap(void) - return (ushort *)&(cp->lcd_cmap[255 * sizeof(ushort)]); - #elif defined(CONFIG_ATMEL_LCD) - return (ushort *)(panel_info.mmio + ATMEL_LCDC_LUT(0)); --#elif !defined(CONFIG_ATMEL_HLCD) && !defined(CONFIG_EXYNOS_FB) -+#elif !defined(CONFIG_ATMEL_HLCD) && !defined(CONFIG_EXYNOS_FB) && !defined(CONFIG_VIDEO_GPM940B0) - return panel_info.cmap; - #else - #if defined(CONFIG_LCD_LOGO) -diff --git a/drivers/video/Makefile b/drivers/video/Makefile -index ebb6da8..03625bc 100644 ---- a/drivers/video/Makefile -+++ b/drivers/video/Makefile -@@ -50,6 +50,7 @@ COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o - COBJS-$(CONFIG_VIDEO_SM501) += sm501.o - COBJS-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o - COBJS-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o -+COBJS-$(CONFIG_VIDEO_GPM940B0) += nanonote_gpm940b0.o - - COBJS := $(sort $(COBJS-y)) - SRCS := $(COBJS:.o=.c) -diff --git a/drivers/video/nanonote_gpm940b0.c b/drivers/video/nanonote_gpm940b0.c -new file mode 100644 -index 0000000..11efb72 ---- /dev/null -+++ b/drivers/video/nanonote_gpm940b0.c -@@ -0,0 +1,400 @@ -+/* -+ * JzRISC lcd controller -+ * -+ * Xiangfu Liu -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ */ -+ -+#include -+#include -+#include -+ -+#include /* virt_to_phys() */ -+#include -+ -+#include "nanonote_gpm940b0.h" -+ -+#define align2(n) (n)=((((n)+1)>>1)<<1) -+#define align4(n) (n)=((((n)+3)>>2)<<2) -+#define align8(n) (n)=((((n)+7)>>3)<<3) -+ -+struct jzfb_info { -+ unsigned int cfg; /* panel mode and pin usage etc. */ -+ unsigned int w; -+ unsigned int h; -+ unsigned int bpp; /* bit per pixel */ -+ unsigned int fclk; /* frame clk */ -+ unsigned int hsw; /* hsync width, in pclk */ -+ unsigned int vsw; /* vsync width, in line count */ -+ unsigned int elw; /* end of line, in pclk */ -+ unsigned int blw; /* begin of line, in pclk */ -+ unsigned int efw; /* end of frame, in line count */ -+ unsigned int bfw; /* begin of frame, in line count */ -+}; -+ -+static struct jzfb_info jzfb = { -+ MODE_8BIT_SERIAL_TFT | PCLK_N | HSYNC_N | VSYNC_N, -+ 320, 240, 32, 70, 1, 1, 273, 140, 1, 20 -+}; -+ -+vidinfo_t panel_info = { -+ 320, 240, LCD_BPP, -+}; -+ -+void *lcd_base; -+void *lcd_console_address; -+int lcd_line_length; -+int lcd_color_fg; -+int lcd_color_bg; -+short console_col; -+short console_row; -+ -+static int jz_lcd_init_mem(void *lcdbase, vidinfo_t *vid) -+{ -+ u_long palette_mem_size; -+ struct jz_fb_info *fbi = &vid->jz_fb; -+ int fb_size = vid->vl_row * (vid->vl_col * NBITS (vid->vl_bpix)) / 8; -+ -+ fbi->screen = (u_long)lcdbase; -+ fbi->palette_size = 256; -+ palette_mem_size = fbi->palette_size * sizeof(u16); -+ -+ debug("jz_lcd.c palette_mem_size = 0x%08lx\n", (u_long) palette_mem_size); -+ /* locate palette and descs at end of page following fb */ -+ fbi->palette = (u_long)lcdbase + fb_size + PAGE_SIZE - palette_mem_size; -+ -+ return 0; -+} -+ -+static void jz_lcd_desc_init(vidinfo_t *vid) -+{ -+ struct jz_fb_info * fbi; -+ fbi = &vid->jz_fb; -+ fbi->dmadesc_fblow = (struct jz_fb_dma_descriptor *)((unsigned int)fbi->palette - 3*16); -+ fbi->dmadesc_fbhigh = (struct jz_fb_dma_descriptor *)((unsigned int)fbi->palette - 2*16); -+ fbi->dmadesc_palette = (struct jz_fb_dma_descriptor *)((unsigned int)fbi->palette - 1*16); -+ -+ #define BYTES_PER_PANEL (vid->vl_col * vid->vl_row * NBITS(vid->vl_bpix) / 8) -+ -+ /* populate descriptors */ -+ fbi->dmadesc_fblow->fdadr = virt_to_phys(fbi->dmadesc_fblow); -+ fbi->dmadesc_fblow->fsadr = virt_to_phys((void *)(fbi->screen + BYTES_PER_PANEL)); -+ fbi->dmadesc_fblow->fidr = 0; -+ fbi->dmadesc_fblow->ldcmd = BYTES_PER_PANEL / 4 ; -+ -+ fbi->fdadr1 = virt_to_phys(fbi->dmadesc_fblow); /* only used in dual-panel mode */ -+ -+ fbi->dmadesc_fbhigh->fsadr = virt_to_phys((void *)fbi->screen); -+ fbi->dmadesc_fbhigh->fidr = 0; -+ fbi->dmadesc_fbhigh->ldcmd = BYTES_PER_PANEL / 4; /* length in word */ -+ -+ fbi->dmadesc_palette->fsadr = virt_to_phys((void *)fbi->palette); -+ fbi->dmadesc_palette->fidr = 0; -+ fbi->dmadesc_palette->ldcmd = (fbi->palette_size * 2)/4 | (1<<28); -+ -+ if(NBITS(vid->vl_bpix) < 12) { -+ /* assume any mode with <12 bpp is palette driven */ -+ fbi->dmadesc_palette->fdadr = virt_to_phys(fbi->dmadesc_fbhigh); -+ fbi->dmadesc_fbhigh->fdadr = virt_to_phys(fbi->dmadesc_palette); -+ /* flips back and forth between pal and fbhigh */ -+ fbi->fdadr0 = virt_to_phys(fbi->dmadesc_palette); -+ } else { -+ /* palette shouldn't be loaded in true-color mode */ -+ fbi->dmadesc_fbhigh->fdadr = virt_to_phys((void *)fbi->dmadesc_fbhigh); -+ fbi->fdadr0 = virt_to_phys(fbi->dmadesc_fbhigh); /* no pal just fbhigh */ -+ } -+} -+ -+static int jz_lcd_hw_init(vidinfo_t *vid) -+{ -+ struct jz_fb_info *fbi = &vid->jz_fb; -+ unsigned int val = 0; -+ unsigned int pclk; -+ unsigned int stnH; -+ int pll_div; -+ -+ /* Setting Control register */ -+ switch (jzfb.bpp) { -+ case 1: -+ val |= LCD_CTRL_BPP_1; -+ break; -+ case 2: -+ val |= LCD_CTRL_BPP_2; -+ break; -+ case 4: -+ val |= LCD_CTRL_BPP_4; -+ break; -+ case 8: -+ val |= LCD_CTRL_BPP_8; -+ break; -+ case 15: -+ val |= LCD_CTRL_RGB555; -+ case 16: -+ val |= LCD_CTRL_BPP_16; -+ break; -+ case 17 ... 32: -+ val |= LCD_CTRL_BPP_18_24; /* target is 4bytes/pixel */ -+ break; -+ -+ default: -+ printf("jz_lcd.c The BPP %d is not supported\n", jzfb.bpp); -+ val |= LCD_CTRL_BPP_16; -+ break; -+ } -+ -+ switch (jzfb.cfg & MODE_MASK) { -+ case MODE_STN_MONO_DUAL: -+ case MODE_STN_COLOR_DUAL: -+ case MODE_STN_MONO_SINGLE: -+ case MODE_STN_COLOR_SINGLE: -+ switch (jzfb.bpp) { -+ case 1: -+ /* val |= LCD_CTRL_PEDN; */ -+ case 2: -+ val |= LCD_CTRL_FRC_2; -+ break; -+ case 4: -+ val |= LCD_CTRL_FRC_4; -+ break; -+ case 8: -+ default: -+ val |= LCD_CTRL_FRC_16; -+ break; -+ } -+ break; -+ } -+ -+ val |= LCD_CTRL_BST_16; /* Burst Length is 16WORD=64Byte */ -+ val |= LCD_CTRL_OFUP; /* OutFIFO underrun protect */ -+ -+ switch (jzfb.cfg & MODE_MASK) { -+ case MODE_STN_MONO_DUAL: -+ case MODE_STN_COLOR_DUAL: -+ case MODE_STN_MONO_SINGLE: -+ case MODE_STN_COLOR_SINGLE: -+ switch (jzfb.cfg & STN_DAT_PINMASK) { -+ case STN_DAT_PIN1: -+ /* Do not adjust the hori-param value. */ -+ break; -+ case STN_DAT_PIN2: -+ align2(jzfb.hsw); -+ align2(jzfb.elw); -+ align2(jzfb.blw); -+ break; -+ case STN_DAT_PIN4: -+ align4(jzfb.hsw); -+ align4(jzfb.elw); -+ align4(jzfb.blw); -+ break; -+ case STN_DAT_PIN8: -+ align8(jzfb.hsw); -+ align8(jzfb.elw); -+ align8(jzfb.blw); -+ break; -+ } -+ break; -+ } -+ -+ REG_LCD_CTRL = val; -+ -+ switch (jzfb.cfg & MODE_MASK) { -+ case MODE_STN_MONO_DUAL: -+ case MODE_STN_COLOR_DUAL: -+ case MODE_STN_MONO_SINGLE: -+ case MODE_STN_COLOR_SINGLE: -+ if (((jzfb.cfg & MODE_MASK) == MODE_STN_MONO_DUAL) || -+ ((jzfb.cfg & MODE_MASK) == MODE_STN_COLOR_DUAL)) -+ stnH = jzfb.h >> 1; -+ else -+ stnH = jzfb.h; -+ -+ REG_LCD_VSYNC = (0 << 16) | jzfb.vsw; -+ REG_LCD_HSYNC = ((jzfb.blw+jzfb.w) << 16) | (jzfb.blw+jzfb.w+jzfb.hsw); -+ -+ /* Screen setting */ -+ REG_LCD_VAT = ((jzfb.blw + jzfb.w + jzfb.hsw + jzfb.elw) << 16) | (stnH + jzfb.vsw + jzfb.bfw + jzfb.efw); -+ REG_LCD_DAH = (jzfb.blw << 16) | (jzfb.blw + jzfb.w); -+ REG_LCD_DAV = (0 << 16) | (stnH); -+ -+ /* AC BIAs signal */ -+ REG_LCD_PS = (0 << 16) | (stnH+jzfb.vsw+jzfb.efw+jzfb.bfw); -+ -+ break; -+ -+ case MODE_TFT_GEN: -+ case MODE_TFT_SHARP: -+ case MODE_TFT_CASIO: -+ case MODE_TFT_SAMSUNG: -+ case MODE_8BIT_SERIAL_TFT: -+ case MODE_TFT_18BIT: -+ REG_LCD_VSYNC = (0 << 16) | jzfb.vsw; -+ REG_LCD_HSYNC = (0 << 16) | jzfb.hsw; -+ REG_LCD_DAV =((jzfb.vsw+jzfb.bfw) << 16) | (jzfb.vsw +jzfb.bfw+jzfb.h); -+ REG_LCD_DAH = ((jzfb.hsw + jzfb.blw) << 16) | (jzfb.hsw + jzfb.blw + jzfb.w ); -+ REG_LCD_VAT = (((jzfb.blw + jzfb.w + jzfb.elw + jzfb.hsw)) << 16) \ -+ | (jzfb.vsw + jzfb.bfw + jzfb.h + jzfb.efw); -+ break; -+ } -+ -+ switch (jzfb.cfg & MODE_MASK) { -+ case MODE_TFT_SAMSUNG: -+ { -+ unsigned int total, tp_s, tp_e, ckv_s, ckv_e; -+ unsigned int rev_s, rev_e, inv_s, inv_e; -+ -+ pclk = val * (jzfb.w + jzfb.hsw + jzfb.elw + jzfb.blw) * -+ (jzfb.h + jzfb.vsw + jzfb.efw + jzfb.bfw); /* Pixclk */ -+ -+ total = jzfb.blw + jzfb.w + jzfb.elw + jzfb.hsw; -+ tp_s = jzfb.blw + jzfb.w + 1; -+ tp_e = tp_s + 1; -+ ckv_s = tp_s - pclk/(1000000000/4100); -+ ckv_e = tp_s + total; -+ rev_s = tp_s - 11; /* -11.5 clk */ -+ rev_e = rev_s + total; -+ inv_s = tp_s; -+ inv_e = inv_s + total; -+ REG_LCD_CLS = (tp_s << 16) | tp_e; -+ REG_LCD_PS = (ckv_s << 16) | ckv_e; -+ REG_LCD_SPL = (rev_s << 16) | rev_e; -+ REG_LCD_REV = (inv_s << 16) | inv_e; -+ jzfb.cfg |= STFT_REVHI | STFT_SPLHI; -+ break; -+ } -+ case MODE_TFT_SHARP: -+ { -+ unsigned int total, cls_s, cls_e, ps_s, ps_e; -+ unsigned int spl_s, spl_e, rev_s, rev_e; -+ total = jzfb.blw + jzfb.w + jzfb.elw + jzfb.hsw; -+ spl_s = 1; -+ spl_e = spl_s + 1; -+ cls_s = 0; -+ cls_e = total - 60; /* > 4us (pclk = 80ns) */ -+ ps_s = cls_s; -+ ps_e = cls_e; -+ rev_s = total - 40; /* > 3us (pclk = 80ns) */ -+ rev_e = rev_s + total; -+ jzfb.cfg |= STFT_PSHI; -+ REG_LCD_SPL = (spl_s << 16) | spl_e; -+ REG_LCD_CLS = (cls_s << 16) | cls_e; -+ REG_LCD_PS = (ps_s << 16) | ps_e; -+ REG_LCD_REV = (rev_s << 16) | rev_e; -+ break; -+ } -+ case MODE_TFT_CASIO: -+ break; -+ } -+ -+ /* Configure the LCD panel */ -+ REG_LCD_CFG = jzfb.cfg; -+ -+ /* Timing setting */ -+ __cpm_stop_lcd(); -+ -+ val = jzfb.fclk; /* frame clk */ -+ if ( (jzfb.cfg & MODE_MASK) != MODE_8BIT_SERIAL_TFT) { -+ pclk = val * (jzfb.w + jzfb.hsw + jzfb.elw + jzfb.blw) * -+ (jzfb.h + jzfb.vsw + jzfb.efw + jzfb.bfw); /* Pixclk */ -+ } else { -+ /* serial mode: Hsync period = 3*Width_Pixel */ -+ pclk = val * (jzfb.w*3 + jzfb.hsw + jzfb.elw + jzfb.blw) * -+ (jzfb.h + jzfb.vsw + jzfb.efw + jzfb.bfw); /* Pixclk */ -+ } -+ -+ if (((jzfb.cfg & MODE_MASK) == MODE_STN_COLOR_SINGLE) || -+ ((jzfb.cfg & MODE_MASK) == MODE_STN_COLOR_DUAL)) -+ pclk = (pclk * 3); -+ -+ if (((jzfb.cfg & MODE_MASK) == MODE_STN_COLOR_SINGLE) || -+ ((jzfb.cfg & MODE_MASK) == MODE_STN_COLOR_DUAL) || -+ ((jzfb.cfg & MODE_MASK) == MODE_STN_MONO_SINGLE) || -+ ((jzfb.cfg & MODE_MASK) == MODE_STN_MONO_DUAL)) -+ pclk = pclk >> ((jzfb.cfg & STN_DAT_PINMASK) >> 4); -+ -+ if (((jzfb.cfg & MODE_MASK) == MODE_STN_COLOR_DUAL) || -+ ((jzfb.cfg & MODE_MASK) == MODE_STN_MONO_DUAL)) -+ pclk >>= 1; -+ -+ pll_div = (REG_CPM_CPCCR & CPM_CPCCR_PCS); /* clock source,0:pllout/2 1: pllout */ -+ pll_div = pll_div ? 1 : 2; -+ val = (__cpm_get_pllout() / pll_div) / pclk; -+ val--; -+ if (val > 0x1ff) { -+ printf("CPM_LPCDR too large, set it to 0x1ff\n"); -+ val = 0x1ff; -+ } -+ __cpm_set_pixdiv(val); -+ -+ val = pclk * 3 ; /* LCDClock > 2.5*Pixclock */ -+ if (val > 150000000) { -+ printf("Warning: LCDClock=%d\n, LCDClock must less or equal to 150MHz.\n", val); -+ printf("Change LCDClock to 150MHz\n"); -+ val = 150000000; -+ } -+ val = (__cpm_get_pllout() / pll_div) / val; -+ val--; -+ if (val > 0x1f) { -+ printf("CPM_CPCCR.LDIV too large, set it to 0x1f\n"); -+ val = 0x1f; -+ } -+ __cpm_set_ldiv( val ); -+ REG_CPM_CPCCR |= CPM_CPCCR_CE ; /* update divide */ -+ -+ __cpm_start_lcd(); -+ udelay(1000); -+ -+ REG_LCD_DA0 = fbi->fdadr0; /* frame descripter*/ -+ -+ if (((jzfb.cfg & MODE_MASK) == MODE_STN_COLOR_DUAL) || -+ ((jzfb.cfg & MODE_MASK) == MODE_STN_MONO_DUAL)) -+ REG_LCD_DA1 = fbi->fdadr1; /* frame descripter*/ -+ -+ return 0; -+} -+ -+void lcd_ctrl_init (void *lcdbase) -+{ -+ __lcd_display_pin_init(); -+ __lcd_display_on() ; -+ -+ jz_lcd_init_mem(lcdbase, &panel_info); -+ jz_lcd_desc_init(&panel_info); -+ jz_lcd_hw_init(&panel_info); -+ -+} -+ -+/* -+ * Before enabled lcd controller, lcd registers should be configured correctly. -+ */ -+void lcd_enable (void) -+{ -+ REG_LCD_CTRL &= ~(1<<4); /* LCDCTRL.DIS */ -+ REG_LCD_CTRL |= 1<<3; /* LCDCTRL.ENA*/ -+} -+ -+void lcd_disable (void) -+{ -+ REG_LCD_CTRL |= (1<<4); -+} -+ -+void lcd_setcolreg (ushort regno, ushort red, ushort green, ushort blue) -+{ -+} -+ -+void lcd_initcolregs (void) -+{ -+} -diff --git a/drivers/video/nanonote_gpm940b0.h b/drivers/video/nanonote_gpm940b0.h -new file mode 100644 -index 0000000..efe491e ---- /dev/null -+++ b/drivers/video/nanonote_gpm940b0.h -@@ -0,0 +1,135 @@ -+/* -+ * JzRISC lcd controller -+ * -+ * Xiangfu Liu -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, -+ * MA 02111-1307 USA -+ */ -+ -+#ifndef __QI_LB60_GPM940B0_H__ -+#define __QI_LB60_GPM940B0_H__ -+ -+struct lcd_desc{ -+ unsigned int next_desc; /* LCDDAx */ -+ unsigned int databuf; /* LCDSAx */ -+ unsigned int frame_id; /* LCDFIDx */ -+ unsigned int cmd; /* LCDCMDx */ -+}; -+ -+#define MODE_MASK 0x0f -+#define MODE_TFT_GEN 0x00 -+#define MODE_TFT_SHARP 0x01 -+#define MODE_TFT_CASIO 0x02 -+#define MODE_TFT_SAMSUNG 0x03 -+#define MODE_CCIR656_NONINT 0x04 -+#define MODE_CCIR656_INT 0x05 -+#define MODE_STN_COLOR_SINGLE 0x08 -+#define MODE_STN_MONO_SINGLE 0x09 -+#define MODE_STN_COLOR_DUAL 0x0a -+#define MODE_STN_MONO_DUAL 0x0b -+#define MODE_8BIT_SERIAL_TFT 0x0c -+ -+#define MODE_TFT_18BIT (1<<7) -+ -+#define STN_DAT_PIN1 (0x00 << 4) -+#define STN_DAT_PIN2 (0x01 << 4) -+#define STN_DAT_PIN4 (0x02 << 4) -+#define STN_DAT_PIN8 (0x03 << 4) -+#define STN_DAT_PINMASK STN_DAT_PIN8 -+ -+#define STFT_PSHI (1 << 15) -+#define STFT_CLSHI (1 << 14) -+#define STFT_SPLHI (1 << 13) -+#define STFT_REVHI (1 << 12) -+ -+#define SYNC_MASTER (0 << 16) -+#define SYNC_SLAVE (1 << 16) -+ -+#define DE_P (0 << 9) -+#define DE_N (1 << 9) -+ -+#define PCLK_P (0 << 10) -+#define PCLK_N (1 << 10) -+ -+#define HSYNC_P (0 << 11) -+#define HSYNC_N (1 << 11) -+ -+#define VSYNC_P (0 << 8) -+#define VSYNC_N (1 << 8) -+ -+#define DATA_NORMAL (0 << 17) -+#define DATA_INVERSE (1 << 17) -+ -+ -+/* Jz LCDFB supported I/O controls. */ -+#define FBIOSETBACKLIGHT 0x4688 -+#define FBIODISPON 0x4689 -+#define FBIODISPOFF 0x468a -+#define FBIORESET 0x468b -+#define FBIOPRINT_REG 0x468c -+ -+/* -+ * LCD panel specific definition -+ */ -+#define MODE (0xc9) /* 8bit serial RGB */ -+ -+#define __spi_write_reg1(reg, val) \ -+do { \ -+ unsigned char no; \ -+ unsigned short value; \ -+ unsigned char a=reg; \ -+ unsigned char b=val; \ -+ __gpio_set_pin(SPEN); \ -+ __gpio_set_pin(SPCK); \ -+ __gpio_clear_pin(SPDA); \ -+ __gpio_clear_pin(SPEN); \ -+ value=((a<<8)|(b&0xFF)); \ -+ for(no=0;no<16;no++) \ -+ { \ -+ __gpio_clear_pin(SPCK); \ -+ if((value&0x8000)==0x8000) \ -+ __gpio_set_pin(SPDA); \ -+ else \ -+ __gpio_clear_pin(SPDA); \ -+ __gpio_set_pin(SPCK); \ -+ value=(value<<1); \ -+ } \ -+ __gpio_set_pin(SPEN); \ -+} while (0) -+ -+#define __lcd_display_pin_init() \ -+do { \ -+ __cpm_start_tcu(); \ -+ __gpio_as_output(SPEN); /* use SPDA */ \ -+ __gpio_as_output(SPCK); /* use SPCK */ \ -+ __gpio_as_output(SPDA); /* use SPDA */ \ -+} while (0) -+ -+#define __lcd_display_on() \ -+do { \ -+ __spi_write_reg1(0x05, 0x1e); \ -+ __spi_write_reg1(0x05, 0x5e); \ -+ __spi_write_reg1(0x07, 0x8d); \ -+ __spi_write_reg1(0x13, 0x01); \ -+ __spi_write_reg1(0x05, 0x5f); \ -+} while (0) -+ -+#define __lcd_display_off() \ -+do { \ -+ __spi_write_reg1(0x05, 0x5e); \ -+} while (0) -+ -+#endif /* __QI_LB60_GPM940B0_H__ */ -diff --git a/include/configs/qi_lb60.h b/include/configs/qi_lb60.h -index 52b370c..d3e78ad 100644 ---- a/include/configs/qi_lb60.h -+++ b/include/configs/qi_lb60.h -@@ -32,6 +32,13 @@ - * Miscellaneous configurable options - */ - #define CONFIG_NANONOTE -+ -+#define CONFIG_LCD -+#define CONFIG_SYS_WHITE_ON_BLACK -+#define LCD_BPP LCD_COLOR32 -+#define CONFIG_VIDEO_GPM940B0 -+ -+ - #define CONFIG_JZ4740_MMC - #define CONFIG_MMC 1 - #define CONFIG_FAT 1 -diff --git a/include/lcd.h b/include/lcd.h -index 42070d7..6de5482 100644 ---- a/include/lcd.h -+++ b/include/lcd.h -@@ -263,8 +263,44 @@ typedef struct vidinfo { - - void init_panel_info(vidinfo_t *vid); - --#else -+#elif defined(CONFIG_JZSOC) -+/* -+ * LCD controller stucture for JZSOC: JZ4740 -+ */ -+struct jz_fb_dma_descriptor { -+ u_long fdadr; /* Frame descriptor address register */ -+ u_long fsadr; /* Frame source address register */ -+ u_long fidr; /* Frame ID register */ -+ u_long ldcmd; /* Command register */ -+}; -+ -+/* -+ * Jz LCD info -+ */ -+struct jz_fb_info { -+ -+ u_long fdadr0; /* physical address of frame/palette descriptor */ -+ u_long fdadr1; /* physical address of frame descriptor */ -+ -+ /* DMA descriptors */ -+ struct jz_fb_dma_descriptor * dmadesc_fblow; -+ struct jz_fb_dma_descriptor * dmadesc_fbhigh; -+ struct jz_fb_dma_descriptor * dmadesc_palette; -+ u_long screen; /* address of frame buffer */ -+ u_long palette; /* address of palette memory */ -+ u_int palette_size; -+}; -+typedef struct vidinfo { -+ ushort vl_col; /* Number of columns (i.e. 640) */ -+ ushort vl_row; /* Number of rows (i.e. 480) */ -+ u_char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */ -+ -+ struct jz_fb_info jz_fb; -+} vidinfo_t; -+ -+extern vidinfo_t panel_info; - -+#else - typedef struct vidinfo { - ushort vl_col; /* Number of columns (i.e. 160) */ - ushort vl_row; /* Number of rows (i.e. 100) */ -@@ -318,6 +354,7 @@ void lcd_show_board_info(void); - #define LCD_COLOR4 2 - #define LCD_COLOR8 3 - #define LCD_COLOR16 4 -+#define LCD_COLOR32 5 - - /*----------------------------------------------------------------------*/ - #if defined(CONFIG_LCD_INFO_BELOW_LOGO) -@@ -369,7 +406,7 @@ void lcd_show_board_info(void); - # define CONSOLE_COLOR_GREY 14 - # define CONSOLE_COLOR_WHITE 15 /* Must remain last / highest */ - --#else -+#elif LCD_BPP == LCD_COLOR16 - - /* - * 16bpp color definitions -@@ -377,6 +414,15 @@ void lcd_show_board_info(void); - # define CONSOLE_COLOR_BLACK 0x0000 - # define CONSOLE_COLOR_WHITE 0xffff /* Must remain last / highest */ - -+#elif LCD_BPP == LCD_COLOR32 -+/* -+ * 18,24,32 bpp color definitions -+ */ -+# define CONSOLE_COLOR_BLACK 0x00000000 -+# define CONSOLE_COLOR_WHITE 0xffffffff /* Must remain last / highest */ -+ -+#else -+ - #endif /* color definitions */ - - /************************************************************************/ -@@ -406,7 +452,7 @@ void lcd_show_board_info(void); - #if LCD_BPP == LCD_MONOCHROME - # define COLOR_MASK(c) ((c) | (c) << 1 | (c) << 2 | (c) << 3 | \ - (c) << 4 | (c) << 5 | (c) << 6 | (c) << 7) --#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) -+#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || (LCD_BPP == LCD_COLOR32) - # define COLOR_MASK(c) (c) - #else - # error Unsupported LCD BPP. --- -1.7.9.5 - diff --git a/package/boot/uboot-xburst/patches/0006-enable-silent-console.patch b/package/boot/uboot-xburst/patches/0006-enable-silent-console.patch deleted file mode 100644 index ebd6a6a7b..000000000 --- a/package/boot/uboot-xburst/patches/0006-enable-silent-console.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 5eb4d4c598f2806bd1b3d1140e917bfead7851ad Mon Sep 17 00:00:00 2001 -From: Xiangfu -Date: Wed, 10 Oct 2012 23:51:26 +0800 -Subject: [PATCH 6/6] enable silent console - ---- - common/console.c | 16 ++++++++++++++++ - include/configs/qi_lb60.h | 2 ++ - 2 files changed, 18 insertions(+) - -diff --git a/common/console.c b/common/console.c -index 1177f7d..e8a2078 100644 ---- a/common/console.c -+++ b/common/console.c -@@ -685,6 +685,14 @@ done: - - gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */ - -+#ifdef CONFIG_SILENT_CONSOLE -+ /* Check one more time the contents of the silent environment -+ * variable, because if the environment is loaded from NAND it was -+ * not available when console_init_f() was called */ -+ if (getenv("silent") != NULL) -+ gd->flags |= GD_FLG_SILENT; -+#endif -+ - stdio_print_current_devices(); - - #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE -@@ -760,6 +768,14 @@ int console_init_r(void) - - gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */ - -+#ifdef CONFIG_SILENT_CONSOLE -+ /* Check one more time the contents of the silent environment -+ * variable, because if the environment is loaded from NAND it was -+ * not available when console_init_f() was called */ -+ if (getenv("silent") != NULL) -+ gd->flags |= GD_FLG_SILENT; -+#endif -+ - stdio_print_current_devices(); - - /* Setting environment variables */ -diff --git a/include/configs/qi_lb60.h b/include/configs/qi_lb60.h -index d3e78ad..a3534ff 100644 ---- a/include/configs/qi_lb60.h -+++ b/include/configs/qi_lb60.h -@@ -102,6 +102,8 @@ - #define CONFIG_SYS_NO_FLASH - #define CONFIG_SYS_FLASH_BASE 0 /* init flash_base as 0 */ - -+#define CONFIG_SILENT_CONSOLE 1 /* Enable silent console */ -+ - /* - * Command line configuration - */ --- -1.7.9.5 - diff --git a/package/boot/uboot-zynq/Makefile b/package/boot/uboot-zynq/Makefile index 2e4c6cc03..b6b1dc8b8 100644 --- a/package/boot/uboot-zynq/Makefile +++ b/package/boot/uboot-zynq/Makefile @@ -7,9 +7,9 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=2018.07 +PKG_VERSION:=2019.07 -PKG_HASH:=9f10df88bc91b35642e461217f73256bbaeeca9ae2db8db56197ba5e89e1f6d4 +PKG_HASH:=bff4fa77e8da17521c030ca4c5b947a056c1b1be4d3e6ee8637020b8d50251d0 include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/u-boot.mk diff --git a/package/boot/uboot-zynq/patches/020-v2018.09-arm-zynq-dts-add-spi-flash-node-to-zedboard.patch b/package/boot/uboot-zynq/patches/020-v2018.09-arm-zynq-dts-add-spi-flash-node-to-zedboard.patch deleted file mode 100644 index 195cdf632..000000000 --- a/package/boot/uboot-zynq/patches/020-v2018.09-arm-zynq-dts-add-spi-flash-node-to-zedboard.patch +++ /dev/null @@ -1,38 +0,0 @@ -From a492fdffa3c86f6b8420b6433a2ce07271597324 Mon Sep 17 00:00:00 2001 -From: Luis Araneda -Date: Fri, 27 Jul 2018 04:43:42 -0400 -Subject: [PATCH] arm: zynq: dts: add spi flash node to zedboard - -Add a flash node to fix the detection of the memory IC. -With the changes introduced with commit 8fee8845e754 -("enf_sf: reuse setup_flash_device instead of open coding it") -the SPI speed is now read from device-tree or a default value -is applied. This replaced the old behavior of setting the -SPI speed to CONFIG_ENV_SPI_MAX_HZ. - -As this board didn't have a flash node, the default value -was applied to the SPI speed, producing an error when probing -the flash memory (speed too slow). - -Signed-off-by: Luis Araneda -Signed-off-by: Michal Simek ---- - arch/arm/dts/zynq-zed.dts | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/arm/dts/zynq-zed.dts -+++ b/arch/arm/dts/zynq-zed.dts -@@ -51,6 +51,13 @@ - &qspi { - u-boot,dm-pre-reloc; - status = "okay"; -+ num-cs = <1>; -+ flash@0 { -+ compatible = "spansion,s25fl256s", "spi-flash"; -+ reg = <0>; -+ spi-max-frequency = <30000000>; -+ m25p,fast-read; -+ }; - }; - - &sdhci0 { diff --git a/package/boot/uboot-zynq/patches/025-v2018.09-arm-zynq-add-support-for-the-zybo-z7-board.patch b/package/boot/uboot-zynq/patches/025-v2018.09-arm-zynq-add-support-for-the-zybo-z7-board.patch deleted file mode 100644 index 0e4504b85..000000000 --- a/package/boot/uboot-zynq/patches/025-v2018.09-arm-zynq-add-support-for-the-zybo-z7-board.patch +++ /dev/null @@ -1,499 +0,0 @@ -From 58f449676ac29938ea2970e240a2defe99240a8e Mon Sep 17 00:00:00 2001 -From: Luis Araneda -Date: Tue, 24 Jul 2018 11:31:19 -0400 -Subject: [PATCH] arm: zynq: add support for the zybo z7 board - -The board is manufactured by Digilent -Main features: -- Soc: XC7Z010 (Z7-10) or XC7Z020 (Z7-20) -- RAM: 1 GB DDR3L -- FLASH: 16 MB QSPI -- 1 Gbps Ethernet -- USB 2.0 -- microSD slot -- Pcam camera connector -- HDMI Tx and Rx -- Audio codec: stereo out, stereo in, mic -- 5 (Z7-10) or 6 (Z7-20) Pmod ports -- 6 push-buttons, 4 switches, 5 LEDs -- 1 (Z7-10) or 2 (Z7-20) RGB LEDs - -Signed-off-by: Luis Araneda -Signed-off-by: Michal Simek ---- - arch/arm/dts/Makefile | 3 +- - arch/arm/dts/zynq-zybo-z7.dts | 81 +++++ - board/xilinx/zynq/zynq-zybo-z7/ps7_init_gpl.c | 297 ++++++++++++++++++ - configs/zynq_zybo_z7_defconfig | 68 ++++ - 4 files changed, 448 insertions(+), 1 deletion(-) - create mode 100644 arch/arm/dts/zynq-zybo-z7.dts - create mode 100644 board/xilinx/zynq/zynq-zybo-z7/ps7_init_gpl.c - create mode 100644 configs/zynq_zybo_z7_defconfig - ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -145,7 +145,8 @@ dtb-$(CONFIG_ARCH_ZYNQ) += \ - zynq-zc770-xm013.dtb \ - zynq-zed.dtb \ - zynq-zturn.dtb \ -- zynq-zybo.dtb -+ zynq-zybo.dtb \ -+ zynq-zybo-z7.dtb - dtb-$(CONFIG_ARCH_ZYNQMP) += \ - zynqmp-mini-emmc0.dtb \ - zynqmp-mini-emmc1.dtb \ ---- /dev/null -+++ b/arch/arm/dts/zynq-zybo-z7.dts -@@ -0,0 +1,81 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+/* -+ * Copyright (C) 2011 - 2015 Xilinx -+ * Copyright (C) 2012 National Instruments Corp. -+ */ -+/dts-v1/; -+#include "zynq-7000.dtsi" -+#include -+ -+/ { -+ model = "Digilent Zybo Z7 board"; -+ compatible = "digilent,zynq-zybo-z7", "xlnx,zynq-7000"; -+ -+ aliases { -+ ethernet0 = &gem0; -+ serial0 = &uart1; -+ spi0 = &qspi; -+ mmc0 = &sdhci0; -+ }; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x0 0x40000000>; -+ }; -+ -+ chosen { -+ bootargs = ""; -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ gpio-leds { -+ compatible = "gpio-leds"; -+ -+ ld4 { -+ label = "zynq-zybo-z7:green:ld4"; -+ gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ usb_phy0: phy0 { -+ #phy-cells = <0>; -+ compatible = "usb-nop-xceiv"; -+ reset-gpios = <&gpio0 46 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&clkc { -+ ps-clk-frequency = <33333333>; -+}; -+ -+&gem0 { -+ status = "okay"; -+ phy-mode = "rgmii-id"; -+ phy-handle = <ðernet_phy>; -+ -+ ethernet_phy: ethernet-phy@0 { -+ reg = <0>; -+ device_type = "ethernet-phy"; -+ }; -+}; -+ -+&qspi { -+ u-boot,dm-pre-reloc; -+ status = "okay"; -+}; -+ -+&sdhci0 { -+ u-boot,dm-pre-reloc; -+ status = "okay"; -+}; -+ -+&uart1 { -+ u-boot,dm-pre-reloc; -+ status = "okay"; -+}; -+ -+&usb0 { -+ status = "okay"; -+ dr_mode = "host"; -+ usb-phy = <&usb_phy0>; -+}; ---- /dev/null -+++ b/board/xilinx/zynq/zynq-zybo-z7/ps7_init_gpl.c -@@ -0,0 +1,297 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+/* -+ * (c) Copyright 2010-2014 Xilinx, Inc. All rights reserved. -+ * -+ * Procedure to generate this file (using Vivado Webpack 2018.2): -+ * + Install board files from digilent/vivado-boards repository -+ * (commit 6a45981 from 2018-06-05) -+ * + Start Vivado and create a new RTL project with the Zybo-z7-20 board -+ * + Create a block design -+ * - Add "ZYNQ7 Processing System" IP -+ * - Run "Block Automation" (Check "Apply Board Preset") -+ * - Connect ports FCLK_CLK0 and M_AXI_GP0_ACLK -+ * - Save diagram changes -+ * - Go to sources view, select the block diagram, -+ * and select "Generate Output Products" -+ * + Copy the generated "ps7_init_gpl.c" file -+ * + Perform manual editions based on existing Zynq boards -+ * and the checkpatch.pl script -+ * -+ */ -+ -+#include -+ -+static unsigned long ps7_pll_init_data_3_0[] = { -+ EMIT_WRITE(0xF8000008, 0x0000DF0DU), -+ EMIT_MASKWRITE(0xF8000110, 0x003FFFF0U, 0x000FA220U), -+ EMIT_MASKWRITE(0xF8000100, 0x0007F000U, 0x00028000U), -+ EMIT_MASKWRITE(0xF8000100, 0x00000010U, 0x00000010U), -+ EMIT_MASKWRITE(0xF8000100, 0x00000001U, 0x00000001U), -+ EMIT_MASKWRITE(0xF8000100, 0x00000001U, 0x00000000U), -+ EMIT_MASKPOLL(0xF800010C, 0x00000001U), -+ EMIT_MASKWRITE(0xF8000100, 0x00000010U, 0x00000000U), -+ EMIT_MASKWRITE(0xF8000120, 0x1F003F30U, 0x1F000200U), -+ EMIT_MASKWRITE(0xF8000114, 0x003FFFF0U, 0x0012C220U), -+ EMIT_MASKWRITE(0xF8000104, 0x0007F000U, 0x00020000U), -+ EMIT_MASKWRITE(0xF8000104, 0x00000010U, 0x00000010U), -+ EMIT_MASKWRITE(0xF8000104, 0x00000001U, 0x00000001U), -+ EMIT_MASKWRITE(0xF8000104, 0x00000001U, 0x00000000U), -+ EMIT_MASKPOLL(0xF800010C, 0x00000002U), -+ EMIT_MASKWRITE(0xF8000104, 0x00000010U, 0x00000000U), -+ EMIT_MASKWRITE(0xF8000124, 0xFFF00003U, 0x0C200003U), -+ EMIT_MASKWRITE(0xF8000118, 0x003FFFF0U, 0x001452C0U), -+ EMIT_MASKWRITE(0xF8000108, 0x0007F000U, 0x0001E000U), -+ EMIT_MASKWRITE(0xF8000108, 0x00000010U, 0x00000010U), -+ EMIT_MASKWRITE(0xF8000108, 0x00000001U, 0x00000001U), -+ EMIT_MASKWRITE(0xF8000108, 0x00000001U, 0x00000000U), -+ EMIT_MASKPOLL(0xF800010C, 0x00000004U), -+ EMIT_MASKWRITE(0xF8000108, 0x00000010U, 0x00000000U), -+ EMIT_WRITE(0xF8000004, 0x0000767BU), -+ EMIT_EXIT(), -+}; -+ -+static unsigned long ps7_clock_init_data_3_0[] = { -+ EMIT_WRITE(0xF8000008, 0x0000DF0DU), -+ EMIT_MASKWRITE(0xF8000128, 0x03F03F01U, 0x00700F01U), -+ EMIT_MASKWRITE(0xF8000138, 0x00000011U, 0x00000001U), -+ EMIT_MASKWRITE(0xF8000140, 0x03F03F71U, 0x00100801U), -+ EMIT_MASKWRITE(0xF800014C, 0x00003F31U, 0x00000501U), -+ EMIT_MASKWRITE(0xF8000150, 0x00003F33U, 0x00001401U), -+ EMIT_MASKWRITE(0xF8000154, 0x00003F33U, 0x00000A02U), -+ EMIT_MASKWRITE(0xF8000168, 0x00003F31U, 0x00000501U), -+ EMIT_MASKWRITE(0xF8000170, 0x03F03F30U, 0x00400500U), -+ EMIT_MASKWRITE(0xF80001C4, 0x00000001U, 0x00000001U), -+ EMIT_MASKWRITE(0xF800012C, 0x01FFCCCDU, 0x01EC044DU), -+ EMIT_WRITE(0xF8000004, 0x0000767BU), -+ EMIT_EXIT(), -+}; -+ -+static unsigned long ps7_ddr_init_data_3_0[] = { -+ EMIT_MASKWRITE(0xF8006000, 0x0001FFFFU, 0x00000080U), -+ EMIT_MASKWRITE(0xF8006004, 0x0007FFFFU, 0x00001081U), -+ EMIT_MASKWRITE(0xF8006008, 0x03FFFFFFU, 0x03C0780FU), -+ EMIT_MASKWRITE(0xF800600C, 0x03FFFFFFU, 0x02001001U), -+ EMIT_MASKWRITE(0xF8006010, 0x03FFFFFFU, 0x00014001U), -+ EMIT_MASKWRITE(0xF8006014, 0x001FFFFFU, 0x0004281AU), -+ EMIT_MASKWRITE(0xF8006018, 0xF7FFFFFFU, 0x44E458D2U), -+ EMIT_MASKWRITE(0xF800601C, 0xFFFFFFFFU, 0x720238E5U), -+ EMIT_MASKWRITE(0xF8006020, 0x7FDFFFFCU, 0x270872D0U), -+ EMIT_MASKWRITE(0xF8006024, 0x0FFFFFC3U, 0x00000000U), -+ EMIT_MASKWRITE(0xF8006028, 0x00003FFFU, 0x00002007U), -+ EMIT_MASKWRITE(0xF800602C, 0xFFFFFFFFU, 0x00000008U), -+ EMIT_MASKWRITE(0xF8006030, 0xFFFFFFFFU, 0x00040930U), -+ EMIT_MASKWRITE(0xF8006034, 0x13FF3FFFU, 0x000116D4U), -+ EMIT_MASKWRITE(0xF8006038, 0x00000003U, 0x00000000U), -+ EMIT_MASKWRITE(0xF800603C, 0x000FFFFFU, 0x00000777U), -+ EMIT_MASKWRITE(0xF8006040, 0xFFFFFFFFU, 0xFFF00000U), -+ EMIT_MASKWRITE(0xF8006044, 0x0FFFFFFFU, 0x0F666666U), -+ EMIT_MASKWRITE(0xF8006048, 0x0003F03FU, 0x0003C008U), -+ EMIT_MASKWRITE(0xF8006050, 0xFF0F8FFFU, 0x77010800U), -+ EMIT_MASKWRITE(0xF8006058, 0x00010000U, 0x00000000U), -+ EMIT_MASKWRITE(0xF800605C, 0x0000FFFFU, 0x00005003U), -+ EMIT_MASKWRITE(0xF8006060, 0x000017FFU, 0x0000003EU), -+ EMIT_MASKWRITE(0xF8006064, 0x00021FE0U, 0x00020000U), -+ EMIT_MASKWRITE(0xF8006068, 0x03FFFFFFU, 0x00284141U), -+ EMIT_MASKWRITE(0xF800606C, 0x0000FFFFU, 0x00001610U), -+ EMIT_MASKWRITE(0xF8006078, 0x03FFFFFFU, 0x00466111U), -+ EMIT_MASKWRITE(0xF800607C, 0x000FFFFFU, 0x00032222U), -+ EMIT_MASKWRITE(0xF80060A4, 0xFFFFFFFFU, 0x10200802U), -+ EMIT_MASKWRITE(0xF80060A8, 0x0FFFFFFFU, 0x0690CB73U), -+ EMIT_MASKWRITE(0xF80060AC, 0x000001FFU, 0x000001FEU), -+ EMIT_MASKWRITE(0xF80060B0, 0x1FFFFFFFU, 0x1CFFFFFFU), -+ EMIT_MASKWRITE(0xF80060B4, 0x00000200U, 0x00000200U), -+ EMIT_MASKWRITE(0xF80060B8, 0x01FFFFFFU, 0x00200066U), -+ EMIT_MASKWRITE(0xF80060C4, 0x00000003U, 0x00000000U), -+ EMIT_MASKWRITE(0xF80060C8, 0x000000FFU, 0x00000000U), -+ EMIT_MASKWRITE(0xF80060DC, 0x00000001U, 0x00000000U), -+ EMIT_MASKWRITE(0xF80060F0, 0x0000FFFFU, 0x00000000U), -+ EMIT_MASKWRITE(0xF80060F4, 0x0000000FU, 0x00000008U), -+ EMIT_MASKWRITE(0xF8006114, 0x000000FFU, 0x00000000U), -+ EMIT_MASKWRITE(0xF8006118, 0x7FFFFFCFU, 0x40000001U), -+ EMIT_MASKWRITE(0xF800611C, 0x7FFFFFCFU, 0x40000001U), -+ EMIT_MASKWRITE(0xF8006120, 0x7FFFFFCFU, 0x40000001U), -+ EMIT_MASKWRITE(0xF8006124, 0x7FFFFFCFU, 0x40000001U), -+ EMIT_MASKWRITE(0xF800612C, 0x000FFFFFU, 0x00027000U), -+ EMIT_MASKWRITE(0xF8006130, 0x000FFFFFU, 0x00027000U), -+ EMIT_MASKWRITE(0xF8006134, 0x000FFFFFU, 0x00026C00U), -+ EMIT_MASKWRITE(0xF8006138, 0x000FFFFFU, 0x00028800U), -+ EMIT_MASKWRITE(0xF8006140, 0x000FFFFFU, 0x00000035U), -+ EMIT_MASKWRITE(0xF8006144, 0x000FFFFFU, 0x00000035U), -+ EMIT_MASKWRITE(0xF8006148, 0x000FFFFFU, 0x00000035U), -+ EMIT_MASKWRITE(0xF800614C, 0x000FFFFFU, 0x00000035U), -+ EMIT_MASKWRITE(0xF8006154, 0x000FFFFFU, 0x0000007AU), -+ EMIT_MASKWRITE(0xF8006158, 0x000FFFFFU, 0x0000007AU), -+ EMIT_MASKWRITE(0xF800615C, 0x000FFFFFU, 0x0000007CU), -+ EMIT_MASKWRITE(0xF8006160, 0x000FFFFFU, 0x00000073U), -+ EMIT_MASKWRITE(0xF8006168, 0x001FFFFFU, 0x000000F1U), -+ EMIT_MASKWRITE(0xF800616C, 0x001FFFFFU, 0x000000F1U), -+ EMIT_MASKWRITE(0xF8006170, 0x001FFFFFU, 0x000000F0U), -+ EMIT_MASKWRITE(0xF8006174, 0x001FFFFFU, 0x000000F7U), -+ EMIT_MASKWRITE(0xF800617C, 0x000FFFFFU, 0x000000BAU), -+ EMIT_MASKWRITE(0xF8006180, 0x000FFFFFU, 0x000000BAU), -+ EMIT_MASKWRITE(0xF8006184, 0x000FFFFFU, 0x000000BCU), -+ EMIT_MASKWRITE(0xF8006188, 0x000FFFFFU, 0x000000B3U), -+ EMIT_MASKWRITE(0xF8006190, 0x6FFFFEFEU, 0x00040080U), -+ EMIT_MASKWRITE(0xF8006194, 0x000FFFFFU, 0x0001FC82U), -+ EMIT_MASKWRITE(0xF8006204, 0xFFFFFFFFU, 0x00000000U), -+ EMIT_MASKWRITE(0xF8006208, 0x000703FFU, 0x000003FFU), -+ EMIT_MASKWRITE(0xF800620C, 0x000703FFU, 0x000003FFU), -+ EMIT_MASKWRITE(0xF8006210, 0x000703FFU, 0x000003FFU), -+ EMIT_MASKWRITE(0xF8006214, 0x000703FFU, 0x000003FFU), -+ EMIT_MASKWRITE(0xF8006218, 0x000F03FFU, 0x000003FFU), -+ EMIT_MASKWRITE(0xF800621C, 0x000F03FFU, 0x000003FFU), -+ EMIT_MASKWRITE(0xF8006220, 0x000F03FFU, 0x000003FFU), -+ EMIT_MASKWRITE(0xF8006224, 0x000F03FFU, 0x000003FFU), -+ EMIT_MASKWRITE(0xF80062A8, 0x00000FF5U, 0x00000000U), -+ EMIT_MASKWRITE(0xF80062AC, 0xFFFFFFFFU, 0x00000000U), -+ EMIT_MASKWRITE(0xF80062B0, 0x003FFFFFU, 0x00005125U), -+ EMIT_MASKWRITE(0xF80062B4, 0x0003FFFFU, 0x000012A8U), -+ EMIT_MASKPOLL(0xF8000B74, 0x00002000U), -+ EMIT_MASKWRITE(0xF8006000, 0x0001FFFFU, 0x00000081U), -+ EMIT_MASKPOLL(0xF8006054, 0x00000007U), -+ EMIT_EXIT(), -+}; -+ -+static unsigned long ps7_mio_init_data_3_0[] = { -+ EMIT_WRITE(0xF8000008, 0x0000DF0DU), -+ EMIT_MASKWRITE(0xF8000B40, 0x00000FFFU, 0x00000600U), -+ EMIT_MASKWRITE(0xF8000B44, 0x00000FFFU, 0x00000600U), -+ EMIT_MASKWRITE(0xF8000B48, 0x00000FFFU, 0x00000672U), -+ EMIT_MASKWRITE(0xF8000B4C, 0x00000FFFU, 0x00000672U), -+ EMIT_MASKWRITE(0xF8000B50, 0x00000FFFU, 0x00000674U), -+ EMIT_MASKWRITE(0xF8000B54, 0x00000FFFU, 0x00000674U), -+ EMIT_MASKWRITE(0xF8000B58, 0x00000FFFU, 0x00000600U), -+ EMIT_MASKWRITE(0xF8000B5C, 0xFFFFFFFFU, 0x0018C068U), -+ EMIT_MASKWRITE(0xF8000B60, 0xFFFFFFFFU, 0x00F98068U), -+ EMIT_MASKWRITE(0xF8000B64, 0xFFFFFFFFU, 0x00F98068U), -+ EMIT_MASKWRITE(0xF8000B68, 0xFFFFFFFFU, 0x00F98068U), -+ EMIT_MASKWRITE(0xF8000B6C, 0x00007FFFU, 0x00000260U), -+ EMIT_MASKWRITE(0xF8000B70, 0x00000001U, 0x00000001U), -+ EMIT_MASKWRITE(0xF8000B70, 0x00000021U, 0x00000020U), -+ EMIT_MASKWRITE(0xF8000B70, 0x07FEFFFFU, 0x00000823U), -+ EMIT_MASKWRITE(0xF8000700, 0x00003FFFU, 0x00001600U), -+ EMIT_MASKWRITE(0xF8000704, 0x00003FFFU, 0x00001602U), -+ EMIT_MASKWRITE(0xF8000708, 0x00003FFFU, 0x00000602U), -+ EMIT_MASKWRITE(0xF800070C, 0x00003FFFU, 0x00000602U), -+ EMIT_MASKWRITE(0xF8000710, 0x00003FFFU, 0x00000602U), -+ EMIT_MASKWRITE(0xF8000714, 0x00003FFFU, 0x00000602U), -+ EMIT_MASKWRITE(0xF8000718, 0x00003FFFU, 0x00000602U), -+ EMIT_MASKWRITE(0xF800071C, 0x00003FFFU, 0x00000600U), -+ EMIT_MASKWRITE(0xF8000720, 0x00003FFFU, 0x00000602U), -+ EMIT_MASKWRITE(0xF8000724, 0x00003FFFU, 0x00001600U), -+ EMIT_MASKWRITE(0xF8000728, 0x00003FFFU, 0x00001600U), -+ EMIT_MASKWRITE(0xF800072C, 0x00003FFFU, 0x00001600U), -+ EMIT_MASKWRITE(0xF8000730, 0x00003FFFU, 0x00001600U), -+ EMIT_MASKWRITE(0xF8000734, 0x00003FFFU, 0x00001600U), -+ EMIT_MASKWRITE(0xF8000738, 0x00003FFFU, 0x00001600U), -+ EMIT_MASKWRITE(0xF800073C, 0x00003FFFU, 0x00001600U), -+ EMIT_MASKWRITE(0xF8000740, 0x00003FFFU, 0x00001302U), -+ EMIT_MASKWRITE(0xF8000744, 0x00003FFFU, 0x00001302U), -+ EMIT_MASKWRITE(0xF8000748, 0x00003FFFU, 0x00001302U), -+ EMIT_MASKWRITE(0xF800074C, 0x00003FFFU, 0x00001302U), -+ EMIT_MASKWRITE(0xF8000750, 0x00003FFFU, 0x00001302U), -+ EMIT_MASKWRITE(0xF8000754, 0x00003FFFU, 0x00001302U), -+ EMIT_MASKWRITE(0xF8000758, 0x00003FFFU, 0x00001303U), -+ EMIT_MASKWRITE(0xF800075C, 0x00003FFFU, 0x00001303U), -+ EMIT_MASKWRITE(0xF8000760, 0x00003FFFU, 0x00001303U), -+ EMIT_MASKWRITE(0xF8000764, 0x00003FFFU, 0x00001303U), -+ EMIT_MASKWRITE(0xF8000768, 0x00003FFFU, 0x00001303U), -+ EMIT_MASKWRITE(0xF800076C, 0x00003FFFU, 0x00001303U), -+ EMIT_MASKWRITE(0xF8000770, 0x00003FFFU, 0x00001304U), -+ EMIT_MASKWRITE(0xF8000774, 0x00003FFFU, 0x00001305U), -+ EMIT_MASKWRITE(0xF8000778, 0x00003FFFU, 0x00001304U), -+ EMIT_MASKWRITE(0xF800077C, 0x00003FFFU, 0x00001305U), -+ EMIT_MASKWRITE(0xF8000780, 0x00003FFFU, 0x00001304U), -+ EMIT_MASKWRITE(0xF8000784, 0x00003FFFU, 0x00001304U), -+ EMIT_MASKWRITE(0xF8000788, 0x00003FFFU, 0x00001304U), -+ EMIT_MASKWRITE(0xF800078C, 0x00003FFFU, 0x00001304U), -+ EMIT_MASKWRITE(0xF8000790, 0x00003FFFU, 0x00001305U), -+ EMIT_MASKWRITE(0xF8000794, 0x00003FFFU, 0x00001304U), -+ EMIT_MASKWRITE(0xF8000798, 0x00003FFFU, 0x00001304U), -+ EMIT_MASKWRITE(0xF800079C, 0x00003FFFU, 0x00001304U), -+ EMIT_MASKWRITE(0xF80007A0, 0x00003FFFU, 0x00001280U), -+ EMIT_MASKWRITE(0xF80007A4, 0x00003FFFU, 0x00001280U), -+ EMIT_MASKWRITE(0xF80007A8, 0x00003FFFU, 0x00001280U), -+ EMIT_MASKWRITE(0xF80007AC, 0x00003FFFU, 0x00001280U), -+ EMIT_MASKWRITE(0xF80007B0, 0x00003FFFU, 0x00001280U), -+ EMIT_MASKWRITE(0xF80007B4, 0x00003FFFU, 0x00001280U), -+ EMIT_MASKWRITE(0xF80007B8, 0x00003FFFU, 0x00001200U), -+ EMIT_MASKWRITE(0xF80007BC, 0x00003F01U, 0x00001201U), -+ EMIT_MASKWRITE(0xF80007C0, 0x00003FFFU, 0x000012E0U), -+ EMIT_MASKWRITE(0xF80007C4, 0x00003FFFU, 0x000012E1U), -+ EMIT_MASKWRITE(0xF80007C8, 0x00003FFFU, 0x00001200U), -+ EMIT_MASKWRITE(0xF80007CC, 0x00003FFFU, 0x00001200U), -+ EMIT_MASKWRITE(0xF80007D0, 0x00003FFFU, 0x00001280U), -+ EMIT_MASKWRITE(0xF80007D4, 0x00003FFFU, 0x00001280U), -+ EMIT_MASKWRITE(0xF8000830, 0x003F003FU, 0x002F0037U), -+ EMIT_WRITE(0xF8000004, 0x0000767BU), -+ EMIT_EXIT(), -+}; -+ -+static unsigned long ps7_peripherals_init_data_3_0[] = { -+ EMIT_WRITE(0xF8000008, 0x0000DF0DU), -+ EMIT_MASKWRITE(0xF8000B48, 0x00000180U, 0x00000180U), -+ EMIT_MASKWRITE(0xF8000B4C, 0x00000180U, 0x00000180U), -+ EMIT_MASKWRITE(0xF8000B50, 0x00000180U, 0x00000180U), -+ EMIT_MASKWRITE(0xF8000B54, 0x00000180U, 0x00000180U), -+ EMIT_WRITE(0xF8000004, 0x0000767BU), -+ EMIT_MASKWRITE(0xE0001034, 0x000000FFU, 0x00000006U), -+ EMIT_MASKWRITE(0xE0001018, 0x0000FFFFU, 0x0000007CU), -+ EMIT_MASKWRITE(0xE0001000, 0x000001FFU, 0x00000017U), -+ EMIT_MASKWRITE(0xE0001004, 0x000003FFU, 0x00000020U), -+ EMIT_MASKWRITE(0xE000D000, 0x00080000U, 0x00080000U), -+ EMIT_MASKWRITE(0xF8007000, 0x20000000U, 0x00000000U), -+ EMIT_MASKWRITE(0xE000A244, 0x003FFFFFU, 0x00004000U), -+ EMIT_MASKWRITE(0xE000A008, 0xFFFFFFFFU, 0xBFFF4000U), -+ EMIT_MASKWRITE(0xE000A248, 0x003FFFFFU, 0x00004000U), -+ EMIT_MASKWRITE(0xE000A008, 0xFFFFFFFFU, 0xBFFF0000U), -+ EMIT_MASKDELAY(0xF8F00200, 1), -+ EMIT_MASKWRITE(0xE000A008, 0xFFFFFFFFU, 0xBFFF4000U), -+ EMIT_EXIT(), -+}; -+ -+static unsigned long ps7_post_config_3_0[] = { -+ EMIT_WRITE(0xF8000008, 0x0000DF0DU), -+ EMIT_MASKWRITE(0xF8000900, 0x0000000FU, 0x0000000FU), -+ EMIT_MASKWRITE(0xF8000240, 0xFFFFFFFFU, 0x00000000U), -+ EMIT_WRITE(0xF8000004, 0x0000767BU), -+ EMIT_EXIT(), -+}; -+ -+int ps7_post_config(void) -+{ -+ int ret = -1; -+ -+ ret = ps7_config(ps7_post_config_3_0); -+ if (ret != PS7_INIT_SUCCESS) -+ return ret; -+ -+ return PS7_INIT_SUCCESS; -+} -+ -+int ps7_init(void) -+{ -+ int ret; -+ -+ ret = ps7_config(ps7_mio_init_data_3_0); -+ if (ret != PS7_INIT_SUCCESS) -+ return ret; -+ -+ ret = ps7_config(ps7_pll_init_data_3_0); -+ if (ret != PS7_INIT_SUCCESS) -+ return ret; -+ -+ ret = ps7_config(ps7_clock_init_data_3_0); -+ if (ret != PS7_INIT_SUCCESS) -+ return ret; -+ -+ ret = ps7_config(ps7_ddr_init_data_3_0); -+ if (ret != PS7_INIT_SUCCESS) -+ return ret; -+ -+ ret = ps7_config(ps7_peripherals_init_data_3_0); -+ if (ret != PS7_INIT_SUCCESS) -+ return ret; -+ -+ return PS7_INIT_SUCCESS; -+} ---- /dev/null -+++ b/configs/zynq_zybo_z7_defconfig -@@ -0,0 +1,68 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_ZYNQ=y -+CONFIG_SYS_TEXT_BASE=0x4000000 -+CONFIG_SPL=y -+CONFIG_DEBUG_UART_BASE=0xe0001000 -+CONFIG_DEBUG_UART_CLOCK=50000000 -+CONFIG_SPL_STACK_R_ADDR=0x200000 -+CONFIG_DEFAULT_DEVICE_TREE="zynq-zybo-z7" -+CONFIG_DEBUG_UART=y -+CONFIG_DISTRO_DEFAULTS=y -+CONFIG_FIT=y -+CONFIG_FIT_SIGNATURE=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_IMAGE_FORMAT_LEGACY=y -+CONFIG_BOOTCOMMAND="run $modeboot || run distro_bootcmd" -+CONFIG_SPL_STACK_R=y -+CONFIG_SPL_OS_BOOT=y -+CONFIG_SPL_SPI_LOAD=y -+CONFIG_SYS_PROMPT="Zynq> " -+CONFIG_CMD_THOR_DOWNLOAD=y -+CONFIG_CMD_DFU=y -+# CONFIG_CMD_FLASH is not set -+CONFIG_CMD_FPGA_LOADBP=y -+CONFIG_CMD_FPGA_LOADFS=y -+CONFIG_CMD_FPGA_LOADMK=y -+CONFIG_CMD_FPGA_LOADP=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_I2C=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_SF=y -+CONFIG_CMD_USB=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_TFTPPUT=y -+CONFIG_CMD_CACHE=y -+CONFIG_CMD_EXT4_WRITE=y -+CONFIG_ENV_IS_IN_SPI_FLASH=y -+CONFIG_NET_RANDOM_ETHADDR=y -+CONFIG_SPL_DM_SEQ_ALIAS=y -+CONFIG_DFU_MMC=y -+CONFIG_DFU_RAM=y -+CONFIG_FPGA_XILINX=y -+CONFIG_FPGA_ZYNQPL=y -+CONFIG_DM_GPIO=y -+CONFIG_SYS_I2C_ZYNQ=y -+CONFIG_ZYNQ_I2C0=y -+CONFIG_ZYNQ_I2C1=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_ZYNQ=y -+CONFIG_SPI_FLASH=y -+CONFIG_SPI_FLASH_BAR=y -+CONFIG_SPI_FLASH_SPANSION=y -+CONFIG_PHY_REALTEK=y -+CONFIG_ZYNQ_GEM=y -+CONFIG_DEBUG_UART_ZYNQ=y -+CONFIG_ZYNQ_SERIAL=y -+CONFIG_ZYNQ_QSPI=y -+CONFIG_USB=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_ULPI_VIEWPORT=y -+CONFIG_USB_ULPI=y -+CONFIG_USB_STORAGE=y -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_MANUFACTURER="Xilinx" -+CONFIG_USB_GADGET_VENDOR_NUM=0x03fd -+CONFIG_USB_GADGET_PRODUCT_NUM=0x0300 -+CONFIG_CI_UDC=y -+CONFIG_USB_GADGET_DOWNLOAD=y -+CONFIG_USB_FUNCTION_THOR=y diff --git a/package/boot/uboot-zynq/patches/110-zybo-z7-read-mac-address-from-SPI-flash-memory.patch b/package/boot/uboot-zynq/patches/110-zybo-z7-read-mac-address-from-SPI-flash-memory.patch index f0ebc3323..00dce9a02 100644 --- a/package/boot/uboot-zynq/patches/110-zybo-z7-read-mac-address-from-SPI-flash-memory.patch +++ b/package/boot/uboot-zynq/patches/110-zybo-z7-read-mac-address-from-SPI-flash-memory.patch @@ -1,7 +1,7 @@ -From ac8fcc92d87436715ce85f39a4fe4f07c3bfa15e Mon Sep 17 00:00:00 2001 +From 67db0da72eb7ed87ebaaeb8a26891cb2cf916500 Mon Sep 17 00:00:00 2001 From: Luis Araneda -Date: Sun, 22 Jul 2018 02:52:41 -0400 -Subject: [U-Boot] [RFC PATCH] arm: zynq: read mac address from SPI flash memory +Date: Sun, 21 Jul 2019 23:24:12 -0400 +Subject: [U-Boot] [PATCH] arm: zynq: read mac address from SPI flash memory Implement a method for reading the MAC address from an SPI flash memory. @@ -11,38 +11,34 @@ memory Signed-off-by: Luis Araneda --- -As of 2018-08-23, this patch has been sent to U-Boot's mailing list -and is being reviewed. Some changes on the implementation are expected, -but the functionality should not change +As of 2019-08-18, this patch has not been accepted by upstream U-Boot. +Keep this patch until an alternative is accepted by upstream. --- - board/xilinx/zynq/board.c | 28 ++++++++++++++++++++++++++++ + board/xilinx/common/board.c | 28 ++++++++++++++++++++++++++++ configs/zynq_zybo_z7_defconfig | 3 +++ drivers/misc/Kconfig | 17 +++++++++++++++++ 3 files changed, 48 insertions(+) ---- a/board/xilinx/zynq/board.c -+++ b/board/xilinx/zynq/board.c -@@ -6,9 +6,12 @@ +--- a/board/xilinx/common/board.c ++++ b/board/xilinx/common/board.c +@@ -6,7 +6,10 @@ #include #include +#include +#include - #include - #include - #include + #include +#include - #include - #include - #include -@@ -83,6 +86,31 @@ int zynq_board_read_rom_ethaddr(unsigned - printf("I2C EEPROM MAC address read failed\n"); + + int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) + { +@@ -34,5 +37,30 @@ int zynq_board_read_rom_ethaddr(unsigned + debug("%s: I2C EEPROM MAC %pM\n", __func__, ethaddr); #endif +#if defined(CONFIG_MAC_ADDR_IN_SPI_FLASH) + struct spi_flash *flash; + struct udevice *dev; -+ int ret; + + ret = spi_flash_probe_bus_cs(CONFIG_SF_DEFAULT_BUS, + CONFIG_SF_DEFAULT_CS, @@ -55,7 +51,7 @@ but the functionality should not change + } + + flash = dev_get_uclass_priv(dev); -+ flash->read_cmd = CONFIG_MAC_ADDR_SPI_FLASH_READ_CMD; ++ flash->read_opcode = CONFIG_MAC_ADDR_SPI_FLASH_READ_CMD; + + if (spi_flash_read_dm(dev, + CONFIG_MAC_ADDR_SPI_FLASH_DATA_OFFSET, @@ -64,15 +60,15 @@ but the functionality should not change + + device_remove(dev, DM_REMOVE_NORMAL); +#endif - return 0; ++ + return ret; } - --- a/configs/zynq_zybo_z7_defconfig +++ b/configs/zynq_zybo_z7_defconfig -@@ -44,6 +44,9 @@ CONFIG_DM_GPIO=y - CONFIG_SYS_I2C_ZYNQ=y - CONFIG_ZYNQ_I2C0=y - CONFIG_ZYNQ_I2C1=y +@@ -42,6 +42,9 @@ CONFIG_DFU_RAM=y + CONFIG_FPGA_XILINX=y + CONFIG_FPGA_ZYNQPL=y + CONFIG_DM_GPIO=y +CONFIG_MAC_ADDR_IN_SPI_FLASH=y +CONFIG_MAC_ADDR_SPI_FLASH_READ_CMD=0x4b +CONFIG_MAC_ADDR_SPI_FLASH_DATA_OFFSET=0x20 @@ -81,7 +77,7 @@ but the functionality should not change CONFIG_SPI_FLASH=y --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig -@@ -272,6 +272,23 @@ config SYS_I2C_EEPROM_ADDR_OVERFLOW +@@ -366,6 +366,23 @@ config SYS_I2C_EEPROM_ADDR_OVERFLOW endif diff --git a/package/boot/uboot-zynq/patches/210-link-libcrypto-static.patch b/package/boot/uboot-zynq/patches/210-link-libcrypto-static.patch index 6fe253606..d2e7bf168 100644 --- a/package/boot/uboot-zynq/patches/210-link-libcrypto-static.patch +++ b/package/boot/uboot-zynq/patches/210-link-libcrypto-static.patch @@ -3,9 +3,9 @@ needed dependencies are added too. --- a/tools/Makefile +++ b/tools/Makefile -@@ -146,7 +146,7 @@ endif - # MXSImage needs LibSSL - ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CONFIG_ARMADA_38X)$(CONFIG_ARMADA_39X)$(CONFIG_FIT_SIGNATURE),) +@@ -151,7 +151,7 @@ ifneq ($(CONFIG_MX23)$(CONFIG_MX28)$(CON + HOSTCFLAGS_kwbimage.o += \ + $(shell pkg-config --cflags libssl libcrypto 2> /dev/null || echo "") HOSTLOADLIBES_mkimage += \ - $(shell pkg-config --libs libssl libcrypto 2> /dev/null || echo "-lssl -lcrypto") + $(shell pkg-config --libs --static libssl libcrypto 2> /dev/null || echo "-lssl -lpthread -lcrypto") diff --git a/package/boot/yamonenv/Makefile b/package/boot/yamonenv/Makefile deleted file mode 100644 index ef1f36de6..000000000 --- a/package/boot/yamonenv/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright (C) 2006 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=yamonenv -PKG_VERSION:=20051022 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)_gruen.4g__$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://downloads.openwrt.org/sources -PKG_HASH:=466eca9cdad2c15e957fb9ce7d0b6927ecd17d85c4cc2dff37e97a3e6b209c67 - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) - -PKG_FLAGS:=nonshared - -include $(INCLUDE_DIR)/package.mk - -define Package/yamonenv - SECTION:=utils - CATEGORY:=Utilities - SUBMENU:=Boot Loaders - DEPENDS:=@TARGET_au1000 - TITLE:=YAMON configuration utility - MAINTAINER:=Florian Fainelli -endef - -define Build/Configure -endef - -define Package/yamonenv/install - $(INSTALL_DIR) $(1)/usr/sbin - $(CP) $(PKG_BUILD_DIR)/src/$(PKG_NAME) $(1)/usr/sbin/ -endef - -$(eval $(call BuildPackage,yamonenv)) diff --git a/package/boot/yamonenv/patches/001-yamonenv_mtd_partition.patch b/package/boot/yamonenv/patches/001-yamonenv_mtd_partition.patch deleted file mode 100644 index e1def28af..000000000 --- a/package/boot/yamonenv/patches/001-yamonenv_mtd_partition.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/yamonenv.c -+++ b/src/yamonenv.c -@@ -12,7 +12,7 @@ - #include - #include - --#define DEFAULT_YAMON_ENV_FILE "/dev/mtd/3" -+#define DEFAULT_YAMON_ENV_FILE "/dev/mtd3" - - - // control byte definitions: diff --git a/package/kernel/linux/modules/hwmon.mk b/package/kernel/linux/modules/hwmon.mk index e79304b4f..31836fbce 100644 --- a/package/kernel/linux/modules/hwmon.mk +++ b/package/kernel/linux/modules/hwmon.mk @@ -257,6 +257,21 @@ endef $(eval $(call KernelPackage,hwmon-ltc4151)) +define KernelPackage/hwmon-mcp3021 + TITLE:=MCP3021/3221 monitoring support + KCONFIG:=CONFIG_SENSORS_MCP3021 + FILES:=$(LINUX_DIR)/drivers/hwmon/mcp3021.ko + AUTOLOAD:=$(call AutoProbe,mcp3021) + $(call AddDepends/hwmon,+kmod-i2c-core) +endef + +define KernelPackage/hwmon-mcp3021/description + Kernel module for Linear Technology MCP3021/3221 current and voltage monitor chip +endef + +$(eval $(call KernelPackage,hwmon-mcp3021)) + + define KernelPackage/hwmon-nct6775 TITLE:=NCT6106D/6775F/6776F/6779D/6791D/6792D/6793D and compatibles monitoring support KCONFIG:=CONFIG_SENSORS_NCT6775 diff --git a/scripts/download.pl b/scripts/download.pl index 017e952b2..fb4c488f4 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -194,9 +194,11 @@ foreach my $mirror (@ARGV) { push @mirrors, "https://downloads.sourceforge.net/$1"; } } elsif ($mirror =~ /^\@APACHE\/(.+)$/) { + push @mirrors, "https://mirrors.ustc.edu.cn/apache/$1"; push @mirrors, "https://mirror.netcologne.de/apache.org/$1"; push @mirrors, "https://mirror.aarnet.edu.au/pub/apache/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/apache/$1"; + push @mirrors, "https://archive.apache.org/dist/$1"; push @mirrors, "http://mirror.cogentco.com/pub/apache/$1"; push @mirrors, "http://mirror.navercorp.com/apache/$1"; push @mirrors, "http://ftp.jaist.ac.jp/pub/apache/$1"; @@ -212,6 +214,7 @@ foreach my $mirror (@ARGV) { push @mirrors, "https://raw.githubusercontent.com/$dir"; } } elsif ($mirror =~ /^\@GNU\/(.+)$/) { + push @mirrors, "https://mirrors.ustc.edu.cn/gnu/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnu/$1"; push @mirrors, "https://mirror.netcologne.de/gnu/$1"; push @mirrors, "http://ftp.kddilabs.jp/GNU/gnu/$1"; @@ -235,19 +238,20 @@ foreach my $mirror (@ARGV) { push @extra, "$extra[0]/testing"; } elsif ($filename =~ /linux-(\d+\.\d+(?:\.\d+)?)/) { push @extra, "$extra[0]/longterm/v$1"; - } + } foreach my $dir (@extra) { - push @mirrors, "http://mirrors.ustc.edu.cn/kernel.org/$dir"; + push @mirrors, "https://mirrors.ustc.edu.cn/kernel.org/$dir"; push @mirrors, "https://cdn.kernel.org/pub/$dir"; - push @mirrors, "https://mirror.rackspace.com/kernel.org/$dir"; - push @mirrors, "http://download.xs4all.nl/ftp.kernel.org/pub/$dir"; - push @mirrors, "http://mirrors.mit.edu/kernel/$dir"; + push @mirrors, "https://mirror.rackspace.com/kernel.org/pub/$dir"; + push @mirrors, "https://download.xs4all.nl/ftp.kernel.org/pub/$dir"; + push @mirrors, "https://mirrors.mit.edu/kernel/$dir"; push @mirrors, "http://ftp.nara.wide.ad.jp/pub/kernel.org/$dir"; push @mirrors, "http://www.ring.gr.jp/archives/linux/kernel.org/$dir"; push @mirrors, "ftp://ftp.riken.jp/Linux/kernel.org/$dir"; push @mirrors, "ftp://www.mirrorservice.org/sites/ftp.kernel.org/pub/$dir"; } } elsif ($mirror =~ /^\@GNOME\/(.+)$/) { + push @mirrors, "https://mirrors.ustc.edu.cn/gnome/sources/$1"; push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnome/sources/$1"; push @mirrors, "http://ftp.acc.umu.se/pub/GNOME/sources/$1"; push @mirrors, "http://ftp.kaist.ac.kr/gnome/sources/$1"; @@ -263,9 +267,8 @@ foreach my $mirror (@ARGV) { } #push @mirrors, 'https://mirror1.openwrt.org'; -push @mirrors, 'https://sources.lede-project.org'; +push @mirrors, 'https://sources.openwrt.org'; push @mirrors, 'https://mirror2.openwrt.org/sources'; -push @mirrors, 'https://downloads.openwrt.org/sources'; while (!-f "$target/$filename") { my $mirror = shift @mirrors; @@ -275,4 +278,3 @@ while (!-f "$target/$filename") { } $SIG{INT} = \&cleanup; - diff --git a/scripts/json_add_image_info.py b/scripts/json_add_image_info.py old mode 100644 new mode 100755 index fe498b773..44b4031f8 --- a/scripts/json_add_image_info.py +++ b/scripts/json_add_image_info.py @@ -1,1156 +1,55 @@ +#!/usr/bin/env python3 +import json +import os +import hashlib +def e(variable, default=None): + return os.environ.get(variable, default) +json_path = "{}{}{}.json".format(e("BIN_DIR"), os.sep, e("IMAGE_PREFIX")) - - - - - - - - - - - +with open(os.path.join(e("BIN_DIR"), e("IMAGE_NAME")), "rb") as image_file: + image_hash = hashlib.sha256(image_file.read()).hexdigest() +def get_titles(): + titles = [] + for prefix in ["", "ALT0_", "ALT1_", "ALT2_"]: + title = {} + for var in ["vendor", "model", "variant"]: + if e("DEVICE_{}{}".format(prefix, var.upper())): + title[var] = e("DEVICE_{}{}".format(prefix, var.upper())) - - - - - - - + if title: + titles.append(title) - - - openwrt/json_add_image_info.py at master · openwrt/openwrt · GitHub - - - - + if not titles: + titles.append({"title": e("DEVICE_TITLE")}) - - + return titles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content - - - - - - - - - - - -
- -
- - -
- -
- - - -
-
-
- - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - Permalink - - - - - -
- - -
- - Branch: - master - - - - - - - -
- -
- - Find file - - - Copy path - -
-
- - -
- - Find file - - - Copy path - -
-
- - - - -
-
- - @aparcar - aparcar - - build: create JSON files containing image info - - - - 881ed09 - Sep 29, 2019 - -
- -
-
- - 1 contributor - - -
- -

- Users who have contributed to this file -

-
- -
-
-
-
- - - - - -
- -
-
- - executable file - - 56 lines (40 sloc) - - 1.53 KB -
- -
- -
- Raw - Blame - History -
- - -
- - - -
-
-
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#!/usr/bin/env python3
-
import json
import os
import hashlib
-
-
def e(variable, default=None):
return os.environ.get(variable, default)
-
-
json_path = "{}{}{}.json".format(e("BIN_DIR"), os.sep, e("IMAGE_PREFIX"))
-
with open(os.path.join(e("BIN_DIR"), e("IMAGE_NAME")), "rb") as image_file:
image_hash = hashlib.sha256(image_file.read()).hexdigest()
-
-
def get_titles():
titles = []
for prefix in ["", "ALT0_", "ALT1_", "ALT2_"]:
title = {}
for var in ["vendor", "model", "variant"]:
if e("DEVICE_{}{}".format(prefix, var.upper())):
title[var] = e("DEVICE_{}{}".format(prefix, var.upper()))
-
if title:
titles.append(title)
-
if not titles:
titles.append({"title": e("DEVICE_TITLE")})
-
return titles
-
-
if not os.path.exists(json_path):
device_info = {
"id": e("DEVICE_ID"),
"image_prefix": e("IMAGE_PREFIX"),
"images": [],
"metadata_version": 1,
"supported_devices": e("SUPPORTED_DEVICES").split(),
"target": "{}/{}".format(e("TARGET"), e("SUBTARGET", "generic")),
"titles": get_titles(),
"version_commit": e("VERSION_CODE"),
"version_number": e("VERSION_NUMBER"),
}
else:
with open(json_path, "r") as json_file:
device_info = json.load(json_file)
-
image_info = {"type": e("IMAGE_TYPE"), "name": e("IMAGE_NAME"), "sha256": image_hash}
device_info["images"].append(image_info)
-
with open(json_path, "w") as json_file:
json.dump(device_info, json_file, sort_keys=True, indent=" ")
- - - -
- -
- - - -
- - -
- - -
-
- - - -
-
- -
-
- - -
- - - - - - -
- - - You can’t perform that action at this time. -
- - - - - - - - - - - - - - -
- - - +image_info = {"type": e("IMAGE_TYPE"), "name": e("IMAGE_NAME"), "sha256": image_hash} +device_info["images"].append(image_info) +with open(json_path, "w") as json_file: + json.dump(device_info, json_file, sort_keys=True, indent=" ") diff --git a/target/linux/apm821xx/patches-4.14/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch b/target/linux/apm821xx/patches-4.14/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch deleted file mode 100644 index d2c384882..000000000 --- a/target/linux/apm821xx/patches-4.14/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6e88098ca43a3d80ae86908f7badba683c8a0d84 Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Wed, 23 Jan 2019 11:24:18 +0000 -Subject: [PATCH 07/15] crypto: crypto4xx - Fix wrong - ppc4xx_trng_probe()/ppc4xx_trng_remove() arguments - -When building without CONFIG_HW_RANDOM_PPC4XX, I hit the following build failure: -drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_probe': -drivers/crypto/amcc/crypto4xx_core.c:1407:20: error: passing argument 1 of 'ppc4xx_trng_probe' from incompatible pointer type [-Werror=incompatible-pointer-types] -In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0: -drivers/crypto/amcc/crypto4xx_trng.h:28:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *' -drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_remove': -drivers/crypto/amcc/crypto4xx_core.c:1434:21: error: passing argument 1 of 'ppc4xx_trng_remove' from incompatible pointer type [-Werror=incompatible-pointer-types] -In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0: -drivers/crypto/amcc/crypto4xx_trng.h:30:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *' - -This patch fix the needed argument of ppc4xx_trng_probe()/ppc4xx_trng_remove() in that case. - -Fixes: 5343e674f32f ("crypto4xx: integrate ppc4xx-rng into crypto4xx") -Signed-off-by: Corentin Labbe -Signed-off-by: Herbert Xu ---- - drivers/crypto/amcc/crypto4xx_trng.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/crypto/amcc/crypto4xx_trng.h -+++ b/drivers/crypto/amcc/crypto4xx_trng.h -@@ -26,9 +26,9 @@ void ppc4xx_trng_probe(struct crypto4xx_ - void ppc4xx_trng_remove(struct crypto4xx_core_device *core_dev); - #else - static inline void ppc4xx_trng_probe( -- struct crypto4xx_device *dev __maybe_unused) { } -+ struct crypto4xx_core_device *dev __maybe_unused) { } - static inline void ppc4xx_trng_remove( -- struct crypto4xx_device *dev __maybe_unused) { } -+ struct crypto4xx_core_device *dev __maybe_unused) { } - #endif - - #endif diff --git a/target/linux/apm821xx/patches-4.19/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch b/target/linux/apm821xx/patches-4.19/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch deleted file mode 100644 index d2c384882..000000000 --- a/target/linux/apm821xx/patches-4.19/023-0007-crypto-crypto4xx-Fix-wrong-ppc4xx_trng_probe-ppc4xx_.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6e88098ca43a3d80ae86908f7badba683c8a0d84 Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Wed, 23 Jan 2019 11:24:18 +0000 -Subject: [PATCH 07/15] crypto: crypto4xx - Fix wrong - ppc4xx_trng_probe()/ppc4xx_trng_remove() arguments - -When building without CONFIG_HW_RANDOM_PPC4XX, I hit the following build failure: -drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_probe': -drivers/crypto/amcc/crypto4xx_core.c:1407:20: error: passing argument 1 of 'ppc4xx_trng_probe' from incompatible pointer type [-Werror=incompatible-pointer-types] -In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0: -drivers/crypto/amcc/crypto4xx_trng.h:28:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *' -drivers/crypto/amcc/crypto4xx_core.c: In function 'crypto4xx_remove': -drivers/crypto/amcc/crypto4xx_core.c:1434:21: error: passing argument 1 of 'ppc4xx_trng_remove' from incompatible pointer type [-Werror=incompatible-pointer-types] -In file included from drivers/crypto/amcc/crypto4xx_core.c:50:0: -drivers/crypto/amcc/crypto4xx_trng.h:30:20: note: expected 'struct crypto4xx_device *' but argument is of type 'struct crypto4xx_core_device *' - -This patch fix the needed argument of ppc4xx_trng_probe()/ppc4xx_trng_remove() in that case. - -Fixes: 5343e674f32f ("crypto4xx: integrate ppc4xx-rng into crypto4xx") -Signed-off-by: Corentin Labbe -Signed-off-by: Herbert Xu ---- - drivers/crypto/amcc/crypto4xx_trng.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/crypto/amcc/crypto4xx_trng.h -+++ b/drivers/crypto/amcc/crypto4xx_trng.h -@@ -26,9 +26,9 @@ void ppc4xx_trng_probe(struct crypto4xx_ - void ppc4xx_trng_remove(struct crypto4xx_core_device *core_dev); - #else - static inline void ppc4xx_trng_probe( -- struct crypto4xx_device *dev __maybe_unused) { } -+ struct crypto4xx_core_device *dev __maybe_unused) { } - static inline void ppc4xx_trng_remove( -- struct crypto4xx_device *dev __maybe_unused) { } -+ struct crypto4xx_core_device *dev __maybe_unused) { } - #endif - - #endif diff --git a/target/linux/ath79/dts/ar7161_netgear_wndr3700v2.dts b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts similarity index 85% rename from target/linux/ath79/dts/ar7161_netgear_wndr3700v2.dts rename to target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts index 76ef300a8..f3d27f2bd 100644 --- a/target/linux/ath79/dts/ar7161_netgear_wndr3700v2.dts +++ b/target/linux/ath79/dts/ar7161_netgear_wndr3700-v2.dts @@ -4,8 +4,8 @@ #include "ar7161_netgear_wndr3700.dtsi" / { - compatible = "netgear,wndr3700v2", "qca,ar7161"; - model = "Netgear WNDR3700v2"; + compatible = "netgear,wndr3700-v2", "qca,ar7161"; + model = "Netgear WNDR3700 v2"; }; &partitions { diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts new file mode 100644 index 000000000..d1c2628d8 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e560ac.dts @@ -0,0 +1,174 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "comfast,cf-e560ac", "qca,qca9531"; + model = "COMFAST CF-E560AC"; + + aliases { + serial0 = &uart; + label-mac-device = ð1; + led-boot = &led_system; + led-failsafe = &led_system; + led-upgrade = &led_system; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + lan1 { + label = "cf-e560ac:blue:lan1"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "cf-e560ac:blue:lan2"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "cf-e560ac:blue:lan3"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "cf-e560ac:blue:lan4"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + led_system: system { + label = "cf-e560ac:blue:system"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "cf-e560ac:blue:wan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "cf-e560ac:blue:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + hw_algo = "toggle"; + hw_margin_ms = <1200>; + always-running; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x010000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x010000 0x010000>; + read-only; + }; + + partition@20000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x020000 0xfc0000>; + }; + + partition@fe0000 { + label = "configs"; + reg = <0xfe0000 0x010000>; + read-only; + }; + + partition@ff0000 { + label = "nvram"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&usb0 { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <1>; +}; + +ð1 { + mtd-mac-address = <&art 0x0>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + mtd-mac-address = <&art 0x0>; + mtd-mac-address-increment = <10>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 15a467ccc..55d677252 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -73,6 +73,13 @@ comfast,cf-e5) ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "$boardname:blue:rssi1" "wlan0" "33" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:blue:rssi2" "wlan0" "66" "100" ;; +comfast,cf-e560ac) + ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "$boardname:blue:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "$boardname:blue:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "$boardname:blue:lan3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "$boardname:blue:lan4" "switch0" "0x10" + ;; dlink,dir-842-c1|\ dlink,dir-842-c2|\ dlink,dir-842-c3|\ diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 4630cf844..a3fcf3571 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -103,6 +103,13 @@ ath79_setup_interfaces() ubnt,routerstation) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; + comfast,cf-e560ac|\ + tplink,archer-c60-v1|\ + tplink,archer-c60-v2) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" + ;; comfast,cf-wr650ac-v1|\ comfast,cf-wr650ac-v2) ucidef_add_switch "switch0" \ @@ -180,7 +187,7 @@ ath79_setup_interfaces() "0@eth0" "2:lan" "3:lan" "4:lan" "1:wan" ;; netgear,wndr3700|\ - netgear,wndr3700v2|\ + netgear,wndr3700-v2|\ netgear,wndr3800|\ netgear,wndr3800ch) ucidef_set_interface_wan "eth1" @@ -228,12 +235,6 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan" ;; - tplink,archer-c60-v1|\ - tplink,archer-c60-v2) - ucidef_set_interface_wan "eth1" - ucidef_add_switch "switch0" \ - "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" - ;; tplink,archer-d50-v1) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "1:wan" @@ -386,7 +387,7 @@ ath79_setup_macs() label_mac=$wan_mac ;; netgear,wndr3700|\ - netgear,wndr3700v2|\ + netgear,wndr3700-v2|\ netgear,wndr3800) lan_mac=$(macaddr_setbit_la "$(mtd_get_mac_binary art 0x0)") ;; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 8a915cec4..b43146ca3 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -187,7 +187,7 @@ case "$FIRMWARE" in case $board in buffalo,wzr-hp-ag300h|\ netgear,wndr3700|\ - netgear,wndr3700v2|\ + netgear,wndr3700-v2|\ netgear,wndr3800|\ netgear,wndr3800ch) ath9k_eeprom_extract "art" 0x1000 0xeb8 @@ -205,7 +205,7 @@ case "$FIRMWARE" in case $board in buffalo,wzr-hp-ag300h|\ netgear,wndr3700|\ - netgear,wndr3700v2|\ + netgear,wndr3700-v2|\ netgear,wndr3800|\ netgear,wndr3800ch) ath9k_eeprom_extract "art" 0x5000 0xeb8 diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 0f2dd6bae..3450c1634 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -191,6 +191,13 @@ case "$FIRMWARE" in /lib/firmware/ath10k/QCA9888/hw2.0/board.bin rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin ;; + comfast,cf-e560ac) + ath10kcal_extract "art" 0x5000 0x2f20 + ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary art 0x0) +2) + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin + ;; dlink,dir-842-c1|\ dlink,dir-842-c2|\ dlink,dir-842-c3|\ diff --git a/target/linux/ath79/generic/target.mk b/target/linux/ath79/generic/target.mk index 488aa6df1..15841ff2c 100644 --- a/target/linux/ath79/generic/target.mk +++ b/target/linux/ath79/generic/target.mk @@ -1,7 +1,7 @@ BOARDNAME:=Generic FEATURES += minor squashfs -DEFAULT_PACKAGES += wpad-basic +DEFAULT_PACKAGES += wpad define Target/Description Build firmware images for generic Atheros AR71xx/AR913x/AR934x based boards. diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 1bc7b2d68..98ba520a5 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -300,6 +300,16 @@ define Device/comfast_cf-e5 endef TARGET_DEVICES += comfast_cf-e5 +define Device/comfast_cf-e560ac + SOC := qca9531 + DEVICE_VENDOR := COMFAST + DEVICE_MODEL := CF-E560AC + DEVICE_PACKAGES := kmod-leds-gpio kmod-usb2 kmod-ath10k-ct \ + ath10k-firmware-qca9888-ct + IMAGE_SIZE := 16128k +endef +TARGET_DEVICES += comfast_cf-e560ac + define Device/comfast_cf-wr650ac-v1 SOC := qca9558 DEVICE_VENDOR := COMFAST @@ -648,7 +658,7 @@ define Device/iodata_etg3-r DEVICE_VENDOR := I-O DATA DEVICE_MODEL := ETG3-R IMAGE_SIZE := 7680k - DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-basic + DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad endef TARGET_DEVICES += iodata_etg3-r @@ -819,7 +829,7 @@ define Device/netgear_wndr3700 endef TARGET_DEVICES += netgear_wndr3700 -define Device/netgear_wndr3700v2 +define Device/netgear_wndr3700-v2 $(Device/netgear_wndr3x00) DEVICE_MODEL := WNDR3700 DEVICE_VARIANT := v2 @@ -827,9 +837,9 @@ define Device/netgear_wndr3700v2 NETGEAR_BOARD_ID := WNDR3700v2 NETGEAR_HW_ID := 29763654+16+64 IMAGE_SIZE := 15872k - SUPPORTED_DEVICES += wndr3700 + SUPPORTED_DEVICES += wndr3700 netgear,wndr3700v2 endef -TARGET_DEVICES += netgear_wndr3700v2 +TARGET_DEVICES += netgear_wndr3700-v2 define Device/netgear_wndr3800 $(Device/netgear_wndr3x00) diff --git a/target/linux/ath79/nand/target.mk b/target/linux/ath79/nand/target.mk index c565c9b2b..e57c77682 100644 --- a/target/linux/ath79/nand/target.mk +++ b/target/linux/ath79/nand/target.mk @@ -2,7 +2,7 @@ BOARDNAME := Generic devices with NAND flash FEATURES += squashfs nand -DEFAULT_PACKAGES += wpad-basic +DEFAULT_PACKAGES += wpad define Target/Description Firmware for boards using Qualcomm Atheros, MIPS-based SoCs diff --git a/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch index 6f36dc683..92396c13e 100644 --- a/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-4.19/910-unaligned_access_hacks.patch @@ -728,7 +728,7 @@ EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -3895,14 +3895,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -3896,14 +3896,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch b/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch index 49dd89c2d..d79b2d0b7 100644 --- a/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch +++ b/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1222,6 +1222,18 @@ static const struct flash_info *spi_nor_ +@@ -1226,6 +1226,18 @@ static const struct flash_info *spi_nor_ } dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n", id[0], id[1], id[2]); diff --git a/target/linux/bcm53xx/patches-4.19/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch b/target/linux/bcm53xx/patches-4.19/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch index a0d40b0f0..21687e7a3 100644 --- a/target/linux/bcm53xx/patches-4.19/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch +++ b/target/linux/bcm53xx/patches-4.19/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1297,6 +1297,18 @@ static const struct flash_info *spi_nor_ +@@ -1301,6 +1301,18 @@ static const struct flash_info *spi_nor_ } dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n", id[0], id[1], id[2]); diff --git a/target/linux/brcm47xx/patches-4.19/209-b44-register-adm-switch.patch b/target/linux/brcm47xx/patches-4.19/209-b44-register-adm-switch.patch index 3706591b0..bc2d2ab90 100644 --- a/target/linux/brcm47xx/patches-4.19/209-b44-register-adm-switch.patch +++ b/target/linux/brcm47xx/patches-4.19/209-b44-register-adm-switch.patch @@ -19,7 +19,7 @@ Subject: [PATCH 210/210] b44: register adm switch #include #include -@@ -2246,6 +2248,69 @@ static void b44_adjust_link(struct net_d +@@ -2249,6 +2251,69 @@ static void b44_adjust_link(struct net_d } } @@ -89,7 +89,7 @@ Subject: [PATCH 210/210] b44: register adm switch static int b44_register_phy_one(struct b44 *bp) { struct mii_bus *mii_bus; -@@ -2281,6 +2346,9 @@ static int b44_register_phy_one(struct b +@@ -2284,6 +2349,9 @@ static int b44_register_phy_one(struct b if (!mdiobus_is_registered_device(bp->mii_bus, bp->phy_addr) && (sprom->boardflags_lo & (B44_BOARDFLAG_ROBO | B44_BOARDFLAG_ADM))) { @@ -99,7 +99,7 @@ Subject: [PATCH 210/210] b44: register adm switch dev_info(sdev->dev, "could not find PHY at %i, use fixed one\n", bp->phy_addr); -@@ -2475,6 +2543,7 @@ static void b44_remove_one(struct ssb_de +@@ -2478,6 +2546,7 @@ static void b44_remove_one(struct ssb_de unregister_netdev(dev); if (bp->flags & B44_FLAG_EXTERNAL_PHY) b44_unregister_phy_one(bp); diff --git a/target/linux/brcm47xx/patches-4.19/210-b44_phy_fix.patch b/target/linux/brcm47xx/patches-4.19/210-b44_phy_fix.patch index 51e4b8c5a..8c7a73ac0 100644 --- a/target/linux/brcm47xx/patches-4.19/210-b44_phy_fix.patch +++ b/target/linux/brcm47xx/patches-4.19/210-b44_phy_fix.patch @@ -43,7 +43,7 @@ if (bp->flags & B44_FLAG_EXTERNAL_PHY) return 0; -@@ -2176,6 +2201,8 @@ static int b44_get_invariants(struct b44 +@@ -2179,6 +2204,8 @@ static int b44_get_invariants(struct b44 * valid PHY address. */ bp->phy_addr &= 0x1F; diff --git a/target/linux/brcm47xx/patches-4.19/831-old_gpio_wdt.patch b/target/linux/brcm47xx/patches-4.19/831-old_gpio_wdt.patch index ddac7917e..259dc0125 100644 --- a/target/linux/brcm47xx/patches-4.19/831-old_gpio_wdt.patch +++ b/target/linux/brcm47xx/patches-4.19/831-old_gpio_wdt.patch @@ -4,7 +4,7 @@ Signed-off-by: Mathias Adam --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig -@@ -1497,6 +1497,15 @@ config WDT_MTX1 +@@ -1498,6 +1498,15 @@ config WDT_MTX1 Hardware driver for the MTX-1 boards. This is a watchdog timer that will reboot the machine after a 100 seconds timer expired. diff --git a/target/linux/brcm63xx/patches-4.14/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch b/target/linux/brcm63xx/patches-4.14/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch deleted file mode 100644 index ac03e643b..000000000 --- a/target/linux/brcm63xx/patches-4.14/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch +++ /dev/null @@ -1,203 +0,0 @@ -From 51559154375fff4a94bbbc249fdd9248a80827b3 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Tue, 18 Dec 2018 10:19:02 +0100 -Subject: [PATCH] MIPS: BCM63XX: drop unused and broken DSP platform device - -Trying to register the DSP platform device results in a null pointer -access: - -[ 0.124184] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 804e305c, ra == 804e6f20 -[ 0.135208] Oops[#1]: -[ 0.137514] CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.87 -... -[ 0.197117] epc : 804e305c bcm63xx_dsp_register+0x80/0xa4 -[ 0.202838] ra : 804e6f20 board_register_devices+0x258/0x390 -... - -This happens because it tries to copy the passed platform data over the -platform_device's unpopulated platform_data. - -Since this code has been broken since its submission, no driver was ever -submitted for it, and apparently nobody was using it, just remove it -instead of trying to fix it. - -Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.") -Signed-off-by: Jonas Gorski ---- - arch/mips/bcm63xx/Makefile | 6 +-- - arch/mips/bcm63xx/boards/board_bcm963xx.c | 20 -------- - arch/mips/bcm63xx/dev-dsp.c | 56 ---------------------- - .../include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h | 14 ------ - .../mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 5 -- - 5 files changed, 3 insertions(+), 98 deletions(-) - delete mode 100644 arch/mips/bcm63xx/dev-dsp.c - delete mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h - ---- a/arch/mips/bcm63xx/Makefile -+++ b/arch/mips/bcm63xx/Makefile -@@ -1,8 +1,8 @@ - # SPDX-License-Identifier: GPL-2.0 - obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \ -- setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ -- dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \ -- dev-wdt.o dev-usb-usbd.o -+ setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \ -+ dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \ -+ dev-usb-usbd.o - obj-$(CONFIG_EARLY_PRINTK) += early_printk.o - - obj-y += boards/ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -23,7 +23,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -289,14 +288,6 @@ static struct board_info __initdata boar - .has_pccard = 1, - .has_ehci0 = 1, - -- .has_dsp = 1, -- .dsp = { -- .gpio_rst = 6, -- .gpio_int = 34, -- .cs = 2, -- .ext_irq = 2, -- }, -- - .leds = { - { - .name = "adsl-fail", -@@ -401,14 +392,6 @@ static struct board_info __initdata boar - - .has_ohci0 = 1, - -- .has_dsp = 1, -- .dsp = { -- .gpio_rst = 6, -- .gpio_int = 34, -- .ext_irq = 2, -- .cs = 2, -- }, -- - .leds = { - { - .name = "adsl-fail", -@@ -898,9 +881,6 @@ int __init board_register_devices(void) - if (board.has_usbd) - bcm63xx_usbd_register(&board.usbd); - -- if (board.has_dsp) -- bcm63xx_dsp_register(&board.dsp); -- - /* Generate MAC address for WLAN and register our SPROM, - * do this after registering enet devices - */ ---- a/arch/mips/bcm63xx/dev-dsp.c -+++ /dev/null -@@ -1,56 +0,0 @@ --/* -- * Broadcom BCM63xx VoIP DSP registration -- * -- * This file is subject to the terms and conditions of the GNU General Public -- * License. See the file "COPYING" in the main directory of this archive -- * for more details. -- * -- * Copyright (C) 2009 Florian Fainelli -- */ -- --#include --#include --#include -- --#include --#include --#include --#include -- --static struct resource voip_dsp_resources[] = { -- { -- .start = -1, /* filled at runtime */ -- .end = -1, /* filled at runtime */ -- .flags = IORESOURCE_MEM, -- }, -- { -- .start = -1, /* filled at runtime */ -- .flags = IORESOURCE_IRQ, -- }, --}; -- --static struct platform_device bcm63xx_voip_dsp_device = { -- .name = "bcm63xx-voip-dsp", -- .id = -1, -- .num_resources = ARRAY_SIZE(voip_dsp_resources), -- .resource = voip_dsp_resources, --}; -- --int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd) --{ -- struct bcm63xx_dsp_platform_data *dpd; -- u32 val; -- -- /* Get the memory window */ -- val = bcm_mpi_readl(MPI_CSBASE_REG(pd->cs - 1)); -- val &= MPI_CSBASE_BASE_MASK; -- voip_dsp_resources[0].start = val; -- voip_dsp_resources[0].end = val + 0xFFFFFFF; -- voip_dsp_resources[1].start = pd->ext_irq; -- -- /* copy given platform data */ -- dpd = bcm63xx_voip_dsp_device.dev.platform_data; -- memcpy(dpd, pd, sizeof (*pd)); -- -- return platform_device_register(&bcm63xx_voip_dsp_device); --} ---- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h -+++ /dev/null -@@ -1,14 +0,0 @@ --/* SPDX-License-Identifier: GPL-2.0 */ --#ifndef __BCM63XX_DSP_H --#define __BCM63XX_DSP_H -- --struct bcm63xx_dsp_platform_data { -- unsigned gpio_rst; -- unsigned gpio_int; -- unsigned cs; -- unsigned ext_irq; --}; -- --int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd); -- --#endif /* __BCM63XX_DSP_H */ ---- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h -+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h -@@ -7,7 +7,6 @@ - #include - #include - #include --#include - - /* - * flash mapping -@@ -31,7 +30,6 @@ struct board_info { - unsigned int has_ohci0:1; - unsigned int has_ehci0:1; - unsigned int has_usbd:1; -- unsigned int has_dsp:1; - unsigned int has_uart0:1; - unsigned int has_uart1:1; - -@@ -43,9 +41,6 @@ struct board_info { - /* USB config */ - struct bcm63xx_usbd_platform_data usbd; - -- /* DSP config */ -- struct bcm63xx_dsp_platform_data dsp; -- - /* GPIO LEDs */ - struct gpio_led leds[5]; - diff --git a/target/linux/brcm63xx/patches-4.19/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch b/target/linux/brcm63xx/patches-4.19/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch deleted file mode 100644 index ac03e643b..000000000 --- a/target/linux/brcm63xx/patches-4.19/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch +++ /dev/null @@ -1,203 +0,0 @@ -From 51559154375fff4a94bbbc249fdd9248a80827b3 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Tue, 18 Dec 2018 10:19:02 +0100 -Subject: [PATCH] MIPS: BCM63XX: drop unused and broken DSP platform device - -Trying to register the DSP platform device results in a null pointer -access: - -[ 0.124184] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 804e305c, ra == 804e6f20 -[ 0.135208] Oops[#1]: -[ 0.137514] CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.87 -... -[ 0.197117] epc : 804e305c bcm63xx_dsp_register+0x80/0xa4 -[ 0.202838] ra : 804e6f20 board_register_devices+0x258/0x390 -... - -This happens because it tries to copy the passed platform data over the -platform_device's unpopulated platform_data. - -Since this code has been broken since its submission, no driver was ever -submitted for it, and apparently nobody was using it, just remove it -instead of trying to fix it. - -Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.") -Signed-off-by: Jonas Gorski ---- - arch/mips/bcm63xx/Makefile | 6 +-- - arch/mips/bcm63xx/boards/board_bcm963xx.c | 20 -------- - arch/mips/bcm63xx/dev-dsp.c | 56 ---------------------- - .../include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h | 14 ------ - .../mips/include/asm/mach-bcm63xx/board_bcm963xx.h | 5 -- - 5 files changed, 3 insertions(+), 98 deletions(-) - delete mode 100644 arch/mips/bcm63xx/dev-dsp.c - delete mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h - ---- a/arch/mips/bcm63xx/Makefile -+++ b/arch/mips/bcm63xx/Makefile -@@ -1,8 +1,8 @@ - # SPDX-License-Identifier: GPL-2.0 - obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \ -- setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ -- dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \ -- dev-wdt.o dev-usb-usbd.o -+ setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \ -+ dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \ -+ dev-usb-usbd.o - obj-$(CONFIG_EARLY_PRINTK) += early_printk.o - - obj-y += boards/ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -23,7 +23,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -289,14 +288,6 @@ static struct board_info __initdata boar - .has_pccard = 1, - .has_ehci0 = 1, - -- .has_dsp = 1, -- .dsp = { -- .gpio_rst = 6, -- .gpio_int = 34, -- .cs = 2, -- .ext_irq = 2, -- }, -- - .leds = { - { - .name = "adsl-fail", -@@ -401,14 +392,6 @@ static struct board_info __initdata boar - - .has_ohci0 = 1, - -- .has_dsp = 1, -- .dsp = { -- .gpio_rst = 6, -- .gpio_int = 34, -- .ext_irq = 2, -- .cs = 2, -- }, -- - .leds = { - { - .name = "adsl-fail", -@@ -898,9 +881,6 @@ int __init board_register_devices(void) - if (board.has_usbd) - bcm63xx_usbd_register(&board.usbd); - -- if (board.has_dsp) -- bcm63xx_dsp_register(&board.dsp); -- - /* Generate MAC address for WLAN and register our SPROM, - * do this after registering enet devices - */ ---- a/arch/mips/bcm63xx/dev-dsp.c -+++ /dev/null -@@ -1,56 +0,0 @@ --/* -- * Broadcom BCM63xx VoIP DSP registration -- * -- * This file is subject to the terms and conditions of the GNU General Public -- * License. See the file "COPYING" in the main directory of this archive -- * for more details. -- * -- * Copyright (C) 2009 Florian Fainelli -- */ -- --#include --#include --#include -- --#include --#include --#include --#include -- --static struct resource voip_dsp_resources[] = { -- { -- .start = -1, /* filled at runtime */ -- .end = -1, /* filled at runtime */ -- .flags = IORESOURCE_MEM, -- }, -- { -- .start = -1, /* filled at runtime */ -- .flags = IORESOURCE_IRQ, -- }, --}; -- --static struct platform_device bcm63xx_voip_dsp_device = { -- .name = "bcm63xx-voip-dsp", -- .id = -1, -- .num_resources = ARRAY_SIZE(voip_dsp_resources), -- .resource = voip_dsp_resources, --}; -- --int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd) --{ -- struct bcm63xx_dsp_platform_data *dpd; -- u32 val; -- -- /* Get the memory window */ -- val = bcm_mpi_readl(MPI_CSBASE_REG(pd->cs - 1)); -- val &= MPI_CSBASE_BASE_MASK; -- voip_dsp_resources[0].start = val; -- voip_dsp_resources[0].end = val + 0xFFFFFFF; -- voip_dsp_resources[1].start = pd->ext_irq; -- -- /* copy given platform data */ -- dpd = bcm63xx_voip_dsp_device.dev.platform_data; -- memcpy(dpd, pd, sizeof (*pd)); -- -- return platform_device_register(&bcm63xx_voip_dsp_device); --} ---- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h -+++ /dev/null -@@ -1,14 +0,0 @@ --/* SPDX-License-Identifier: GPL-2.0 */ --#ifndef __BCM63XX_DSP_H --#define __BCM63XX_DSP_H -- --struct bcm63xx_dsp_platform_data { -- unsigned gpio_rst; -- unsigned gpio_int; -- unsigned cs; -- unsigned ext_irq; --}; -- --int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd); -- --#endif /* __BCM63XX_DSP_H */ ---- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h -+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h -@@ -7,7 +7,6 @@ - #include - #include - #include --#include - - /* - * flash mapping -@@ -31,7 +30,6 @@ struct board_info { - unsigned int has_ohci0:1; - unsigned int has_ehci0:1; - unsigned int has_usbd:1; -- unsigned int has_dsp:1; - unsigned int has_uart0:1; - unsigned int has_uart1:1; - -@@ -43,9 +41,6 @@ struct board_info { - /* USB config */ - struct bcm63xx_usbd_platform_data usbd; - -- /* DSP config */ -- struct bcm63xx_dsp_platform_data dsp; -- - /* GPIO LEDs */ - struct gpio_led leds[5]; - diff --git a/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch b/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch index 55d0f40f4..577f2d3df 100644 --- a/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch +++ b/target/linux/generic/backport-4.19/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch @@ -10,7 +10,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c -@@ -532,5 +532,35 @@ void nf_flow_table_free(struct nf_flowta +@@ -535,5 +535,35 @@ void nf_flow_table_free(struct nf_flowta } EXPORT_SYMBOL_GPL(nf_flow_table_free); @@ -48,7 +48,7 @@ Signed-off-by: Pablo Neira Ayuso MODULE_AUTHOR("Pablo Neira Ayuso "); --- a/net/netfilter/nft_flow_offload.c +++ b/net/netfilter/nft_flow_offload.c -@@ -217,47 +217,14 @@ static struct nft_expr_type nft_flow_off +@@ -216,47 +216,14 @@ static struct nft_expr_type nft_flow_off .owner = THIS_MODULE, }; diff --git a/target/linux/generic/backport-4.19/702-v4.20-net-ethernet-Add-helper-for-MACs-which-support-asym-.patch b/target/linux/generic/backport-4.19/702-v4.20-net-ethernet-Add-helper-for-MACs-which-support-asym-.patch index ee6e6a6da..3ada51636 100644 --- a/target/linux/generic/backport-4.19/702-v4.20-net-ethernet-Add-helper-for-MACs-which-support-asym-.patch +++ b/target/linux/generic/backport-4.19/702-v4.20-net-ethernet-Add-helper-for-MACs-which-support-asym-.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1776,6 +1776,19 @@ int phy_set_max_speed(struct phy_device +@@ -1777,6 +1777,19 @@ int phy_set_max_speed(struct phy_device } EXPORT_SYMBOL(phy_set_max_speed); diff --git a/target/linux/generic/backport-4.19/703-v4.20-net-ethernet-Add-helper-for-set_pauseparam-for-Asym-.patch b/target/linux/generic/backport-4.19/703-v4.20-net-ethernet-Add-helper-for-set_pauseparam-for-Asym-.patch index 8d68fbfe0..4ad3bf698 100644 --- a/target/linux/generic/backport-4.19/703-v4.20-net-ethernet-Add-helper-for-set_pauseparam-for-Asym-.patch +++ b/target/linux/generic/backport-4.19/703-v4.20-net-ethernet-Add-helper-for-set_pauseparam-for-Asym-.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1789,6 +1789,36 @@ void phy_support_asym_pause(struct phy_d +@@ -1790,6 +1790,36 @@ void phy_support_asym_pause(struct phy_d } EXPORT_SYMBOL(phy_support_asym_pause); diff --git a/target/linux/generic/backport-4.19/704-v4.20-net-phy-Stop-with-excessive-soft-reset.patch b/target/linux/generic/backport-4.19/704-v4.20-net-phy-Stop-with-excessive-soft-reset.patch index 77ad5b96d..00ef6b7a1 100644 --- a/target/linux/generic/backport-4.19/704-v4.20-net-phy-Stop-with-excessive-soft-reset.patch +++ b/target/linux/generic/backport-4.19/704-v4.20-net-phy-Stop-with-excessive-soft-reset.patch @@ -29,7 +29,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -885,8 +885,6 @@ int phy_init_hw(struct phy_device *phyde +@@ -886,8 +886,6 @@ int phy_init_hw(struct phy_device *phyde if (phydev->drv->soft_reset) ret = phydev->drv->soft_reset(phydev); diff --git a/target/linux/generic/backport-4.19/737-v5.5-net-phy-add-core-phylib-sfp-support.patch b/target/linux/generic/backport-4.19/737-v5.5-net-phy-add-core-phylib-sfp-support.patch index 8dcad2fa5..9b34d40a0 100644 --- a/target/linux/generic/backport-4.19/737-v5.5-net-phy-add-core-phylib-sfp-support.patch +++ b/target/linux/generic/backport-4.19/737-v5.5-net-phy-add-core-phylib-sfp-support.patch @@ -54,7 +54,7 @@ Signed-off-by: Russell King #include #include #include -@@ -943,6 +944,65 @@ void phy_attached_print(struct phy_devic +@@ -944,6 +945,65 @@ void phy_attached_print(struct phy_devic EXPORT_SYMBOL(phy_attached_print); /** @@ -120,7 +120,7 @@ Signed-off-by: Russell King * phy_attach_direct - attach a network device to a given PHY device pointer * @dev: network device to attach * @phydev: Pointer to phy_device to attach -@@ -1015,6 +1075,9 @@ int phy_attach_direct(struct net_device +@@ -1016,6 +1076,9 @@ int phy_attach_direct(struct net_device phydev->attached_dev = dev; dev->phydev = phydev; @@ -130,7 +130,7 @@ Signed-off-by: Russell King /* Some Ethernet drivers try to connect to a PHY device before * calling register_netdevice() -> netdev_register_kobject() and * does the dev->dev.kobj initialization. Here we only check for -@@ -1949,6 +2012,9 @@ static int phy_remove(struct device *dev +@@ -1950,6 +2013,9 @@ static int phy_remove(struct device *dev phydev->state = PHY_DOWN; mutex_unlock(&phydev->lock); diff --git a/target/linux/generic/backport-4.19/740-v5.5-net-phy-avoid-matching-all-ones-clause-45-PHY-IDs.patch b/target/linux/generic/backport-4.19/740-v5.5-net-phy-avoid-matching-all-ones-clause-45-PHY-IDs.patch index d6c012019..81f161e9b 100644 --- a/target/linux/generic/backport-4.19/740-v5.5-net-phy-avoid-matching-all-ones-clause-45-PHY-IDs.patch +++ b/target/linux/generic/backport-4.19/740-v5.5-net-phy-avoid-matching-all-ones-clause-45-PHY-IDs.patch @@ -37,7 +37,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -334,7 +334,7 @@ static int phy_bus_match(struct device * +@@ -335,7 +335,7 @@ static int phy_bus_match(struct device * if (phydev->is_c45) { for (i = 1; i < num_ids; i++) { @@ -46,7 +46,7 @@ Signed-off-by: Russell King continue; if ((phydrv->phy_id & phydrv->phy_id_mask) == -@@ -622,10 +622,13 @@ static int get_phy_id(struct mii_bus *bu +@@ -623,10 +623,13 @@ static int get_phy_id(struct mii_bus *bu */ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) { diff --git a/target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-savedscp.patch b/target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-savedscp.patch deleted file mode 100644 index 5217eca58..000000000 --- a/target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-savedscp.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 5a4d7714faa28c03e85d696fba82716fbda5c432 Mon Sep 17 00:00:00 2001 -From: Kevin Darbyshire-Bryant -Date: Sat, 23 Mar 2019 09:29:49 +0000 -Subject: [PATCH] netfilter: connmark: introduce savedscp - -savedscp is a method of storing the DSCP of an ip packet into conntrack -mark. In combination with a suitable tc filter action (conndscp but may -end up being integrated into connmark) DSCP values are able to be stored -on egress and restored on ingress across links that otherwise alter or -bleach DSCP. - -This is useful for qdiscs such as CAKE which are able to shape according -to policies based on DSCP. - -Ingress classification is traditionally a challenging task since -iptables rules haven't yet run and tc filter/eBPF programs are pre-NAT -lookups, hence are unable to see internal IPv4 addresses as used on the -typical home masquerading gateway. - -The ingress problem is solved by the tc filter, but the tc people didn't -like the idea of tc setting conntrack mark values, though they are ok -with reading conntrack values and hence restoring DSCP from conntrack -marks. - -x_tables CONNMARK with the new savedscp action solves the problem of -storing the DSCP to the conntrack mark. - -It accepts 2 parameters. The mark is a 32bit value with usually one 1 -bit set. This bit is set when savedscp saves the DSCP to the mark. -This is useful to implement a 'one shot' -iptables based classification where the 'complicated' iptables rules are -only run once to classify the connection on initial (egress) packet and -subsequent packets are all marked/restored with the same DSCP. A mark -of zero disables the setting of a status bit/s. - -The mask is a 32bit value of at least 6 contiguous bits and represents -the area where the DSCP will be stored. - -e.g. - -iptables -A QOS_MARK_eth0 -t mangle -j CONNMARK --savedscp-mark 0xfc000000/0x01000000 - -Would store the DSCP in the top 6 bits of the 32bit mark field, and use -the LSB of the top byte as the 'DSCP has been stored' marker. - -Signed-off-by: Kevin Darbyshire-Bryant ---- - include/uapi/linux/netfilter/xt_connmark.h | 3 ++- - net/netfilter/xt_connmark.c | 21 ++++++++++++++++++++- - 2 files changed, 22 insertions(+), 2 deletions(-) - ---- a/include/uapi/linux/netfilter/xt_connmark.h -+++ b/include/uapi/linux/netfilter/xt_connmark.h -@@ -16,7 +16,8 @@ - enum { - XT_CONNMARK_SET = 0, - XT_CONNMARK_SAVE, -- XT_CONNMARK_RESTORE -+ XT_CONNMARK_RESTORE, -+ XT_CONNMARK_SAVEDSCP - }; - - struct xt_connmark_tginfo1 { ---- a/net/netfilter/xt_connmark.c -+++ b/net/netfilter/xt_connmark.c -@@ -42,6 +42,7 @@ connmark_tg(struct sk_buff *skb, const s - enum ip_conntrack_info ctinfo; - struct nf_conn *ct; - u_int32_t newmark; -+ u_int8_t dscp, maskshift; - - ct = nf_ct_get(skb, &ctinfo); - if (ct == NULL) -@@ -57,7 +58,25 @@ connmark_tg(struct sk_buff *skb, const s - break; - case XT_CONNMARK_SAVE: - newmark = (ct->mark & ~info->ctmask) ^ -- (skb->mark & info->nfmask); -+ (skb->mark & info->nfmask); -+ if (ct->mark != newmark) { -+ ct->mark = newmark; -+ nf_conntrack_event_cache(IPCT_MARK, ct); -+ } -+ break; -+ case XT_CONNMARK_SAVEDSCP: -+ if (skb->protocol == htons(ETH_P_IP)) -+ dscp = ipv4_get_dsfield(ip_hdr(skb)) >> 2; -+ else if (skb->protocol == htons(ETH_P_IPV6)) -+ dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> 2; -+ else /* protocol doesn't have diffserv */ -+ break; -+ -+ /* nfmask contains the mask shift value */ -+ maskshift = info->nfmask & 0x1f; -+ newmark = (ct->mark & ~info->ctmark) | -+ (info->ctmask | (dscp << maskshift)); -+ - if (ct->mark != newmark) { - ct->mark = newmark; - nf_conntrack_event_cache(IPCT_MARK, ct); diff --git a/target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-set-dscpmark.patch b/target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-set-dscpmark.patch new file mode 100644 index 000000000..1ecc95bf2 --- /dev/null +++ b/target/linux/generic/hack-4.14/645-netfilter-connmark-introduce-set-dscpmark.patch @@ -0,0 +1,124 @@ +From f1627abea333781d3e2a61bac4c7fd4502395741 Mon Sep 17 00:00:00 2001 +From: Kevin Darbyshire-Bryant +Date: Sat, 23 Mar 2019 09:29:49 +0000 +Subject: [PATCH] netfilter: connmark: introduce set-dscpmark + +set-dscpmark is a method of storing the DSCP of an ip packet into +conntrack mark. In combination with a suitable tc filter action +(act_ctinfo) DSCP values are able to be stored in the mark on egress and +restored on ingress across links that otherwise alter or bleach DSCP. + +This is useful for qdiscs such as CAKE which are able to shape according +to policies based on DSCP. + +Ingress classification is traditionally a challenging task since +iptables rules haven't yet run and tc filter/eBPF programs are pre-NAT +lookups, hence are unable to see internal IPv4 addresses as used on the +typical home masquerading gateway. + +x_tables CONNMARK set-dscpmark target solves the problem of storing the +DSCP to the conntrack mark in a way suitable for the new act_ctinfo tc +action to restore. + +The set-dscpmark option accepts 2 parameters, a 32bit 'dscpmask' and a +32bit 'statemask'. The dscp mask must be 6 contiguous bits and +represents the area where the DSCP will be stored in the connmark. The +state mask is a minimum 1 bit length mask that must not overlap with the +dscpmask. It represents a flag which is set when the DSCP has been +stored in the conntrack mark. This is useful to implement a 'one shot' +iptables based classification where the 'complicated' iptables rules are +only run once to classify the connection on initial (egress) packet and +subsequent packets are all marked/restored with the same DSCP. A state +mask of zero disables the setting of a status bit/s. + +example syntax with a suitably modified iptables user space application: + +iptables -A QOS_MARK_eth0 -t mangle -j CONNMARK --set-dscpmark 0xfc000000/0x01000000 + +Would store the DSCP in the top 6 bits of the 32bit mark field, and use +the LSB of the top byte as the 'DSCP has been stored' marker. + +|----0xFC----conntrack mark----000000---| +| Bits 31-26 | bit 25 | bit24 |~~~ Bit 0| +| DSCP | unused | flag |unused | +|-----------------------0x01---000000---| + ^ ^ + | | + ---| Conditional flag + | set this when dscp +|-ip diffserv-| stored in mark +| 6 bits | +|-------------| + +an identically configured tc action to restore looks like: + +tc filter show dev eth0 ingress +filter parent ffff: protocol all pref 10 u32 chain 0 +filter parent ffff: protocol all pref 10 u32 chain 0 fh 800: ht divisor 1 +filter parent ffff: protocol all pref 10 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1: not_in_hw + match 00000000/00000000 at 0 + action order 1: ctinfo zone 0 pipe + index 2 ref 1 bind 1 dscp 0xfc000000/0x1000000 + + action order 2: mirred (Egress Redirect to device ifb4eth0) stolen + index 1 ref 1 bind 1 + +|----0xFC----conntrack mark----000000---| +| Bits 31-26 | bit 25 | bit24 |~~~ Bit 0| +| DSCP | unused | flag |unused | +|-----------------------0x01---000000---| + | | + | | + ---| Conditional flag + v only restore if set +|-ip diffserv-| +| 6 bits | +|-------------| + +Signed-off-by: Kevin Darbyshire-Bryant +--- + net/netfilter/xt_connmark.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +--- a/net/netfilter/xt_connmark.c ++++ b/net/netfilter/xt_connmark.c +@@ -42,6 +42,7 @@ connmark_tg(struct sk_buff *skb, const s + enum ip_conntrack_info ctinfo; + struct nf_conn *ct; + u_int32_t newmark; ++ u_int8_t dscp, maskshift; + + ct = nf_ct_get(skb, &ctinfo); + if (ct == NULL) +@@ -49,7 +50,21 @@ connmark_tg(struct sk_buff *skb, const s + + switch (info->mode) { + case XT_CONNMARK_SET: +- newmark = (ct->mark & ~info->ctmask) ^ info->ctmark; ++ if (info->nfmask & 0x80000000) { ++ newmark = (ct->mark & ~info->ctmask) ^ info->ctmark; ++ } else { ++ if (skb->protocol == htons(ETH_P_IP)) ++ dscp = ipv4_get_dsfield(ip_hdr(skb)) >> 2; ++ else if (skb->protocol == htons(ETH_P_IPV6)) ++ dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> 2; ++ else /* protocol doesn't have diffserv */ ++ break; ++ ++ /* nfmask contains the mask shift value */ ++ maskshift = info->nfmask & 0x1f; ++ newmark = (ct->mark & ~info->ctmark) | ++ (info->ctmask | (dscp << maskshift)); ++ } + if (ct->mark != newmark) { + ct->mark = newmark; + nf_conntrack_event_cache(IPCT_MARK, ct); +@@ -57,7 +72,7 @@ connmark_tg(struct sk_buff *skb, const s + break; + case XT_CONNMARK_SAVE: + newmark = (ct->mark & ~info->ctmask) ^ +- (skb->mark & info->nfmask); ++ (skb->mark & info->nfmask); + if (ct->mark != newmark) { + ct->mark = newmark; + nf_conntrack_event_cache(IPCT_MARK, ct); diff --git a/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch index 97bbee96a..cc84311ef 100644 --- a/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch @@ -15,7 +15,7 @@ --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1461,6 +1461,9 @@ int genphy_update_link(struct phy_device +@@ -1462,6 +1462,9 @@ int genphy_update_link(struct phy_device { int status; diff --git a/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch index 71a26dba4..2778377de 100644 --- a/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.19/661-use_fq_codel_by_default.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h -@@ -486,12 +486,13 @@ extern struct Qdisc_ops noop_qdisc_ops; +@@ -487,12 +487,13 @@ extern struct Qdisc_ops noop_qdisc_ops; extern struct Qdisc_ops pfifo_fast_ops; extern struct Qdisc_ops mq_qdisc_ops; extern struct Qdisc_ops noqueue_qdisc_ops; @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -2160,7 +2160,7 @@ static int __init pktsched_init(void) +@@ -2162,7 +2162,7 @@ static int __init pktsched_init(void) return err; } diff --git a/target/linux/generic/hack-4.19/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.19/702-phy_add_aneg_done_function.patch index 9a9097d91..fe295906e 100644 --- a/target/linux/generic/hack-4.19/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-4.19/702-phy_add_aneg_done_function.patch @@ -15,7 +15,7 @@ --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1512,6 +1512,9 @@ int genphy_update_link(struct phy_device +@@ -1577,6 +1577,9 @@ int genphy_update_link(struct phy_device { int status; diff --git a/target/linux/generic/pending-4.14/481-mtd-spi-nor-add-support-for-Gigadevice-GD25D05.patch b/target/linux/generic/pending-4.14/481-mtd-spi-nor-add-support-for-Gigadevice-GD25D05.patch new file mode 100644 index 000000000..5c71c9cf7 --- /dev/null +++ b/target/linux/generic/pending-4.14/481-mtd-spi-nor-add-support-for-Gigadevice-GD25D05.patch @@ -0,0 +1,29 @@ +From d68b4aa22e8c625685bfad642dd7337948dc0ad1 Mon Sep 17 00:00:00 2001 +From: Koen Vandeputte +Date: Mon, 6 Jan 2020 13:07:56 +0100 +Subject: [PATCH] mtd: spi-nor: add support for Gigadevice GD25D05 + +Signed-off-by: Koen Vandeputte +--- + drivers/mtd/spi-nor/spi-nor.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c +index f4afe123e9dc..a34fa42d47a2 100644 +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2346,6 +2346,11 @@ static const struct flash_info spi_nor_ids[] = { + { "mb85rs1mt", INFO(0x047f27, 0, 128 * 1024, 1, SPI_NOR_NO_ERASE) }, + + /* GigaDevice */ ++ { ++ "gd25d05", INFO(0xc84010, 0, 64 * 1024, 1, ++ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | ++ SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) ++ }, + { + "gd25q16", INFO(0xc84015, 0, 64 * 1024, 32, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | +-- +2.17.1 + diff --git a/target/linux/generic/pending-4.14/630-packet_socket_type.patch b/target/linux/generic/pending-4.14/630-packet_socket_type.patch index 8dbe06023..a4737b23e 100644 --- a/target/linux/generic/pending-4.14/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.14/630-packet_socket_type.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1829,6 +1829,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1836,6 +1836,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1836,6 +1837,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1843,6 +1844,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1848,7 +1850,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1855,7 +1857,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2075,12 +2077,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2082,12 +2084,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2206,12 +2208,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2213,12 +2215,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3294,6 +3296,7 @@ static int packet_create(struct net *net +@@ -3301,6 +3303,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3907,6 +3910,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3923,6 +3926,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3959,6 +3972,13 @@ static int packet_getsockopt(struct sock +@@ -3975,6 +3988,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index 6e2eca6da..96c8ae9c1 100644 --- a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -350,7 +350,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1922,6 +2084,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1920,6 +2082,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -366,7 +366,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1959,6 +2130,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1957,6 +2128,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_FWMARK]) parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]); @@ -413,7 +413,7 @@ Signed-off-by: Steven Barth } static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], -@@ -2074,6 +2285,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -2072,6 +2283,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -426,7 +426,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -2103,6 +2320,24 @@ static size_t ip6_tnl_get_size(const str +@@ -2101,6 +2318,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(0) + /* IFLA_IPTUN_FWMARK */ nla_total_size(4) + @@ -451,7 +451,7 @@ Signed-off-by: Steven Barth 0; } -@@ -2110,6 +2345,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2108,6 +2343,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -461,7 +461,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || -@@ -2119,9 +2357,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2117,9 +2355,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) || @@ -490,7 +490,7 @@ Signed-off-by: Steven Barth if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || -@@ -2161,6 +2417,7 @@ static const struct nla_policy ip6_tnl_p +@@ -2159,6 +2415,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, [IFLA_IPTUN_FWMARK] = { .type = NLA_U32 }, diff --git a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 8919ea34e..067de75f3 100644 --- a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6970,6 +7017,7 @@ int dev_set_mac_address(struct net_devic +@@ -6961,6 +7008,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch index 4ba722183..d49fdc77a 100644 --- a/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1105,6 +1105,9 @@ void phy_detach(struct phy_device *phyde +@@ -1106,6 +1106,9 @@ void phy_detach(struct phy_device *phyde struct module *ndev_owner = dev->dev.parent->driver->owner; struct mii_bus *bus; diff --git a/target/linux/generic/pending-4.19/481-mtd-spi-nor-add-support-for-Gigadevice-GD25D05.patch b/target/linux/generic/pending-4.19/481-mtd-spi-nor-add-support-for-Gigadevice-GD25D05.patch new file mode 100644 index 000000000..5c71c9cf7 --- /dev/null +++ b/target/linux/generic/pending-4.19/481-mtd-spi-nor-add-support-for-Gigadevice-GD25D05.patch @@ -0,0 +1,29 @@ +From d68b4aa22e8c625685bfad642dd7337948dc0ad1 Mon Sep 17 00:00:00 2001 +From: Koen Vandeputte +Date: Mon, 6 Jan 2020 13:07:56 +0100 +Subject: [PATCH] mtd: spi-nor: add support for Gigadevice GD25D05 + +Signed-off-by: Koen Vandeputte +--- + drivers/mtd/spi-nor/spi-nor.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c +index f4afe123e9dc..a34fa42d47a2 100644 +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2346,6 +2346,11 @@ static const struct flash_info spi_nor_ids[] = { + { "mb85rs1mt", INFO(0x047f27, 0, 128 * 1024, 1, SPI_NOR_NO_ERASE) }, + + /* GigaDevice */ ++ { ++ "gd25d05", INFO(0xc84010, 0, 64 * 1024, 1, ++ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | ++ SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) ++ }, + { + "gd25q16", INFO(0xc84015, 0, 64 * 1024, 32, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | +-- +2.17.1 + diff --git a/target/linux/generic/pending-4.19/630-packet_socket_type.patch b/target/linux/generic/pending-4.19/630-packet_socket_type.patch index 7c4ab32fa..25f44b466 100644 --- a/target/linux/generic/pending-4.19/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.19/630-packet_socket_type.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1790,6 +1790,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1796,6 +1796,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1797,6 +1798,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1803,6 +1804,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1809,7 +1811,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1815,7 +1817,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2037,12 +2039,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2043,12 +2045,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2168,12 +2170,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2174,12 +2176,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3259,6 +3261,7 @@ static int packet_create(struct net *net +@@ -3265,6 +3267,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3870,6 +3873,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3885,6 +3888,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3922,6 +3935,13 @@ static int packet_getsockopt(struct sock +@@ -3937,6 +3950,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index a4996efbc..f0946e8dd 100644 --- a/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-4.19/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -237,7 +237,7 @@ Signed-off-by: Pablo Neira Ayuso INIT_DEFERRABLE_WORK(&flowtable->gc_work, nf_flow_offload_work_gc); err = rhashtable_init(&flowtable->rhashtable, -@@ -535,6 +580,8 @@ static void nf_flow_table_iterate_cleanu +@@ -538,6 +583,8 @@ static void nf_flow_table_iterate_cleanu { nf_flow_table_iterate(flowtable, nf_flow_table_do_cleanup, dev); flush_delayed_work(&flowtable->gc_work); @@ -246,7 +246,7 @@ Signed-off-by: Pablo Neira Ayuso } void nf_flow_table_cleanup(struct net *net, struct net_device *dev) -@@ -548,6 +595,26 @@ void nf_flow_table_cleanup(struct net *n +@@ -551,6 +598,26 @@ void nf_flow_table_cleanup(struct net *n } EXPORT_SYMBOL_GPL(nf_flow_table_cleanup); @@ -273,7 +273,7 @@ Signed-off-by: Pablo Neira Ayuso void nf_flow_table_free(struct nf_flowtable *flow_table) { mutex_lock(&flowtable_lock); -@@ -557,9 +624,58 @@ void nf_flow_table_free(struct nf_flowta +@@ -560,9 +627,58 @@ void nf_flow_table_free(struct nf_flowta nf_flow_table_iterate(flow_table, nf_flow_table_do_cleanup, NULL); WARN_ON(!nf_flow_offload_gc_step(flow_table)); rhashtable_destroy(&flow_table->rhashtable); @@ -506,7 +506,7 @@ Signed-off-by: Pablo Neira Ayuso +MODULE_ALIAS("nf-flow-table-hw"); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5490,6 +5490,13 @@ static int nf_tables_flowtable_parse_hoo +@@ -5503,6 +5503,13 @@ static int nf_tables_flowtable_parse_hoo if (err < 0) return err; @@ -520,7 +520,7 @@ Signed-off-by: Pablo Neira Ayuso ops = kcalloc(n, sizeof(struct nf_hook_ops), GFP_KERNEL); if (!ops) return -ENOMEM; -@@ -5621,10 +5628,19 @@ static int nf_tables_newflowtable(struct +@@ -5634,10 +5641,19 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -540,7 +540,7 @@ Signed-off-by: Pablo Neira Ayuso err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK], flowtable); if (err < 0) -@@ -5750,7 +5766,8 @@ static int nf_tables_fill_flowtable_info +@@ -5763,7 +5779,8 @@ static int nf_tables_fill_flowtable_info nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) || nla_put_be32(skb, NFTA_FLOWTABLE_USE, htonl(flowtable->use)) || nla_put_be64(skb, NFTA_FLOWTABLE_HANDLE, cpu_to_be64(flowtable->handle), @@ -552,7 +552,7 @@ Signed-off-by: Pablo Neira Ayuso nest = nla_nest_start(skb, NFTA_FLOWTABLE_HOOK); --- a/net/netfilter/nft_flow_offload.c +++ b/net/netfilter/nft_flow_offload.c -@@ -127,6 +127,9 @@ static void nft_flow_offload_eval(const +@@ -126,6 +126,9 @@ static void nft_flow_offload_eval(const if (ret < 0) goto err_flow_add; diff --git a/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index d5f4a4c96..8b7594e9c 100644 --- a/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-4.19/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -350,7 +350,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1926,6 +2088,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1924,6 +2086,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -366,7 +366,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1963,6 +2134,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1961,6 +2132,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_FWMARK]) parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]); @@ -413,7 +413,7 @@ Signed-off-by: Steven Barth } static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], -@@ -2078,6 +2289,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -2076,6 +2287,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -426,7 +426,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -2107,6 +2324,24 @@ static size_t ip6_tnl_get_size(const str +@@ -2105,6 +2322,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(0) + /* IFLA_IPTUN_FWMARK */ nla_total_size(4) + @@ -451,7 +451,7 @@ Signed-off-by: Steven Barth 0; } -@@ -2114,6 +2349,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2112,6 +2347,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -461,7 +461,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || -@@ -2123,9 +2361,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2121,9 +2359,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) || @@ -490,7 +490,7 @@ Signed-off-by: Steven Barth if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || -@@ -2165,6 +2421,7 @@ static const struct nla_policy ip6_tnl_p +@@ -2163,6 +2419,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, [IFLA_IPTUN_FWMARK] = { .type = NLA_U32 }, diff --git a/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index ad7ccdb04..61cc4e830 100644 --- a/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.19/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -5483,6 +5483,9 @@ static enum gro_result dev_gro_receive(s +@@ -5454,6 +5454,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -7141,6 +7144,48 @@ static void __netdev_adjacent_dev_unlink +@@ -7112,6 +7115,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -7191,6 +7236,7 @@ static int __netdev_upper_dev_link(struc +@@ -7162,6 +7207,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -7283,6 +7329,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -7254,6 +7300,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -7913,6 +7960,7 @@ int dev_set_mac_address(struct net_devic +@@ -7893,6 +7940,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch index dafd84759..1c180b225 100644 --- a/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-4.19/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1200,6 +1200,9 @@ void phy_detach(struct phy_device *phyde +@@ -1201,6 +1201,9 @@ void phy_detach(struct phy_device *phyde struct module *ndev_owner = dev->dev.parent->driver->owner; struct mii_bus *bus; diff --git a/target/linux/ipq40xx/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch b/target/linux/ipq40xx/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch index 01de23981..b77ab89e6 100644 --- a/target/linux/ipq40xx/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch +++ b/target/linux/ipq40xx/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch @@ -8,7 +8,7 @@ { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) }, { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) }, { "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, -@@ -1201,11 +1202,12 @@ static const struct flash_info spi_nor_i +@@ -1205,11 +1206,12 @@ static const struct flash_info spi_nor_i { }, }; @@ -23,7 +23,7 @@ tmp = nor->read_reg(nor, SPINOR_OP_RDID, id, SPI_NOR_MAX_ID_LEN); if (tmp < 0) { -@@ -1216,10 +1218,16 @@ static const struct flash_info *spi_nor_ +@@ -1220,10 +1222,16 @@ static const struct flash_info *spi_nor_ for (tmp = 0; tmp < ARRAY_SIZE(spi_nor_ids) - 1; tmp++) { info = &spi_nor_ids[tmp]; if (info->id_len) { @@ -42,7 +42,7 @@ dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n", id[0], id[1], id[2]); return ERR_PTR(-ENODEV); -@@ -2679,7 +2687,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2683,7 +2691,7 @@ int spi_nor_scan(struct spi_nor *nor, co info = spi_nor_match_id(name); /* Try to auto-detect if chip name wasn't specified or not found */ if (!info) @@ -51,7 +51,7 @@ if (IS_ERR_OR_NULL(info)) return -ENOENT; -@@ -2690,7 +2698,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2694,7 +2702,7 @@ int spi_nor_scan(struct spi_nor *nor, co if (name && info->id_len) { const struct flash_info *jinfo; diff --git a/target/linux/ipq40xx/patches-4.19/303-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch b/target/linux/ipq40xx/patches-4.19/303-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch index 426710745..66746b962 100644 --- a/target/linux/ipq40xx/patches-4.19/303-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch +++ b/target/linux/ipq40xx/patches-4.19/303-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch @@ -8,7 +8,7 @@ { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) }, { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) }, { "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, -@@ -1276,11 +1277,12 @@ static const struct flash_info spi_nor_i +@@ -1280,11 +1281,12 @@ static const struct flash_info spi_nor_i { }, }; @@ -23,7 +23,7 @@ tmp = nor->read_reg(nor, SPINOR_OP_RDID, id, SPI_NOR_MAX_ID_LEN); if (tmp < 0) { -@@ -1291,10 +1293,16 @@ static const struct flash_info *spi_nor_ +@@ -1295,10 +1297,16 @@ static const struct flash_info *spi_nor_ for (tmp = 0; tmp < ARRAY_SIZE(spi_nor_ids) - 1; tmp++) { info = &spi_nor_ids[tmp]; if (info->id_len) { @@ -42,7 +42,7 @@ dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n", id[0], id[1], id[2]); return ERR_PTR(-ENODEV); -@@ -2828,7 +2836,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2832,7 +2840,7 @@ int spi_nor_scan(struct spi_nor *nor, co info = spi_nor_match_id(name); /* Try to auto-detect if chip name wasn't specified or not found */ if (!info) @@ -51,7 +51,7 @@ if (IS_ERR_OR_NULL(info)) return -ENOENT; -@@ -2839,7 +2847,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2843,7 +2851,7 @@ int spi_nor_scan(struct spi_nor *nor, co if (name && info->id_len) { const struct flash_info *jinfo; diff --git a/target/linux/ipq806x/patches-4.19/0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime.patch b/target/linux/ipq806x/patches-4.19/0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime.patch index bb82251bf..c1cf02e74 100644 --- a/target/linux/ipq806x/patches-4.19/0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime.patch +++ b/target/linux/ipq806x/patches-4.19/0049-PM-OPP-Support-adjusting-OPP-voltages-at-runtime.patch @@ -39,7 +39,7 @@ Signed-off-by: Sylwester Nawrocki --- a/drivers/opp/core.c +++ b/drivers/opp/core.c -@@ -1623,6 +1623,75 @@ put_table: +@@ -1629,6 +1629,75 @@ put_table: } /** diff --git a/target/linux/ipq806x/patches-4.19/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch b/target/linux/ipq806x/patches-4.19/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch index 8ba2369dd..9f0b9ec6d 100644 --- a/target/linux/ipq806x/patches-4.19/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch +++ b/target/linux/ipq806x/patches-4.19/0052-PM-OPP-Update-the-voltage-tolerance-when-adjusting-t.patch @@ -17,7 +17,7 @@ Signed-off-by: Georgi Djakov --- a/drivers/opp/core.c +++ b/drivers/opp/core.c -@@ -1663,6 +1663,7 @@ int dev_pm_opp_adjust_voltage(struct dev +@@ -1669,6 +1669,7 @@ int dev_pm_opp_adjust_voltage(struct dev struct opp_table *opp_table; struct dev_pm_opp *tmp_opp, *opp = ERR_PTR(-ENODEV); int r = 0; @@ -25,7 +25,7 @@ Signed-off-by: Georgi Djakov /* Find the opp_table */ opp_table = _find_opp_table(dev); -@@ -1692,8 +1693,17 @@ int dev_pm_opp_adjust_voltage(struct dev +@@ -1698,8 +1699,17 @@ int dev_pm_opp_adjust_voltage(struct dev goto adjust_unlock; opp->supplies->u_volt = u_volt; diff --git a/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch b/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch index 63d12e688..784b10dd5 100644 --- a/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/202-core-linux-support-layerscape.patch @@ -77,8 +77,8 @@ Signed-off-by: Yangbo Lu * * A side effect of the link creation is re-ordering of dpm_list and the * devices_kset list by moving the consumer device and all devices depending -@@ -182,7 +182,8 @@ struct device_link *device_link_add(stru - struct device_link *link; +@@ -183,7 +183,8 @@ struct device_link *device_link_add(stru + bool rpm_put_supplier = false; if (!consumer || !supplier || - ((flags & DL_FLAG_STATELESS) && (flags & DL_FLAG_AUTOREMOVE))) @@ -86,8 +86,8 @@ Signed-off-by: Yangbo Lu + (flags & DL_FLAG_AUTOREMOVE_CONSUMER))) return NULL; - device_links_write_lock(); -@@ -200,8 +201,10 @@ struct device_link *device_link_add(stru + if (flags & DL_FLAG_PM_RUNTIME && flags & DL_FLAG_RPM_ACTIVE) { +@@ -209,8 +210,10 @@ struct device_link *device_link_add(stru } list_for_each_entry(link, &supplier->links.consumers, s_node) @@ -99,7 +99,7 @@ Signed-off-by: Yangbo Lu link = kzalloc(sizeof(*link), GFP_KERNEL); if (!link) -@@ -233,6 +236,7 @@ struct device_link *device_link_add(stru +@@ -237,6 +240,7 @@ struct device_link *device_link_add(stru link->consumer = consumer; INIT_LIST_HEAD(&link->c_node); link->flags = flags; @@ -107,7 +107,7 @@ Signed-off-by: Yangbo Lu /* Determine the initial link state. */ if (flags & DL_FLAG_STATELESS) { -@@ -303,8 +307,10 @@ static void __device_link_free_srcu(stru +@@ -311,8 +315,10 @@ static void __device_link_free_srcu(stru device_link_free(container_of(rhead, struct device_link, rcu_head)); } @@ -119,7 +119,7 @@ Signed-off-by: Yangbo Lu dev_info(link->consumer, "Dropping the link to %s\n", dev_name(link->supplier)); -@@ -316,8 +322,10 @@ static void __device_link_del(struct dev +@@ -324,8 +330,10 @@ static void __device_link_del(struct dev call_srcu(&device_links_srcu, &link->rcu_head, __device_link_free_srcu); } #else /* !CONFIG_SRCU */ @@ -131,7 +131,7 @@ Signed-off-by: Yangbo Lu dev_info(link->consumer, "Dropping the link to %s\n", dev_name(link->supplier)); -@@ -335,18 +343,50 @@ static void __device_link_del(struct dev +@@ -343,18 +351,50 @@ static void __device_link_del(struct dev * @link: Device link to delete. * * The caller must ensure proper synchronization of this function with runtime @@ -184,7 +184,7 @@ Signed-off-by: Yangbo Lu static void device_links_missing_supplier(struct device *dev) { struct device_link *link; -@@ -454,8 +494,8 @@ static void __device_links_no_driver(str +@@ -462,8 +502,8 @@ static void __device_links_no_driver(str if (link->flags & DL_FLAG_STATELESS) continue; @@ -195,7 +195,7 @@ Signed-off-by: Yangbo Lu else if (link->status != DL_STATE_SUPPLIER_UNBIND) WRITE_ONCE(link->status, DL_STATE_AVAILABLE); } -@@ -490,8 +530,18 @@ void device_links_driver_cleanup(struct +@@ -498,8 +538,18 @@ void device_links_driver_cleanup(struct if (link->flags & DL_FLAG_STATELESS) continue; @@ -215,7 +215,7 @@ Signed-off-by: Yangbo Lu WRITE_ONCE(link->status, DL_STATE_DORMANT); } -@@ -608,13 +658,13 @@ static void device_links_purge(struct de +@@ -616,13 +666,13 @@ static void device_links_purge(struct de list_for_each_entry_safe_reverse(link, ln, &dev->links.suppliers, c_node) { WARN_ON(link->status == DL_STATE_ACTIVE); @@ -231,7 +231,7 @@ Signed-off-by: Yangbo Lu } device_links_write_unlock(); -@@ -1036,6 +1086,34 @@ static ssize_t online_store(struct devic +@@ -1044,6 +1094,34 @@ static ssize_t online_store(struct devic } static DEVICE_ATTR_RW(online); @@ -266,7 +266,7 @@ Signed-off-by: Yangbo Lu int device_add_groups(struct device *dev, const struct attribute_group **groups) { return sysfs_create_groups(&dev->kobj, groups); -@@ -1207,8 +1285,20 @@ static int device_add_attrs(struct devic +@@ -1215,8 +1293,20 @@ static int device_add_attrs(struct devic goto err_remove_dev_groups; } @@ -287,7 +287,7 @@ Signed-off-by: Yangbo Lu err_remove_dev_groups: device_remove_groups(dev, dev->groups); err_remove_type_groups: -@@ -1226,6 +1316,8 @@ static void device_remove_attrs(struct d +@@ -1234,6 +1324,8 @@ static void device_remove_attrs(struct d struct class *class = dev->class; const struct device_type *type = dev->type; @@ -462,7 +462,7 @@ Signed-off-by: Yangbo Lu extern int __must_check bus_create_file(struct bus_type *, struct bus_attribute *); -@@ -750,14 +752,16 @@ enum device_link_state { +@@ -751,14 +753,16 @@ enum device_link_state { * Device link flags. * * STATELESS: The core won't track the presence of supplier/consumer drivers. @@ -484,7 +484,7 @@ Signed-off-by: Yangbo Lu /** * struct device_link - Device link representation. -@@ -768,6 +772,7 @@ enum device_link_state { +@@ -769,6 +773,7 @@ enum device_link_state { * @status: The state of the link (with respect to the presence of drivers). * @flags: Link flags. * @rpm_active: Whether or not the consumer device is runtime-PM-active. @@ -492,7 +492,7 @@ Signed-off-by: Yangbo Lu * @rcu_head: An RCU head to use for deferred execution of SRCU callbacks. */ struct device_link { -@@ -778,6 +783,7 @@ struct device_link { +@@ -779,6 +784,7 @@ struct device_link { enum device_link_state status; u32 flags; bool rpm_active; @@ -500,7 +500,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_SRCU struct rcu_head rcu_head; #endif -@@ -850,6 +856,8 @@ struct dev_links_info { +@@ -851,6 +857,8 @@ struct dev_links_info { * @coherent_dma_mask: Like dma_mask, but for alloc_coherent mapping as not all * hardware supports 64-bit addresses for consistent allocations * such descriptors. @@ -509,7 +509,7 @@ Signed-off-by: Yangbo Lu * @dma_pfn_offset: offset of DMA memory range relatively of RAM * @dma_parms: A low level driver may set these to teach IOMMU code about * segment limitations. -@@ -929,6 +937,7 @@ struct device { +@@ -930,6 +938,7 @@ struct device { not all hardware supports 64 bit addresses for consistent allocations such descriptors. */ @@ -517,7 +517,7 @@ Signed-off-by: Yangbo Lu unsigned long dma_pfn_offset; struct device_dma_parameters *dma_parms; -@@ -1267,6 +1276,7 @@ extern const char *dev_driver_string(con +@@ -1268,6 +1277,7 @@ extern const char *dev_driver_string(con struct device_link *device_link_add(struct device *consumer, struct device *supplier, u32 flags); void device_link_del(struct device_link *link); @@ -580,7 +580,7 @@ Signed-off-by: Yangbo Lu void __kfree_skb(struct sk_buff *skb); extern struct kmem_cache *skbuff_head_cache; -@@ -3313,6 +3314,7 @@ static inline void skb_free_datagram_loc +@@ -3315,6 +3316,7 @@ static inline void skb_free_datagram_loc } int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags); int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len); diff --git a/target/linux/layerscape/patches-4.14/811-clock-support-layerscape.patch b/target/linux/layerscape/patches-4.14/811-clock-support-layerscape.patch index 331c77c80..09a33572f 100644 --- a/target/linux/layerscape/patches-4.14/811-clock-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/811-clock-support-layerscape.patch @@ -75,7 +75,7 @@ Signed-off-by: Yogesh Gaur snprintf(pll->div[i].name, sizeof(pll->div[i].name), "cg-pll%d-div%d", idx, i + 1); -@@ -1417,6 +1435,7 @@ CLK_OF_DECLARE(qoriq_clockgen_ls1043a, " +@@ -1418,6 +1436,7 @@ CLK_OF_DECLARE(qoriq_clockgen_ls1043a, " CLK_OF_DECLARE(qoriq_clockgen_ls1046a, "fsl,ls1046a-clockgen", clockgen_init); CLK_OF_DECLARE(qoriq_clockgen_ls1088a, "fsl,ls1088a-clockgen", clockgen_init); CLK_OF_DECLARE(qoriq_clockgen_ls2080a, "fsl,ls2080a-clockgen", clockgen_init); diff --git a/target/linux/layerscape/patches-4.14/812-flexspi-support-layerscape.patch b/target/linux/layerscape/patches-4.14/812-flexspi-support-layerscape.patch index 3ecec1756..fa1cdf075 100644 --- a/target/linux/layerscape/patches-4.14/812-flexspi-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/812-flexspi-support-layerscape.patch @@ -1534,7 +1534,7 @@ Signed-off-by: Yogesh Gaur /* PMC */ { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) }, { "pm25lv010", INFO(0, 0, 32 * 1024, 4, SECT_4K_PMC) }, -@@ -2431,6 +2438,7 @@ static int spi_nor_init_params(struct sp +@@ -2435,6 +2442,7 @@ static int spi_nor_init_params(struct sp params->quad_enable = macronix_quad_enable; break; @@ -1542,7 +1542,7 @@ Signed-off-by: Yogesh Gaur case SNOR_MFR_MICRON: break; -@@ -2749,7 +2757,8 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2753,7 +2761,8 @@ int spi_nor_scan(struct spi_nor *nor, co mtd->_read = spi_nor_read; /* NOR protection support for STmicro/Micron chips and similar */ diff --git a/target/linux/layerscape/patches-4.14/820-sec-support-layerscape.patch b/target/linux/layerscape/patches-4.14/820-sec-support-layerscape.patch index 9632b32d5..63f6540be 100644 --- a/target/linux/layerscape/patches-4.14/820-sec-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.14/820-sec-support-layerscape.patch @@ -11852,7 +11852,7 @@ Signed-off-by: Zhao Qiang dev = caam_jr_alloc(); if (IS_ERR(dev)) { -@@ -361,10 +342,3 @@ free_caam_alloc: +@@ -364,10 +345,3 @@ free_caam_alloc: caam_jr_free(dev); return err; } diff --git a/target/linux/mediatek/Makefile b/target/linux/mediatek/Makefile index 28101a70d..4d7df9852 100644 --- a/target/linux/mediatek/Makefile +++ b/target/linux/mediatek/Makefile @@ -9,7 +9,7 @@ SUBTARGETS:=mt7622 mt7623 mt7629 FEATURES:=squashfs nand ramdisk fpu MAINTAINER:=John Crispin -KERNEL_PATCHVER:=4.14 +KERNEL_PATCHVER:=4.19 include $(INCLUDE_DIR)/target.mk DEFAULT_PACKAGES += \ diff --git a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622.dtsi index 3fdd06a8d..a5c0a5d54 100644 --- a/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622.dtsi +++ b/target/linux/mediatek/files-4.19/arch/arm64/boot/dts/mediatek/mt7622.dtsi @@ -664,6 +664,17 @@ status = "disabled"; }; + wmac: wmac@18000000 { + compatible = "mediatek,mt7622-wmac"; + reg = <0 0x18000000 0 0x100000>; + interrupts = ; + + mediatek,infracfg = <&infracfg>; + status = "disabled"; + + power-domains = <&scpsys MT7622_POWER_DOMAIN_WB>; + }; + ssusbsys: ssusbsys@1a000000 { compatible = "mediatek,mt7622-ssusbsys", "syscon"; diff --git a/target/linux/mediatek/image/gen_mt7623_emmc_img.sh b/target/linux/mediatek/image/gen_mt7623_emmc_img.sh index 1cb0883fb..a5f296ef1 100755 --- a/target/linux/mediatek/image/gen_mt7623_emmc_img.sh +++ b/target/linux/mediatek/image/gen_mt7623_emmc_img.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh OUTPUT_FILE=$1 KERNEL_FILE=$2 diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index b84a3a6b5..9a5aedc88 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -1,4 +1,4 @@ -define Device/MTK-RFB1 +define Device/mediatek_mt7622-rfb1 DEVICE_VENDOR := MediaTek DEVICE_MODEL := MTK7622 rfb1 AP DEVICE_DTS := mt7622-rfb1 @@ -6,24 +6,26 @@ define Device/MTK-RFB1 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3 \ kmod-ata-core kmod-ata-ahci-mtk endef -TARGET_DEVICES += MTK-RFB1 +TARGET_DEVICES += mediatek_mt7622-rfb1 -define Device/MTK-LYNX-RFB1 +define Device/mediatek_mt7622-lynx-rfb1 DEVICE_VENDOR := MediaTek DEVICE_MODEL := MTK7622 Lynx rfb1 AP DEVICE_DTS := mt7622-lynx-rfb1 DEVICE_DTS_DIR := $(DTS_DIR)/mediatek + SUPPORTED_DEVICES := mediatek,mt7622-rfb1 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3 \ kmod-ata-core kmod-ata-ahci-mtk endef -TARGET_DEVICES += MTK-LYNX-RFB1 +TARGET_DEVICES += mediatek_mt7622-lynx-rfb1 -define Device/BPI-R64 +define Device/lemaker_bananapi-bpi-r64 DEVICE_VENDOR := LeMaker DEVICE_MODEL := Banana Pi R64 DEVICE_DTS := mt7622-bananapi-bpi-r64 DEVICE_DTS_DIR := $(DTS_DIR)/mediatek + SUPPORTED_DEVICES := bananapi,bpi-r64 DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb3 \ kmod-ata-core kmod-ata-ahci-mtk endef -TARGET_DEVICES += BPI-R64 +TARGET_DEVICES += lemaker_bananapi-bpi-r64 diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index 3f7297984..fd609d22f 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -1,20 +1,18 @@ -define Device/7623a-unielec-u7623-02-emmc-512m +define Device/unielec_u7623-02-emmc-512m DEVICE_VENDOR := UniElec DEVICE_MODEL := U7623-02 DEVICE_VARIANT := eMMC/512MB RAM - DEVICE_DTS := mt7623a-unielec-u7623-02-emmc-512M + DEVICE_DTS := mt7623a-unielec-u7623-02-emmc-512m DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc - SUPPORTED_DEVICES := unielec,u7623-02-emmc-512m IMAGES := sysupgrade-emmc.bin.gz IMAGE/sysupgrade-emmc.bin.gz := sysupgrade-emmc | gzip | append-metadata endef +TARGET_DEVICES += unielec_u7623-02-emmc-512m -TARGET_DEVICES += 7623a-unielec-u7623-02-emmc-512m - -define Device/7623n-bananapi-bpi-r2 +define Device/lemaker_bananapi-bpi-r2 DEVICE_VENDOR := LeMaker DEVICE_MODEL := Banana Pi R2 DEVICE_DTS := mt7623n-bananapi-bpi-r2 + SUPPORTED_DEVICES := bananapi,bpi-r2 endef - -TARGET_DEVICES += 7623n-bananapi-bpi-r2 +TARGET_DEVICES += lemaker_bananapi-bpi-r2 diff --git a/target/linux/mediatek/image/mt7629.mk b/target/linux/mediatek/image/mt7629.mk index ba1daefa0..71fb3dda0 100644 --- a/target/linux/mediatek/image/mt7629.mk +++ b/target/linux/mediatek/image/mt7629.mk @@ -5,4 +5,3 @@ define Device/mediatek_mt7629-lynx-rfb DEVICE_PACKAGES := swconfig endef TARGET_DEVICES += mediatek_mt7629-lynx-rfb - diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network new file mode 100755 index 000000000..d719a35de --- /dev/null +++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network @@ -0,0 +1,29 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +mediatek_setup_interfaces() +{ + local board="$1" + + case $board in + esac +} + +mediatek_setup_macs() +{ + local board="$1" + + case $board in + esac +} + +board_config_update +board=$(board_name) +mediatek_setup_interfaces $board +mediatek_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh new file mode 100755 index 000000000..f2264592a --- /dev/null +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -0,0 +1,26 @@ +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + *) + default_do_upgrade "$1" + ;; + esac +} + +PART_NAME=firmware + +platform_check_image() { + local board=$(board_name) + + [ "$#" -gt 1 ] && return 1 + + case "$board" in + *) + echo "Sysupgrade is not supported on your board yet." + return 1 + ;; + esac + + return 0 +} diff --git a/target/linux/mediatek/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7623/base-files/etc/board.d/02_network similarity index 62% rename from target/linux/mediatek/base-files/etc/board.d/02_network rename to target/linux/mediatek/mt7623/base-files/etc/board.d/02_network index faa243424..391b1ddc0 100755 --- a/target/linux/mediatek/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/mt7623/base-files/etc/board.d/02_network @@ -9,12 +9,8 @@ mediatek_setup_interfaces() local board="$1" case $board in - 'mediatek,mt7623a-rfb-emmc') - ucidef_set_interface_lan "lan0 lan1 lan2 lan3" - ucidef_set_interface_wan eth1 - ;; - 'bananapi,bpi-r2'|\ - "unielec,u7623"*) + bananapi,bpi-r2|\ + unielec,u7623-02-emmc-512m) ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" "wan" ;; esac @@ -25,9 +21,8 @@ mediatek_setup_macs() local board="$1" case $board in - "unielec,u7623"*) - mac=$(cat /sys/class/net/wan/address) - ucidef_set_interface_macaddr "wan" $mac + unielec,u7623-02-emmc-512m) + ucidef_set_interface_macaddr "wan" "$(cat /sys/class/net/wan/address)" ;; esac } diff --git a/target/linux/mediatek/base-files/lib/preinit/07_set_iface_mac b/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac similarity index 97% rename from target/linux/mediatek/base-files/lib/preinit/07_set_iface_mac rename to target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac index 3d0400073..7a73a2d84 100644 --- a/target/linux/mediatek/base-files/lib/preinit/07_set_iface_mac +++ b/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac @@ -10,7 +10,7 @@ preinit_set_mac_address() { . /lib/functions/system.sh case $(board_name) in - "unielec,u7623"*) + unielec,u7623-02-emmc-512m) if [ -b $RECOVERY_PART ]; then insmod nls_cp437 insmod nls_iso8859-1 diff --git a/target/linux/mediatek/base-files/lib/preinit/79_move_config b/target/linux/mediatek/mt7623/base-files/lib/preinit/79_move_config similarity index 100% rename from target/linux/mediatek/base-files/lib/preinit/79_move_config rename to target/linux/mediatek/mt7623/base-files/lib/preinit/79_move_config diff --git a/target/linux/mediatek/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh similarity index 50% rename from target/linux/mediatek/base-files/lib/upgrade/platform.sh rename to target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh index 9c99ee1c1..225fec0bc 100755 --- a/target/linux/mediatek/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7623/base-files/lib/upgrade/platform.sh @@ -1,7 +1,8 @@ -platform_do_upgrade() { +platform_do_upgrade() { local board=$(board_name) + case "$board" in - "unielec,u7623"*) + unielec,u7623-02-emmc-512m) #Keep the persisten random mac address (if it exists) mkdir -p /tmp/recovery mount -o rw,noatime /dev/mmcblk0p1 /tmp/recovery @@ -26,29 +27,28 @@ platform_do_upgrade() { PART_NAME=firmware -platform_check_image() { - local board=$(board_name) - local magic="$(get_magic_long "$1")" +platform_check_image() { + local board=$(board_name) + local magic="$(get_magic_long "$1")" - [ "$#" -gt 1 ] && return 1 + [ "$#" -gt 1 ] && return 1 - case "$board" in + case "$board" in bananapi,bpi-r2|\ - "unielec,u7623"*) - [ "$magic" != "27051956" ] && { + unielec,u7623-02-emmc-512m) + [ "$magic" != "27051956" ] && { echo "Invalid image type." - return 1 - } - return 0 - ;; - - *) + return 1 + } + return 0 + ;; + *) echo "Sysupgrade is not supported on your board yet." - return 1 - ;; - esac + return 1 + ;; + esac - return 0 + return 0 } platform_copy_config_emmc() { @@ -61,7 +61,7 @@ platform_copy_config_emmc() { platform_copy_config() { case "$(board_name)" in - "unielec,u7623"*) + unielec,u7623-02-emmc-512m) platform_copy_config_emmc ;; esac diff --git a/target/linux/mediatek/mt7623/config-4.19 b/target/linux/mediatek/mt7623/config-4.19 new file mode 100644 index 000000000..57c014819 --- /dev/null +++ b/target/linux/mediatek/mt7623/config-4.19 @@ -0,0 +1,515 @@ +# CONFIG_AIO is not set +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_KCOV=y +CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y +CONFIG_ARCH_HAS_PHYS_TO_DMA=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MEDIATEK=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +# CONFIG_ARM_ATAG_DTB_COMPAT is not set +CONFIG_ARM_CPU_SUSPEND=y +# CONFIG_ARM_CPU_TOPOLOGY is not set +CONFIG_ARM_GIC=y +CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +# CONFIG_ARM_LPAE is not set +CONFIG_ARM_MEDIATEK_CPUFREQ=y +CONFIG_ARM_PATCH_IDIV=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_SMMU is not set +CONFIG_ARM_THUMB=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_UNWIND=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_ATAGS=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BOUNCE=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_CLEANCACHE=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="earlyprintk console=ttyS0,115200 rootfstype=squashfs,jffs2" +CONFIG_CMDLINE_FROM_BOOTLOADER=y +CONFIG_COMMON_CLK=y +CONFIG_COMMON_CLK_MEDIATEK=y +CONFIG_COMMON_CLK_MT2701=y +# CONFIG_COMMON_CLK_MT2701_AUDSYS is not set +CONFIG_COMMON_CLK_MT2701_BDPSYS=y +CONFIG_COMMON_CLK_MT2701_ETHSYS=y +# CONFIG_COMMON_CLK_MT2701_G3DSYS is not set +CONFIG_COMMON_CLK_MT2701_HIFSYS=y +CONFIG_COMMON_CLK_MT2701_IMGSYS=y +CONFIG_COMMON_CLK_MT2701_MMSYS=y +CONFIG_COMMON_CLK_MT2701_VDECSYS=y +# CONFIG_COMMON_CLK_MT7622 is not set +# CONFIG_COMMON_CLK_MT7629 is not set +# CONFIG_COMMON_CLK_MT7629_ETHSYS is not set +# CONFIG_COMMON_CLK_MT7629_HIFSYS is not set +# CONFIG_COMMON_CLK_MT8135 is not set +# CONFIG_COMMON_CLK_MT8173 is not set +CONFIG_COREDUMP=y +# CONFIG_CPUFREQ_DT is not set +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +# CONFIG_CPU_BPREDICT_DISABLE is not set +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +# CONFIG_CPU_FREQ_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_HAS_ASID=y +# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set +# CONFIG_CPU_ICACHE_DISABLE is not set +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_PM=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_SPECTRE=y +# CONFIG_CPU_THERMAL is not set +CONFIG_CPU_THUMB_CAPABLE=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRC16=y +# CONFIG_CRC32_SARWATE is not set +CONFIG_CRC32_SLICEBY8=y +CONFIG_CROSS_MEMORY_ATTACH=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_CTR=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_DEV_MEDIATEK=y +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_HMAC=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_SEQIV=y +CONFIG_CRYPTO_SHA1=y +CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DEBUG_ALIGN_RODATA=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_GPIO=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_MT6589_UART0=y +# CONFIG_DEBUG_MT8127_UART0 is not set +# CONFIG_DEBUG_MT8135_UART3 is not set +CONFIG_DEBUG_PREEMPT=y +CONFIG_DEBUG_UART_8250=y +# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set +CONFIG_DEBUG_UART_8250_SHIFT=2 +# CONFIG_DEBUG_UART_8250_WORD is not set +CONFIG_DEBUG_UART_PHYS=0x11004000 +CONFIG_DEBUG_UART_VIRT=0xf1004000 +CONFIG_DEBUG_UNCOMPRESS=y +# CONFIG_DEBUG_USER is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EINT_MTK=y +CONFIG_ELF_CORE=y +CONFIG_EXT4_FS=y +# CONFIG_F2FS_CHECK_FS is not set +CONFIG_F2FS_FS=y +# CONFIG_F2FS_FS_SECURITY is not set +CONFIG_F2FS_FS_XATTR=y +CONFIG_F2FS_STAT_FS=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FREEZER=y +CONFIG_FS_IOMAP=y +CONFIG_FS_MBCACHE=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_IRQ_MULTI_HANDLER=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_PINCTRL_GROUPS=y +CONFIG_GENERIC_PINMUX_FUNCTIONS=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARM_ARCH_TIMER=y +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_EBPF_JIT=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_RSEQ=y +CONFIG_HAVE_SMP=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HIGHMEM=y +# CONFIG_HIGHPTE is not set +CONFIG_HOTPLUG_CPU=y +CONFIG_HWMON=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_MTK=y +CONFIG_HZ_FIXED=0 +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MT65XX=y +CONFIG_ICPLUS_PHY=y +CONFIG_IIO=y +# CONFIG_IIO_BUFFER is not set +# CONFIG_IIO_TRIGGER is not set +CONFIG_INITRAMFS_COMPRESSION="" +CONFIG_INITRAMFS_ROOT_GID=1000 +CONFIG_INITRAMFS_ROOT_UID=1000 +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_IOMMU_DEBUGFS is not set +# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set +# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set +CONFIG_IOMMU_SUPPORT=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_KALLSYMS=y +CONFIG_LEDS_MT6323=y +CONFIG_LIBFDT=y +CONFIG_LOCK_DEBUGGING_SUPPORT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +# CONFIG_MACH_MT2701 is not set +# CONFIG_MACH_MT6589 is not set +# CONFIG_MACH_MT6592 is not set +CONFIG_MACH_MT7623=y +# CONFIG_MACH_MT7629 is not set +# CONFIG_MACH_MT8127 is not set +# CONFIG_MACH_MT8135 is not set +CONFIG_MAGIC_SYSRQ=y +CONFIG_MDIO_BITBANG=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_GPIO=y +CONFIG_MEDIATEK_MT6577_AUXADC=y +CONFIG_MEDIATEK_WATCHDOG=y +CONFIG_MEMFD_CREATE=y +CONFIG_MFD_CORE=y +CONFIG_MFD_MT6397=y +CONFIG_MFD_SYSCON=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_MTK=y +CONFIG_MMC_SDHCI=y +# CONFIG_MMC_SDHCI_PCI is not set +CONFIG_MMC_SDHCI_PLTFM=y +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MODULES_USE_ELF_REL=y +# CONFIG_MT753X_GSW is not set +CONFIG_MTD_BLOCK2MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_M25P80=y +CONFIG_MTD_MT81xx_NOR=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_MTK=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPLIT_FIRMWARE=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_BLOCK=y +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MTK_EFUSE=y +# CONFIG_MTK_HSDMA is not set +CONFIG_MTK_INFRACFG=y +# CONFIG_MTK_IOMMU is not set +# CONFIG_MTK_IOMMU_V1 is not set +CONFIG_MTK_PMIC_WRAP=y +CONFIG_MTK_SCPSYS=y +CONFIG_MTK_THERMAL=y +CONFIG_MTK_TIMER=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEON=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_MT7530=y +CONFIG_NET_DSA_TAG_MTK=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_MEDIATEK_SOC=y +CONFIG_NET_SWITCHDEV=y +# CONFIG_NET_VENDOR_AURORA is not set +CONFIG_NET_VENDOR_MEDIATEK=y +# CONFIG_NET_VENDOR_WIZNET is not set +CONFIG_NLS=y +CONFIG_NO_BOOTMEM=y +CONFIG_NO_HZ=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +CONFIG_NR_CPUS=4 +CONFIG_NVMEM=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_KOBJ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_OF_RESERVED_MEM=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_MEDIATEK=y +CONFIG_PCIE_PME=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +# CONFIG_PCI_V3_SEMI is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PHYLINK=y +CONFIG_PHY_MTK_TPHY=y +# CONFIG_PHY_MTK_XSPHY is not set +CONFIG_PINCTRL=y +CONFIG_PINCTRL_MT2701=y +CONFIG_PINCTRL_MT6397=y +CONFIG_PINCTRL_MT7623=y +# CONFIG_PINCTRL_MT7629 is not set +CONFIG_PINCTRL_MTK=y +CONFIG_PINCTRL_MTK_MOORE=y +CONFIG_PM=y +CONFIG_PM_CLK=y +# CONFIG_PM_DEBUG is not set +CONFIG_PM_GENERIC_DOMAINS=y +CONFIG_PM_GENERIC_DOMAINS_OF=y +CONFIG_PM_GENERIC_DOMAINS_SLEEP=y +CONFIG_PM_OPP=y +CONFIG_PM_SLEEP=y +CONFIG_PM_SLEEP_SMP=y +CONFIG_POWER_RESET=y +CONFIG_POWER_SUPPLY=y +CONFIG_PREEMPT=y +CONFIG_PREEMPT_COUNT=y +# CONFIG_PREEMPT_NONE is not set +CONFIG_PREEMPT_RCU=y +CONFIG_PRINTK_TIME=y +CONFIG_PWM=y +CONFIG_PWM_MEDIATEK=y +# CONFIG_PWM_MTK_DISP is not set +CONFIG_PWM_SYSFS=y +CONFIG_RAS=y +CONFIG_RATIONAL=y +CONFIG_RCU_CPU_STALL_TIMEOUT=21 +# CONFIG_RCU_EXPERT is not set +CONFIG_RCU_NEED_SEGCBLIST=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_REFCOUNT_FULL=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_GPIO=y +CONFIG_REGULATOR_MT6323=y +# CONFIG_REGULATOR_MT6380 is not set +# CONFIG_REGULATOR_MT6397 is not set +# CONFIG_REGULATOR_QCOM_SPMI is not set +CONFIG_RESET_CONTROLLER=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +# CONFIG_RTC_DRV_CMOS is not set +# CONFIG_RTC_DRV_MT6397 is not set +# CONFIG_RTC_DRV_MT7622 is not set +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SERIAL_8250_DMA is not set +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_MT6577=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SFP is not set +CONFIG_SGL_ALLOC=y +CONFIG_SMP=y +# CONFIG_SMP_ON_UP is not set +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_BITBANG=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_MEM=y +CONFIG_SPI_MT65XX=y +# CONFIG_SPI_MTK_SNFI is not set +CONFIG_SPMI=y +CONFIG_SRCU=y +# CONFIG_STRIP_ASM_SYMS is not set +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +CONFIG_SWCONFIG=y +CONFIG_SWPHY=y +CONFIG_SWP_EMULATE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TASKS_RCU=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_OF=y +# CONFIG_THUMB2_KERNEL is not set +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TREE_SRCU=y +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_UEVENT_HELPER_PATH="" +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +# CONFIG_USB_EHCI_HCD is not set +CONFIG_USB_SUPPORT=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_MTK=y +CONFIG_USB_XHCI_PLATFORM=y +CONFIG_USE_OF=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WATCHDOG_CORE=y +CONFIG_XPS=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0 +CONFIG_ZBOOT_ROM_TEXT=0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/mediatek/mt7629/target.mk b/target/linux/mediatek/mt7629/target.mk index 4bec630c1..e0eafe030 100644 --- a/target/linux/mediatek/mt7629/target.mk +++ b/target/linux/mediatek/mt7629/target.mk @@ -9,7 +9,6 @@ CPU_TYPE:=cortex-a7 FEATURES:=squashfs nand ramdisk KERNELNAME:=Image dtbs -KERNEL_PATCHVER:=4.19 define Target/Description Build firmware images for MediaTek mt7629 ARM based boards. diff --git a/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch b/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch index c396e314a..bb49ee75e 100644 --- a/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch +++ b/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1943,7 +1943,7 @@ static struct phy_driver genphy_driver = +@@ -1944,7 +1944,7 @@ static struct phy_driver genphy_driver = .config_init = genphy_config_init, .features = PHY_GBIT_FEATURES | SUPPORTED_MII | SUPPORTED_AUI | SUPPORTED_FIBRE | diff --git a/target/linux/mediatek/patches-4.14/0064-dts.patch b/target/linux/mediatek/patches-4.14/0064-dts.patch index a2f5000d4..ec9adfbb4 100644 --- a/target/linux/mediatek/patches-4.14/0064-dts.patch +++ b/target/linux/mediatek/patches-4.14/0064-dts.patch @@ -115,468 +115,6 @@ &i2c0 { pinctrl-names = "default"; ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -1061,6 +1061,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \ - mt6580-evbp1.dtb \ - mt6589-aquaris5.dtb \ - mt6592-evb.dtb \ -+ mt7623a-rfb-emmc.dtb \ - mt7623n-rfb-nand.dtb \ - mt7623n-bananapi-bpi-r2.dtb \ - mt8127-moose.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/mt7623a-rfb-emmc.dts -@@ -0,0 +1,449 @@ -+/* -+ * Copyright 2017 Sean Wang -+ * -+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+ */ -+ -+/dts-v1/; -+#include -+#include "mt7623.dtsi" -+#include "mt6323.dtsi" -+ -+/ { -+ model = "MediaTek MT7623N NAND reference board"; -+ compatible = "mediatek,mt7623a-rfb-emmc", "mediatek,mt7623"; -+ -+ aliases { -+ serial2 = &uart2; -+ }; -+ -+ chosen { -+ bootargs = "earlyprintk block2mtd.block2mtd=/dev/mmcblk0,65536,eMMC,5 mtdparts=eMMC:256k(mbr)ro,512k(uboot)ro,256k(config)ro,256k(factory)ro,32M(kernel),32M(recovery),1024M(rootfs),2048M(usrdata),-(bmtpool) rootfstype=squashfs,jffs2"; -+ -+ stdout-path = "serial2:115200n8"; -+ }; -+ -+ memory { -+ reg = <0 0x80000000 0 0x20000000>; -+ }; -+ -+ cpus { -+ cpu@0 { -+ proc-supply = <&mt6323_vproc_reg>; -+ }; -+ -+ cpu@1 { -+ proc-supply = <&mt6323_vproc_reg>; -+ }; -+ -+ cpu@2 { -+ proc-supply = <&mt6323_vproc_reg>; -+ }; -+ -+ cpu@3 { -+ proc-supply = <&mt6323_vproc_reg>; -+ }; -+ }; -+ -+ memory@80000000 { -+ reg = <0 0x80000000 0 0x40000000>; -+ }; -+ -+ mt7530: switch@0 { -+ compatible = "mediatek,mt7530"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+}; -+ -+&crypto { -+ status = "okay"; -+}; -+ -+ð { -+ status = "okay"; -+ -+ gmac0: mac@0 { -+ compatible = "mediatek,eth-mac"; -+ reg = <0>; -+ phy-mode = "trgmii"; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ pause; -+ }; -+ }; -+ -+ gmac1: mac@1 { -+ compatible = "mediatek,eth-mac"; -+ reg = <1>; -+ phy-mode = "rgmiii-rxid"; -+ phy-handle = <&phy5>; -+ }; -+ -+ mdio: mdio-bus { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ phy5: ethernet-phy@5 { -+ reg = <5>; -+ phy-mode = "rgmii-rxid"; -+ }; -+ }; -+}; -+ -+&mt7530 { -+ compatible = "mediatek,mt7530"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0>; -+ pinctrl-names = "default"; -+ mediatek,mcm; -+ resets = <ðsys 2>; -+ reset-names = "mcm"; -+ core-supply = <&mt6323_vpa_reg>; -+ io-supply = <&mt6323_vemc3v3_reg>; -+ -+ dsa,mii-bus = <&mdio>; -+ -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0>; -+ -+ port@0 { -+ reg = <0>; -+ label = "lan0"; -+ cpu = <&cpu_port0>; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ label = "lan1"; -+ cpu = <&cpu_port0>; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ label = "lan2"; -+ cpu = <&cpu_port0>; -+ }; -+ -+ port@3 { -+ reg = <3>; -+ label = "lan3"; -+ cpu = <&cpu_port0>; -+ }; -+ -+ cpu_port0: port@6 { -+ reg = <6>; -+ label = "cpu"; -+ ethernet = <&gmac0>; -+ phy-mode = "trgmii"; -+ -+ fixed-link { -+ speed = <1000>; -+ full-duplex; -+ }; -+ }; -+ }; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default", "state_uhs"; -+ pinctrl-0 = <&mmc0_pins_default>; -+ pinctrl-1 = <&mmc0_pins_uhs>; -+ status = "okay"; -+ bus-width = <8>; -+ max-frequency = <50000000>; -+ cap-mmc-highspeed; -+ vmmc-supply = <&mt6323_vemc3v3_reg>; -+ vqmmc-supply = <&mt6323_vio18_reg>; -+ non-removable; -+}; -+ -+&mmc1 { -+ pinctrl-names = "default", "state_uhs"; -+ pinctrl-0 = <&mmc1_pins_default>; -+ pinctrl-1 = <&mmc1_pins_uhs>; -+ status = "okay"; -+ bus-width = <4>; -+ max-frequency = <50000000>; -+ cap-sd-highspeed; -+ cd-gpios = <&pio 261 0>; -+ vmmc-supply = <&mt6323_vmch_reg>; -+ vqmmc-supply = <&mt6323_vio18_reg>; -+}; -+ -+&pio { -+ cir_pins_a:cir@0 { -+ pins_cir { -+ pinmux = ; -+ bias-disable; -+ }; -+ }; -+ -+ i2c0_pins_a: i2c@0 { -+ pins_i2c0 { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ }; -+ -+ i2c1_pins_a: i2c@1 { -+ pin_i2c1 { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ }; -+ -+ i2s0_pins_a: i2s@0 { -+ pin_i2s0 { -+ pinmux = , -+ , -+ , -+ , -+ ; -+ drive-strength = ; -+ bias-pull-down; -+ }; -+ }; -+ -+ i2s1_pins_a: i2s@1 { -+ pin_i2s1 { -+ pinmux = , -+ , -+ , -+ , -+ ; -+ drive-strength = ; -+ bias-pull-down; -+ }; -+ }; -+ -+ mmc0_pins_default: mmc0default { -+ pins_cmd_dat { -+ pinmux = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ input-enable; -+ bias-pull-up; -+ }; -+ -+ pins_clk { -+ pinmux = ; -+ bias-pull-down; -+ }; -+ -+ pins_rst { -+ pinmux = ; -+ bias-pull-up; -+ }; -+ }; -+ -+ mmc0_pins_uhs: mmc0 { -+ pins_cmd_dat { -+ pinmux = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ input-enable; -+ drive-strength = ; -+ bias-pull-up = ; -+ }; -+ -+ pins_clk { -+ pinmux = ; -+ drive-strength = ; -+ bias-pull-down = ; -+ }; -+ -+ pins_rst { -+ pinmux = ; -+ bias-pull-up; -+ }; -+ }; -+ -+ mmc1_pins_default: mmc1default { -+ pins_cmd_dat { -+ pinmux = , -+ , -+ , -+ , -+ ; -+ input-enable; -+ drive-strength = ; -+ bias-pull-up = ; -+ }; -+ -+ pins_clk { -+ pinmux = ; -+ bias-pull-down; -+ drive-strength = ; -+ }; -+ -+ pins_wp { -+ pinmux = ; -+ input-enable; -+ bias-pull-up; -+ }; -+ -+ pins_insert { -+ pinmux = ; -+ bias-pull-up; -+ }; -+ }; -+ -+ mmc1_pins_uhs: mmc1 { -+ pins_cmd_dat { -+ pinmux = , -+ , -+ , -+ , -+ ; -+ input-enable; -+ drive-strength = ; -+ bias-pull-up = ; -+ }; -+ -+ pins_clk { -+ pinmux = ; -+ drive-strength = ; -+ bias-pull-down = ; -+ }; -+ }; -+ -+ pwm_pins_a: pwm@0 { -+ pins_pwm { -+ pinmux = , -+ , -+ , -+ , -+ ; -+ }; -+ }; -+ -+ spi0_pins_a: spi@0 { -+ pins_spi { -+ pinmux = , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ }; -+ -+ uart0_pins_a: uart@0 { -+ pins_dat { -+ pinmux = , -+ ; -+ }; -+ }; -+ -+ uart1_pins_a: uart@1 { -+ pins_dat { -+ pinmux = , -+ ; -+ }; -+ }; -+}; -+ -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm_pins_a>; -+ status = "okay"; -+}; -+ -+&pwrap { -+ mt6323 { -+ mt6323led: led { -+ compatible = "mediatek,mt6323-led"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ led@0 { -+ reg = <0>; -+ label = "bpi-r2:isink:green"; -+ default-state = "off"; -+ }; -+ -+ led@1 { -+ reg = <1>; -+ label = "bpi-r2:isink:red"; -+ default-state = "off"; -+ }; -+ -+ led@2 { -+ reg = <2>; -+ label = "bpi-r2:isink:blue"; -+ default-state = "off"; -+ }; -+ }; -+ }; -+}; -+ -+&spi0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi0_pins_a>; -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "disabled"; -+}; -+ -+&uart1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart1_pins_a>; -+ status = "disabled"; -+}; -+ -+&uart2 { -+ status = "okay"; -+}; -+ -+&usb1 { -+ vusb33-supply = <&mt6323_vusb_reg>; -+ status = "okay"; -+}; -+ -+&usb2 { -+ vusb33-supply = <&mt6323_vusb_reg>; -+ status = "okay"; -+}; -+ -+&u3phy1 { -+ status = "okay"; -+}; -+ -+&u3phy2 { -+ status = "okay"; -+}; -+ --- a/arch/arm/boot/dts/mt7623.dtsi +++ b/arch/arm/boot/dts/mt7623.dtsi @@ -326,6 +326,7 @@ diff --git a/target/linux/mediatek/patches-4.14/0143-mmc-mediatek-add-support-of-mt2701-mt2712.patch b/target/linux/mediatek/patches-4.14/0143-mmc-mediatek-add-support-of-mt2701-mt2712.patch index 9b43df80e..c06cf73a7 100644 --- a/target/linux/mediatek/patches-4.14/0143-mmc-mediatek-add-support-of-mt2701-mt2712.patch +++ b/target/linux/mediatek/patches-4.14/0143-mmc-mediatek-add-support-of-mt2701-mt2712.patch @@ -26,7 +26,7 @@ Signed-off-by: Ulf Hansson /* MSDC_IOCON mask */ #define MSDC_IOCON_SDR104CKS (0x1 << 0) /* RW */ -@@ -295,6 +298,10 @@ struct msdc_save_para { +@@ -297,6 +300,10 @@ struct msdc_save_para { u32 emmc50_cfg0; }; @@ -37,7 +37,7 @@ Signed-off-by: Ulf Hansson struct msdc_tune_para { u32 iocon; u32 pad_tune; -@@ -309,6 +316,7 @@ struct msdc_delay_phase { +@@ -311,6 +318,7 @@ struct msdc_delay_phase { struct msdc_host { struct device *dev; @@ -45,7 +45,7 @@ Signed-off-by: Ulf Hansson struct mmc_host *mmc; /* mmc structure */ int cmd_rsp; -@@ -350,6 +358,31 @@ struct msdc_host { +@@ -352,6 +360,31 @@ struct msdc_host { struct msdc_tune_para saved_tune_para; /* tune result of CMD21/CMD19 */ }; @@ -77,7 +77,7 @@ Signed-off-by: Ulf Hansson static void sdr_set_bits(void __iomem *reg, u32 bs) { u32 val = readl(reg); -@@ -509,7 +542,12 @@ static void msdc_set_timeout(struct msdc +@@ -511,7 +544,12 @@ static void msdc_set_timeout(struct msdc timeout = (ns + clk_ns - 1) / clk_ns + clks; /* in 1048576 sclk cycle unit */ timeout = (timeout + (0x1 << 20) - 1) >> 20; @@ -91,7 +91,7 @@ Signed-off-by: Ulf Hansson /*DDR mode will double the clk cycles for data timeout */ timeout = mode >= 2 ? timeout * 2 : timeout; timeout = timeout > 1 ? timeout - 1 : 0; -@@ -548,7 +586,11 @@ static void msdc_set_mclk(struct msdc_ho +@@ -550,7 +588,11 @@ static void msdc_set_mclk(struct msdc_ho flags = readl(host->base + MSDC_INTEN); sdr_clr_bits(host->base + MSDC_INTEN, flags); @@ -104,7 +104,7 @@ Signed-off-by: Ulf Hansson if (timing == MMC_TIMING_UHS_DDR50 || timing == MMC_TIMING_MMC_DDR52 || timing == MMC_TIMING_MMC_HS400) { -@@ -568,8 +610,12 @@ static void msdc_set_mclk(struct msdc_ho +@@ -570,8 +612,12 @@ static void msdc_set_mclk(struct msdc_ho if (timing == MMC_TIMING_MMC_HS400 && hz >= (host->src_clk_freq >> 1)) { @@ -119,7 +119,7 @@ Signed-off-by: Ulf Hansson sclk = host->src_clk_freq >> 1; div = 0; /* div is ignore when bit18 is set */ } -@@ -587,8 +633,15 @@ static void msdc_set_mclk(struct msdc_ho +@@ -589,8 +635,15 @@ static void msdc_set_mclk(struct msdc_ho sclk = (host->src_clk_freq >> 2) / div; } } @@ -137,7 +137,7 @@ Signed-off-by: Ulf Hansson sdr_set_bits(host->base + MSDC_CFG, MSDC_CFG_CKPDN); while (!(readl(host->base + MSDC_CFG) & MSDC_CFG_CKSTB)) cpu_relax(); -@@ -1617,12 +1670,17 @@ static int msdc_drv_probe(struct platfor +@@ -1620,12 +1673,17 @@ static int msdc_drv_probe(struct platfor struct mmc_host *mmc; struct msdc_host *host; struct resource *res; @@ -155,7 +155,7 @@ Signed-off-by: Ulf Hansson /* Allocate MMC host for this device */ mmc = mmc_alloc_host(sizeof(struct msdc_host), &pdev->dev); if (!mmc) -@@ -1686,11 +1744,15 @@ static int msdc_drv_probe(struct platfor +@@ -1689,11 +1747,15 @@ static int msdc_drv_probe(struct platfor msdc_of_property_parse(pdev, host); host->dev = &pdev->dev; @@ -172,7 +172,7 @@ Signed-off-by: Ulf Hansson mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23; /* MMC core transfer sizes tunable parameters */ -@@ -1839,12 +1901,6 @@ static const struct dev_pm_ops msdc_dev_ +@@ -1842,12 +1904,6 @@ static const struct dev_pm_ops msdc_dev_ SET_RUNTIME_PM_OPS(msdc_runtime_suspend, msdc_runtime_resume, NULL) }; diff --git a/target/linux/mediatek/patches-4.14/0152-mmc-mediatek-make-hs400_tune_response-only-for-mt817.patch b/target/linux/mediatek/patches-4.14/0152-mmc-mediatek-make-hs400_tune_response-only-for-mt817.patch index cb7f8ffb2..b74c3f52d 100644 --- a/target/linux/mediatek/patches-4.14/0152-mmc-mediatek-make-hs400_tune_response-only-for-mt817.patch +++ b/target/linux/mediatek/patches-4.14/0152-mmc-mediatek-make-hs400_tune_response-only-for-mt817.patch @@ -17,7 +17,7 @@ Signed-off-by: Ulf Hansson --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c -@@ -300,6 +300,7 @@ struct msdc_save_para { +@@ -302,6 +302,7 @@ struct msdc_save_para { struct mtk_mmc_compatible { u8 clk_div_bits; @@ -25,7 +25,7 @@ Signed-off-by: Ulf Hansson }; struct msdc_tune_para { -@@ -360,18 +361,22 @@ struct msdc_host { +@@ -362,18 +363,22 @@ struct msdc_host { static const struct mtk_mmc_compatible mt8135_compat = { .clk_div_bits = 8, @@ -48,7 +48,7 @@ Signed-off-by: Ulf Hansson }; static const struct of_device_id msdc_of_ids[] = { -@@ -666,7 +671,8 @@ static void msdc_set_mclk(struct msdc_ho +@@ -668,7 +673,8 @@ static void msdc_set_mclk(struct msdc_ho host->base + PAD_CMD_TUNE); } @@ -58,7 +58,7 @@ Signed-off-by: Ulf Hansson sdr_set_field(host->base + PAD_CMD_TUNE, MSDC_PAD_TUNE_CMDRRDLY, host->hs400_cmd_int_delay); -@@ -1594,7 +1600,8 @@ static int msdc_execute_tuning(struct mm +@@ -1597,7 +1603,8 @@ static int msdc_execute_tuning(struct mm struct msdc_host *host = mmc_priv(mmc); int ret; diff --git a/target/linux/mediatek/patches-4.14/0153-mmc-mediatek-add-pad_tune0-support.patch b/target/linux/mediatek/patches-4.14/0153-mmc-mediatek-add-pad_tune0-support.patch index 8c4bbd261..c8a442195 100644 --- a/target/linux/mediatek/patches-4.14/0153-mmc-mediatek-add-pad_tune0-support.patch +++ b/target/linux/mediatek/patches-4.14/0153-mmc-mediatek-add-pad_tune0-support.patch @@ -23,7 +23,7 @@ Signed-off-by: Ulf Hansson #define PAD_DS_TUNE 0x188 #define PAD_CMD_TUNE 0x18c #define EMMC50_CFG0 0x208 -@@ -301,6 +302,7 @@ struct msdc_save_para { +@@ -303,6 +304,7 @@ struct msdc_save_para { struct mtk_mmc_compatible { u8 clk_div_bits; bool hs400_tune; /* only used for MT8173 */ @@ -31,7 +31,7 @@ Signed-off-by: Ulf Hansson }; struct msdc_tune_para { -@@ -362,21 +364,25 @@ struct msdc_host { +@@ -364,21 +366,25 @@ struct msdc_host { static const struct mtk_mmc_compatible mt8135_compat = { .clk_div_bits = 8, .hs400_tune = false, @@ -57,7 +57,7 @@ Signed-off-by: Ulf Hansson }; static const struct of_device_id msdc_of_ids[] = { -@@ -581,6 +587,7 @@ static void msdc_set_mclk(struct msdc_ho +@@ -583,6 +589,7 @@ static void msdc_set_mclk(struct msdc_ho u32 flags; u32 div; u32 sclk; @@ -65,7 +65,7 @@ Signed-off-by: Ulf Hansson if (!hz) { dev_dbg(host->dev, "set mclk to 0\n"); -@@ -663,10 +670,10 @@ static void msdc_set_mclk(struct msdc_ho +@@ -665,10 +672,10 @@ static void msdc_set_mclk(struct msdc_ho */ if (host->sclk <= 52000000) { writel(host->def_tune_para.iocon, host->base + MSDC_IOCON); @@ -78,7 +78,7 @@ Signed-off-by: Ulf Hansson writel(host->saved_tune_para.pad_cmd_tune, host->base + PAD_CMD_TUNE); } -@@ -1224,6 +1231,7 @@ static irqreturn_t msdc_irq(int irq, voi +@@ -1226,6 +1233,7 @@ static irqreturn_t msdc_irq(int irq, voi static void msdc_init_hw(struct msdc_host *host) { u32 val; @@ -86,7 +86,7 @@ Signed-off-by: Ulf Hansson /* Configure to MMC/SD mode, clock free running */ sdr_set_bits(host->base + MSDC_CFG, MSDC_CFG_MODE | MSDC_CFG_CKPDN); -@@ -1239,7 +1247,7 @@ static void msdc_init_hw(struct msdc_hos +@@ -1241,7 +1249,7 @@ static void msdc_init_hw(struct msdc_hos val = readl(host->base + MSDC_INT); writel(val, host->base + MSDC_INT); @@ -95,7 +95,7 @@ Signed-off-by: Ulf Hansson writel(0, host->base + MSDC_IOCON); sdr_set_field(host->base + MSDC_IOCON, MSDC_IOCON_DDLSEL, 0); writel(0x403c0046, host->base + MSDC_PATCH_BIT); -@@ -1259,7 +1267,7 @@ static void msdc_init_hw(struct msdc_hos +@@ -1261,7 +1269,7 @@ static void msdc_init_hw(struct msdc_hos sdr_set_field(host->base + SDC_CFG, SDC_CFG_DTOC, 3); host->def_tune_para.iocon = readl(host->base + MSDC_IOCON); @@ -104,7 +104,7 @@ Signed-off-by: Ulf Hansson dev_dbg(host->dev, "init hardware done!"); } -@@ -1402,18 +1410,19 @@ static int msdc_tune_response(struct mmc +@@ -1404,18 +1412,19 @@ static int msdc_tune_response(struct mmc struct msdc_delay_phase internal_delay_phase; u8 final_delay, final_maxlen; u32 internal_delay = 0; @@ -126,7 +126,7 @@ Signed-off-by: Ulf Hansson MSDC_PAD_TUNE_CMDRDLY, i); /* * Using the same parameters, it may sometimes pass the test, -@@ -1437,7 +1446,7 @@ static int msdc_tune_response(struct mmc +@@ -1439,7 +1448,7 @@ static int msdc_tune_response(struct mmc sdr_set_bits(host->base + MSDC_IOCON, MSDC_IOCON_RSPL); for (i = 0; i < PAD_DELAY_MAX; i++) { @@ -135,7 +135,7 @@ Signed-off-by: Ulf Hansson MSDC_PAD_TUNE_CMDRDLY, i); /* * Using the same parameters, it may sometimes pass the test, -@@ -1462,12 +1471,12 @@ skip_fall: +@@ -1464,12 +1473,12 @@ skip_fall: final_maxlen = final_fall_delay.maxlen; if (final_maxlen == final_rise_delay.maxlen) { sdr_clr_bits(host->base + MSDC_IOCON, MSDC_IOCON_RSPL); @@ -150,7 +150,7 @@ Signed-off-by: Ulf Hansson final_fall_delay.final_phase); final_delay = final_fall_delay.final_phase; } -@@ -1475,7 +1484,7 @@ skip_fall: +@@ -1477,7 +1486,7 @@ skip_fall: goto skip_internal; for (i = 0; i < PAD_DELAY_MAX; i++) { @@ -159,7 +159,7 @@ Signed-off-by: Ulf Hansson MSDC_PAD_TUNE_CMDRRDLY, i); mmc_send_tuning(mmc, opcode, &cmd_err); if (!cmd_err) -@@ -1483,7 +1492,7 @@ skip_fall: +@@ -1485,7 +1494,7 @@ skip_fall: } dev_dbg(host->dev, "Final internal delay: 0x%x\n", internal_delay); internal_delay_phase = get_best_delay(host, internal_delay); @@ -168,7 +168,7 @@ Signed-off-by: Ulf Hansson internal_delay_phase.final_phase); skip_internal: dev_dbg(host->dev, "Final cmd pad delay: %x\n", final_delay); -@@ -1545,12 +1554,13 @@ static int msdc_tune_data(struct mmc_hos +@@ -1548,12 +1557,13 @@ static int msdc_tune_data(struct mmc_hos u32 rise_delay = 0, fall_delay = 0; struct msdc_delay_phase final_rise_delay, final_fall_delay = { 0,}; u8 final_delay, final_maxlen; @@ -183,7 +183,7 @@ Signed-off-by: Ulf Hansson MSDC_PAD_TUNE_DATRRDLY, i); ret = mmc_send_tuning(mmc, opcode, NULL); if (!ret) -@@ -1565,7 +1575,7 @@ static int msdc_tune_data(struct mmc_hos +@@ -1568,7 +1578,7 @@ static int msdc_tune_data(struct mmc_hos sdr_set_bits(host->base + MSDC_IOCON, MSDC_IOCON_DSPL); sdr_set_bits(host->base + MSDC_IOCON, MSDC_IOCON_W_DSPL); for (i = 0; i < PAD_DELAY_MAX; i++) { @@ -192,7 +192,7 @@ Signed-off-by: Ulf Hansson MSDC_PAD_TUNE_DATRRDLY, i); ret = mmc_send_tuning(mmc, opcode, NULL); if (!ret) -@@ -1578,14 +1588,14 @@ skip_fall: +@@ -1581,14 +1591,14 @@ skip_fall: if (final_maxlen == final_rise_delay.maxlen) { sdr_clr_bits(host->base + MSDC_IOCON, MSDC_IOCON_DSPL); sdr_clr_bits(host->base + MSDC_IOCON, MSDC_IOCON_W_DSPL); @@ -209,7 +209,7 @@ Signed-off-by: Ulf Hansson MSDC_PAD_TUNE_DATRRDLY, final_fall_delay.final_phase); final_delay = final_fall_delay.final_phase; -@@ -1599,6 +1609,7 @@ static int msdc_execute_tuning(struct mm +@@ -1602,6 +1612,7 @@ static int msdc_execute_tuning(struct mm { struct msdc_host *host = mmc_priv(mmc); int ret; @@ -217,7 +217,7 @@ Signed-off-by: Ulf Hansson if (host->hs400_mode && host->dev_comp->hs400_tune) -@@ -1616,7 +1627,7 @@ static int msdc_execute_tuning(struct mm +@@ -1619,7 +1630,7 @@ static int msdc_execute_tuning(struct mm } host->saved_tune_para.iocon = readl(host->base + MSDC_IOCON); @@ -226,7 +226,7 @@ Signed-off-by: Ulf Hansson host->saved_tune_para.pad_cmd_tune = readl(host->base + PAD_CMD_TUNE); return ret; } -@@ -1857,10 +1868,12 @@ static int msdc_drv_remove(struct platfo +@@ -1860,10 +1871,12 @@ static int msdc_drv_remove(struct platfo #ifdef CONFIG_PM static void msdc_save_reg(struct msdc_host *host) { @@ -240,7 +240,7 @@ Signed-off-by: Ulf Hansson host->save_para.patch_bit0 = readl(host->base + MSDC_PATCH_BIT); host->save_para.patch_bit1 = readl(host->base + MSDC_PATCH_BIT1); host->save_para.pad_ds_tune = readl(host->base + PAD_DS_TUNE); -@@ -1870,10 +1883,12 @@ static void msdc_save_reg(struct msdc_ho +@@ -1873,10 +1886,12 @@ static void msdc_save_reg(struct msdc_ho static void msdc_restore_reg(struct msdc_host *host) { diff --git a/target/linux/mediatek/patches-4.14/0154-mmc-mediatek-add-async-fifo-and-data-tune-support.patch b/target/linux/mediatek/patches-4.14/0154-mmc-mediatek-add-async-fifo-and-data-tune-support.patch index abb263b71..fab917bce 100644 --- a/target/linux/mediatek/patches-4.14/0154-mmc-mediatek-add-async-fifo-and-data-tune-support.patch +++ b/target/linux/mediatek/patches-4.14/0154-mmc-mediatek-add-async-fifo-and-data-tune-support.patch @@ -23,9 +23,9 @@ Signed-off-by: Ulf Hansson #define MSDC_PAD_TUNE 0xec #define MSDC_PAD_TUNE0 0xf0 #define PAD_DS_TUNE 0x188 -@@ -216,11 +217,20 @@ - #define MSDC_PATCH_BIT_SPCPUSH (0x1 << 29) /* RW */ - #define MSDC_PATCH_BIT_DECRCTMO (0x1 << 30) /* RW */ +@@ -218,11 +219,20 @@ + + #define MSDC_PATCH_BIT1_CMDTA (0x7 << 3) /* RW */ +#define MSDC_PATCH_BIT2_CFGRESP (0x1 << 15) /* RW */ +#define MSDC_PATCH_BIT2_CFGCRCSTS (0x1 << 28) /* RW */ @@ -44,7 +44,7 @@ Signed-off-by: Ulf Hansson #define PAD_DS_TUNE_DLY1 (0x1f << 2) /* RW */ #define PAD_DS_TUNE_DLY2 (0x1f << 7) /* RW */ -@@ -294,6 +304,7 @@ struct msdc_save_para { +@@ -296,6 +306,7 @@ struct msdc_save_para { u32 pad_tune; u32 patch_bit0; u32 patch_bit1; @@ -52,7 +52,7 @@ Signed-off-by: Ulf Hansson u32 pad_ds_tune; u32 pad_cmd_tune; u32 emmc50_cfg0; -@@ -303,6 +314,8 @@ struct mtk_mmc_compatible { +@@ -305,6 +316,8 @@ struct mtk_mmc_compatible { u8 clk_div_bits; bool hs400_tune; /* only used for MT8173 */ u32 pad_tune_reg; @@ -61,7 +61,7 @@ Signed-off-by: Ulf Hansson }; struct msdc_tune_para { -@@ -365,24 +378,32 @@ static const struct mtk_mmc_compatible m +@@ -367,24 +380,32 @@ static const struct mtk_mmc_compatible m .clk_div_bits = 8, .hs400_tune = false, .pad_tune_reg = MSDC_PAD_TUNE, @@ -94,7 +94,7 @@ Signed-off-by: Ulf Hansson }; static const struct of_device_id msdc_of_ids[] = { -@@ -1252,8 +1273,29 @@ static void msdc_init_hw(struct msdc_hos +@@ -1254,8 +1275,29 @@ static void msdc_init_hw(struct msdc_hos sdr_set_field(host->base + MSDC_IOCON, MSDC_IOCON_DDLSEL, 0); writel(0x403c0046, host->base + MSDC_PATCH_BIT); sdr_set_field(host->base + MSDC_PATCH_BIT, MSDC_CKGEN_MSDC_DLY_SEL, 1); @@ -125,7 +125,7 @@ Signed-off-by: Ulf Hansson /* Configure to enable SDIO mode. * it's must otherwise sdio cmd5 failed -@@ -1268,6 +1310,8 @@ static void msdc_init_hw(struct msdc_hos +@@ -1270,6 +1312,8 @@ static void msdc_init_hw(struct msdc_hos host->def_tune_para.iocon = readl(host->base + MSDC_IOCON); host->def_tune_para.pad_tune = readl(host->base + tune_reg); @@ -134,7 +134,7 @@ Signed-off-by: Ulf Hansson dev_dbg(host->dev, "init hardware done!"); } -@@ -1480,7 +1524,7 @@ skip_fall: +@@ -1482,7 +1526,7 @@ skip_fall: final_fall_delay.final_phase); final_delay = final_fall_delay.final_phase; } @@ -143,7 +143,7 @@ Signed-off-by: Ulf Hansson goto skip_internal; for (i = 0; i < PAD_DELAY_MAX; i++) { -@@ -1638,6 +1682,8 @@ static int msdc_prepare_hs400_tuning(str +@@ -1641,6 +1685,8 @@ static int msdc_prepare_hs400_tuning(str host->hs400_mode = true; writel(host->hs400_ds_delay, host->base + PAD_DS_TUNE); @@ -152,7 +152,7 @@ Signed-off-by: Ulf Hansson return 0; } -@@ -1876,6 +1922,7 @@ static void msdc_save_reg(struct msdc_ho +@@ -1879,6 +1925,7 @@ static void msdc_save_reg(struct msdc_ho host->save_para.pad_tune = readl(host->base + tune_reg); host->save_para.patch_bit0 = readl(host->base + MSDC_PATCH_BIT); host->save_para.patch_bit1 = readl(host->base + MSDC_PATCH_BIT1); @@ -160,7 +160,7 @@ Signed-off-by: Ulf Hansson host->save_para.pad_ds_tune = readl(host->base + PAD_DS_TUNE); host->save_para.pad_cmd_tune = readl(host->base + PAD_CMD_TUNE); host->save_para.emmc50_cfg0 = readl(host->base + EMMC50_CFG0); -@@ -1891,6 +1938,7 @@ static void msdc_restore_reg(struct msdc +@@ -1894,6 +1941,7 @@ static void msdc_restore_reg(struct msdc writel(host->save_para.pad_tune, host->base + tune_reg); writel(host->save_para.patch_bit0, host->base + MSDC_PATCH_BIT); writel(host->save_para.patch_bit1, host->base + MSDC_PATCH_BIT1); diff --git a/target/linux/mediatek/patches-4.14/0155-mmc-mediatek-add-busy_check-support.patch b/target/linux/mediatek/patches-4.14/0155-mmc-mediatek-add-busy_check-support.patch index 3bb2df6b5..5735f1a25 100644 --- a/target/linux/mediatek/patches-4.14/0155-mmc-mediatek-add-busy_check-support.patch +++ b/target/linux/mediatek/patches-4.14/0155-mmc-mediatek-add-busy_check-support.patch @@ -16,7 +16,7 @@ Signed-off-by: Ulf Hansson --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c -@@ -316,6 +316,7 @@ struct mtk_mmc_compatible { +@@ -318,6 +318,7 @@ struct mtk_mmc_compatible { u32 pad_tune_reg; bool async_fifo; bool data_tune; @@ -24,7 +24,7 @@ Signed-off-by: Ulf Hansson }; struct msdc_tune_para { -@@ -380,6 +381,7 @@ static const struct mtk_mmc_compatible m +@@ -382,6 +383,7 @@ static const struct mtk_mmc_compatible m .pad_tune_reg = MSDC_PAD_TUNE, .async_fifo = false, .data_tune = false, @@ -32,7 +32,7 @@ Signed-off-by: Ulf Hansson }; static const struct mtk_mmc_compatible mt8173_compat = { -@@ -388,6 +390,7 @@ static const struct mtk_mmc_compatible m +@@ -390,6 +392,7 @@ static const struct mtk_mmc_compatible m .pad_tune_reg = MSDC_PAD_TUNE, .async_fifo = false, .data_tune = false, @@ -40,7 +40,7 @@ Signed-off-by: Ulf Hansson }; static const struct mtk_mmc_compatible mt2701_compat = { -@@ -396,6 +399,7 @@ static const struct mtk_mmc_compatible m +@@ -398,6 +401,7 @@ static const struct mtk_mmc_compatible m .pad_tune_reg = MSDC_PAD_TUNE0, .async_fifo = true, .data_tune = true, @@ -48,7 +48,7 @@ Signed-off-by: Ulf Hansson }; static const struct mtk_mmc_compatible mt2712_compat = { -@@ -404,6 +408,7 @@ static const struct mtk_mmc_compatible m +@@ -406,6 +410,7 @@ static const struct mtk_mmc_compatible m .pad_tune_reg = MSDC_PAD_TUNE0, .async_fifo = true, .data_tune = true, @@ -56,7 +56,7 @@ Signed-off-by: Ulf Hansson }; static const struct of_device_id msdc_of_ids[] = { -@@ -1275,6 +1280,8 @@ static void msdc_init_hw(struct msdc_hos +@@ -1277,6 +1282,8 @@ static void msdc_init_hw(struct msdc_hos sdr_set_field(host->base + MSDC_PATCH_BIT, MSDC_CKGEN_MSDC_DLY_SEL, 1); writel(0xffff4089, host->base + MSDC_PATCH_BIT1); sdr_set_bits(host->base + EMMC50_CFG0, EMMC50_CFG_CFCSTS_SEL); diff --git a/target/linux/mediatek/patches-4.14/0156-mmc-mediatek-add-stop_clk-fix-and-enhance_rx-support.patch b/target/linux/mediatek/patches-4.14/0156-mmc-mediatek-add-stop_clk-fix-and-enhance_rx-support.patch index 8db0a279e..044cc021f 100644 --- a/target/linux/mediatek/patches-4.14/0156-mmc-mediatek-add-stop_clk-fix-and-enhance_rx-support.patch +++ b/target/linux/mediatek/patches-4.14/0156-mmc-mediatek-add-stop_clk-fix-and-enhance_rx-support.patch @@ -42,16 +42,16 @@ Signed-off-by: Ulf Hansson /* MSDC_DMA_CTRL mask */ #define MSDC_DMA_CTRL_START (0x1 << 0) /* W */ #define MSDC_DMA_CTRL_STOP (0x1 << 1) /* W */ -@@ -217,6 +222,8 @@ - #define MSDC_PATCH_BIT_SPCPUSH (0x1 << 29) /* RW */ - #define MSDC_PATCH_BIT_DECRCTMO (0x1 << 30) /* RW */ +@@ -219,6 +224,8 @@ + + #define MSDC_PATCH_BIT1_CMDTA (0x7 << 3) /* RW */ +#define MSDC_PATCH_BIT1_STOP_DLY (0xf << 8) /* RW */ + #define MSDC_PATCH_BIT2_CFGRESP (0x1 << 15) /* RW */ #define MSDC_PATCH_BIT2_CFGCRCSTS (0x1 << 28) /* RW */ #define MSDC_PB2_RESPWAIT (0x3 << 2) /* RW */ -@@ -242,6 +249,9 @@ +@@ -244,6 +251,9 @@ #define EMMC50_CFG_CRCSTS_EDGE (0x1 << 3) /* RW */ #define EMMC50_CFG_CFCSTS_SEL (0x1 << 4) /* RW */ @@ -61,7 +61,7 @@ Signed-off-by: Ulf Hansson #define REQ_CMD_EIO (0x1 << 0) #define REQ_CMD_TMO (0x1 << 1) #define REQ_DAT_ERR (0x1 << 2) -@@ -308,6 +318,7 @@ struct msdc_save_para { +@@ -310,6 +320,7 @@ struct msdc_save_para { u32 pad_ds_tune; u32 pad_cmd_tune; u32 emmc50_cfg0; @@ -69,7 +69,7 @@ Signed-off-by: Ulf Hansson }; struct mtk_mmc_compatible { -@@ -317,6 +328,8 @@ struct mtk_mmc_compatible { +@@ -319,6 +330,8 @@ struct mtk_mmc_compatible { bool async_fifo; bool data_tune; bool busy_check; @@ -78,7 +78,7 @@ Signed-off-by: Ulf Hansson }; struct msdc_tune_para { -@@ -382,6 +395,8 @@ static const struct mtk_mmc_compatible m +@@ -384,6 +397,8 @@ static const struct mtk_mmc_compatible m .async_fifo = false, .data_tune = false, .busy_check = false, @@ -87,7 +87,7 @@ Signed-off-by: Ulf Hansson }; static const struct mtk_mmc_compatible mt8173_compat = { -@@ -391,6 +406,8 @@ static const struct mtk_mmc_compatible m +@@ -393,6 +408,8 @@ static const struct mtk_mmc_compatible m .async_fifo = false, .data_tune = false, .busy_check = false, @@ -96,7 +96,7 @@ Signed-off-by: Ulf Hansson }; static const struct mtk_mmc_compatible mt2701_compat = { -@@ -400,6 +417,8 @@ static const struct mtk_mmc_compatible m +@@ -402,6 +419,8 @@ static const struct mtk_mmc_compatible m .async_fifo = true, .data_tune = true, .busy_check = false, @@ -105,7 +105,7 @@ Signed-off-by: Ulf Hansson }; static const struct mtk_mmc_compatible mt2712_compat = { -@@ -409,6 +428,8 @@ static const struct mtk_mmc_compatible m +@@ -411,6 +430,8 @@ static const struct mtk_mmc_compatible m .async_fifo = true, .data_tune = true, .busy_check = true, @@ -114,7 +114,7 @@ Signed-off-by: Ulf Hansson }; static const struct of_device_id msdc_of_ids[] = { -@@ -1280,15 +1301,31 @@ static void msdc_init_hw(struct msdc_hos +@@ -1282,15 +1303,31 @@ static void msdc_init_hw(struct msdc_hos sdr_set_field(host->base + MSDC_PATCH_BIT, MSDC_CKGEN_MSDC_DLY_SEL, 1); writel(0xffff4089, host->base + MSDC_PATCH_BIT1); sdr_set_bits(host->base + EMMC50_CFG0, EMMC50_CFG_CFCSTS_SEL); @@ -150,7 +150,7 @@ Signed-off-by: Ulf Hansson /* use async fifo, then no need tune internal delay */ sdr_clr_bits(host->base + MSDC_PATCH_BIT2, MSDC_PATCH_BIT2_CFGRESP); -@@ -1933,6 +1970,7 @@ static void msdc_save_reg(struct msdc_ho +@@ -1936,6 +1973,7 @@ static void msdc_save_reg(struct msdc_ho host->save_para.pad_ds_tune = readl(host->base + PAD_DS_TUNE); host->save_para.pad_cmd_tune = readl(host->base + PAD_CMD_TUNE); host->save_para.emmc50_cfg0 = readl(host->base + EMMC50_CFG0); @@ -158,7 +158,7 @@ Signed-off-by: Ulf Hansson } static void msdc_restore_reg(struct msdc_host *host) -@@ -1949,6 +1987,7 @@ static void msdc_restore_reg(struct msdc +@@ -1952,6 +1990,7 @@ static void msdc_restore_reg(struct msdc writel(host->save_para.pad_ds_tune, host->base + PAD_DS_TUNE); writel(host->save_para.pad_cmd_tune, host->base + PAD_CMD_TUNE); writel(host->save_para.emmc50_cfg0, host->base + EMMC50_CFG0); diff --git a/target/linux/mediatek/patches-4.14/0157-mmc-mediatek-add-support-of-source_cg-clock.patch b/target/linux/mediatek/patches-4.14/0157-mmc-mediatek-add-support-of-source_cg-clock.patch index 8a183ceb5..b02a9c161 100644 --- a/target/linux/mediatek/patches-4.14/0157-mmc-mediatek-add-support-of-source_cg-clock.patch +++ b/target/linux/mediatek/patches-4.14/0157-mmc-mediatek-add-support-of-source_cg-clock.patch @@ -15,7 +15,7 @@ Signed-off-by: Ulf Hansson --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c -@@ -372,6 +372,7 @@ struct msdc_host { +@@ -374,6 +374,7 @@ struct msdc_host { struct clk *src_clk; /* msdc source clock */ struct clk *h_clk; /* msdc h_clk */ @@ -23,7 +23,7 @@ Signed-off-by: Ulf Hansson u32 mclk; /* mmc subsystem clock frequency */ u32 src_clk_freq; /* source clock frequency */ u32 sclk; /* SD/MS bus clock frequency */ -@@ -616,6 +617,7 @@ static void msdc_set_timeout(struct msdc +@@ -618,6 +619,7 @@ static void msdc_set_timeout(struct msdc static void msdc_gate_clock(struct msdc_host *host) { @@ -31,7 +31,7 @@ Signed-off-by: Ulf Hansson clk_disable_unprepare(host->src_clk); clk_disable_unprepare(host->h_clk); } -@@ -624,6 +626,7 @@ static void msdc_ungate_clock(struct msd +@@ -626,6 +628,7 @@ static void msdc_ungate_clock(struct msd { clk_prepare_enable(host->h_clk); clk_prepare_enable(host->src_clk); @@ -39,7 +39,7 @@ Signed-off-by: Ulf Hansson while (!(readl(host->base + MSDC_CFG) & MSDC_CFG_CKSTB)) cpu_relax(); } -@@ -692,6 +695,15 @@ static void msdc_set_mclk(struct msdc_ho +@@ -694,6 +697,15 @@ static void msdc_set_mclk(struct msdc_ho sclk = (host->src_clk_freq >> 2) / div; } } @@ -55,7 +55,7 @@ Signed-off-by: Ulf Hansson if (host->dev_comp->clk_div_bits == 8) sdr_set_field(host->base + MSDC_CFG, MSDC_CFG_CKMOD | MSDC_CFG_CKDIV, -@@ -700,10 +712,14 @@ static void msdc_set_mclk(struct msdc_ho +@@ -702,10 +714,14 @@ static void msdc_set_mclk(struct msdc_ho sdr_set_field(host->base + MSDC_CFG, MSDC_CFG_CKMOD_EXTRA | MSDC_CFG_CKDIV_EXTRA, (mode << 12) | div); @@ -71,7 +71,7 @@ Signed-off-by: Ulf Hansson host->sclk = sclk; host->mclk = hz; host->timing = timing; -@@ -1822,6 +1838,11 @@ static int msdc_drv_probe(struct platfor +@@ -1825,6 +1841,11 @@ static int msdc_drv_probe(struct platfor goto host_free; } diff --git a/target/linux/mediatek/patches-4.14/0158-mmc-mediatek-add-latch-ck-support.patch b/target/linux/mediatek/patches-4.14/0158-mmc-mediatek-add-latch-ck-support.patch index cad45f6cf..bd86ab53a 100644 --- a/target/linux/mediatek/patches-4.14/0158-mmc-mediatek-add-latch-ck-support.patch +++ b/target/linux/mediatek/patches-4.14/0158-mmc-mediatek-add-latch-ck-support.patch @@ -16,7 +16,7 @@ Signed-off-by: Ulf Hansson --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c -@@ -378,6 +378,7 @@ struct msdc_host { +@@ -380,6 +380,7 @@ struct msdc_host { u32 sclk; /* SD/MS bus clock frequency */ unsigned char timing; bool vqmmc_enabled; @@ -24,7 +24,7 @@ Signed-off-by: Ulf Hansson u32 hs400_ds_delay; u32 hs200_cmd_int_delay; /* cmd internal delay for HS200/SDR104 */ u32 hs400_cmd_int_delay; /* cmd internal delay for HS400 */ -@@ -1661,6 +1662,8 @@ static int msdc_tune_data(struct mmc_hos +@@ -1664,6 +1665,8 @@ static int msdc_tune_data(struct mmc_hos u32 tune_reg = host->dev_comp->pad_tune_reg; int i, ret; @@ -33,7 +33,7 @@ Signed-off-by: Ulf Hansson sdr_clr_bits(host->base + MSDC_IOCON, MSDC_IOCON_DSPL); sdr_clr_bits(host->base + MSDC_IOCON, MSDC_IOCON_W_DSPL); for (i = 0 ; i < PAD_DELAY_MAX; i++) { -@@ -1773,6 +1776,9 @@ static const struct mmc_host_ops mt_msdc +@@ -1776,6 +1779,9 @@ static const struct mmc_host_ops mt_msdc static void msdc_of_property_parse(struct platform_device *pdev, struct msdc_host *host) { diff --git a/target/linux/mediatek/patches-4.14/0159-mmc-mediatek-improve-eMMC-hs400-mode-read-performanc.patch b/target/linux/mediatek/patches-4.14/0159-mmc-mediatek-improve-eMMC-hs400-mode-read-performanc.patch index 63aef198c..21a0c9048 100644 --- a/target/linux/mediatek/patches-4.14/0159-mmc-mediatek-improve-eMMC-hs400-mode-read-performanc.patch +++ b/target/linux/mediatek/patches-4.14/0159-mmc-mediatek-improve-eMMC-hs400-mode-read-performanc.patch @@ -23,7 +23,7 @@ Signed-off-by: Ulf Hansson #define SDC_FIFO_CFG 0x228 /*--------------------------------------------------------------------------*/ -@@ -249,6 +250,8 @@ +@@ -251,6 +252,8 @@ #define EMMC50_CFG_CRCSTS_EDGE (0x1 << 3) /* RW */ #define EMMC50_CFG_CFCSTS_SEL (0x1 << 4) /* RW */ @@ -32,7 +32,7 @@ Signed-off-by: Ulf Hansson #define SDC_FIFO_CFG_WRVALIDSEL (0x1 << 24) /* RW */ #define SDC_FIFO_CFG_RDVALIDSEL (0x1 << 25) /* RW */ -@@ -318,6 +321,7 @@ struct msdc_save_para { +@@ -320,6 +323,7 @@ struct msdc_save_para { u32 pad_ds_tune; u32 pad_cmd_tune; u32 emmc50_cfg0; @@ -40,7 +40,7 @@ Signed-off-by: Ulf Hansson u32 sdc_fifo_cfg; }; -@@ -1747,6 +1751,9 @@ static int msdc_prepare_hs400_tuning(str +@@ -1750,6 +1754,9 @@ static int msdc_prepare_hs400_tuning(str writel(host->hs400_ds_delay, host->base + PAD_DS_TUNE); /* hs400 mode must set it to 0 */ sdr_clr_bits(host->base + MSDC_PATCH_BIT2, MSDC_PATCH_BIT2_CFGCRCSTS); @@ -50,7 +50,7 @@ Signed-off-by: Ulf Hansson return 0; } -@@ -1997,6 +2004,7 @@ static void msdc_save_reg(struct msdc_ho +@@ -2000,6 +2007,7 @@ static void msdc_save_reg(struct msdc_ho host->save_para.pad_ds_tune = readl(host->base + PAD_DS_TUNE); host->save_para.pad_cmd_tune = readl(host->base + PAD_CMD_TUNE); host->save_para.emmc50_cfg0 = readl(host->base + EMMC50_CFG0); @@ -58,7 +58,7 @@ Signed-off-by: Ulf Hansson host->save_para.sdc_fifo_cfg = readl(host->base + SDC_FIFO_CFG); } -@@ -2014,6 +2022,7 @@ static void msdc_restore_reg(struct msdc +@@ -2017,6 +2025,7 @@ static void msdc_restore_reg(struct msdc writel(host->save_para.pad_ds_tune, host->base + PAD_DS_TUNE); writel(host->save_para.pad_cmd_tune, host->base + PAD_CMD_TUNE); writel(host->save_para.emmc50_cfg0, host->base + EMMC50_CFG0); diff --git a/target/linux/mediatek/patches-4.14/0160-mmc-mediatek-perfer-to-use-rise-edge-latching-for-cm.patch b/target/linux/mediatek/patches-4.14/0160-mmc-mediatek-perfer-to-use-rise-edge-latching-for-cm.patch index 6da13bec6..756797b74 100644 --- a/target/linux/mediatek/patches-4.14/0160-mmc-mediatek-perfer-to-use-rise-edge-latching-for-cm.patch +++ b/target/linux/mediatek/patches-4.14/0160-mmc-mediatek-perfer-to-use-rise-edge-latching-for-cm.patch @@ -16,7 +16,7 @@ Signed-off-by: Ulf Hansson --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c -@@ -1550,7 +1550,8 @@ static int msdc_tune_response(struct mmc +@@ -1552,7 +1552,8 @@ static int msdc_tune_response(struct mmc } final_rise_delay = get_best_delay(host, rise_delay); /* if rising edge has enough margin, then do not scan falling edge */ diff --git a/target/linux/mediatek/patches-4.14/0199-thermal-mtk-Cleanup-unused-defines.patch b/target/linux/mediatek/patches-4.14/0199-thermal-mtk-Cleanup-unused-defines.patch index a7288acdf..af910a666 100644 --- a/target/linux/mediatek/patches-4.14/0199-thermal-mtk-Cleanup-unused-defines.patch +++ b/target/linux/mediatek/patches-4.14/0199-thermal-mtk-Cleanup-unused-defines.patch @@ -40,7 +40,7 @@ Signed-off-by: Eduardo Valentin struct mtk_thermal; struct thermal_bank_cfg { -@@ -765,7 +758,7 @@ static struct platform_driver mtk_therma +@@ -767,7 +760,7 @@ static struct platform_driver mtk_therma .probe = mtk_thermal_probe, .remove = mtk_thermal_remove, .driver = { diff --git a/target/linux/mediatek/patches-4.14/0200-thermal-mediatek-add-support-for-MT7622-SoC.patch b/target/linux/mediatek/patches-4.14/0200-thermal-mediatek-add-support-for-MT7622-SoC.patch index 731bd163d..1dc293641 100644 --- a/target/linux/mediatek/patches-4.14/0200-thermal-mediatek-add-support-for-MT7622-SoC.patch +++ b/target/linux/mediatek/patches-4.14/0200-thermal-mediatek-add-support-for-MT7622-SoC.patch @@ -68,7 +68,7 @@ Signed-off-by: Shunli Wang /** * raw_to_mcelsius - convert a raw ADC value to mcelsius * @mt: The thermal controller -@@ -631,6 +662,10 @@ static const struct of_device_id mtk_the +@@ -633,6 +664,10 @@ static const struct of_device_id mtk_the { .compatible = "mediatek,mt2712-thermal", .data = (void *)&mt2712_thermal_data, diff --git a/target/linux/mediatek/patches-4.14/0203-mmc-mediatek-add-support-for-MT7622-SoC.patch b/target/linux/mediatek/patches-4.14/0203-mmc-mediatek-add-support-for-MT7622-SoC.patch index 613adbc89..39ecd8786 100644 --- a/target/linux/mediatek/patches-4.14/0203-mmc-mediatek-add-support-for-MT7622-SoC.patch +++ b/target/linux/mediatek/patches-4.14/0203-mmc-mediatek-add-support-for-MT7622-SoC.patch @@ -16,7 +16,7 @@ Tested-by: Jumin Li --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c -@@ -438,11 +438,23 @@ static const struct mtk_mmc_compatible m +@@ -440,11 +440,23 @@ static const struct mtk_mmc_compatible m .enhance_rx = true, }; diff --git a/target/linux/mediatek/patches-4.14/0227-arm-dts-Add-Unielec-U7623-DTS.patch b/target/linux/mediatek/patches-4.14/0227-arm-dts-Add-Unielec-U7623-DTS.patch index 996b309e8..cc3758119 100644 --- a/target/linux/mediatek/patches-4.14/0227-arm-dts-Add-Unielec-U7623-DTS.patch +++ b/target/linux/mediatek/patches-4.14/0227-arm-dts-Add-Unielec-U7623-DTS.patch @@ -5,24 +5,24 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS --- arch/arm/boot/dts/Makefile | 1 + - .../dts/mt7623a-unielec-u7623-02-emmc-512M.dts | 18 + + .../dts/mt7623a-unielec-u7623-02-emmc-512m.dts | 18 + .../boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi | 366 +++++++++++++++++++++ 3 files changed, 385 insertions(+) - create mode 100644 arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512M.dts + create mode 100644 arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512m.dts create mode 100644 arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -1062,6 +1062,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \ +@@ -1061,6 +1061,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \ + mt6580-evbp1.dtb \ mt6589-aquaris5.dtb \ mt6592-evb.dtb \ - mt7623a-rfb-emmc.dtb \ -+ mt7623a-unielec-u7623-02-emmc-512M.dtb \ ++ mt7623a-unielec-u7623-02-emmc-512m.dtb \ mt7623n-rfb-nand.dtb \ mt7623n-bananapi-bpi-r2.dtb \ mt8127-moose.dtb \ --- /dev/null -+++ b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512M.dts ++++ b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512m.dts @@ -0,0 +1,18 @@ +/* + * Copyright 2018 Kristian Evensen diff --git a/target/linux/mediatek/patches-4.19/0002-eth-fix-dsa-support.patch b/target/linux/mediatek/patches-4.19/0002-eth-fix-dsa-support.patch new file mode 100644 index 000000000..6c9022251 --- /dev/null +++ b/target/linux/mediatek/patches-4.19/0002-eth-fix-dsa-support.patch @@ -0,0 +1,34 @@ +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -999,11 +999,6 @@ static int mtk_poll_rx(struct napi_struc + if (!(trxd.rxd2 & RX_DMA_DONE)) + break; + +- /* find out which mac the packet come from. values start at 1 */ +-#if defined(CONFIG_NET_DSA) +- mac = (trxd.rxd4 >> 22) & 0x1; +- mac = (mac + 1) % 2; +-#else + mac = (trxd.rxd4 >> RX_DMA_FPORT_SHIFT) & + RX_DMA_FPORT_MASK; + /* From QDMA(5). This is a external interface case of HWNAT. +@@ -1017,7 +1012,7 @@ static int mtk_poll_rx(struct napi_struc + mac = 0; + else + mac--; +-#endif ++ + if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT || + !eth->netdev[mac])) + goto release_desc; +@@ -2030,10 +2025,6 @@ static int mtk_hw_init(struct mtk_eth *e + /* Disable RX VLan Offloading */ + mtk_w32(eth, 0, MTK_CDMP_EG_CTRL); + +-#if defined(CONFIG_NET_DSA) +- mtk_w32(eth, 0x81000001, MTK_CDMP_IG_CTRL); +-#endif +- + mtk_w32(eth, 0x8f0f8f0f, MTK_PDMA_DELAY_INT); + mtk_w32(eth, 0x8f0f8f0f, MTK_QDMA_DELAY_INT); + diff --git a/target/linux/mediatek/patches-4.19/0227-arm-dts-Add-Unielec-U7623-DTS.patch b/target/linux/mediatek/patches-4.19/0227-arm-dts-Add-Unielec-U7623-DTS.patch index 6561e8d5a..7b92141c5 100644 --- a/target/linux/mediatek/patches-4.19/0227-arm-dts-Add-Unielec-U7623-DTS.patch +++ b/target/linux/mediatek/patches-4.19/0227-arm-dts-Add-Unielec-U7623-DTS.patch @@ -5,10 +5,10 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS --- arch/arm/boot/dts/Makefile | 1 + - .../dts/mt7623a-unielec-u7623-02-emmc-512M.dts | 18 + + .../dts/mt7623a-unielec-u7623-02-emmc-512m.dts | 18 + .../boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi | 366 +++++++++++++++++++++ 3 files changed, 385 insertions(+) - create mode 100644 arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512M.dts + create mode 100644 arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512m.dts create mode 100644 arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi --- a/arch/arm/boot/dts/Makefile @@ -17,12 +17,12 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS mt7623a-rfb-nand.dtb \ mt7623n-rfb-emmc.dtb \ mt7623n-bananapi-bpi-r2.dtb \ -+ mt7623a-unielec-u7623-02-emmc-512M.dtb \ ++ mt7623a-unielec-u7623-02-emmc-512m.dtb \ mt8127-moose.dtb \ mt8135-evbp1.dtb dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb --- /dev/null -+++ b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512M.dts ++++ b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512m.dts @@ -0,0 +1,18 @@ +/* + * Copyright 2018 Kristian Evensen diff --git a/target/linux/mediatek/patches-4.19/0228-arm-dts-bpir2-fix-console.patch b/target/linux/mediatek/patches-4.19/0228-arm-dts-bpir2-fix-console.patch new file mode 100644 index 000000000..b7251177f --- /dev/null +++ b/target/linux/mediatek/patches-4.19/0228-arm-dts-bpir2-fix-console.patch @@ -0,0 +1,10 @@ +--- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts ++++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts +@@ -19,6 +19,7 @@ + + chosen { + stdout-path = "serial2:115200n8"; ++ bootargs = "console=ttyS2,115200n8"; + }; + + cpus { diff --git a/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch index d5f9627fa..f35b3901e 100644 --- a/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -2663,6 +2663,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2667,6 +2667,7 @@ int spi_nor_scan(struct spi_nor *nor, co struct device *dev = nor->dev; struct mtd_info *mtd = &nor->mtd; struct device_node *np = spi_nor_get_flash_node(nor); @@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma int ret; int i; -@@ -2738,7 +2739,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2742,7 +2743,12 @@ int spi_nor_scan(struct spi_nor *nor, co spi_nor_wait_till_ready(nor); } diff --git a/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch b/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch index 8631f5d72..dee65a839 100644 --- a/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch +++ b/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch @@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau { "w25m512jv", INFO(0xef7119, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_DUAL_READ) }, -@@ -1237,6 +1289,9 @@ static int spi_nor_read(struct mtd_info +@@ -1241,6 +1293,9 @@ static int spi_nor_read(struct mtd_info if (ret) return ret; @@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau while (len) { loff_t addr = from; -@@ -1261,6 +1316,18 @@ static int spi_nor_read(struct mtd_info +@@ -1265,6 +1320,18 @@ static int spi_nor_read(struct mtd_info ret = 0; read_err: @@ -154,7 +154,7 @@ Signed-off-by: Felix Fietkau spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ); return ret; } -@@ -1362,6 +1429,10 @@ static int spi_nor_write(struct mtd_info +@@ -1366,6 +1433,10 @@ static int spi_nor_write(struct mtd_info if (ret) return ret; @@ -165,7 +165,7 @@ Signed-off-by: Felix Fietkau for (i = 0; i < len; ) { ssize_t written; loff_t addr = to + i; -@@ -1402,6 +1473,7 @@ static int spi_nor_write(struct mtd_info +@@ -1406,6 +1477,7 @@ static int spi_nor_write(struct mtd_info } write_err: @@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE); return ret; } -@@ -2818,8 +2890,10 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2822,8 +2894,10 @@ int spi_nor_scan(struct spi_nor *nor, co } else if (mtd->size > 0x1000000) { /* enable 4-byte addressing if the device exceeds 16MiB */ nor->addr_width = 4; diff --git a/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch b/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch index b6266a8ef..9ea2a1135 100644 --- a/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch +++ b/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch @@ -33,7 +33,7 @@ /* * Write status register 1 byte * Returns negative if error occurred. -@@ -2890,9 +2899,16 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2894,9 +2903,16 @@ int spi_nor_scan(struct spi_nor *nor, co } else if (mtd->size > 0x1000000) { /* enable 4-byte addressing if the device exceeds 16MiB */ nor->addr_width = 4; diff --git a/target/linux/ramips/patches-4.14/304-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch b/target/linux/ramips/patches-4.14/304-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch index c8febaf73..831350546 100644 --- a/target/linux/ramips/patches-4.14/304-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch +++ b/target/linux/ramips/patches-4.14/304-spi-nor-enable-4B-opcodes-for-mx25l25635f.patch @@ -18,7 +18,7 @@ For reference see: { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) }, { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) }, { "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, -@@ -1267,11 +1268,12 @@ static const struct flash_info spi_nor_i +@@ -1271,11 +1272,12 @@ static const struct flash_info spi_nor_i { }, }; @@ -33,7 +33,7 @@ For reference see: tmp = nor->read_reg(nor, SPINOR_OP_RDID, id, SPI_NOR_MAX_ID_LEN); if (tmp < 0) { -@@ -1282,10 +1284,16 @@ static const struct flash_info *spi_nor_ +@@ -1286,10 +1288,16 @@ static const struct flash_info *spi_nor_ for (tmp = 0; tmp < ARRAY_SIZE(spi_nor_ids) - 1; tmp++) { info = &spi_nor_ids[tmp]; if (info->id_len) { @@ -52,7 +52,7 @@ For reference see: dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n", id[0], id[1], id[2]); return ERR_PTR(-ENODEV); -@@ -2765,7 +2773,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2769,7 +2777,7 @@ int spi_nor_scan(struct spi_nor *nor, co info = spi_nor_match_id(name); /* Try to auto-detect if chip name wasn't specified or not found */ if (!info) @@ -61,7 +61,7 @@ For reference see: if (IS_ERR_OR_NULL(info)) return -ENOENT; -@@ -2776,7 +2784,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2780,7 +2788,7 @@ int spi_nor_scan(struct spi_nor *nor, co if (name && info->id_len) { const struct flash_info *jinfo; diff --git a/target/linux/sunxi/patches-4.14/025-arm64-dts-allwinner-A64-Restore-EMAC-changes.patch b/target/linux/sunxi/patches-4.14/025-arm64-dts-allwinner-A64-Restore-EMAC-changes.patch index af4a92158..23c3ec27e 100644 --- a/target/linux/sunxi/patches-4.14/025-arm64-dts-allwinner-A64-Restore-EMAC-changes.patch +++ b/target/linux/sunxi/patches-4.14/025-arm64-dts-allwinner-A64-Restore-EMAC-changes.patch @@ -155,7 +155,7 @@ Signed-off-by: Maxime Ripard pinctrl-0 = <&mmc2_pins>; --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -449,6 +449,26 @@ +@@ -450,6 +450,26 @@ #size-cells = <0>; }; diff --git a/target/linux/sunxi/patches-4.14/026-arm64-dts-allwinner-add-snps-dwmac-mdio-compatible-t.patch b/target/linux/sunxi/patches-4.14/026-arm64-dts-allwinner-add-snps-dwmac-mdio-compatible-t.patch index 40efc9f3e..ee4731d0d 100644 --- a/target/linux/sunxi/patches-4.14/026-arm64-dts-allwinner-add-snps-dwmac-mdio-compatible-t.patch +++ b/target/linux/sunxi/patches-4.14/026-arm64-dts-allwinner-add-snps-dwmac-mdio-compatible-t.patch @@ -18,7 +18,7 @@ Signed-off-by: Maxime Ripard --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -464,6 +464,7 @@ +@@ -465,6 +465,7 @@ #size-cells = <0>; mdio: mdio { diff --git a/target/linux/sunxi/patches-4.14/040-arm64-dts-allwinner-a64-Add-watchdog.patch b/target/linux/sunxi/patches-4.14/040-arm64-dts-allwinner-a64-Add-watchdog.patch index 0503b8882..90c72f950 100644 --- a/target/linux/sunxi/patches-4.14/040-arm64-dts-allwinner-a64-Add-watchdog.patch +++ b/target/linux/sunxi/patches-4.14/040-arm64-dts-allwinner-a64-Add-watchdog.patch @@ -32,7 +32,7 @@ Signed-off-by: Maxime Ripard Example: --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -537,5 +537,12 @@ +@@ -538,5 +538,12 @@ #address-cells = <1>; #size-cells = <0>; }; diff --git a/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch b/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch index 5374547e9..1e40f99d0 100644 --- a/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch +++ b/target/linux/sunxi/patches-4.14/080-arm64-allwinner-a64-add-SPI-nodes.patch @@ -21,7 +21,7 @@ Signed-off-by: Maxime Ripard --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -325,6 +325,16 @@ +@@ -326,6 +326,16 @@ drive-strength = <40>; }; @@ -38,7 +38,7 @@ Signed-off-by: Maxime Ripard uart0_pins_a: uart0@0 { pins = "PB8", "PB9"; function = "uart0"; -@@ -470,6 +480,37 @@ +@@ -471,6 +481,37 @@ }; };