From 0ee6de292a9c5f43039f7ea6f6688bbe9238f6c7 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Fri, 5 Apr 2019 10:51:56 -0500 Subject: [PATCH] merge cleanup from linux-dev Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- patch.sh | 87 +- patches/WireGuard/0001-merge-WireGuard.patch | 4 +- .../0001-sync-am335x-peripheral-pinmux.patch | 779 ------ ...generated-capes-add-dtbs-to-makefile.patch | 21 +- patches/defconfig | 6 +- ..._i2c-invert-swap-and-offset-options.patch} | 75 +- ...roduce-offsets-to-manually-re-calbra.patch | 97 - ...Create-device-class-for-pwm-channels.patch | 6 +- ...spi-spidev-allow-use-of-spidev-in-DT.patch | 4 +- ...upport-for-MikroElectronica-OLED-B-C.patch | 2 +- .../ti/cpsw/0001-cpsw-search-for-phy.patch | 4 +- ...-port-of-Nathaniel-Lewis-eQEP-driver.patch | 30 +- ...andled-fault-on-eQEP-register-access.patch | 8 +- ...0001-ti-dra7-etnaviv-2d-acceleration.patch | 2 +- ...AM335x-CM3-Power-Managment-Firmware.patch} | 8 +- .../gpio/0001-BeagleBone-pinmux-helper.patch | 53 +- .../0002-am33xx-add-gpio-line-names.patch | 14 +- ...-we-have-drivers-stomping-on-each-ot.patch | 8 +- ...mbols-when-CONFIG_OF_OVERLAY-is-used.patch | 8 +- ...ngs-remoteproc-Add-TI-PRUSS-bindings.patch | 239 -- ...-a-platform-driver-for-PRUSS-in-TI-S.patch | 670 ----- ...ip-Add-pruss-intc-irq-driver-for-PRU.patch | 95 - ...d-a-PRUSS-irqchip-driver-for-PRUSS-i.patch | 801 ------ ...teproc-add-map-parameter-to-da_to_va.patch | 211 -- ...page-lookup-for-TI-PRU-to-ELF-loader.patch | 208 -- ...oteproc-Add-a-rproc_set_firmware-API.patch | 159 -- ...upport-to-handle-device-specific-res.patch | 159 -- ...eproc-Add-binding-doc-for-PRU-Cores-.patch | 86 - ...teproc-pru-Add-PRU-remoteproc-driver.patch | 1144 -------- ...dd-pru_rproc_set_ctable-and-pru_rpro.patch | 155 -- ...u-Add-support-for-virtio-rpmsg-stack.patch | 306 -- ...sg_bus-move-back-rpmsg_hdr-into-a-pu.patch | 95 - ...014-rpmsg-pru-add-a-PRU-RPMsg-driver.patch | 425 --- ...t-more-than-one-GPIO-bus-reset-lines.patch | 104 - ...-bindings-net-Add-TI-PRUeth-bindings.patch | 115 - ...-prueth-Add-TI-PRUSS-Ethernet-driver.patch | 2469 ----------------- ...sysc-Add-support-for-PRUSS-SYSC-type.patch | 190 -- ...19-ARM-dts-dra7-add-PRU-ICSS-modules.patch | 256 -- ...7xx-idk-common-Enable-PRU-ICSS-nodes.patch | 42 - ...dk-common-Add-PRUSS2-Ethernet-applic.patch | 134 - ...idk-prueth-provide-intc-config-in-DT.patch | 33 - ...dts-AM33xx-Add-the-PRU-ICSS-DT-nodes.patch | 123 - ...ARM-dts-am335x-Enable-PRU-ICSS-nodes.patch | 69 - ...CK-implement-reset-control-for-pruss.patch | 64 - .../0001-ARM-samples-seccomp-no-m32.patch | 10 +- ...-8250_omap.c-use-pr_info-over-pr_err.patch | 8 +- ...nt-spidev1-spidev2-for-compability-w.patch | 29 - .../ti/tsc/0001-ti_am335x_tsc.c-driver.patch | 10 +- ...rrect-formula-code-to-calculate-pres.patch | 16 +- .../tps65217/0001-HACK-tps65217_pwr_but.patch | 8 +- ...-w5100-spi-hack-dt-support-for-w5500.patch | 4 +- ...0001-packaging-sync-builddeb-changes.patch | 4 +- patches/ref_omap2plus_defconfig | 4 +- .../0001-first-pass-imx6q-ccimx6sbc.patch | 335 --- ...002-mcimx6ul-bb-and-ism43362-b81-evb.patch | 562 ---- ...-pico-pi.dts-add-default-stdout-path.patch | 2 +- ...r-pwrseq-generic-add-binding-doc-for.patch | 8 +- ...002-power-add-power-sequence-library.patch | 8 +- ...usb-device-add-optional-properties-f.patch | 4 +- ...er-sequence-handling-for-USB-devices.patch | 4 +- ...dl-Enable-usb-node-children-with-reg.patch | 14 +- ...udoo.dtsi-fix-onboard-USB-HUB-proper.patch | 14 +- ...imx6q-evi-Fix-onboard-hub-reset-line.patch | 14 +- ...mx6-udooqdl-add-arduino-manager-driv.patch | 24 +- ...udoo-clk-imx6q.c-set-IMX6QDL_CLK_CKO.patch | 10 +- ...-Wandboard-add-wifi-bt-rfkill-driver.patch | 12 +- ...d-add-binding-for-wand-rfkill-driver.patch | 20 +- ...rrow-BeagleBone-Black-Industrial-dts.patch | 13 +- .../soc/ti/am335x/0001-sync-with-ti-4.4.patch | 4 +- ...one-common-update-leds-to-match-3.8..patch | 8 +- ...one-common-add-collision-and-carrier.patch | 47 - ...5x-bone-common-disable-running-JTAG.patch} | 10 +- ...35x-bone-common-add-no-capemgr.dtsi.patch} | 23 +- ...ne-common-add-am335x-bbw-bbb-base.h.patch} | 6 +- ...x-boneblack-common-remove-CEC-noise.patch} | 8 +- ...sd335x-common.dtsi-add-pruss_soc_bus.patch | 25 - ...oneblack-enable-wl1835mod-cape-suppo.patch | 211 -- ...002-add-am335x-boneblack-bbbmini.dts.patch | 226 -- ...oneblack-bbb-exp-c.dtb-am335x-bonebl.patch | 1105 -------- .../beaglebone_capes/0004-bb-audio-cape.patch | 70 - ...1-am335x-boneblue.dts-force-1ghz-opp.patch | 8 +- .../blue/0002-blue-add-pwm-eqep-spi-etc.patch | 18 +- ...0003-am335x-boneblue.dts-fix-rtc-off.patch | 6 +- .../0001-ARM-dts-omap3-beagle-add-i2c2.patch | 4 +- .../0002-ARM-dts-omap3-beagle-xm-spidev.patch | 4 +- ...eagle.dts-enable-twl4030-power-reset.patch | 4 +- .../ti/omap3/0004-omap3-beagle-fixes.patch | 4 +- ...4-move-emif-so-panda-es-b3-now-boots.patch | 18 +- ...Bring-back-twl6030-clk32kg-regulator.patch | 14 +- ...1-am335x-pocketbeagle.dtb-config-pin.patch | 18 +- ...gle.dts-microSD-mcasp0_aclkr.mmc0_sd.patch | 6 +- .../0001-add-am335x-boneblack-uboot.dts.patch | 4 +- ...0002-uboot-cape-universal-enablement.patch | 26 +- scripts/gcc.sh | 15 +- tools/host_det.sh | 7 +- version.sh | 2 +- 96 files changed, 377 insertions(+), 12229 deletions(-) delete mode 100644 patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch rename patches/drivers/ar1021_i2c/{0001-ar1021_i2c-add-invert-swap-options.patch => 0001-ar1021_i2c-invert-swap-and-offset-options.patch} (55%) delete mode 100644 patches/drivers/ar1021_i2c/0002-ar1021_i2c.c-introduce-offsets-to-manually-re-calbra.patch rename patches/drivers/ti/firmware/{0001-add-am33x-firmware.patch => 0001-Add-AM335x-CM3-Power-Managment-Firmware.patch} (99%) delete mode 100644 patches/drivers/ti/rogerq_pruss/0001-dt-bindings-remoteproc-Add-TI-PRUSS-bindings.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0002-soc-ti-pruss-Add-a-platform-driver-for-PRUSS-in-TI-S.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0003-dt-binding-irqchip-Add-pruss-intc-irq-driver-for-PRU.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0004-irqchip-pruss-Add-a-PRUSS-irqchip-driver-for-PRUSS-i.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0005-remoteproc-add-map-parameter-to-da_to_va.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0006-remoteproc-add-page-lookup-for-TI-PRU-to-ELF-loader.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0007-remoteproc-Add-a-rproc_set_firmware-API.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0008-remoteproc-Add-support-to-handle-device-specific-res.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0009-dt-binding-remoteproc-Add-binding-doc-for-PRU-Cores-.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0010-remoteproc-pru-Add-PRU-remoteproc-driver.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0011-remoteproc-pru-Add-pru_rproc_set_ctable-and-pru_rpro.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0012-remoteproc-pru-Add-support-for-virtio-rpmsg-stack.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0013-rpmsg-virtio_rpmsg_bus-move-back-rpmsg_hdr-into-a-pu.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0014-rpmsg-pru-add-a-PRU-RPMsg-driver.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0015-mdio_bus-Support-more-than-one-GPIO-bus-reset-lines.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0016-dt-bindings-net-Add-TI-PRUeth-bindings.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0017-net-prueth-Add-TI-PRUSS-Ethernet-driver.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0018-bus-ti-sysc-Add-support-for-PRUSS-SYSC-type.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0019-ARM-dts-dra7-add-PRU-ICSS-modules.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0020-ARM-dts-am57xx-idk-common-Enable-PRU-ICSS-nodes.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0021-ARM-dts-am57xx-idk-common-Add-PRUSS2-Ethernet-applic.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0022-optional-am57xx-idk-prueth-provide-intc-config-in-DT.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0023-ARM-dts-AM33xx-Add-the-PRU-ICSS-DT-nodes.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0024-ARM-dts-am335x-Enable-PRU-ICSS-nodes.patch delete mode 100644 patches/drivers/ti/rogerq_pruss/0025-HACK-implement-reset-control-for-pruss.patch delete mode 100644 patches/drivers/ti/spi/0001-am33xx-spi-we-want-spidev1-spidev2-for-compability-w.patch delete mode 100644 patches/soc/imx/imx6/0001-first-pass-imx6q-ccimx6sbc.patch delete mode 100644 patches/soc/imx/imx6/0002-mcimx6ul-bb-and-ism43362-b81-evb.patch delete mode 100644 patches/soc/ti/am335x/0003-ARM-dts-am335x-bone-common-add-collision-and-carrier.patch rename patches/soc/ti/am335x/{0004-ARM-dts-am335x-bone-common-disable-running-JTAG.patch => 0003-ARM-dts-am335x-bone-common-disable-running-JTAG.patch} (96%) rename patches/soc/ti/am335x/{0005-ARM-dts-am335x-bone-common-add-no-capemgr.dtsi.patch => 0004-ARM-dts-am335x-bone-common-add-no-capemgr.dtsi.patch} (95%) rename patches/soc/ti/am335x/{0006-ARM-dts-am335x-bone-common-add-am335x-bbw-bbb-base.h.patch => 0005-ARM-dts-am335x-bone-common-add-am335x-bbw-bbb-base.h.patch} (95%) rename patches/soc/ti/am335x/{0007-ARM-dts-am335x-boneblack-common-remove-CEC-noise.patch => 0006-ARM-dts-am335x-boneblack-common-remove-CEC-noise.patch} (94%) delete mode 100644 patches/soc/ti/am335x/0008-am335x-osd335x-common.dtsi-add-pruss_soc_bus.patch delete mode 100644 patches/soc/ti/beaglebone_capes/0001-ARM-dts-am335x-boneblack-enable-wl1835mod-cape-suppo.patch delete mode 100644 patches/soc/ti/beaglebone_capes/0002-add-am335x-boneblack-bbbmini.dts.patch delete mode 100644 patches/soc/ti/beaglebone_capes/0003-add-lcd-am335x-boneblack-bbb-exp-c.dtb-am335x-bonebl.patch delete mode 100644 patches/soc/ti/beaglebone_capes/0004-bb-audio-cape.patch diff --git a/patch.sh b/patch.sh index 98336ea73..1ac7ba12b 100644 --- a/patch.sh +++ b/patch.sh @@ -265,10 +265,11 @@ ti_pm_firmware () { fi cd ./KERNEL/ + mkdir -p ./firmware/ || true cp -v ../ti-amx3-cm3-pm-firmware/bin/am* ./firmware/ ${git_bin} add -f ./firmware/am* - ${git_bin} commit -a -m 'add am33x firmware' -s + ${git_bin} commit -a -m 'Add AM335x CM3 Power Managment Firmware' -s ${git_bin} format-patch -1 -o ../patches/drivers/ti/firmware/ rm -rf ../ti-amx3-cm3-pm-firmware/ || true @@ -277,14 +278,14 @@ ti_pm_firmware () { start_cleanup - ${git} "${DIR}/patches/drivers/ti/firmware/0001-add-am33x-firmware.patch" + ${git} "${DIR}/patches/drivers/ti/firmware/0001-Add-AM335x-CM3-Power-Managment-Firmware.patch" wdir="drivers/ti/firmware" number=1 cleanup fi - ${git} "${DIR}/patches/drivers/ti/firmware/0001-add-am33x-firmware.patch" + ${git} "${DIR}/patches/drivers/ti/firmware/0001-Add-AM335x-CM3-Power-Managment-Firmware.patch" } local_patch () { @@ -350,48 +351,6 @@ backports () { fi } -ti_rogerq_pruss () { - #https://github.com/rogerq/linux/commits/for-v5.1/pruss-2.0 - #regenerate="enable" - branch="for-v5.1/pruss-2.0" - git_depth="30" - patch_depth="25" - if [ "x${regenerate}" = "xenable" ] ; then - - cd ../ - if [ ! -d ./rogerq_pruss/ ] ; then - ${git_bin} clone -b ${branch} https://github.com/rogerq/linux --depth=${git_depth} ./rogerq_pruss/ - else - rm -rf ./rogerq_pruss || true - ${git_bin} clone -b ${branch} https://github.com/rogerq/linux --depth=${git_depth} ./rogerq_pruss/ - fi - - cd ./rogerq_pruss/ - - ${git_bin} format-patch -${patch_depth} -o ../patches/drivers/ti/rogerq_pruss - - cd ../KERNEL/ - - rm -rf ../rogerq_pruss/ || true - - dir 'drivers/ti/rogerq_pruss' - exit 2 - fi - - #regenerate="enable" - if [ "x${regenerate}" = "xenable" ] ; then - start_cleanup - fi - - dir 'drivers/ti/rogerq_pruss' - - if [ "x${regenerate}" = "xenable" ] ; then - wdir="drivers/ti/rogerq_pruss" - number=25 - cleanup - fi -} - reverts () { echo "dir: reverts" #regenerate="enable" @@ -425,7 +384,6 @@ drivers () { dir 'drivers/ti/eqep' dir 'drivers/ti/rpmsg' dir 'drivers/ti/serial' - dir 'drivers/ti/spi' dir 'drivers/ti/tsc' dir 'drivers/ti/gpio' } @@ -433,7 +391,6 @@ drivers () { soc () { # dir 'soc/imx/udoo' # dir 'soc/imx/wandboard' -# dir 'soc/imx/imx6' # dir 'soc/imx/imx7' dir 'soc/ti/omap3' @@ -443,7 +400,6 @@ soc () { dir 'soc/ti/blue' dir 'soc/ti/abbbi' dir 'soc/ti/pocketbeagle' - dir 'soc/ti/beaglebone_capes' dir 'soc/ti/uboot' } @@ -452,47 +408,15 @@ dtb_makefile_append () { } beaglebone () { - #This has to be last... - echo "dir: beaglebone/dtbs" - #regenerate="enable" - if [ "x${regenerate}" = "xenable" ] ; then - patch -p1 < "${DIR}/patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch" - exit 2 - fi - - #regenerate="enable" - if [ "x${regenerate}" = "xenable" ] ; then - start_cleanup - fi - - ${git} "${DIR}/patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch" - - if [ "x${regenerate}" = "xenable" ] ; then - number=1 - cleanup - fi - #### #dtb makefile echo "dir: beaglebone/generated" #regenerate="enable" if [ "x${regenerate}" = "xenable" ] ; then - device="am335x-boneblack-uboot.dtb" ; dtb_makefile_append - -# device="am335x-boneblack-roboticscape.dtb" ; dtb_makefile_append -# device="am335x-boneblack-wireless-roboticscape.dtb" ; dtb_makefile_append - device="am335x-abbbi.dtb" ; dtb_makefile_append - device="am335x-boneblack-wl1835mod.dtb" ; dtb_makefile_append - - device="am335x-boneblack-bbbmini.dtb" ; dtb_makefile_append - - device="am335x-boneblack-bbb-exp-c.dtb" ; dtb_makefile_append - device="am335x-boneblack-bbb-exp-r.dtb" ; dtb_makefile_append - - device="am335x-boneblack-audio.dtb" ; dtb_makefile_append + device="am335x-boneblack-uboot.dtb" ; dtb_makefile_append device="am335x-bone-uboot-univ.dtb" ; dtb_makefile_append device="am335x-boneblack-uboot-univ.dtb" ; dtb_makefile_append @@ -508,7 +432,6 @@ beaglebone () { ### #backports -#ti_rogerq_pruss #reverts drivers soc diff --git a/patches/WireGuard/0001-merge-WireGuard.patch b/patches/WireGuard/0001-merge-WireGuard.patch index b7ff01883..966771c60 100644 --- a/patches/WireGuard/0001-merge-WireGuard.patch +++ b/patches/WireGuard/0001-merge-WireGuard.patch @@ -1,6 +1,6 @@ -From db1e83d0bb250ed904319596404db4a7d99fc303 Mon Sep 17 00:00:00 2001 +From 4cd5d56bc5b5583abc0be451ecb3591d08281392 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> -Date: Mon, 1 Apr 2019 09:51:23 -0500 +Date: Fri, 5 Apr 2019 10:48:11 -0500 Subject: [PATCH] merge: WireGuard Signed-off-by: Robert Nelson <robertcnelson@gmail.com> diff --git a/patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch b/patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch deleted file mode 100644 index 6fceb2e34..000000000 --- a/patches/beaglebone/dtbs/0001-sync-am335x-peripheral-pinmux.patch +++ /dev/null @@ -1,779 +0,0 @@ -From 22568c2d1be623e7b845355320a6be5f16147b88 Mon Sep 17 00:00:00 2001 -From: Robert Nelson <robertcnelson@gmail.com> -Date: Wed, 1 Mar 2017 13:20:14 -0600 -Subject: [PATCH] sync: am335x-peripheral/pinmux - -Signed-off-by: Robert Nelson <robertcnelson@gmail.com> ---- - arch/arm/boot/dts/am335x-bone-emmc-in-reset.dtsi | 18 ++++ - arch/arm/boot/dts/am335x-bone-pinmux-can1.dtsi | 45 ++++++++ - arch/arm/boot/dts/am335x-bone-pinmux-emmc.dtsi | 88 +++++++++++++++ - arch/arm/boot/dts/am335x-bone-pinmux-i2c2.dtsi | 45 ++++++++ - arch/arm/boot/dts/am335x-bone-pinmux-nxp-hdmi.dtsi | 120 +++++++++++++++++++++ - arch/arm/boot/dts/am335x-bone-pinmux-spi0.dtsi | 51 +++++++++ - arch/arm/boot/dts/am335x-bone-pinmux-spi1.dtsi | 27 +++++ - arch/arm/boot/dts/am335x-bone-pinmux-spi1a.dtsi | 28 +++++ - arch/arm/boot/dts/am335x-bone-pinmux-ttyS5.dtsi | 48 +++++++++ - arch/arm/boot/dts/am335x-cape-rtc-ds1307.dtsi | 31 ++++++ - arch/arm/boot/dts/am335x-peripheral-can1.dtsi | 13 +++ - arch/arm/boot/dts/am335x-peripheral-emmc.dtsi | 15 +++ - arch/arm/boot/dts/am335x-peripheral-i2c2.dtsi | 13 +++ - arch/arm/boot/dts/am335x-peripheral-nxp-hdmi.dtsi | 29 +++++ - arch/arm/boot/dts/am335x-peripheral-spi0.dtsi | 13 +++ - arch/arm/boot/dts/am335x-peripheral-spi1.dtsi | 13 +++ - arch/arm/boot/dts/am335x-peripheral-spi1a.dtsi | 13 +++ - arch/arm/boot/dts/am335x-peripheral-ttyS5.dtsi | 13 +++ - 18 files changed, 623 insertions(+) - create mode 100644 arch/arm/boot/dts/am335x-bone-emmc-in-reset.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-can1.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-emmc.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-i2c2.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-nxp-hdmi.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-spi0.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-spi1.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-spi1a.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-ttyS5.dtsi - create mode 100644 arch/arm/boot/dts/am335x-cape-rtc-ds1307.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-can1.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-emmc.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-i2c2.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-nxp-hdmi.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-spi0.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-spi1.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-spi1a.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-ttyS5.dtsi - -diff --git a/arch/arm/boot/dts/am335x-bone-emmc-in-reset.dtsi b/arch/arm/boot/dts/am335x-bone-emmc-in-reset.dtsi -new file mode 100644 -index 000000000000..7d8f673229c0 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-emmc-in-reset.dtsi -@@ -0,0 +1,18 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+/* standard */ -+ -+&gpio1 { -+ emmc_rst { -+ gpio-hog; -+ gpios = <20 0>; -+ output-high; -+ line-name = "EMMC ResetN"; -+ }; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-can1.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-can1.dtsi -new file mode 100644 -index 000000000000..9e264132cc46 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-can1.dtsi -@@ -0,0 +1,45 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-can1.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P9_24_pinmux { -+ * mode = "can"; -+ * }; -+ * P9_26_pinmux { -+ * mode = "can"; -+ * }; -+ *}; -+ * -+ *&dcan1 { -+ * pinctrl-0 = <>; -+ *}; -+ * -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ dcan1_pins: pinmux_dcan1_pins { -+ pinctrl-single,pins = < -+ /* P9_26: uart1_rxd.d_can1_tx */ -+ BONE_P9_26 (PIN_OUTPUT_PULLUP | MUX_MODE2) -+ /* P9_24: uart1_txd.d_can1_rx */ -+ BONE_P9_24 (PIN_INPUT_PULLUP | MUX_MODE2) -+ >; -+ }; -+}; -+ -+&dcan1 { -+ pinctrl-0 = <&dcan1_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-emmc.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-emmc.dtsi -new file mode 100644 -index 000000000000..22cf4621b357 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-emmc.dtsi -@@ -0,0 +1,88 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+/* Testing */ -+/* lsblk */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-emmc.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P8_21_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_20_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_25_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_24_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_05_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_06_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_23_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_22_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_03_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_04_pinmux { -+ * state = "disabled"; -+ * }; -+ *}; -+ * -+ *&mmc2 { -+ * pinctrl-0 = <>; -+ *}; -+ * -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ emmc_pins: pinmux_emmc_pins { -+ pinctrl-single,pins = < -+ /* P8_21: gpmc_csn1.mmc1_clk */ -+ BONE_P8_21 (PIN_INPUT_PULLUP | MUX_MODE2) -+ /* P8_20: gpmc_csn2.mmc1_cmd */ -+ BONE_P8_20 (PIN_INPUT_PULLUP | MUX_MODE2) -+ /* P8_25: gpmc_ad0.mmc1_dat0 */ -+ BONE_P8_25 (PIN_INPUT_PULLUP | MUX_MODE1) -+ /* P8_24: gpmc_ad1.mmc1_dat1 */ -+ BONE_P8_24 (PIN_INPUT_PULLUP | MUX_MODE1) -+ /* P8_05: gpmc_ad2.mmc1_dat2 */ -+ BONE_P8_05 (PIN_INPUT_PULLUP | MUX_MODE1) -+ /* P8_06: gpmc_ad3.mmc1_dat3 */ -+ BONE_P8_06 (PIN_INPUT_PULLUP | MUX_MODE1) -+ /* P8_23: gpmc_ad4.mmc1_dat4 */ -+ BONE_P8_23 (PIN_INPUT_PULLUP | MUX_MODE1) -+ /* P8_22: gpmc_ad5.mmc1_dat5 */ -+ BONE_P8_22 (PIN_INPUT_PULLUP | MUX_MODE1) -+ /* P8_03: gpmc_ad6.mmc1_dat6 */ -+ BONE_P8_03 (PIN_INPUT_PULLUP | MUX_MODE1) -+ /* P8_04: gpmc_ad7.mmc1_dat7 */ -+ BONE_P8_04 (PIN_INPUT_PULLUP | MUX_MODE1) -+ >; -+ }; -+}; -+ -+&mmc2 { -+ pinctrl-0 = <&emmc_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-i2c2.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-i2c2.dtsi -new file mode 100644 -index 000000000000..abf3b57522e3 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-i2c2.dtsi -@@ -0,0 +1,45 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-i2c2.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P9_19_pinmux { -+ * mode = "i2c"; -+ * }; -+ * P9_20_pinmux { -+ * mode = "i2c"; -+ * }; -+ *}; -+ * -+ *&dcan0 { -+ * pinctrl-0 = <>; -+ *}; -+ * -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ i2c2_pins: pinmux_i2c2_pins { -+ pinctrl-single,pins = < -+ /* P9_20: uart1_ctsn.i2c2_sda */ -+ BONE_P9_20 (SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE3) -+ /* P9_19: uart1_rtsn.i2c2_scl */ -+ BONE_P9_19 (SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE3) -+ >; -+ }; -+}; -+ -+&i2c2 { -+ pinctrl-0 = <&i2c2_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-nxp-hdmi.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-nxp-hdmi.dtsi -new file mode 100644 -index 000000000000..5205fa0f9a95 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-nxp-hdmi.dtsi -@@ -0,0 +1,120 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include "am335x-peripheral-nxp-hdmi.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P8_27_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_28_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_29_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_30_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_31_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_32_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_33_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_34_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_35_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_36_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_37_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_38_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_39_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_40_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_41_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_42_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_43_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_44_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_45_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_46_pinmux { -+ * state = "disabled"; -+ * }; -+ *}; -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ nxp_hdmi_pins: pinmux_nxp_hdmi_pins { -+ pinctrl-single,pins = < -+ AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr0 */ -+ AM33XX_IOPAD(0x8a0, PIN_OUTPUT | MUX_MODE0) /* lcd_data0.lcd_data0 */ -+ AM33XX_IOPAD(0x8a4, PIN_OUTPUT | MUX_MODE0) /* lcd_data1.lcd_data1 */ -+ AM33XX_IOPAD(0x8a8, PIN_OUTPUT | MUX_MODE0) /* lcd_data2.lcd_data2 */ -+ AM33XX_IOPAD(0x8ac, PIN_OUTPUT | MUX_MODE0) /* lcd_data3.lcd_data3 */ -+ AM33XX_IOPAD(0x8b0, PIN_OUTPUT | MUX_MODE0) /* lcd_data4.lcd_data4 */ -+ AM33XX_IOPAD(0x8b4, PIN_OUTPUT | MUX_MODE0) /* lcd_data5.lcd_data5 */ -+ AM33XX_IOPAD(0x8b8, PIN_OUTPUT | MUX_MODE0) /* lcd_data6.lcd_data6 */ -+ AM33XX_IOPAD(0x8bc, PIN_OUTPUT | MUX_MODE0) /* lcd_data7.lcd_data7 */ -+ AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE0) /* lcd_data8.lcd_data8 */ -+ AM33XX_IOPAD(0x8c4, PIN_OUTPUT | MUX_MODE0) /* lcd_data9.lcd_data9 */ -+ AM33XX_IOPAD(0x8c8, PIN_OUTPUT | MUX_MODE0) /* lcd_data10.lcd_data10 */ -+ AM33XX_IOPAD(0x8cc, PIN_OUTPUT | MUX_MODE0) /* lcd_data11.lcd_data11 */ -+ AM33XX_IOPAD(0x8d0, PIN_OUTPUT | MUX_MODE0) /* lcd_data12.lcd_data12 */ -+ AM33XX_IOPAD(0x8d4, PIN_OUTPUT | MUX_MODE0) /* lcd_data13.lcd_data13 */ -+ AM33XX_IOPAD(0x8d8, PIN_OUTPUT | MUX_MODE0) /* lcd_data14.lcd_data14 */ -+ AM33XX_IOPAD(0x8dc, PIN_OUTPUT | MUX_MODE0) /* lcd_data15.lcd_data15 */ -+ AM33XX_IOPAD(0x8e0, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_vsync.lcd_vsync */ -+ AM33XX_IOPAD(0x8e4, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_hsync.lcd_hsync */ -+ AM33XX_IOPAD(0x8e8, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_pclk.lcd_pclk */ -+ AM33XX_IOPAD(0x8ec, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* lcd_ac_bias_en.lcd_ac_bias_en */ -+ >; -+ }; -+ -+ nxp_hdmi_off_pins: nxp_hdmi_off_pins { -+ pinctrl-single,pins = < -+ AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr0 */ -+ >; -+ }; -+}; -+ -+&i2c0 { -+ tda19988 { -+ pinctrl-names = "default", "off"; -+ pinctrl-0 = <&nxp_hdmi_bonelt_pins>; -+ pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; -+ }; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-spi0.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-spi0.dtsi -new file mode 100644 -index 000000000000..354e66ad4f04 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-spi0.dtsi -@@ -0,0 +1,51 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-spi0.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P9_17_pinmux { -+ * status = "disabled"; -+ * }; -+ * P9_18_pinmux { -+ * status = "disabled"; -+ * }; -+ * P9_21_pinmux { -+ * status = "disabled"; -+ * }; -+ * P9_22_pinmux { -+ * status = "disabled"; -+ * }; -+ *}; -+ * -+ *&spi0 { -+ * pinctrl-0 = <>; -+ *}; -+ * -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ spi0_pins: pinmux_spi0_pins { -+ pinctrl-single,pins = < -+ 0x150 (PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_sclk.spi0_sclk */ -+ 0x154 (PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_d0.spi0_d0 */ -+ 0x158 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* spi0_d1.spi0_d1 */ -+ 0x15c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* spi0_cs0.spi0_cs0 */ -+ >; -+ }; -+}; -+ -+&spi0 { -+ pinctrl-0 = <&spi0_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-spi1.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-spi1.dtsi -new file mode 100644 -index 000000000000..bff7f8dae839 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-spi1.dtsi -@@ -0,0 +1,27 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-spi1.dtsi" -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ spi1_pins: pinmux_spi1_pins { -+ pinctrl-single,pins = < -+ 0x190 0x33 /* mcasp0_aclkx.spi1_sclk, INPUT_PULLUP | MODE3 */ -+ 0x194 0x33 /* mcasp0_fsx.spi1_d0, INPUT_PULLUP | MODE3 */ -+ 0x198 0x13 /* mcasp0_axr0.spi1_d1, OUTPUT_PULLUP | MODE3 */ -+ 0x19c 0x13 /* mcasp0_ahclkr.spi1_cs0, OUTPUT_PULLUP | MODE3 */ -+ // 0x164 0x12 /* eCAP0_in_PWM0_out.spi1_cs1 OUTPUT_PULLUP | MODE2 */ >; -+ }; -+}; -+ -+&spi1 { -+ pinctrl-0 = <&spi1_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-spi1a.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-spi1a.dtsi -new file mode 100644 -index 000000000000..62874c892ff7 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-spi1a.dtsi -@@ -0,0 +1,28 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-spi1.dtsi" -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ spi1a_pins: pinmux_spi1a_pins { -+ pinctrl-single,pins = < -+ 0x164 0x34 /* eCAP0_in_PWM0_out.spi1_sclk, INPUT_PULLUP | MODE4 */ -+ /* NOTE: P9.42 is connected to two pads */ -+ // 0x1A0 0x27 /* set the other pad to gpio input */ -+ 0x194 0x33 /* mcasp0_fsx.spi1_d0, INPUT_PULLUP | MODE3 */ -+ 0x198 0x13 /* mcasp0_axr0.spi1_d1, OUTPUT_PULLUP | MODE3 */ -+ 0x178 0x14 /* uart1_ctsn.spi1_cs0, OUTPUT_PULLUP | MODE4 */ >; -+ }; -+}; -+ -+&spi1 { -+ pinctrl-0 = <&spi1a_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-ttyS5.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-ttyS5.dtsi -new file mode 100644 -index 000000000000..01d0aec1de44 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-ttyS5.dtsi -@@ -0,0 +1,48 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+/* Testing */ -+/* sudo /sbin/getty -L ttyS5 115200 vt102 */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-ttyS5.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P8_37_pinmux { -+ * mode = "uart"; -+ * }; -+ * P8_38_pinmux { -+ * mode = "uart"; -+ * }; -+ *}; -+ * -+ *&uart5 { -+ * pinctrl-0 = <>; -+ *}; -+ * -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ uart5_pins: pinmux_uart5_pins { -+ pinctrl-single,pins = < -+ /* P8_38: lcd_data9.uart5_rxd */ -+ BONE_P8_38 (PIN_INPUT_PULLUP | MUX_MODE4) -+ /* P8_37: lcd_data8.uart5_txd */ -+ BONE_P8_37 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) -+ >; -+ }; -+}; -+ -+&uart5 { -+ pinctrl-0 = <&uart5_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-cape-rtc-ds1307.dtsi b/arch/arm/boot/dts/am335x-cape-rtc-ds1307.dtsi -new file mode 100644 -index 000000000000..bce6ac50cd89 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-cape-rtc-ds1307.dtsi -@@ -0,0 +1,31 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+ -+&am33xx_pinmux { -+ i2c2_pins: pinmux_i2c2_pins { -+ pinctrl-single,pins = < -+ BONE_P9_20 0x73 /* (SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE3) uart1_ctsn.i2c2_sda */ -+ BONE_P9_19 0x73 /* (SLEWCTRL_SLOW | PIN_INPUT_PULLUP | MUX_MODE3) uart1_rtsn.i2c2_scl */ -+ >; -+ }; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins>; -+ -+ status = "okay"; -+ clock-frequency = <100000>; -+ -+ rtc@68 { -+ compatible = "maxim,ds1307"; -+ reg = <0x68>; -+ }; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-can1.dtsi b/arch/arm/boot/dts/am335x-peripheral-can1.dtsi -new file mode 100644 -index 000000000000..02b5bd17066e ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-can1.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&dcan1 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-emmc.dtsi b/arch/arm/boot/dts/am335x-peripheral-emmc.dtsi -new file mode 100644 -index 000000000000..603f34ec6dc4 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-emmc.dtsi -@@ -0,0 +1,15 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&mmc2 { -+ vmmc-supply = <&vmmcsd_fixed>; -+ pinctrl-names = "default"; -+ -+ bus-width = <8>; -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-i2c2.dtsi b/arch/arm/boot/dts/am335x-peripheral-i2c2.dtsi -new file mode 100644 -index 000000000000..ed9a0b52f913 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-i2c2.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-nxp-hdmi.dtsi b/arch/arm/boot/dts/am335x-peripheral-nxp-hdmi.dtsi -new file mode 100644 -index 000000000000..1dfd26a691a6 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-nxp-hdmi.dtsi -@@ -0,0 +1,29 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&lcdc { -+ status = "okay"; -+ port { -+ lcdc_0: endpoint@0 { -+ remote-endpoint = <&hdmi_0>; -+ }; -+ }; -+}; -+ -+&i2c0 { -+ tda19988 { -+ compatible = "nxp,tda998x"; -+ reg = <0x70>; -+ -+ port { -+ hdmi_0: endpoint@0 { -+ remote-endpoint = <&lcdc_0>; -+ }; -+ }; -+ }; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-spi0.dtsi b/arch/arm/boot/dts/am335x-peripheral-spi0.dtsi -new file mode 100644 -index 000000000000..969e35259979 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-spi0.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&spi0 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-spi1.dtsi b/arch/arm/boot/dts/am335x-peripheral-spi1.dtsi -new file mode 100644 -index 000000000000..ac5fe97b65d9 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-spi1.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&spi1 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-spi1a.dtsi b/arch/arm/boot/dts/am335x-peripheral-spi1a.dtsi -new file mode 100644 -index 000000000000..ac5fe97b65d9 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-spi1a.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&spi1 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-ttyS5.dtsi b/arch/arm/boot/dts/am335x-peripheral-ttyS5.dtsi -new file mode 100644 -index 000000000000..8b42fb02b9b4 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-ttyS5.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&uart5 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; --- -2.11.0 - diff --git a/patches/beaglebone/generated/0001-auto-generated-capes-add-dtbs-to-makefile.patch b/patches/beaglebone/generated/0001-auto-generated-capes-add-dtbs-to-makefile.patch index bd83bba0e..59c92fdf5 100644 --- a/patches/beaglebone/generated/0001-auto-generated-capes-add-dtbs-to-makefile.patch +++ b/patches/beaglebone/generated/0001-auto-generated-capes-add-dtbs-to-makefile.patch @@ -1,34 +1,29 @@ -From b4e1e02cb05eac904f38d21394e087ff41117936 Mon Sep 17 00:00:00 2001 +From 23bb33ecc487dbce8393173df17bf562161c7c6e Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> -Date: Wed, 2 Jan 2019 08:58:01 -0600 +Date: Thu, 4 Apr 2019 17:17:03 -0500 Subject: [PATCH] auto generated: capes: add dtbs to makefile Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- - arch/arm/boot/dts/Makefile | 10 ++++++++++ - 1 file changed, 10 insertions(+) + arch/arm/boot/dts/Makefile | 5 +++++ + 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 6fb3ab4cbbe5..e44ea87b6e35 100644 +index 64d963019453..a225a81cb10a 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -718,6 +718,16 @@ dtb-$(CONFIG_SOC_AM33XX) += \ +@@ -725,6 +725,11 @@ dtb-$(CONFIG_SOC_AM33XX) += \ am335x-base0033.dtb \ am335x-bone.dtb \ am335x-boneblack.dtb \ + am335x-bonegreen-wireless-uboot-univ.dtb \ + am335x-boneblack-uboot-univ.dtb \ + am335x-bone-uboot-univ.dtb \ -+ am335x-boneblack-audio.dtb \ -+ am335x-boneblack-bbb-exp-r.dtb \ -+ am335x-boneblack-bbb-exp-c.dtb \ -+ am335x-boneblack-bbbmini.dtb \ -+ am335x-boneblack-wl1835mod.dtb \ -+ am335x-abbbi.dtb \ + am335x-boneblack-uboot.dtb \ ++ am335x-abbbi.dtb \ am335x-boneblack-wireless.dtb \ am335x-boneblue.dtb \ am335x-bonegreen.dtb \ -- -2.19.2 +2.20.1 diff --git a/patches/defconfig b/patches/defconfig index 8bf612052..e6ac29dcc 100644 --- a/patches/defconfig +++ b/patches/defconfig @@ -4,10 +4,10 @@ # # -# Compiler: arm-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802 +# Compiler: arm-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0 # CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=80201 +CONFIG_GCC_VERSION=80300 CONFIG_CLANG_VERSION=0 CONFIG_CC_HAS_ASM_GOTO=y CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y @@ -22,7 +22,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32 # CONFIG_COMPILE_TEST is not set CONFIG_LOCALVERSION="" # CONFIG_LOCALVERSION_AUTO is not set -CONFIG_BUILD_SALT="5.1-rc3-bone0" +CONFIG_BUILD_SALT="5.1-rc3-bone0.1" CONFIG_HAVE_KERNEL_GZIP=y CONFIG_HAVE_KERNEL_LZMA=y CONFIG_HAVE_KERNEL_XZ=y diff --git a/patches/drivers/ar1021_i2c/0001-ar1021_i2c-add-invert-swap-options.patch b/patches/drivers/ar1021_i2c/0001-ar1021_i2c-invert-swap-and-offset-options.patch similarity index 55% rename from patches/drivers/ar1021_i2c/0001-ar1021_i2c-add-invert-swap-options.patch rename to patches/drivers/ar1021_i2c/0001-ar1021_i2c-invert-swap-and-offset-options.patch index 08fc9b1c9..cc9055809 100644 --- a/patches/drivers/ar1021_i2c/0001-ar1021_i2c-add-invert-swap-options.patch +++ b/patches/drivers/ar1021_i2c/0001-ar1021_i2c-invert-swap-and-offset-options.patch @@ -1,26 +1,30 @@ -From 8c5718a8366cf556c7fc098a77312a2f83efe75f Mon Sep 17 00:00:00 2001 +From 3200e7ab3642f9da30b2f11777c8133c8ea314aa Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> -Date: Mon, 29 Jan 2018 13:20:10 -0600 -Subject: [PATCH] ar1021_i2c: add invert/swap options +Date: Fri, 5 Apr 2019 09:51:32 -0500 +Subject: [PATCH] ar1021_i2c: invert/swap and offset options Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- - drivers/input/touchscreen/ar1021_i2c.c | 45 ++++++++++++++++++++++++++++++---- - 1 file changed, 40 insertions(+), 5 deletions(-) + drivers/input/touchscreen/ar1021_i2c.c | 85 ++++++++++++++++++++++++-- + 1 file changed, 80 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c -index b35b640fdadf..5c6fe0440399 100644 +index b35b640fdadf..a1d4019c5a74 100644 --- a/drivers/input/touchscreen/ar1021_i2c.c +++ b/drivers/input/touchscreen/ar1021_i2c.c -@@ -18,6 +18,7 @@ +@@ -18,6 +18,11 @@ #define AR1021_MAX_X 4095 #define AR1021_MAX_Y 4095 +#define AR1021_MAX_PRESSURE 255 ++ ++#define AR1021_CMD 0x55 ++ ++#define AR1021_CMD_ENABLE_TOUCH 0x12 #define AR1021_CMD 0x55 -@@ -27,6 +28,9 @@ struct ar1021_i2c { +@@ -27,8 +32,29 @@ struct ar1021_i2c { struct i2c_client *client; struct input_dev *input; u8 data[AR1021_TOCUH_PKG_SIZE]; @@ -29,8 +33,28 @@ index b35b640fdadf..5c6fe0440399 100644 + bool swap_xy; }; ++static bool ar1021_get_prop_u32(struct device *dev, ++ const char *property, ++ unsigned int default_value, ++ unsigned int *value) ++{ ++ u32 val; ++ int error; ++ ++ error = device_property_read_u32(dev, property, &val); ++ if (error) { ++ *value = default_value; ++ return false; ++ } ++ ++ *value = val; ++ return true; ++} ++ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) -@@ -50,9 +54,22 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) + { + struct ar1021_i2c *ar1021 = dev_id; +@@ -50,9 +76,22 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) x = ((data[2] & 0x1f) << 7) | (data[1] & 0x7f); y = ((data[4] & 0x1f) << 7) | (data[3] & 0x7f); @@ -55,13 +79,38 @@ index b35b640fdadf..5c6fe0440399 100644 input_sync(input); out: -@@ -117,10 +134,28 @@ static int ar1021_i2c_probe(struct i2c_client *client, +@@ -94,6 +133,8 @@ static int ar1021_i2c_probe(struct i2c_client *client, + struct ar1021_i2c *ar1021; + struct input_dev *input; + int error; ++ unsigned int offset_x, offset_y; ++ bool data_present; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { + dev_err(&client->dev, "i2c_check_functionality error\n"); +@@ -117,10 +158,44 @@ static int ar1021_i2c_probe(struct i2c_client *client, input->open = ar1021_i2c_open; input->close = ar1021_i2c_close; + ar1021->invert_x = device_property_read_bool(&client->dev, "touchscreen-inverted-x"); + ar1021->invert_y = device_property_read_bool(&client->dev, "touchscreen-inverted-y"); + ar1021->swap_xy = device_property_read_bool(&client->dev, "touchscreen-swapped-x-y"); ++ ++ data_present = ar1021_get_prop_u32(&client->dev, ++ "touchscreen-offset-x", ++ 0, ++ &offset_x); ++ ++ if (data_present) ++ dev_info(&client->dev, "touchscreen-offset-x: %d\n", offset_x); ++ ++ data_present = ar1021_get_prop_u32(&client->dev, ++ "touchscreen-offset-y", ++ 0, ++ &offset_y); ++ ++ if (data_present) ++ dev_info(&client->dev, "touchscreen-offset-y: %d\n", offset_y); + __set_bit(INPUT_PROP_DIRECT, input->propbit); - input_set_capability(input, EV_KEY, BTN_TOUCH); @@ -79,8 +128,8 @@ index b35b640fdadf..5c6fe0440399 100644 + } + else + { -+ input_set_abs_params(input, ABS_X, 0, AR1021_MAX_X, 0, 0); -+ input_set_abs_params(input, ABS_Y, 0, AR1021_MAX_Y, 0, 0); ++ input_set_abs_params(input, ABS_X, offset_x, AR1021_MAX_X-offset_x, 0, 0); ++ input_set_abs_params(input, ABS_Y, offset_y, AR1021_MAX_Y-offset_y, 0, 0); + } + + input_set_abs_params(input, ABS_PRESSURE, 0, AR1021_MAX_PRESSURE, 0, 0); @@ -88,5 +137,5 @@ index b35b640fdadf..5c6fe0440399 100644 input_set_drvdata(input, ar1021); -- -2.15.1 +2.20.1 diff --git a/patches/drivers/ar1021_i2c/0002-ar1021_i2c.c-introduce-offsets-to-manually-re-calbra.patch b/patches/drivers/ar1021_i2c/0002-ar1021_i2c.c-introduce-offsets-to-manually-re-calbra.patch deleted file mode 100644 index eacd4c09b..000000000 --- a/patches/drivers/ar1021_i2c/0002-ar1021_i2c.c-introduce-offsets-to-manually-re-calbra.patch +++ /dev/null @@ -1,97 +0,0 @@ -From e8718b212c8451b5c89bff7e636716d21070aaa1 Mon Sep 17 00:00:00 2001 -From: Robert Nelson <robertcnelson@gmail.com> -Date: Mon, 29 Jan 2018 13:23:40 -0600 -Subject: [PATCH 2/2] ar1021_i2c.c: introduce offsets to manually re-calbrate - screen - -Signed-off-by: Robert Nelson <robertcnelson@gmail.com> ---- - drivers/input/touchscreen/ar1021_i2c.c | 44 ++++++++++++++++++++++++++++++++-- - 1 file changed, 42 insertions(+), 2 deletions(-) - -diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c -index 5c6fe0440399..a1d4019c5a74 100644 ---- a/drivers/input/touchscreen/ar1021_i2c.c -+++ b/drivers/input/touchscreen/ar1021_i2c.c -@@ -24,6 +24,10 @@ - - #define AR1021_CMD_ENABLE_TOUCH 0x12 - -+#define AR1021_CMD 0x55 -+ -+#define AR1021_CMD_ENABLE_TOUCH 0x12 -+ - struct ar1021_i2c { - struct i2c_client *client; - struct input_dev *input; -@@ -33,6 +37,24 @@ struct ar1021_i2c { - bool swap_xy; - }; - -+static bool ar1021_get_prop_u32(struct device *dev, -+ const char *property, -+ unsigned int default_value, -+ unsigned int *value) -+{ -+ u32 val; -+ int error; -+ -+ error = device_property_read_u32(dev, property, &val); -+ if (error) { -+ *value = default_value; -+ return false; -+ } -+ -+ *value = val; -+ return true; -+} -+ - static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) - { - struct ar1021_i2c *ar1021 = dev_id; -@@ -111,6 +133,8 @@ static int ar1021_i2c_probe(struct i2c_client *client, - struct ar1021_i2c *ar1021; - struct input_dev *input; - int error; -+ unsigned int offset_x, offset_y; -+ bool data_present; - - if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { - dev_err(&client->dev, "i2c_check_functionality error\n"); -@@ -138,6 +162,22 @@ static int ar1021_i2c_probe(struct i2c_client *client, - ar1021->invert_y = device_property_read_bool(&client->dev, "touchscreen-inverted-y"); - ar1021->swap_xy = device_property_read_bool(&client->dev, "touchscreen-swapped-x-y"); - -+ data_present = ar1021_get_prop_u32(&client->dev, -+ "touchscreen-offset-x", -+ 0, -+ &offset_x); -+ -+ if (data_present) -+ dev_info(&client->dev, "touchscreen-offset-x: %d\n", offset_x); -+ -+ data_present = ar1021_get_prop_u32(&client->dev, -+ "touchscreen-offset-y", -+ 0, -+ &offset_y); -+ -+ if (data_present) -+ dev_info(&client->dev, "touchscreen-offset-y: %d\n", offset_y); -+ - __set_bit(INPUT_PROP_DIRECT, input->propbit); - //input_set_capability(input, EV_KEY, BTN_TOUCH); - -@@ -151,8 +191,8 @@ static int ar1021_i2c_probe(struct i2c_client *client, - } - else - { -- input_set_abs_params(input, ABS_X, 0, AR1021_MAX_X, 0, 0); -- input_set_abs_params(input, ABS_Y, 0, AR1021_MAX_Y, 0, 0); -+ input_set_abs_params(input, ABS_X, offset_x, AR1021_MAX_X-offset_x, 0, 0); -+ input_set_abs_params(input, ABS_Y, offset_y, AR1021_MAX_Y-offset_y, 0, 0); - } - - input_set_abs_params(input, ABS_PRESSURE, 0, AR1021_MAX_PRESSURE, 0, 0); --- -2.15.1 - diff --git a/patches/drivers/pwm/0001-pwm-Create-device-class-for-pwm-channels.patch b/patches/drivers/pwm/0001-pwm-Create-device-class-for-pwm-channels.patch index 6a54d778e..ebd04e0d9 100644 --- a/patches/drivers/pwm/0001-pwm-Create-device-class-for-pwm-channels.patch +++ b/patches/drivers/pwm/0001-pwm-Create-device-class-for-pwm-channels.patch @@ -1,7 +1,7 @@ -From e908ce05b151aa9a161afdd1b6be6feae98330da Mon Sep 17 00:00:00 2001 +From bd9672e274031f856334be8daf44ce60df77d896 Mon Sep 17 00:00:00 2001 From: David Hsu <davidhsu@google.com> Date: Sun, 30 Apr 2017 22:10:56 -0500 -Subject: [PATCH 2/2] pwm: Create device class for pwm channels +Subject: [PATCH] pwm: Create device class for pwm channels #https://lkml.org/lkml/2016/6/14/967 @@ -102,5 +102,5 @@ index ceb233dd6048..5c34b816c628 100644 if (IS_ERR(parent)) { dev_warn(chip->dev, -- -2.19.2 +2.20.1 diff --git a/patches/drivers/spi/0001-NFM-spi-spidev-allow-use-of-spidev-in-DT.patch b/patches/drivers/spi/0001-NFM-spi-spidev-allow-use-of-spidev-in-DT.patch index 797cbb5f4..76feaf79a 100644 --- a/patches/drivers/spi/0001-NFM-spi-spidev-allow-use-of-spidev-in-DT.patch +++ b/patches/drivers/spi/0001-NFM-spi-spidev-allow-use-of-spidev-in-DT.patch @@ -1,4 +1,4 @@ -From 44f94886a63279c6fcf36304eacab5d3d5b3b663 Mon Sep 17 00:00:00 2001 +From 89270ca9bed2dd895e56c3da7a5d13196063c224 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Sun, 28 Oct 2018 16:14:23 -0500 Subject: [PATCH] NFM: spi: spidev: allow use of spidev in DT @@ -28,5 +28,5 @@ index b0c76e2626ce..2dabf005ed66 100644 spidev_probe_acpi(spi); -- -2.19.1 +2.20.1 diff --git a/patches/drivers/ssd1306/0001-fb_ssd1306-add-support-for-MikroElectronica-OLED-B-C.patch b/patches/drivers/ssd1306/0001-fb_ssd1306-add-support-for-MikroElectronica-OLED-B-C.patch index 1542fc8af..9b8642390 100644 --- a/patches/drivers/ssd1306/0001-fb_ssd1306-add-support-for-MikroElectronica-OLED-B-C.patch +++ b/patches/drivers/ssd1306/0001-fb_ssd1306-add-support-for-MikroElectronica-OLED-B-C.patch @@ -1,4 +1,4 @@ -From 89bd8ffdaf148696543fee9fdd87fb0a111d6e24 Mon Sep 17 00:00:00 2001 +From ff09b6ee6403dc28b892499c1779fb16b11ebb17 Mon Sep 17 00:00:00 2001 From: Jason Kridner <jdk@ti.com> Date: Mon, 22 Jan 2018 09:12:34 +0000 Subject: [PATCH] fb_ssd1306: add support for MikroElectronica OLED B Click diff --git a/patches/drivers/ti/cpsw/0001-cpsw-search-for-phy.patch b/patches/drivers/ti/cpsw/0001-cpsw-search-for-phy.patch index 91e933dc3..ede9f28a5 100644 --- a/patches/drivers/ti/cpsw/0001-cpsw-search-for-phy.patch +++ b/patches/drivers/ti/cpsw/0001-cpsw-search-for-phy.patch @@ -1,4 +1,4 @@ -From 0f71b5da43eb6dabb2567b9a52179d700cdfa1d5 Mon Sep 17 00:00:00 2001 +From 19e9235c0e3e73d8204cefcf7e499849b87c72a5 Mon Sep 17 00:00:00 2001 From: Jay at Control Module Industries <cmidroid@gmail.com> Date: Tue, 19 May 2015 13:35:14 -0500 Subject: [PATCH] cpsw: search for phy @@ -143,5 +143,5 @@ index a98aedae1b41..a981c5e06cc8 100644 #ifdef CONFIG_PM_SLEEP -- -2.17.1 +2.20.1 diff --git a/patches/drivers/ti/eqep/0001-tieqep-forward-port-of-Nathaniel-Lewis-eQEP-driver.patch b/patches/drivers/ti/eqep/0001-tieqep-forward-port-of-Nathaniel-Lewis-eQEP-driver.patch index 387820d42..679f8381a 100644 --- a/patches/drivers/ti/eqep/0001-tieqep-forward-port-of-Nathaniel-Lewis-eQEP-driver.patch +++ b/patches/drivers/ti/eqep/0001-tieqep-forward-port-of-Nathaniel-Lewis-eQEP-driver.patch @@ -1,22 +1,22 @@ -From 99ccea81afb18dcf35be05a4e7f7daf34ed52438 Mon Sep 17 00:00:00 2001 +From 523de078edb45c432770993a37202d0415cec261 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Sun, 30 Dec 2018 19:37:59 -0600 -Subject: [PATCH] tieqep: forward port of Nathaniel Lewis eQEP driver +Subject: [PATCH 1/2] tieqep: forward port of Nathaniel Lewis eQEP driver Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- - arch/arm/boot/dts/am33xx.dtsi | 30 ++ - drivers/misc/Kconfig | 11 + - drivers/misc/Makefile | 1 + - drivers/misc/tieqep.c | 738 ++++++++++++++++++++++++++++++++++ + arch/arm/boot/dts/am33xx-l4.dtsi | 30 ++ + drivers/misc/Kconfig | 11 + + drivers/misc/Makefile | 1 + + drivers/misc/tieqep.c | 738 +++++++++++++++++++++++++++++++ 4 files changed, 780 insertions(+) create mode 100644 drivers/misc/tieqep.c diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi -index 7b818d9d2eab..74b82fd23f9c 100644 +index f459ec316a22..44c3f33f78a6 100644 --- a/arch/arm/boot/dts/am33xx-l4.dtsi +++ b/arch/arm/boot/dts/am33xx-l4.dtsi -@@ -1913,6 +1913,16 @@ +@@ -1912,6 +1912,16 @@ status = "disabled"; }; @@ -33,7 +33,7 @@ index 7b818d9d2eab..74b82fd23f9c 100644 ehrpwm0: pwm@200 { compatible = "ti,am3352-ehrpwm", "ti,am33xx-ehrpwm"; -@@ -1966,6 +1976,16 @@ +@@ -1965,6 +1975,16 @@ status = "disabled"; }; @@ -50,7 +50,7 @@ index 7b818d9d2eab..74b82fd23f9c 100644 ehrpwm1: pwm@200 { compatible = "ti,am3352-ehrpwm", "ti,am33xx-ehrpwm"; -@@ -2019,6 +2039,16 @@ +@@ -2018,6 +2038,16 @@ status = "disabled"; }; @@ -68,10 +68,10 @@ index 7b818d9d2eab..74b82fd23f9c 100644 compatible = "ti,am3352-ehrpwm", "ti,am33xx-ehrpwm"; diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index f417b06e11c5..6794ef7099b8 100644 +index 42ab8ec92a04..e4290588bed9 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig -@@ -521,6 +521,17 @@ config PVPANIC +@@ -532,6 +532,17 @@ config PVPANIC a paravirtualized device provided by QEMU; it lets a virtual machine (guest) communicate panic events to the host. @@ -90,10 +90,10 @@ index f417b06e11c5..6794ef7099b8 100644 source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index e39ccbbc1b3a..c287701f4c9a 100644 +index d5b7d3404dc7..80885df95e0c 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile -@@ -43,6 +43,7 @@ obj-y += ti-st/ +@@ -44,6 +44,7 @@ obj-y += ti-st/ obj-y += lis3lv02d/ obj-$(CONFIG_USB_SWITCH_FSA9480) += fsa9480.o obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/ @@ -846,5 +846,5 @@ index 000000000000..d2628847bb8e +MODULE_AUTHOR("Nathaniel R. Lewis"); +MODULE_LICENSE("GPL"); -- -2.19.2 +2.20.1 diff --git a/patches/drivers/ti/eqep/0002-tieqep-fix-unhandled-fault-on-eQEP-register-access.patch b/patches/drivers/ti/eqep/0002-tieqep-fix-unhandled-fault-on-eQEP-register-access.patch index 8d33c5676..ccec85f2f 100644 --- a/patches/drivers/ti/eqep/0002-tieqep-fix-unhandled-fault-on-eQEP-register-access.patch +++ b/patches/drivers/ti/eqep/0002-tieqep-fix-unhandled-fault-on-eQEP-register-access.patch @@ -1,7 +1,7 @@ -From f5f7209b572ddeb4831a1f9ae5e27655e0fb3e04 Mon Sep 17 00:00:00 2001 +From 8c343fd056216ba03345da5f1ca16ede76f72f6a Mon Sep 17 00:00:00 2001 From: Drew Fustini <drew@pdp7.com> Date: Thu, 2 Feb 2017 05:19:11 -0600 -Subject: [PATCH] tieqep: fix unhandled fault on eQEP register access +Subject: [PATCH 2/2] tieqep: fix unhandled fault on eQEP register access Call pm_runtime_get_sync() at the beginning of any functions that will read or write to the memory mapped eQEP registers. This is to ensure @@ -24,7 +24,7 @@ https://groups.google.com/d/msg/beagleboard/_TdTH7oPEXE/MNvU-mY6DgAJ 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/misc/tieqep.c b/drivers/misc/tieqep.c -index d2628847..bb69ad4 100644 +index d2628847bb8e..bb69ad4468e2 100644 --- a/drivers/misc/tieqep.c +++ b/drivers/misc/tieqep.c @@ -241,9 +241,13 @@ static ssize_t eqep_get_enabled(struct device *dev, struct device_attribute *att @@ -97,5 +97,5 @@ index d2628847..bb69ad4 100644 if (tmp_mode == TIEQEP_MODE_ABSOLUTE) { -- -2.9.3 +2.20.1 diff --git a/patches/drivers/ti/etnaviv/0001-ti-dra7-etnaviv-2d-acceleration.patch b/patches/drivers/ti/etnaviv/0001-ti-dra7-etnaviv-2d-acceleration.patch index 734b5758f..6273ea305 100644 --- a/patches/drivers/ti/etnaviv/0001-ti-dra7-etnaviv-2d-acceleration.patch +++ b/patches/drivers/ti/etnaviv/0001-ti-dra7-etnaviv-2d-acceleration.patch @@ -1,4 +1,4 @@ -From 6f4da6b0e818a8725cf9b4f7a8ee180752cb0f07 Mon Sep 17 00:00:00 2001 +From 954fc84cf778050de4da6ed19566b6dc3673d31a Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Sun, 17 Mar 2019 18:31:07 -0500 Subject: [PATCH] ti: dra7: etnaviv: 2d acceleration diff --git a/patches/drivers/ti/firmware/0001-add-am33x-firmware.patch b/patches/drivers/ti/firmware/0001-Add-AM335x-CM3-Power-Managment-Firmware.patch similarity index 99% rename from patches/drivers/ti/firmware/0001-add-am33x-firmware.patch rename to patches/drivers/ti/firmware/0001-Add-AM335x-CM3-Power-Managment-Firmware.patch index 430da494a..672a99f72 100644 --- a/patches/drivers/ti/firmware/0001-add-am33x-firmware.patch +++ b/patches/drivers/ti/firmware/0001-Add-AM335x-CM3-Power-Managment-Firmware.patch @@ -1,7 +1,7 @@ -From b0dc7860a2a8802e14ca282cd90262a2d8cc198a Mon Sep 17 00:00:00 2001 +From a2d86608d32b3e57da097d988e359d036a026189 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> -Date: Wed, 20 Jun 2018 11:06:50 -0500 -Subject: [PATCH] add am33x firmware +Date: Fri, 5 Apr 2019 09:49:14 -0500 +Subject: [PATCH] Add AM335x CM3 Power Managment Firmware Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -1040,5 +1040,5 @@ literal 0 HcmV?d00001 -- -2.17.1 +2.20.1 diff --git a/patches/drivers/ti/gpio/0001-BeagleBone-pinmux-helper.patch b/patches/drivers/ti/gpio/0001-BeagleBone-pinmux-helper.patch index a1893b3b5..5344903b1 100644 --- a/patches/drivers/ti/gpio/0001-BeagleBone-pinmux-helper.patch +++ b/patches/drivers/ti/gpio/0001-BeagleBone-pinmux-helper.patch @@ -1,7 +1,10 @@ -From baff097e6c14f236aac7ba79afbe4a571c5bee3f Mon Sep 17 00:00:00 2001 +From 0080afd9ece3d7f24d46d49d51fe4b503b064f55 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Mon, 29 Jan 2018 13:43:56 -0600 -Subject: [PATCH] BeagleBone pinmux helper +Subject: [PATCH 1/3] BeagleBone pinmux helper +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Authors: Pantelis Antoniou <panto@antoniou-consulting.com> @@ -16,18 +19,18 @@ https://github.com/RobertCNelson/linux-dev/tree/35e301ae8436e9f56f65bf1a7440021e Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- - arch/arm/boot/dts/am33xx.dtsi | 2 +- - drivers/gpio/Kconfig | 14 + - drivers/gpio/Makefile | 1 + - drivers/gpio/gpio-of-helper.c | 435 ++++++++++++++++++++++ - drivers/gpio/gpiolib-sysfs.c | 35 +- - drivers/misc/Kconfig | 1 + - drivers/misc/Makefile | 1 + - drivers/misc/cape/Kconfig | 5 + - drivers/misc/cape/Makefile | 5 + - drivers/misc/cape/beaglebone/Kconfig | 10 + - drivers/misc/cape/beaglebone/Makefile | 5 + - drivers/misc/cape/beaglebone/bone-pinmux-helper.c | 242 ++++++++++++ + arch/arm/boot/dts/am33xx.dtsi | 2 +- + drivers/gpio/Kconfig | 14 + + drivers/gpio/Makefile | 1 + + drivers/gpio/gpio-of-helper.c | 435 ++++++++++++++++++ + drivers/gpio/gpiolib-sysfs.c | 35 +- + drivers/misc/Kconfig | 1 + + drivers/misc/Makefile | 1 + + drivers/misc/cape/Kconfig | 5 + + drivers/misc/cape/Makefile | 5 + + drivers/misc/cape/beaglebone/Kconfig | 10 + + drivers/misc/cape/beaglebone/Makefile | 5 + + .../misc/cape/beaglebone/bone-pinmux-helper.c | 242 ++++++++++ 12 files changed, 752 insertions(+), 4 deletions(-) create mode 100644 drivers/gpio/gpio-of-helper.c create mode 100644 drivers/misc/cape/Kconfig @@ -37,10 +40,10 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> create mode 100644 drivers/misc/cape/beaglebone/bone-pinmux-helper.c diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi -index a6e8b192a8bf..d107115115ab 100644 +index a2eca3f4feac..f9a7e1d48174 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi -@@ -157,7 +157,7 @@ +@@ -160,7 +160,7 @@ * for the moment, just use a fake OCP bus entry to represent * the whole bus hierarchy. */ @@ -50,10 +53,10 @@ index a6e8b192a8bf..d107115115ab 100644 #address-cells = <1>; #size-cells = <1>; diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig -index 8dbb2280538d..e0781ba629e3 100644 +index 3f50526a771f..579ecfe34b59 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig -@@ -61,6 +61,20 @@ config GPIO_SYSFS +@@ -73,6 +73,20 @@ config GPIO_SYSFS Kernel drivers may also request that a particular GPIO be exported to userspace; this can be useful when debugging. @@ -75,7 +78,7 @@ index 8dbb2280538d..e0781ba629e3 100644 depends on HAS_IOMEM # Only for IOMEM drivers tristate diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile -index cccb0d40846c..a50ea0310003 100644 +index 54d55274b93a..b8054699c3eb 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_GPIOLIB) += gpiolib-devprop.o @@ -528,7 +531,7 @@ index 000000000000..83f362f7da5f +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:gpio-of-helper"); diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c -index 3dbaf489a8a5..7015730d84f9 100644 +index fbf6b1a0a4fa..ec7aa6f3c56e 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -37,10 +37,10 @@ static DEFINE_MUTEX(sysfs_lock); @@ -624,10 +627,10 @@ index 3dbaf489a8a5..7015730d84f9 100644 * /sys/class/gpio/gpiochipN/ * /base ... matching gpio_chip.base (N) diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index 886f466e3485..4f50f5b28868 100644 +index e4290588bed9..5a1c54960685 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig -@@ -521,6 +521,7 @@ source "drivers/misc/mei/Kconfig" +@@ -553,6 +553,7 @@ source "drivers/misc/mei/Kconfig" source "drivers/misc/vmw_vmci/Kconfig" source "drivers/misc/mic/Kconfig" source "drivers/misc/genwqe/Kconfig" @@ -636,10 +639,10 @@ index 886f466e3485..4f50f5b28868 100644 source "drivers/misc/cxl/Kconfig" source "drivers/misc/ocxl/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index 34e54dc28ac9..9d47283bacc4 100644 +index 80885df95e0c..0a139ba5446a 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile -@@ -50,6 +50,7 @@ obj-$(CONFIG_SRAM) += sram.o +@@ -52,6 +52,7 @@ obj-$(CONFIG_SRAM) += sram.o obj-$(CONFIG_SRAM_EXEC) += sram-exec.o obj-y += mic/ obj-$(CONFIG_GENWQE) += genwqe/ @@ -945,5 +948,5 @@ index 000000000000..d81363a77b10 +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:bone-pinmux-helper"); -- -2.16.1 +2.20.1 diff --git a/patches/drivers/ti/gpio/0002-am33xx-add-gpio-line-names.patch b/patches/drivers/ti/gpio/0002-am33xx-add-gpio-line-names.patch index 473b5e460..f1560c796 100644 --- a/patches/drivers/ti/gpio/0002-am33xx-add-gpio-line-names.patch +++ b/patches/drivers/ti/gpio/0002-am33xx-add-gpio-line-names.patch @@ -1,14 +1,14 @@ -From a2a99ba0dc152f7175d4191b02b77eb6ab62bcb5 Mon Sep 17 00:00:00 2001 +From ff6d24db1dc8c5abc2eca7858389a9bb5a9d6ebd Mon Sep 17 00:00:00 2001 From: Jason Kridner <jdk@ti.com> Date: Tue, 2 Jan 2018 20:18:02 +0000 -Subject: [PATCH 2/2] am33xx: add gpio line names +Subject: [PATCH 2/3] am33xx: add gpio line names --- arch/arm/boot/dts/am33xx-l4.dtsi | 132 +++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi -index 74b82fd23f9c..1b2dd62ea069 100644 +index 44c3f33f78a6..3cb07b979da7 100644 --- a/arch/arm/boot/dts/am33xx-l4.dtsi +++ b/arch/arm/boot/dts/am33xx-l4.dtsi @@ -158,6 +158,39 @@ @@ -51,7 +51,7 @@ index 74b82fd23f9c..1b2dd62ea069 100644 }; }; -@@ -1300,6 +1333,39 @@ +@@ -1299,6 +1332,39 @@ #interrupt-cells = <2>; reg = <0x0 0x1000>; interrupts = <98>; @@ -91,7 +91,7 @@ index 74b82fd23f9c..1b2dd62ea069 100644 }; }; -@@ -1712,6 +1778,39 @@ +@@ -1711,6 +1777,39 @@ #interrupt-cells = <2>; reg = <0x0 0x1000>; interrupts = <32>; @@ -131,7 +131,7 @@ index 74b82fd23f9c..1b2dd62ea069 100644 }; }; -@@ -1746,6 +1845,39 @@ +@@ -1745,6 +1844,39 @@ #interrupt-cells = <2>; reg = <0x0 0x1000>; interrupts = <62>; @@ -172,5 +172,5 @@ index 74b82fd23f9c..1b2dd62ea069 100644 }; -- -2.19.2 +2.20.1 diff --git a/patches/drivers/ti/gpio/0003-hack-gpiolib-yes-we-have-drivers-stomping-on-each-ot.patch b/patches/drivers/ti/gpio/0003-hack-gpiolib-yes-we-have-drivers-stomping-on-each-ot.patch index 670600d0f..a6900f4a1 100644 --- a/patches/drivers/ti/gpio/0003-hack-gpiolib-yes-we-have-drivers-stomping-on-each-ot.patch +++ b/patches/drivers/ti/gpio/0003-hack-gpiolib-yes-we-have-drivers-stomping-on-each-ot.patch @@ -1,4 +1,4 @@ -From 165a927026493f1dd6f964d6c4ebec7d6ce8bbed Mon Sep 17 00:00:00 2001 +From 74a9234de08135ade696e1391e30caed8495618f Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Sun, 30 Dec 2018 19:44:02 -0600 Subject: [PATCH 3/3] hack: gpiolib: yes we have drivers stomping on each @@ -10,10 +10,10 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c -index 1651d7f0a303..51f1b15a1005 100644 +index 0495bf1d480a..bbd7791b2739 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c -@@ -2284,10 +2284,10 @@ static int gpiod_request_commit(struct gpio_desc *desc, const char *label) +@@ -2328,10 +2328,10 @@ static int gpiod_request_commit(struct gpio_desc *desc, const char *label) if (test_and_set_bit(FLAG_REQUESTED, &desc->flags) == 0) { desc_set_label(desc, label ? : "?"); status = 0; @@ -29,5 +29,5 @@ index 1651d7f0a303..51f1b15a1005 100644 if (chip->request) { -- -2.19.2 +2.20.1 diff --git a/patches/drivers/ti/overlays/0001-ARM-DT-Enable-symbols-when-CONFIG_OF_OVERLAY-is-used.patch b/patches/drivers/ti/overlays/0001-ARM-DT-Enable-symbols-when-CONFIG_OF_OVERLAY-is-used.patch index 5bb4662b7..edea94939 100644 --- a/patches/drivers/ti/overlays/0001-ARM-DT-Enable-symbols-when-CONFIG_OF_OVERLAY-is-used.patch +++ b/patches/drivers/ti/overlays/0001-ARM-DT-Enable-symbols-when-CONFIG_OF_OVERLAY-is-used.patch @@ -1,4 +1,4 @@ -From 8fc4764e1f9d72fc548be173bfa5b481cd460bf1 Mon Sep 17 00:00:00 2001 +From 5fd51571912b3c0a7ee5a3f7cc726e65ec32e385 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Date: Sat, 6 Dec 2014 20:10:49 +0200 Subject: [PATCH] ARM: DT: Enable symbols when CONFIG_OF_OVERLAY is used @@ -9,7 +9,7 @@ Subject: [PATCH] ARM: DT: Enable symbols when CONFIG_OF_OVERLAY is used 2 files changed, 9 insertions(+) diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile -index a3af4dc08c3e..5e9c1d6bd88e 100644 +index 0b3cd7a33a26..87a8b8db3411 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile @@ -29,6 +29,10 @@ export ZRELADDR INITRD_PHYS PARAMS_PHYS @@ -24,7 +24,7 @@ index a3af4dc08c3e..5e9c1d6bd88e 100644 cmd_deflate_xip_data = $(CONFIG_SHELL) -c \ diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index ade7a38543dc..dd2d291bf141 100644 +index f4f5aeaf3298..61b699dbb56f 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1,4 +1,9 @@ @@ -38,5 +38,5 @@ index ade7a38543dc..dd2d291bf141 100644 alpine-db.dtb dtb-$(CONFIG_MACH_ARTPEC6) += \ -- -2.15.1 +2.20.1 diff --git a/patches/drivers/ti/rogerq_pruss/0001-dt-bindings-remoteproc-Add-TI-PRUSS-bindings.patch b/patches/drivers/ti/rogerq_pruss/0001-dt-bindings-remoteproc-Add-TI-PRUSS-bindings.patch deleted file mode 100644 index cafd75525..000000000 --- a/patches/drivers/ti/rogerq_pruss/0001-dt-bindings-remoteproc-Add-TI-PRUSS-bindings.patch +++ /dev/null @@ -1,239 +0,0 @@ -From 82f890d286f0c0db1424d6df099ab6a97d1a2138 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Fri, 10 Nov 2017 11:05:31 -0600 -Subject: [PATCH 01/25] dt-bindings: remoteproc: Add TI PRUSS bindings - -This patch adds the bindings for the Programmable Real-Time Unit -and Industrial Communication Subsystem (PRU-ICSS) present on various -SoCs such as AM33xx, AM437x, AM57xx, Keystone 66AK2G SoC, etc. It is -present on the Davinci based OMAPL138 SoCs and K3 architecture -based AM65x SoCs as well (not covered for now). - -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - .../devicetree/bindings/soc/ti/ti,pruss.txt | 212 ++++++++++++++++++ - 1 file changed, 212 insertions(+) - create mode 100644 Documentation/devicetree/bindings/soc/ti/ti,pruss.txt - -diff --git a/Documentation/devicetree/bindings/soc/ti/ti,pruss.txt b/Documentation/devicetree/bindings/soc/ti/ti,pruss.txt -new file mode 100644 -index 000000000000..5ac76fd32abd ---- /dev/null -+++ b/Documentation/devicetree/bindings/soc/ti/ti,pruss.txt -@@ -0,0 +1,212 @@ -+PRU-ICSS on TI SoCs -+=================== -+ -+The Programmable Real-Time Unit and Industrial Communication Subsystem -+(PRU-ICSS) is present on various TI SoCs such as AM335x, AM437x, Keystone -+66AK2G, etc. A PRUSS consists of dual 32-bit RISC cores (Programmable -+Real-Time Units, or PRUs) with program memory and data memory. -+ -+The programmable nature of the PRUs provide flexibility to implement -+custom peripheral interfaces, fast real-time responses, or specialized -+data handling. The common peripheral modules include the following, -+ -+ - Enhanced GPIO with async capture and serial support -+ - an Ethernet MII_RT module with two MII ports -+ - an MDIO port to control external Ethernet PHYs -+ - an Industrial Ethernet Peripheral (IEP) to manage/generate Industrial -+ Ethernet functions -+ - an Enhanced Capture Module (eCAP) -+ - a 16550-compatible UART to support PROFIBUS -+ - Interrupt controller with 64 input events and 10 Host interrupts. -+ -+A shared Data RAM, if present, can be accessed by both the PRU cores. The -+Interrupt Controller (INTC) and a CFG module are common to both the PRU -+cores. -+ -+Various sub-modules within a PRU-ICSS subsystem are represented as individual -+nodes. -+ -+PRUSS Node -+============= -+ -+This node represents the entire ICSS instance and the various modules are -+contained as children. The PRUSS driver is responsible for managing the -+common resources i.e. DRAM0, DRAM1, SHARED_RAM and CFG space. -+ -+Required Properties: -+-------------------- -+- compatible : should be one of, -+ "ti,am3356-pruss" for AM335x family of SoCs -+ "ti,am4376-pruss" for AM437x family of SoCs -+ "ti,am5728-pruss" for AM57xx family of SoCs -+ "ti,k2g-pruss" for 66AK2G family of SoCs -+- reg : base address and size for each of the Data RAMs as -+ mentioned in reg-names, and in the same order as the -+ reg-names -+- reg-names : should contain a string(s) from among the following names, -+ each representing a specific Data RAM region. Some PRU-ICSS -+ instances on certain SoCs might not have Shared DRAM. -+ "dram0" for Data RAM0, -+ "dram1" for Data RAM1, -+ "shrdram2" for Shared Data RAM, -+- #address-cells : should be 1 -+- #size-cells : should be 1 -+- ranges : no specific range translations required, child nodes have the -+ same address view as the parent, so should be mentioned without -+ any value for the property -+ -+Optional Properties: -+-------------------- -+- no-shared-ram : Should be present if the instance doesn't have Shared RAM. -+ e.g. AM4376 ICSS0 instance doesn't have Shared RAM. -+ -+The PRUSS node will have one or more of the folowing child nodes. -+ -+PRU CORES -+========= -+ICSS typically has 2 PRU cores. These should be represented as remoteproc devices. -+ -+INTC node -+========= -+ICSS has one INTC interrupt controller module. This should be represented as -+a standard interrupt-controller node. -+ -+CFG, IEP, MII_RT -+================ -+The individual sub-modules CFG, IEP and MII_RT are represented as a syscon -+node each with specific node names as below: -+ "cfg" for CFG sub-module, -+ "iep" for IEP sub-module, -+ "mii_rt" for MII-RT sub-module, -+ -+See Documentation/devicetree/bindings/mfd/syscon.txt for details. -+ -+MDIO -+==== -+Each PRUSS has an MDIO module that can be used to control external PHYs. The -+MDIO module used within the PRU-ICSS is an instance of the MDIO Controller -+used in TI Davinci SoCs. Please refer to the corresponding binding document, -+Documentation/devicetree/bindings/net/davinci-mdio.txt for details. -+ -+Application/User Nodes -+======================= -+A PRU application/user node typically uses one or more PRU device nodes to -+implement a PRU application/functionality. Each application/client node would -+need a reference to at least a PRU node, and optionally pass some configuration -+parameters. -+ -+Required Properties: -+-------------------- -+- prus : phandles to the PRU nodes used -+ -+Optional Properties: -+-------------------- -+- firmware-name : firmwares for the PRU cores, the default firmware -+ for the core from the PRU node will be used if not -+ provided. The firmware names should correspond to -+ the PRU cores listed in the 'prus' property -+- ti,pruss-gp-mux-sel : array of values for the GP_MUX_SEL under PRUSS_GPCFG -+ register for a PRU. This selects the internal muxing -+ scheme for the PRU instance. If not provided, the -+ default out-of-reset value (0) for the PRU core is -+ used. Values should correspond to the PRU cores listed -+ in the 'prus' property -+- ti,pru-interrupt-map : PRU interrupt mappings, containing an array of entries -+ with each entry consisting of 4 cell-values. First one -+ is an index towards the "prus" property to identify the -+ PRU core for the interrupt map, second is the PRU -+ System Event id, third is the PRU interrupt channel id -+ and fourth is the PRU host interrupt id. If provided, -+ this map will supercede any other configuration -+ provided through firmware -+ -+Example: -+======== -+1. /* AM33xx PRU-ICSS */ -+ -+ pruss: pruss@0 { -+ compatible = "ti,am3356-pruss"; -+ reg = <0x0 0x2000>, -+ <0x2000 0x2000>, -+ <0x10000 0x3000>; -+ reg-names = "dram0", "dram1", -+ "shrdram2"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ pruss_cfg: cfg@26000 { -+ compatible = "syscon"; -+ reg = <0x26000 0x2000>; -+ }; -+ -+ pruss_iep: iep@2e000 { -+ compatible = "syscon"; -+ reg = <0x2e000 0x31c>; -+ }; -+ -+ pruss_mii_rt: mii_rt@32000 { -+ compatible = "syscon"; -+ reg = <0x32000 0x58>; -+ }; -+ -+ pruss_intc: intc@20000 { -+ compatible = "ti,am3356-pruss-intc"; -+ reg = <0x20000 0x2000>; -+ reg-names = "intc"; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ interrupts = <20 21 22 23 24 25 26 27>; -+ interrupt-names = "host2", "host3", "host4", -+ "host5", "host6", "host7", -+ "host8", "host9"; -+ }; -+ -+ pru0: pru@34000 { -+ compatible = "ti,am3356-pru"; -+ reg = <0x34000 0x2000>, -+ <0x22000 0x400>, -+ <0x22400 0x100>; -+ reg-names = "iram", "control", "debug"; -+ gpcfg = <&pruss_cfg 0x8>; -+ firmware-name = "am335x-pru0-fw"; -+ interrupt-parent = <&pruss_intc>; -+ interrupts = <16>, <17>; -+ interrupt-names = "vring", "kick"; -+ }; -+ -+ pru1: pru@38000 { -+ compatible = "ti,am3356-pru"; -+ reg = <0x38000 0x2000>, -+ <0x24000 0x400>, -+ <0x24400 0x100>; -+ reg-names = "iram", "control", "debug"; -+ gpcfg = <&pruss_cfg 0xc>; -+ firmware-name = "am335x-pru1-fw"; -+ interrupt-parent = <&pruss_intc>; -+ interrupts = <18>, <19>; -+ interrupt-names = "vring", "kick"; -+ }; -+ -+ pruss_mdio: mdio@32400 { -+ compatible = "ti,davinci_mdio"; -+ reg = <0x32400 0x90>; -+ clocks = <&dpll_core_m4_ck>; -+ clock-names = "fck"; -+ bus_freq = <1000000>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "disabled"; -+ }; -+ }; -+ -+2: /* PRU application node example */ -+ app_node: app_node { -+ prus = <&pru0>, <&pru1>; -+ firmware-name = "pruss-app-fw", "pruss-app-fw-2"; -+ ti,pruss-gp-mux-sel = <2>, <1>; -+ /* setup interrupts for prus: -+ prus[0] => pru1_0: ev=16, chnl=2, host-irq=7, -+ prus[1] => pru1_1: ev=19, chnl=1, host-irq=3 */ -+ ti,pru-interrupt-map = <0 16 2 7 >, <1 19 1 3>; -+ } --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0002-soc-ti-pruss-Add-a-platform-driver-for-PRUSS-in-TI-S.patch b/patches/drivers/ti/rogerq_pruss/0002-soc-ti-pruss-Add-a-platform-driver-for-PRUSS-in-TI-S.patch deleted file mode 100644 index 26616b304..000000000 --- a/patches/drivers/ti/rogerq_pruss/0002-soc-ti-pruss-Add-a-platform-driver-for-PRUSS-in-TI-S.patch +++ /dev/null @@ -1,670 +0,0 @@ -From e6612f818379f08caf2c5c5879ecb8c9c8428441 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Tue, 7 Nov 2017 14:12:07 -0600 -Subject: [PATCH 02/25] soc: ti: pruss: Add a platform driver for PRUSS in TI - SoCs - -The Programmable Real-Time Unit - Industrial Communication -Subsystem (PRU-ICSS) is present on various TI SoCs such as -AM335x or AM437x or the Keystone 66AK2G. Each SoC can have -one or more PRUSS instances that may or may not be identical. -For example, AM335x SoCs have a single PRUSS, while AM437x has -two PRUSS instances PRUSS1 and PRUSS0, with the PRUSS0 being -a cut-down version of the PRUSS1. - -The PRUSS consists of dual 32-bit RISC cores called the -Programmable Real-Time Units (PRUs), with data and -instruction memories. It also contains various sub-modules -like MDIO, MII_RT, UART, etc. Each sub-module will be driven -by it's own driver. - -This PRUSS platform driver deals with the overall PRUSS and is -used for managing the subsystem level resources like various -memories and common CFG module. It is responsible for the -creation and deletion of the platform devices for the child PRU -devices and the various sub-modules. - -This design provides flexibility in representing the different -modules of PRUSS accordingly, and at the same time allowing the -PRUSS driver to add some instance specific configuration within -an SoC. - -pruss_get() and pruss_put() APIs allow client drivers to request -the 'struct pruss) device handle from the 'struct rproc' handle -for the respective PRU. This handle will be used by client drivers -to request various operations of the PRUSS platform driver through -below APIs. - -pruss_request_mem_region() & pruss_release_mem_region() allow -client drivers to acquire and release the common memory resources -present within a PRU-ICSS subsystem. This allows the client drivers -to directly manipulate the respective memories, -as per their design contract with the associated firmware. - -pruss_cfg_read() and pruss_cfg_update() allow other drivers to read -and update the registers in the CFG submodule within the PRUSS. -This interface provides a simple way for client drivers -without having them to include and parse these syscon nodes within -their respective device nodes. - -pruss_cfg_miirt_enable() and pruss_cfg_xfr_enable() allow the -client drivers to set MII_RT event enable/disable and -XFR (XIN XOUT) enable/disable respectively. - -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Keerthy <j-keerthy@ti.com> -Signed-off-by: Andrew F. Davis <afd@ti.com> -Signed-off-by: Tero Kristo <t-kristo@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/soc/ti/Kconfig | 12 ++ - drivers/soc/ti/Makefile | 1 + - drivers/soc/ti/pruss.c | 347 ++++++++++++++++++++++++++++++++++++++++ - include/linux/pruss.h | 211 ++++++++++++++++++++++++ - 4 files changed, 571 insertions(+) - create mode 100644 drivers/soc/ti/pruss.c - create mode 100644 include/linux/pruss.h - -diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig -index be4570baad96..789f2a8a5c25 100644 ---- a/drivers/soc/ti/Kconfig -+++ b/drivers/soc/ti/Kconfig -@@ -73,4 +73,16 @@ config TI_SCI_PM_DOMAINS - called ti_sci_pm_domains. Note this is needed early in boot before - rootfs may be available. - -+config TI_PRUSS -+ tristate "TI PRU-ICSS Subsystem Platform drivers" -+ depends on SOC_AM33XX || SOC_AM43XX || SOC_DRA7XX -+ select MFD_SYSCON -+ default n -+ help -+ TI PRU-ICSS Subsystem platform specific support. -+ -+ Say Y or M here to support the Programmable Realtime Unit (PRU) -+ processors on various TI SoCs. It's safe to say N here if you're -+ not interested in the PRU or if you are unsure. -+ - endif # SOC_TI -diff --git a/drivers/soc/ti/Makefile b/drivers/soc/ti/Makefile -index a22edc0b258a..55b4b0429026 100644 ---- a/drivers/soc/ti/Makefile -+++ b/drivers/soc/ti/Makefile -@@ -8,3 +8,4 @@ obj-$(CONFIG_KEYSTONE_NAVIGATOR_DMA) += knav_dma.o - obj-$(CONFIG_AMX3_PM) += pm33xx.o - obj-$(CONFIG_WKUP_M3_IPC) += wkup_m3_ipc.o - obj-$(CONFIG_TI_SCI_PM_DOMAINS) += ti_sci_pm_domains.o -+obj-$(CONFIG_TI_PRUSS) += pruss.o -diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c -new file mode 100644 -index 000000000000..c9493983ba1d ---- /dev/null -+++ b/drivers/soc/ti/pruss.c -@@ -0,0 +1,347 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* -+ * PRU-ICSS platform driver for various TI SoCs -+ * -+ * Copyright (C) 2014-2019 Texas Instruments Incorporated - http://www.ti.com/ -+ * Suman Anna <s-anna@ti.com> -+ * Andrew F. Davis <afd@ti.com> -+ */ -+ -+#include <linux/dma-mapping.h> -+#include <linux/module.h> -+#include <linux/io.h> -+#include <linux/mfd/syscon.h> -+#include <linux/of_address.h> -+#include <linux/of_device.h> -+#include <linux/pruss.h> -+#include <linux/regmap.h> -+#include <linux/remoteproc.h> -+ -+/** -+ * struct pruss - PRUSS parent structure -+ * @dev: pruss device pointer -+ * @cfg: regmap for config region -+ * @mem_regions: data for each of the PRUSS memory regions -+ * @mem_in_use: to indicate if memory resource is in use -+ * @no_shared_ram: indicate that shared RAM is absent -+ * @lock: mutex to serialize access to resources -+ */ -+struct pruss { -+ struct device *dev; -+ struct regmap *cfg; -+ struct pruss_mem_region mem_regions[PRUSS_MEM_MAX]; -+ struct pruss_mem_region *mem_in_use[PRUSS_MEM_MAX]; -+ bool no_shared_ram; -+ struct mutex lock; /* PRU resource lock */ -+}; -+ -+/** -+ * pruss_get() - get the pruss for a given PRU remoteproc -+ * @rproc: remoteproc handle of a PRU instance -+ * -+ * Finds the parent pruss device for a PRU given the @rproc handle of the -+ * PRU remote processor. This function increments the pruss device's refcount, -+ * so always use pruss_put() to decrement it back once pruss isn't needed -+ * anymore. -+ * -+ * Returns the pruss handle on success, and an ERR_PTR on failure using one -+ * of the following error values -+ * -EINVAL if invalid parameter -+ * -ENODEV if PRU device or PRUSS device is not found -+ */ -+struct pruss *pruss_get(struct rproc *rproc) -+{ -+ struct pruss *pruss; -+ struct device *dev; -+ struct platform_device *ppdev; -+ -+ if (IS_ERR(rproc)) -+ return ERR_PTR(-EINVAL); -+ -+ dev = &rproc->dev; -+ if (!dev->parent) -+ return ERR_PTR(-ENODEV); -+ -+ /* rudimentary check to make sure rproc handle is for a PRU */ -+ if (!strstr(dev_name(dev->parent), "pru")) -+ return ERR_PTR(-ENODEV); -+ -+ ppdev = to_platform_device(dev->parent->parent); -+ pruss = platform_get_drvdata(ppdev); -+ if (pruss) -+ get_device(pruss->dev); -+ -+ return pruss ? pruss : ERR_PTR(-ENODEV); -+} -+EXPORT_SYMBOL_GPL(pruss_get); -+ -+/** -+ * pruss_put() - decrement pruss device's usecount -+ * @pruss: pruss handle -+ * -+ * Complimentary function for pruss_get(). Needs to be called -+ * after the PRUSS is used, and only if the pruss_get() succeeds. -+ */ -+void pruss_put(struct pruss *pruss) -+{ -+ if (IS_ERR(pruss)) -+ return; -+ -+ put_device(pruss->dev); -+} -+EXPORT_SYMBOL_GPL(pruss_put); -+ -+/** -+ * pruss_request_mem_region() - request a memory resource -+ * @pruss: the pruss instance -+ * @mem_id: the memory resource id -+ * @region: pointer to memory region structure to be filled in -+ * -+ * This function allows a client driver to request a memory resource, -+ * and if successful, will let the client driver own the particular -+ * memory region until released using the pruss_release_mem_region() -+ * API. -+ * -+ * Returns the memory region if requested resource is available, an -+ * error otherwise -+ */ -+int pruss_request_mem_region(struct pruss *pruss, enum pruss_mem mem_id, -+ struct pruss_mem_region *region) -+{ -+ if (IS_ERR(pruss) || !region) -+ return -EINVAL; -+ -+ if (mem_id >= PRUSS_MEM_MAX) -+ return -EINVAL; -+ -+ mutex_lock(&pruss->lock); -+ -+ if (pruss->mem_in_use[mem_id]) { -+ mutex_unlock(&pruss->lock); -+ return -EBUSY; -+ } -+ -+ *region = pruss->mem_regions[mem_id]; -+ pruss->mem_in_use[mem_id] = region; -+ -+ mutex_unlock(&pruss->lock); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(pruss_request_mem_region); -+ -+/** -+ * pruss_release_mem_region() - release a memory resource -+ * @pruss: the pruss instance -+ * @region: the memory region to release -+ * -+ * This function is the complimentary function to -+ * pruss_request_mem_region(), and allows the client drivers to -+ * release back a memory resource. -+ * -+ * Returns 0 on success, an error code otherwise -+ */ -+int pruss_release_mem_region(struct pruss *pruss, -+ struct pruss_mem_region *region) -+{ -+ int id; -+ -+ if (IS_ERR(pruss) || !region) -+ return -EINVAL; -+ -+ mutex_lock(&pruss->lock); -+ -+ /* find out the memory region being released */ -+ for (id = 0; id < PRUSS_MEM_MAX; id++) { -+ if (pruss->mem_in_use[id] == region) -+ break; -+ } -+ -+ if (id == PRUSS_MEM_MAX) { -+ mutex_unlock(&pruss->lock); -+ return -EINVAL; -+ } -+ -+ pruss->mem_in_use[id] = NULL; -+ -+ mutex_unlock(&pruss->lock); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(pruss_release_mem_region); -+ -+/** -+ * pruss_cfg_read() - read a PRUSS CFG register -+ * @pruss: the pruss instance handle -+ * @reg: register offset within the CFG sub-module -+ * @val: pointer to return the value in -+ * -+ * Reads a given register within CFG module of PRUSS -+ * and returns it through the passed-in @val pointer -+ * -+ * Returns 0 on success, or an error code otherwise -+ */ -+int pruss_cfg_read(struct pruss *pruss, unsigned int reg, unsigned int *val) -+{ -+ if (IS_ERR(pruss)) -+ return -EINVAL; -+ -+ return regmap_read(pruss->cfg, reg, val); -+} -+EXPORT_SYMBOL_GPL(pruss_cfg_read); -+ -+/** -+ * pruss_cfg_update() - update a PRUSS CFG register -+ * @pruss: the pruss instance handle -+ * @reg: register offset within the CFG sub-module -+ * @mask: bit mask to use for programming the @val -+ * @val: value to write -+ * -+ * Updates a given register within CFG sub-module of PRUSS -+ * -+ * Returns 0 on success, or an error code otherwise -+ */ -+int pruss_cfg_update(struct pruss *pruss, unsigned int reg, -+ unsigned int mask, unsigned int val) -+{ -+ if (IS_ERR(pruss)) -+ return -EINVAL; -+ -+ return regmap_update_bits(pruss->cfg, reg, mask, val); -+} -+EXPORT_SYMBOL_GPL(pruss_cfg_update); -+ -+/** -+ * struct pruss_match_private_data - private data to handle multiple instances -+ * @device_name: device name of the PRUSS instance -+ * @priv_data: PRUSS driver private data for this PRUSS instance -+ */ -+struct pruss_match_private_data { -+ const char *device_name; -+ const struct pruss_private_data *priv_data; -+}; -+ -+static const -+struct pruss_private_data *pruss_get_private_data(struct platform_device *pdev) -+{ -+ const struct pruss_match_private_data *data; -+ -+ if (!of_device_is_compatible(pdev->dev.of_node, "ti,am4376-pruss")) -+ return NULL; -+ -+ data = of_device_get_match_data(&pdev->dev); -+ for (; data && data->device_name; data++) { -+ if (!strcmp(dev_name(&pdev->dev), data->device_name)) -+ return data->priv_data; -+ } -+ -+ return ERR_PTR(-ENODEV); -+} -+ -+static int pruss_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct device_node *node = dev->of_node; -+ struct device_node *np; -+ struct pruss *pruss; -+ struct resource *res; -+ int ret, i; -+ const struct pruss_private_data *data; -+ const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" }; -+ -+ if (!node) { -+ dev_err(dev, "Non-DT platform device not supported\n"); -+ return -ENODEV; -+ } -+ -+ data = pruss_get_private_data(pdev); -+ if (IS_ERR(data)) { -+ dev_err(dev, "missing private data\n"); -+ return -ENODEV; -+ } -+ -+ ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(32)); -+ if (ret) { -+ dev_err(dev, "dma_set_coherent_mask: %d\n", ret); -+ return ret; -+ } -+ -+ pruss = devm_kzalloc(dev, sizeof(*pruss), GFP_KERNEL); -+ if (!pruss) -+ return -ENOMEM; -+ -+ pruss->dev = dev; -+ mutex_init(&pruss->lock); -+ -+ pruss->no_shared_ram = of_property_read_bool(node, "no-shared-ram"); -+ -+ np = of_get_child_by_name(node, "cfg"); -+ if (!np) -+ return -ENODEV; -+ -+ pruss->cfg = syscon_node_to_regmap(np); -+ of_node_put(np); -+ if (IS_ERR(pruss->cfg)) -+ return -ENODEV; -+ -+ for (i = 0; i < ARRAY_SIZE(mem_names); i++) { -+ if (pruss->no_shared_ram && !strcmp(mem_names[i], "shrdram2")) -+ continue; -+ -+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, -+ mem_names[i]); -+ pruss->mem_regions[i].va = devm_ioremap_resource(dev, res); -+ if (!pruss->mem_regions[i].va) { -+ dev_err(dev, "failed to get resource: %s\n", -+ mem_names[i]); -+ return -ENODEV; -+ } -+ pruss->mem_regions[i].pa = res->start; -+ pruss->mem_regions[i].size = resource_size(res); -+ -+ dev_dbg(dev, "memory %8s: pa %pa size 0x%zx va %p\n", -+ mem_names[i], &pruss->mem_regions[i].pa, -+ pruss->mem_regions[i].size, pruss->mem_regions[i].va); -+ } -+ -+ platform_set_drvdata(pdev, pruss); -+ -+ dev_info(&pdev->dev, "creating PRU cores and other child platform devices\n"); -+ ret = of_platform_populate(node, NULL, NULL, &pdev->dev); -+ if (ret) -+ dev_err(dev, "of_platform_populate failed\n"); -+ -+ return ret; -+} -+ -+static int pruss_remove(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ -+ dev_info(dev, "remove PRU cores and other child platform devices\n"); -+ of_platform_depopulate(dev); -+ -+ return 0; -+} -+ -+static const struct of_device_id pruss_of_match[] = { -+ { .compatible = "ti,am3356-pruss", }, -+ { .compatible = "ti,am4376-pruss", }, -+ { .compatible = "ti,am5728-pruss", }, -+ { /* sentinel */ }, -+}; -+MODULE_DEVICE_TABLE(of, pruss_of_match); -+ -+static struct platform_driver pruss_driver = { -+ .driver = { -+ .name = "pruss", -+ .of_match_table = pruss_of_match, -+ }, -+ .probe = pruss_probe, -+ .remove = pruss_remove, -+}; -+module_platform_driver(pruss_driver); -+ -+MODULE_AUTHOR("Suman Anna <s-anna@ti.com>"); -+MODULE_DESCRIPTION("PRU-ICSS Subsystem Driver"); -+MODULE_LICENSE("GPL v2"); -diff --git a/include/linux/pruss.h b/include/linux/pruss.h -new file mode 100644 -index 000000000000..b236b30857dd ---- /dev/null -+++ b/include/linux/pruss.h -@@ -0,0 +1,211 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/** -+ * PRU-ICSS Subsystem user interfaces -+ * -+ * Copyright (C) 2015-2019 Texas Instruments Incorporated - http://www.ti.com -+ * Suman Anna <s-anna@ti.com> -+ * Tero Kristo <t-kristo@ti.com> -+ */ -+ -+#ifndef __LINUX_PRUSS_H -+#define __LINUX_PRUSS_H -+ -+/* -+ * PRU_ICSS_CFG registers -+ * SYSCFG, ISRP, ISP, IESP, IECP, SCRP applicable on AMxxxx devices only -+ */ -+#define PRUSS_CFG_REVID 0x00 -+#define PRUSS_CFG_SYSCFG 0x04 -+#define PRUSS_CFG_GPCFG(x) (0x08 + (x) * 4) -+#define PRUSS_CFG_CGR 0x10 -+#define PRUSS_CFG_ISRP 0x14 -+#define PRUSS_CFG_ISP 0x18 -+#define PRUSS_CFG_IESP 0x1C -+#define PRUSS_CFG_IECP 0x20 -+#define PRUSS_CFG_SCRP 0x24 -+#define PRUSS_CFG_PMAO 0x28 -+#define PRUSS_CFG_MII_RT 0x2C -+#define PRUSS_CFG_IEPCLK 0x30 -+#define PRUSS_CFG_SPP 0x34 -+#define PRUSS_CFG_PIN_MX 0x40 -+ -+/* PRUSS_GPCFG register bits */ -+#define PRUSS_GPCFG_PRU_GPO_SH_SEL BIT(25) -+ -+#define PRUSS_GPCFG_PRU_DIV1_SHIFT 20 -+#define PRUSS_GPCFG_PRU_DIV1_MASK GENMASK(24, 20) -+ -+#define PRUSS_GPCFG_PRU_DIV0_SHIFT 15 -+#define PRUSS_GPCFG_PRU_DIV0_MASK GENMASK(15, 19) -+ -+#define PRUSS_GPCFG_PRU_GPO_MODE BIT(14) -+#define PRUSS_GPCFG_PRU_GPO_MODE_DIRECT 0 -+#define PRUSS_GPCFG_PRU_GPO_MODE_SERIAL BIT(14) -+ -+#define PRUSS_GPCFG_PRU_GPI_SB BIT(13) -+ -+#define PRUSS_GPCFG_PRU_GPI_DIV1_SHIFT 8 -+#define PRUSS_GPCFG_PRU_GPI_DIV1_MASK GENMASK(12, 8) -+ -+#define PRUSS_GPCFG_PRU_GPI_DIV0_SHIFT 3 -+#define PRUSS_GPCFG_PRU_GPI_DIV0_MASK GENMASK(7, 3) -+ -+#define PRUSS_GPCFG_PRU_GPI_CLK_MODE_POSITIVE 0 -+#define PRUSS_GPCFG_PRU_GPI_CLK_MODE_NEGATIVE BIT(2) -+#define PRUSS_GPCFG_PRU_GPI_CLK_MODE BIT(2) -+ -+#define PRUSS_GPCFG_PRU_GPI_MODE_MASK GENMASK(1, 0) -+#define PRUSS_GPCFG_PRU_GPI_MODE_SHIFT 0 -+ -+#define PRUSS_GPCFG_PRU_MUX_SEL_SHIFT 26 -+#define PRUSS_GPCFG_PRU_MUX_SEL_MASK GENMASK(29, 26) -+ -+/* PRUSS_MII_RT register bits */ -+#define PRUSS_MII_RT_EVENT_EN BIT(0) -+ -+/* PRUSS_SPP register bits */ -+#define PRUSS_SPP_XFER_SHIFT_EN BIT(1) -+#define PRUSS_SPP_PRU1_PAD_HP_EN BIT(0) -+ -+/** -+ * enum pruss_gp_mux_sel - PRUSS GPI/O Mux modes for the -+ * PRUSS_GPCFG0/1 registers -+ * -+ * NOTE: The below defines are the most common values, but there -+ * are some exceptions like on 66AK2G, where the RESERVED and MII2 -+ * values are interchanged. Also, this bit-field does not exist on -+ * AM335x SoCs -+ */ -+enum pruss_gp_mux_sel { -+ PRUSS_GP_MUX_SEL_GP = 0, -+ PRUSS_GP_MUX_SEL_ENDAT, -+ PRUSS_GP_MUX_SEL_RESERVED, -+ PRUSS_GP_MUX_SEL_SD, -+ PRUSS_GP_MUX_SEL_MII2, -+ PRUSS_GP_MUX_SEL_MAX, -+}; -+ -+/** -+ * enum pruss_gpi_mode - PRUSS GPI configuration modes, used -+ * to program the PRUSS_GPCFG0/1 registers -+ */ -+enum pruss_gpi_mode { -+ PRUSS_GPI_MODE_DIRECT = 0, -+ PRUSS_GPI_MODE_PARALLEL, -+ PRUSS_GPI_MODE_28BIT_SHIFT, -+ PRUSS_GPI_MODE_MII, -+}; -+ -+/** -+ * enum pruss_mem - PRUSS memory range identifiers -+ */ -+enum pruss_mem { -+ PRUSS_MEM_DRAM0 = 0, -+ PRUSS_MEM_DRAM1, -+ PRUSS_MEM_SHRD_RAM2, -+ PRUSS_MEM_MAX, -+}; -+ -+/** -+ * struct pruss_mem_region - PRUSS memory region structure -+ * @va: kernel virtual address of the PRUSS memory region -+ * @pa: physical (bus) address of the PRUSS memory region -+ * @size: size of the PRUSS memory region -+ */ -+struct pruss_mem_region { -+ void __iomem *va; -+ phys_addr_t pa; -+ size_t size; -+}; -+ -+struct pruss; -+struct rproc; -+ -+#if IS_ENABLED(CONFIG_TI_PRUSS) -+ -+struct pruss *pruss_get(struct rproc *rproc); -+void pruss_put(struct pruss *pruss); -+ -+int pruss_request_mem_region(struct pruss *pruss, enum pruss_mem mem_id, -+ struct pruss_mem_region *region); -+int pruss_release_mem_region(struct pruss *pruss, -+ struct pruss_mem_region *region); -+ -+int pruss_cfg_read(struct pruss *pruss, unsigned int reg, unsigned int *val); -+int pruss_cfg_update(struct pruss *pruss, unsigned int reg, -+ unsigned int mask, unsigned int val); -+ -+/** -+ * pruss_cfg_miirt_enable() - Enable/disable MII RT Events -+ * @pruss: the pruss instance -+ * @enable: enable/disable -+ * -+ * Enable/disable the MII RT Events for the PRUSS. -+ */ -+static inline int pruss_cfg_miirt_enable(struct pruss *pruss, bool enable) -+{ -+ u32 set = enable ? PRUSS_MII_RT_EVENT_EN : 0; -+ -+ return pruss_cfg_update(pruss, PRUSS_CFG_MII_RT, -+ PRUSS_MII_RT_EVENT_EN, set); -+} -+ -+/** -+ * pruss_cfg_xfr_enable() - Enable/disable XIN XOUT shift functionality -+ * @pruss: the pruss instance -+ * @enable: enable/disable -+ */ -+static inline int pruss_cfg_xfr_enable(struct pruss *pruss, bool enable) -+{ -+ u32 set = enable ? PRUSS_SPP_XFER_SHIFT_EN : 0; -+ -+ return pruss_cfg_update(pruss, PRUSS_CFG_SPP, -+ PRUSS_SPP_XFER_SHIFT_EN, set); -+} -+#else -+ -+static inline struct pruss *pruss_get(struct rproc *rproc) -+{ -+ return ERR_PTR(-ENOTSUPP); -+} -+ -+static inline void pruss_put(struct pruss *pruss) { } -+ -+static inline int pruss_request_mem_region(struct pruss *pruss, -+ enum pruss_mem mem_id, -+ struct pruss_mem_region *region) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int pruss_release_mem_region(struct pruss *pruss, -+ struct pruss_mem_region *region) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int pruss_cfg_read(struct pruss *pruss, unsigned int reg, -+ unsigned int *val) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int pruss_cfg_update(struct pruss *pruss, unsigned int reg, -+ unsigned int mask, unsigned int val) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int pruss_cfg_miirt_enable(struct pruss *pruss, bool enable) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int pruss_cfg_xfr_enable(struct pruss *pruss, bool enable) -+{ -+ return -ENOTSUPP; -+} -+ -+#endif /* CONFIG_TI_PRUSS */ -+ -+#endif /* __LINUX_PRUSS_H */ --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0003-dt-binding-irqchip-Add-pruss-intc-irq-driver-for-PRU.patch b/patches/drivers/ti/rogerq_pruss/0003-dt-binding-irqchip-Add-pruss-intc-irq-driver-for-PRU.patch deleted file mode 100644 index 61d3d2c87..000000000 --- a/patches/drivers/ti/rogerq_pruss/0003-dt-binding-irqchip-Add-pruss-intc-irq-driver-for-PRU.patch +++ /dev/null @@ -1,95 +0,0 @@ -From ccde3ba5994d1cd3e18b54db21fdd5f754a75591 Mon Sep 17 00:00:00 2001 -From: "Andrew F. Davis" <afd@ti.com> -Date: Mon, 4 Feb 2019 10:43:25 +0200 -Subject: [PATCH 03/25] dt-binding: irqchip: Add pruss-intc-irq driver for - PRUSS interrupts - -The Programmable Real-Time Unit Subsystem (PRUSS) contains an -interrupt controller (INTC) that can handle various system input -events and post interrupts back to the device-level initiators. -The INTC can support upto 64 input events with individual control -configuration and hardware prioritization. These events are mapped -onto 10 interrupt signals through two levels of many-to-one mapping -support. Different interrupt signals are routed to the individual -PRU cores or to the host CPU. - -The PRUSS INTC platform driver manages this PRUSS interrupt -controller and implements an irqchip driver to provide a Linux -standard way for the PRU client users to enable/disable/ack/ -re-trigger a PRUSS system event. The system events to interrupt -channels and host interrupts relies on the mapping configuration -provided through a firmware resource table for now. This will be -revisited and enhanced in the future for a better interface. The -mappings will currently be programmed during the boot/shutdown -of the PRU. - -Cc: Thomas Gleixner <tglx@linutronix.de> -Cc: Jason Cooper <jason@lakedaemon.net> -Cc: Marc Zyngier <marc.zyngier@arm.com> -Cc: Rob Herring <robh+dt@kernel.org> -Signed-off-by: Andrew F. Davis <afd@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - .../ti,pruss-intc-irq.txt | 50 +++++++++++++++++++ - 1 file changed, 50 insertions(+) - create mode 100644 Documentation/devicetree/bindings/interrupt-controller/ti,pruss-intc-irq.txt - -diff --git a/Documentation/devicetree/bindings/interrupt-controller/ti,pruss-intc-irq.txt b/Documentation/devicetree/bindings/interrupt-controller/ti,pruss-intc-irq.txt -new file mode 100644 -index 000000000000..d765f39dad71 ---- /dev/null -+++ b/Documentation/devicetree/bindings/interrupt-controller/ti,pruss-intc-irq.txt -@@ -0,0 +1,50 @@ -+PRU ICSS INTC on TI SoCs -+======================== -+ -+Each PRUSS has a single interrupt controller instance that is common to both -+the PRU cores. Each interrupt controller can detect 64 input events which are -+then mapped to 10 possible output interrupts through two levels of mapping. The -+input events can be triggered by either the PRUs and/or various other PRUSS -+internal and external peripherals. The first 2 output interrupts are fed -+exclusively to the internal PRU cores, with the remaining 8 connected to -+external interrupt controllers including the MPU. -+ -+Required Properties: -+-------------------- -+- compatible : should be one of, -+ "ti,am3356-pruss-intc" for AM335x family of SoCs -+ "ti,am4376-pruss-intc" for AM437x family of SoCs -+ "ti,am5728-pruss-intc" for AM57xx family of SoCs -+ "ti,k2g-pruss-intc" for 66AK2G family of SoCs -+- reg : base address and size for the PRUSS INTC sub-module -+- reg-names : should contain the string "intc" -+- interrupts : all the interrupts generated towards the main host -+ processor in the SoC. The format depends on the -+ interrupt specifier for the particular SoC's MPU -+ parent interrupt controller -+- interrupt-names: should use one of the following names for each interrupt, -+ the name should match the corresponding host interrupt -+ number, -+ "host2", "host3", "host4", "host5", "host6", -+ "host7", "host8" or "host9" -+ NOTE: AM437x and 66AK2G SoCs do not have "host7" interrupt -+ connected to MPU -+- interrupt-controller : mark this node as an interrupt controller -+- #interrupt-cells : should be 1. Client users shall use the PRU System -+ event number (the interrupt source that the client -+ is interested in) as the value of the interrupts -+ property in their node -+ -+Example: -+-------- -+ pruss_intc: intc@20000 { -+ compatible = "ti,am3356-pruss-intc"; -+ reg = <0x20000 0x2000>; -+ reg-names = "intc"; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ interrupts = <20 21 22 23 24 25 26 27>; -+ interrupt-names = "host2", "host3", "host4", -+ "host5", "host6", "host7", -+ "host8", "host9"; -+ }; --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0004-irqchip-pruss-Add-a-PRUSS-irqchip-driver-for-PRUSS-i.patch b/patches/drivers/ti/rogerq_pruss/0004-irqchip-pruss-Add-a-PRUSS-irqchip-driver-for-PRUSS-i.patch deleted file mode 100644 index ab1bb2875..000000000 --- a/patches/drivers/ti/rogerq_pruss/0004-irqchip-pruss-Add-a-PRUSS-irqchip-driver-for-PRUSS-i.patch +++ /dev/null @@ -1,801 +0,0 @@ -From abd3f0a9e7a28315d0d9f35c3190332809f25a8c Mon Sep 17 00:00:00 2001 -From: "Andrew F. Davis" <afd@ti.com> -Date: Wed, 8 Nov 2017 17:23:18 -0600 -Subject: [PATCH 04/25] irqchip: pruss: Add a PRUSS irqchip driver for PRUSS - interrupts - -The Programmable Real-Time Unit Subsystem (PRUSS) contains an -interrupt controller (INTC) that can handle various system input -events and post interrupts back to the device-level initiators. -The INTC can support upto 64 input events with individual control -configuration and hardware prioritization. These events are mapped -onto 10 interrupt signals through two levels of many-to-one mapping -support. Different interrupt signals are routed to the individual -PRU cores or to the host CPU. - -The PRUSS INTC platform driver manages this PRUSS interrupt -controller and implements an irqchip driver to provide a Linux -standard way for the PRU client users to enable/disable/ack/ -re-trigger a PRUSS system event. The system events to interrupt -channels and host interrupts relies on the mapping configuration -provided through a firmware resource table for now. This will be -revisited and enhanced in the future for a better interface. The -mappings will currently be programmed during the boot/shutdown -of the PRU. - -The PRUSS INTC module is reference counted during the interrupt -setup phase through the irqchip's irq_request_resources() and -irq_release_resources() ops. This restricts the module from being -removed as long as there are active interrupt users. - -The PRUSS INTC can generate an interrupt to various processor -subsystems on the SoC through a set of 64 possible PRU system -events. These system events can be used by PRU client drivers -or applications for event notifications/signalling between PRUs -and MPU or other processors. An API, pruss_intc_trigger() is -provided to MPU-side PRU client drivers/applications to be able -to trigger an event/interrupt using IRQ numbers provided by the -PRUSS-INTC irqdomain chip. - -Cc: Thomas Gleixner <tglx@linutronix.de> -Cc: Jason Cooper <jason@lakedaemon.net> -Cc: Marc Zyngier <marc.zyngier@arm.com> -Signed-off-by: Andrew F. Davis <afd@ti.com> -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/irqchip/Makefile | 1 + - drivers/irqchip/irq-pruss-intc.c | 630 +++++++++++++++++++++++++ - include/linux/irqchip/irq-pruss-intc.h | 93 ++++ - 3 files changed, 724 insertions(+) - create mode 100644 drivers/irqchip/irq-pruss-intc.c - create mode 100644 include/linux/irqchip/irq-pruss-intc.h - -diff --git a/drivers/irqchip/Makefile b/drivers/irqchip/Makefile -index 7acd0e36d0b4..8995d388a105 100644 ---- a/drivers/irqchip/Makefile -+++ b/drivers/irqchip/Makefile -@@ -94,4 +94,5 @@ obj-$(CONFIG_CSKY_APB_INTC) += irq-csky-apb-intc.o - obj-$(CONFIG_SIFIVE_PLIC) += irq-sifive-plic.o - obj-$(CONFIG_IMX_IRQSTEER) += irq-imx-irqsteer.o - obj-$(CONFIG_MADERA_IRQ) += irq-madera.o -+obj-$(CONFIG_TI_PRUSS) += irq-pruss-intc.o - obj-$(CONFIG_LS1X_IRQ) += irq-ls1x.o -diff --git a/drivers/irqchip/irq-pruss-intc.c b/drivers/irqchip/irq-pruss-intc.c -new file mode 100644 -index 000000000000..0288535e93c8 ---- /dev/null -+++ b/drivers/irqchip/irq-pruss-intc.c -@@ -0,0 +1,630 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * PRU-ICSS INTC IRQChip driver for various TI SoCs -+ * -+ * Copyright (C) 2016-2019 Texas Instruments Incorporated - http://www.ti.com/ -+ * Andrew F. Davis <afd@ti.com> -+ * Suman Anna <s-anna@ti.com> -+ */ -+ -+#include <linux/irq.h> -+#include <linux/irqchip/chained_irq.h> -+#include <linux/irqchip/irq-pruss-intc.h> -+#include <linux/irqdomain.h> -+#include <linux/module.h> -+#include <linux/of_device.h> -+#include <linux/of_irq.h> -+#include <linux/of_platform.h> -+#include <linux/platform_device.h> -+ -+/* -+ * Number of host interrupts reaching the main MPU sub-system. Note that this -+ * is not the same as the total number of host interrupts supported by the PRUSS -+ * INTC instance -+ */ -+#define MAX_HOST_NUM_IRQS 8 -+ -+/* minimum starting host interrupt number for MPU */ -+#define MIN_PRU_HOST_INT 2 -+ -+/* maximum number of host interrupts */ -+#define MAX_PRU_HOST_INT 10 -+ -+/* PRU_ICSS_INTC registers */ -+#define PRU_INTC_REVID 0x0000 -+#define PRU_INTC_CR 0x0004 -+#define PRU_INTC_GER 0x0010 -+#define PRU_INTC_GNLR 0x001C -+#define PRU_INTC_SISR 0x0020 -+#define PRU_INTC_SICR 0x0024 -+#define PRU_INTC_EISR 0x0028 -+#define PRU_INTC_EICR 0x002C -+#define PRU_INTC_HIEISR 0x0034 -+#define PRU_INTC_HIDISR 0x0038 -+#define PRU_INTC_GPIR 0x0080 -+#define PRU_INTC_SRSR0 0x0200 -+#define PRU_INTC_SRSR1 0x0204 -+#define PRU_INTC_SECR0 0x0280 -+#define PRU_INTC_SECR1 0x0284 -+#define PRU_INTC_ESR0 0x0300 -+#define PRU_INTC_ESR1 0x0304 -+#define PRU_INTC_ECR0 0x0380 -+#define PRU_INTC_ECR1 0x0384 -+#define PRU_INTC_CMR(x) (0x0400 + (x) * 4) -+#define PRU_INTC_HMR(x) (0x0800 + (x) * 4) -+#define PRU_INTC_HIPIR(x) (0x0900 + (x) * 4) -+#define PRU_INTC_SIPR0 0x0D00 -+#define PRU_INTC_SIPR1 0x0D04 -+#define PRU_INTC_SITR0 0x0D80 -+#define PRU_INTC_SITR1 0x0D84 -+#define PRU_INTC_HINLR(x) (0x1100 + (x) * 4) -+#define PRU_INTC_HIER 0x1500 -+ -+/* HIPIR register bit-fields */ -+#define INTC_HIPIR_NONE_HINT 0x80000000 -+ -+static const char * const irq_names[] = { -+ "host2", "host3", "host4", "host5", "host6", "host7", "host8", "host9", -+}; -+ -+/** -+ * struct pruss_intc_match_data - match data to handle SoC variations -+ * @no_host7_intr: flag denoting the absence of host7 interrupt into MPU -+ */ -+struct pruss_intc_match_data { -+ bool no_host7_intr; -+}; -+ -+/** -+ * struct pruss_intc - PRUSS interrupt controller structure -+ * @irqs: kernel irq numbers corresponding to PRUSS host interrupts -+ * @mem: base virtual address of INTC register space -+ * @irqchip: irq chip for this interrupt controller -+ * @domain: irq domain for this interrupt controller -+ * @config_map: stored INTC configuration mapping data -+ * @lock: mutex to serialize access to INTCa -+ * @host_mask: indicate which HOST IRQs are enabled -+ */ -+struct pruss_intc { -+ unsigned int irqs[MAX_HOST_NUM_IRQS]; -+ void __iomem *base; -+ struct irq_chip *irqchip; -+ struct irq_domain *domain; -+ struct pruss_intc_config config_map; -+ struct mutex lock; /* PRUSS INTC lock */ -+ u32 host_mask; -+}; -+ -+static inline u32 pruss_intc_read_reg(struct pruss_intc *intc, unsigned int reg) -+{ -+ return readl_relaxed(intc->base + reg); -+} -+ -+static inline void pruss_intc_write_reg(struct pruss_intc *intc, -+ unsigned int reg, u32 val) -+{ -+ writel_relaxed(val, intc->base + reg); -+} -+ -+static int pruss_intc_check_write(struct pruss_intc *intc, unsigned int reg, -+ unsigned int sysevent) -+{ -+ if (!intc) -+ return -EINVAL; -+ -+ if (sysevent >= MAX_PRU_SYS_EVENTS) -+ return -EINVAL; -+ -+ pruss_intc_write_reg(intc, reg, sysevent); -+ -+ return 0; -+} -+ -+static struct pruss_intc *dev_to_intc(struct device *user_dev) -+{ -+ struct device_node *np; -+ struct platform_device *pdev; -+ struct pruss_intc *intc; -+ -+ np = of_irq_find_parent(user_dev->of_node); -+ if (!np) -+ return ERR_PTR(-ENODEV); -+ -+ pdev = of_find_device_by_node(np); -+ if (!pdev) -+ return ERR_PTR(-EPROBE_DEFER); /* Not probed yet? */ -+ -+ intc = platform_get_drvdata(pdev); -+ if (!intc) -+ return ERR_PTR(-EINVAL); -+ -+ return intc; -+} -+ -+/** -+ * pruss_intc_configure() - configure the PRUSS INTC -+ * @dev: device -+ * @intc_config: PRU core-specific INTC configuration -+ * -+ * Configures the PRUSS INTC with the provided configuration from -+ * a PRU core. Any existing event to channel mappings or channel to -+ * host interrupt mappings are checked to make sure there are no -+ * conflicting configuration between both the PRU cores. The function -+ * is intended to be used only by the PRU remoteproc driver. -+ * -+ * Returns 0 on success, or a suitable error code otherwise -+ */ -+int pruss_intc_configure(struct device *dev, -+ struct pruss_intc_config *intc_config) -+{ -+ struct pruss_intc *intc; -+ int i, idx, ret; -+ s8 ch, host; -+ u64 sysevt_mask = 0; -+ u32 ch_mask = 0; -+ u32 host_mask = 0; -+ u32 val; -+ -+ intc = dev_to_intc(dev); -+ if (IS_ERR(intc)) -+ return PTR_ERR(intc); -+ -+ mutex_lock(&intc->lock); -+ -+ /* -+ * configure channel map registers - each register holds map info -+ * for 4 events, with each event occupying the lower nibble in -+ * a register byte address in little-endian fashion -+ */ -+ for (i = 0; i < ARRAY_SIZE(intc_config->sysev_to_ch); i++) { -+ ch = intc_config->sysev_to_ch[i]; -+ if (ch < 0) -+ continue; -+ -+ /* check if sysevent already assigned */ -+ if (intc->config_map.sysev_to_ch[i] != -1) { -+ dev_err(dev, "event %d (req. channel %d) already assigned to channel %d\n", -+ i, ch, intc->config_map.sysev_to_ch[i]); -+ ret = -EEXIST; -+ goto unlock; -+ } -+ -+ intc->config_map.sysev_to_ch[i] = ch; -+ -+ idx = i / 4; -+ val = pruss_intc_read_reg(intc, PRU_INTC_CMR(idx)); -+ val |= ch << ((i & 3) * 8); -+ pruss_intc_write_reg(intc, PRU_INTC_CMR(idx), val); -+ sysevt_mask |= BIT_ULL(i); -+ ch_mask |= BIT(ch); -+ -+ dev_dbg(dev, "SYSEV%d -> CH%d (CMR%d 0x%08x)\n", i, ch, idx, -+ pruss_intc_read_reg(intc, PRU_INTC_CMR(idx))); -+ } -+ -+ /* -+ * set host map registers - each register holds map info for -+ * 4 channels, with each channel occupying the lower nibble in -+ * a register byte address in little-endian fashion -+ */ -+ for (i = 0; i < ARRAY_SIZE(intc_config->ch_to_host); i++) { -+ host = intc_config->ch_to_host[i]; -+ if (host < 0) -+ continue; -+ -+ /* check if channel already assigned */ -+ if (intc->config_map.ch_to_host[i] != -1) { -+ dev_err(dev, "channel %d (req. intr_no %d) already assigned to intr_no %d\n", -+ i, host, intc->config_map.ch_to_host[i]); -+ ret = -EEXIST; -+ goto unlock; -+ } -+ -+ /* check if host intr is already in use by other PRU */ -+ if (intc->host_mask & (1U << host)) { -+ dev_err(dev, "%s: host intr %d already in use\n", -+ __func__, host); -+ ret = -EEXIST; -+ goto unlock; -+ } -+ -+ intc->config_map.ch_to_host[i] = host; -+ -+ idx = i / 4; -+ -+ val = pruss_intc_read_reg(intc, PRU_INTC_HMR(idx)); -+ val |= host << ((i & 3) * 8); -+ pruss_intc_write_reg(intc, PRU_INTC_HMR(idx), val); -+ -+ ch_mask |= BIT(i); -+ host_mask |= BIT(host); -+ -+ dev_dbg(dev, "CH%d -> HOST%d (HMR%d 0x%08x)\n", i, host, idx, -+ pruss_intc_read_reg(intc, PRU_INTC_HMR(idx))); -+ } -+ -+ dev_info(dev, "intc: config: system_events = 0x%016llx intr_channels = 0x%08x host_intr = 0x%08x\n", -+ sysevt_mask, ch_mask, host_mask); -+ -+ /* enable system events, writing 0 has no-effect */ -+ pruss_intc_write_reg(intc, PRU_INTC_ESR0, lower_32_bits(sysevt_mask)); -+ pruss_intc_write_reg(intc, PRU_INTC_SECR0, lower_32_bits(sysevt_mask)); -+ pruss_intc_write_reg(intc, PRU_INTC_ESR1, upper_32_bits(sysevt_mask)); -+ pruss_intc_write_reg(intc, PRU_INTC_SECR1, upper_32_bits(sysevt_mask)); -+ -+ /* enable host interrupts */ -+ for (i = 0; i < MAX_PRU_HOST_INT; i++) { -+ if (host_mask & BIT(i)) -+ pruss_intc_write_reg(intc, PRU_INTC_HIEISR, i); -+ } -+ -+ /* global interrupt enable */ -+ pruss_intc_write_reg(intc, PRU_INTC_GER, 1); -+ -+ intc->host_mask |= host_mask; -+ -+ mutex_unlock(&intc->lock); -+ return 0; -+ -+unlock: -+ mutex_unlock(&intc->lock); -+ return ret; -+} -+EXPORT_SYMBOL_GPL(pruss_intc_configure); -+ -+/** -+ * pruss_intc_unconfigure() - unconfigure the PRUSS INTC -+ * @dev: device -+ * @intc_config: PRU core specific INTC configuration -+ * -+ * Undo whatever was done in pruss_intc_configure() for a PRU core. -+ * It should be sufficient to just mark the resources free in the -+ * global map and disable the host interrupts and sysevents. -+ */ -+int pruss_intc_unconfigure(struct device *dev, -+ struct pruss_intc_config *intc_config) -+{ -+ struct pruss_intc *intc; -+ int i; -+ s8 ch, host; -+ u64 sysevt_mask = 0; -+ u32 host_mask = 0; -+ -+ intc = dev_to_intc(dev); -+ if (IS_ERR(intc)) -+ return PTR_ERR(intc); -+ -+ mutex_lock(&intc->lock); -+ -+ for (i = 0; i < ARRAY_SIZE(intc_config->sysev_to_ch); i++) { -+ ch = intc_config->sysev_to_ch[i]; -+ if (ch < 0) -+ continue; -+ -+ /* mark sysevent free in global map */ -+ intc->config_map.sysev_to_ch[i] = -1; -+ sysevt_mask |= BIT_ULL(i); -+ } -+ -+ for (i = 0; i < ARRAY_SIZE(intc_config->ch_to_host); i++) { -+ host = intc_config->ch_to_host[i]; -+ if (host < 0) -+ continue; -+ -+ /* mark channel free in global map */ -+ intc->config_map.ch_to_host[i] = -1; -+ host_mask |= BIT(host); -+ } -+ -+ dev_info(dev, "intc: unconfig: system_events = 0x%016llx host_intr = 0x%08x\n", -+ sysevt_mask, host_mask); -+ -+ /* disable system events, writing 0 has no-effect */ -+ pruss_intc_write_reg(intc, PRU_INTC_ECR0, lower_32_bits(sysevt_mask)); -+ pruss_intc_write_reg(intc, PRU_INTC_ECR1, upper_32_bits(sysevt_mask)); -+ /* clear any pending status */ -+ pruss_intc_write_reg(intc, PRU_INTC_SECR0, lower_32_bits(sysevt_mask)); -+ pruss_intc_write_reg(intc, PRU_INTC_SECR1, upper_32_bits(sysevt_mask)); -+ -+ /* disable host interrupts */ -+ for (i = 0; i < MAX_PRU_HOST_INT; i++) { -+ if (host_mask & BIT(i)) -+ pruss_intc_write_reg(intc, PRU_INTC_HIDISR, i); -+ } -+ -+ intc->host_mask &= ~host_mask; -+ mutex_unlock(&intc->lock); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(pruss_intc_unconfigure); -+ -+static void pruss_intc_init(struct pruss_intc *intc) -+{ -+ int i; -+ -+ /* configure polarity to active high for all system interrupts */ -+ pruss_intc_write_reg(intc, PRU_INTC_SIPR0, 0xffffffff); -+ pruss_intc_write_reg(intc, PRU_INTC_SIPR1, 0xffffffff); -+ -+ /* configure type to pulse interrupt for all system interrupts */ -+ pruss_intc_write_reg(intc, PRU_INTC_SITR0, 0); -+ pruss_intc_write_reg(intc, PRU_INTC_SITR1, 0); -+ -+ /* clear all 16 interrupt channel map registers */ -+ for (i = 0; i < 16; i++) -+ pruss_intc_write_reg(intc, PRU_INTC_CMR(i), 0); -+ -+ /* clear all 3 host interrupt map registers */ -+ for (i = 0; i < 3; i++) -+ pruss_intc_write_reg(intc, PRU_INTC_HMR(i), 0); -+} -+ -+static void pruss_intc_irq_ack(struct irq_data *data) -+{ -+ struct pruss_intc *intc = irq_data_get_irq_chip_data(data); -+ unsigned int hwirq = data->hwirq; -+ -+ pruss_intc_check_write(intc, PRU_INTC_SICR, hwirq); -+} -+ -+static void pruss_intc_irq_mask(struct irq_data *data) -+{ -+ struct pruss_intc *intc = irq_data_get_irq_chip_data(data); -+ unsigned int hwirq = data->hwirq; -+ -+ pruss_intc_check_write(intc, PRU_INTC_EICR, hwirq); -+} -+ -+static void pruss_intc_irq_unmask(struct irq_data *data) -+{ -+ struct pruss_intc *intc = irq_data_get_irq_chip_data(data); -+ unsigned int hwirq = data->hwirq; -+ -+ pruss_intc_check_write(intc, PRU_INTC_EISR, hwirq); -+} -+ -+static int pruss_intc_irq_retrigger(struct irq_data *data) -+{ -+ struct pruss_intc *intc = irq_data_get_irq_chip_data(data); -+ unsigned int hwirq = data->hwirq; -+ -+ return pruss_intc_check_write(intc, PRU_INTC_SISR, hwirq); -+} -+ -+static int pruss_intc_irq_reqres(struct irq_data *data) -+{ -+ if (!try_module_get(THIS_MODULE)) -+ return -ENODEV; -+ -+ return 0; -+} -+ -+static void pruss_intc_irq_relres(struct irq_data *data) -+{ -+ module_put(THIS_MODULE); -+} -+ -+/** -+ * pruss_intc_trigger() - trigger a PRU system event -+ * @irq: linux IRQ number associated with a PRU system event -+ * -+ * Trigger an interrupt by signalling a specific PRU system event. -+ * This can be used by PRUSS client users to raise/send an event to -+ * a PRU or any other core that is listening on the host interrupt -+ * mapped to that specific PRU system event. The @irq variable is the -+ * Linux IRQ number associated with a specific PRU system event that -+ * a client user/application uses. The interrupt mappings for this is -+ * provided by the PRUSS INTC irqchip instance. -+ * -+ * Returns 0 on success, or an error value upon failure. -+ */ -+int pruss_intc_trigger(unsigned int irq) -+{ -+ struct irq_desc *desc; -+ -+ if (irq <= 0) -+ return -EINVAL; -+ -+ desc = irq_to_desc(irq); -+ if (!desc) -+ return -EINVAL; -+ -+ pruss_intc_irq_retrigger(&desc->irq_data); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(pruss_intc_trigger); -+ -+static int pruss_intc_irq_domain_map(struct irq_domain *d, unsigned int virq, -+ irq_hw_number_t hw) -+{ -+ struct pruss_intc *intc = d->host_data; -+ -+ irq_set_chip_data(virq, intc); -+ irq_set_chip_and_handler(virq, intc->irqchip, handle_level_irq); -+ -+ return 0; -+} -+ -+static void pruss_intc_irq_domain_unmap(struct irq_domain *d, unsigned int virq) -+{ -+ irq_set_chip_and_handler(virq, NULL, NULL); -+ irq_set_chip_data(virq, NULL); -+} -+ -+static const struct irq_domain_ops pruss_intc_irq_domain_ops = { -+ .xlate = irq_domain_xlate_onecell, -+ .map = pruss_intc_irq_domain_map, -+ .unmap = pruss_intc_irq_domain_unmap, -+}; -+ -+static void pruss_intc_irq_handler(struct irq_desc *desc) -+{ -+ unsigned int irq = irq_desc_get_irq(desc); -+ struct irq_chip *chip = irq_desc_get_chip(desc); -+ struct pruss_intc *intc = irq_get_handler_data(irq); -+ u32 hipir; -+ unsigned int virq; -+ int i, hwirq; -+ -+ chained_irq_enter(chip, desc); -+ -+ /* find our host irq number */ -+ for (i = 0; i < MAX_HOST_NUM_IRQS; i++) -+ if (intc->irqs[i] == irq) -+ break; -+ if (i == MAX_HOST_NUM_IRQS) -+ goto err; -+ -+ i += MIN_PRU_HOST_INT; -+ -+ /* get highest priority pending PRUSS system event */ -+ hipir = pruss_intc_read_reg(intc, PRU_INTC_HIPIR(i)); -+ while (!(hipir & BIT(31))) { -+ hwirq = hipir & GENMASK(9, 0); -+ virq = irq_linear_revmap(intc->domain, hwirq); -+ -+ /* -+ * XXX: manually ACK any system events that do not have a -+ * handler mapped yet -+ */ -+ if (unlikely(!virq)) -+ pruss_intc_check_write(intc, PRU_INTC_SICR, hwirq); -+ else -+ generic_handle_irq(virq); -+ -+ /* get next system event */ -+ hipir = pruss_intc_read_reg(intc, PRU_INTC_HIPIR(i)); -+ } -+err: -+ chained_irq_exit(chip, desc); -+} -+ -+static int pruss_intc_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct pruss_intc *intc; -+ struct resource *res; -+ struct irq_chip *irqchip; -+ int i, irq; -+ const struct pruss_intc_match_data *data; -+ bool skip_host7; -+ -+ data = of_device_get_match_data(dev); -+ skip_host7 = data ? data->no_host7_intr : false; -+ -+ intc = devm_kzalloc(dev, sizeof(*intc), GFP_KERNEL); -+ if (!intc) -+ return -ENOMEM; -+ platform_set_drvdata(pdev, intc); -+ -+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "intc"); -+ intc->base = devm_ioremap_resource(dev, res); -+ if (IS_ERR(intc->base)) { -+ dev_err(dev, "failed to parse and map intc memory resource\n"); -+ return PTR_ERR(intc->base); -+ } -+ -+ mutex_init(&intc->lock); -+ -+ for (i = 0; i < ARRAY_SIZE(intc->config_map.sysev_to_ch); i++) -+ intc->config_map.sysev_to_ch[i] = -1; -+ -+ for (i = 0; i < ARRAY_SIZE(intc->config_map.ch_to_host); i++) -+ intc->config_map.ch_to_host[i] = -1; -+ -+ pruss_intc_init(intc); -+ -+ irqchip = devm_kzalloc(dev, sizeof(*irqchip), GFP_KERNEL); -+ if (!irqchip) -+ return -ENOMEM; -+ -+ irqchip->irq_ack = pruss_intc_irq_ack; -+ irqchip->irq_mask = pruss_intc_irq_mask; -+ irqchip->irq_unmask = pruss_intc_irq_unmask; -+ irqchip->irq_retrigger = pruss_intc_irq_retrigger; -+ irqchip->irq_request_resources = pruss_intc_irq_reqres; -+ irqchip->irq_release_resources = pruss_intc_irq_relres; -+ irqchip->name = dev_name(dev); -+ intc->irqchip = irqchip; -+ -+ /* always 64 events */ -+ intc->domain = irq_domain_add_linear(dev->of_node, MAX_PRU_SYS_EVENTS, -+ &pruss_intc_irq_domain_ops, intc); -+ if (!intc->domain) -+ return -ENOMEM; -+ -+ for (i = 0; i < MAX_HOST_NUM_IRQS; i++) { -+ irq = platform_get_irq_byname(pdev, irq_names[i]); -+ if (irq < 0) { -+ if (!strcmp(irq_names[i], "host7") && !!skip_host7) -+ continue; -+ -+ dev_err(dev->parent, "platform_get_irq_byname failed for %s : %d\n", -+ irq_names[i], irq); -+ goto fail_irq; -+ } -+ -+ intc->irqs[i] = irq; -+ irq_set_handler_data(irq, intc); -+ irq_set_chained_handler(irq, pruss_intc_irq_handler); -+ } -+ -+ return 0; -+ -+fail_irq: -+ irq_domain_remove(intc->domain); -+ return irq; -+} -+ -+static int pruss_intc_remove(struct platform_device *pdev) -+{ -+ struct pruss_intc *intc = platform_get_drvdata(pdev); -+ unsigned int hwirq; -+ -+ if (intc->domain) { -+ for (hwirq = 0; hwirq < MAX_PRU_SYS_EVENTS; hwirq++) -+ irq_dispose_mapping(irq_find_mapping(intc->domain, -+ hwirq)); -+ irq_domain_remove(intc->domain); -+ } -+ -+ return 0; -+} -+ -+static const struct pruss_intc_match_data am437x_pruss_intc_data = { -+ .no_host7_intr = true, -+}; -+ -+static const struct of_device_id pruss_intc_of_match[] = { -+ { -+ .compatible = "ti,am3356-pruss-intc", -+ .data = NULL, -+ }, -+ { -+ .compatible = "ti,am4376-pruss-intc", -+ .data = &am437x_pruss_intc_data, -+ }, -+ { -+ .compatible = "ti,am5728-pruss-intc", -+ .data = NULL, -+ }, -+ { /* sentinel */ }, -+}; -+MODULE_DEVICE_TABLE(of, pruss_intc_of_match); -+ -+static struct platform_driver pruss_intc_driver = { -+ .driver = { -+ .name = "pruss-intc", -+ .of_match_table = pruss_intc_of_match, -+ }, -+ .probe = pruss_intc_probe, -+ .remove = pruss_intc_remove, -+}; -+module_platform_driver(pruss_intc_driver); -+ -+MODULE_AUTHOR("Andrew F. Davis <afd@ti.com>"); -+MODULE_AUTHOR("Suman Anna <s-anna@ti.com>"); -+MODULE_DESCRIPTION("PRU-ICSS INTC Driver"); -+MODULE_LICENSE("GPL v2"); -diff --git a/include/linux/irqchip/irq-pruss-intc.h b/include/linux/irqchip/irq-pruss-intc.h -new file mode 100644 -index 000000000000..5968be562698 ---- /dev/null -+++ b/include/linux/irqchip/irq-pruss-intc.h -@@ -0,0 +1,93 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/** -+ * irq-pruss-intc.h - PRU-ICSS INTC management -+ * -+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com -+ */ -+ -+#ifndef __INCLUDE_LINUX_IRQCHIP_IRQ_PRUSS_INTC_H -+#define __INCLUDE_LINUX_IRQCHIP_IRQ_PRUSS_INTC_H -+ -+/* maximum number of system events */ -+#define MAX_PRU_SYS_EVENTS 64 -+ -+/* maximum number of interrupt channels */ -+#define MAX_PRU_CHANNELS 10 -+ -+/** -+ * struct pruss_intc_config - INTC configuration info -+ * @sysev_to_ch: system events to channel mapping information -+ * @ch_to_host: interrupt channel to host interrupt information -+ */ -+struct pruss_intc_config { -+ s8 sysev_to_ch[MAX_PRU_SYS_EVENTS]; -+ s8 ch_to_host[MAX_PRU_CHANNELS]; -+}; -+ -+#if IS_ENABLED(CONFIG_TI_PRUSS) -+ -+/** -+ * pruss_intc_configure() - configure the PRUSS INTC -+ * @dev: device -+ * @intc_config: PRU core-specific INTC configuration -+ * -+ * Configures the PRUSS INTC with the provided configuration from -+ * a PRU core. Any existing event to channel mappings or channel to -+ * host interrupt mappings are checked to make sure there are no -+ * conflicting configuration between both the PRU cores. The function -+ * is intended to be used only by the PRU remoteproc driver. -+ * -+ * Returns 0 on success, or a suitable error code otherwise -+ */ -+int pruss_intc_configure(struct device *dev, -+ struct pruss_intc_config *intc_config); -+ -+/** -+ * pruss_intc_unconfigure() - unconfigure the PRUSS INTC -+ * @dev: device -+ * @intc_config: PRU core specific INTC configuration -+ * -+ * Undo whatever was done in pruss_intc_configure() for a PRU core. -+ * It should be sufficient to just mark the resources free in the -+ * global map and disable the host interrupts and sysevents. -+ */ -+int pruss_intc_unconfigure(struct device *dev, -+ struct pruss_intc_config *intc_config); -+/** -+ * pruss_intc_trigger() - trigger a PRU system event -+ * @irq: linux IRQ number associated with a PRU system event -+ * -+ * Trigger an interrupt by signalling a specific PRU system event. -+ * This can be used by PRUSS client users to raise/send an event to -+ * a PRU or any other core that is listening on the host interrupt -+ * mapped to that specific PRU system event. The @irq variable is the -+ * Linux IRQ number associated with a specific PRU system event that -+ * a client user/application uses. The interrupt mappings for this is -+ * provided by the PRUSS INTC irqchip instance. -+ * -+ * Returns 0 on success, or an error value upon failure. -+ */ -+int pruss_intc_trigger(unsigned int irq); -+ -+#else -+ -+static inline int pruss_intc_configure(struct device *dev, -+ struct pruss_intc_config *intc_config) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int pruss_intc_unconfigure(struct device *dev, -+ struct pruss_intc_config *intc_config) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int pruss_intc_trigger(unsigned int irq) -+{ -+ return -ENOTSUPP; -+} -+ -+#endif /* CONFIG_TI_PRUSS */ -+ -+#endif /* __INCLUDE_LINUX_IRQCHIP_IRQ_OMAP_INTC_H */ --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0005-remoteproc-add-map-parameter-to-da_to_va.patch b/patches/drivers/ti/rogerq_pruss/0005-remoteproc-add-map-parameter-to-da_to_va.patch deleted file mode 100644 index 44dec93e1..000000000 --- a/patches/drivers/ti/rogerq_pruss/0005-remoteproc-add-map-parameter-to-da_to_va.patch +++ /dev/null @@ -1,211 +0,0 @@ -From 29f61eab2b8a265cd8004e93f9ae9165d158590d Mon Sep 17 00:00:00 2001 -From: David Lechner <david@lechnology.com> -Date: Sat, 23 Jun 2018 16:08:03 -0500 -Subject: [PATCH 05/25] remoteproc: add map parameter to da_to_va - -This adds a new map parameter to the da_to_va callback for remoteproc -devices. This parameter will be used by devices that have more than -one memory map, such as the PRU found in TI Sitara SoCs. - -On these devices, the same physical memory address can refer to two -different locations, i.e. instruction memory or data memory both start -at 0x0. So, an extra bit of information is needed in the da_to_va -callback to tell these apart. - -Devices that only have a single memory map will just pass 0 for this -parameter. For now we are using 0 everywhere, but later patches will -modify this value. - -Signed-off-by: David Lechner <david@lechnology.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/remoteproc/imx_rproc.c | 2 +- - drivers/remoteproc/keystone_remoteproc.c | 3 ++- - drivers/remoteproc/qcom_q6v5_mss.c | 2 +- - drivers/remoteproc/qcom_wcnss.c | 2 +- - drivers/remoteproc/remoteproc_core.c | 11 +++++++---- - drivers/remoteproc/remoteproc_elf_loader.c | 4 ++-- - drivers/remoteproc/remoteproc_internal.h | 2 +- - drivers/remoteproc/st_slim_rproc.c | 2 +- - drivers/remoteproc/wkup_m3_rproc.c | 3 ++- - include/linux/remoteproc.h | 2 +- - 10 files changed, 19 insertions(+), 14 deletions(-) - -diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c -index 54c07fd3f204..78c3502fea36 100644 ---- a/drivers/remoteproc/imx_rproc.c -+++ b/drivers/remoteproc/imx_rproc.c -@@ -211,7 +211,7 @@ static int imx_rproc_da_to_sys(struct imx_rproc *priv, u64 da, - return -ENOENT; - } - --static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, int len) -+static void *imx_rproc_da_to_va(struct rproc *rproc, u64 da, int len, int map) - { - struct imx_rproc *priv = rproc->priv; - void *va = NULL; -diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c -index aaac31134e39..0f87cf95ae4f 100644 ---- a/drivers/remoteproc/keystone_remoteproc.c -+++ b/drivers/remoteproc/keystone_remoteproc.c -@@ -254,7 +254,8 @@ static void keystone_rproc_kick(struct rproc *rproc, int vqid) - * can be used either by the remoteproc core for loading (when using kernel - * remoteproc loader), or by any rpmsg bus drivers. - */ --static void *keystone_rproc_da_to_va(struct rproc *rproc, u64 da, int len) -+static void *keystone_rproc_da_to_va(struct rproc *rproc, u64 da, int len, -+ int map) - { - struct keystone_rproc *ksproc = rproc->priv; - void __iomem *va = NULL; -diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c -index 01be7314e176..d0cdc340e759 100644 ---- a/drivers/remoteproc/qcom_q6v5_mss.c -+++ b/drivers/remoteproc/qcom_q6v5_mss.c -@@ -971,7 +971,7 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc, - int ret = 0; - struct q6v5 *qproc = rproc->priv; - unsigned long mask = BIT((unsigned long)segment->priv); -- void *ptr = rproc_da_to_va(rproc, segment->da, segment->size); -+ void *ptr = rproc_da_to_va(rproc, segment->da, segment->size, 0); - - /* Unlock mba before copying segments */ - if (!qproc->dump_mba_loaded) -diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c -index b0e07e9f42d5..92b05fb10557 100644 ---- a/drivers/remoteproc/qcom_wcnss.c -+++ b/drivers/remoteproc/qcom_wcnss.c -@@ -295,7 +295,7 @@ static int wcnss_stop(struct rproc *rproc) - return ret; - } - --static void *wcnss_da_to_va(struct rproc *rproc, u64 da, int len) -+static void *wcnss_da_to_va(struct rproc *rproc, u64 da, int len, int map) - { - struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; - int offset; -diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c -index 54ec38fc5dca..06ef4faec83f 100644 ---- a/drivers/remoteproc/remoteproc_core.c -+++ b/drivers/remoteproc/remoteproc_core.c -@@ -166,6 +166,8 @@ static phys_addr_t rproc_va_to_pa(void *cpu_addr) - * @rproc: handle of a remote processor - * @da: remoteproc device address to translate - * @len: length of the memory region @da is pointing to -+ * @map: indicates which memory map to use for devices with more than one -+ * memory map or 0 for devices that only have a single memory map - * - * Some remote processors will ask us to allocate them physically contiguous - * memory regions (which we call "carveouts"), and map them to specific -@@ -190,13 +192,13 @@ static phys_addr_t rproc_va_to_pa(void *cpu_addr) - * here the output of the DMA API for the carveouts, which should be more - * correct. - */ --void *rproc_da_to_va(struct rproc *rproc, u64 da, int len) -+void *rproc_da_to_va(struct rproc *rproc, u64 da, int len, int map) - { - struct rproc_mem_entry *carveout; - void *ptr = NULL; - - if (rproc->ops->da_to_va) { -- ptr = rproc->ops->da_to_va(rproc, da, len); -+ ptr = rproc->ops->da_to_va(rproc, da, len, map); - if (ptr) - goto out; - } -@@ -575,7 +577,7 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, - } - - /* what's the kernel address of this resource ? */ -- ptr = rproc_da_to_va(rproc, rsc->da, rsc->len); -+ ptr = rproc_da_to_va(rproc, rsc->da, rsc->len, 0); - if (!ptr) { - dev_err(dev, "erroneous trace resource entry\n"); - return -EINVAL; -@@ -1549,7 +1551,8 @@ static void rproc_coredump(struct rproc *rproc) - if (segment->dump) { - segment->dump(rproc, segment, data + offset); - } else { -- ptr = rproc_da_to_va(rproc, segment->da, segment->size); -+ ptr = rproc_da_to_va(rproc, segment->da, -+ segment->size, 0); - if (!ptr) { - dev_err(&rproc->dev, - "invalid coredump segment (%pad, %zu)\n", -diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c -index b17d72ec8603..8888d39e1b13 100644 ---- a/drivers/remoteproc/remoteproc_elf_loader.c -+++ b/drivers/remoteproc/remoteproc_elf_loader.c -@@ -182,7 +182,7 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) - } - - /* grab the kernel address for this device address */ -- ptr = rproc_da_to_va(rproc, da, memsz); -+ ptr = rproc_da_to_va(rproc, da, memsz, 0); - if (!ptr) { - dev_err(dev, "bad phdr da 0x%x mem 0x%x\n", da, memsz); - ret = -EINVAL; -@@ -333,6 +333,6 @@ struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc, - if (!shdr) - return NULL; - -- return rproc_da_to_va(rproc, shdr->sh_addr, shdr->sh_size); -+ return rproc_da_to_va(rproc, shdr->sh_addr, shdr->sh_size, 0); - } - EXPORT_SYMBOL(rproc_elf_find_loaded_rsc_table); -diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h -index f6cad243d7ca..15e08338fb44 100644 ---- a/drivers/remoteproc/remoteproc_internal.h -+++ b/drivers/remoteproc/remoteproc_internal.h -@@ -51,7 +51,7 @@ void rproc_exit_sysfs(void); - void rproc_free_vring(struct rproc_vring *rvring); - int rproc_alloc_vring(struct rproc_vdev *rvdev, int i); - --void *rproc_da_to_va(struct rproc *rproc, u64 da, int len); -+void *rproc_da_to_va(struct rproc *rproc, u64 da, int len, int map); - int rproc_trigger_recovery(struct rproc *rproc); - - int rproc_elf_sanity_check(struct rproc *rproc, const struct firmware *fw); -diff --git a/drivers/remoteproc/st_slim_rproc.c b/drivers/remoteproc/st_slim_rproc.c -index d711d9430a4f..8b843c88fb34 100644 ---- a/drivers/remoteproc/st_slim_rproc.c -+++ b/drivers/remoteproc/st_slim_rproc.c -@@ -178,7 +178,7 @@ static int slim_rproc_stop(struct rproc *rproc) - return 0; - } - --static void *slim_rproc_da_to_va(struct rproc *rproc, u64 da, int len) -+static void *slim_rproc_da_to_va(struct rproc *rproc, u64 da, int len, int map) - { - struct st_slim_rproc *slim_rproc = rproc->priv; - void *va = NULL; -diff --git a/drivers/remoteproc/wkup_m3_rproc.c b/drivers/remoteproc/wkup_m3_rproc.c -index 1ada0e51fef6..12cb26ebf35b 100644 ---- a/drivers/remoteproc/wkup_m3_rproc.c -+++ b/drivers/remoteproc/wkup_m3_rproc.c -@@ -88,7 +88,8 @@ static int wkup_m3_rproc_stop(struct rproc *rproc) - return 0; - } - --static void *wkup_m3_rproc_da_to_va(struct rproc *rproc, u64 da, int len) -+static void *wkup_m3_rproc_da_to_va(struct rproc *rproc, u64 da, int len, -+ int map) - { - struct wkup_m3_rproc *wkupm3 = rproc->priv; - void *va = NULL; -diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h -index 507a2b524208..e908b5823412 100644 ---- a/include/linux/remoteproc.h -+++ b/include/linux/remoteproc.h -@@ -356,7 +356,7 @@ struct rproc_ops { - int (*start)(struct rproc *rproc); - int (*stop)(struct rproc *rproc); - void (*kick)(struct rproc *rproc, int vqid); -- void * (*da_to_va)(struct rproc *rproc, u64 da, int len); -+ void * (*da_to_va)(struct rproc *rproc, u64 da, int len, int map); - int (*parse_fw)(struct rproc *rproc, const struct firmware *fw); - struct resource_table *(*find_loaded_rsc_table)( - struct rproc *rproc, const struct firmware *fw); --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0006-remoteproc-add-page-lookup-for-TI-PRU-to-ELF-loader.patch b/patches/drivers/ti/rogerq_pruss/0006-remoteproc-add-page-lookup-for-TI-PRU-to-ELF-loader.patch deleted file mode 100644 index c487f3411..000000000 --- a/patches/drivers/ti/rogerq_pruss/0006-remoteproc-add-page-lookup-for-TI-PRU-to-ELF-loader.patch +++ /dev/null @@ -1,208 +0,0 @@ -From 4e5551b927d08812536b716b4ba497e2bda0ea17 Mon Sep 17 00:00:00 2001 -From: David Lechner <david@lechnology.com> -Date: Sat, 23 Jun 2018 16:08:04 -0500 -Subject: [PATCH 06/25] remoteproc: add page lookup for TI PRU to ELF loader - -This adds a special handler to the default remoteproc ELF firmware -loader that looks up the memory map on TI PRU firmware files. - -These processors have multiple memory maps that share the same address -space, so we need to know the page in addition to the physical address -in order to translate the address to a local CPU address. - -Signed-off-by: David Lechner <david@lechnology.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/remoteproc/remoteproc_elf_loader.c | 117 +++++++++++++++++++-- - include/uapi/linux/elf-em.h | 1 + - 2 files changed, 112 insertions(+), 6 deletions(-) - -diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c -index 8888d39e1b13..79c9d39abe55 100644 ---- a/drivers/remoteproc/remoteproc_elf_loader.c -+++ b/drivers/remoteproc/remoteproc_elf_loader.c -@@ -32,6 +32,103 @@ - - #include "remoteproc_internal.h" - -+#define SHT_TI_PHATTRS 0x7F000004 -+#define SHT_TI_SH_PAGE 0x7F000007 -+ -+struct elf32_ti_phattrs { -+ Elf32_Half pha_seg_id; /* Segment id */ -+ Elf32_Half pha_tag_id; /* Attribute kind id */ -+ union { -+ Elf32_Off pha_offset; /* byte offset within the section */ -+ Elf32_Word pha_value; /* Constant tag value */ -+ } pha_un; -+}; -+ -+/* this struct is reverse engineered, so not sure what most of the values are */ -+struct ti_section_page { -+ u32 unk0; -+ u32 unk1; -+ u32 unk2; -+ u32 unk3; -+ u32 unk4; -+ u16 size; -+ u16 unk5; -+ u16 unk6; -+ u8 data[0]; /* array of size */ -+}; -+ -+/** -+ * rproc_elf_segment_to_map() - Gets memory map for segment -+ * @id: segment id -+ * @elf_data: pointer to ELF file data -+ * -+ * Returns the memory map for the segment. -+ */ -+static int rproc_elf_segment_to_map(u32 id, const u8 *elf_data) -+{ -+ struct elf32_hdr *ehdr; -+ struct elf32_shdr *shdr; -+ struct elf32_ti_phattrs *ti_attrs = NULL; -+ int i; -+ -+ ehdr = (struct elf32_hdr *)elf_data; -+ shdr = (struct elf32_shdr *)(elf_data + ehdr->e_shoff); -+ -+ if (ehdr->e_machine != EM_TI_PRU) -+ return 0; -+ -+ for (i = 0; i < ehdr->e_shnum; i++, shdr++) { -+ if (shdr->sh_type == SHT_TI_PHATTRS) { -+ ti_attrs = (struct elf32_ti_phattrs *)(elf_data + shdr->sh_offset); -+ break; -+ } -+ } -+ -+ if (!ti_attrs) -+ return 0; -+ -+ /* list is terminated by tag id == 0 (PHA_NULL) */ -+ for (; ti_attrs->pha_tag_id; ti_attrs++) { -+ if (ti_attrs->pha_tag_id == 3 && ti_attrs->pha_seg_id == id) -+ return ti_attrs->pha_un.pha_value; -+ } -+ -+ return 0; -+} -+ -+/** -+ * rproc_elf_section_to_map() - Gets memory map for section -+ * @id: segment id -+ * @elf_data: pointer to ELF file data -+ * -+ * Returns the memory map for the section. -+ */ -+static int rproc_elf_section_to_map(u32 id, const u8 *elf_data) -+{ -+ struct elf32_hdr *ehdr; -+ struct elf32_shdr *shdr; -+ struct ti_section_page *map = NULL; -+ int i; -+ -+ ehdr = (struct elf32_hdr *)elf_data; -+ shdr = (struct elf32_shdr *)(elf_data + ehdr->e_shoff); -+ -+ if (ehdr->e_machine != EM_TI_PRU) -+ return 0; -+ -+ for (i = 0; i < ehdr->e_shnum; i++, shdr++) { -+ if (shdr->sh_type == SHT_TI_SH_PAGE) { -+ map = (struct ti_section_page *)(elf_data + shdr->sh_offset); -+ break; -+ } -+ } -+ -+ if (!map || id >= map->size) -+ return 0; -+ -+ return map->data[id]; -+} -+ - /** - * rproc_elf_sanity_check() - Sanity Check ELF firmware image - * @rproc: the remote processor handle -@@ -147,7 +244,7 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) - struct device *dev = &rproc->dev; - struct elf32_hdr *ehdr; - struct elf32_phdr *phdr; -- int i, ret = 0; -+ int i, map, ret = 0; - const u8 *elf_data = fw->data; - - ehdr = (struct elf32_hdr *)elf_data; -@@ -181,8 +278,10 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) - break; - } - -+ map = rproc_elf_segment_to_map(i, elf_data); -+ - /* grab the kernel address for this device address */ -- ptr = rproc_da_to_va(rproc, da, memsz, 0); -+ ptr = rproc_da_to_va(rproc, da, memsz, map); - if (!ptr) { - dev_err(dev, "bad phdr da 0x%x mem 0x%x\n", da, memsz); - ret = -EINVAL; -@@ -209,7 +308,7 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) - EXPORT_SYMBOL(rproc_elf_load_segments); - - static struct elf32_shdr * --find_table(struct device *dev, struct elf32_hdr *ehdr, size_t fw_size) -+find_table(struct device *dev, struct elf32_hdr *ehdr, size_t fw_size, int *id) - { - struct elf32_shdr *shdr; - int i; -@@ -261,6 +360,9 @@ find_table(struct device *dev, struct elf32_hdr *ehdr, size_t fw_size) - return NULL; - } - -+ if (id) -+ *id = i; -+ - return shdr; - } - -@@ -288,7 +390,7 @@ int rproc_elf_load_rsc_table(struct rproc *rproc, const struct firmware *fw) - - ehdr = (struct elf32_hdr *)elf_data; - -- shdr = find_table(dev, ehdr, fw->size); -+ shdr = find_table(dev, ehdr, fw->size, NULL); - if (!shdr) - return -EINVAL; - -@@ -328,11 +430,14 @@ struct resource_table *rproc_elf_find_loaded_rsc_table(struct rproc *rproc, - { - struct elf32_hdr *ehdr = (struct elf32_hdr *)fw->data; - struct elf32_shdr *shdr; -+ int id, map; - -- shdr = find_table(&rproc->dev, ehdr, fw->size); -+ shdr = find_table(&rproc->dev, ehdr, fw->size, &id); - if (!shdr) - return NULL; - -- return rproc_da_to_va(rproc, shdr->sh_addr, shdr->sh_size, 0); -+ map = rproc_elf_section_to_map(id, fw->data); -+ -+ return rproc_da_to_va(rproc, shdr->sh_addr, shdr->sh_size, map); - } - EXPORT_SYMBOL(rproc_elf_find_loaded_rsc_table); -diff --git a/include/uapi/linux/elf-em.h b/include/uapi/linux/elf-em.h -index 0c3000faedba..70b487a80648 100644 ---- a/include/uapi/linux/elf-em.h -+++ b/include/uapi/linux/elf-em.h -@@ -38,6 +38,7 @@ - #define EM_BLACKFIN 106 /* ADI Blackfin Processor */ - #define EM_ALTERA_NIOS2 113 /* Altera Nios II soft-core processor */ - #define EM_TI_C6000 140 /* TI C6X DSPs */ -+#define EM_TI_PRU 144 /* TI Programmable Realtime Unit */ - #define EM_AARCH64 183 /* ARM 64 bit */ - #define EM_TILEPRO 188 /* Tilera TILEPro */ - #define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */ --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0007-remoteproc-Add-a-rproc_set_firmware-API.patch b/patches/drivers/ti/rogerq_pruss/0007-remoteproc-Add-a-rproc_set_firmware-API.patch deleted file mode 100644 index 33e58e80b..000000000 --- a/patches/drivers/ti/rogerq_pruss/0007-remoteproc-Add-a-rproc_set_firmware-API.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 58c737d3c7f11037c68dd6f50daa9d94042ae1b7 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Mon, 29 Jan 2018 16:25:31 -0600 -Subject: [PATCH 07/25] remoteproc: Add a rproc_set_firmware() API - -A new API, rproc_set_firmware() is added to allow the remoteproc platform -drivers and remoteproc client drivers to be able to configure a custom -firmware name that is different from the default name used during -remoteproc registration. This function is being introduced to provide -a kernel-level equivalent of the current sysfs interface to remoteproc -client drivers. This allows some remoteproc drivers to choose different -firmwares at runtime when the remote processor is not running based on -the functional feature it is providing using that remote processor. -The TI PRU Ethernet driver will be an example of such usage as it -requires to use different firmwares for different supported protocols. - -Also, update the firmware_store() function used by the sysfs interface -to reuse this function to avoid code duplication. - -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/remoteproc/remoteproc_core.c | 61 +++++++++++++++++++++++++++ - drivers/remoteproc/remoteproc_sysfs.c | 33 +-------------- - include/linux/remoteproc.h | 1 + - 3 files changed, 64 insertions(+), 31 deletions(-) - -diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c -index 06ef4faec83f..2d9646f13a54 100644 ---- a/drivers/remoteproc/remoteproc_core.c -+++ b/drivers/remoteproc/remoteproc_core.c -@@ -2149,6 +2149,67 @@ void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type) - } - EXPORT_SYMBOL(rproc_report_crash); - -+/** -+ * rproc_set_firmware() - assign a new firmware -+ * @rproc: rproc handle to which the new firmware is being assigned -+ * @fw_name: new firmware name to be assigned -+ * -+ * This function allows remoteproc drivers or clients to configure a custom -+ * firmware name that is different from the default name used during remoteproc -+ * registration. The function does not trigger a remote processor boot, -+ * only sets the firmware name used for a subsequent boot. This function -+ * should also be called only when the remote processor is offline. -+ * -+ * This allows either the userspace to configure a different name through -+ * sysfs or a kernel-level remoteproc or a remoteproc client driver to set -+ * a specific firmware when it is controlling the boot and shutdown of the -+ * remote processor. -+ * -+ * Returns 0 on success or a negative value upon failure -+ */ -+int rproc_set_firmware(struct rproc *rproc, const char *fw_name) -+{ -+ struct device *dev = rproc->dev.parent; -+ int ret, len; -+ char *p; -+ -+ if (!rproc || !fw_name) -+ return -EINVAL; -+ -+ ret = mutex_lock_interruptible(&rproc->lock); -+ if (ret) { -+ dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, ret); -+ return -EINVAL; -+ } -+ -+ if (rproc->state != RPROC_OFFLINE) { -+ dev_err(dev, "can't change firmware while running\n"); -+ ret = -EBUSY; -+ goto out; -+ } -+ -+ len = strcspn(fw_name, "\n"); -+ if (!len) { -+ dev_err(dev, "empty firmware name string\n"); -+ ret = -EINVAL; -+ goto out; -+ } -+ -+ p = kstrndup(fw_name, len, GFP_KERNEL); -+ if (!p) { -+ ret = -ENOMEM; -+ goto out; -+ } -+ -+ kfree(rproc->firmware); -+ rproc->firmware = p; -+ -+out: -+ mutex_unlock(&rproc->lock); -+ return ret; -+} -+EXPORT_SYMBOL(rproc_set_firmware); -+ - static int __init remoteproc_init(void) - { - rproc_init_sysfs(); -diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c -index 3a4c3d7cafca..6cf04a71b75a 100644 ---- a/drivers/remoteproc/remoteproc_sysfs.c -+++ b/drivers/remoteproc/remoteproc_sysfs.c -@@ -32,38 +32,9 @@ static ssize_t firmware_store(struct device *dev, - const char *buf, size_t count) - { - struct rproc *rproc = to_rproc(dev); -- char *p; -- int err, len = count; -+ int err; - -- err = mutex_lock_interruptible(&rproc->lock); -- if (err) { -- dev_err(dev, "can't lock rproc %s: %d\n", rproc->name, err); -- return -EINVAL; -- } -- -- if (rproc->state != RPROC_OFFLINE) { -- dev_err(dev, "can't change firmware while running\n"); -- err = -EBUSY; -- goto out; -- } -- -- len = strcspn(buf, "\n"); -- if (!len) { -- dev_err(dev, "can't provide a NULL firmware\n"); -- err = -EINVAL; -- goto out; -- } -- -- p = kstrndup(buf, len, GFP_KERNEL); -- if (!p) { -- err = -ENOMEM; -- goto out; -- } -- -- kfree(rproc->firmware); -- rproc->firmware = p; --out: -- mutex_unlock(&rproc->lock); -+ err = rproc_set_firmware(rproc, buf); - - return err ? err : count; - } -diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h -index e908b5823412..b5aa5fbff09b 100644 ---- a/include/linux/remoteproc.h -+++ b/include/linux/remoteproc.h -@@ -590,6 +590,7 @@ rproc_of_resm_mem_entry_init(struct device *dev, u32 of_resm_idx, int len, - - int rproc_boot(struct rproc *rproc); - void rproc_shutdown(struct rproc *rproc); -+int rproc_set_firmware(struct rproc *rproc, const char *fw_name); - void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type); - int rproc_coredump_add_segment(struct rproc *rproc, dma_addr_t da, size_t size); - int rproc_coredump_add_custom_segment(struct rproc *rproc, --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0008-remoteproc-Add-support-to-handle-device-specific-res.patch b/patches/drivers/ti/rogerq_pruss/0008-remoteproc-Add-support-to-handle-device-specific-res.patch deleted file mode 100644 index 11501b0a7..000000000 --- a/patches/drivers/ti/rogerq_pruss/0008-remoteproc-Add-support-to-handle-device-specific-res.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 21e8f89b372d337e6be6664a25a438f9c0cdf985 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Tue, 24 Oct 2017 19:01:56 -0500 -Subject: [PATCH 08/25] remoteproc: Add support to handle device specific - resource types - -The remoteproc framework handles a fixed set of resource table entries -today. To make it scalable across multiple platforms, it makes sense -for the framework to provide a way for the device specific implementation -to define and handle vendor specific resource types. These resource types -would be very specific to an implementation instance that it does not -make sense for the framework to handle it. - -For instance, a remoteproc implementation might want timers information -embedded in the resource table so that the driver could parse the binary -and enable accordingly. Another example would be hwspinlocks that it -is using, to properly share system wide resources. The PRU interrupt -controller's interrupt-map could be provided via a vendor specific -resource. - -This patch adds a function pointer to the list of rproc_ops for the -driver implementation to handle such custom vendor resources. - -[rogerq@ti.com] Get rid of pre/post loaders. Show in debugfs. -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/remoteproc/remoteproc_core.c | 36 +++++++++++++++++++++++++ - drivers/remoteproc/remoteproc_debugfs.c | 3 +++ - include/linux/remoteproc.h | 17 ++++++++++-- - 3 files changed, 54 insertions(+), 2 deletions(-) - -diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c -index 2d9646f13a54..b43aa40188bf 100644 ---- a/drivers/remoteproc/remoteproc_core.c -+++ b/drivers/remoteproc/remoteproc_core.c -@@ -895,6 +895,41 @@ void rproc_add_carveout(struct rproc *rproc, struct rproc_mem_entry *mem) - } - EXPORT_SYMBOL(rproc_add_carveout); - -+/** -+ * rproc_handle_vendor_rsc() - provide implementation specific hook -+ * to handle vendor/custom resources -+ * @rproc: the remote processor -+ * @rsc: vendor resource to be handled by remoteproc drivers -+ * @offset: offset of the resource data in resource table -+ * @avail: size of available data -+ * -+ * Remoteproc implementations might want to add resource table entries -+ * that are not generic enough to be handled by the framework. This -+ * provides a hook to handle such custom resources. -+ * -+ * Returns 0 on success, or an appropriate error code otherwise -+ */ -+static int rproc_handle_vendor_rsc(struct rproc *rproc, -+ struct fw_rsc_vendor *rsc, -+ int offset, int avail) -+{ -+ struct device *dev = &rproc->dev; -+ -+ if (sizeof(*rsc) > avail) { -+ dev_err(dev, "vendor rsc is truncated\n"); -+ return -EINVAL; -+ } -+ -+ dev_dbg(dev, "vendor rsc:"); -+ -+ if (!rproc->ops->handle_vendor_rsc) { -+ dev_err(dev, "no vendor rsc handler! ignoring resource\n"); -+ return 0; -+ } -+ -+ return rproc->ops->handle_vendor_rsc(rproc, (void *)rsc); -+} -+ - /** - * rproc_mem_entry_init() - allocate and initialize rproc_mem_entry struct - * @dev: pointer on device struct -@@ -983,6 +1018,7 @@ static rproc_handle_resource_t rproc_loading_handlers[RSC_LAST] = { - [RSC_CARVEOUT] = (rproc_handle_resource_t)rproc_handle_carveout, - [RSC_DEVMEM] = (rproc_handle_resource_t)rproc_handle_devmem, - [RSC_TRACE] = (rproc_handle_resource_t)rproc_handle_trace, -+ [RSC_VENDOR] = (rproc_handle_resource_t)rproc_handle_vendor_rsc, - [RSC_VDEV] = (rproc_handle_resource_t)rproc_handle_vdev, - }; - -diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c -index e90135c64af0..ef661652577c 100644 ---- a/drivers/remoteproc/remoteproc_debugfs.c -+++ b/drivers/remoteproc/remoteproc_debugfs.c -@@ -230,6 +230,9 @@ static int rproc_rsc_table_show(struct seq_file *seq, void *p) - v->vring[j].pa); - } - break; -+ case RSC_VENDOR: -+ seq_printf(seq, "Entry %d is of type %s [Vendor specific]\n", -+ i, types[hdr->type]); - default: - seq_printf(seq, "Unknown resource type found: %d [hdr: %pK]\n", - hdr->type, hdr); -diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h -index b5aa5fbff09b..9f4c457617f2 100644 ---- a/include/linux/remoteproc.h -+++ b/include/linux/remoteproc.h -@@ -100,6 +100,7 @@ struct fw_rsc_hdr { - * the remote processor will be writing logs. - * @RSC_VDEV: declare support for a virtio device, and serve as its - * virtio header. -+ * @RSC_VENDOR: vendor specific resource type. - * @RSC_LAST: just keep this one at the end - * - * For more details regarding a specific resource type, please see its -@@ -115,7 +116,8 @@ enum fw_resource_type { - RSC_DEVMEM = 1, - RSC_TRACE = 2, - RSC_VDEV = 3, -- RSC_LAST = 4, -+ RSC_VENDOR = 4, -+ RSC_LAST, - }; - - #define FW_RSC_ADDR_ANY (-1) -@@ -307,6 +309,14 @@ struct fw_rsc_vdev { - - struct rproc; - -+/** -+ * struct fw_rsc_vendor - vendor specific resource definition -+ * @data: resource data. vendor defined. -+ */ -+struct fw_rsc_vendor { -+ u8 data[0]; -+} __packed; -+ - /** - * struct rproc_mem_entry - memory entry descriptor - * @va: virtual address -@@ -347,7 +357,8 @@ struct firmware; - * @da_to_va: optional platform hook to perform address translations - * @load_rsc_table: load resource table from firmware image - * @find_loaded_rsc_table: find the loaded resouce table -- * @load: load firmeware to memory, where the remote processor -+ * @handle_vendor_rsc: hook to handle device specific resource table entries -+ * @load: load firmware to memory, where the remote processor - * expects to find it - * @sanity_check: sanity check the fw image - * @get_boot_addr: get boot address to entry point specified in firmware -@@ -360,6 +371,8 @@ struct rproc_ops { - int (*parse_fw)(struct rproc *rproc, const struct firmware *fw); - struct resource_table *(*find_loaded_rsc_table)( - struct rproc *rproc, const struct firmware *fw); -+ int (*handle_vendor_rsc)(struct rproc *rproc, -+ struct fw_rsc_vendor *rsc); - int (*load)(struct rproc *rproc, const struct firmware *fw); - int (*sanity_check)(struct rproc *rproc, const struct firmware *fw); - u32 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw); --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0009-dt-binding-remoteproc-Add-binding-doc-for-PRU-Cores-.patch b/patches/drivers/ti/rogerq_pruss/0009-dt-binding-remoteproc-Add-binding-doc-for-PRU-Cores-.patch deleted file mode 100644 index ff345e615..000000000 --- a/patches/drivers/ti/rogerq_pruss/0009-dt-binding-remoteproc-Add-binding-doc-for-PRU-Cores-.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 2bf797780752e1588e1a77cb4d972212afd3e248 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Fri, 1 Feb 2019 14:11:28 +0200 -Subject: [PATCH 09/25] dt-binding: remoteproc: Add binding doc for PRU Cores - in the PRU-ICSS - -The Programmable Real-Time Unit Subsystem (PRUSS) consists of -dual 32-bit RISC cores (Programmable Real-Time Units, or PRUs) -for program execution. This patch adds a remoteproc platform -driver for managing the individual PRU RISC cores life cycle. - -Add DT binding documentation for that. - -Cc: Rob Herring <robh+dt@kernel.org> -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - .../bindings/remoteproc/ti,pru-rproc.txt | 56 +++++++++++++++++++ - 1 file changed, 56 insertions(+) - create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,pru-rproc.txt - -diff --git a/Documentation/devicetree/bindings/remoteproc/ti,pru-rproc.txt b/Documentation/devicetree/bindings/remoteproc/ti,pru-rproc.txt -new file mode 100644 -index 000000000000..02dfd0e671b6 ---- /dev/null -+++ b/Documentation/devicetree/bindings/remoteproc/ti,pru-rproc.txt -@@ -0,0 +1,56 @@ -+PRU Core on TI SoCs -+=================== -+ -+Each PRUSS has dual PRU cores, each represented by a PRU child node. Each node -+can optionally be rendered inactive by using the standard DT string property, -+"status". -+ -+Required Properties: -+-------------------- -+- compatible : should be -+ "ti,am3356-pru" for AM335x family of SoCs -+ "ti,am4376-pru" for AM437x family of SoCs -+ "ti,am5728-pru" for AM57xx family of SoCs -+ "ti,k2g-pru" for 66AK2G family of SoCs -+- reg : base address and size for each of the 3 sub-module address -+ spaces as mentioned in reg-names, and in the same order as -+ the reg-names -+- reg-names : should contain each of the following 3 names, the binding is -+ agnostic of the order of these reg-names -+ "iram" for Instruction RAM, -+ "control" for the CTRL sub-module registers, -+ "debug" for the Debug sub-module registers, -+ -+- firmware-name : should contain the name of the firmware image file -+ located on the firmware search path. This firmware will be -+ used as default if the Application node or User (via sysfs) -+ doesn't provide a firmware-name. -+ -+- gpcfg : pHandle to CFG module's syscon regmap and offset to PRU's -+ GPCFG register. -+ -+Optional Properties: -+-------------------- -+The virtio based communication between the MPU and a PRU core _requires_ -+either the 'mboxes' property, or the set of 'interrupt-parent', 'interrupts' -+and 'interrupt-names' properties to be defined. The latter option is the -+preferred choice. The 'mboxes' property is not applicable for 66AK2G and -+DA850/OMAP-L138 SoCs. -+ -+- mboxes : OMAP Mailbox specifier denoting the sub-mailbox, if using -+ a mailbox for IPC signalling between host and a PRU core. -+ The specifier format is as per the bindings, -+ Documentation/devicetree/bindings/mailbox/omap-mailbox.txt -+ This property should match with the sub-mailbox node used -+ in the corresponding firmware image. -+- interrupt-parent : phandle to the PRUSS INTC node. Should be defined if -+ interrupts property is to be used. -+- interrupts : array of interrupt specifiers if using PRU system events -+ for IPC signalling between host and a PRU core. This -+ property should match with the PRU system event used in -+ the corresponding firmware image. -+- interrupt-names : should use one of the following names for each interrupt, -+ the name should match the corresponding PRU system event -+ number, -+ "vring" - for PRU to HOST virtqueue signalling -+ "kick" - for HOST to PRU virtqueue signalling --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0010-remoteproc-pru-Add-PRU-remoteproc-driver.patch b/patches/drivers/ti/rogerq_pruss/0010-remoteproc-pru-Add-PRU-remoteproc-driver.patch deleted file mode 100644 index 3e4c5ae75..000000000 --- a/patches/drivers/ti/rogerq_pruss/0010-remoteproc-pru-Add-PRU-remoteproc-driver.patch +++ /dev/null @@ -1,1144 +0,0 @@ -From 451e0084204e0f18f9ea8c97f8aadd7bb1ca8c39 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Tue, 13 Feb 2018 16:53:24 -0600 -Subject: [PATCH 10/25] remoteproc/pru: Add PRU remoteproc driver - -The Programmable Real-Time Unit Subsystem (PRUSS) consists of -dual 32-bit RISC cores (Programmable Real-Time Units, or PRUs) -for program execution. This patch adds a remoteproc platform -driver for managing the individual PRU RISC cores life cycle. - -This remoteproc driver does not have support for error recovery -and system suspend/resume features. Different compatibles are -used to allow providing scalability for instance-specific device -data if needed. The driver uses a default firmware-name retrieved -from device-tree, and the firmwares are expected to be present -in the standard Linux firmware search paths. They can also be -adjusted by userspace if required through the sysfs interface -provided by the remoteproc core. - -The PRU remoteproc driver uses a client-driven boot methodology -- it does _not_ support auto-boot so that the PRU load and boot -is dictated by the corresponding client drivers for achieving -various usecases. This allows flexibility for the client drivers -or applications to set a firmware name (if needed) based on their -desired functionality and boot the PRU. The sysfs bind and unbind -attributes have also been suppressed so that the PRU devices cannot -be unbound and thereby shutdown a PRU from underneath a PRU client -driver. - -A new entry 'single_step' is added to the remoteproc debugfs dir. -The 'single_step' utilizes the single-step execution of the PRU -cores. Writing a non-zero value performs a single step, and a -zero value restores the PRU to execute in the same mode as the -mode before the first single step. (note: if the PRU is halted -because of a halt instruction, then no change occurs). - -pru_rproc_get() and pru_rproc_put() functions allow client drivers -to acquire and release the remoteproc device associated with a PRU core. -The PRU cores are treated as resources with only one client owning -it at a time. - -PRU interrupt mapping can be provided via devicetree using -ti,pru-interrupt-map property or via the resource table in the -firmware blob. If both are provided, the config in DT takes precedence. -For interrupt map via resource table, pru-software-support-package [1] -has been historically using version 0 for this. However, the current -data structure is not scaleable and is not self sufficient. -1) it hard codes number of channel to host mappings so is not -scaleable to newer SoCs than have more of these. -2) it does not contain the event to channel mappings within -itself but relies on a pointer to point to another section -in data memory. This causes a weird complication that the -respective data section must be loaded before we can really -use the INTC map. - -With this patch we drop support for version 0 and support -version 1 which is a more robust and scalable data structure. -It should be able to support a sufficiently large number (255) of -sysevents, channels and host interrupts and is self contained -so it can be used without dependency on order of loading sections. - -[1] git://git.ti.com/pru-software-support-package/pru-software-support-package.git - -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Andrew F. Davis <afd@ti.com> -Signed-off-by: Tero Kristo <t-kristo@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/remoteproc/Kconfig | 14 + - drivers/remoteproc/Makefile | 1 + - drivers/remoteproc/pru_rproc.c | 930 +++++++++++++++++++++++++++ - drivers/remoteproc/pru_rproc.h | 54 ++ - include/linux/remoteproc/pru_rproc.h | 27 + - 5 files changed, 1026 insertions(+) - create mode 100644 drivers/remoteproc/pru_rproc.c - create mode 100644 drivers/remoteproc/pru_rproc.h - create mode 100644 include/linux/remoteproc/pru_rproc.h - -diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig -index f0abd2608044..333666ef91a3 100644 ---- a/drivers/remoteproc/Kconfig -+++ b/drivers/remoteproc/Kconfig -@@ -197,6 +197,20 @@ config ST_REMOTEPROC - config ST_SLIM_REMOTEPROC - tristate - -+config PRUSS_REMOTEPROC -+ tristate "TI PRUSS remoteproc support" -+ depends on TI_PRUSS -+ default n -+ help -+ Support for TI PRU-ICSS remote processors via the remote processor -+ framework. -+ -+ Currently supported on AM33xx SoCs. -+ -+ Say Y or M here to support the Programmable Realtime Unit (PRU) -+ processors on various TI SoCs. It's safe to say N here if you're -+ not interested in the PRU or if you are unsure. -+ - endif # REMOTEPROC - - endmenu -diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile -index ce5d061e92be..88a86ccce5ca 100644 ---- a/drivers/remoteproc/Makefile -+++ b/drivers/remoteproc/Makefile -@@ -26,3 +26,4 @@ qcom_wcnss_pil-y += qcom_wcnss.o - qcom_wcnss_pil-y += qcom_wcnss_iris.o - obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o - obj-$(CONFIG_ST_SLIM_REMOTEPROC) += st_slim_rproc.o -+obj-$(CONFIG_PRUSS_REMOTEPROC) += pru_rproc.o -diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c -new file mode 100644 -index 000000000000..ddd4b64aaf9b ---- /dev/null -+++ b/drivers/remoteproc/pru_rproc.c -@@ -0,0 +1,930 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * PRU-ICSS remoteproc driver for various TI SoCs -+ * -+ * Copyright (C) 2014-2019 Texas Instruments Incorporated - http://www.ti.com/ -+ * Suman Anna <s-anna@ti.com> -+ * Andrew F. Davis <afd@ti.com> -+ */ -+ -+#include <linux/bitops.h> -+#include <linux/debugfs.h> -+#include <linux/interrupt.h> -+#include <linux/irqchip/irq-pruss-intc.h> -+#include <linux/mfd/syscon.h> -+#include <linux/module.h> -+#include <linux/of_device.h> -+#include <linux/regmap.h> -+#include <linux/remoteproc.h> -+#include <linux/remoteproc/pru_rproc.h> -+#include <linux/pruss.h> -+ -+#include "remoteproc_internal.h" -+#include "pru_rproc.h" -+ -+/* ELF PAGE ID */ -+#define PRU_PAGE_IRAM 0 -+#define PRU_PAGE_DRAM 1 -+ -+/* IRAM offsets */ -+#define PRU0_IRAM_START 0x34000 -+#define PRU1_IRAM_START 0x38000 -+#define PRU_IRAM_MASK 0x3ffff -+ -+/* PRU_ICSS_PRU_CTRL registers */ -+#define PRU_CTRL_CTRL 0x0000 -+#define PRU_CTRL_STS 0x0004 -+#define PRU_CTRL_WAKEUP_EN 0x0008 -+#define PRU_CTRL_CYCLE 0x000C -+#define PRU_CTRL_STALL 0x0010 -+#define PRU_CTRL_CTBIR0 0x0020 -+#define PRU_CTRL_CTBIR1 0x0024 -+#define PRU_CTRL_CTPPR0 0x0028 -+#define PRU_CTRL_CTPPR1 0x002C -+ -+/* CTRL register bit-fields */ -+#define CTRL_CTRL_SOFT_RST_N BIT(0) -+#define CTRL_CTRL_EN BIT(1) -+#define CTRL_CTRL_SLEEPING BIT(2) -+#define CTRL_CTRL_CTR_EN BIT(3) -+#define CTRL_CTRL_SINGLE_STEP BIT(8) -+#define CTRL_CTRL_RUNSTATE BIT(15) -+ -+/* PRU_ICSS_PRU_DEBUG registers */ -+#define PRU_DEBUG_GPREG(x) (0x0000 + (x) * 4) -+#define PRU_DEBUG_CT_REG(x) (0x0080 + (x) * 4) -+ -+/** -+ * struct pru_rproc - PRU remoteproc structure -+ * @id: id of the PRU core within the PRUSS -+ * @pruss: back-reference to parent PRUSS structure -+ * @rproc: remoteproc pointer for this PRU core -+ * @iram_region: PRU IRAM IOMEM -+ * @ctrl_regmap: regmap to PRU CTRL IOMEM -+ * @debug_regmap: regmap to PRU DEBUG IOMEM -+ * @client_np: client device node -+ * @intc_config: PRU INTC configuration data -+ * @dram0: PRUSS DRAM0 region -+ * @dram1: PRUSS DRAM1 region -+ * @shrdram: PRUSS SHARED RAM region -+ * @iram_da: device address of Instruction RAM for this PRU -+ * @pdram_da: device address of primary Data RAM for this PRU -+ * @sdram_da: device address of secondary Data RAM for this PRU -+ * @shrdram_da: device address of shared Data RAM -+ * @cfg: regmap to CFG module -+ * @gpcfg_reg: offset to gpcfg register of this PRU -+ * @fw_name: name of firmware image used during loading -+ * @gpmux_save: saved value for gpmux config -+ * @dt_irqs: number of irqs configured from DT -+ * @fw_irqs: number of irqs configured from FW -+ * @lock: mutex to protect client usage -+ * @dbg_single_step: debug state variable to set PRU into single step mode -+ * @ctrl_saved_state: saved CTRL state to return to normal mode -+ */ -+struct pru_rproc { -+ int id; -+ struct pruss *pruss; -+ struct rproc *rproc; -+ struct pruss_mem_region iram_region; -+ struct regmap *ctrl_regmap; -+ struct regmap *debug_regmap; -+ struct device_node *client_np; -+ struct pruss_intc_config intc_config; -+ struct pruss_mem_region dram0; -+ struct pruss_mem_region dram1; -+ struct pruss_mem_region shrdram; -+ u32 iram_da; -+ u32 pdram_da; -+ u32 sdram_da; -+ u32 shrdram_da; -+ struct regmap *cfg; -+ int gpcfg_reg; -+ const char *fw_name; -+ u8 gpmux_save; -+ int dt_irqs; -+ int fw_irqs; -+ struct mutex lock; /* client access lock */ -+ bool dbg_single_step; -+ u32 ctrl_saved_state; -+}; -+ -+/** -+ * pru_rproc_set_firmware() - set firmware for a pru core -+ * @rproc: the rproc instance of the PRU -+ * @fw_name: the new firmware name, or NULL if default is desired -+ */ -+static int pru_rproc_set_firmware(struct rproc *rproc, const char *fw_name) -+{ -+ struct pru_rproc *pru = rproc->priv; -+ -+ if (!fw_name) -+ fw_name = pru->fw_name; -+ -+ return rproc_set_firmware(rproc, fw_name); -+} -+ -+/* -+ * pru_get_gpmux() - get the current GPMUX value for a PRU device -+ * @pru: pru_rproc instance -+ * @mux: pointer to store the current mux value into -+ * -+ * returns 0 on success, negative error value otherwise. -+ */ -+static int pru_get_gpmux(struct pru_rproc *pru, u8 *mux) -+{ -+ int ret; -+ unsigned int val; -+ -+ ret = regmap_read(pru->cfg, pru->gpcfg_reg, &val); -+ if (ret) -+ return ret; -+ -+ *mux = (u8)((val & PRUSS_GPCFG_PRU_MUX_SEL_MASK) >> -+ PRUSS_GPCFG_PRU_MUX_SEL_SHIFT); -+ -+ return 0; -+} -+ -+/** -+ * pru_set_gpmux() - set the GPMUX value for a PRU device -+ * @pru: pru_rproc instance -+ * @mux: new mux value for PRU -+ * -+ * returns 0 on success, negative error value otherwise. -+ */ -+static int pru_set_gpmux(struct pru_rproc *pru, u8 mux) -+{ -+ if (mux >= PRUSS_GP_MUX_SEL_MAX) -+ return -EINVAL; -+ -+ return regmap_update_bits(pru->cfg, pru->gpcfg_reg, -+ PRUSS_GPCFG_PRU_MUX_SEL_MASK, -+ (u32)mux << PRUSS_GPCFG_PRU_MUX_SEL_SHIFT); -+} -+ -+static int pru_get_intc_dt_config(struct pru_rproc *pru, -+ const char *propname, int index, -+ struct pruss_intc_config *intc_config) -+{ -+ struct device *dev = &pru->rproc->dev; -+ struct device_node *np = pru->client_np; -+ struct property *prop; -+ int ret = 0, entries, i; -+ int dt_irqs = 0; -+ u32 *arr; -+ int max_system_events, max_pru_channels, max_pru_host_ints; -+ -+ max_system_events = MAX_PRU_SYS_EVENTS; -+ max_pru_channels = MAX_PRU_CHANNELS; -+ max_pru_host_ints = MAX_PRU_CHANNELS; -+ -+ prop = of_find_property(np, propname, NULL); -+ if (!prop) -+ return 0; -+ -+ entries = of_property_count_u32_elems(np, propname); -+ if (entries <= 0 || entries % 4) -+ return -EINVAL; -+ -+ arr = kmalloc_array(entries, sizeof(u32), GFP_KERNEL); -+ if (!arr) -+ return -ENOMEM; -+ -+ ret = of_property_read_u32_array(np, propname, arr, entries); -+ if (ret) -+ return -EINVAL; -+ -+ for (i = 0; i < ARRAY_SIZE(intc_config->sysev_to_ch); i++) -+ intc_config->sysev_to_ch[i] = -1; -+ -+ for (i = 0; i < ARRAY_SIZE(intc_config->ch_to_host); i++) -+ intc_config->ch_to_host[i] = -1; -+ -+ for (i = 0; i < entries; i += 4) { -+ if (arr[i] != index) -+ continue; -+ -+ if (arr[i + 1] < 0 || -+ arr[i + 1] >= max_system_events) { -+ dev_err(dev, "bad sys event %d\n", arr[i + 1]); -+ ret = -EINVAL; -+ goto err; -+ } -+ -+ if (arr[i + 2] < 0 || -+ arr[i + 2] >= max_pru_channels) { -+ dev_err(dev, "bad channel %d\n", arr[i + 2]); -+ ret = -EINVAL; -+ goto err; -+ } -+ -+ if (arr[i + 3] < 0 || -+ arr[i + 3] >= max_pru_host_ints) { -+ dev_err(dev, "bad irq %d\n", arr[i + 3]); -+ ret = -EINVAL; -+ goto err; -+ } -+ -+ intc_config->sysev_to_ch[arr[i + 1]] = arr[i + 2]; -+ dev_dbg(dev, "sysevt-to-ch[%d] -> %d\n", arr[i + 1], -+ arr[i + 2]); -+ -+ intc_config->ch_to_host[arr[i + 2]] = arr[i + 3]; -+ dev_dbg(dev, "chnl-to-host[%d] -> %d\n", arr[i + 2], -+ arr[i + 3]); -+ -+ dt_irqs++; -+ } -+ -+ kfree(arr); -+ return dt_irqs; -+ -+err: -+ kfree(arr); -+ return ret; -+} -+ -+static struct rproc *__pru_rproc_get(struct device_node *np, int index) -+{ -+ struct device_node *rproc_np = NULL; -+ struct platform_device *pdev; -+ struct rproc *rproc; -+ -+ rproc_np = of_parse_phandle(np, "prus", index); -+ if (!rproc_np || !of_device_is_available(rproc_np)) -+ return ERR_PTR(-ENODEV); -+ -+ pdev = of_find_device_by_node(rproc_np); -+ of_node_put(rproc_np); -+ -+ if (!pdev) -+ /* probably PRU not yet probed */ -+ return ERR_PTR(-EPROBE_DEFER); -+ -+ /* TODO: replace the crude string based check to make sure it is PRU */ -+ if (!strstr(dev_name(&pdev->dev), "pru")) { -+ put_device(&pdev->dev); -+ return ERR_PTR(-ENODEV); -+ } -+ -+ rproc = platform_get_drvdata(pdev); -+ put_device(&pdev->dev); -+ if (!rproc) -+ return ERR_PTR(-EPROBE_DEFER); -+ -+ get_device(&rproc->dev); -+ -+ return rproc; -+} -+ -+/** -+ * pru_rproc_get() - get the PRU rproc instance from a device node -+ * @np: the user/client device node -+ * @index: index to use for the prus property -+ * -+ * This function looks through a client device node's "prus" property at index -+ * @index and returns the rproc handle for a valid PRU remote processor if -+ * found. The function allows only one user to own the PRU rproc resource at -+ * a time. Caller must call pru_rproc_put() when done with using the rproc, -+ * not required if the function returns a failure. -+ * -+ * Returns the rproc handle on success, and an ERR_PTR on failure using one -+ * of the following error values -+ * -ENODEV if device is not found -+ * -EBUSY if PRU is already acquired by anyone -+ * -EPROBE_DEFER is PRU device is not probed yet -+ */ -+struct rproc *pru_rproc_get(struct device_node *np, int index) -+{ -+ struct rproc *rproc; -+ struct pru_rproc *pru; -+ struct device *dev; -+ int ret; -+ u32 mux; -+ const char *fw_name; -+ -+ rproc = __pru_rproc_get(np, index); -+ if (IS_ERR(rproc)) -+ return rproc; -+ -+ pru = rproc->priv; -+ dev = &rproc->dev; -+ -+ mutex_lock(&pru->lock); -+ -+ if (pru->client_np) { -+ mutex_unlock(&pru->lock); -+ put_device(&rproc->dev); -+ return ERR_PTR(-EBUSY); -+ } -+ -+ pru->client_np = np; -+ -+ mutex_unlock(&pru->lock); -+ -+ ret = pru_get_gpmux(pru, &pru->gpmux_save); -+ if (ret) { -+ dev_err(dev, "failed to get cfg gpmux: %d\n", ret); -+ goto err; -+ } -+ -+ ret = of_property_read_u32_index(np, "ti,pruss-gp-mux-sel", index, -+ &mux); -+ if (!ret) { -+ ret = pru_set_gpmux(pru, mux); -+ if (ret) { -+ dev_err(dev, "failed to set cfg gpmux: %d\n", ret); -+ goto err; -+ } -+ } -+ -+ ret = of_property_read_string_index(np, "firmware-name", index, -+ &fw_name); -+ if (!ret) { -+ ret = pru_rproc_set_firmware(rproc, fw_name); -+ if (ret) { -+ dev_err(dev, "failed to set firmware: %d\n", ret); -+ goto err; -+ } -+ } -+ -+ ret = pru_get_intc_dt_config(pru, "ti,pru-interrupt-map", -+ index, &pru->intc_config); -+ if (ret < 0) { -+ dev_err(dev, "error getting DT interrupt map: %d\n", ret); -+ goto err; -+ } -+ -+ pru->dt_irqs = ret; -+ -+ return rproc; -+ -+err: -+ pru_rproc_put(rproc); -+ return ERR_PTR(ret); -+} -+EXPORT_SYMBOL_GPL(pru_rproc_get); -+ -+/** -+ * pru_rproc_put() - release the PRU rproc resource -+ * @rproc: the rproc resource to release -+ * -+ * Releases the PRU rproc resource and makes it available to other -+ * users. -+ */ -+void pru_rproc_put(struct rproc *rproc) -+{ -+ struct pru_rproc *pru; -+ -+ if (IS_ERR_OR_NULL(rproc)) -+ return; -+ -+ /* TODO: replace the crude string based check to make sure it is PRU */ -+ if (!strstr(dev_name(rproc->dev.parent), "pru")) -+ return; -+ -+ pru = rproc->priv; -+ if (!pru->client_np) -+ return; -+ -+ pru_rproc_set_firmware(rproc, NULL); -+ pru_set_gpmux(pru, pru->gpmux_save); -+ -+ mutex_lock(&pru->lock); -+ pru->client_np = NULL; -+ mutex_unlock(&pru->lock); -+ -+ put_device(&rproc->dev); -+} -+EXPORT_SYMBOL_GPL(pru_rproc_put); -+ -+/* -+ * Control PRU single-step mode -+ * -+ * This is a debug helper function used for controlling the single-step -+ * mode of the PRU. The PRU Debug registers are not accessible when the -+ * PRU is in RUNNING state. -+ * -+ * Writing a non-zero value sets the PRU into single-step mode irrespective -+ * of its previous state. The PRU mode is saved only on the first set into -+ * a single-step mode. Writing a zero value will restore the PRU into its -+ * original mode. -+ */ -+static int pru_rproc_debug_ss_set(void *data, u64 val) -+{ -+ struct rproc *rproc = data; -+ struct pru_rproc *pru = rproc->priv; -+ u32 reg_val; -+ bool debug_ss; -+ -+ debug_ss = !!val; -+ if (!debug_ss && !pru->dbg_single_step) -+ return 0; -+ -+ regmap_read(pru->ctrl_regmap, PRU_CTRL_CTRL, ®_val); -+ -+ if (debug_ss && !pru->dbg_single_step) -+ pru->ctrl_saved_state = reg_val; -+ -+ if (debug_ss) -+ reg_val |= CTRL_CTRL_SINGLE_STEP | CTRL_CTRL_EN; -+ else -+ reg_val = pru->ctrl_saved_state; -+ -+ pru->dbg_single_step = debug_ss; -+ regmap_write(pru->ctrl_regmap, PRU_CTRL_CTRL, reg_val); -+ -+ return 0; -+} -+ -+static int pru_rproc_debug_ss_get(void *data, u64 *val) -+{ -+ struct rproc *rproc = data; -+ struct pru_rproc *pru = rproc->priv; -+ -+ *val = pru->dbg_single_step; -+ -+ return 0; -+} -+DEFINE_SIMPLE_ATTRIBUTE(pru_rproc_debug_ss_fops, pru_rproc_debug_ss_get, -+ pru_rproc_debug_ss_set, "%llu\n"); -+ -+/* -+ * Create PRU-specific debugfs entries -+ * -+ * The entries are created only if the parent remoteproc debugfs directory -+ * exists, and will be cleaned up by the remoteproc core. -+ */ -+static void pru_rproc_create_debug_entries(struct rproc *rproc) -+{ -+ if (!rproc->dbg_dir) -+ return; -+ -+ debugfs_create_file("single_step", 0600, rproc->dbg_dir, -+ rproc, &pru_rproc_debug_ss_fops); -+} -+ -+static void *pru_d_da_to_va(struct pru_rproc *pru, u32 da, int len); -+ -+/* -+ * parse the custom interrupt map resource and save the intc_config -+ * for use when booting the processor. -+ */ -+static int pru_handle_vendor_intrmap(struct rproc *rproc, -+ struct fw_rsc_pruss_intrmap *rsc) -+{ -+ int fw_irqs = 0, i, ret = 0; -+ u8 *arr; -+ struct device *dev = &rproc->dev; -+ struct pru_rproc *pru = rproc->priv; -+ -+ dev_dbg(dev, "vendor rsc intc: version %d\n", rsc->version); -+ -+ /* -+ * 0 was prototyping version. Not supported. -+ * 1 is currently supported version. -+ */ -+ if (rsc->version == 0 || rsc->version > 1) { -+ dev_err(dev, "Unsupported version %d\n", rsc->version); -+ return -EINVAL; -+ } -+ -+ /* DT provided INTC config takes precedence */ -+ if (pru->dt_irqs) { -+ dev_info(dev, "INTC config in DT and FW. Using DT config.\n"); -+ return 0; -+ } -+ -+ arr = rsc->data; -+ -+ for (i = 0; i < ARRAY_SIZE(pru->intc_config.sysev_to_ch); i++) -+ pru->intc_config.sysev_to_ch[i] = -1; -+ -+ for (i = 0; i < ARRAY_SIZE(pru->intc_config.ch_to_host); i++) -+ pru->intc_config.ch_to_host[i] = -1; -+ -+ for (i = 0; i < rsc->num_maps * 3; i += 3) { -+ if (arr[i] < 0 || -+ arr[i] >= MAX_PRU_SYS_EVENTS) { -+ dev_err(dev, "bad sys event %d\n", arr[i]); -+ ret = -EINVAL; -+ goto err; -+ } -+ -+ if (arr[i + 1] < 0 || -+ arr[i + 1] >= MAX_PRU_CHANNELS) { -+ dev_err(dev, "bad channel %d\n", arr[i + 1]); -+ ret = -EINVAL; -+ goto err; -+ } -+ -+ if (arr[i + 2] < 0 || -+ arr[i + 2] >= MAX_PRU_CHANNELS) { -+ dev_err(dev, "bad host irq %d\n", arr[i + 2]); -+ ret = -EINVAL; -+ goto err; -+ } -+ -+ pru->intc_config.sysev_to_ch[arr[i]] = arr[i + 1]; -+ dev_dbg(dev, "sysevt-to-ch[%d] -> %d\n", arr[i], -+ arr[i + 1]); -+ -+ pru->intc_config.ch_to_host[arr[i + 1]] = arr[i + 2]; -+ dev_dbg(dev, "chnl-to-host[%d] -> %d\n", arr[i + 1], -+ arr[i + 2]); -+ -+ fw_irqs++; -+ } -+ -+ pru->fw_irqs = fw_irqs; -+ return 0; -+ -+err: -+ pru->fw_irqs = 0; -+ return ret; -+} -+ -+/* PRU-specific vendor resource handler */ -+static int pru_rproc_handle_vendor_rsc(struct rproc *rproc, -+ struct fw_rsc_vendor *ven_rsc) -+{ -+ struct device *dev = rproc->dev.parent; -+ int ret = -EINVAL; -+ -+ struct fw_rsc_pruss_intrmap *rsc; -+ -+ rsc = (struct fw_rsc_pruss_intrmap *)ven_rsc->data; -+ -+ switch (rsc->type) { -+ case PRUSS_RSC_INTRS: -+ ret = pru_handle_vendor_intrmap(rproc, rsc); -+ break; -+ default: -+ dev_err(dev, "%s: cannot handle unknown type %d\n", __func__, -+ rsc->type); -+ } -+ -+ return ret; -+} -+ -+/* start a PRU core */ -+static int pru_rproc_start(struct rproc *rproc) -+{ -+ struct device *dev = &rproc->dev; -+ struct pru_rproc *pru = rproc->priv; -+ u32 val; -+ int ret; -+ -+ dev_dbg(dev, "starting PRU%d: entry-point = 0x%x\n", -+ pru->id, (rproc->bootaddr >> 2)); -+ -+ if (pru->dt_irqs || pru->fw_irqs) { -+ ret = pruss_intc_configure(rproc->dev.parent, -+ &pru->intc_config); -+ if (ret) { -+ dev_err(dev, "failed to configure intc %d\n", ret); -+ return ret; -+ } -+ } -+ -+ val = CTRL_CTRL_EN | ((rproc->bootaddr >> 2) << 16); -+ regmap_write(pru->ctrl_regmap, PRU_CTRL_CTRL, val); -+ -+ return 0; -+} -+ -+/* stop/disable a PRU core */ -+static int pru_rproc_stop(struct rproc *rproc) -+{ -+ struct device *dev = &rproc->dev; -+ struct pru_rproc *pru = rproc->priv; -+ -+ dev_dbg(dev, "stopping PRU%d\n", pru->id); -+ regmap_update_bits(pru->ctrl_regmap, PRU_CTRL_CTRL, CTRL_CTRL_EN, 0); -+ -+ /* undo INTC config */ -+ if (pru->dt_irqs || pru->fw_irqs) -+ pruss_intc_unconfigure(rproc->dev.parent, &pru->intc_config); -+ -+ return 0; -+} -+ -+/* -+ * Convert PRU device address (data spaces only) to kernel virtual address -+ * -+ * Each PRU has access to all data memories within the PRUSS, accessible at -+ * different ranges. So, look through both its primary and secondary Data -+ * RAMs as well as any shared Data RAM to convert a PRU device address to -+ * kernel virtual address. Data RAM0 is primary Data RAM for PRU0 and Data -+ * RAM1 is primary Data RAM for PRU1. -+ */ -+static void *pru_d_da_to_va(struct pru_rproc *pru, u32 da, int len) -+{ -+ struct pruss_mem_region dram0, dram1, shrd_ram; -+ u32 offset; -+ void *va = NULL; -+ -+ if (len <= 0) -+ return NULL; -+ -+ dram0 = pru->dram0; -+ dram1 = pru->dram1; -+ /* PRU1 has its local RAM addresses reversed */ -+ if (pru->id == 1) -+ swap(dram0, dram1); -+ shrd_ram = pru->shrdram; -+ -+ if (da >= pru->pdram_da && da + len <= pru->pdram_da + dram0.size) { -+ offset = da - pru->pdram_da; -+ va = (__force void *)(dram0.va + offset); -+ } else if (da >= pru->sdram_da && -+ da + len <= pru->sdram_da + dram1.size) { -+ offset = da - pru->sdram_da; -+ va = (__force void *)(dram1.va + offset); -+ } else if (da >= pru->shrdram_da && -+ da + len <= pru->shrdram_da + shrd_ram.size) { -+ offset = da - pru->shrdram_da; -+ va = (__force void *)(shrd_ram.va + offset); -+ } -+ -+ return va; -+} -+ -+/* -+ * Convert PRU device address (instruction space) to kernel virtual address -+ * -+ * A PRU does not have an unified address space. Each PRU has its very own -+ * private Instruction RAM, and its device address is identical to that of -+ * its primary Data RAM device address. -+ */ -+static void *pru_i_da_to_va(struct pru_rproc *pru, u32 da, int len) -+{ -+ u32 offset; -+ void *va = NULL; -+ -+ if (len <= 0) -+ return NULL; -+ -+ if (da >= pru->iram_da && -+ da + len <= pru->iram_da + pru->iram_region.size) { -+ offset = da - pru->iram_da; -+ va = (__force void *)(pru->iram_region.va + offset); -+ } -+ -+ return va; -+} -+ -+/* PRU-specific address translator */ -+static void *pru_da_to_va(struct rproc *rproc, u64 da, int len, int map) -+{ -+ struct pru_rproc *pru = rproc->priv; -+ void *va; -+ -+ switch (map) { -+ case PRU_PAGE_IRAM: -+ va = pru_i_da_to_va(pru, da, len); -+ break; -+ case PRU_PAGE_DRAM: -+ va = pru_d_da_to_va(pru, da, len); -+ break; -+ default: -+ dev_info(&rproc->dev, "%s: invalid page %d\n", __func__, map); -+ return 0; -+ }; -+ -+ return va; -+} -+ -+static struct rproc_ops pru_rproc_ops = { -+ .start = pru_rproc_start, -+ .stop = pru_rproc_stop, -+ .da_to_va = pru_da_to_va, -+ .handle_vendor_rsc = pru_rproc_handle_vendor_rsc, -+}; -+ -+static int pru_rproc_set_id(struct pru_rproc *pru) -+{ -+ int ret = 0; -+ u32 iram_start = pru->iram_region.pa & PRU_IRAM_MASK; -+ -+ if (iram_start == PRU0_IRAM_START) -+ pru->id = 0; -+ else if (iram_start == PRU1_IRAM_START) -+ pru->id = 1; -+ else -+ ret = -EINVAL; -+ -+ return ret; -+} -+ -+static struct regmap_config pru_ctrl_regmap_config = { -+ .name = "ctrl", -+ .reg_bits = 32, -+ .reg_stride = 4, -+ .val_bits = 32, -+ .max_register = PRU_CTRL_CTPPR1, -+}; -+ -+static struct regmap_config pru_debug_regmap_config = { -+ .name = "debug", -+ .reg_bits = 32, -+ .reg_stride = 4, -+ .val_bits = 32, -+ .max_register = PRU_DEBUG_CT_REG(31), -+}; -+ -+static int pru_rproc_probe(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct device_node *np = dev->of_node; -+ struct platform_device *ppdev = to_platform_device(dev->parent); -+ struct pru_rproc *pru; -+ const char *fw_name; -+ struct rproc *rproc = NULL; -+ struct resource *res; -+ int ret; -+ void __iomem *va; -+ -+ if (!np) { -+ dev_err(dev, "Non-DT platform device not supported\n"); -+ return -ENODEV; -+ } -+ -+ ret = of_property_read_string(np, "firmware-name", &fw_name); -+ if (ret) { -+ dev_err(dev, "unable to retrieve firmware-name %d\n", ret); -+ return ret; -+ } -+ -+ rproc = rproc_alloc(dev, pdev->name, &pru_rproc_ops, fw_name, -+ sizeof(*pru)); -+ if (!rproc) { -+ dev_err(dev, "rproc_alloc failed\n"); -+ return -ENOMEM; -+ } -+ -+ pru = rproc->priv; -+ pru->cfg = syscon_regmap_lookup_by_phandle(np, "gpcfg"); -+ if (IS_ERR(pru->cfg)) { -+ if (PTR_ERR(pru->cfg) != -EPROBE_DEFER) -+ dev_err(dev, "can't get gpcfg syscon regmap\n"); -+ -+ return PTR_ERR(pru->cfg); -+ } -+ -+ if (of_property_read_u32_index(np, "gpcfg", 1, &pru->gpcfg_reg)) { -+ dev_err(dev, "couldn't get gpcfg reg. offset\n"); -+ return -EINVAL; -+ } -+ -+ /* error recovery is not supported for PRUs */ -+ rproc->recovery_disabled = true; -+ -+ /* -+ * rproc_add will auto-boot the processor normally, but this is -+ * not desired with PRU client driven boot-flow methodology. A PRU -+ * application/client driver will boot the corresponding PRU -+ * remote-processor as part of its state machine either through -+ * the remoteproc sysfs interface or through the equivalent kernel API -+ */ -+ rproc->auto_boot = false; -+ -+ pru->pruss = platform_get_drvdata(ppdev); -+ pru->rproc = rproc; -+ pru->fw_name = fw_name; -+ mutex_init(&pru->lock); -+ -+ ret = pruss_request_mem_region(pru->pruss, PRUSS_MEM_DRAM0, -+ &pru->dram0); -+ if (ret) { -+ dev_err(dev, "couldn't get PRUSS DRAM0: %d\n", ret); -+ return ret; -+ } -+ pruss_release_mem_region(pru->pruss, &pru->dram0); -+ -+ ret = pruss_request_mem_region(pru->pruss, PRUSS_MEM_DRAM1, -+ &pru->dram1); -+ if (ret) { -+ dev_err(dev, "couldn't get PRUSS DRAM1: %d\n", ret); -+ return ret; -+ } -+ pruss_release_mem_region(pru->pruss, &pru->dram1); -+ -+ ret = pruss_request_mem_region(pru->pruss, PRUSS_MEM_SHRD_RAM2, -+ &pru->shrdram); -+ if (ret) { -+ dev_err(dev, "couldn't get PRUSS Shared RAM: %d\n", ret); -+ return ret; -+ } -+ pruss_release_mem_region(pru->pruss, &pru->shrdram); -+ -+ /* XXX: get this from match data if different in the future */ -+ pru->iram_da = 0; -+ pru->pdram_da = 0; -+ pru->sdram_da = 0x2000; -+ pru->shrdram_da = 0x10000; -+ -+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "iram"); -+ pru->iram_region.va = devm_ioremap_resource(dev, res); -+ if (IS_ERR(pru->iram_region.va)) { -+ ret = PTR_ERR(pru->iram_region.va); -+ dev_err(dev, "failed to get iram resource: %d\n", ret); -+ goto free_rproc; -+ } -+ -+ pru->iram_region.pa = res->start; -+ pru->iram_region.size = resource_size(res); -+ -+ dev_dbg(dev, "iram: pa %pa size 0x%zx va %p\n", -+ &pru->iram_region.pa, pru->iram_region.size, -+ pru->iram_region.va); -+ -+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control"); -+ va = devm_ioremap_resource(dev, res); -+ if (IS_ERR(va)) { -+ ret = PTR_ERR(va); -+ dev_err(dev, "failed to get control resource: %d\n", ret); -+ goto free_rproc; -+ } -+ -+ pru->ctrl_regmap = devm_regmap_init_mmio(dev, va, -+ &pru_ctrl_regmap_config); -+ if (IS_ERR(pru->ctrl_regmap)) { -+ ret = PTR_ERR(pru->ctrl_regmap); -+ dev_err(dev, "CTRL regmap init failed: %d\n", ret); -+ goto free_rproc; -+ } -+ -+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "debug"); -+ va = devm_ioremap_resource(dev, res); -+ if (IS_ERR(va)) { -+ ret = PTR_ERR(va); -+ dev_err(dev, "failed to get debug resource: %d\n", ret); -+ goto free_rproc; -+ } -+ pru->debug_regmap = devm_regmap_init_mmio(dev, va, -+ &pru_debug_regmap_config); -+ if (IS_ERR(pru->debug_regmap)) { -+ ret = PTR_ERR(pru->debug_regmap); -+ dev_err(dev, "DEBUG regmap init failed: %d\n", ret); -+ goto free_rproc; -+ } -+ -+ ret = pru_rproc_set_id(pru); -+ if (ret < 0) -+ goto free_rproc; -+ -+ platform_set_drvdata(pdev, rproc); -+ -+ ret = rproc_add(pru->rproc); -+ if (ret) { -+ dev_err(dev, "rproc_add failed: %d\n", ret); -+ goto free_rproc; -+ } -+ -+ pru_rproc_create_debug_entries(rproc); -+ -+ dev_info(dev, "PRU rproc node %s probed successfully\n", np->full_name); -+ -+ return 0; -+ -+free_rproc: -+ rproc_free(rproc); -+ return ret; -+} -+ -+static int pru_rproc_remove(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct rproc *rproc = platform_get_drvdata(pdev); -+ -+ dev_info(dev, "%s: removing rproc %s\n", __func__, rproc->name); -+ -+ rproc_del(rproc); -+ rproc_free(rproc); -+ -+ return 0; -+} -+ -+static const struct of_device_id pru_rproc_match[] = { -+ { .compatible = "ti,am3356-pru", }, -+ { .compatible = "ti,am4376-pru", }, -+ { .compatible = "ti,am5728-pru", }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, pru_rproc_match); -+ -+static struct platform_driver pru_rproc_driver = { -+ .driver = { -+ .name = "pru-rproc", -+ .of_match_table = pru_rproc_match, -+ .suppress_bind_attrs = true, -+ }, -+ .probe = pru_rproc_probe, -+ .remove = pru_rproc_remove, -+}; -+module_platform_driver(pru_rproc_driver); -+ -+MODULE_AUTHOR("Suman Anna <s-anna@ti.com>"); -+MODULE_DESCRIPTION("PRU-ICSS Remote Processor Driver"); -+MODULE_LICENSE("GPL v2"); -diff --git a/drivers/remoteproc/pru_rproc.h b/drivers/remoteproc/pru_rproc.h -new file mode 100644 -index 000000000000..bbcf3921d36e ---- /dev/null -+++ b/drivers/remoteproc/pru_rproc.h -@@ -0,0 +1,54 @@ -+/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ -+/* -+ * PRUSS Remote Processor specific types -+ * -+ * Copyright (C) 2014-2019 Texas Instruments Incorporated - http://www.ti.com/ -+ * All rights reserved. -+ */ -+ -+#ifndef _PRU_REMOTEPROC_H_ -+#define _PRU_REMOTEPROC_H_ -+ -+/** -+ * enum pruss_rsc_types - PRU specific resource types -+ * -+ * @PRUSS_RSC_INTRS: Resource holding information on PRU PINTC configuration -+ * @PRUSS_RSC_MAX: Indicates end of known/defined PRU resource types. -+ * This should be the last definition. -+ * -+ * Introduce new custom resource types before PRUSS_RSC_MAX. -+ */ -+enum pruss_rsc_types { -+ PRUSS_RSC_INTRS = 1, -+ PRUSS_RSC_MAX = 2, -+}; -+ -+/** -+ * struct fw_rsc_pruss_intrmap - vendor resource to define PRU interrupts -+ * @type: should be PRUSS_RSC_INTRS -+ * @version: should be 1 or greater. 0 was for prototyping and is not supported -+ * @num_maps: number of interrupt mappings that follow -+ * @data: Array of 'num_maps' mappings. -+ * Each mapping is a triplet {s, c, h} -+ * s - system event id -+ * c - channel id -+ * h - host interrupt id -+ * -+ * PRU system events are mapped to channels, and these channels are mapped -+ * to host interrupts. Events can be mapped to channels in a one-to-one or -+ * many-to-one ratio (multiple events per channel), and channels can be -+ * mapped to host interrupts in a one-to-one or many-to-one ratio (multiple -+ * channels per interrupt). -+ * -+ * This resource is variable length due to the nature of INTC map. -+ * The below data structure is scalable so it can support sufficiently -+ * large number of sysevents and hosts. -+ */ -+struct fw_rsc_pruss_intrmap { -+ u16 type; -+ u16 version; -+ u8 num_maps; -+ u8 data[]; -+} __packed; -+ -+#endif /* _PRU_REMOTEPROC_H_ */ -diff --git a/include/linux/remoteproc/pru_rproc.h b/include/linux/remoteproc/pru_rproc.h -new file mode 100644 -index 000000000000..841da09c20c6 ---- /dev/null -+++ b/include/linux/remoteproc/pru_rproc.h -@@ -0,0 +1,27 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/** -+ * PRU-ICSS Remote Subsystem user interfaces -+ * -+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com -+ */ -+ -+#ifndef __LINUX_REMOTEPROC_PRU_RPROC_H -+#define __LINUX_REMOTEPROC_PRU_RPROC_H -+ -+#if IS_ENABLED(CONFIG_PRUSS_REMOTEPROC) -+ -+struct rproc *pru_rproc_get(struct device_node *node, int index); -+void pru_rproc_put(struct rproc *rproc); -+ -+#else -+ -+static inline struct rproc *pru_rproc_get(struct device_node *node, int index) -+{ -+ return ERR_PTR(-ENOTSUPP); -+} -+ -+static inline void pru_rproc_put(struct rproc *rproc) { } -+ -+#endif /* CONFIG_PRUSS_REMOTEPROC */ -+ -+#endif /* __LINUX_REMOTEPROC_PRU_RPROC_H */ --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0011-remoteproc-pru-Add-pru_rproc_set_ctable-and-pru_rpro.patch b/patches/drivers/ti/rogerq_pruss/0011-remoteproc-pru-Add-pru_rproc_set_ctable-and-pru_rpro.patch deleted file mode 100644 index 4feecdd8f..000000000 --- a/patches/drivers/ti/rogerq_pruss/0011-remoteproc-pru-Add-pru_rproc_set_ctable-and-pru_rpro.patch +++ /dev/null @@ -1,155 +0,0 @@ -From 65f513c540608bffd4e2f393ac47448903a103b3 Mon Sep 17 00:00:00 2001 -From: Roger Quadros <rogerq@ti.com> -Date: Thu, 9 Feb 2017 12:13:21 -0600 -Subject: [PATCH 11/25] remoteproc/pru: Add pru_rproc_set_ctable() and - pru_rproc_set_gpimode() - -Some firmwares expect the OS drivers to configure the CTABLE -entries publishing dynamically allocated memory regions. For -example, the PRU Ethernet firmwares use the C28 and C30 entries -for retrieving the Shared RAM and System SRAM (OCMC) areas -allocated by the PRU Ethernet client driver. - -Provide a way for users to do that through a new API, -pru_rproc_set_ctable(). The API returns 0 on success and -a negative value on error. - -NOTE: -The programmable CTABLE entries are typically re-programmed by -the PRU firmwares when dealing with a certain block of memory -during block processing. This API provides an interface to the -PRU client drivers to publish a dynamically allocated memory -block with the PRU firmware using a CTABLE entry instead of a -negotiated address in shared memory. Additional synchronization -may be needed between the PRU client drivers and firmwares if -different addresses needs to be published at run-time reusing -the same CTABLE entry. - -Some client drivers need to set the GPI mode of the -PRU. The GPI mode select bits like in the GPCFG register -space. Add pru_rproc_set_gpimode() API to set the GPI -mode for the PRU. - -Signed-off-by: Roger Quadros <rogerq@ti.com> -Signed-off-by: Andrew F. Davis <afd@ti.com> -[s-anna@ti.com: add the NOTE: on patch description, minor cleanups] -Signed-off-by: Suman Anna <s-anna@ti.com> ---- - drivers/remoteproc/pru_rproc.c | 48 ++++++++++++++++++++++++++++ - include/linux/remoteproc/pru_rproc.h | 30 +++++++++++++++++ - 2 files changed, 78 insertions(+) - -diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c -index ddd4b64aaf9b..85463f7bd430 100644 ---- a/drivers/remoteproc/pru_rproc.c -+++ b/drivers/remoteproc/pru_rproc.c -@@ -398,6 +398,54 @@ void pru_rproc_put(struct rproc *rproc) - } - EXPORT_SYMBOL_GPL(pru_rproc_put); - -+/** -+ * pru_rproc_set_ctable() - set the constant table index for the PRU -+ * @rproc: the rproc instance of the PRU -+ * @c: constant table index to set -+ * @addr: physical address to set it to -+ */ -+int pru_rproc_set_ctable(struct rproc *rproc, enum pru_ctable_idx c, u32 addr) -+{ -+ struct pru_rproc *pru = rproc->priv; -+ unsigned int reg; -+ u32 mask, set; -+ u16 idx; -+ u16 idx_mask; -+ -+ /* pointer is 16 bit and index is 8-bit so mask out the rest */ -+ idx_mask = (c >= PRU_C28) ? 0xFFFF : 0xFF; -+ -+ /* ctable uses bit 8 and upwards only */ -+ idx = (addr >> 8) & idx_mask; -+ -+ /* configurable ctable (i.e. C24) starts at PRU_CTRL_CTBIR0 */ -+ reg = PRU_CTRL_CTBIR0 + 4 * (c >> 1); -+ mask = idx_mask << (16 * (c & 1)); -+ set = idx << (16 * (c & 1)); -+ -+ regmap_update_bits(pru->ctrl_regmap, reg, mask, set); -+ -+ return 0; -+} -+EXPORT_SYMBOL_GPL(pru_rproc_set_ctable); -+ -+/** -+ * pru_rproc_set_gpimode() - set the GPI mode for the PRU -+ * @rproc: the rproc instance of the PRU -+ * @mode: GPI mode to set -+ * -+ * Returns 0 on success, negative error value otherwise. -+ */ -+int pru_rproc_set_gpimode(struct rproc *rproc, enum pruss_gpi_mode mode) -+{ -+ struct pru_rproc *pru = rproc->priv; -+ -+ return regmap_update_bits(pru->cfg, pru->gpcfg_reg, -+ PRUSS_GPCFG_PRU_GPI_MODE_MASK, -+ mode << PRUSS_GPCFG_PRU_GPI_MODE_SHIFT); -+} -+EXPORT_SYMBOL_GPL(pru_rproc_set_gpimode); -+ - /* - * Control PRU single-step mode - * -diff --git a/include/linux/remoteproc/pru_rproc.h b/include/linux/remoteproc/pru_rproc.h -index 841da09c20c6..887d99624ae0 100644 ---- a/include/linux/remoteproc/pru_rproc.h -+++ b/include/linux/remoteproc/pru_rproc.h -@@ -8,10 +8,28 @@ - #ifndef __LINUX_REMOTEPROC_PRU_RPROC_H - #define __LINUX_REMOTEPROC_PRU_RPROC_H - -+/** -+ * enum pru_ctable_idx - Configurable Constant table index identifiers -+ */ -+enum pru_ctable_idx { -+ PRU_C24 = 0, -+ PRU_C25, -+ PRU_C26, -+ PRU_C27, -+ PRU_C28, -+ PRU_C29, -+ PRU_C30, -+ PRU_C31, -+}; -+ -+enum pruss_gpi_mode; -+ - #if IS_ENABLED(CONFIG_PRUSS_REMOTEPROC) - - struct rproc *pru_rproc_get(struct device_node *node, int index); - void pru_rproc_put(struct rproc *rproc); -+int pru_rproc_set_ctable(struct rproc *rproc, enum pru_ctable_idx c, u32 addr); -+int pru_rproc_set_gpimode(struct rproc *rproc, enum pruss_gpi_mode mode); - - #else - -@@ -22,6 +40,18 @@ static inline struct rproc *pru_rproc_get(struct device_node *node, int index) - - static inline void pru_rproc_put(struct rproc *rproc) { } - -+static inline int pru_rproc_set_ctable(struct rproc *rproc, -+ enum pru_ctable_idx c, u32 addr) -+{ -+ return -ENOTSUPP; -+} -+ -+static inline int pru_rproc_set_gpimode(struct rproc *rproc, -+ enum pruss_gpi_mode mode) -+{ -+ return -ENOTSUPP; -+} -+ - #endif /* CONFIG_PRUSS_REMOTEPROC */ - - #endif /* __LINUX_REMOTEPROC_PRU_RPROC_H */ --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0012-remoteproc-pru-Add-support-for-virtio-rpmsg-stack.patch b/patches/drivers/ti/rogerq_pruss/0012-remoteproc-pru-Add-support-for-virtio-rpmsg-stack.patch deleted file mode 100644 index 2ad8e1581..000000000 --- a/patches/drivers/ti/rogerq_pruss/0012-remoteproc-pru-Add-support-for-virtio-rpmsg-stack.patch +++ /dev/null @@ -1,306 +0,0 @@ -From 511090af4a64f1063fff7bf4b9c7570f3038b918 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Wed, 31 Jan 2018 14:29:57 -0600 -Subject: [PATCH 12/25] remoteproc/pru: Add support for virtio rpmsg stack - -The PRU remoteproc driver has been enhanced to support the optional -rpmsg stack using the virtio-ring based communication transport -between MPU and a PRU core. This provides support to any firmware -images supporting the virtio devices. - -The virtio-ring signalling support is provided either through a OMAP -mailbox or through two PRU system events on OMAP-architecture based -SoCs - one event used in each direction for kicking from one processor -and receiving notification on the other processor. The virtio rpmsg -signalling is enabled only using using PRU system events for interrupts -on the Keystone-architecture based 66AK2G SoCs (it is possible to -implement using an alternate Keystone specific IPCGR registers as well). -The driver supports both signalling options, though the PRU events based -signalling is the recommended option as it avoids an external peripheral -access from the PRU side. It also provides a uniform solution across -both the OMAP, Keystone and Davinci architectures. The PRU events based -signalling takes precedence if both options are mentioned. Either of the -options would require the corresponding firmware support though. A build -dependency against MAILBOX is also added. Note that the OMAP Mailbox -IP is not present on 66AK2G and Davinci SoCs, so it is only selected -for OMAP-based SoCs. - -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/remoteproc/Kconfig | 2 + - drivers/remoteproc/pru_rproc.c | 165 ++++++++++++++++++++++++++++++++- - 2 files changed, 166 insertions(+), 1 deletion(-) - -diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig -index 333666ef91a3..b89acb0cc5a4 100644 ---- a/drivers/remoteproc/Kconfig -+++ b/drivers/remoteproc/Kconfig -@@ -200,6 +200,8 @@ config ST_SLIM_REMOTEPROC - config PRUSS_REMOTEPROC - tristate "TI PRUSS remoteproc support" - depends on TI_PRUSS -+ select MAILBOX -+ select OMAP2PLUS_MBOX if ARCH_OMAP2PLUS - default n - help - Support for TI PRU-ICSS remote processors via the remote processor -diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c -index 85463f7bd430..b47c4fdb7e21 100644 ---- a/drivers/remoteproc/pru_rproc.c -+++ b/drivers/remoteproc/pru_rproc.c -@@ -11,6 +11,7 @@ - #include <linux/debugfs.h> - #include <linux/interrupt.h> - #include <linux/irqchip/irq-pruss-intc.h> -+#include <linux/mailbox_client.h> - #include <linux/mfd/syscon.h> - #include <linux/module.h> - #include <linux/of_device.h> -@@ -64,6 +65,10 @@ - * @debug_regmap: regmap to PRU DEBUG IOMEM - * @client_np: client device node - * @intc_config: PRU INTC configuration data -+ * @mbox: mailbox channel handle used for vring signalling with MPU -+ * @client: mailbox client to request the mailbox channel -+ * @irq_ring: IRQ number to use for processing vring buffers -+ * @irq_kick: IRQ number to use to perform virtio kick - * @dram0: PRUSS DRAM0 region - * @dram1: PRUSS DRAM1 region - * @shrdram: PRUSS SHARED RAM region -@@ -90,6 +95,10 @@ struct pru_rproc { - struct regmap *debug_regmap; - struct device_node *client_np; - struct pruss_intc_config intc_config; -+ struct mbox_chan *mbox; -+ struct mbox_client client; -+ int irq_vring; -+ int irq_kick; - struct pruss_mem_region dram0; - struct pruss_mem_region dram1; - struct pruss_mem_region shrdram; -@@ -615,6 +624,82 @@ static int pru_rproc_handle_vendor_rsc(struct rproc *rproc, - return ret; - } - -+/** -+ * pru_rproc_mbox_callback() - inbound mailbox message handler -+ * @client: mailbox client pointer used for requesting the mailbox channel -+ * @data: mailbox payload -+ * -+ * This handler is invoked by omap's mailbox driver whenever a mailbox -+ * message is received. Usually, the mailbox payload simply contains -+ * the index of the virtqueue that is kicked by the PRU remote processor, -+ * and we let remoteproc core handle it. -+ * -+ * In addition to virtqueue indices, we might also have some out-of-band -+ * values that indicates different events. Those values are deliberately -+ * very big so they don't coincide with virtqueue indices. -+ */ -+static void pru_rproc_mbox_callback(struct mbox_client *client, void *data) -+{ -+ struct pru_rproc *pru = container_of(client, struct pru_rproc, client); -+ struct device *dev = &pru->rproc->dev; -+ u32 msg = (u32)data; -+ -+ dev_dbg(dev, "mbox msg: 0x%x\n", msg); -+ -+ /* msg contains the index of the triggered vring */ -+ if (rproc_vq_interrupt(pru->rproc, msg) == IRQ_NONE) -+ dev_dbg(dev, "no message was found in vqid %d\n", msg); -+} -+ -+/** -+ * pru_rproc_vring_interrupt() - interrupt handler for processing vrings -+ * @irq: irq number associated with the PRU event MPU is listening on -+ * @data: interrupt handler data, will be a PRU rproc structure -+ * -+ * This handler is used by the PRU remoteproc driver when using PRU system -+ * events for processing the virtqueues. Unlike the mailbox IP, there is -+ * no payload associated with an interrupt, so either a unique event is -+ * used for each virtqueue kick, or a both virtqueues are processed on -+ * a single event. The latter is chosen to conserve the usable PRU system -+ * events. -+ */ -+static irqreturn_t pru_rproc_vring_interrupt(int irq, void *data) -+{ -+ struct pru_rproc *pru = data; -+ -+ dev_dbg(&pru->rproc->dev, "got vring irq\n"); -+ -+ /* process incoming buffers on both the Rx and Tx vrings */ -+ rproc_vq_interrupt(pru->rproc, 0); -+ rproc_vq_interrupt(pru->rproc, 1); -+ -+ return IRQ_HANDLED; -+} -+ -+/* kick a virtqueue */ -+static void pru_rproc_kick(struct rproc *rproc, int vq_id) -+{ -+ struct device *dev = &rproc->dev; -+ struct pru_rproc *pru = rproc->priv; -+ int ret; -+ -+ dev_dbg(dev, "kicking vqid %d on PRU%d\n", vq_id, pru->id); -+ -+ if (pru->irq_kick > 0) { -+ ret = pruss_intc_trigger(pru->irq_kick); -+ if (ret < 0) -+ dev_err(dev, "pruss_intc_trigger failed: %d\n", ret); -+ } else if (pru->mbox) { -+ /* -+ * send the index of the triggered virtqueue in the mailbox -+ * payload -+ */ -+ ret = mbox_send_message(pru->mbox, (void *)vq_id); -+ if (ret < 0) -+ dev_err(dev, "mbox_send_message failed: %d\n", ret); -+ } -+} -+ - /* start a PRU core */ - static int pru_rproc_start(struct rproc *rproc) - { -@@ -635,10 +720,36 @@ static int pru_rproc_start(struct rproc *rproc) - } - } - -+ if (!list_empty(&pru->rproc->rvdevs)) { -+ if (!pru->mbox && (pru->irq_vring <= 0 || pru->irq_kick <= 0)) { -+ dev_err(dev, "virtio vring interrupt mechanisms are not provided\n"); -+ ret = -EINVAL; -+ goto fail; -+ } -+ -+ if (!pru->mbox && pru->irq_vring > 0) { -+ ret = request_threaded_irq(pru->irq_vring, NULL, -+ pru_rproc_vring_interrupt, -+ IRQF_ONESHOT, dev_name(dev), -+ pru); -+ if (ret) { -+ dev_err(dev, "failed to enable vring interrupt, ret = %d\n", -+ ret); -+ goto fail; -+ } -+ } -+ } -+ - val = CTRL_CTRL_EN | ((rproc->bootaddr >> 2) << 16); - regmap_write(pru->ctrl_regmap, PRU_CTRL_CTRL, val); - - return 0; -+ -+fail: -+ if (pru->dt_irqs || pru->fw_irqs) -+ pruss_intc_unconfigure(rproc->dev.parent, &pru->intc_config); -+ -+ return ret; - } - - /* stop/disable a PRU core */ -@@ -650,6 +761,10 @@ static int pru_rproc_stop(struct rproc *rproc) - dev_dbg(dev, "stopping PRU%d\n", pru->id); - regmap_update_bits(pru->ctrl_regmap, PRU_CTRL_CTRL, CTRL_CTRL_EN, 0); - -+ if (!list_empty(&pru->rproc->rvdevs) && -+ !pru->mbox && pru->irq_vring > 0) -+ free_irq(pru->irq_vring, pru); -+ - /* undo INTC config */ - if (pru->dt_irqs || pru->fw_irqs) - pruss_intc_unconfigure(rproc->dev.parent, &pru->intc_config); -@@ -746,6 +861,7 @@ static void *pru_da_to_va(struct rproc *rproc, u64 da, int len, int map) - static struct rproc_ops pru_rproc_ops = { - .start = pru_rproc_start, - .stop = pru_rproc_stop, -+ .kick = pru_rproc_kick, - .da_to_va = pru_da_to_va, - .handle_vendor_rsc = pru_rproc_handle_vendor_rsc, - }; -@@ -789,6 +905,7 @@ static int pru_rproc_probe(struct platform_device *pdev) - struct pru_rproc *pru; - const char *fw_name; - struct rproc *rproc = NULL; -+ struct mbox_client *client; - struct resource *res; - int ret; - void __iomem *va; -@@ -924,10 +1041,51 @@ static int pru_rproc_probe(struct platform_device *pdev) - - platform_set_drvdata(pdev, rproc); - -+ /* get optional vring and kick interrupts for supporting virtio rpmsg */ -+ pru->irq_vring = platform_get_irq_byname(pdev, "vring"); -+ if (pru->irq_vring <= 0) { -+ ret = pru->irq_vring; -+ if (ret == -EPROBE_DEFER) -+ goto free_rproc; -+ dev_dbg(dev, "unable to get vring interrupt, status = %d\n", -+ ret); -+ } -+ -+ pru->irq_kick = platform_get_irq_byname(pdev, "kick"); -+ if (pru->irq_kick <= 0) { -+ ret = pru->irq_kick; -+ if (ret == -EPROBE_DEFER) -+ goto free_rproc; -+ dev_dbg(dev, "unable to get kick interrupt, status = %d\n", -+ ret); -+ } -+ -+ /* -+ * get optional mailbox for virtio rpmsg signalling if vring and kick -+ * interrupts are not specified for OMAP architecture based SoCs -+ */ -+ if (pru->irq_vring <= 0 && pru->irq_kick <= 0 && -+ !of_device_is_compatible(np, "ti,k2g-pru") && -+ !of_device_is_compatible(np, "ti,da850-pru")) { -+ client = &pru->client; -+ client->dev = dev; -+ client->tx_done = NULL; -+ client->rx_callback = pru_rproc_mbox_callback; -+ client->tx_block = false; -+ client->knows_txdone = false; -+ pru->mbox = mbox_request_channel(client, 0); -+ if (IS_ERR(pru->mbox)) { -+ ret = PTR_ERR(pru->mbox); -+ pru->mbox = NULL; -+ dev_dbg(dev, "unable to get mailbox channel, status = %d\n", -+ ret); -+ } -+ } -+ - ret = rproc_add(pru->rproc); - if (ret) { - dev_err(dev, "rproc_add failed: %d\n", ret); -- goto free_rproc; -+ goto put_mbox; - } - - pru_rproc_create_debug_entries(rproc); -@@ -936,6 +1094,8 @@ static int pru_rproc_probe(struct platform_device *pdev) - - return 0; - -+put_mbox: -+ mbox_free_channel(pru->mbox); - free_rproc: - rproc_free(rproc); - return ret; -@@ -945,9 +1105,12 @@ static int pru_rproc_remove(struct platform_device *pdev) - { - struct device *dev = &pdev->dev; - struct rproc *rproc = platform_get_drvdata(pdev); -+ struct pru_rproc *pru = rproc->priv; - - dev_info(dev, "%s: removing rproc %s\n", __func__, rproc->name); - -+ mbox_free_channel(pru->mbox); -+ - rproc_del(rproc); - rproc_free(rproc); - --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0013-rpmsg-virtio_rpmsg_bus-move-back-rpmsg_hdr-into-a-pu.patch b/patches/drivers/ti/rogerq_pruss/0013-rpmsg-virtio_rpmsg_bus-move-back-rpmsg_hdr-into-a-pu.patch deleted file mode 100644 index c93f68059..000000000 --- a/patches/drivers/ti/rogerq_pruss/0013-rpmsg-virtio_rpmsg_bus-move-back-rpmsg_hdr-into-a-pu.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 8243b3c02280c3bfb64a86fc99631bdb87feaa80 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Tue, 9 Jan 2018 12:45:04 -0600 -Subject: [PATCH 13/25] rpmsg: virtio_rpmsg_bus: move back rpmsg_hdr into a - public header - -Commit e88dae5da46d ("rpmsg: Move virtio specifics from public header") -has moved the struct rpmsg_hdr definition from the public rpmsg.h and -made it private to virtio_rpmsg_bus module. This structure is a common -header used in all virtio rpmsg messages, and used by various virtio -rpmsg bus drivers. So, move this back into the virtio_rpmsg specific -public header to make it visible to various rpmsg drivers. - -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/rpmsg/virtio_rpmsg_bus.c | 21 +-------------------- - include/linux/rpmsg/virtio_rpmsg.h | 26 ++++++++++++++++++++++++++ - 2 files changed, 27 insertions(+), 20 deletions(-) - create mode 100644 include/linux/rpmsg/virtio_rpmsg.h - -diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c -index 664f957012cd..f654923c027c 100644 ---- a/drivers/rpmsg/virtio_rpmsg_bus.c -+++ b/drivers/rpmsg/virtio_rpmsg_bus.c -@@ -26,6 +26,7 @@ - #include <linux/rpmsg.h> - #include <linux/mutex.h> - #include <linux/of_device.h> -+#include <linux/rpmsg/virtio_rpmsg.h> - - #include "rpmsg_internal.h" - -@@ -72,26 +73,6 @@ struct virtproc_info { - /* The feature bitmap for virtio rpmsg */ - #define VIRTIO_RPMSG_F_NS 0 /* RP supports name service notifications */ - --/** -- * struct rpmsg_hdr - common header for all rpmsg messages -- * @src: source address -- * @dst: destination address -- * @reserved: reserved for future use -- * @len: length of payload (in bytes) -- * @flags: message flags -- * @data: @len bytes of message payload data -- * -- * Every message sent(/received) on the rpmsg bus begins with this header. -- */ --struct rpmsg_hdr { -- u32 src; -- u32 dst; -- u32 reserved; -- u16 len; -- u16 flags; -- u8 data[0]; --} __packed; -- - /** - * struct rpmsg_ns_msg - dynamic name service announcement message - * @name: name of remote service that is published -diff --git a/include/linux/rpmsg/virtio_rpmsg.h b/include/linux/rpmsg/virtio_rpmsg.h -new file mode 100644 -index 000000000000..cf5f82032d95 ---- /dev/null -+++ b/include/linux/rpmsg/virtio_rpmsg.h -@@ -0,0 +1,26 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+ -+#ifndef _LINUX_RPMSG_VIRTIO_RPMSG_H -+#define _LINUX_RPMSG_VIRTIO_RPMSG_H -+ -+/** -+ * struct rpmsg_hdr - common header for all virtio rpmsg messages -+ * @src: source address -+ * @dst: destination address -+ * @reserved: reserved for future use -+ * @len: length of payload (in bytes) -+ * @flags: message flags -+ * @data: @len bytes of message payload data -+ * -+ * Every message sent(/received) on the rpmsg bus begins with this header. -+ */ -+struct rpmsg_hdr { -+ u32 src; -+ u32 dst; -+ u32 reserved; -+ u16 len; -+ u16 flags; -+ u8 data[0]; -+} __packed; -+ -+#endif --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0014-rpmsg-pru-add-a-PRU-RPMsg-driver.patch b/patches/drivers/ti/rogerq_pruss/0014-rpmsg-pru-add-a-PRU-RPMsg-driver.patch deleted file mode 100644 index 22fa12db2..000000000 --- a/patches/drivers/ti/rogerq_pruss/0014-rpmsg-pru-add-a-PRU-RPMsg-driver.patch +++ /dev/null @@ -1,425 +0,0 @@ -From 487d5c26f10a4b397b72ce3f6ab6c4eafd645267 Mon Sep 17 00:00:00 2001 -From: Jason Reeder <jreeder@ti.com> -Date: Thu, 2 Feb 2017 20:48:57 -0600 -Subject: [PATCH 14/25] rpmsg: pru: add a PRU RPMsg driver - -An RPMsg driver that exposes interfaces to user space, to -allow applications to communicate with the PRU processors -on available TI SoCs has been added. This is restricted to -SoCs that have the PRUSS remoteproc support. - -Signed-off-by: Jason Reeder <jreeder@ti.com> -[s-anna@ti.com: various cleanups, rpmsg rebase fixes for 4.14] -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/rpmsg/Kconfig | 14 ++ - drivers/rpmsg/Makefile | 1 + - drivers/rpmsg/rpmsg_pru.c | 360 ++++++++++++++++++++++++++++++++++++++ - 3 files changed, 375 insertions(+) - create mode 100644 drivers/rpmsg/rpmsg_pru.c - -diff --git a/drivers/rpmsg/Kconfig b/drivers/rpmsg/Kconfig -index d0322b41eca5..5beb5e479c25 100644 ---- a/drivers/rpmsg/Kconfig -+++ b/drivers/rpmsg/Kconfig -@@ -55,4 +55,18 @@ config RPMSG_VIRTIO - select RPMSG - select VIRTIO - -+config RPMSG_PRU -+ tristate "PRU RPMsg Communication driver" -+ default n -+ depends on RPMSG_VIRTIO -+ depends on REMOTEPROC -+ depends on PRUSS_REMOTEPROC -+ help -+ An rpmsg driver that exposes interfaces to user space, to allow -+ applications to communicate with the PRU processors on available -+ TI SoCs. This is restricted to SoCs that have the PRUSS remoteproc -+ support. -+ -+ If unsure, say N. -+ - endmenu -diff --git a/drivers/rpmsg/Makefile b/drivers/rpmsg/Makefile -index 9aa859502d27..b66a5dddcce8 100644 ---- a/drivers/rpmsg/Makefile -+++ b/drivers/rpmsg/Makefile -@@ -1,6 +1,7 @@ - # SPDX-License-Identifier: GPL-2.0 - obj-$(CONFIG_RPMSG) += rpmsg_core.o - obj-$(CONFIG_RPMSG_CHAR) += rpmsg_char.o -+obj-$(CONFIG_RPMSG_PRU) += rpmsg_pru.o - obj-$(CONFIG_RPMSG_QCOM_GLINK_RPM) += qcom_glink_rpm.o - obj-$(CONFIG_RPMSG_QCOM_GLINK_NATIVE) += qcom_glink_native.o - obj-$(CONFIG_RPMSG_QCOM_GLINK_SMEM) += qcom_glink_smem.o -diff --git a/drivers/rpmsg/rpmsg_pru.c b/drivers/rpmsg/rpmsg_pru.c -new file mode 100644 -index 000000000000..2e8d2b1ac7c7 ---- /dev/null -+++ b/drivers/rpmsg/rpmsg_pru.c -@@ -0,0 +1,360 @@ -+// SPDX-License-Identifier: GPL-2.0 -+/* -+ * PRU Remote Processor Messaging Driver -+ * -+ * Copyright (C) 2015-2019 Texas Instruments Incorporated - http://www.ti.com/ -+ * Jason Reeder <jreeder@ti.com> -+ * Suman Anna <s-anna@ti.com> -+ * -+ * This software is licensed under the terms of the GNU General Public -+ * License version 2, as published by the Free Software Foundation, and -+ * may be copied, distributed, and modified under those terms. -+ * -+ * 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. -+ */ -+ -+#include <linux/kernel.h> -+#include <linux/rpmsg.h> -+#include <linux/slab.h> -+#include <linux/fs.h> -+#include <linux/init.h> -+#include <linux/cdev.h> -+#include <linux/module.h> -+#include <linux/kfifo.h> -+#include <linux/uaccess.h> -+#include <linux/mutex.h> -+#include <linux/poll.h> -+#include <linux/rpmsg/virtio_rpmsg.h> -+ -+#define PRU_MAX_DEVICES (8) -+/* Matches the definition in virtio_rpmsg_bus.c */ -+#define RPMSG_BUF_SIZE (512) -+#define MAX_FIFO_MSG (32) -+#define FIFO_MSG_SIZE RPMSG_BUF_SIZE -+ -+/** -+ * struct rpmsg_pru_dev - Structure that contains the per-device data -+ * @rpdev: rpmsg channel device that is associated with this rpmsg_pru device -+ * @dev: device -+ * @cdev: character device -+ * @locked: boolean used to determine whether or not the device file is in use -+ * @devt: dev_t structure for the rpmsg_pru device -+ * @msg_fifo: kernel fifo used to buffer the messages between userspace and PRU -+ * @msg_len: array storing the lengths of each message in the kernel fifo -+ * @msg_idx_rd: kernel fifo read index -+ * @msg_idx_wr: kernel fifo write index -+ * @wait_list: wait queue used to implement the poll operation of the character -+ * device -+ * -+ * Each rpmsg_pru device provides an interface, using an rpmsg channel (rpdev), -+ * between a user space character device (cdev) and a PRU core. A kernel fifo -+ * (msg_fifo) is used to buffer the messages in the kernel that are -+ * being passed between the character device and the PRU. -+ */ -+struct rpmsg_pru_dev { -+ struct rpmsg_device *rpdev; -+ struct device *dev; -+ struct cdev cdev; -+ bool locked; -+ dev_t devt; -+ struct kfifo msg_fifo; -+ u32 msg_len[MAX_FIFO_MSG]; -+ int msg_idx_rd; -+ int msg_idx_wr; -+ wait_queue_head_t wait_list; -+}; -+ -+static struct class *rpmsg_pru_class; -+static dev_t rpmsg_pru_devt; -+static DEFINE_MUTEX(rpmsg_pru_lock); -+static DEFINE_IDR(rpmsg_pru_minors); -+ -+static int rpmsg_pru_open(struct inode *inode, struct file *filp) -+{ -+ struct rpmsg_pru_dev *prudev; -+ int ret = -EACCES; -+ -+ prudev = container_of(inode->i_cdev, struct rpmsg_pru_dev, cdev); -+ -+ mutex_lock(&rpmsg_pru_lock); -+ if (!prudev->locked) { -+ prudev->locked = true; -+ filp->private_data = prudev; -+ ret = 0; -+ } -+ mutex_unlock(&rpmsg_pru_lock); -+ -+ if (ret) -+ dev_err(prudev->dev, "Device already open\n"); -+ -+ return ret; -+} -+ -+static int rpmsg_pru_release(struct inode *inode, struct file *filp) -+{ -+ struct rpmsg_pru_dev *prudev; -+ -+ prudev = container_of(inode->i_cdev, struct rpmsg_pru_dev, cdev); -+ mutex_lock(&rpmsg_pru_lock); -+ prudev->locked = false; -+ mutex_unlock(&rpmsg_pru_lock); -+ return 0; -+} -+ -+static ssize_t rpmsg_pru_read(struct file *filp, char __user *buf, -+ size_t count, loff_t *f_pos) -+{ -+ int ret; -+ u32 length; -+ struct rpmsg_pru_dev *prudev; -+ -+ prudev = filp->private_data; -+ -+ if (kfifo_is_empty(&prudev->msg_fifo) && -+ (filp->f_flags & O_NONBLOCK)) -+ return -EAGAIN; -+ -+ ret = wait_event_interruptible(prudev->wait_list, -+ !kfifo_is_empty(&prudev->msg_fifo)); -+ if (ret) -+ return -EINTR; -+ -+ ret = kfifo_to_user(&prudev->msg_fifo, buf, -+ prudev->msg_len[prudev->msg_idx_rd], &length); -+ prudev->msg_idx_rd = (prudev->msg_idx_rd + 1) % MAX_FIFO_MSG; -+ -+ return ret ? ret : length; -+} -+ -+static ssize_t rpmsg_pru_write(struct file *filp, const char __user *buf, -+ size_t count, loff_t *f_pos) -+{ -+ int ret; -+ struct rpmsg_pru_dev *prudev; -+ static char rpmsg_pru_buf[RPMSG_BUF_SIZE]; -+ -+ prudev = filp->private_data; -+ -+ if (count > RPMSG_BUF_SIZE - sizeof(struct rpmsg_hdr)) { -+ dev_err(prudev->dev, "Data too large for RPMsg Buffer\n"); -+ return -EINVAL; -+ } -+ -+ if (copy_from_user(rpmsg_pru_buf, buf, count)) { -+ dev_err(prudev->dev, "Error copying buffer from user space"); -+ return -EFAULT; -+ } -+ -+ ret = rpmsg_send(prudev->rpdev->ept, (void *)rpmsg_pru_buf, count); -+ if (ret) -+ dev_err(prudev->dev, "rpmsg_send failed: %d\n", ret); -+ -+ return ret ? ret : count; -+} -+ -+static unsigned int rpmsg_pru_poll(struct file *filp, -+ struct poll_table_struct *wait) -+{ -+ int mask; -+ struct rpmsg_pru_dev *prudev; -+ -+ prudev = filp->private_data; -+ -+ poll_wait(filp, &prudev->wait_list, wait); -+ -+ mask = POLLOUT | POLLWRNORM; -+ -+ if (!kfifo_is_empty(&prudev->msg_fifo)) -+ mask |= POLLIN | POLLRDNORM; -+ -+ return mask; -+} -+ -+static const struct file_operations rpmsg_pru_fops = { -+ .owner = THIS_MODULE, -+ .open = rpmsg_pru_open, -+ .release = rpmsg_pru_release, -+ .read = rpmsg_pru_read, -+ .write = rpmsg_pru_write, -+ .poll = rpmsg_pru_poll, -+}; -+ -+static int rpmsg_pru_cb(struct rpmsg_device *rpdev, void *data, int len, -+ void *priv, u32 src) -+{ -+ u32 length; -+ struct rpmsg_pru_dev *prudev; -+ -+ prudev = dev_get_drvdata(&rpdev->dev); -+ -+ if (kfifo_avail(&prudev->msg_fifo) < len) { -+ dev_err(&rpdev->dev, "Not enough space on the FIFO\n"); -+ return -ENOSPC; -+ } -+ -+ if ((prudev->msg_idx_wr + 1) % MAX_FIFO_MSG == -+ prudev->msg_idx_rd) { -+ dev_err(&rpdev->dev, "Message length table is full\n"); -+ return -ENOSPC; -+ } -+ -+ length = kfifo_in(&prudev->msg_fifo, data, len); -+ prudev->msg_len[prudev->msg_idx_wr] = length; -+ prudev->msg_idx_wr = (prudev->msg_idx_wr + 1) % MAX_FIFO_MSG; -+ -+ wake_up_interruptible(&prudev->wait_list); -+ -+ return 0; -+} -+ -+static int rpmsg_pru_probe(struct rpmsg_device *rpdev) -+{ -+ int ret; -+ struct rpmsg_pru_dev *prudev; -+ int minor_got; -+ -+ prudev = devm_kzalloc(&rpdev->dev, sizeof(*prudev), GFP_KERNEL); -+ if (!prudev) -+ return -ENOMEM; -+ -+ mutex_lock(&rpmsg_pru_lock); -+ minor_got = idr_alloc(&rpmsg_pru_minors, prudev, 0, PRU_MAX_DEVICES, -+ GFP_KERNEL); -+ mutex_unlock(&rpmsg_pru_lock); -+ if (minor_got < 0) { -+ ret = minor_got; -+ dev_err(&rpdev->dev, "Failed to get a minor number for the rpmsg_pru device: %d\n", -+ ret); -+ goto fail_alloc_minor; -+ } -+ -+ prudev->devt = MKDEV(MAJOR(rpmsg_pru_devt), minor_got); -+ -+ cdev_init(&prudev->cdev, &rpmsg_pru_fops); -+ prudev->cdev.owner = THIS_MODULE; -+ ret = cdev_add(&prudev->cdev, prudev->devt, 1); -+ if (ret) { -+ dev_err(&rpdev->dev, "Unable to add cdev for the rpmsg_pru device\n"); -+ goto fail_add_cdev; -+ } -+ -+ prudev->dev = device_create(rpmsg_pru_class, &rpdev->dev, prudev->devt, -+ NULL, "rpmsg_pru%d", rpdev->dst); -+ if (IS_ERR(prudev->dev)) { -+ dev_err(&rpdev->dev, "Unable to create the rpmsg_pru device\n"); -+ ret = PTR_ERR(prudev->dev); -+ goto fail_create_device; -+ } -+ -+ prudev->rpdev = rpdev; -+ -+ ret = kfifo_alloc(&prudev->msg_fifo, MAX_FIFO_MSG * FIFO_MSG_SIZE, -+ GFP_KERNEL); -+ if (ret) { -+ dev_err(&rpdev->dev, "Unable to allocate fifo for the rpmsg_pru device\n"); -+ goto fail_alloc_fifo; -+ } -+ -+ init_waitqueue_head(&prudev->wait_list); -+ -+ dev_set_drvdata(&rpdev->dev, prudev); -+ -+ dev_info(&rpdev->dev, "new rpmsg_pru device: /dev/rpmsg_pru%d", -+ rpdev->dst); -+ -+ return 0; -+ -+fail_alloc_fifo: -+ device_destroy(rpmsg_pru_class, prudev->devt); -+fail_create_device: -+ cdev_del(&prudev->cdev); -+fail_add_cdev: -+ mutex_lock(&rpmsg_pru_lock); -+ idr_remove(&rpmsg_pru_minors, minor_got); -+ mutex_unlock(&rpmsg_pru_lock); -+fail_alloc_minor: -+ return ret; -+} -+ -+static void rpmsg_pru_remove(struct rpmsg_device *rpdev) -+{ -+ struct rpmsg_pru_dev *prudev; -+ -+ prudev = dev_get_drvdata(&rpdev->dev); -+ -+ kfifo_free(&prudev->msg_fifo); -+ device_destroy(rpmsg_pru_class, prudev->devt); -+ cdev_del(&prudev->cdev); -+ mutex_lock(&rpmsg_pru_lock); -+ idr_remove(&rpmsg_pru_minors, MINOR(prudev->devt)); -+ mutex_unlock(&rpmsg_pru_lock); -+} -+ -+/* .name matches on RPMsg Channels and causes a probe */ -+static const struct rpmsg_device_id rpmsg_driver_pru_id_table[] = { -+ { .name = "rpmsg-pru" }, -+ { }, -+}; -+MODULE_DEVICE_TABLE(rpmsg, rpmsg_driver_pru_id_table); -+ -+static struct rpmsg_driver rpmsg_pru_driver = { -+ .drv.name = KBUILD_MODNAME, -+ .id_table = rpmsg_driver_pru_id_table, -+ .probe = rpmsg_pru_probe, -+ .callback = rpmsg_pru_cb, -+ .remove = rpmsg_pru_remove, -+}; -+ -+static int __init rpmsg_pru_init(void) -+{ -+ int ret; -+ -+ rpmsg_pru_class = class_create(THIS_MODULE, "rpmsg_pru"); -+ if (IS_ERR(rpmsg_pru_class)) { -+ pr_err("Unable to create class\n"); -+ ret = PTR_ERR(rpmsg_pru_class); -+ goto fail_create_class; -+ } -+ -+ ret = alloc_chrdev_region(&rpmsg_pru_devt, 0, PRU_MAX_DEVICES, -+ "rpmsg_pru"); -+ if (ret) { -+ pr_err("Unable to allocate chrdev region\n"); -+ goto fail_alloc_region; -+ } -+ -+ ret = register_rpmsg_driver(&rpmsg_pru_driver); -+ if (ret) { -+ pr_err("Unable to register rpmsg driver"); -+ goto fail_register_rpmsg_driver; -+ } -+ -+ return 0; -+ -+fail_register_rpmsg_driver: -+ unregister_chrdev_region(rpmsg_pru_devt, PRU_MAX_DEVICES); -+fail_alloc_region: -+ class_destroy(rpmsg_pru_class); -+fail_create_class: -+ return ret; -+} -+ -+static void __exit rpmsg_pru_exit(void) -+{ -+ unregister_rpmsg_driver(&rpmsg_pru_driver); -+ idr_destroy(&rpmsg_pru_minors); -+ mutex_destroy(&rpmsg_pru_lock); -+ class_destroy(rpmsg_pru_class); -+ unregister_chrdev_region(rpmsg_pru_devt, PRU_MAX_DEVICES); -+} -+ -+module_init(rpmsg_pru_init); -+module_exit(rpmsg_pru_exit); -+ -+MODULE_AUTHOR("Jason Reeder <jreeder@ti.com>"); -+MODULE_ALIAS("rpmsg:rpmsg-pru"); -+MODULE_DESCRIPTION("PRU Remote Processor Messaging Driver"); -+MODULE_LICENSE("GPL v2"); --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0015-mdio_bus-Support-more-than-one-GPIO-bus-reset-lines.patch b/patches/drivers/ti/rogerq_pruss/0015-mdio_bus-Support-more-than-one-GPIO-bus-reset-lines.patch deleted file mode 100644 index 5fd17259f..000000000 --- a/patches/drivers/ti/rogerq_pruss/0015-mdio_bus-Support-more-than-one-GPIO-bus-reset-lines.patch +++ /dev/null @@ -1,104 +0,0 @@ -From c5e9bc112a5956746775e9c3131fed1d9cdfd7e0 Mon Sep 17 00:00:00 2001 -From: Roger Quadros <rogerq@ti.com> -Date: Mon, 26 Feb 2018 16:16:20 +0200 -Subject: [PATCH 15/25] mdio_bus: Support more than one GPIO bus reset lines - -Some platforms like AM572x-idk and K2G-ICE-evm have more than -one GPIO reset lines for the PHYs on the bus. - -All the reset lines need to be toggled for the PHYs to work. - -Signed-off-by: Roger Quadros <rogerq@ti.com> -Signed-off-by: Sekhar Nori <nsekhar@ti.com> ---- - drivers/net/phy/mdio_bus.c | 43 ++++++++++++++++++++++++-------------- - include/linux/phy.h | 3 ++- - 2 files changed, 29 insertions(+), 17 deletions(-) - -diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c -index 66b9cfe692fc..234c260a9954 100644 ---- a/drivers/net/phy/mdio_bus.c -+++ b/drivers/net/phy/mdio_bus.c -@@ -386,20 +386,27 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) - mutex_init(&bus->mdio_lock); - - /* de-assert bus level PHY GPIO reset */ -- gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_LOW); -- if (IS_ERR(gpiod)) { -- dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n", -- bus->id); -- device_del(&bus->dev); -- return PTR_ERR(gpiod); -- } else if (gpiod) { -- bus->reset_gpiod = gpiod; -- -- gpiod_set_value_cansleep(gpiod, 1); -- udelay(bus->reset_delay_us); -- gpiod_set_value_cansleep(gpiod, 0); -+ for (i = 0; i < PHY_MAX_ADDR; i++) { -+ gpiod = devm_gpiod_get_index_optional(&bus->dev, "reset", -+ i, GPIOD_OUT_LOW); -+ if (IS_ERR(gpiod)) { -+ dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n", -+ bus->id); -+ device_del(&bus->dev); -+ return PTR_ERR(gpiod); -+ } else if (gpiod) { -+ bus->reset_gpiod[i] = gpiod; -+ -+ gpiod_set_value_cansleep(gpiod, 1); -+ udelay(bus->reset_delay_us); -+ gpiod_set_value_cansleep(gpiod, 0); -+ } else { -+ break; -+ } - } - -+ bus->num_resets = i; -+ - if (bus->reset) - bus->reset(bus); - -@@ -432,8 +439,10 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) - } - - /* Put PHYs in RESET to save power */ -- if (bus->reset_gpiod) -- gpiod_set_value_cansleep(bus->reset_gpiod, 1); -+ for (i = 0; i < bus->num_resets; i++) { -+ if (bus->reset_gpiod[i]) -+ gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); -+ } - - device_del(&bus->dev); - return err; -@@ -461,8 +470,10 @@ void mdiobus_unregister(struct mii_bus *bus) - } - - /* Put PHYs in RESET to save power */ -- if (bus->reset_gpiod) -- gpiod_set_value_cansleep(bus->reset_gpiod, 1); -+ for (i = 0; i < bus->num_resets; i++) { -+ if (bus->reset_gpiod[i]) -+ gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); -+ } - - device_del(&bus->dev); - } -diff --git a/include/linux/phy.h b/include/linux/phy.h -index ef20aeea10cc..92add8df0c70 100644 ---- a/include/linux/phy.h -+++ b/include/linux/phy.h -@@ -249,7 +249,8 @@ struct mii_bus { - /* GPIO reset pulse width in microseconds */ - int reset_delay_us; - /* RESET GPIO descriptor pointer */ -- struct gpio_desc *reset_gpiod; -+ int num_resets; -+ struct gpio_desc *reset_gpiod[PHY_MAX_ADDR]; - }; - #define to_mii_bus(d) container_of(d, struct mii_bus, dev) - --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0016-dt-bindings-net-Add-TI-PRUeth-bindings.patch b/patches/drivers/ti/rogerq_pruss/0016-dt-bindings-net-Add-TI-PRUeth-bindings.patch deleted file mode 100644 index 0b7531e20..000000000 --- a/patches/drivers/ti/rogerq_pruss/0016-dt-bindings-net-Add-TI-PRUeth-bindings.patch +++ /dev/null @@ -1,115 +0,0 @@ -From be500f3eda6c6861cd6950c7c946c700d03ff1b8 Mon Sep 17 00:00:00 2001 -From: "Andrew F. Davis" <afd@ti.com> -Date: Mon, 26 Feb 2018 16:16:21 +0200 -Subject: [PATCH 16/25] dt-bindings: net: Add TI-PRUeth bindings - -Add DT binding information for TI's PRUSS Ethernet -device driver. - -Signed-off-by: Andrew F. Davis <afd@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Sekhar Nori <nsekhar@ti.com> ---- - .../devicetree/bindings/net/ti-prueth.txt | 89 +++++++++++++++++++ - 1 file changed, 89 insertions(+) - create mode 100644 Documentation/devicetree/bindings/net/ti-prueth.txt - -diff --git a/Documentation/devicetree/bindings/net/ti-prueth.txt b/Documentation/devicetree/bindings/net/ti-prueth.txt -new file mode 100644 -index 000000000000..d1b5a4bcfe5e ---- /dev/null -+++ b/Documentation/devicetree/bindings/net/ti-prueth.txt -@@ -0,0 +1,89 @@ -+Texas Instruments PRUSS Ethernet MAC -+==================================== -+ -+Required properties: -+- compatible : Should be one of the following, -+ "ti,am3359-prueth" for AM335x SoCs -+ "ti,am4376-prueth" for AM437x SoCs -+ "ti,am57-prueth" for AM57xx SoCs -+ "ti,k2g-prueth" for 66AK2G SoCs -+ -+- prus : list of pHandles to the PRU nodes -+- firmware-name : list of strings containing firmware path. -+- sram : pHandle to OCMC SRAM node -+- interrupt-parent : pHandle to the PRUSS INTC node -+- mii-rt : pHandle to MII_RT module's syscon regmap -+- iep : pHandle to IEP module's syscon regmap -+ -+Must contain children, one for each of the MAC ports. -+Children must be named ethernet-mii0 and ethernet-mii1. -+Either one or both children can be present. If only one -+child is present driver operates in single EMAC mode. -+ -+For single mode operation with the 2nd PRU, you still need -+to provide both PRUs and firmware-names but the firmware-name -+for the first PRU can be NULL. See 2nd example. -+ -+Required properties for children: -+- phy-handle : See ethernet.txt file in the same directory. -+- phy-mode : See ethernet.txt file in the same directory. -+- interrupt-names : should be "rx" and "tx" -+- interrupts : should contain an array of PRUSS system event -+ numbers used as the interrupt sources for Rx -+ and Tx respectively. -+ -+Optional properties for children: -+- local-mac-address : mac address for the port. -+ -+Example (am572x-idk board, dual-emac): -+====================================== -+ pruss2_eth { -+ compatible = "ti,am57-prueth"; -+ prus = <&pru2_0>, <&pru2_1>; -+ firmware-name = "ti-pruss/am57xx-pru0-prueth-fw.elf", -+ "ti-pruss/am57xx-pru1-prueth-fw.elf"; -+ sram = <&ocmcram1>; -+ interrupt-parent = <&pruss2_intc>; -+ mii-rt = <&pruss2_mii_rt>; -+ iep = <&pruss2_iep>; -+ -+ pruss2_emac0: ethernet-mii0 { -+ phy-handle = <&pruss2_eth0_phy>; -+ phy-mode = "mii"; -+ interrupts = <20>, <22>; -+ interrupt-names = "rx", "tx"; -+ /* Filled in by bootloader */ -+ local-mac-address = [00 00 00 00 00 00]; -+ }; -+ -+ pruss2_emac1: ethernet-mii1 { -+ phy-handle = <&pruss2_eth1_phy>; -+ phy-mode = "mii"; -+ interrupts = <21>, <23>; -+ interrupt-names = "rx", "tx"; -+ /* Filled in by bootloader */ -+ local-mac-address = [00 00 00 00 00 00]; -+ }; -+ }; -+ -+Example (am572x-idk board, single-emac): -+======================================= -+ pruss2_eth { -+ compatible = "ti,am57-prueth"; -+ prus = <&pru2_0>, <&pru2_1>; -+ firmware-name = "", -+ "ti-pruss/am57xx-pru1-prueth-fw.elf"; -+ sram = <&ocmcram1>; -+ interrupt-parent = <&pruss2_intc>; -+ mii-rt = <&pruss2_mii_rt>; -+ iep = <&pruss2_iep>; -+ -+ pruss2_emac1: ethernet-mii1 { -+ phy-handle = <&pruss2_eth1_phy>; -+ phy-mode = "mii"; -+ interrupts = <21>, <23>; -+ interrupt-names = "rx", "tx"; -+ /* Filled in by bootloader */ -+ local-mac-address = [00 00 00 00 00 00]; -+ }; -+ }; --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0017-net-prueth-Add-TI-PRUSS-Ethernet-driver.patch b/patches/drivers/ti/rogerq_pruss/0017-net-prueth-Add-TI-PRUSS-Ethernet-driver.patch deleted file mode 100644 index 197eaa640..000000000 --- a/patches/drivers/ti/rogerq_pruss/0017-net-prueth-Add-TI-PRUSS-Ethernet-driver.patch +++ /dev/null @@ -1,2469 +0,0 @@ -From f407ab8f5d87f61c39f2bf727481dcf521890190 Mon Sep 17 00:00:00 2001 -From: Roger Quadros <rogerq@ti.com> -Date: Tue, 27 Feb 2018 12:10:13 +0200 -Subject: [PATCH 17/25] net: prueth: Add TI PRUSS Ethernet driver - -This driver brings dual-EMAC functionality on TI SoCs that support -Ethernet over PRUSS. - -[s-anna@ti.com: Add K2G ICE board compatibles] -[nsekhar@ti.com: checkpatch warning fixes] -[jjhilbolt@ti.com: defer probe fixes] - -Signed-off-by: Roger Quadros <rogerq@ti.com> -Signed-off-by: Andrew F. Davis <afd@ti.com> -Signed-off-by: Felipe Balbi <balbi@ti.com> -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Sekhar Nori <nsekhar@ti.com> ---- - drivers/net/ethernet/ti/Kconfig | 6 + - drivers/net/ethernet/ti/Makefile | 2 + - drivers/net/ethernet/ti/icss_mii_rt.h | 83 ++ - drivers/net/ethernet/ti/icss_switch.h | 204 +++ - drivers/net/ethernet/ti/prueth.c | 1925 +++++++++++++++++++++++++ - drivers/net/ethernet/ti/prueth.h | 175 +++ - 6 files changed, 2395 insertions(+) - create mode 100644 drivers/net/ethernet/ti/icss_mii_rt.h - create mode 100644 drivers/net/ethernet/ti/icss_switch.h - create mode 100644 drivers/net/ethernet/ti/prueth.c - create mode 100644 drivers/net/ethernet/ti/prueth.h - -diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig -index bb126be1eb72..c738372c56bf 100644 ---- a/drivers/net/ethernet/ti/Kconfig -+++ b/drivers/net/ethernet/ti/Kconfig -@@ -136,4 +136,10 @@ config CPMAC - ---help--- - TI AR7 CPMAC Ethernet support - -+config TI_PRUETH -+ tristate "TI PRU Ethernet EMAC/Switch driver" -+ depends on PRUSS_REMOTEPROC -+ ---help--- -+ Support EMAC over PRUSS. -+ - endif # NET_VENDOR_TI -diff --git a/drivers/net/ethernet/ti/Makefile b/drivers/net/ethernet/ti/Makefile -index 0be551de821c..58e440fcb6af 100644 ---- a/drivers/net/ethernet/ti/Makefile -+++ b/drivers/net/ethernet/ti/Makefile -@@ -21,3 +21,5 @@ obj-$(CONFIG_TI_KEYSTONE_NETCP) += keystone_netcp.o - keystone_netcp-y := netcp_core.o - obj-$(CONFIG_TI_KEYSTONE_NETCP_ETHSS) += keystone_netcp_ethss.o - keystone_netcp_ethss-y := netcp_ethss.o netcp_sgmii.o netcp_xgbepcsr.o -+ -+obj-$(CONFIG_TI_PRUETH) += prueth.o -diff --git a/drivers/net/ethernet/ti/icss_mii_rt.h b/drivers/net/ethernet/ti/icss_mii_rt.h -new file mode 100644 -index 000000000000..c07144a89562 ---- /dev/null -+++ b/drivers/net/ethernet/ti/icss_mii_rt.h -@@ -0,0 +1,83 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+ -+/* PRU-ICSS MII_RT register definitions -+ * -+ * Copyright (C) 2015-2018 Texas Instruments Incorporated - http://www.ti.com -+ */ -+ -+#ifndef __NET_PRUSS_MII_RT_H__ -+#define __NET_PRUSS_MII_RT_H__ -+ -+/* PRUSS_MII_RT Registers */ -+#define PRUSS_MII_RT_RXCFG0 0x0 -+#define PRUSS_MII_RT_RXCFG1 0x4 -+#define PRUSS_MII_RT_TXCFG0 0x10 -+#define PRUSS_MII_RT_TXCFG1 0x14 -+#define PRUSS_MII_RT_TX_CRC0 0x20 -+#define PRUSS_MII_RT_TX_CRC1 0x24 -+#define PRUSS_MII_RT_TX_IPG0 0x30 -+#define PRUSS_MII_RT_TX_IPG1 0x34 -+#define PRUSS_MII_RT_PRS0 0x38 -+#define PRUSS_MII_RT_PRS1 0x3c -+#define PRUSS_MII_RT_RX_FRMS0 0x40 -+#define PRUSS_MII_RT_RX_FRMS1 0x44 -+#define PRUSS_MII_RT_RX_PCNT0 0x48 -+#define PRUSS_MII_RT_RX_PCNT1 0x4c -+#define PRUSS_MII_RT_RX_ERR0 0x50 -+#define PRUSS_MII_RT_RX_ERR1 0x54 -+ -+/* PRUSS_MII_RT_RXCFG0/1 bits */ -+#define PRUSS_MII_RT_RXCFG_RX_ENABLE BIT(0) -+#define PRUSS_MII_RT_RXCFG_RX_DATA_RDY_MODE_DIS BIT(1) -+#define PRUSS_MII_RT_RXCFG_RX_CUT_PREAMBLE BIT(2) -+#define PRUSS_MII_RT_RXCFG_RX_MUX_SEL BIT(3) -+#define PRUSS_MII_RT_RXCFG_RX_L2_EN BIT(4) -+#define PRUSS_MII_RT_RXCFG_RX_BYTE_SWAP BIT(5) -+#define PRUSS_MII_RT_RXCFG_RX_AUTO_FWD_PRE BIT(6) -+#define PRUSS_MII_RT_RXCFG_RX_L2_EOF_SCLR_DIS BIT(9) -+ -+/* PRUSS_MII_RT_TXCFG0/1 bits */ -+#define PRUSS_MII_RT_TXCFG_TX_ENABLE BIT(0) -+#define PRUSS_MII_RT_TXCFG_TX_AUTO_PREAMBLE BIT(1) -+#define PRUSS_MII_RT_TXCFG_TX_EN_MODE BIT(2) -+#define PRUSS_MII_RT_TXCFG_TX_BYTE_SWAP BIT(3) -+#define PRUSS_MII_RT_TXCFG_TX_MUX_SEL BIT(8) -+#define PRUSS_MII_RT_TXCFG_PRE_TX_AUTO_SEQUENCE BIT(9) -+#define PRUSS_MII_RT_TXCFG_PRE_TX_AUTO_ESC_ERR BIT(10) -+#define PRUSS_MII_RT_TXCFG_TX_32_MODE_EN BIT(11) -+ -+#define PRUSS_MII_RT_TXCFG_TX_START_DELAY_SHIFT 16 -+#define PRUSS_MII_RT_TXCFG_TX_START_DELAY_MASK GENMASK(25, 16) -+ -+#define PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_SHIFT 28 -+#define PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_MASK GENMASK(30, 28) -+ -+/* PRUSS_MII_RT_TX_IPG0/1 bits */ -+#define PRUSS_MII_RT_TX_IPG_IPG_SHIFT 0 -+#define PRUSS_MII_RT_TX_IPG_IPG_MASK GENMASK(9, 0) -+ -+/* PRUSS_MII_RT_PRS0/1 bits */ -+#define PRUSS_MII_RT_PRS_COL BIT(0) -+#define PRUSS_MII_RT_PRS_CRS BIT(1) -+ -+/* PRUSS_MII_RT_RX_FRMS0/1 bits */ -+#define PRUSS_MII_RT_RX_FRMS_MIN_FRM_SHIFT 0 -+#define PRUSS_MII_RT_RX_FRMS_MIN_FRM_MASK GENMASK(15, 0) -+ -+#define PRUSS_MII_RT_RX_FRMS_MAX_FRM_SHIFT 16 -+#define PRUSS_MII_RT_RX_FRMS_MAX_FRM_MASK GENMASK(31, 16) -+ -+/* PRUSS_MII_RT_RX_PCNT0/1 bits */ -+#define PRUSS_MII_RT_RX_PCNT_MIN_PCNT_SHIFT 0 -+#define PRUSS_MII_RT_RX_PCNT_MIN_PCNT_MASK GENMASK(3, 0) -+ -+#define PRUSS_MII_RT_RX_PCNT_MAX_PCNT_SHIFT 4 -+#define PRUSS_MII_RT_RX_PCNT_MAX_PCNT_MASK GENMASK(7, 4) -+ -+/* PRUSS_MII_RT_RX_ERR0/1 bits */ -+#define PRUSS_MII_RT_RX_ERR_MIN_PCNT_ERR BIT(0) -+#define PRUSS_MII_RT_RX_ERR_MAX_PCNT_ERR BIT(1) -+#define PRUSS_MII_RT_RX_ERR_MIN_FRM_ERR BIT(2) -+#define PRUSS_MII_RT_RX_ERR_MAX_FRM_ERR BIT(3) -+ -+#endif /* __NET_PRUSS_MII_RT_H__ */ -diff --git a/drivers/net/ethernet/ti/icss_switch.h b/drivers/net/ethernet/ti/icss_switch.h -new file mode 100644 -index 000000000000..528b81d43e39 ---- /dev/null -+++ b/drivers/net/ethernet/ti/icss_switch.h -@@ -0,0 +1,204 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+ -+/* Copyright (C) 2015-2018 Texas Instruments Incorporated - http://www.ti.com -+ */ -+ -+#ifndef __ICSS_SWITCH_H -+#define __ICSS_SWITCH_H -+ -+/* Basic Switch Parameters -+ * Used to auto compute offset addresses on L3 OCMC RAM. Do not modify these -+ * without changing firmware accordingly -+ */ -+#define SWITCH_BUFFER_SIZE (64 * 1024) /* L3 buffer */ -+#define ICSS_BLOCK_SIZE 32 /* data bytes per BD */ -+#define BD_SIZE 4 /* byte buffer descriptor */ -+ -+#define PORT_LINK_MASK 0x1 -+#define PORT_IS_HD_MASK 0x2 -+ -+/* Physical Port queue size (number of BDs). Same for both ports */ -+#define QUEUE_1_SIZE 97 /* Network Management high */ -+#define QUEUE_2_SIZE 97 /* Network Management low */ -+#define QUEUE_3_SIZE 97 /* Protocol specific */ -+#define QUEUE_4_SIZE 97 /* NRT (IP,ARP, ICMP) */ -+ -+/* Host queue size (number of BDs). Each BD points to data buffer of 32 bytes. -+ * HOST PORT QUEUES can buffer up to 4 full sized frames per queue -+ */ -+#define HOST_QUEUE_1_SIZE 194 /* Protocol and VLAN priority 7 & 6 */ -+#define HOST_QUEUE_2_SIZE 194 /* Protocol mid */ -+#define HOST_QUEUE_3_SIZE 194 /* Protocol low */ -+#define HOST_QUEUE_4_SIZE 194 /* NRT (IP, ARP, ICMP) */ -+ -+/* NRT Buffer descriptor definition -+ * Each buffer descriptor points to a max 32 byte block and has 32 bit in size -+ * to have atomic operation. -+ * PRU can address bytewise into memory. -+ * Definition of 32 bit descriptor is as follows -+ * -+ * Bits Name Meaning -+ * ============================================================================= -+ * 0..7 Index points to index in buffer queue, max 256 x 32 -+ * byte blocks can be addressed -+ * 8..12 Block_length number of valid bytes in this specific block. -+ * Will be <=32 bytes on last block of packet -+ * 13 More "More" bit indicating that there are more blocks -+ * 14 Shadow indicates that "index" is pointing into shadow -+ * buffer -+ * 15 TimeStamp indicates that this packet has time stamp in -+ * separate buffer - only needed of PTCP runs on -+ * host -+ * 16..17 Port different meaning for ingress and egress, -+ * Ingress: Port = 0 indicates phy port 1 and -+ * Port = 1 indicates phy port 2. -+ * Egress: 0 sends on phy port 1 and 1 sends on -+ * phy port 2. Port = 2 goes over MAC table -+ * look-up -+ * 18..28 Length 11 bit of total packet length which is put into -+ * first BD only so that host access only one BD -+ * 29 VlanTag indicates that packet has Length/Type field of -+ * 0x08100 with VLAN tag in following byte -+ * 30 Broadcast indicates that packet goes out on both physical -+ * ports, there will be two bd but only one buffer -+ * 31 Error indicates there was an error in the packet -+ */ -+#define PRUETH_BD_SHADOW_MASK BIT(14) -+ -+#define PRUETH_BD_PORT_MASK GENMASK(17, 16) -+#define PRUETH_BD_PORT_SHIFT 16 -+ -+#define PRUETH_BD_LENGTH_MASK GENMASK(28, 18) -+#define PRUETH_BD_LENGTH_SHIFT 18 -+ -+#define PRUETH_BD_BROADCAST_MASK BIT(30) -+#define PRUETH_BD_BROADCAST_SHIFT 30 -+ -+#define PRUETH_BD_ERROR_MASK BIT(31) -+#define PRUETH_BD_ERROR_SHIFT 31 -+ -+/* The following offsets indicate which sections of the memory are used -+ * for EMAC internal tasks -+ */ -+#define DRAM_START_OFFSET 0x1e98 -+#define SRAM_START_OFFSET 0x400 -+ -+/* General Purpose Statistics -+ * These are present on both PRU0 and PRU1 DRAM -+ */ -+/* base statistics offset */ -+#define STATISTICS_OFFSET 0x1f00 -+#define STAT_SIZE 0x90 -+ -+/* Offset for storing -+ * 1. Storm Prevention Params -+ * 2. PHY Speed Offset -+ * 3. Port Status Offset -+ * These are present on both PRU0 and PRU1 -+ */ -+/* 4 bytes */ -+#define STORM_PREVENTION_OFFSET (STATISTICS_OFFSET + STAT_SIZE) -+/* 4 bytes */ -+#define PHY_SPEED_OFFSET (STATISTICS_OFFSET + STAT_SIZE + 4) -+/* 1 byte */ -+#define PORT_STATUS_OFFSET (STATISTICS_OFFSET + STAT_SIZE + 8) -+/* 1 byte */ -+#define COLLISION_COUNTER (STATISTICS_OFFSET + STAT_SIZE + 9) -+/* 4 bytes */ -+#define RX_PKT_SIZE_OFFSET (STATISTICS_OFFSET + STAT_SIZE + 10) -+/* 4 bytes */ -+#define PORT_CONTROL_ADDR (STATISTICS_OFFSET + STAT_SIZE + 14) -+/* 6 bytes */ -+#define PORT_MAC_ADDR (STATISTICS_OFFSET + STAT_SIZE + 18) -+/* 1 byte */ -+#define RX_INT_STATUS_OFFSET (STATISTICS_OFFSET + STAT_SIZE + 24) -+ -+/* DRAM Offsets for EMAC -+ * Present on Both DRAM0 and DRAM1 -+ */ -+ -+/* 4 queue descriptors for port tx = 32 bytes */ -+#define TX_CONTEXT_Q1_OFFSET_ADDR (PORT_QUEUE_DESC_OFFSET + 32) -+#define PORT_QUEUE_DESC_OFFSET (ICSS_EMAC_TTS_CYC_TX_SOF + 8) -+ -+/* EMAC Time Triggered Send Offsets */ -+#define ICSS_EMAC_TTS_CYC_TX_SOF (ICSS_EMAC_TTS_PREV_TX_SOF + 8) -+#define ICSS_EMAC_TTS_PREV_TX_SOF (ICSS_EMAC_TTS_MISSED_CYCLE_CNT_OFFSET + 4) -+#define ICSS_EMAC_TTS_MISSED_CYCLE_CNT_OFFSET (ICSS_EMAC_TTS_STATUS_OFFSET + 4) -+#define ICSS_EMAC_TTS_STATUS_OFFSET (ICSS_EMAC_TTS_CFG_TIME_OFFSET + 4) -+#define ICSS_EMAC_TTS_CFG_TIME_OFFSET (ICSS_EMAC_TTS_CYCLE_PERIOD_OFFSET + 4) -+#define ICSS_EMAC_TTS_CYCLE_PERIOD_OFFSET (ICSS_EMAC_TTS_CYCLE_START_OFFSET + 8) -+#define ICSS_EMAC_TTS_CYCLE_START_OFFSET ICSS_EMAC_TTS_BASE_OFFSET -+#define ICSS_EMAC_TTS_BASE_OFFSET DRAM_START_OFFSET -+ -+/* Shared RAM offsets for EMAC */ -+ -+/* Queue Descriptors */ -+ -+/* 4 queue descriptors for port 0 (host receive). 32 bytes */ -+#define HOST_QUEUE_DESC_OFFSET (HOST_QUEUE_SIZE_ADDR + 16) -+ -+/* table offset for queue size: -+ * 3 ports * 4 Queues * 1 byte offset = 12 bytes -+ */ -+#define HOST_QUEUE_SIZE_ADDR (HOST_QUEUE_OFFSET_ADDR + 8) -+/* table offset for queue: -+ * 4 Queues * 2 byte offset = 8 bytes -+ */ -+#define HOST_QUEUE_OFFSET_ADDR (HOST_QUEUE_DESCRIPTOR_OFFSET_ADDR + 8) -+/* table offset for Host queue descriptors: -+ * 1 ports * 4 Queues * 2 byte offset = 8 bytes -+ */ -+#define HOST_QUEUE_DESCRIPTOR_OFFSET_ADDR (HOST_Q4_RX_CONTEXT_OFFSET + 8) -+ -+/* Host Port Rx Context */ -+#define HOST_Q4_RX_CONTEXT_OFFSET (HOST_Q3_RX_CONTEXT_OFFSET + 8) -+#define HOST_Q3_RX_CONTEXT_OFFSET (HOST_Q2_RX_CONTEXT_OFFSET + 8) -+#define HOST_Q2_RX_CONTEXT_OFFSET (HOST_Q1_RX_CONTEXT_OFFSET + 8) -+#define HOST_Q1_RX_CONTEXT_OFFSET (EMAC_PROMISCUOUS_MODE_OFFSET + 4) -+ -+/* Promiscuous mode control */ -+#define EMAC_P1_PROMISCUOUS_BIT BIT(0) -+#define EMAC_P2_PROMISCUOUS_BIT BIT(1) -+#define EMAC_PROMISCUOUS_MODE_OFFSET (EMAC_RESERVED + 4) -+#define EMAC_RESERVED EOF_48K_BUFFER_BD -+ -+/* allow for max 48k buffer which spans the descriptors up to 0x1800 6kB */ -+#define EOF_48K_BUFFER_BD (P0_BUFFER_DESC_OFFSET + HOST_BD_SIZE + PORT_BD_SIZE) -+ -+#define HOST_BD_SIZE ((HOST_QUEUE_1_SIZE + HOST_QUEUE_2_SIZE + HOST_QUEUE_3_SIZE + HOST_QUEUE_4_SIZE) * BD_SIZE) -+#define PORT_BD_SIZE ((QUEUE_1_SIZE + QUEUE_2_SIZE + QUEUE_3_SIZE + QUEUE_4_SIZE) * 2 * BD_SIZE) -+ -+#define END_OF_BD_POOL (P2_Q4_BD_OFFSET + QUEUE_4_SIZE * BD_SIZE) -+#define P2_Q4_BD_OFFSET (P2_Q3_BD_OFFSET + QUEUE_3_SIZE * BD_SIZE) -+#define P2_Q3_BD_OFFSET (P2_Q2_BD_OFFSET + QUEUE_2_SIZE * BD_SIZE) -+#define P2_Q2_BD_OFFSET (P2_Q1_BD_OFFSET + QUEUE_1_SIZE * BD_SIZE) -+#define P2_Q1_BD_OFFSET (P1_Q4_BD_OFFSET + QUEUE_4_SIZE * BD_SIZE) -+#define P1_Q4_BD_OFFSET (P1_Q3_BD_OFFSET + QUEUE_3_SIZE * BD_SIZE) -+#define P1_Q3_BD_OFFSET (P1_Q2_BD_OFFSET + QUEUE_2_SIZE * BD_SIZE) -+#define P1_Q2_BD_OFFSET (P1_Q1_BD_OFFSET + QUEUE_1_SIZE * BD_SIZE) -+#define P1_Q1_BD_OFFSET (P0_Q4_BD_OFFSET + HOST_QUEUE_4_SIZE * BD_SIZE) -+#define P0_Q4_BD_OFFSET (P0_Q3_BD_OFFSET + HOST_QUEUE_3_SIZE * BD_SIZE) -+#define P0_Q3_BD_OFFSET (P0_Q2_BD_OFFSET + HOST_QUEUE_2_SIZE * BD_SIZE) -+#define P0_Q2_BD_OFFSET (P0_Q1_BD_OFFSET + HOST_QUEUE_1_SIZE * BD_SIZE) -+#define P0_Q1_BD_OFFSET P0_BUFFER_DESC_OFFSET -+#define P0_BUFFER_DESC_OFFSET SRAM_START_OFFSET -+ -+/* Memory Usage of L3 OCMC RAM */ -+ -+/* L3 64KB Memory - mainly buffer Pool */ -+#define END_OF_BUFFER_POOL (P2_Q4_BUFFER_OFFSET + QUEUE_4_SIZE * ICSS_BLOCK_SIZE) -+#define P2_Q4_BUFFER_OFFSET (P2_Q3_BUFFER_OFFSET + QUEUE_3_SIZE * ICSS_BLOCK_SIZE) -+#define P2_Q3_BUFFER_OFFSET (P2_Q2_BUFFER_OFFSET + QUEUE_2_SIZE * ICSS_BLOCK_SIZE) -+#define P2_Q2_BUFFER_OFFSET (P2_Q1_BUFFER_OFFSET + QUEUE_1_SIZE * ICSS_BLOCK_SIZE) -+#define P2_Q1_BUFFER_OFFSET (P1_Q4_BUFFER_OFFSET + QUEUE_4_SIZE * ICSS_BLOCK_SIZE) -+#define P1_Q4_BUFFER_OFFSET (P1_Q3_BUFFER_OFFSET + QUEUE_3_SIZE * ICSS_BLOCK_SIZE) -+#define P1_Q3_BUFFER_OFFSET (P1_Q2_BUFFER_OFFSET + QUEUE_2_SIZE * ICSS_BLOCK_SIZE) -+#define P1_Q2_BUFFER_OFFSET (P1_Q1_BUFFER_OFFSET + QUEUE_1_SIZE * ICSS_BLOCK_SIZE) -+#define P1_Q1_BUFFER_OFFSET (P0_Q4_BUFFER_OFFSET + HOST_QUEUE_4_SIZE * ICSS_BLOCK_SIZE) -+#define P0_Q4_BUFFER_OFFSET (P0_Q3_BUFFER_OFFSET + HOST_QUEUE_3_SIZE * ICSS_BLOCK_SIZE) -+#define P0_Q3_BUFFER_OFFSET (P0_Q2_BUFFER_OFFSET + HOST_QUEUE_2_SIZE * ICSS_BLOCK_SIZE) -+#define P0_Q2_BUFFER_OFFSET (P0_Q1_BUFFER_OFFSET + HOST_QUEUE_1_SIZE * ICSS_BLOCK_SIZE) -+#define P0_Q1_BUFFER_OFFSET 0x0000 -+ -+#endif /* __ICSS_SWITCH_H */ -diff --git a/drivers/net/ethernet/ti/prueth.c b/drivers/net/ethernet/ti/prueth.c -new file mode 100644 -index 000000000000..536ae6997961 ---- /dev/null -+++ b/drivers/net/ethernet/ti/prueth.c -@@ -0,0 +1,1925 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+ -+/* PRU ICSS Ethernet Driver -+ * -+ * Copyright (C) 2015-2018 Texas Instruments Incorporated - http://www.ti.com -+ * Roger Quadros <rogerq@ti.com> -+ * Andrew F. Davis <afd@ti.com> -+ */ -+ -+#include <linux/etherdevice.h> -+#include <linux/genalloc.h> -+#include <linux/if_vlan.h> -+#include <linux/interrupt.h> -+#include <linux/kernel.h> -+#include <linux/mfd/syscon.h> -+#include <linux/module.h> -+#include <linux/of.h> -+#include <linux/of_irq.h> -+#include <linux/of_mdio.h> -+#include <linux/of_net.h> -+#include <linux/of_platform.h> -+#include <linux/phy.h> -+#include <linux/pruss.h> -+#include <linux/regmap.h> -+#include <linux/remoteproc.h> -+#include <linux/remoteproc/pru_rproc.h> -+ -+#include "prueth.h" -+#include "icss_mii_rt.h" -+#include "icss_switch.h" -+ -+#define PRUETH_MODULE_VERSION "0.2" -+#define PRUETH_MODULE_DESCRIPTION "PRUSS Ethernet driver" -+ -+#define OCMC_RAM_SIZE (SZ_64K - SZ_8K) -+ -+/* TX Minimum Inter packet gap */ -+#define TX_MIN_IPG 0xb8 -+ -+#define TX_START_DELAY 0x40 -+#define TX_CLK_DELAY 0x6 -+ -+/* PRUSS_IEP_GLOBAL_CFG register definitions */ -+#define PRUSS_IEP_GLOBAL_CFG 0 -+ -+#define PRUSS_IEP_GLOBAL_CFG_CNT_ENABLE BIT(0) -+ -+/* PRUSS local memory map */ -+#define ICSS_LOCAL_SHARED_RAM 0x00010000 -+ -+/* Netif debug messages possible */ -+#define PRUETH_EMAC_DEBUG (NETIF_MSG_DRV | \ -+ NETIF_MSG_PROBE | \ -+ NETIF_MSG_LINK | \ -+ NETIF_MSG_TIMER | \ -+ NETIF_MSG_IFDOWN | \ -+ NETIF_MSG_IFUP | \ -+ NETIF_MSG_RX_ERR | \ -+ NETIF_MSG_TX_ERR | \ -+ NETIF_MSG_TX_QUEUED | \ -+ NETIF_MSG_INTR | \ -+ NETIF_MSG_TX_DONE | \ -+ NETIF_MSG_RX_STATUS | \ -+ NETIF_MSG_PKTDATA | \ -+ NETIF_MSG_HW | \ -+ NETIF_MSG_WOL) -+ -+static int debug_level = -1; -+module_param(debug_level, int, 0444); -+MODULE_PARM_DESC(debug_level, "PRUETH debug level (NETIF_MSG bits)"); -+ -+#define EMAC_POLL_WEIGHT (64) /* Default NAPI poll weight */ -+#define EMAC_MAX_PKTLEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) -+#define EMAC_MIN_PKTLEN (60) -+ -+/* In switch mode there are 3 real ports i.e. 3 mac addrs. -+ * however Linux sees only the host side port. The other 2 ports -+ * are the switch ports. -+ * In emac mode there are 2 real ports i.e. 2 mac addrs. -+ * Linux sees both the ports. -+ */ -+enum prueth_port { -+ PRUETH_PORT_HOST = 0, /* host side port */ -+ PRUETH_PORT_MII0, /* physical port MII 0 */ -+ PRUETH_PORT_MII1, /* physical port MII 1 */ -+}; -+ -+enum prueth_mac { -+ PRUETH_MAC0 = 0, -+ PRUETH_MAC1, -+ PRUETH_NUM_MACS, -+}; -+ -+/* In both switch & emac modes there are 3 port queues -+ * EMAC mode: -+ * RX packets for both MII0 & MII1 ports come on -+ * QUEUE_HOST. -+ * TX packets for MII0 go on QUEUE_MII0, TX packets -+ * for MII1 go on QUEUE_MII1. -+ * Switch mode: -+ * Host port RX packets come on QUEUE_HOST -+ * TX packets might have to go on MII0 or MII1 or both. -+ * MII0 TX queue is QUEUE_MII0 and MII1 TX queue is -+ * QUEUE_MII1. -+ */ -+enum prueth_port_queue_id { -+ PRUETH_PORT_QUEUE_HOST = 0, -+ PRUETH_PORT_QUEUE_MII0, -+ PRUETH_PORT_QUEUE_MII1, -+ PRUETH_PORT_QUEUE_MAX, -+}; -+ -+/* Each port queue has 4 queues and 1 collision queue */ -+enum prueth_queue_id { -+ PRUETH_QUEUE1 = 0, -+ PRUETH_QUEUE2, -+ PRUETH_QUEUE3, -+ PRUETH_QUEUE4, -+ PRUETH_COLQUEUE, /* collision queue */ -+}; -+ -+/* PRUeth memory range identifiers */ -+enum prueth_mem { -+ PRUETH_MEM_DRAM0 = 0, -+ PRUETH_MEM_DRAM1, -+ PRUETH_MEM_SHARED_RAM, -+ PRUETH_MEM_OCMC, -+ PRUETH_MEM_MAX, -+}; -+ -+/* ensure that order of PRUSS mem regions is same as above */ -+static enum pruss_mem pruss_mem_ids[] = { PRUSS_MEM_DRAM0, PRUSS_MEM_DRAM1, -+ PRUSS_MEM_SHRD_RAM2 }; -+ -+/** -+ * struct prueth_private_data - PRU Ethernet private data -+ * @fw_names: firmware names to be used for PRUSS ethernet usecases -+ */ -+struct prueth_private_data { -+ const char *fw_names[PRUETH_NUM_MACS]; -+}; -+ -+/* data for each emac port */ -+struct prueth_emac { -+ struct prueth *prueth; -+ struct net_device *ndev; -+ u8 mac_addr[6]; -+ struct napi_struct napi; -+ u32 msg_enable; -+ -+ int link; -+ int speed; -+ int duplex; -+ -+ const char *phy_id; -+ struct device_node *phy_node; -+ int phy_if; -+ struct phy_device *phydev; -+ struct rproc *pru; -+ -+ enum prueth_port port_id; -+ enum prueth_port_queue_id tx_port_queue; -+ -+ enum prueth_queue_id rx_queue_start; -+ enum prueth_queue_id rx_queue_end; -+ -+ enum prueth_mem dram; -+ -+ int rx_irq; -+ int tx_irq; -+ -+ struct prueth_queue_desc __iomem *rx_queue_descs; -+ struct prueth_queue_desc __iomem *tx_queue_descs; -+ -+ struct port_statistics stats; /* stats holder when i/f is down */ -+ -+ spinlock_t lock; /* serialize access */ -+}; -+ -+/** -+ * struct prueth - PRUeth structure -+ * @dev: device -+ * @pruss: pruss handle -+ * @pru0: rproc instance to PRU0 -+ * @pru1: rproc instance to PRU1 -+ * @mem: PRUSS memory resources we need to access -+ * @sram_pool: OCMC ram pool for buffers -+ * @mii_rt: regmap to mii_rt block -+ * @iep: regmap to IEP block -+ * -+ * @eth_node: node for each emac node -+ * @emac: emac data for three ports, one host and two physical -+ * @registered_netdevs: net device for each registered emac -+ */ -+struct prueth { -+ struct device *dev; -+ struct pruss *pruss; -+ struct rproc *pru0, *pru1; -+ struct pruss_mem_region mem[PRUETH_MEM_MAX]; -+ struct gen_pool *sram_pool; -+ struct regmap *mii_rt; -+ struct regmap *iep; -+ -+ struct device_node *eth_node[PRUETH_NUM_MACS]; -+ struct prueth_emac *emac[PRUETH_NUM_MACS]; -+ struct net_device *registered_netdevs[PRUETH_NUM_MACS]; -+}; -+ -+static inline u32 prueth_read_reg(struct prueth *prueth, -+ enum prueth_mem region, -+ unsigned int reg) -+{ -+ return readl_relaxed(prueth->mem[region].va + reg); -+} -+ -+static inline void prueth_write_reg(struct prueth *prueth, -+ enum prueth_mem region, -+ unsigned int reg, u32 val) -+{ -+ writel_relaxed(val, prueth->mem[region].va + reg); -+} -+ -+static inline -+void prueth_set_reg(struct prueth *prueth, enum prueth_mem region, -+ unsigned int reg, u32 mask, u32 set) -+{ -+ u32 val; -+ -+ val = prueth_read_reg(prueth, region, reg); -+ val &= ~mask; -+ val |= (set & mask); -+ prueth_write_reg(prueth, region, reg, val); -+} -+ -+static const struct prueth_queue_info queue_infos[][4] = { -+ [PRUETH_PORT_QUEUE_HOST] = { -+ [PRUETH_QUEUE1] = { -+ P0_Q1_BUFFER_OFFSET, -+ HOST_QUEUE_DESC_OFFSET, -+ P0_Q1_BD_OFFSET, -+ P0_Q1_BD_OFFSET + ((HOST_QUEUE_1_SIZE - 1) * BD_SIZE), -+ }, -+ [PRUETH_QUEUE2] = { -+ P0_Q2_BUFFER_OFFSET, -+ HOST_QUEUE_DESC_OFFSET + 8, -+ P0_Q2_BD_OFFSET, -+ P0_Q2_BD_OFFSET + ((HOST_QUEUE_2_SIZE - 1) * BD_SIZE), -+ }, -+ [PRUETH_QUEUE3] = { -+ P0_Q3_BUFFER_OFFSET, -+ HOST_QUEUE_DESC_OFFSET + 16, -+ P0_Q3_BD_OFFSET, -+ P0_Q3_BD_OFFSET + ((HOST_QUEUE_3_SIZE - 1) * BD_SIZE), -+ }, -+ [PRUETH_QUEUE4] = { -+ P0_Q4_BUFFER_OFFSET, -+ HOST_QUEUE_DESC_OFFSET + 24, -+ P0_Q4_BD_OFFSET, -+ P0_Q4_BD_OFFSET + ((HOST_QUEUE_4_SIZE - 1) * BD_SIZE), -+ }, -+ }, -+ [PRUETH_PORT_QUEUE_MII0] = { -+ [PRUETH_QUEUE1] = { -+ P1_Q1_BUFFER_OFFSET, -+ P1_Q1_BUFFER_OFFSET + ((QUEUE_1_SIZE - 1) * ICSS_BLOCK_SIZE), -+ P1_Q1_BD_OFFSET, -+ P1_Q1_BD_OFFSET + ((QUEUE_1_SIZE - 1) * BD_SIZE), -+ }, -+ [PRUETH_QUEUE2] = { -+ P1_Q2_BUFFER_OFFSET, -+ P1_Q2_BUFFER_OFFSET + ((QUEUE_2_SIZE - 1) * ICSS_BLOCK_SIZE), -+ P1_Q2_BD_OFFSET, -+ P1_Q2_BD_OFFSET + ((QUEUE_2_SIZE - 1) * BD_SIZE), -+ }, -+ [PRUETH_QUEUE3] = { -+ P1_Q3_BUFFER_OFFSET, -+ P1_Q3_BUFFER_OFFSET + ((QUEUE_3_SIZE - 1) * ICSS_BLOCK_SIZE), -+ P1_Q3_BD_OFFSET, -+ P1_Q3_BD_OFFSET + ((QUEUE_3_SIZE - 1) * BD_SIZE), -+ }, -+ [PRUETH_QUEUE4] = { -+ P1_Q4_BUFFER_OFFSET, -+ P1_Q4_BUFFER_OFFSET + ((QUEUE_4_SIZE - 1) * ICSS_BLOCK_SIZE), -+ P1_Q4_BD_OFFSET, -+ P1_Q4_BD_OFFSET + ((QUEUE_4_SIZE - 1) * BD_SIZE), -+ }, -+ }, -+ [PRUETH_PORT_QUEUE_MII1] = { -+ [PRUETH_QUEUE1] = { -+ P2_Q1_BUFFER_OFFSET, -+ P2_Q1_BUFFER_OFFSET + ((QUEUE_1_SIZE - 1) * ICSS_BLOCK_SIZE), -+ P2_Q1_BD_OFFSET, -+ P2_Q1_BD_OFFSET + ((QUEUE_1_SIZE - 1) * BD_SIZE), -+ }, -+ [PRUETH_QUEUE2] = { -+ P2_Q2_BUFFER_OFFSET, -+ P2_Q2_BUFFER_OFFSET + ((QUEUE_2_SIZE - 1) * ICSS_BLOCK_SIZE), -+ P2_Q2_BD_OFFSET, -+ P2_Q2_BD_OFFSET + ((QUEUE_2_SIZE - 1) * BD_SIZE), -+ }, -+ [PRUETH_QUEUE3] = { -+ P2_Q3_BUFFER_OFFSET, -+ P2_Q3_BUFFER_OFFSET + ((QUEUE_3_SIZE - 1) * ICSS_BLOCK_SIZE), -+ P2_Q3_BD_OFFSET, -+ P2_Q3_BD_OFFSET + ((QUEUE_3_SIZE - 1) * BD_SIZE), -+ }, -+ [PRUETH_QUEUE4] = { -+ P2_Q4_BUFFER_OFFSET, -+ P2_Q4_BUFFER_OFFSET + ((QUEUE_4_SIZE - 1) * ICSS_BLOCK_SIZE), -+ P2_Q4_BD_OFFSET, -+ P2_Q4_BD_OFFSET + ((QUEUE_4_SIZE - 1) * BD_SIZE), -+ }, -+ }, -+}; -+ -+static const struct prueth_queue_desc queue_descs[][4] = { -+ [PRUETH_PORT_QUEUE_HOST] = { -+ { .rd_ptr = P0_Q1_BD_OFFSET, .wr_ptr = P0_Q1_BD_OFFSET, }, -+ { .rd_ptr = P0_Q2_BD_OFFSET, .wr_ptr = P0_Q2_BD_OFFSET, }, -+ { .rd_ptr = P0_Q3_BD_OFFSET, .wr_ptr = P0_Q3_BD_OFFSET, }, -+ { .rd_ptr = P0_Q4_BD_OFFSET, .wr_ptr = P0_Q4_BD_OFFSET, }, -+ }, -+ [PRUETH_PORT_QUEUE_MII0] = { -+ { .rd_ptr = P1_Q1_BD_OFFSET, .wr_ptr = P1_Q1_BD_OFFSET, }, -+ { .rd_ptr = P1_Q2_BD_OFFSET, .wr_ptr = P1_Q2_BD_OFFSET, }, -+ { .rd_ptr = P1_Q3_BD_OFFSET, .wr_ptr = P1_Q3_BD_OFFSET, }, -+ { .rd_ptr = P1_Q4_BD_OFFSET, .wr_ptr = P1_Q4_BD_OFFSET, }, -+ }, -+ [PRUETH_PORT_QUEUE_MII1] = { -+ { .rd_ptr = P2_Q1_BD_OFFSET, .wr_ptr = P2_Q1_BD_OFFSET, }, -+ { .rd_ptr = P2_Q2_BD_OFFSET, .wr_ptr = P2_Q2_BD_OFFSET, }, -+ { .rd_ptr = P2_Q3_BD_OFFSET, .wr_ptr = P2_Q3_BD_OFFSET, }, -+ { .rd_ptr = P2_Q4_BD_OFFSET, .wr_ptr = P2_Q4_BD_OFFSET, }, -+ } -+}; -+ -+static int prueth_hostconfig(struct prueth *prueth) -+{ -+ void __iomem *sram_base = prueth->mem[PRUETH_MEM_SHARED_RAM].va; -+ void __iomem *sram; -+ -+ /* queue size lookup table */ -+ sram = sram_base + HOST_QUEUE_SIZE_ADDR; -+ writew(HOST_QUEUE_1_SIZE, sram); -+ writew(HOST_QUEUE_2_SIZE, sram + 2); -+ writew(HOST_QUEUE_3_SIZE, sram + 4); -+ writew(HOST_QUEUE_4_SIZE, sram + 6); -+ -+ /* queue information table */ -+ sram = sram_base + HOST_Q1_RX_CONTEXT_OFFSET; -+ memcpy_toio(sram, queue_infos[PRUETH_PORT_QUEUE_HOST], -+ sizeof(queue_infos[PRUETH_PORT_QUEUE_HOST])); -+ -+ /* buffer offset table */ -+ sram = sram_base + HOST_QUEUE_OFFSET_ADDR; -+ writew(P0_Q1_BUFFER_OFFSET, sram); -+ writew(P0_Q2_BUFFER_OFFSET, sram + 2); -+ writew(P0_Q3_BUFFER_OFFSET, sram + 4); -+ writew(P0_Q4_BUFFER_OFFSET, sram + 6); -+ -+ /* buffer descriptor offset table*/ -+ sram = sram_base + HOST_QUEUE_DESCRIPTOR_OFFSET_ADDR; -+ writew(P0_Q1_BD_OFFSET, sram); -+ writew(P0_Q2_BD_OFFSET, sram + 2); -+ writew(P0_Q3_BD_OFFSET, sram + 4); -+ writew(P0_Q4_BD_OFFSET, sram + 6); -+ -+ /* queue table */ -+ sram = sram_base + HOST_QUEUE_DESC_OFFSET; -+ memcpy_toio(sram, queue_descs[PRUETH_PORT_QUEUE_HOST], -+ sizeof(queue_descs[PRUETH_PORT_QUEUE_HOST])); -+ -+ return 0; -+} -+ -+#define prueth_mii_set(dir, port, mask, set) \ -+ regmap_update_bits(prueth->mii_rt, PRUSS_MII_RT_##dir##CFG##port, \ -+ PRUSS_MII_RT_##dir##CFG_##dir##_##mask, set) -+ -+static void prueth_mii_init(struct prueth *prueth) -+{ -+ /* Configuration of Port 0 Rx */ -+ prueth_mii_set(RX, 0, ENABLE, PRUSS_MII_RT_RXCFG_RX_ENABLE); -+ prueth_mii_set(RX, 0, DATA_RDY_MODE_DIS, -+ PRUSS_MII_RT_RXCFG_RX_DATA_RDY_MODE_DIS); -+ prueth_mii_set(RX, 0, MUX_SEL, 0x0); -+ prueth_mii_set(RX, 0, L2_EN, PRUSS_MII_RT_RXCFG_RX_L2_EN); -+ prueth_mii_set(RX, 0, CUT_PREAMBLE, PRUSS_MII_RT_RXCFG_RX_CUT_PREAMBLE); -+ prueth_mii_set(RX, 0, L2_EOF_SCLR_DIS, -+ PRUSS_MII_RT_RXCFG_RX_L2_EOF_SCLR_DIS); -+ -+ /* Configuration of Port 0 Tx */ -+ prueth_mii_set(TX, 0, ENABLE, PRUSS_MII_RT_TXCFG_TX_ENABLE); -+ prueth_mii_set(TX, 0, AUTO_PREAMBLE, -+ PRUSS_MII_RT_TXCFG_TX_AUTO_PREAMBLE); -+ prueth_mii_set(TX, 0, 32_MODE_EN, PRUSS_MII_RT_TXCFG_TX_32_MODE_EN); -+ prueth_mii_set(TX, 0, MUX_SEL, 0x0); -+ prueth_mii_set(TX, 0, START_DELAY_MASK, -+ TX_START_DELAY << PRUSS_MII_RT_TXCFG_TX_START_DELAY_SHIFT); -+ prueth_mii_set(TX, 0, CLK_DELAY_MASK, -+ TX_CLK_DELAY << PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_SHIFT); -+ -+ /* Configuration of Port 1 Rx */ -+ prueth_mii_set(RX, 1, ENABLE, PRUSS_MII_RT_RXCFG_RX_ENABLE); -+ prueth_mii_set(RX, 1, -+ DATA_RDY_MODE_DIS, PRUSS_MII_RT_RXCFG_RX_DATA_RDY_MODE_DIS); -+ prueth_mii_set(RX, 1, MUX_SEL, PRUSS_MII_RT_RXCFG_RX_MUX_SEL); -+ prueth_mii_set(RX, 1, L2_EN, PRUSS_MII_RT_RXCFG_RX_L2_EN); -+ prueth_mii_set(RX, 1, CUT_PREAMBLE, PRUSS_MII_RT_RXCFG_RX_CUT_PREAMBLE); -+ prueth_mii_set(RX, 1, L2_EOF_SCLR_DIS, -+ PRUSS_MII_RT_RXCFG_RX_L2_EOF_SCLR_DIS); -+ -+ /* Configuration of Port 1 Tx */ -+ prueth_mii_set(TX, 1, ENABLE, PRUSS_MII_RT_TXCFG_TX_ENABLE); -+ prueth_mii_set(TX, 1, AUTO_PREAMBLE, -+ PRUSS_MII_RT_TXCFG_TX_AUTO_PREAMBLE); -+ prueth_mii_set(TX, 1, 32_MODE_EN, PRUSS_MII_RT_TXCFG_TX_32_MODE_EN); -+ prueth_mii_set(TX, 1, MUX_SEL, PRUSS_MII_RT_TXCFG_TX_MUX_SEL); -+ prueth_mii_set(TX, 1, START_DELAY_MASK, -+ TX_START_DELAY << PRUSS_MII_RT_TXCFG_TX_START_DELAY_SHIFT); -+ prueth_mii_set(TX, 1, CLK_DELAY_MASK, -+ TX_CLK_DELAY << PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_SHIFT); -+} -+ -+static void prueth_clearmem(struct prueth *prueth, enum prueth_mem region) -+{ -+ memset_io(prueth->mem[region].va, 0, prueth->mem[region].size); -+} -+ -+static int prueth_hostinit(struct prueth *prueth) -+{ -+ /* Clear shared RAM */ -+ prueth_clearmem(prueth, PRUETH_MEM_SHARED_RAM); -+ -+ /* Clear OCMC RAM */ -+ prueth_clearmem(prueth, PRUETH_MEM_OCMC); -+ -+ /* Clear data RAMs */ -+ if (prueth->eth_node[PRUETH_MAC0]) -+ prueth_clearmem(prueth, PRUETH_MEM_DRAM0); -+ if (prueth->eth_node[PRUETH_MAC1]) -+ prueth_clearmem(prueth, PRUETH_MEM_DRAM1); -+ -+ /* Initialize host queues in shared RAM */ -+ prueth_hostconfig(prueth); -+ -+ /* Configure MII_RT */ -+ prueth_mii_init(prueth); -+ -+ /* Enable IEP Counter */ -+ regmap_update_bits(prueth->iep, PRUSS_IEP_GLOBAL_CFG, -+ PRUSS_IEP_GLOBAL_CFG_CNT_ENABLE, -+ PRUSS_IEP_GLOBAL_CFG_CNT_ENABLE); -+ -+ return 0; -+} -+ -+static int prueth_port_enable(struct prueth_emac *emac, bool enable) -+{ -+ void __iomem *port_ctrl; -+ struct prueth *prueth = emac->prueth; -+ -+ port_ctrl = prueth->mem[emac->dram].va + PORT_CONTROL_ADDR; -+ -+ writeb(!!enable, port_ctrl); -+ -+ return 0; -+} -+ -+static int prueth_emac_config(struct prueth_emac *emac) -+{ -+ struct prueth *prueth = emac->prueth; -+ -+ /* PRU needs local shared RAM address for C28 */ -+ u32 sharedramaddr = ICSS_LOCAL_SHARED_RAM; -+ -+ /* PRU needs real global OCMC address for C30*/ -+ u32 ocmcaddr = (u32)prueth->mem[PRUETH_MEM_OCMC].pa; -+ void __iomem *sram = prueth->mem[PRUETH_MEM_SHARED_RAM].va; -+ void __iomem *dram_base; -+ void __iomem *mac_addr; -+ void __iomem *dram; -+ -+ /* Clear data RAM */ -+ prueth_clearmem(prueth, emac->dram); -+ -+ dram_base = prueth->mem[emac->dram].va; -+ -+ /* setup mac address */ -+ mac_addr = dram_base + PORT_MAC_ADDR; -+ memcpy_toio(mac_addr, emac->mac_addr, 6); -+ -+ /* queue information table */ -+ dram = dram_base + TX_CONTEXT_Q1_OFFSET_ADDR; -+ memcpy_toio(dram, queue_infos[emac->port_id], -+ sizeof(queue_infos[emac->port_id])); -+ -+ /* queue table */ -+ dram = dram_base + PORT_QUEUE_DESC_OFFSET; -+ memcpy_toio(dram, queue_descs[emac->port_id], -+ sizeof(queue_descs[emac->port_id])); -+ -+ emac->rx_queue_descs = sram + HOST_QUEUE_DESC_OFFSET; -+ emac->tx_queue_descs = dram; -+ -+ /* Set in constant table C28 of PRU0 to ICSS Shared memory */ -+ pru_rproc_set_ctable(emac->pru, PRU_C28, sharedramaddr); -+ -+ /* Set in constant table C30 of PRU0 to OCMC memory */ -+ pru_rproc_set_ctable(emac->pru, PRU_C30, ocmcaddr); -+ -+ return 0; -+} -+ -+/* update phy/port status information for firmware */ -+static void emac_update_phystatus(struct prueth_emac *emac) -+{ -+ struct prueth *prueth = emac->prueth; -+ enum prueth_mem region; -+ u32 phy_speed, port_status = 0; -+ -+ region = emac->dram; -+ phy_speed = emac->speed; -+ prueth_write_reg(prueth, region, PHY_SPEED_OFFSET, phy_speed); -+ -+ if (emac->duplex == DUPLEX_HALF) -+ port_status |= PORT_IS_HD_MASK; -+ if (emac->link) -+ port_status |= PORT_LINK_MASK; -+ writeb(port_status, prueth->mem[region].va + PORT_STATUS_OFFSET); -+} -+ -+/* called back by PHY layer if there is change in link state of hw port*/ -+static void emac_adjust_link(struct net_device *ndev) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ struct phy_device *phydev = emac->phydev; -+ unsigned long flags; -+ bool new_state = false; -+ -+ spin_lock_irqsave(&emac->lock, flags); -+ -+ if (phydev->link) { -+ /* check the mode of operation - full/half duplex */ -+ if (phydev->duplex != emac->duplex) { -+ new_state = true; -+ emac->duplex = phydev->duplex; -+ } -+ if (phydev->speed != emac->speed) { -+ new_state = true; -+ emac->speed = phydev->speed; -+ } -+ if (!emac->link) { -+ new_state = true; -+ emac->link = 1; -+ } -+ } else if (emac->link) { -+ new_state = true; -+ emac->link = 0; -+ /* defaults for no link */ -+ -+ /* f/w only support 10 or 100 */ -+ emac->speed = SPEED_100; -+ -+ /* half duplex may not be supported by f/w */ -+ emac->duplex = DUPLEX_FULL; -+ } -+ -+ emac_update_phystatus(emac); -+ -+ if (new_state) -+ phy_print_status(phydev); -+ -+ if (emac->link) { -+ /* link ON */ -+ netif_carrier_on(ndev); -+ -+ /* reactivate the transmit queue if it is stopped */ -+ if (netif_running(ndev) && netif_queue_stopped(ndev)) -+ netif_wake_queue(ndev); -+ } else { -+ /* link OFF */ -+ netif_carrier_off(ndev); -+ if (!netif_queue_stopped(ndev)) -+ netif_stop_queue(ndev); -+ } -+ -+ spin_unlock_irqrestore(&emac->lock, flags); -+} -+ -+/** -+ * emac_tx_hardirq - EMAC Tx interrupt handler -+ * @irq: interrupt number -+ * @dev_id: pointer to net_device -+ * -+ * This is called whenever a packet has finished being transmitted, this clears -+ * up hardware buffer space, our only task is to re-enable the transmit queue -+ * if it was previously disabled due to hardware queue being full -+ * -+ * Returns interrupt handled condition -+ */ -+static irqreturn_t emac_tx_hardirq(int irq, void *dev_id) -+{ -+ struct net_device *ndev = (struct net_device *)dev_id; -+ -+ if (unlikely(netif_queue_stopped(ndev))) -+ netif_wake_queue(ndev); -+ -+ return IRQ_HANDLED; -+} -+ -+/** -+ * emac_rx_hardirq - EMAC Rx interrupt handler -+ * @irq: interrupt number -+ * @dev_id: pointer to net_device -+ * -+ * EMAC Interrupt handler - we only schedule NAPI and not process any packets -+ * here. -+ * -+ * Returns interrupt handled condition -+ */ -+static irqreturn_t emac_rx_hardirq(int irq, void *dev_id) -+{ -+ struct net_device *ndev = (struct net_device *)dev_id; -+ struct prueth_emac *emac = netdev_priv(ndev); -+ -+ if (likely(netif_running(ndev))) { -+ /* disable Rx system event */ -+ disable_irq_nosync(emac->rx_irq); -+ napi_schedule(&emac->napi); -+ } -+ -+ return IRQ_HANDLED; -+} -+ -+/** -+ * prueth_tx_enqueue - queue a packet to firmware for transmission -+ * -+ * @emac: EMAC data structure -+ * @skb: packet data buffer -+ * @queue_id: priority queue id -+ */ -+static int prueth_tx_enqueue(struct prueth_emac *emac, struct sk_buff *skb, -+ enum prueth_queue_id queue_id) -+{ -+ struct net_device *ndev = emac->ndev; -+ int pktlen; -+ struct prueth_queue_desc __iomem *queue_desc; -+ const struct prueth_queue_info *txqueue; -+ u16 bd_rd_ptr, bd_wr_ptr, update_wr_ptr; -+ int write_block, read_block, free_blocks, update_block, pkt_block_size; -+ unsigned int buffer_desc_count; -+ bool buffer_wrapped = false; -+ void *src_addr; -+ void *dst_addr; -+ -+ /* OCMC RAM is not cached and write order is not important */ -+ void *ocmc_ram = (__force void *)emac->prueth->mem[PRUETH_MEM_OCMC].va; -+ void __iomem *dram; -+ u32 wr_buf_desc; -+ int ret; -+ int txport = emac->tx_port_queue; /* which port to tx: MII0 or MII1 */ -+ -+ dram = emac->prueth->mem[emac->dram].va; -+ ret = skb_padto(skb, EMAC_MIN_PKTLEN); -+ if (ret) { -+ if (netif_msg_tx_err(emac) && net_ratelimit()) -+ netdev_err(ndev, "packet pad failed"); -+ return ret; -+ } -+ src_addr = skb->data; -+ -+ /* pad packet if needed */ -+ pktlen = skb->len; -+ if (pktlen < EMAC_MIN_PKTLEN) -+ pktlen = EMAC_MIN_PKTLEN; -+ -+ /* Get the tx queue */ -+ queue_desc = emac->tx_queue_descs + queue_id; -+ txqueue = &queue_infos[txport][queue_id]; -+ buffer_desc_count = txqueue->buffer_desc_end - -+ txqueue->buffer_desc_offset; -+ buffer_desc_count /= BD_SIZE; -+ buffer_desc_count++; -+ -+ bd_rd_ptr = readw(&queue_desc->rd_ptr); -+ bd_wr_ptr = readw(&queue_desc->wr_ptr); -+ -+ /* the PRU firmware deals mostly in pointers already -+ * offset into ram, we would like to deal in indexes -+ * within the queue we are working with for code -+ * simplicity, calculate this here -+ */ -+ write_block = (bd_wr_ptr - txqueue->buffer_desc_offset) / BD_SIZE; -+ read_block = (bd_rd_ptr - txqueue->buffer_desc_offset) / BD_SIZE; -+ if (write_block > read_block) { -+ free_blocks = buffer_desc_count - write_block; -+ free_blocks += read_block; -+ } else if (write_block < read_block) { -+ free_blocks = read_block - write_block; -+ } else { /* they are all free */ -+ free_blocks = buffer_desc_count; -+ } -+ pkt_block_size = DIV_ROUND_UP(pktlen, ICSS_BLOCK_SIZE); -+ if (pkt_block_size > free_blocks) /* out of queue space */ -+ return -ENOBUFS; -+ -+ /* calculate end BD address post write */ -+ update_block = write_block + pkt_block_size; -+ -+ /* Check for wrap around */ -+ if (update_block >= buffer_desc_count) { -+ update_block %= buffer_desc_count; -+ buffer_wrapped = true; -+ } -+ -+ dst_addr = ocmc_ram + txqueue->buffer_offset + -+ (write_block * ICSS_BLOCK_SIZE); -+ -+ /* Copy the data from socket buffer(DRAM) to PRU buffers(OCMC) */ -+ if (buffer_wrapped) { /* wrapped around buffer */ -+ int bytes = (buffer_desc_count - write_block) * ICSS_BLOCK_SIZE; -+ int remaining; -+ -+ /* bytes is integral multiple of ICSS_BLOCK_SIZE but -+ * entire packet may have fit within the last BD -+ * if pkt_info.length is not integral multiple of -+ * ICSS_BLOCK_SIZE -+ */ -+ if (pktlen < bytes) -+ bytes = pktlen; -+ -+ /* copy non-wrapped part */ -+ memcpy(dst_addr, src_addr, bytes); -+ -+ /* copy wrapped part */ -+ src_addr += bytes; -+ remaining = pktlen - bytes; -+ dst_addr = ocmc_ram + txqueue->buffer_offset; -+ memcpy(dst_addr, src_addr, remaining); -+ } else { -+ memcpy(dst_addr, src_addr, pktlen); -+ } -+ -+ /* update first buffer descriptor */ -+ wr_buf_desc = (pktlen << PRUETH_BD_LENGTH_SHIFT) & PRUETH_BD_LENGTH_MASK; -+ writel(wr_buf_desc, dram + bd_wr_ptr); -+ -+ /* update the write pointer in this queue descriptor, the firmware -+ * polls for this change so this will signal the start of transmission -+ */ -+ update_wr_ptr = txqueue->buffer_desc_offset + (update_block * BD_SIZE); -+ writew(update_wr_ptr, &queue_desc->wr_ptr); -+ -+ return 0; -+} -+ -+static void parse_packet_info(u32 buffer_descriptor, -+ struct prueth_packet_info *pkt_info) -+{ -+ pkt_info->shadow = !!(buffer_descriptor & PRUETH_BD_SHADOW_MASK); -+ pkt_info->port = (buffer_descriptor & PRUETH_BD_PORT_MASK) >> -+ PRUETH_BD_PORT_SHIFT; -+ pkt_info->length = (buffer_descriptor & PRUETH_BD_LENGTH_MASK) >> -+ PRUETH_BD_LENGTH_SHIFT; -+ pkt_info->broadcast = !!(buffer_descriptor & PRUETH_BD_BROADCAST_MASK); -+ pkt_info->error = !!(buffer_descriptor & PRUETH_BD_ERROR_MASK); -+} -+ -+/* get packet from queue -+ * negative for error -+ */ -+static int emac_rx_packet(struct prueth_emac *emac, u16 *bd_rd_ptr, -+ struct prueth_packet_info pkt_info, -+ const struct prueth_queue_info *rxqueue) -+{ -+ struct net_device *ndev = emac->ndev; -+ int read_block, update_block, pkt_block_size; -+ unsigned int buffer_desc_count; -+ bool buffer_wrapped = false; -+ struct sk_buff *skb; -+ void *src_addr; -+ void *dst_addr; -+ -+ /* OCMC RAM is not cached and read order is not important */ -+ void *ocmc_ram = (__force void *)emac->prueth->mem[PRUETH_MEM_OCMC].va; -+ -+ /* the PRU firmware deals mostly in pointers already -+ * offset into ram, we would like to deal in indexes -+ * within the queue we are working with for code -+ * simplicity, calculate this here -+ */ -+ buffer_desc_count = rxqueue->buffer_desc_end - -+ rxqueue->buffer_desc_offset; -+ buffer_desc_count /= BD_SIZE; -+ buffer_desc_count++; -+ read_block = (*bd_rd_ptr - rxqueue->buffer_desc_offset) / BD_SIZE; -+ pkt_block_size = DIV_ROUND_UP(pkt_info.length, ICSS_BLOCK_SIZE); -+ -+ /* calculate end BD address post read */ -+ update_block = read_block + pkt_block_size; -+ -+ /* Check for wrap around */ -+ if (update_block >= buffer_desc_count) { -+ update_block %= buffer_desc_count; -+ buffer_wrapped = true; -+ } -+ -+ /* calculate new pointer in ram */ -+ *bd_rd_ptr = rxqueue->buffer_desc_offset + (update_block * BD_SIZE); -+ -+ /* Allocate a socket buffer for this packet */ -+ skb = netdev_alloc_skb_ip_align(ndev, pkt_info.length); -+ if (!skb) { -+ if (netif_msg_rx_err(emac) && net_ratelimit()) -+ netdev_err(ndev, "failed rx buffer alloc\n"); -+ return -ENOMEM; -+ } -+ dst_addr = skb->data; -+ -+ /* Get the start address of the first buffer from -+ * the read buffer description -+ */ -+ src_addr = ocmc_ram + rxqueue->buffer_offset + (read_block * ICSS_BLOCK_SIZE); -+ -+ /* Copy the data from PRU buffers(OCMC) to socket buffer(DRAM) */ -+ if (buffer_wrapped) { /* wrapped around buffer */ -+ int bytes = (buffer_desc_count - read_block) * ICSS_BLOCK_SIZE; -+ int remaining; -+ -+ /* bytes is integral multiple of ICSS_BLOCK_SIZE but -+ * entire packet may have fit within the last BD -+ * if pkt_info.length is not integral multiple of -+ * ICSS_BLOCK_SIZE -+ */ -+ if (pkt_info.length < bytes) -+ bytes = pkt_info.length; -+ -+ /* copy non-wrapped part */ -+ memcpy(dst_addr, src_addr, bytes); -+ -+ /* copy wrapped part */ -+ dst_addr += bytes; -+ remaining = pkt_info.length - bytes; -+ src_addr = ocmc_ram + rxqueue->buffer_offset; -+ memcpy(dst_addr, src_addr, remaining); -+ } else { -+ memcpy(dst_addr, src_addr, pkt_info.length); -+ } -+ -+ /* send packet up the stack */ -+ skb_put(skb, pkt_info.length); -+ skb->protocol = eth_type_trans(skb, ndev); -+ netif_receive_skb(skb); -+ -+ /* update stats */ -+ ndev->stats.rx_bytes += pkt_info.length; -+ ndev->stats.rx_packets++; -+ -+ return 0; -+} -+ -+/* get upto quota number of packets */ -+static int emac_rx_packets(struct prueth_emac *emac, int quota) -+{ -+ int start_queue, end_queue; -+ struct prueth_queue_desc __iomem *queue_desc; -+ const struct prueth_queue_info *rxqueue; -+ u8 overflow_cnt; -+ u16 bd_rd_ptr, bd_wr_ptr, update_rd_ptr; -+ u32 rd_buf_desc; -+ void __iomem *shared_ram = emac->prueth->mem[PRUETH_MEM_SHARED_RAM].va; -+ struct prueth_packet_info pkt_info; -+ struct net_device_stats *ndevstats = &emac->ndev->stats; -+ int i, ret, used = 0; -+ -+ start_queue = emac->rx_queue_start; -+ end_queue = emac->rx_queue_end; -+ -+ /* search host queues for packets */ -+ for (i = start_queue; i <= end_queue; i++) { -+ queue_desc = emac->rx_queue_descs + i; -+ rxqueue = &queue_infos[PRUETH_PORT_HOST][i]; -+ -+ overflow_cnt = readb(&queue_desc->overflow_cnt); -+ if (overflow_cnt > 0) { -+ emac->ndev->stats.rx_over_errors += overflow_cnt; -+ -+ /* reset to zero */ -+ writeb(0, &queue_desc->overflow_cnt); -+ } -+ -+ bd_rd_ptr = readw(&queue_desc->rd_ptr); -+ bd_wr_ptr = readw(&queue_desc->wr_ptr); -+ -+ /* while packets are available in this queue */ -+ while (bd_rd_ptr != bd_wr_ptr) { -+ /* get packet info from the read buffer descriptor */ -+ rd_buf_desc = readl(shared_ram + bd_rd_ptr); -+ parse_packet_info(rd_buf_desc, &pkt_info); -+ -+ if (pkt_info.length <= 0) { -+ /* a packet length of zero will cause us to -+ * never move the read pointer ahead, locking -+ * the driver, so we manually have to move it -+ * to the write pointer, discarding all -+ * remaining packets in this queue. This should -+ * never happen. -+ */ -+ update_rd_ptr = bd_wr_ptr; -+ ndevstats->rx_length_errors++; -+ } else if (pkt_info.length > EMAC_MAX_PKTLEN) { -+ /* if the packet is too large we skip it but we -+ * still need to move the read pointer ahead -+ * and assume something is wrong with the read -+ * pointer as the firmware should be filtering -+ * these packets -+ */ -+ update_rd_ptr = bd_wr_ptr; -+ ndevstats->rx_length_errors++; -+ } else { -+ update_rd_ptr = bd_rd_ptr; -+ ret = emac_rx_packet(emac, &update_rd_ptr, -+ pkt_info, rxqueue); -+ if (ret) -+ return ret; -+ -+ used++; -+ } -+ -+ /* after reading the buffer descriptor we clear it -+ * to prevent improperly moved read pointer errors -+ * from simply looking like old packets. -+ */ -+ writel(0, shared_ram + bd_rd_ptr); -+ -+ /* update read pointer in queue descriptor */ -+ writew(update_rd_ptr, &queue_desc->rd_ptr); -+ bd_rd_ptr = update_rd_ptr; -+ -+ /* all we have room for? */ -+ if (used >= quota) -+ return used; -+ } -+ } -+ -+ return used; -+} -+ -+/* get statistics maintained by the PRU firmware into @pstats */ -+static void emac_get_stats(struct prueth_emac *emac, -+ struct port_statistics *pstats) -+{ -+ void __iomem *dram; -+ -+ dram = emac->prueth->mem[emac->dram].va; -+ memcpy_fromio(pstats, dram + STATISTICS_OFFSET, sizeof(*pstats)); -+} -+ -+/* set PRU firmware statistics */ -+static void emac_set_stats(struct prueth_emac *emac, -+ struct port_statistics *pstats) -+{ -+ void __iomem *dram; -+ -+ dram = emac->prueth->mem[emac->dram].va; -+ memcpy_fromio(dram + STATISTICS_OFFSET, pstats, sizeof(*pstats)); -+} -+ -+/** -+ * emac_napi_poll - EMAC NAPI Poll function -+ * @ndev: EMAC network adapter -+ * @budget: Number of receive packets to process (as told by NAPI layer) -+ * -+ * NAPI Poll function implemented to process packets as per budget. We check -+ * the type of interrupt on the device and accordingly call the TX or RX -+ * packet processing functions. We follow the budget for RX processing and -+ * also put a cap on number of TX pkts processed through config param. The -+ * NAPI schedule function is called if more packets pending. -+ * -+ * Returns number of packets received (in most cases; else TX pkts - rarely) -+ */ -+static int emac_napi_poll(struct napi_struct *napi, int budget) -+{ -+ struct prueth_emac *emac = container_of(napi, struct prueth_emac, napi); -+ int num_rx_packets; -+ -+ num_rx_packets = emac_rx_packets(emac, budget); -+ if (num_rx_packets < budget) { -+ napi_complete(napi); -+ -+ enable_irq(emac->rx_irq); -+ } -+ -+ return num_rx_packets; -+} -+ -+/** -+ * emac_ndo_open - EMAC device open -+ * @ndev: network adapter device -+ * -+ * Called when system wants to start the interface. -+ * -+ * Returns 0 for a successful open, or appropriate error code -+ */ -+static int emac_ndo_open(struct net_device *ndev) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ int ret; -+ -+ ret = request_irq(emac->rx_irq, emac_rx_hardirq, -+ IRQF_TRIGGER_HIGH | IRQF_ONESHOT, -+ ndev->name, ndev); -+ if (ret) { -+ netdev_err(ndev, "unable to request RX IRQ\n"); -+ return ret; -+ } -+ ret = request_irq(emac->tx_irq, emac_tx_hardirq, -+ IRQF_TRIGGER_HIGH | IRQF_ONESHOT, -+ ndev->name, ndev); -+ if (ret) { -+ netdev_err(ndev, "unable to request TX IRQ\n"); -+ goto free_rx_irq; -+ } -+ -+ /* set h/w MAC as user might have re-configured */ -+ ether_addr_copy(emac->mac_addr, ndev->dev_addr); -+ -+ netif_carrier_off(ndev); -+ -+ /* reset and start PRU firmware */ -+ prueth_emac_config(emac); -+ -+ /* restore stats */ -+ emac_set_stats(emac, &emac->stats); -+ -+ /* boot the PRU */ -+ ret = rproc_boot(emac->pru); -+ if (ret) { -+ netdev_err(ndev, "failed to boot PRU: %d\n", ret); -+ goto free_irq; -+ } -+ -+ /* start PHY */ -+ phy_start(emac->phydev); -+ napi_enable(&emac->napi); -+ -+ /* enable the port */ -+ prueth_port_enable(emac, true); -+ -+ if (netif_msg_drv(emac)) -+ dev_notice(&ndev->dev, "started\n"); -+ -+ return 0; -+ -+free_irq: -+ free_irq(emac->tx_irq, ndev); -+free_rx_irq: -+ free_irq(emac->rx_irq, ndev); -+ -+ return ret; -+} -+ -+/** -+ * emac_ndo_stop - EMAC device stop -+ * @ndev: network adapter device -+ * -+ * Called when system wants to stop or down the interface. -+ */ -+static int emac_ndo_stop(struct net_device *ndev) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ -+ /* disable the mac port */ -+ prueth_port_enable(emac, 0); -+ -+ /* stop PHY */ -+ phy_stop(emac->phydev); -+ -+ /* inform the upper layers. */ -+ netif_stop_queue(ndev); -+ napi_disable(&emac->napi); -+ netif_carrier_off(ndev); -+ -+ /* stop the PRU */ -+ rproc_shutdown(emac->pru); -+ -+ /* save stats */ -+ emac_get_stats(emac, &emac->stats); -+ -+ /* free rx and tx interrupts */ -+ free_irq(emac->tx_irq, ndev); -+ free_irq(emac->rx_irq, ndev); -+ -+ if (netif_msg_drv(emac)) -+ dev_notice(&ndev->dev, "stopped\n"); -+ -+ return 0; -+} -+ -+/** -+ * emac_ndo_start_xmit - EMAC Transmit function -+ * @skb: SKB pointer -+ * @ndev: EMAC network adapter -+ * -+ * Called by the system to transmit a packet - we queue the packet in -+ * EMAC hardware transmit queue -+ * -+ * Returns success(NETDEV_TX_OK) or error code (typically out of desc's) -+ */ -+static int emac_ndo_start_xmit(struct sk_buff *skb, struct net_device *ndev) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ int ret = 0; -+ -+ if (unlikely(!emac->link)) { -+ if (netif_msg_tx_err(emac) && net_ratelimit()) -+ netdev_err(ndev, "No link to transmit"); -+ goto fail_tx; -+ } -+ -+ /* we don't yet support different TX priority queues */ -+ ret = prueth_tx_enqueue(emac, skb, PRUETH_QUEUE4); -+ if (ret) { -+ if (ret != -ENOBUFS && netif_msg_tx_err(emac) && net_ratelimit()) -+ netdev_err(ndev, "packet queue failed: %d\n", ret); -+ goto fail_tx; -+ } -+ -+ ndev->stats.tx_packets++; -+ ndev->stats.tx_bytes += skb->len; -+ dev_kfree_skb_any(skb); -+ -+ return NETDEV_TX_OK; -+ -+fail_tx: -+ if (ret == -ENOBUFS) { -+ /* no free TX queue */ -+ netif_stop_queue(ndev); -+ ret = NETDEV_TX_BUSY; -+ } else { -+ /* error */ -+ ndev->stats.tx_dropped++; -+ ret = NET_XMIT_DROP; -+ } -+ -+ return ret; -+} -+ -+/** -+ * emac_ndo_tx_timeout - EMAC Transmit timeout function -+ * @ndev: The EMAC network adapter -+ * -+ * Called when system detects that a skb timeout period has expired -+ * potentially due to a fault in the adapter in not being able to send -+ * it out on the wire. -+ */ -+static void emac_ndo_tx_timeout(struct net_device *ndev) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ -+ if (netif_msg_tx_err(emac)) -+ netdev_err(ndev, "xmit timeout"); -+ -+ ndev->stats.tx_errors++; -+ -+ /* TODO: can we recover or need to reboot firmware? */ -+ -+ netif_wake_queue(ndev); -+} -+ -+/** -+ * emac_ndo_getstats - EMAC get statistics function -+ * @ndev: The EMAC network adapter -+ * -+ * Called when system wants to get statistics from the device. -+ * -+ * We return the statistics in net_device_stats structure pulled from emac -+ */ -+static struct net_device_stats *emac_ndo_get_stats(struct net_device *ndev) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ struct port_statistics pstats; -+ struct net_device_stats *stats = &ndev->stats; -+ -+ emac_get_stats(emac, &pstats); -+ stats->collisions = pstats.late_coll + pstats.single_coll + -+ pstats.multi_coll + pstats.excess_coll; -+ stats->multicast = pstats.rx_mcast; -+ -+ return stats; -+} -+ -+/** -+ * emac_ndo_set_rx_mode - EMAC set receive mode function -+ * @ndev: The EMAC network adapter -+ * -+ * Called when system wants to set the receive mode of the device. -+ * -+ */ -+static void emac_ndo_set_rx_mode(struct net_device *ndev) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ struct prueth *prueth = emac->prueth; -+ void __iomem *sram = prueth->mem[PRUETH_MEM_SHARED_RAM].va; -+ u32 reg = readl(sram + EMAC_PROMISCUOUS_MODE_OFFSET); -+ u32 mask; -+ -+ switch (emac->port_id) { -+ case PRUETH_PORT_MII0: -+ mask = EMAC_P1_PROMISCUOUS_BIT; -+ break; -+ case PRUETH_PORT_MII1: -+ mask = EMAC_P2_PROMISCUOUS_BIT; -+ break; -+ default: -+ netdev_err(ndev, "%s: invalid port\n", __func__); -+ return; -+ } -+ -+ if (ndev->flags & IFF_PROMISC) { -+ /* Enable promiscuous mode */ -+ reg |= mask; -+ } else { -+ /* Disable promiscuous mode */ -+ reg &= ~mask; -+ } -+ -+ writel(reg, sram + EMAC_PROMISCUOUS_MODE_OFFSET); -+} -+ -+static const struct net_device_ops emac_netdev_ops = { -+ .ndo_open = emac_ndo_open, -+ .ndo_stop = emac_ndo_stop, -+ .ndo_start_xmit = emac_ndo_start_xmit, -+ .ndo_set_mac_address = eth_mac_addr, -+ .ndo_validate_addr = eth_validate_addr, -+ .ndo_change_mtu = eth_change_mtu, -+ .ndo_tx_timeout = emac_ndo_tx_timeout, -+ .ndo_get_stats = emac_ndo_get_stats, -+ .ndo_set_rx_mode = emac_ndo_set_rx_mode, -+}; -+ -+/** -+ * emac_get_drvinfo - Get EMAC driver information -+ * @ndev: The network adapter -+ * @info: ethtool info structure containing name and version -+ * -+ * Returns EMAC driver information (name and version) -+ */ -+static void emac_get_drvinfo(struct net_device *ndev, -+ struct ethtool_drvinfo *info) -+{ -+ strlcpy(info->driver, PRUETH_MODULE_DESCRIPTION, sizeof(info->driver)); -+ strlcpy(info->version, PRUETH_MODULE_VERSION, sizeof(info->version)); -+} -+ -+/** -+ * emac_get_link_ksettings - Get EMAC settings -+ * @ndev: The network adapter -+ * @ecmd: ethtool command -+ * -+ * Executes ethool get command -+ */ -+static int emac_get_link_ksettings(struct net_device *ndev, -+ struct ethtool_link_ksettings *ecmd) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ -+ if (!emac->phydev) -+ return -EOPNOTSUPP; -+ -+ phy_ethtool_ksettings_get(emac->phydev, ecmd); -+ return 0; -+} -+ -+/** -+ * emac_set_link_ksettings - Set EMAC settings -+ * @ndev: The EMAC network adapter -+ * @ecmd: ethtool command -+ * -+ * Executes ethool set command -+ */ -+static int emac_set_link_ksettings(struct net_device *ndev, -+ const struct ethtool_link_ksettings *ecmd) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ -+ if (!emac->phydev) -+ return -EOPNOTSUPP; -+ -+ return phy_ethtool_ksettings_set(emac->phydev, ecmd); -+} -+ -+#define PRUETH_STAT_OFFSET(m) offsetof(struct port_statistics, m) -+ -+static const struct { -+ char string[ETH_GSTRING_LEN]; -+ u32 offset; -+} prueth_ethtool_stats[] = { -+ {"txBcast", PRUETH_STAT_OFFSET(tx_bcast)}, -+ {"txMcast", PRUETH_STAT_OFFSET(tx_mcast)}, -+ {"txUcast", PRUETH_STAT_OFFSET(tx_ucast)}, -+ {"txOctets", PRUETH_STAT_OFFSET(tx_octets)}, -+ {"rxBcast", PRUETH_STAT_OFFSET(rx_bcast)}, -+ {"rxMcast", PRUETH_STAT_OFFSET(rx_mcast)}, -+ {"rxUcast", PRUETH_STAT_OFFSET(rx_ucast)}, -+ {"rxOctets", PRUETH_STAT_OFFSET(rx_octets)}, -+ -+ {"tx64byte", PRUETH_STAT_OFFSET(tx64byte)}, -+ {"tx65_127byte", PRUETH_STAT_OFFSET(tx65_127byte)}, -+ {"tx128_255byte", PRUETH_STAT_OFFSET(tx128_255byte)}, -+ {"tx256_511byte", PRUETH_STAT_OFFSET(tx256_511byte)}, -+ {"tx512_1023byte", PRUETH_STAT_OFFSET(tx512_1023byte)}, -+ {"tx1024byte", PRUETH_STAT_OFFSET(tx1024byte)}, -+ {"rx64byte", PRUETH_STAT_OFFSET(rx64byte)}, -+ {"rx65_127byte", PRUETH_STAT_OFFSET(rx65_127byte)}, -+ {"rx128_255byte", PRUETH_STAT_OFFSET(rx128_255byte)}, -+ {"rx256_511byte", PRUETH_STAT_OFFSET(rx256_511byte)}, -+ {"rx512_1023byte", PRUETH_STAT_OFFSET(rx512_1023byte)}, -+ {"rx1024byte", PRUETH_STAT_OFFSET(rx1024byte)}, -+ -+ {"lateColl", PRUETH_STAT_OFFSET(late_coll)}, -+ {"singleColl", PRUETH_STAT_OFFSET(single_coll)}, -+ {"multiColl", PRUETH_STAT_OFFSET(multi_coll)}, -+ {"excessColl", PRUETH_STAT_OFFSET(excess_coll)}, -+ -+ {"rxMisAlignmentFrames", PRUETH_STAT_OFFSET(rx_misalignment_frames)}, -+ {"stormPrevCounter", PRUETH_STAT_OFFSET(stormprev_counter)}, -+ {"macRxError", PRUETH_STAT_OFFSET(mac_rxerror)}, -+ {"SFDError", PRUETH_STAT_OFFSET(sfd_error)}, -+ {"defTx", PRUETH_STAT_OFFSET(def_tx)}, -+ {"macTxError", PRUETH_STAT_OFFSET(mac_txerror)}, -+ {"rxOverSizedFrames", PRUETH_STAT_OFFSET(rx_oversized_frames)}, -+ {"rxUnderSizedFrames", PRUETH_STAT_OFFSET(rx_undersized_frames)}, -+ {"rxCRCFrames", PRUETH_STAT_OFFSET(rx_crc_frames)}, -+ {"droppedPackets", PRUETH_STAT_OFFSET(dropped_packets)}, -+ -+ {"txHWQOverFlow", PRUETH_STAT_OFFSET(tx_hwq_overflow)}, -+ {"txHWQUnderFlow", PRUETH_STAT_OFFSET(tx_hwq_underflow)}, -+}; -+ -+static int emac_get_sset_count(struct net_device *ndev, int stringset) -+{ -+ switch (stringset) { -+ case ETH_SS_STATS: -+ return ARRAY_SIZE(prueth_ethtool_stats); -+ default: -+ return -EOPNOTSUPP; -+ } -+} -+ -+static void emac_get_strings(struct net_device *ndev, u32 stringset, u8 *data) -+{ -+ u8 *p = data; -+ int i; -+ -+ switch (stringset) { -+ case ETH_SS_STATS: -+ for (i = 0; i < ARRAY_SIZE(prueth_ethtool_stats); i++) { -+ memcpy(p, prueth_ethtool_stats[i].string, -+ ETH_GSTRING_LEN); -+ p += ETH_GSTRING_LEN; -+ } -+ break; -+ default: -+ break; -+ } -+} -+ -+static void emac_get_ethtool_stats(struct net_device *ndev, -+ struct ethtool_stats *stats, u64 *data) -+{ -+ struct prueth_emac *emac = netdev_priv(ndev); -+ struct port_statistics pstats; -+ u32 val; -+ int i; -+ void *ptr; -+ -+ emac_get_stats(emac, &pstats); -+ -+ for (i = 0; i < ARRAY_SIZE(prueth_ethtool_stats); i++) { -+ ptr = &pstats; -+ ptr += prueth_ethtool_stats[i].offset; -+ val = *(u32 *)ptr; -+ data[i] = val; -+ } -+} -+ -+/* Ethtool support for EMAC adapter */ -+static const struct ethtool_ops emac_ethtool_ops = { -+ .get_drvinfo = emac_get_drvinfo, -+ .get_link_ksettings = emac_get_link_ksettings, -+ .set_link_ksettings = emac_set_link_ksettings, -+ .get_link = ethtool_op_get_link, -+ .get_ts_info = ethtool_op_get_ts_info, -+ .get_sset_count = emac_get_sset_count, -+ .get_strings = emac_get_strings, -+ .get_ethtool_stats = emac_get_ethtool_stats, -+}; -+ -+/* get emac_port corresponding to eth_node name */ -+static int prueth_node_port(struct device_node *eth_node) -+{ -+ if (!strcmp(eth_node->name, "ethernet-mii0")) -+ return PRUETH_PORT_MII0; -+ else if (!strcmp(eth_node->name, "ethernet-mii1")) -+ return PRUETH_PORT_MII1; -+ else -+ return -EINVAL; -+} -+ -+/* get MAC instance corresponding to eth_node name */ -+static int prueth_node_mac(struct device_node *eth_node) -+{ -+ if (!strcmp(eth_node->name, "ethernet-mii0")) -+ return PRUETH_MAC0; -+ else if (!strcmp(eth_node->name, "ethernet-mii1")) -+ return PRUETH_MAC1; -+ else -+ return -EINVAL; -+} -+ -+static int prueth_netdev_init(struct prueth *prueth, -+ struct device_node *eth_node) -+{ -+ enum prueth_port port; -+ enum prueth_mac mac; -+ struct net_device *ndev; -+ struct prueth_emac *emac; -+ const u8 *mac_addr; -+ int ret; -+ -+ port = prueth_node_port(eth_node); -+ if (port < 0) -+ return -EINVAL; -+ -+ mac = prueth_node_mac(eth_node); -+ if (mac < 0) -+ return -EINVAL; -+ -+ ndev = devm_alloc_etherdev(prueth->dev, sizeof(*emac)); -+ if (!ndev) -+ return -ENOMEM; -+ -+ SET_NETDEV_DEV(ndev, prueth->dev); -+ emac = netdev_priv(ndev); -+ prueth->emac[mac] = emac; -+ emac->prueth = prueth; -+ emac->ndev = ndev; -+ emac->port_id = port; -+ -+ switch (port) { -+ case PRUETH_PORT_MII0: -+ emac->tx_port_queue = PRUETH_PORT_QUEUE_MII0; -+ -+ /* packets from MII0 are on queues 1 through 2 */ -+ emac->rx_queue_start = PRUETH_QUEUE1; -+ emac->rx_queue_end = PRUETH_QUEUE2; -+ -+ emac->dram = PRUETH_MEM_DRAM0; -+ emac->pru = prueth->pru0; -+ break; -+ case PRUETH_PORT_MII1: -+ emac->tx_port_queue = PRUETH_PORT_QUEUE_MII1; -+ -+ /* packets from MII1 are on queues 3 through 4 */ -+ emac->rx_queue_start = PRUETH_QUEUE3; -+ emac->rx_queue_end = PRUETH_QUEUE4; -+ -+ emac->dram = PRUETH_MEM_DRAM1; -+ emac->pru = prueth->pru1; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ emac->rx_irq = of_irq_get_byname(eth_node, "rx"); -+ if (emac->rx_irq < 0) { -+ ret = emac->rx_irq; -+ if (ret != -EPROBE_DEFER) -+ dev_err(prueth->dev, "could not get rx irq\n"); -+ goto free; -+ } -+ emac->tx_irq = of_irq_get_byname(eth_node, "tx"); -+ if (emac->tx_irq < 0) { -+ ret = emac->tx_irq; -+ if (ret != -EPROBE_DEFER) -+ dev_err(prueth->dev, "could not get tx irq\n"); -+ goto free; -+ } -+ -+ emac->msg_enable = netif_msg_init(debug_level, PRUETH_EMAC_DEBUG); -+ spin_lock_init(&emac->lock); -+ -+ /* get mac address from DT and set private and netdev addr */ -+ mac_addr = of_get_mac_address(eth_node); -+ if (mac_addr) -+ ether_addr_copy(ndev->dev_addr, mac_addr); -+ if (!is_valid_ether_addr(ndev->dev_addr)) { -+ eth_hw_addr_random(ndev); -+ dev_warn(prueth->dev, "port %d: using random MAC addr: %pM\n", -+ port, ndev->dev_addr); -+ } -+ ether_addr_copy(emac->mac_addr, ndev->dev_addr); -+ -+ emac->phy_node = of_parse_phandle(eth_node, "phy-handle", 0); -+ if (!emac->phy_node) { -+ dev_err(prueth->dev, "couldn't find phy-handle\n"); -+ ret = -ENODEV; -+ goto free; -+ } -+ -+ emac->phy_if = of_get_phy_mode(eth_node); -+ if (emac->phy_if < 0) { -+ dev_err(prueth->dev, "could not get phy-mode property\n"); -+ ret = emac->phy_if; -+ goto free; -+ } -+ -+ /* connect PHY */ -+ emac->phydev = of_phy_connect(ndev, emac->phy_node, -+ &emac_adjust_link, 0, emac->phy_if); -+ if (!emac->phydev) { -+ dev_dbg(prueth->dev, "couldn't connect to phy %s\n", -+ emac->phy_node->full_name); -+ ret = -EPROBE_DEFER; -+ goto free; -+ } -+ -+ ndev->netdev_ops = &emac_netdev_ops; -+ ndev->ethtool_ops = &emac_ethtool_ops; -+ -+ netif_napi_add(ndev, &emac->napi, emac_napi_poll, EMAC_POLL_WEIGHT); -+ -+ return 0; -+ -+free: -+ prueth->emac[mac] = NULL; -+ -+ return ret; -+} -+ -+static void prueth_netdev_exit(struct prueth *prueth, -+ struct device_node *eth_node) -+{ -+ struct prueth_emac *emac; -+ enum prueth_mac mac; -+ -+ mac = prueth_node_mac(eth_node); -+ if (mac < 0) -+ return; -+ -+ emac = prueth->emac[mac]; -+ if (!emac) -+ return; -+ -+ dev_info(prueth->dev, "freeing port %d\n", mac); -+ -+ phy_disconnect(emac->phydev); -+ -+ netif_napi_del(&emac->napi); -+ prueth->emac[mac] = NULL; -+} -+ -+static const struct of_device_id prueth_dt_match[]; -+ -+static int prueth_probe(struct platform_device *pdev) -+{ -+ struct prueth *prueth; -+ struct device *dev = &pdev->dev; -+ struct device_node *np = dev->of_node; -+ struct device_node *eth0_node, *eth1_node; -+ const struct of_device_id *match; -+ struct pruss *pruss; -+ int i, ret; -+ -+ if (!np) -+ return -ENODEV; /* we don't support non DT */ -+ -+ match = of_match_device(prueth_dt_match, dev); -+ if (!match) -+ return -ENODEV; -+ -+ prueth = devm_kzalloc(dev, sizeof(*prueth), GFP_KERNEL); -+ if (!prueth) -+ return -ENOMEM; -+ -+ platform_set_drvdata(pdev, prueth); -+ -+ prueth->dev = dev; -+ -+ eth0_node = of_get_child_by_name(np, "ethernet-mii0"); -+ if (!of_device_is_available(eth0_node)) { -+ of_node_put(eth0_node); -+ eth0_node = NULL; -+ } -+ -+ eth1_node = of_get_child_by_name(np, "ethernet-mii1"); -+ if (!of_device_is_available(eth1_node)) { -+ of_node_put(eth1_node); -+ eth1_node = NULL; -+ } -+ -+ /* At least one node must be present and available else we fail */ -+ if (!eth0_node && !eth1_node) { -+ dev_err(dev, "neither ethernet-mii0 nor ethernet-mii1 node available\n"); -+ ret = -ENODEV; -+ goto put_node; -+ } -+ -+ prueth->eth_node[PRUETH_MAC0] = eth0_node; -+ prueth->eth_node[PRUETH_MAC1] = eth1_node; -+ -+ prueth->mii_rt = syscon_regmap_lookup_by_phandle(np, "mii-rt"); -+ if (IS_ERR(prueth->mii_rt)) { -+ dev_err(dev, "couldn't get mii-rt syscon regmap\n"); -+ return -ENODEV; -+ } -+ -+ prueth->iep = syscon_regmap_lookup_by_phandle(np, "iep"); -+ if (IS_ERR(prueth->iep)) { -+ dev_err(dev, "couldn't get iep syscon regmap\n"); -+ return -ENODEV; -+ } -+ -+ if (eth0_node) { -+ prueth->pru0 = pru_rproc_get(np, 0); -+ if (IS_ERR(prueth->pru0)) { -+ ret = PTR_ERR(prueth->pru0); -+ if (ret != -EPROBE_DEFER) -+ dev_err(dev, "unable to get PRU0: %d\n", ret); -+ goto put_node; -+ } -+ } -+ -+ if (eth1_node) { -+ prueth->pru1 = pru_rproc_get(np, 1); -+ if (IS_ERR(prueth->pru1)) { -+ ret = PTR_ERR(prueth->pru1); -+ if (ret != -EPROBE_DEFER) -+ dev_err(dev, "unable to get PRU1: %d\n", ret); -+ goto put_pru0; -+ } -+ } -+ -+ pruss = pruss_get(prueth->pru0 ? prueth->pru0 : prueth->pru1); -+ if (IS_ERR(pruss)) { -+ ret = PTR_ERR(pruss); -+ dev_err(dev, "unable to get pruss handle\n"); -+ goto put_pru1; -+ } -+ prueth->pruss = pruss; -+ -+ /* Configure PRUSS */ -+ if (eth0_node) -+ pru_rproc_set_gpimode(prueth->pru0, PRUSS_GPI_MODE_MII); -+ if (eth1_node) -+ pru_rproc_set_gpimode(prueth->pru1, PRUSS_GPI_MODE_MII); -+ pruss_cfg_miirt_enable(pruss, true); -+ pruss_cfg_xfr_enable(pruss, true); -+ -+ /* Get PRUSS mem resources */ -+ /* OCMC is system resource which we get separately */ -+ for (i = 0; i < ARRAY_SIZE(pruss_mem_ids); i++) { -+ /* skip appropriate DRAM if not required */ -+ if (!eth0_node && i == PRUETH_MEM_DRAM0) -+ continue; -+ -+ if (!eth1_node && i == PRUETH_MEM_DRAM1) -+ continue; -+ -+ ret = pruss_request_mem_region(pruss, pruss_mem_ids[i], -+ &prueth->mem[i]); -+ if (ret) { -+ dev_err(dev, "unable to get PRUSS resource %d: %d\n", -+ i, ret); -+ goto put_mem; -+ } -+ } -+ -+ prueth->sram_pool = of_gen_pool_get(np, "sram", 0); -+ if (!prueth->sram_pool) { -+ dev_err(dev, "unable to get SRAM pool\n"); -+ ret = -ENODEV; -+ -+ goto put_mem; -+ } -+ prueth->mem[PRUETH_MEM_OCMC].va = -+ (void __iomem *)gen_pool_alloc(prueth->sram_pool, -+ OCMC_RAM_SIZE); -+ if (!prueth->mem[PRUETH_MEM_OCMC].va) { -+ dev_err(dev, "unable to allocate OCMC resource\n"); -+ ret = -ENOMEM; -+ goto put_mem; -+ } -+ prueth->mem[PRUETH_MEM_OCMC].pa = -+ gen_pool_virt_to_phys(prueth->sram_pool, -+ (unsigned long)prueth->mem[PRUETH_MEM_OCMC].va); -+ prueth->mem[PRUETH_MEM_OCMC].size = OCMC_RAM_SIZE; -+ dev_dbg(dev, "ocmc: pa %pa va %p size %#zx\n", -+ &prueth->mem[PRUETH_MEM_OCMC].pa, -+ prueth->mem[PRUETH_MEM_OCMC].va, -+ prueth->mem[PRUETH_MEM_OCMC].size); -+ -+ /* setup netdev interfaces */ -+ if (eth0_node) { -+ ret = prueth_netdev_init(prueth, eth0_node); -+ if (ret) { -+ if (ret != -EPROBE_DEFER) { -+ dev_err(dev, "netdev init %s failed: %d\n", -+ eth0_node->name, ret); -+ } -+ goto free_pool; -+ } -+ } -+ -+ if (eth1_node) { -+ ret = prueth_netdev_init(prueth, eth1_node); -+ if (ret) { -+ if (ret != -EPROBE_DEFER) { -+ dev_err(dev, "netdev init %s failed: %d\n", -+ eth1_node->name, ret); -+ } -+ goto netdev_exit; -+ } -+ } -+ -+ ret = prueth_hostinit(prueth); -+ if (ret) { -+ dev_info(dev, "hostinit failed: %d\n", ret); -+ goto netdev_exit; -+ } -+ -+ /* register the network devices */ -+ if (eth0_node) { -+ ret = register_netdev(prueth->emac[PRUETH_MAC0]->ndev); -+ if (ret) { -+ dev_err(dev, "can't register netdev for port MII0"); -+ goto netdev_exit; -+ } -+ -+ prueth->registered_netdevs[PRUETH_MAC0] = prueth->emac[PRUETH_MAC0]->ndev; -+ } -+ -+ if (eth1_node) { -+ ret = register_netdev(prueth->emac[PRUETH_MAC1]->ndev); -+ if (ret) { -+ dev_err(dev, "can't register netdev for port MII1"); -+ goto netdev_unregister; -+ } -+ -+ prueth->registered_netdevs[PRUETH_MAC1] = prueth->emac[PRUETH_MAC1]->ndev; -+ } -+ -+ dev_info(dev, "TI PRU ethernet driver initialized: %s EMAC mode\n", -+ (!eth0_node || !eth1_node) ? "single" : "dual"); -+ -+ return 0; -+ -+netdev_unregister: -+ for (i = 0; i < PRUETH_NUM_MACS; i++) { -+ if (!prueth->registered_netdevs[i]) -+ continue; -+ unregister_netdev(prueth->registered_netdevs[i]); -+ } -+ -+netdev_exit: -+ for (i = 0; i < PRUETH_NUM_MACS; i++) { -+ struct device_node *eth_node; -+ -+ eth_node = prueth->eth_node[i]; -+ if (!eth_node) -+ continue; -+ -+ prueth_netdev_exit(prueth, eth_node); -+ } -+ -+free_pool: -+ gen_pool_free(prueth->sram_pool, -+ (unsigned long)prueth->mem[PRUETH_MEM_OCMC].va, OCMC_RAM_SIZE); -+ -+put_mem: -+ for (i = PRUETH_MEM_DRAM0; i < PRUETH_MEM_OCMC; i++) { -+ if (prueth->mem[i].va) -+ pruss_release_mem_region(pruss, &prueth->mem[i]); -+ } -+ -+ pruss_put(prueth->pruss); -+ -+put_pru1: -+ if (eth1_node) -+ pru_rproc_put(prueth->pru1); -+put_pru0: -+ if (eth0_node) -+ pru_rproc_put(prueth->pru0); -+ -+put_node: -+ of_node_put(eth1_node); -+ of_node_put(eth0_node); -+ -+ return ret; -+} -+ -+static int prueth_remove(struct platform_device *pdev) -+{ -+ struct device_node *eth_node; -+ struct prueth *prueth = platform_get_drvdata(pdev); -+ int i; -+ -+ for (i = 0; i < PRUETH_NUM_MACS; i++) { -+ if (!prueth->registered_netdevs[i]) -+ continue; -+ unregister_netdev(prueth->registered_netdevs[i]); -+ } -+ -+ for (i = 0; i < PRUETH_NUM_MACS; i++) { -+ eth_node = prueth->eth_node[i]; -+ if (!eth_node) -+ continue; -+ -+ prueth_netdev_exit(prueth, eth_node); -+ of_node_put(eth_node); -+ } -+ -+ gen_pool_free(prueth->sram_pool, -+ (unsigned long)prueth->mem[PRUETH_MEM_OCMC].va, -+ OCMC_RAM_SIZE); -+ -+ for (i = PRUETH_MEM_DRAM0; i < PRUETH_MEM_OCMC; i++) { -+ if (prueth->mem[i].va) -+ pruss_release_mem_region(prueth->pruss, &prueth->mem[i]); -+ } -+ -+ pruss_put(prueth->pruss); -+ -+ if (prueth->eth_node[PRUETH_MAC0]) -+ pru_rproc_put(prueth->pru1); -+ if (prueth->eth_node[PRUETH_MAC1]) -+ pru_rproc_put(prueth->pru0); -+ -+ return 0; -+} -+ -+#ifdef CONFIG_PM_SLEEP -+static int prueth_suspend(struct device *dev) -+{ -+ struct prueth *prueth = dev_get_drvdata(dev); -+ struct net_device *ndev; -+ int i, ret; -+ -+ for (i = 0; i < PRUETH_NUM_MACS; i++) { -+ ndev = prueth->registered_netdevs[i]; -+ -+ if (!ndev) -+ continue; -+ -+ if (netif_running(ndev)) { -+ netif_device_detach(ndev); -+ ret = emac_ndo_stop(ndev); -+ if (ret < 0) { -+ netdev_err(ndev, "failed to stop: %d", ret); -+ return ret; -+ } -+ } -+ } -+ -+ return 0; -+} -+ -+static int prueth_resume(struct device *dev) -+{ -+ struct prueth *prueth = dev_get_drvdata(dev); -+ struct net_device *ndev; -+ int i, ret; -+ -+ for (i = 0; i < PRUETH_NUM_MACS; i++) { -+ ndev = prueth->registered_netdevs[i]; -+ -+ if (!ndev) -+ continue; -+ -+ if (netif_running(ndev)) { -+ ret = emac_ndo_open(ndev); -+ if (ret < 0) { -+ netdev_err(ndev, "failed to start: %d", ret); -+ return ret; -+ } -+ netif_device_attach(ndev); -+ } -+ } -+ -+ return 0; -+} -+ -+#endif /* CONFIG_PM_SLEEP */ -+ -+static const struct dev_pm_ops prueth_dev_pm_ops = { -+ SET_SYSTEM_SLEEP_PM_OPS(prueth_suspend, prueth_resume) -+}; -+ -+static const struct of_device_id prueth_dt_match[] = { -+ { .compatible = "ti,am57-prueth", }, -+ { .compatible = "ti,am4376-prueth", }, -+ { .compatible = "ti,am3359-prueth", }, -+ { .compatible = "ti,k2g-prueth", }, -+ { /* sentinel */ } -+}; -+MODULE_DEVICE_TABLE(of, prueth_dt_match); -+ -+static struct platform_driver prueth_driver = { -+ .probe = prueth_probe, -+ .remove = prueth_remove, -+ .driver = { -+ .name = "prueth", -+ .of_match_table = prueth_dt_match, -+ .pm = &prueth_dev_pm_ops, -+ }, -+}; -+module_platform_driver(prueth_driver); -+ -+MODULE_AUTHOR("Roger Quadros <rogerq@ti.com>"); -+MODULE_AUTHOR("Andrew F. Davis <afd@ti.com>"); -+MODULE_DESCRIPTION("PRU Ethernet Driver"); -+MODULE_LICENSE("GPL v2"); -diff --git a/drivers/net/ethernet/ti/prueth.h b/drivers/net/ethernet/ti/prueth.h -new file mode 100644 -index 000000000000..05d2f288c621 ---- /dev/null -+++ b/drivers/net/ethernet/ti/prueth.h -@@ -0,0 +1,175 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+ -+/* PRU ICSS Ethernet driver -+ * -+ * Copyright (C) 2015-2018 Texas Instruments Incorporated - http://www.ti.com -+ */ -+ -+#ifndef __NET_TI_PRUETH_H -+#define __NET_TI_PRUETH_H -+ -+#define PRUETH_NUMQUEUES 5 -+ -+/** -+ * struct prueth_queue_desc - Queue descriptor -+ * @rd_ptr: Read pointer, points to a buffer descriptor in Shared PRU RAM. -+ * @wr_ptr: Write pointer, points to a buffer descriptor in Shared PRU RAM. -+ * @busy_s: Slave queue busy flag, set by slave(us) to request access from -+ * master(PRU). -+ * @status: Bit field status register, Bits: -+ * 0: Master queue busy flag. -+ * 1: Packet has been placed in collision queue. -+ * 2: Packet has been discarded due to overflow. -+ * @max_fill_level: Maximum queue usage seen. -+ * @overflow_cnt: Count of queue overflows. -+ * -+ * Each port has up to 4 queues with variable length. The queue is processed -+ * as ring buffer with read and write pointers. Both pointers are address -+ * pointers and increment by 4 for each buffer descriptor position. Queue has -+ * a length defined in constants and a status. -+ */ -+struct prueth_queue_desc { -+ u16 rd_ptr; -+ u16 wr_ptr; -+ u8 busy_s; -+ u8 status; -+ u8 max_fill_level; -+ u8 overflow_cnt; -+} __packed; -+ -+/** -+ * struct prueth_queue - Information about a queue in memory -+ * @buffer_offset: buffer offset in OCMC RAM -+ * @queue_desc_offset: queue descriptor offset in Shared RAM -+ * @buffer_desc_offset: buffer descriptors offset in Shared RAM -+ * @buffer_desc_end: end address of buffer descriptors in Shared RAM -+ */ -+struct prueth_queue_info { -+ u16 buffer_offset; -+ u16 queue_desc_offset; -+ u16 buffer_desc_offset; -+ u16 buffer_desc_end; -+} __packed; -+ -+/** -+ * struct prueth_packet_info - Info about a packet in buffer -+ * @shadow: this packet is stored in the collision queue -+ * @port: port packet is on -+ * @length: length of packet -+ * @broadcast: this packet is a broadcast packet -+ * @error: this packet has an error -+ */ -+struct prueth_packet_info { -+ bool shadow; -+ unsigned int port; -+ unsigned int length; -+ bool broadcast; -+ bool error; -+}; -+ -+/** -+ * struct port_statistics - Statistics structure for capturing statistics -+ * on PRUs -+ * @tx_bcast: Number of broadcast packets sent -+ * @tx_mcast:Number of multicast packets sent -+ * @tx_ucast:Number of unicast packets sent -+ * -+ * @tx_octets:Number of undersized frames rcvd -+ * -+ * @rx_bcast:Number of broadcast packets rcvd -+ * @rx_mcast:Number of multicast packets rcvd -+ * @rx_ucast:Number of unicast packets rcvd -+ * -+ * @rx_octets:Number of Rx packets -+ * -+ * @tx64byte:Number of 64 byte packets sent -+ * @tx65_127byte:Number of 65-127 byte packets sent -+ * @tx128_255byte:Number of 128-255 byte packets sent -+ * @tx256_511byte:Number of 256-511 byte packets sent -+ * @tx512_1023byte:Number of 512-1023 byte packets sent -+ * @tx1024byte:Number of 1024 and larger size packets sent -+ * -+ * @rx64byte:Number of 64 byte packets rcvd -+ * @rx65_127byte:Number of 65-127 byte packets rcvd -+ * @rx128_255byte:Number of 128-255 byte packets rcvd -+ * @rx256_511byte:Number of 256-511 byte packets rcvd -+ * @rx512_1023byte:Number of 512-1023 byte packets rcvd -+ * @rx1024byte:Number of 1024 and larger size packets rcvd -+ * -+ * @late_coll:Number of late collisions(Half Duplex) -+ * @single_coll:Number of single collisions (Half Duplex) -+ * @multi_coll:Number of multiple collisions (Half Duplex) -+ * @excess_coll:Number of excess collisions(Half Duplex) -+ * -+ * @rx_misalignment_frames:Number of non multiple of 8 byte frames rcvd -+ * @stormprev_counter:Number of packets dropped because of Storm Prevention -+ * @mac_rxerror:Number of MAC receive errors -+ * @sfd_error:Number of invalid SFD -+ * @def_tx:Number of transmissions deferred -+ * @mac_txerror:Number of MAC transmit errors -+ * @rx_oversized_frames:Number of oversized frames rcvd -+ * @rx_undersized_frames:Number of undersized frames rcvd -+ * @rx_crc_frames:Number of CRC error frames rcvd -+ * @dropped_packets:Number of packets dropped due to link down on opposite port -+ * -+ * @tx_hwq_overflow:Hardware Tx Queue (on PRU) over flow count -+ * @tx_hwq_underflow:Hardware Tx Queue (on PRU) under flow count -+ * -+ * @u32 cs_error: Number of carrier sense errors -+ * @sqe_test_error: Number of MAC receive errors -+ * -+ * The fields here are aligned here so that it's consistent -+ * with the memory layout in PRU DRAM, this is to facilitate easy -+ * memcpy. Don't change the order of the fields. -+ */ -+struct port_statistics { -+ u32 tx_bcast; -+ u32 tx_mcast; -+ u32 tx_ucast; -+ -+ u32 tx_octets; -+ -+ u32 rx_bcast; -+ u32 rx_mcast; -+ u32 rx_ucast; -+ -+ u32 rx_octets; -+ -+ u32 tx64byte; -+ u32 tx65_127byte; -+ u32 tx128_255byte; -+ u32 tx256_511byte; -+ u32 tx512_1023byte; -+ u32 tx1024byte; -+ -+ u32 rx64byte; -+ u32 rx65_127byte; -+ u32 rx128_255byte; -+ u32 rx256_511byte; -+ u32 rx512_1023byte; -+ u32 rx1024byte; -+ -+ u32 late_coll; -+ u32 single_coll; -+ u32 multi_coll; -+ u32 excess_coll; -+ -+ u32 rx_misalignment_frames; -+ u32 stormprev_counter; -+ u32 mac_rxerror; -+ u32 sfd_error; -+ u32 def_tx; -+ u32 mac_txerror; -+ u32 rx_oversized_frames; -+ u32 rx_undersized_frames; -+ u32 rx_crc_frames; -+ u32 dropped_packets; -+ -+ u32 tx_hwq_overflow; -+ u32 tx_hwq_underflow; -+ -+ u32 cs_error; -+ u32 sqe_test_error; -+} __packed; -+ -+#endif /* __NET_TI_PRUETH_H */ --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0018-bus-ti-sysc-Add-support-for-PRUSS-SYSC-type.patch b/patches/drivers/ti/rogerq_pruss/0018-bus-ti-sysc-Add-support-for-PRUSS-SYSC-type.patch deleted file mode 100644 index f9d1cfa99..000000000 --- a/patches/drivers/ti/rogerq_pruss/0018-bus-ti-sysc-Add-support-for-PRUSS-SYSC-type.patch +++ /dev/null @@ -1,190 +0,0 @@ -From baeb89ede2358f2b6ae1efdc791da21b4a627e6f Mon Sep 17 00:00:00 2001 -From: Roger Quadros <rogerq@ti.com> -Date: Fri, 18 Jan 2019 18:16:56 +0200 -Subject: [PATCH 18/25] bus: ti-sysc: Add support for PRUSS SYSC type - -The PRUSS module has a SYSCFG which is unique. Add -support for it. - -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - drivers/bus/ti-sysc.c | 78 +++++++++++++++++++++++++++ - include/dt-bindings/bus/ti-sysc.h | 11 ++++ - include/linux/platform_data/ti-sysc.h | 1 + - 3 files changed, 90 insertions(+) - -diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c -index f94d33525771..19b00b04f9e3 100644 ---- a/drivers/bus/ti-sysc.c -+++ b/drivers/bus/ti-sysc.c -@@ -622,6 +622,50 @@ static void sysc_show_registers(struct sysc *ddata) - buf); - } - -+static int sysc_enable_pruss(struct sysc *sysc) -+{ -+ int i; -+ u32 reg; -+ bool ready; -+ -+ /* configure for Smart Idle & Smart Standby */ -+ reg = sysc_read(sysc, sysc->offsets[SYSC_SYSCONFIG]); -+ reg &= ~(SYSC_PRUSS_STANDBY_MASK | SYSC_PRUSS_IDLE_MASK); -+ reg |= SYSC_PRUSS_STANDBY_SMART | SYSC_IDLE_SMART; -+ sysc_write(sysc, sysc->offsets[SYSC_SYSCONFIG], reg); -+ -+ /* bring out of Standby */ -+ reg = sysc_read(sysc, sysc->offsets[SYSC_SYSCONFIG]); -+ reg &= ~SYSC_PRUSS_STANDBY_INIT; -+ sysc_write(sysc, sysc->offsets[SYSC_SYSCONFIG], reg); -+ -+ /* wait till we are ready for transactions - delay is arbitrary */ -+ for (i = 0; i < 10; i++) { -+ reg = sysc_read(sysc, sysc->offsets[SYSC_SYSCONFIG]); -+ ready = !(reg & SYSC_PRUSS_SUB_MWAIT); -+ if (ready) -+ break; -+ udelay(5); -+ } -+ -+ if (!ready) { -+ dev_err(sysc->dev, "not ready for transaction\n"); -+ return -ETIMEDOUT; -+ } -+ -+ return 0; -+} -+ -+static void sysc_disable_pruss(struct sysc *sysc) -+{ -+ u32 reg; -+ -+ /* initiate Standby */ -+ reg = sysc_read(sysc, sysc->offsets[SYSC_SYSCONFIG]); -+ reg |= SYSC_PRUSS_STANDBY_INIT; -+ sysc_write(sysc, sysc->offsets[SYSC_SYSCONFIG], reg); -+} -+ - static int __maybe_unused sysc_runtime_suspend(struct device *dev) - { - struct ti_sysc_platform_data *pdata; -@@ -649,6 +693,9 @@ static int __maybe_unused sysc_runtime_suspend(struct device *dev) - goto idled; - } - -+ if (ddata->cap->type == TI_SYSC_PRUSS) -+ sysc_disable_pruss(ddata); -+ - for (i = 0; i < ddata->nr_clocks; i++) { - if (IS_ERR_OR_NULL(ddata->clocks[i])) - continue; -@@ -704,6 +751,9 @@ static int __maybe_unused sysc_runtime_resume(struct device *dev) - return error; - } - -+ if (ddata->cap->type == TI_SYSC_PRUSS) -+ sysc_enable_pruss(ddata); -+ - awake: - ddata->enabled = true; - -@@ -1573,6 +1623,26 @@ static const struct sysc_capabilities sysc_dra7_mcan = { - .regbits = &sysc_regbits_dra7_mcan, - }; - -+/* -+ * PRUSS on AM33x and later -+ */ -+static const struct sysc_regbits sysc_regbits_pruss = { -+ .midle_shift = -ENODEV, -+ .clkact_shift = -ENODEV, -+ .sidle_shift = -ENODEV, -+ .enwkup_shift = -ENODEV, -+ .srst_shift = -ENODEV, -+ .autoidle_shift = -ENODEV, -+ .dmadisable_shift = -ENODEV, -+ .emufree_shift = -ENODEV, -+}; -+ -+static const struct sysc_capabilities sysc_pruss = { -+ .type = TI_SYSC_PRUSS, -+ .sysc_mask = SYSC_PRUSS_STANDBY_INIT | SYSC_PRUSS_SUB_MWAIT, -+ .regbits = &sysc_regbits_pruss, -+}; -+ - static int sysc_init_pdata(struct sysc *ddata) - { - struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); -@@ -1637,6 +1707,7 @@ static int sysc_probe(struct platform_device *pdev) - int error; - - ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); -+ - if (!ddata) - return -ENOMEM; - -@@ -1702,6 +1773,10 @@ static int sysc_probe(struct platform_device *pdev) - - INIT_DELAYED_WORK(&ddata->idle_work, ti_sysc_idle); - -+ /* FIXME: how to ensure PRUSS stays enabled? */ -+ if (ddata->cap->type == TI_SYSC_PRUSS) -+ goto skip_pm_put; -+ - /* At least earlycon won't survive without deferred idle */ - if (ddata->cfg.quirks & (SYSC_QUIRK_NO_IDLE_ON_INIT | - SYSC_QUIRK_NO_RESET_ON_INIT)) { -@@ -1710,6 +1785,8 @@ static int sysc_probe(struct platform_device *pdev) - pm_runtime_put(&pdev->dev); - } - -+skip_pm_put: -+ - if (!of_get_available_child_count(ddata->dev->of_node)) - reset_control_assert(ddata->rsts); - -@@ -1766,6 +1843,7 @@ static const struct of_device_id sysc_match[] = { - { .compatible = "ti,sysc-usb-host-fs", - .data = &sysc_omap4_usb_host_fs, }, - { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, }, -+ { .compatible = "ti,sysc-pruss", .data = &sysc_pruss, }, - { }, - }; - MODULE_DEVICE_TABLE(of, sysc_match); -diff --git a/include/dt-bindings/bus/ti-sysc.h b/include/dt-bindings/bus/ti-sysc.h -index 7138384e2ef9..8ec78e8ff985 100644 ---- a/include/dt-bindings/bus/ti-sysc.h -+++ b/include/dt-bindings/bus/ti-sysc.h -@@ -17,6 +17,17 @@ - - #define SYSC_DRA7_MCAN_ENAWAKEUP (1 << 4) - -+/* SYSCONFIG specific to PRUSS */ -+#define SYSC_PRUSS_SUB_MWAIT (1 << 5) -+#define SYSC_PRUSS_STANDBY_INIT (1 << 4) -+ -+#define SYSC_PRUSS_STANDBY_FORCE (0 << 2) -+#define SYSC_PRUSS_STANDBY_NO (1 << 2) -+#define SYSC_PRUSS_STANDBY_SMART (2 << 2) -+#define SYSC_PRUSS_STANDBY_MASK (3 << 2) -+ -+#define SYSC_PRUSS_IDLE_MASK 3 -+ - /* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */ - #define SYSC_IDLE_FORCE 0 - #define SYSC_IDLE_NO 1 -diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h -index 1ea3aab972b4..56098e750a82 100644 ---- a/include/linux/platform_data/ti-sysc.h -+++ b/include/linux/platform_data/ti-sysc.h -@@ -15,6 +15,7 @@ enum ti_sysc_module_type { - TI_SYSC_OMAP4_MCASP, - TI_SYSC_OMAP4_USB_HOST_FS, - TI_SYSC_DRA7_MCAN, -+ TI_SYSC_PRUSS, - }; - - struct ti_sysc_cookie { --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0019-ARM-dts-dra7-add-PRU-ICSS-modules.patch b/patches/drivers/ti/rogerq_pruss/0019-ARM-dts-dra7-add-PRU-ICSS-modules.patch deleted file mode 100644 index e77755db8..000000000 --- a/patches/drivers/ti/rogerq_pruss/0019-ARM-dts-dra7-add-PRU-ICSS-modules.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 9ec198f2e32de656add43da671d5231a59827965 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Sat, 22 Dec 2018 07:53:13 +0200 -Subject: [PATCH 19/25] ARM: dts: dra7: add PRU-ICSS modules - -Add the DT nodes for the PRU-ICSS1 and PRU-ICSS2 processor subsystems -that are present on AM57xx family of SoCs. Each PRU-ICSS instance is -represented by a pruss-soc-bus node and a child PRUSS subsystem node. -The two PRU-ICSSs are identical to each other. They are not supported -on DRA7xx SoCs in general, so the nodes are added in disabled state -to the common dra7 DTS file. They should be enabled only in the AM57xx -related board files. - -The PRU-ICSSs on AM57xx are very similar to the PRUSS in AM33xx and -AM437x except for variations in the RAM sizes and the number of -interrupts coming into the MPU INTC. The interrupt events into the -PRU-ICSS also requires programming of the corresponding crossbars -properly. - -The default names for the firmware images for each PRU core are -defined as follows (these can be adjusted either in derivative -board dts files or through sysfs at runtime if required): -PRU-ICSS1 PRU0 Core: am57xx-pru1_0-fw -PRU-ICSS1 PRU1 Core: am57xx-pru1_1-fw -PRU-ICSS2 PRU0 Core: am57xx-pru2_0-fw -PRU-ICSS2 PRU1 Core: am57xx-pru2_1-fw - -Two PRU system events "vring" and "kick" have been added to each -PRU node in each of the PRU-ICSS1 and PRU-ICSS2 remote processor -subsystems to enable the virtio/rpmsg communication between MPU -and that PRU core. - -The PRU system events is the preferred approach over using OMAP -mailboxes, as it eliminates an external peripheral access from -the PRU-side, and keeps the interrupt generation internal to the -PRUSS. The difference from MPU would be minimal in using one -versus the other. - -Mailboxes can still be used if desired. Either approach would -require that an appropriate firmware image is loaded/booted on -the PRU. - -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - arch/arm/boot/dts/dra7.dtsi | 194 ++++++++++++++++++++++++++++++++++++ - 1 file changed, 194 insertions(+) - -diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi -index 2bc9add8b7a5..2458e7a5acfa 100644 ---- a/arch/arm/boot/dts/dra7.dtsi -+++ b/arch/arm/boot/dts/dra7.dtsi -@@ -167,6 +167,200 @@ - l4_per3: interconnect@48800000 { - }; - -+ pru_icss1: target-module@4b200000 { -+ compatible = "ti,sysc-pruss", "ti,sysc"; -+ reg = <0x4b226000 0x4>, -+ <0x4b226004 0x4>; -+ reg-names = "rev", "sysc"; -+ ti,no-reset-on-init; -+ /* Domains (P, C): coreaon_pwrdm, l4per2_clkdm */ -+ clocks = <&l4per2_clkctrl DRA7_L4PER2_PRUSS1_CLKCTRL 0>; -+ clock-names = "fck"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges = <0x00000000 0x4b200000 0x20000000>; -+ -+ pruss1: pruss@4b200000 { -+ compatible = "ti,am5728-pruss"; -+ reg = <0x0000 0x2000>, -+ <0x2000 0x2000>, -+ <0x10000 0x8000>; -+ reg-names = "dram0", "dram1", -+ "shrdram2"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ pruss1_cfg: cfg@26000 { -+ compatible = "syscon"; -+ reg = <0x26000 0x2000>; -+ }; -+ -+ pruss1_iep: iep@2e000 { -+ compatible = "syscon"; -+ reg = <0x2e000 0x31c>; -+ }; -+ -+ pruss1_mii_rt: mii_rt@32000 { -+ compatible = "syscon"; -+ reg = <0x32000 0x58>; -+ }; -+ -+ pruss1_intc: intc@20000 { -+ compatible = "ti,am5728-pruss-intc"; -+ reg = <0x20000 0x2000>; -+ reg-names = "intc"; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>; -+ interrupt-names = "host2", "host3", "host4", -+ "host5", "host6", "host7", -+ "host8", "host9"; -+ }; -+ -+ pru1_0: pru@34000 { -+ compatible = "ti,am5728-pru"; -+ reg = <0x34000 0x3000>, -+ <0x22000 0x400>, -+ <0x22400 0x100>; -+ reg-names = "iram", "control", "debug"; -+ gpcfg = <&pruss1_cfg 0x8>; -+ firmware-name = "am57xx-pru1_0-fw"; -+ interrupt-parent = <&pruss1_intc>; -+ interrupts = <16>, <17>; -+ interrupt-names = "vring", "kick"; -+ }; -+ -+ pru1_1: pru@38000 { -+ compatible = "ti,am5728-pru"; -+ reg = <0x38000 0x3000>, -+ <0x24000 0x400>, -+ <0x24400 0x100>; -+ reg-names = "iram", "control", "debug"; -+ gpcfg = <&pruss1_cfg 0xc>; -+ firmware-name = "am57xx-pru1_1-fw"; -+ interrupt-parent = <&pruss1_intc>; -+ interrupts = <18>, <19>; -+ interrupt-names = "vring", "kick"; -+ }; -+ -+ pruss1_mdio: mdio@32400 { -+ compatible = "ti,davinci_mdio"; -+ reg = <0x32400 0x90>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ clocks = <&dpll_gmac_h13x2_ck>; -+ clock-names = "fck"; -+ bus_freq = <1000000>; -+ status = "disabled"; -+ }; -+ }; -+ }; -+ -+ pru_icss2: target_module@4b280000 { -+ compatible = "ti,sysc-pruss", "ti,sysc"; -+ reg = <0x4b2a6000 0x4>, -+ <0x4b2a6004 0x4>; -+ reg-names = "rev", "sysc"; -+ ti,no-reset-on-init; -+ /* Domains (P, C): coreaon_pwrdm, l4per2_clkdm */ -+ clocks = <&l4per2_clkctrl DRA7_L4PER2_PRUSS2_CLKCTRL 0>; -+ clock-names = "fck"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges = <0x00000000 0x4b280000 0x20000000>; -+ -+ pruss2: pruss@4b280000 { -+ compatible = "ti,am5728-pruss"; -+ reg = <0 0x2000>, -+ <0x2000 0x2000>, -+ <0x10000 0x8000>; -+ reg-names = "dram0", "dram1", -+ "shrdram2"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ pruss2_cfg: cfg@26000 { -+ compatible = "syscon"; -+ reg = <0x26000 0x2000>; -+ }; -+ -+ pruss2_iep: iep@2e000 { -+ compatible = "syscon"; -+ reg = <0x2e000 0x31c>; -+ }; -+ -+ pruss2_mii_rt: mii_rt@32000 { -+ compatible = "syscon"; -+ reg = <0x32000 0x58>; -+ }; -+ -+ pruss2_intc: intc@20000 { -+ compatible = "ti,am5728-pruss-intc"; -+ reg = <0x20000 0x2000>; -+ reg-names = "intc"; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH>, -+ <GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH>; -+ interrupt-names = "host2", "host3", "host4", -+ "host5", "host6", "host7", -+ "host8", "host9"; -+ }; -+ -+ pru2_0: pru@34000 { -+ compatible = "ti,am5728-pru"; -+ reg = <0x34000 0x3000>, -+ <0x22000 0x400>, -+ <0x22400 0x100>; -+ reg-names = "iram", "control", "debug"; -+ gpcfg = <&pruss2_cfg 0x8>; -+ firmware-name = "am57xx-pru2_0-fw"; -+ interrupt-parent = <&pruss2_intc>; -+ interrupts = <16>, <17>; -+ interrupt-names = "vring", "kick"; -+ }; -+ -+ pru2_1: pru@38000 { -+ compatible = "ti,am5728-pru"; -+ reg = <0x38000 0x3000>, -+ <0x24000 0x400>, -+ <0x24400 0x100>; -+ reg-names = "iram", "control", "debug"; -+ gpcfg = <&pruss2_cfg 0xc>; -+ firmware-name = "am57xx-pru2_1-fw"; -+ interrupt-parent = <&pruss2_intc>; -+ interrupts = <18>, <19>; -+ interrupt-names = "vring", "kick"; -+ }; -+ -+ pruss2_mdio: mdio@32400 { -+ compatible = "ti,davinci_mdio"; -+ reg = <0x32400 0x90>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ clocks = <&dpll_gmac_h13x2_ck>; -+ clock-names = "fck"; -+ bus_freq = <1000000>; -+ status = "disabled"; -+ }; -+ }; -+ }; -+ - axi@0 { - compatible = "simple-bus"; - #size-cells = <1>; --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0020-ARM-dts-am57xx-idk-common-Enable-PRU-ICSS-nodes.patch b/patches/drivers/ti/rogerq_pruss/0020-ARM-dts-am57xx-idk-common-Enable-PRU-ICSS-nodes.patch deleted file mode 100644 index 16e2ccf9d..000000000 --- a/patches/drivers/ti/rogerq_pruss/0020-ARM-dts-am57xx-idk-common-Enable-PRU-ICSS-nodes.patch +++ /dev/null @@ -1,42 +0,0 @@ -From f7aeb69d7853beb9331c24cb5d0cb8f4385cbb37 Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Tue, 30 Jan 2018 13:56:44 -0600 -Subject: [PATCH 20/25] ARM: dts: am57xx-idk-common: Enable PRU-ICSS nodes - -The two PRU-ICSS processor subsystem bus nodes and their corresponding -subsystem nodes were left in disabled state in the base dra7.dts file. -The PRU-ICSSs are supported on only the AM57xx SoCs, so enable these -nodes (both PRU-ICSS1 and PRU-ICSS2 instances) to support them on -all the AM571x, AM572x and AM574x IDK boards. The PRU nodes are -already enabled in the base dts file, and so become effective -automatically with the enabling of these PRU-ICSS nodes. - -The corresponding PRU nodes can be disabled later on if there are -no use-cases defined to use a particular PRU core or the whole -PRU-ICSS subsystem itself if both its PRU cores are unused. - -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - arch/arm/boot/dts/am57xx-idk-common.dtsi | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi -index f7bd26458915..6991412890c5 100644 ---- a/arch/arm/boot/dts/am57xx-idk-common.dtsi -+++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi -@@ -492,3 +492,11 @@ - &cpu0 { - vdd-supply = <&smps12_reg>; - }; -+ -+&pruss1 { -+ status = "okay"; -+}; -+ -+&pruss2 { -+ status = "okay"; -+}; --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0021-ARM-dts-am57xx-idk-common-Add-PRUSS2-Ethernet-applic.patch b/patches/drivers/ti/rogerq_pruss/0021-ARM-dts-am57xx-idk-common-Add-PRUSS2-Ethernet-applic.patch deleted file mode 100644 index 229012898..000000000 --- a/patches/drivers/ti/rogerq_pruss/0021-ARM-dts-am57xx-idk-common-Add-PRUSS2-Ethernet-applic.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 0a360ee69a2df589dec69ba57980baafc73db19f Mon Sep 17 00:00:00 2001 -From: "Andrew F. Davis" <afd@ti.com> -Date: Mon, 26 Feb 2018 16:16:24 +0200 -Subject: [PATCH 21/25] ARM: dts: am57xx-idk-common: Add PRUSS2 Ethernet - application node - -Add PRUSS Ethernet application node for PRU-ICSS2. We don't add this on -PRU-ICSS1 as it is not connected to the SoC by default on AM57xx IDKs. - -[rogerq@ti.com: Add PHY reset GPIOs] - -Signed-off-by: Andrew F. Davis <afd@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> -Signed-off-by: Sekhar Nori <nsekhar@ti.com> ---- - arch/arm/boot/dts/am571x-idk.dts | 5 +++ - arch/arm/boot/dts/am572x-idk.dts | 6 +++ - arch/arm/boot/dts/am574x-idk.dts | 6 +++ - arch/arm/boot/dts/am57xx-idk-common.dtsi | 47 ++++++++++++++++++++++++ - 4 files changed, 64 insertions(+) - -diff --git a/arch/arm/boot/dts/am571x-idk.dts b/arch/arm/boot/dts/am571x-idk.dts -index 6432309b39e3..1fdc0d266963 100644 ---- a/arch/arm/boot/dts/am571x-idk.dts -+++ b/arch/arm/boot/dts/am571x-idk.dts -@@ -194,3 +194,8 @@ - pinctrl-1 = <&mmc2_pins_hs>; - pinctrl-2 = <&mmc2_pins_ddr_rev20 &mmc2_iodelay_ddr_conf>; - }; -+ -+&pruss2_mdio { -+ reset-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>; -+ reset-delay-us = <2>; /* PHY datasheet states 1uS min */ -+}; -diff --git a/arch/arm/boot/dts/am572x-idk.dts b/arch/arm/boot/dts/am572x-idk.dts -index b2fb6e097be7..5cbde6aa2971 100644 ---- a/arch/arm/boot/dts/am572x-idk.dts -+++ b/arch/arm/boot/dts/am572x-idk.dts -@@ -36,3 +36,9 @@ - pinctrl-1 = <&mmc2_pins_hs>; - pinctrl-2 = <&mmc2_pins_ddr_rev20>; - }; -+ -+&pruss2_mdio { -+ reset-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>, -+ <&gpio5 9 GPIO_ACTIVE_LOW>; -+ reset-delay-us = <2>; /* PHY datasheet states 1uS min */ -+}; -diff --git a/arch/arm/boot/dts/am574x-idk.dts b/arch/arm/boot/dts/am574x-idk.dts -index 378dfa780ac1..acd5a4eb135b 100644 ---- a/arch/arm/boot/dts/am574x-idk.dts -+++ b/arch/arm/boot/dts/am574x-idk.dts -@@ -40,3 +40,9 @@ - pinctrl-1 = <&mmc2_pins_default>; - pinctrl-2 = <&mmc2_pins_default>; - }; -+ -+&pruss2_mdio { -+ reset-gpios = <&gpio5 8 GPIO_ACTIVE_LOW>, -+ <&gpio5 9 GPIO_ACTIVE_LOW>; -+ reset-delay-us = <2>; /* PHY datasheet states 1uS min */ -+}; -diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi -index 6991412890c5..6c4a0b9d17e9 100644 ---- a/arch/arm/boot/dts/am57xx-idk-common.dtsi -+++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi -@@ -12,6 +12,8 @@ - aliases { - rtc0 = &tps659038_rtc; - rtc1 = &rtc; -+ ethernet2 = &pruss2_emac0; -+ ethernet3 = &pruss2_emac1; - }; - - chosen { -@@ -99,6 +101,36 @@ - default-state = "off"; - }; - }; -+ -+ /* Dual-MAC Ethernet application node on PRU-ICSS2 */ -+ pruss2_eth { -+ compatible = "ti,am57-prueth"; -+ prus = <&pru2_0>, <&pru2_1>; -+ firmware-name = "ti-pruss/am57xx-pru0-prueth-fw.elf", -+ "ti-pruss/am57xx-pru1-prueth-fw.elf"; -+ sram = <&ocmcram1>; -+ interrupt-parent = <&pruss2_intc>; -+ mii-rt = <&pruss2_mii_rt>; -+ iep = <&pruss2_iep>; -+ -+ pruss2_emac0: ethernet-mii0 { -+ phy-handle = <&pruss2_eth0_phy>; -+ phy-mode = "mii"; -+ interrupts = <20>, <22>; -+ interrupt-names = "rx", "tx"; -+ /* Filled in by bootloader */ -+ local-mac-address = [00 00 00 00 00 00]; -+ }; -+ -+ pruss2_emac1: ethernet-mii1 { -+ phy-handle = <&pruss2_eth1_phy>; -+ phy-mode = "mii"; -+ interrupts = <21>, <23>; -+ interrupt-names = "rx", "tx"; -+ /* Filled in by bootloader */ -+ local-mac-address = [00 00 00 00 00 00]; -+ }; -+ }; - }; - - &dra7_pmx_core { -@@ -500,3 +532,18 @@ - &pruss2 { - status = "okay"; - }; -+ -+&pruss2_mdio { -+ status = "okay"; -+ pruss2_eth0_phy: ethernet-phy@0 { -+ reg = <0>; -+ interrupt-parent = <&gpio3>; -+ interrupts = <30 IRQ_TYPE_EDGE_FALLING>; -+ }; -+ -+ pruss2_eth1_phy: ethernet-phy@1 { -+ reg = <1>; -+ interrupt-parent = <&gpio3>; -+ interrupts = <31 IRQ_TYPE_EDGE_FALLING>; -+ }; -+}; --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0022-optional-am57xx-idk-prueth-provide-intc-config-in-DT.patch b/patches/drivers/ti/rogerq_pruss/0022-optional-am57xx-idk-prueth-provide-intc-config-in-DT.patch deleted file mode 100644 index 261eacf1d..000000000 --- a/patches/drivers/ti/rogerq_pruss/0022-optional-am57xx-idk-prueth-provide-intc-config-in-DT.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 9d61f2dd6439b145053206ea9148feb8525a34a5 Mon Sep 17 00:00:00 2001 -From: Roger Quadros <rogerq@ti.com> -Date: Thu, 15 Nov 2018 12:32:14 +0200 -Subject: [PATCH 22/25] optional: am57xx-idk: prueth: provide intc config in DT - -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - arch/arm/boot/dts/am57xx-idk-common.dtsi | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi -index 6c4a0b9d17e9..eff28cb44b9d 100644 ---- a/arch/arm/boot/dts/am57xx-idk-common.dtsi -+++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi -@@ -110,6 +110,15 @@ - "ti-pruss/am57xx-pru1-prueth-fw.elf"; - sram = <&ocmcram1>; - interrupt-parent = <&pruss2_intc>; -+ ti,pru-interrupt-map = <0 42 0 0>, /* PORT1_RX_EOF_EVENT */ -+ <0 20 2 2>, /* PRU_ARM_EVENT0 */ -+ <0 22 4 4>, /* PRU_ARM_EVENT2 */ -+ <0 41 7 8>, /* MII_LINK0_EVENT */ -+ -+ <1 54 1 1>, /* PORT2_RX_EOF_EVENT */ -+ <1 21 3 3>, /* PRU_ARM_EVENT1 */ -+ <1 23 5 5>, /* PRU_ARM_EVENT3 */ -+ <1 53 8 9>; /* MII_LINK1_EVENT */ - mii-rt = <&pruss2_mii_rt>; - iep = <&pruss2_iep>; - --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0023-ARM-dts-AM33xx-Add-the-PRU-ICSS-DT-nodes.patch b/patches/drivers/ti/rogerq_pruss/0023-ARM-dts-AM33xx-Add-the-PRU-ICSS-DT-nodes.patch deleted file mode 100644 index 05f4f6ec3..000000000 --- a/patches/drivers/ti/rogerq_pruss/0023-ARM-dts-AM33xx-Add-the-PRU-ICSS-DT-nodes.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 26e19ef052e42848a094796c0b2bda6cb3d0b511 Mon Sep 17 00:00:00 2001 -From: Roger Quadros <rogerq@ti.com> -Date: Mon, 28 Jan 2019 16:24:47 +0200 -Subject: [PATCH 23/25] ARM: dts: AM33xx: Add the PRU-ICSS DT nodes - -Add the DT nodes for the PRU-ICSS on AM33xx family of SoCs. The -AM33xx SoCs contain a single PRU-ICSS instance. PRU-ICSS is not -supported on AM3352 SoC though in the AM33xx family, so the nodes -are added in disabled state to the common am33xx dtsi file. They -should be enabled in only those derivative board files that use -a SoC containing PRU-ICSS. - -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - arch/arm/boot/dts/am33xx-l4.dtsi | 89 +++++++++++++++++++++++++++++++- - 1 file changed, 87 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi -index 7b818d9d2eab..5237413a2272 100644 ---- a/arch/arm/boot/dts/am33xx-l4.dtsi -+++ b/arch/arm/boot/dts/am33xx-l4.dtsi -@@ -759,11 +759,96 @@ - }; - - target-module@300000 { /* 0x4a300000, ap 9 04.0 */ -- compatible = "ti,sysc"; -- status = "disabled"; -+ compatible = "ti,sysc-pruss", "ti,sysc"; -+ reg = <0x326000 0x4>, -+ <0x326004 0x4>; -+ reg-names = "rev", "sysc"; -+ ti,no-reset-on-init; -+ /* Domains (P, C): per_pwrdm, pruss_ocp_clkdm */ -+ clocks = <&pruss_ocp_clkctrl AM3_PRUSS_OCP_PRUSS_CLKCTRL 0>; -+ clock-names = "fck"; -+ /* TODO: Use Reset control for RM_PER_RSTCTRL, bit 1 */ -+ - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0x300000 0x80000>; -+ -+ pruss: pruss@0 { -+ compatible = "ti,am3356-pruss"; -+ reg = <0x0 0x2000>, -+ <0x2000 0x2000>, -+ <0x10000 0x3000>; -+ reg-names = "dram0", "dram1", -+ "shrdram2"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ status = "disabled"; -+ -+ pruss_cfg: cfg@26000 { -+ compatible = "syscon"; -+ reg = <0x26000 0x2000>; -+ }; -+ -+ pruss_iep: iep@2e000 { -+ compatible = "syscon"; -+ reg = <0x2e000 0x31c>; -+ }; -+ -+ pruss_mii_rt: mii_rt@32000 { -+ compatible = "syscon"; -+ reg = <0x32000 0x58>; -+ }; -+ -+ pruss_intc: intc@20000 { -+ compatible = "ti,am3356-pruss-intc"; -+ reg = <0x20000 0x2000>; -+ reg-names = "intc"; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ interrupts = <20 21 22 23 24 25 26 27>; -+ interrupt-names = "host2", "host3", "host4", -+ "host5", "host6", "host7", -+ "host8", "host9"; -+ }; -+ -+ pru0: pru@34000 { -+ compatible = "ti,am3356-pru"; -+ reg = <0x34000 0x2000>, -+ <0x22000 0x400>, -+ <0x22400 0x100>; -+ reg-names = "iram", "control", "debug"; -+ gpcfg = <&pruss_cfg 0x8>; -+ firmware-name = "am335x-pru0-fw"; -+ interrupt-parent = <&pruss_intc>; -+ interrupts = <16>, <17>; -+ interrupt-names = "vring", "kick"; -+ }; -+ -+ pru1: pru@38000 { -+ compatible = "ti,am3356-pru"; -+ reg = <0x38000 0x2000>, -+ <0x24000 0x400>, -+ <0x24400 0x100>; -+ reg-names = "iram", "control", "debug"; -+ gpcfg = <&pruss_cfg 0xc>; -+ firmware-name = "am335x-pru1-fw"; -+ interrupt-parent = <&pruss_intc>; -+ interrupts = <18>, <19>; -+ interrupt-names = "vring", "kick"; -+ }; -+ -+ pruss_mdio: mdio@32400 { -+ compatible = "ti,davinci_mdio"; -+ reg = <0x32400 0x90>; -+ clocks = <&dpll_core_m4_ck>; -+ clock-names = "fck"; -+ bus_freq = <1000000>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "disabled"; -+ }; -+ }; - }; - }; - }; --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0024-ARM-dts-am335x-Enable-PRU-ICSS-nodes.patch b/patches/drivers/ti/rogerq_pruss/0024-ARM-dts-am335x-Enable-PRU-ICSS-nodes.patch deleted file mode 100644 index 1705c7b77..000000000 --- a/patches/drivers/ti/rogerq_pruss/0024-ARM-dts-am335x-Enable-PRU-ICSS-nodes.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 46e8a2ef2f1722c5c796b428591bb3769ced33da Mon Sep 17 00:00:00 2001 -From: Suman Anna <s-anna@ti.com> -Date: Tue, 30 Jan 2018 13:40:45 -0600 -Subject: [PATCH 24/25] ARM: dts: am335x-*: Enable PRU-ICSS nodes - -The PRU-ICSS processor bus node and subsystem nodes were left in -disabled state in the base am33xx.dtsi file. PRU-ICSS is supported -on these AM335x boards so enable the PRUSS node. - -Signed-off-by: Suman Anna <s-anna@ti.com> -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - arch/arm/boot/dts/am335x-bone-common.dtsi | 4 ++++ - arch/arm/boot/dts/am335x-evm.dts | 4 ++++ - arch/arm/boot/dts/am335x-evmsk.dts | 4 ++++ - arch/arm/boot/dts/am335x-icev2.dts | 4 ++++ - 4 files changed, 16 insertions(+) - -diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi -index 456eef57ef89..d7c997f9ec52 100644 ---- a/arch/arm/boot/dts/am335x-bone-common.dtsi -+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi -@@ -422,3 +422,7 @@ - clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; - clock-names = "ext-clk", "int-clk"; - }; -+ -+&pruss { -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts -index b67f5fee1469..0add38c64b77 100644 ---- a/arch/arm/boot/dts/am335x-evm.dts -+++ b/arch/arm/boot/dts/am335x-evm.dts -@@ -800,3 +800,7 @@ - clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; - clock-names = "ext-clk", "int-clk"; - }; -+ -+&pruss { -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts -index 172c0224e7f6..b75a024b8c88 100644 ---- a/arch/arm/boot/dts/am335x-evmsk.dts -+++ b/arch/arm/boot/dts/am335x-evmsk.dts -@@ -741,3 +741,7 @@ - clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>; - clock-names = "ext-clk", "int-clk"; - }; -+ -+&pruss { -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-icev2.dts b/arch/arm/boot/dts/am335x-icev2.dts -index f2005ecca74f..b36699c794b9 100644 ---- a/arch/arm/boot/dts/am335x-icev2.dts -+++ b/arch/arm/boot/dts/am335x-icev2.dts -@@ -504,3 +504,7 @@ - reg = <3>; - }; - }; -+ -+&pruss { -+ status = "okay"; -+}; --- -2.20.1 - diff --git a/patches/drivers/ti/rogerq_pruss/0025-HACK-implement-reset-control-for-pruss.patch b/patches/drivers/ti/rogerq_pruss/0025-HACK-implement-reset-control-for-pruss.patch deleted file mode 100644 index 55ccd7eb2..000000000 --- a/patches/drivers/ti/rogerq_pruss/0025-HACK-implement-reset-control-for-pruss.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 4116fe85ecf55363ef92eba591acf3d9b02f2ed0 Mon Sep 17 00:00:00 2001 -From: Roger Quadros <rogerq@ti.com> -Date: Tue, 29 Jan 2019 13:46:01 +0200 -Subject: [PATCH 25/25] HACK: implement reset-control for pruss - -Signed-off-by: Roger Quadros <rogerq@ti.com> ---- - arch/arm/boot/dts/am33xx-l4.dtsi | 20 ++++++++++++++++++-- - 1 file changed, 18 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi -index 5237413a2272..cce943622ec0 100644 ---- a/arch/arm/boot/dts/am33xx-l4.dtsi -+++ b/arch/arm/boot/dts/am33xx-l4.dtsi -@@ -1,3 +1,5 @@ -+#include <dt-bindings/reset/ti-syscon.h> -+ - &l4_wkup { /* 0x44c00000 */ - compatible = "ti,am33xx-l4-wkup", "simple-bus"; - reg = <0x44c00000 0x800>, -@@ -96,10 +98,10 @@ - - prcm: prcm@0 { - compatible = "ti,am3-prcm", "simple-bus"; -- reg = <0 0x2000>; -+ reg = <0 0xb00>; - #address-cells = <1>; - #size-cells = <1>; -- ranges = <0 0 0x2000>; -+ ranges = <0 0 0xb00>; - - prcm_clocks: clocks { - #address-cells = <1>; -@@ -108,6 +110,19 @@ - - prcm_clockdomains: clockdomains { - }; -+ -+ }; -+ -+ prm_per { -+ compatible = "syscon", "simple-bus"; -+ reg = <0x0c00 100>; -+ per_rst: reset-controller { -+ compatible = "ti,syscon-reset"; -+ #reset-cells = <1>; -+ ti,reset-bits = < -+ 0x0 1 0x0 1 0x0 0 (ASSERT_SET | DEASSERT_CLEAR | STATUS_NONE) /* 0: pruss */ -+ >; -+ }; - }; - }; - -@@ -768,6 +783,7 @@ - clocks = <&pruss_ocp_clkctrl AM3_PRUSS_OCP_PRUSS_CLKCTRL 0>; - clock-names = "fck"; - /* TODO: Use Reset control for RM_PER_RSTCTRL, bit 1 */ -+ resets = <&per_rst 0>; - - #address-cells = <1>; - #size-cells = <1>; --- -2.20.1 - diff --git a/patches/drivers/ti/rpmsg/0001-ARM-samples-seccomp-no-m32.patch b/patches/drivers/ti/rpmsg/0001-ARM-samples-seccomp-no-m32.patch index 1f7501e0c..a03caacd6 100644 --- a/patches/drivers/ti/rpmsg/0001-ARM-samples-seccomp-no-m32.patch +++ b/patches/drivers/ti/rpmsg/0001-ARM-samples-seccomp-no-m32.patch @@ -1,4 +1,4 @@ -From f29b6e8f7a93875595eea16a109521160198edfa Mon Sep 17 00:00:00 2001 +From 0371312fece57b26784e0b588a17e8219764f6b6 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Fri, 30 Oct 2015 11:14:50 -0500 Subject: [PATCH] ARM: samples seccomp no -m32 @@ -9,10 +9,10 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 1 file changed, 2 insertions(+) diff --git a/samples/seccomp/Makefile b/samples/seccomp/Makefile -index ba942e3ead89..8e4e941dfc18 100644 +index fb43a814d4c0..0c3fdf5dd715 100644 --- a/samples/seccomp/Makefile +++ b/samples/seccomp/Makefile -@@ -18,6 +18,7 @@ bpf-direct-objs := bpf-direct.o +@@ -22,6 +22,7 @@ user-trap-objs := user-trap.o # Try to match the kernel target. ifndef CONFIG_64BIT @@ -20,11 +20,11 @@ index ba942e3ead89..8e4e941dfc18 100644 # s390 has -m31 flag to build 31 bit binaries ifndef CONFIG_S390 -@@ -36,3 +37,4 @@ HOSTLOADLIBES_dropper += $(MFLAG) +@@ -42,3 +43,4 @@ HOSTLDLIBS_user-trap += $(MFLAG) endif always := $(hostprogs-m) endif +endif -- -2.16.1 +2.20.1 diff --git a/patches/drivers/ti/serial/0001-quiet-8250_omap.c-use-pr_info-over-pr_err.patch b/patches/drivers/ti/serial/0001-quiet-8250_omap.c-use-pr_info-over-pr_err.patch index 1f70a5a99..37f9b6bc8 100644 --- a/patches/drivers/ti/serial/0001-quiet-8250_omap.c-use-pr_info-over-pr_err.patch +++ b/patches/drivers/ti/serial/0001-quiet-8250_omap.c-use-pr_info-over-pr_err.patch @@ -1,4 +1,4 @@ -From c065c112e7820d2203886811ff04c082eefc977d Mon Sep 17 00:00:00 2001 +From c7ce33cb5f4f0dab18ebb10584eec77e8f84fce5 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Thu, 16 Jul 2015 17:24:57 -0500 Subject: [PATCH] quiet: 8250_omap.c use pr_info over pr_err @@ -9,10 +9,10 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c -index d75a66c7..7aabae4 100644 +index 0a8316632d75..8ecebd14c655 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c -@@ -1350,10 +1350,10 @@ static int __init omap8250_console_fixup(void) +@@ -1503,10 +1503,10 @@ static int __init omap8250_console_fixup(void) } add_preferred_console("ttyS", idx, options); @@ -27,5 +27,5 @@ index d75a66c7..7aabae4 100644 } console_initcall(omap8250_console_fixup); -- -2.1.4 +2.20.1 diff --git a/patches/drivers/ti/spi/0001-am33xx-spi-we-want-spidev1-spidev2-for-compability-w.patch b/patches/drivers/ti/spi/0001-am33xx-spi-we-want-spidev1-spidev2-for-compability-w.patch deleted file mode 100644 index 123c0d6bc..000000000 --- a/patches/drivers/ti/spi/0001-am33xx-spi-we-want-spidev1-spidev2-for-compability-w.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 14cee610e545005f71c116b845d4104221884ed3 Mon Sep 17 00:00:00 2001 -From: Robert Nelson <robertcnelson@gmail.com> -Date: Fri, 15 Jun 2018 13:21:34 -0500 -Subject: [PATCH] am33xx: spi: we want spidev1/spidev2 for compability with - v4.4/v4.9 - -Signed-off-by: Robert Nelson <robertcnelson@gmail.com> ---- - arch/arm/boot/dts/am33xx.dtsi | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi -index a048086d10b8..d30a40e4b872 100644 ---- a/arch/arm/boot/dts/am33xx.dtsi -+++ b/arch/arm/boot/dts/am33xx.dtsi -@@ -36,8 +36,8 @@ - phy1 = &usb1_phy; - ethernet0 = &cpsw_emac0; - ethernet1 = &cpsw_emac1; -- spi0 = &spi0; -- spi1 = &spi1; -+ spi1 = &spi0; -+ spi2 = &spi1; - }; - - cpus { --- -2.17.1 - diff --git a/patches/drivers/ti/tsc/0001-ti_am335x_tsc.c-driver.patch b/patches/drivers/ti/tsc/0001-ti_am335x_tsc.c-driver.patch index 80844b611..dccdcd65d 100644 --- a/patches/drivers/ti/tsc/0001-ti_am335x_tsc.c-driver.patch +++ b/patches/drivers/ti/tsc/0001-ti_am335x_tsc.c-driver.patch @@ -1,7 +1,7 @@ -From ae23ae812dbcd61a51233345ec0fd2bf1fab01a9 Mon Sep 17 00:00:00 2001 +From fa32ff33601d0dac59303d174422704eab506e11 Mon Sep 17 00:00:00 2001 From: "bigguiness@gmail.com" <bigguiness@gmail.com> Date: Wed, 3 Jan 2018 15:34:07 -0800 -Subject: [PATCH 18/18] ti_am335x_tsc.c driver +Subject: [PATCH 1/2] ti_am335x_tsc.c driver ------=_Part_422_1349561576.1515022447432 Content-Type: text/plain; charset="UTF-8" @@ -56,10 +56,10 @@ Hartley 1 file changed, 1 insertion(+) diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c -index 7953381d939a..534b6c0e520c 100644 +index 83e685557a19..4e0f28e0b548 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c -@@ -446,6 +446,7 @@ static int titsc_probe(struct platform_device *pdev) +@@ -459,6 +459,7 @@ static int titsc_probe(struct platform_device *pdev) input_dev->name = "ti-tsc"; input_dev->dev.parent = &pdev->dev; @@ -68,5 +68,5 @@ index 7953381d939a..534b6c0e520c 100644 input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); -- -2.15.1 +2.20.1 diff --git a/patches/drivers/ti/tsc/0002-ti_am335x_tsc-correct-formula-code-to-calculate-pres.patch b/patches/drivers/ti/tsc/0002-ti_am335x_tsc-correct-formula-code-to-calculate-pres.patch index 64a38d7f3..3a002c1ba 100644 --- a/patches/drivers/ti/tsc/0002-ti_am335x_tsc-correct-formula-code-to-calculate-pres.patch +++ b/patches/drivers/ti/tsc/0002-ti_am335x_tsc-correct-formula-code-to-calculate-pres.patch @@ -1,18 +1,18 @@ -From 6ee3efdc428c3ebbbd23ed8686659c3a4c9a31b4 Mon Sep 17 00:00:00 2001 +From fe9afccc9356ce4327c61f843158257b22786577 Mon Sep 17 00:00:00 2001 From: frost <ifagle@qq.com> Date: Fri, 12 May 2017 00:22:29 +0800 -Subject: [PATCH] ti_am335x_tsc: correct formula code to calculate pressure; - fix touchscreen jitter problem +Subject: [PATCH 2/2] ti_am335x_tsc: correct formula code to calculate + pressure; fix touchscreen jitter problem --- drivers/input/touchscreen/ti_am335x_tsc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c -index 22a76efce2b3..8379e8639a07 100644 +index 4e0f28e0b548..dd358bff4a55 100644 --- a/drivers/input/touchscreen/ti_am335x_tsc.c +++ b/drivers/input/touchscreen/ti_am335x_tsc.c -@@ -33,6 +33,7 @@ +@@ -34,6 +34,7 @@ #define ADCFSM_STEPID 0x10 #define SEQ_SETTLE 275 #define MAX_12BIT ((1 << 12) - 1) @@ -20,7 +20,7 @@ index 22a76efce2b3..8379e8639a07 100644 #define TSC_IRQENB_MASK (IRQENB_FIFO0THRES | IRQENB_EOS | IRQENB_HW_PEN) -@@ -232,6 +233,7 @@ static void titsc_read_coordinates(struct titsc *ts_dev, +@@ -234,6 +235,7 @@ static void titsc_read_coordinates(struct titsc *ts_dev, for (i = 0; i < creads; i++) { xvals[i] = titsc_readl(ts_dev, REG_FIFO0); xvals[i] &= 0xfff; @@ -28,7 +28,7 @@ index 22a76efce2b3..8379e8639a07 100644 } /* -@@ -310,13 +312,13 @@ static irqreturn_t titsc_irq(int irq, void *dev) +@@ -312,13 +314,13 @@ static irqreturn_t titsc_irq(int irq, void *dev) * Resistance(touch) = x plate resistance * * x postion/4096 * ((z2 / z1) - 1) */ @@ -47,5 +47,5 @@ index 22a76efce2b3..8379e8639a07 100644 input_report_abs(input_dev, ABS_Y, y); input_report_abs(input_dev, ABS_PRESSURE, z); -- -2.17.1 +2.20.1 diff --git a/patches/drivers/tps65217/0001-HACK-tps65217_pwr_but.patch b/patches/drivers/tps65217/0001-HACK-tps65217_pwr_but.patch index eaa8c4d8d..f5d3abcac 100644 --- a/patches/drivers/tps65217/0001-HACK-tps65217_pwr_but.patch +++ b/patches/drivers/tps65217/0001-HACK-tps65217_pwr_but.patch @@ -1,7 +1,7 @@ -From ba4fafae9aaa85ff1dae6ee4f9e94f76e9407ebb Mon Sep 17 00:00:00 2001 +From fd9c8bf4ac08100d58d5e51a383db18d66bf1714 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Fri, 28 Oct 2016 14:14:27 -0500 -Subject: [PATCH 9/9] HACK: tps65217_pwr_but +Subject: [PATCH] HACK: tps65217_pwr_but Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -9,7 +9,7 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c -index 3273217..6f26022 100644 +index a4455bb12ae0..b6d4321d421f 100644 --- a/drivers/input/misc/tps65218-pwrbutton.c +++ b/drivers/input/misc/tps65218-pwrbutton.c @@ -36,7 +36,7 @@ struct tps6521x_data { @@ -22,5 +22,5 @@ index 3273217..6f26022 100644 static const struct tps6521x_data tps65218_data = { -- -2.10.2 +2.20.1 diff --git a/patches/drivers/wiznet/0001-wiznet-w5100-spi-hack-dt-support-for-w5500.patch b/patches/drivers/wiznet/0001-wiznet-w5100-spi-hack-dt-support-for-w5500.patch index dddc3cf2d..3dfada444 100644 --- a/patches/drivers/wiznet/0001-wiznet-w5100-spi-hack-dt-support-for-w5500.patch +++ b/patches/drivers/wiznet/0001-wiznet-w5100-spi-hack-dt-support-for-w5500.patch @@ -1,4 +1,4 @@ -From 7fd1620de98d4865516fd626fd052ba6a00e723d Mon Sep 17 00:00:00 2001 +From f1fdb7f107cc3edc4cc6e930bb33e373162b5c48 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Thu, 5 Oct 2017 15:30:04 -0500 Subject: [PATCH] wiznet: w5100-spi: hack dt support for w5500 @@ -49,5 +49,5 @@ index 93a2d3c07303..e981d2ab2336 100644 .probe = w5100_spi_probe, .remove = w5100_spi_remove, -- -2.14.2 +2.20.1 diff --git a/patches/packaging/0001-packaging-sync-builddeb-changes.patch b/patches/packaging/0001-packaging-sync-builddeb-changes.patch index 93331464e..83d50b8f9 100644 --- a/patches/packaging/0001-packaging-sync-builddeb-changes.patch +++ b/patches/packaging/0001-packaging-sync-builddeb-changes.patch @@ -1,6 +1,6 @@ -From 6fbb7ab549326bbb182936793c3ada1a6637b403 Mon Sep 17 00:00:00 2001 +From b61bb949c8401afdce9b2c8044f6f7c2524ad786 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> -Date: Sun, 17 Mar 2019 18:32:36 -0500 +Date: Thu, 4 Apr 2019 16:47:16 -0500 Subject: [PATCH] packaging: sync builddeb changes Signed-off-by: Robert Nelson <robertcnelson@gmail.com> diff --git a/patches/ref_omap2plus_defconfig b/patches/ref_omap2plus_defconfig index d413620f7..556051e05 100644 --- a/patches/ref_omap2plus_defconfig +++ b/patches/ref_omap2plus_defconfig @@ -4,10 +4,10 @@ # # -# Compiler: arm-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802 +# Compiler: arm-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0 # CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=80201 +CONFIG_GCC_VERSION=80300 CONFIG_CLANG_VERSION=0 CONFIG_CC_HAS_ASM_GOTO=y CONFIG_CC_HAS_WARN_MAYBE_UNINITIALIZED=y diff --git a/patches/soc/imx/imx6/0001-first-pass-imx6q-ccimx6sbc.patch b/patches/soc/imx/imx6/0001-first-pass-imx6q-ccimx6sbc.patch deleted file mode 100644 index 121bc3fd6..000000000 --- a/patches/soc/imx/imx6/0001-first-pass-imx6q-ccimx6sbc.patch +++ /dev/null @@ -1,335 +0,0 @@ -From f2c3d91df075d2aea9a948151931b61a67d0abf6 Mon Sep 17 00:00:00 2001 -From: Robert Nelson <robertcnelson@gmail.com> -Date: Fri, 2 Feb 2018 10:34:22 -0600 -Subject: [PATCH 1/2] first pass: imx6q-ccimx6sbc - -Signed-off-by: Robert Nelson <robertcnelson@gmail.com> ---- - arch/arm/boot/dts/Makefile | 1 + - arch/arm/boot/dts/imx6q-ccimx6sbc.dts | 302 ++++++++++++++++++++++++++++++++++ - 2 files changed, 303 insertions(+) - create mode 100644 arch/arm/boot/dts/imx6q-ccimx6sbc.dts - -diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 896048482f5e..09fa63d0c511 100644 ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -435,6 +435,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \ - imx6q-b650v3.dtb \ - imx6q-b850v3.dtb \ - imx6q-cm-fx6.dtb \ -+ imx6q-ccimx6sbc.dtb \ - imx6q-cubox-i.dtb \ - imx6q-cubox-i-emmc-som-v15.dtb \ - imx6q-cubox-i-som-v15.dtb \ -diff --git a/arch/arm/boot/dts/imx6q-ccimx6sbc.dts b/arch/arm/boot/dts/imx6q-ccimx6sbc.dts -new file mode 100644 -index 000000000000..29b6b8eb5af4 ---- /dev/null -+++ b/arch/arm/boot/dts/imx6q-ccimx6sbc.dts -@@ -0,0 +1,302 @@ -+/* -+ * Copyright (C) 2015 Robert Nelson (robertcnelson@gmail.com) -+ * -+ * 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 -+ * version 2 as published by the Free Software Foundation. -+ * -+ * 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. -+ */ -+ -+/dts-v1/; -+#include <dt-bindings/gpio/gpio.h> -+#include "imx6q.dtsi" -+ -+/ { -+ model = "Digi ConnectCore-i.MX6 SBC Board"; -+ compatible = "digi,connectcore/q", "fsl,imx6q"; -+ -+ chosen { -+ stdout-path = &uart4; -+ }; -+ -+ memory { -+ reg = <0x10000000 0x40000000>; -+ }; -+ -+ regulators { -+ compatible = "simple-bus"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ reg_usbh1_reset: regulator@1 { -+ compatible = "regulator-fixed"; -+ reg = <1>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usbh1>; -+ regulator-name = "usbh1_reset"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ gpio = <&gpio3 10 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+ -+ reg_usb_otg_vbus: regulator@2 { -+ compatible = "regulator-fixed"; -+ reg = <2>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usbotg>; -+ regulator-name = "usb_otg_vbus"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ gpio = <&gpio3 22 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+ }; -+}; -+ -+&fec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_enet>; -+ phy-mode = "rgmii"; -+ phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; -+ status = "okay"; -+}; -+ -+&hdmi { -+ ddc-i2c-bus = <&i2c3>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ clock-frequency = <400000>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c2>; -+ status = "okay"; -+ -+ pmic@58 { -+ compatible = "dlg,da9063"; -+ reg = <0x58>; -+ interrupt-parent = <&gpio1>; -+ interrupts = <17 0x8>; /* active-low GPIO0_17 */ -+ -+ regulators { -+ vdd_3v3_reg: bperi { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-always-on; -+ }; -+ -+ ldo3_reg: ldo3 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-always-on; -+ }; -+ -+ ldo4_reg: ldo4 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-always-on; -+ }; -+ -+ ldo6_reg: ldo6 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-always-on; -+ }; -+ -+ ldo7_reg: ldo7 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-always-on; -+ }; -+ -+ ldo8_reg: ldo8 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-always-on; -+ }; -+ }; -+ }; -+}; -+ -+&i2c3 { -+ clock-frequency = <100000>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c3>; -+ status = "okay"; -+}; -+ -+&iomuxc { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_hog>; -+ -+ imx6qdl-ccimx6sbc { -+ pinctrl_hog: hoggrp { -+ fsl,pins = < -+ /* da9063*/ -+ MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x80000000 -+ >; -+ }; -+ -+ pinctrl_enet: enetgrp { -+ fsl,pins = < -+ MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x100b0 -+ MX6QDL_PAD_ENET_MDC__ENET_MDC 0x100b0 -+ MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x100b0 -+ MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x100b0 -+ MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x100b0 -+ MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x100b0 -+ MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x100b0 -+ MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x100b0 -+ MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x100b0 -+ MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0 -+ MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x1b0b0 -+ MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x1b0b0 -+ MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0 -+ MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0 -+ MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b0b0 -+ /* Phy reset */ -+ MX6QDL_PAD_ENET_CRS_DV__GPIO1_IO25 0x000b0 -+ >; -+ }; -+ -+ pinctrl_i2c2: i2c2grp { -+ fsl,pins = < -+ MX6QDL_PAD_KEY_COL3__I2C2_SCL 0x4001b8b1 -+ MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1 -+ >; -+ }; -+ -+ pinctrl_i2c3: i2c3grp { -+ fsl,pins = < -+ MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1 -+ MX6QDL_PAD_GPIO_6__I2C3_SDA 0x4001b8b1 -+ >; -+ }; -+ -+ pinctrl_uart4: uart4grp { -+ fsl,pins = < -+ MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1 -+ MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1 -+ >; -+ }; -+ -+ pinctrl_usbh1: usbh1grp { -+ fsl,pins = < -+ /* need to force low for hub reset */ -+ MX6QDL_PAD_EIM_DA10__GPIO3_IO10 0x10b0 -+ >; -+ }; -+ -+ pinctrl_usbotg: usbotggrp { -+ fsl,pins = < -+ MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059 -+ MX6QDL_PAD_EIM_D21__USB_OTG_OC 0x1b0b0 -+ /* power enable, high active */ -+ MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x10b0 -+ >; -+ }; -+ -+ pinctrl_usdhc2: usdhc2grp { -+ fsl,pins = < -+ MX6QDL_PAD_SD2_CMD__SD2_CMD 0x17059 -+ MX6QDL_PAD_SD2_CLK__SD2_CLK 0x10059 -+ MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x17059 -+ MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059 -+ MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059 -+ MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059 -+ >; -+ }; -+ -+ pinctrl_usdhc4: usdhc4grp { -+ fsl,pins = < -+ MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059 -+ MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059 -+ MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059 -+ MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059 -+ MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059 -+ MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059 -+ MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059 -+ MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059 -+ MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059 -+ MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059 -+ >; -+ }; -+ }; -+}; -+ -+&sata { -+ status = "okay"; -+}; -+ -+&ssi1 { -+ status = "okay"; -+}; -+ -+&uart4 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_uart4>; -+ status = "okay"; -+}; -+ -+&usbh1 { -+ vbus-supply = <®_usbh1_reset>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usbh1>; -+ status = "okay"; -+}; -+ -+&usbotg { -+ vbus-supply = <®_usb_otg_vbus>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usbotg>; -+ status = "okay"; -+}; -+ -+&usdhc2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usdhc2>; -+ bus-width = <4>; -+ broken-cd; /* cd & wp, is not wired up on this board */ -+ status = "okay"; -+}; -+ -+&usdhc4 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usdhc4>; -+ bus-width = <8>; -+ non-removable; -+ status = "okay"; -+}; --- -2.15.1 - diff --git a/patches/soc/imx/imx6/0002-mcimx6ul-bb-and-ism43362-b81-evb.patch b/patches/soc/imx/imx6/0002-mcimx6ul-bb-and-ism43362-b81-evb.patch deleted file mode 100644 index 29ff02792..000000000 --- a/patches/soc/imx/imx6/0002-mcimx6ul-bb-and-ism43362-b81-evb.patch +++ /dev/null @@ -1,562 +0,0 @@ -From 5cd69d2e90cc846055233713a279509dc4ba987e Mon Sep 17 00:00:00 2001 -From: Robert Nelson <robertcnelson@gmail.com> -Date: Tue, 30 Oct 2018 16:21:41 -0500 -Subject: [PATCH 2/2] mcimx6ul-bb and ism43362-b81-evb - -Signed-off-by: Robert Nelson <robertcnelson@gmail.com> ---- - arch/arm/boot/dts/Makefile | 1 + - .../dts/imx6ul-14x14-evk-ism43362-b81-evb.dts | 529 ++++++++++++++++++ - 2 files changed, 530 insertions(+) - create mode 100644 arch/arm/boot/dts/imx6ul-14x14-evk-ism43362-b81-evb.dts - -diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 28a0684281b9..7fca86b558f0 100644 ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -556,6 +556,7 @@ dtb-$(CONFIG_SOC_IMX6SX) += \ - imx6sx-udoo-neo-full.dtb - dtb-$(CONFIG_SOC_IMX6UL) += \ - imx6ul-14x14-evk.dtb \ -+ imx6ul-14x14-evk-ism43362-b81-evb.dtb \ - imx6ul-ccimx6ulsbcexpress.dtb \ - imx6ul-ccimx6ulsbcpro.dtb \ - imx6ul-geam.dtb \ -diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk-ism43362-b81-evb.dts b/arch/arm/boot/dts/imx6ul-14x14-evk-ism43362-b81-evb.dts -new file mode 100644 -index 000000000000..4920bebb006e ---- /dev/null -+++ b/arch/arm/boot/dts/imx6ul-14x14-evk-ism43362-b81-evb.dts -@@ -0,0 +1,529 @@ -+/* -+ * Copyright (C) 2015 Freescale Semiconductor, Inc. -+ * -+ * 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. -+ */ -+ -+/dts-v1/; -+ -+#include "imx6ul.dtsi" -+ -+/ { -+ model = "Freescale i.MX6 UltraLite 14x14 EVK Board"; -+ compatible = "fsl,imx6ul-14x14-evk", "fsl,imx6ul"; -+ -+ chosen { -+ stdout-path = &uart1; -+ }; -+ -+ memory@80000000 { -+ reg = <0x80000000 0x20000000>; -+ }; -+ -+ backlight_display: backlight-display { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm1 0 5000000>; -+ brightness-levels = <0 4 8 16 32 64 128 255>; -+ default-brightness-level = <6>; -+ status = "okay"; -+ }; -+ -+ regulators { -+ compatible = "simple-bus"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ reg_sd1_vmmc: sd1_regulator { -+ compatible = "regulator-fixed"; -+ regulator-name = "VSD_3V3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+ -+ wlreg_on: fixedregulator@100 { -+ compatible = "regulator-fixed"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-name = "wlreg_on"; -+ gpio = <&gpio5 1 GPIO_ACTIVE_HIGH>; -+ startup-delay-us = <100>; -+ enable-active-high; -+ }; -+ }; -+ -+ sound { -+ compatible = "simple-audio-card"; -+ simple-audio-card,name = "mx6ul-wm8960"; -+ simple-audio-card,format = "i2s"; -+ simple-audio-card,bitclock-master = <&dailink_master>; -+ simple-audio-card,frame-master = <&dailink_master>; -+ simple-audio-card,widgets = -+ "Microphone", "Mic Jack", -+ "Line", "Line In", -+ "Line", "Line Out", -+ "Speaker", "Speaker", -+ "Headphone", "Headphone Jack"; -+ simple-audio-card,routing = -+ "Headphone Jack", "HP_L", -+ "Headphone Jack", "HP_R", -+ "Speaker", "SPK_LP", -+ "Speaker", "SPK_LN", -+ "Speaker", "SPK_RP", -+ "Speaker", "SPK_RN", -+ "LINPUT1", "Mic Jack", -+ "LINPUT3", "Mic Jack", -+ "RINPUT1", "Mic Jack", -+ "RINPUT2", "Mic Jack"; -+ -+ simple-audio-card,cpu { -+ sound-dai = <&sai2>; -+ }; -+ -+ dailink_master: simple-audio-card,codec { -+ sound-dai = <&codec>; -+ clocks = <&clks IMX6UL_CLK_SAI2>; -+ }; -+ }; -+ -+ panel { -+ compatible = "innolux,at043tn24"; -+ backlight = <&backlight_display>; -+ -+ port { -+ panel_in: endpoint { -+ remote-endpoint = <&display_out>; -+ }; -+ }; -+ }; -+}; -+ -+&clks { -+ assigned-clocks = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>; -+ assigned-clock-rates = <786432000>; -+}; -+ -+&i2c2 { -+ clock_frequency = <100000>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c2>; -+ status = "okay"; -+ -+ codec: wm8960@1a { -+ #sound-dai-cells = <0>; -+ compatible = "wlf,wm8960"; -+ reg = <0x1a>; -+ wlf,shared-lrclk; -+ }; -+}; -+ -+&fec1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_enet1>; -+ phy-mode = "rmii"; -+ phy-handle = <ðphy0>; -+ status = "okay"; -+}; -+ -+&fec2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_enet2>; -+ phy-mode = "rmii"; -+ phy-handle = <ðphy1>; -+ status = "okay"; -+ -+ mdio { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ ethphy0: ethernet-phy@2 { -+ reg = <2>; -+ micrel,led-mode = <1>; -+ clocks = <&clks IMX6UL_CLK_ENET_REF>; -+ clock-names = "rmii-ref"; -+ }; -+ -+ ethphy1: ethernet-phy@1 { -+ reg = <1>; -+ micrel,led-mode = <1>; -+ clocks = <&clks IMX6UL_CLK_ENET2_REF>; -+ clock-names = "rmii-ref"; -+ }; -+ }; -+}; -+ -+&i2c1 { -+ clock-frequency = <100000>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c1>; -+ status = "okay"; -+ -+ mag3110@e { -+ compatible = "fsl,mag3110"; -+ reg = <0x0e>; -+ }; -+}; -+ -+&lcdif { -+ assigned-clocks = <&clks IMX6UL_CLK_LCDIF_PRE_SEL>; -+ assigned-clock-parents = <&clks IMX6UL_CLK_PLL5_VIDEO_DIV>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_lcdif_dat -+ &pinctrl_lcdif_ctrl>; -+ status = "okay"; -+ -+ port { -+ display_out: endpoint { -+ remote-endpoint = <&panel_in>; -+ }; -+ }; -+}; -+ -+&pwm1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_pwm1>; -+ status = "okay"; -+}; -+ -+&qspi { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_qspi>; -+ status = "okay"; -+ -+ flash0: n25q256a@0 { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ compatible = "micron,n25q256a"; -+ spi-max-frequency = <29000000>; -+ reg = <0>; -+ }; -+}; -+ -+&sai2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_sai2>; -+ assigned-clocks = <&clks IMX6UL_CLK_SAI2_SEL>, -+ <&clks IMX6UL_CLK_SAI2>; -+ assigned-clock-parents = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>; -+ assigned-clock-rates = <0>, <12288000>; -+ fsl,sai-mclk-direction-output; -+ status = "okay"; -+}; -+ -+&snvs_poweroff { -+ status = "okay"; -+}; -+ -+&tsc { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_tsc>; -+ xnur-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>; -+ measure-delay-time = <0xffff>; -+ pre-charge-time = <0xfff>; -+ status = "okay"; -+}; -+ -+&uart1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_uart1>; -+ status = "okay"; -+}; -+ -+&uart2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_uart2>; -+ uart-has-rtscts; -+ status = "okay"; -+}; -+ -+&usbotg1 { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usbotg2 { -+ dr_mode = "host"; -+ disable-over-current; -+ status = "okay"; -+}; -+ -+&usbphy1 { -+ fsl,tx-d-cal = <106>; -+}; -+ -+&usbphy2 { -+ fsl,tx-d-cal = <106>; -+}; -+ -+®_sd1_vmmc { -+ regulator-always-on; -+}; -+ -+&usdhc1 { -+ pinctrl-names = "default", "state_100mhz", "state_200mhz"; -+ pinctrl-0 = <&pinctrl_usdhc1>; -+ pinctrl-1 = <&pinctrl_usdhc1_100mhz>; -+ pinctrl-2 = <&pinctrl_usdhc1_200mhz>; -+ cd-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>; -+ no-1-8-v; -+ keep-power-in-suspend; -+ wakeup-source; -+ vmmc-supply = <®_sd1_vmmc>; -+ status = "okay"; -+}; -+ -+&usdhc2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usdhc2>; -+ no-1-8-v; -+ keep-power-in-suspend; -+ wakeup-source; -+ status = "okay"; -+}; -+ -+&wdog1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_wdog>; -+ fsl,ext-reset-output; -+}; -+ -+&iomuxc { -+ pinctrl-names = "default"; -+ -+ pinctrl_csi1: csi1grp { -+ fsl,pins = < -+ MX6UL_PAD_CSI_MCLK__CSI_MCLK 0x1b088 -+ MX6UL_PAD_CSI_PIXCLK__CSI_PIXCLK 0x1b088 -+ MX6UL_PAD_CSI_VSYNC__CSI_VSYNC 0x1b088 -+ MX6UL_PAD_CSI_HSYNC__CSI_HSYNC 0x1b088 -+ MX6UL_PAD_CSI_DATA00__CSI_DATA02 0x1b088 -+ MX6UL_PAD_CSI_DATA01__CSI_DATA03 0x1b088 -+ MX6UL_PAD_CSI_DATA02__CSI_DATA04 0x1b088 -+ MX6UL_PAD_CSI_DATA03__CSI_DATA05 0x1b088 -+ MX6UL_PAD_CSI_DATA04__CSI_DATA06 0x1b088 -+ MX6UL_PAD_CSI_DATA05__CSI_DATA07 0x1b088 -+ MX6UL_PAD_CSI_DATA06__CSI_DATA08 0x1b088 -+ MX6UL_PAD_CSI_DATA07__CSI_DATA09 0x1b088 -+ >; -+ }; -+ -+ pinctrl_enet1: enet1grp { -+ fsl,pins = < -+ MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x1b0b0 -+ MX6UL_PAD_ENET1_RX_ER__ENET1_RX_ER 0x1b0b0 -+ MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0 -+ MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0 -+ MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b0b0 -+ MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0 -+ MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0 -+ MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x4001b031 -+ >; -+ }; -+ -+ pinctrl_enet2: enet2grp { -+ fsl,pins = < -+ MX6UL_PAD_GPIO1_IO07__ENET2_MDC 0x1b0b0 -+ MX6UL_PAD_GPIO1_IO06__ENET2_MDIO 0x1b0b0 -+ MX6UL_PAD_ENET2_RX_EN__ENET2_RX_EN 0x1b0b0 -+ MX6UL_PAD_ENET2_RX_ER__ENET2_RX_ER 0x1b0b0 -+ MX6UL_PAD_ENET2_RX_DATA0__ENET2_RDATA00 0x1b0b0 -+ MX6UL_PAD_ENET2_RX_DATA1__ENET2_RDATA01 0x1b0b0 -+ MX6UL_PAD_ENET2_TX_EN__ENET2_TX_EN 0x1b0b0 -+ MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0 -+ MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0 -+ MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031 -+ MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x17059 -+ >; -+ }; -+ -+ pinctrl_flexcan1: flexcan1grp{ -+ fsl,pins = < -+ MX6UL_PAD_UART3_RTS_B__FLEXCAN1_RX 0x1b020 -+ MX6UL_PAD_UART3_CTS_B__FLEXCAN1_TX 0x1b020 -+ >; -+ }; -+ -+ pinctrl_flexcan2: flexcan2grp{ -+ fsl,pins = < -+ MX6UL_PAD_UART2_RTS_B__FLEXCAN2_RX 0x1b020 -+ MX6UL_PAD_UART2_CTS_B__FLEXCAN2_TX 0x1b020 -+ >; -+ }; -+ -+ pinctrl_i2c1: i2c1grp { -+ fsl,pins = < -+ MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x4001b8b0 -+ MX6UL_PAD_UART4_RX_DATA__I2C1_SDA 0x4001b8b0 -+ >; -+ }; -+ -+ pinctrl_i2c2: i2c2grp { -+ fsl,pins = < -+ MX6UL_PAD_UART5_TX_DATA__I2C2_SCL 0x4001b8b0 -+ MX6UL_PAD_UART5_RX_DATA__I2C2_SDA 0x4001b8b0 -+ >; -+ }; -+ -+ pinctrl_lcdif_dat: lcdifdatgrp { -+ fsl,pins = < -+ MX6UL_PAD_LCD_DATA00__LCDIF_DATA00 0x79 -+ MX6UL_PAD_LCD_DATA01__LCDIF_DATA01 0x79 -+ MX6UL_PAD_LCD_DATA02__LCDIF_DATA02 0x79 -+ MX6UL_PAD_LCD_DATA03__LCDIF_DATA03 0x79 -+ MX6UL_PAD_LCD_DATA04__LCDIF_DATA04 0x79 -+ MX6UL_PAD_LCD_DATA05__LCDIF_DATA05 0x79 -+ MX6UL_PAD_LCD_DATA06__LCDIF_DATA06 0x79 -+ MX6UL_PAD_LCD_DATA07__LCDIF_DATA07 0x79 -+ MX6UL_PAD_LCD_DATA08__LCDIF_DATA08 0x79 -+ MX6UL_PAD_LCD_DATA09__LCDIF_DATA09 0x79 -+ MX6UL_PAD_LCD_DATA10__LCDIF_DATA10 0x79 -+ MX6UL_PAD_LCD_DATA11__LCDIF_DATA11 0x79 -+ MX6UL_PAD_LCD_DATA12__LCDIF_DATA12 0x79 -+ MX6UL_PAD_LCD_DATA13__LCDIF_DATA13 0x79 -+ MX6UL_PAD_LCD_DATA14__LCDIF_DATA14 0x79 -+ MX6UL_PAD_LCD_DATA15__LCDIF_DATA15 0x79 -+ MX6UL_PAD_LCD_DATA16__LCDIF_DATA16 0x79 -+ MX6UL_PAD_LCD_DATA17__LCDIF_DATA17 0x79 -+ MX6UL_PAD_LCD_DATA18__LCDIF_DATA18 0x79 -+ MX6UL_PAD_LCD_DATA19__LCDIF_DATA19 0x79 -+ MX6UL_PAD_LCD_DATA20__LCDIF_DATA20 0x79 -+ MX6UL_PAD_LCD_DATA21__LCDIF_DATA21 0x79 -+ MX6UL_PAD_LCD_DATA22__LCDIF_DATA22 0x79 -+ MX6UL_PAD_LCD_DATA23__LCDIF_DATA23 0x79 -+ >; -+ }; -+ -+ pinctrl_lcdif_ctrl: lcdifctrlgrp { -+ fsl,pins = < -+ MX6UL_PAD_LCD_CLK__LCDIF_CLK 0x79 -+ MX6UL_PAD_LCD_ENABLE__LCDIF_ENABLE 0x79 -+ MX6UL_PAD_LCD_HSYNC__LCDIF_HSYNC 0x79 -+ MX6UL_PAD_LCD_VSYNC__LCDIF_VSYNC 0x79 -+ /* used for lcd reset */ -+ MX6UL_PAD_SNVS_TAMPER9__GPIO5_IO09 0x79 -+ >; -+ }; -+ -+ pinctrl_qspi: qspigrp { -+ fsl,pins = < -+ MX6UL_PAD_NAND_WP_B__QSPI_A_SCLK 0x70a1 -+ MX6UL_PAD_NAND_READY_B__QSPI_A_DATA00 0x70a1 -+ MX6UL_PAD_NAND_CE0_B__QSPI_A_DATA01 0x70a1 -+ MX6UL_PAD_NAND_CE1_B__QSPI_A_DATA02 0x70a1 -+ MX6UL_PAD_NAND_CLE__QSPI_A_DATA03 0x70a1 -+ MX6UL_PAD_NAND_DQS__QSPI_A_SS0_B 0x70a1 -+ >; -+ }; -+ -+ pinctrl_sai2: sai2grp { -+ fsl,pins = < -+ MX6UL_PAD_JTAG_TDI__SAI2_TX_BCLK 0x17088 -+ MX6UL_PAD_JTAG_TDO__SAI2_TX_SYNC 0x17088 -+ MX6UL_PAD_JTAG_TRST_B__SAI2_TX_DATA 0x11088 -+ MX6UL_PAD_JTAG_TCK__SAI2_RX_DATA 0x11088 -+ MX6UL_PAD_JTAG_TMS__SAI2_MCLK 0x17088 -+ MX6UL_PAD_SNVS_TAMPER4__GPIO5_IO04 0x17059 -+ >; -+ }; -+ -+ pinctrl_pwm1: pwm1grp { -+ fsl,pins = < -+ MX6UL_PAD_GPIO1_IO08__PWM1_OUT 0x110b0 -+ >; -+ }; -+ -+ pinctrl_sim2: sim2grp { -+ fsl,pins = < -+ MX6UL_PAD_CSI_DATA03__SIM2_PORT1_PD 0xb808 -+ MX6UL_PAD_CSI_DATA04__SIM2_PORT1_CLK 0x31 -+ MX6UL_PAD_CSI_DATA05__SIM2_PORT1_RST_B 0xb808 -+ MX6UL_PAD_CSI_DATA06__SIM2_PORT1_SVEN 0xb808 -+ MX6UL_PAD_CSI_DATA07__SIM2_PORT1_TRXD 0xb809 -+ MX6UL_PAD_CSI_DATA02__GPIO4_IO23 0x3008 -+ >; -+ }; -+ -+ pinctrl_tsc: tscgrp { -+ fsl,pins = < -+ MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0xb0 -+ MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0xb0 -+ MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0xb0 -+ MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0xb0 -+ >; -+ }; -+ -+ pinctrl_uart1: uart1grp { -+ fsl,pins = < -+ MX6UL_PAD_UART1_TX_DATA__UART1_DCE_TX 0x1b0b1 -+ MX6UL_PAD_UART1_RX_DATA__UART1_DCE_RX 0x1b0b1 -+ >; -+ }; -+ -+ pinctrl_uart2: uart2grp { -+ fsl,pins = < -+ MX6UL_PAD_UART2_TX_DATA__UART2_DCE_TX 0x1b0b1 -+ MX6UL_PAD_UART2_RX_DATA__UART2_DCE_RX 0x1b0b1 -+ MX6UL_PAD_UART3_RX_DATA__UART2_DCE_RTS 0x1b0b1 -+ MX6UL_PAD_UART3_TX_DATA__UART2_DCE_CTS 0x1b0b1 -+ >; -+ }; -+ -+ pinctrl_usdhc1: usdhc1grp { -+ fsl,pins = < -+ MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x17059 -+ MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x10071 -+ MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x17059 -+ MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x17059 -+ MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x17059 -+ MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x17059 -+ MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */ -+ MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */ -+ MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x17059 /* SD1 RESET */ -+ MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01 0x3029 -+ >; -+ }; -+ -+ pinctrl_usdhc1_100mhz: usdhc1grp100mhz { -+ fsl,pins = < -+ MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170b9 -+ MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100b9 -+ MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170b9 -+ MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170b9 -+ MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170b9 -+ MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170b9 -+ MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01 0x3029 -+ >; -+ }; -+ -+ pinctrl_usdhc1_200mhz: usdhc1grp200mhz { -+ fsl,pins = < -+ MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x170f9 -+ MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x100f9 -+ MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x170f9 -+ MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x170f9 -+ MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x170f9 -+ MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x170f9 -+ MX6UL_PAD_SNVS_TAMPER1__GPIO5_IO01 0x3029 -+ >; -+ }; -+ -+ pinctrl_usdhc2: usdhc2grp { -+ fsl,pins = < -+ MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x17059 -+ MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x17059 -+ MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x17059 -+ MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x17059 -+ MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x17059 -+ MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x17059 -+ >; -+ }; -+ -+ pinctrl_wdog: wdoggrp { -+ fsl,pins = < -+ MX6UL_PAD_LCD_RESET__WDOG1_WDOG_ANY 0x30b0 -+ >; -+ }; -+}; --- -2.19.1 - diff --git a/patches/soc/imx/imx7/0001-ARM-imx7d-pico-pi.dts-add-default-stdout-path.patch b/patches/soc/imx/imx7/0001-ARM-imx7d-pico-pi.dts-add-default-stdout-path.patch index 42f314d0a..9ca115883 100644 --- a/patches/soc/imx/imx7/0001-ARM-imx7d-pico-pi.dts-add-default-stdout-path.patch +++ b/patches/soc/imx/imx7/0001-ARM-imx7d-pico-pi.dts-add-default-stdout-path.patch @@ -1,4 +1,4 @@ -From f8f4256463bf09b530a489435713c76e597040f2 Mon Sep 17 00:00:00 2001 +From 6e8e5ccfbee7a531b035ffce3f95f3901946fa9d Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Wed, 9 Jan 2019 14:33:24 -0600 Subject: [PATCH] ARM: imx7d-pico-pi.dts: add default stdout-path diff --git a/patches/soc/imx/udoo/0001-binding-doc-power-pwrseq-generic-add-binding-doc-for.patch b/patches/soc/imx/udoo/0001-binding-doc-power-pwrseq-generic-add-binding-doc-for.patch index 3d1f6154d..5e052bf90 100644 --- a/patches/soc/imx/udoo/0001-binding-doc-power-pwrseq-generic-add-binding-doc-for.patch +++ b/patches/soc/imx/udoo/0001-binding-doc-power-pwrseq-generic-add-binding-doc-for.patch @@ -1,7 +1,7 @@ -From 07330d520c6009c86e650a58a0ca5e76fcb0b49d Mon Sep 17 00:00:00 2001 +From f5528e96b7dd2b30e1accc518df85d14baad6bae Mon Sep 17 00:00:00 2001 From: Peter Chen <peter.chen@nxp.com> Date: Thu, 18 May 2017 08:48:57 +0800 -Subject: [PATCH 1/7] binding-doc: power: pwrseq-generic: add binding doc for +Subject: [PATCH 1/9] binding-doc: power: pwrseq-generic: add binding doc for generic power sequence library Add binding doc for generic power sequence library. @@ -10,7 +10,7 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Rob Herring <robh@kernel.org> --- - .../bindings/power/pwrseq/pwrseq-generic.txt | 48 ++++++++++++++++++++++ + .../bindings/power/pwrseq/pwrseq-generic.txt | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/pwrseq/pwrseq-generic.txt @@ -69,5 +69,5 @@ index 000000000000..ebf0d477b688 + }; +}; -- -2.11.0 +2.20.1 diff --git a/patches/soc/imx/udoo/0002-power-add-power-sequence-library.patch b/patches/soc/imx/udoo/0002-power-add-power-sequence-library.patch index cd495e32c..42c811770 100644 --- a/patches/soc/imx/udoo/0002-power-add-power-sequence-library.patch +++ b/patches/soc/imx/udoo/0002-power-add-power-sequence-library.patch @@ -1,7 +1,7 @@ -From 6becdabac45eca834fa49f7fc22fc140e29043dd Mon Sep 17 00:00:00 2001 +From e42fbf22376c41b275d47b9cfac360c66ee718dc Mon Sep 17 00:00:00 2001 From: Peter Chen <peter.chen@nxp.com> Date: Thu, 18 May 2017 08:48:58 +0800 -Subject: [PATCH 2/7] power: add power sequence library +Subject: [PATCH 2/9] power: add power sequence library We have an well-known problem that the device needs to do some power sequence before it can be recognized by related host, the typical @@ -109,10 +109,10 @@ index 000000000000..554608e5f3b6 +.. kernel-doc:: drivers/power/pwrseq/core.c + :export: diff --git a/MAINTAINERS b/MAINTAINERS -index e5cbd400d184..a8b295bd540f 100644 +index 43b36dbed48e..188ba4f1e67d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS -@@ -10554,6 +10554,15 @@ F: drivers/firmware/psci*.c +@@ -12418,6 +12418,15 @@ F: drivers/firmware/psci*.c F: include/linux/psci.h F: include/uapi/linux/psci.h diff --git a/patches/soc/imx/udoo/0003-binding-doc-usb-usb-device-add-optional-properties-f.patch b/patches/soc/imx/udoo/0003-binding-doc-usb-usb-device-add-optional-properties-f.patch index f83c62eb1..644472cd4 100644 --- a/patches/soc/imx/udoo/0003-binding-doc-usb-usb-device-add-optional-properties-f.patch +++ b/patches/soc/imx/udoo/0003-binding-doc-usb-usb-device-add-optional-properties-f.patch @@ -1,7 +1,7 @@ -From 181913eae18c7edb10f3337eab6800fad9c2ac3c Mon Sep 17 00:00:00 2001 +From 65bfdb21c26a922b2ada21140782251465159ae3 Mon Sep 17 00:00:00 2001 From: Peter Chen <peter.chen@nxp.com> Date: Thu, 18 May 2017 08:48:59 +0800 -Subject: [PATCH 3/7] binding-doc: usb: usb-device: add optional properties for +Subject: [PATCH 3/9] binding-doc: usb: usb-device: add optional properties for power sequence Add optional properties for power sequence. diff --git a/patches/soc/imx/udoo/0004-usb-core-add-power-sequence-handling-for-USB-devices.patch b/patches/soc/imx/udoo/0004-usb-core-add-power-sequence-handling-for-USB-devices.patch index 4d940b32b..2b051b917 100644 --- a/patches/soc/imx/udoo/0004-usb-core-add-power-sequence-handling-for-USB-devices.patch +++ b/patches/soc/imx/udoo/0004-usb-core-add-power-sequence-handling-for-USB-devices.patch @@ -1,7 +1,7 @@ -From 4cd5f10e91fcb8e5cfb502cf488e1fbe8d46b6be Mon Sep 17 00:00:00 2001 +From a42362841fe263a6c97a1793ccd4b9246ac2b108 Mon Sep 17 00:00:00 2001 From: Peter Chen <peter.chen@nxp.com> Date: Thu, 18 May 2017 08:49:00 +0800 -Subject: [PATCH 4/7] usb: core: add power sequence handling for USB devices +Subject: [PATCH 4/9] usb: core: add power sequence handling for USB devices Some hard-wired USB devices need to do power sequence to let the device work normally, the typical power sequence like: enable USB diff --git a/patches/soc/imx/udoo/0005-ARM-dts-imx6qdl-Enable-usb-node-children-with-reg.patch b/patches/soc/imx/udoo/0005-ARM-dts-imx6qdl-Enable-usb-node-children-with-reg.patch index e8b65270f..08afcccc0 100644 --- a/patches/soc/imx/udoo/0005-ARM-dts-imx6qdl-Enable-usb-node-children-with-reg.patch +++ b/patches/soc/imx/udoo/0005-ARM-dts-imx6qdl-Enable-usb-node-children-with-reg.patch @@ -1,7 +1,7 @@ -From d28841c18bbb0384e36ccfdb4df9e10b2c6789ff Mon Sep 17 00:00:00 2001 +From bf1b3a63aa2f3438750f5acdf372705f8a1beb41 Mon Sep 17 00:00:00 2001 From: Joshua Clayton <stillcompiling@gmail.com> Date: Thu, 18 May 2017 08:49:01 +0800 -Subject: [PATCH 5/7] ARM: dts: imx6qdl: Enable usb node children with <reg> +Subject: [PATCH 5/9] ARM: dts: imx6qdl: Enable usb node children with <reg> Give usb nodes #address and #size attributes, so that a child node representing a permanently connected device such as an onboard hub may @@ -14,10 +14,10 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com> 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi -index 1ce4eabf0590..3ff1ada590d1 100644 +index fe17a3405edc..a5f2f981255f 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi -@@ -969,6 +969,8 @@ +@@ -977,6 +977,8 @@ usbh1: usb@2184200 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; @@ -26,7 +26,7 @@ index 1ce4eabf0590..3ff1ada590d1 100644 reg = <0x02184200 0x200>; interrupts = <0 40 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX6QDL_CLK_USBOH3>; -@@ -983,6 +985,8 @@ +@@ -991,6 +993,8 @@ usbh2: usb@2184400 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; @@ -35,7 +35,7 @@ index 1ce4eabf0590..3ff1ada590d1 100644 reg = <0x02184400 0x200>; interrupts = <0 41 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX6QDL_CLK_USBOH3>; -@@ -996,6 +1000,8 @@ +@@ -1006,6 +1010,8 @@ usbh3: usb@2184600 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; @@ -45,5 +45,5 @@ index 1ce4eabf0590..3ff1ada590d1 100644 interrupts = <0 42 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX6QDL_CLK_USBOH3>; -- -2.19.0 +2.20.1 diff --git a/patches/soc/imx/udoo/0006-ARM-dts-imx6qdl-udoo.dtsi-fix-onboard-USB-HUB-proper.patch b/patches/soc/imx/udoo/0006-ARM-dts-imx6qdl-udoo.dtsi-fix-onboard-USB-HUB-proper.patch index 9d7f3c2ca..bee7df021 100644 --- a/patches/soc/imx/udoo/0006-ARM-dts-imx6qdl-udoo.dtsi-fix-onboard-USB-HUB-proper.patch +++ b/patches/soc/imx/udoo/0006-ARM-dts-imx6qdl-udoo.dtsi-fix-onboard-USB-HUB-proper.patch @@ -1,7 +1,7 @@ -From b089b85cd5ef6359e13c5dd90b95f39638477e39 Mon Sep 17 00:00:00 2001 +From c46707dde637ec75182c2f42f61aab96486bbcee Mon Sep 17 00:00:00 2001 From: Peter Chen <peter.chen@nxp.com> Date: Thu, 18 May 2017 08:49:02 +0800 -Subject: [PATCH 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property +Subject: [PATCH 6/9] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property The current dts describes USB HUB's property at USB controller's entry, it is improper. The USB HUB should be the child node @@ -16,7 +16,7 @@ Tested-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl-udoo.dtsi b/arch/arm/boot/dts/imx6qdl-udoo.dtsi -index 4f27861bbb32..dead14b0d4bf 100644 +index 776bfc77f89d..4781a9e04338 100644 --- a/arch/arm/boot/dts/imx6qdl-udoo.dtsi +++ b/arch/arm/boot/dts/imx6qdl-udoo.dtsi @@ -5,6 +5,8 @@ @@ -28,7 +28,7 @@ index 4f27861bbb32..dead14b0d4bf 100644 / { aliases { backlight = &backlight; -@@ -61,17 +63,6 @@ +@@ -62,17 +64,6 @@ #address-cells = <1>; #size-cells = <0>; @@ -46,7 +46,7 @@ index 4f27861bbb32..dead14b0d4bf 100644 reg_panel: regulator@1 { compatible = "regulator-fixed"; reg = <1>; -@@ -197,7 +188,7 @@ +@@ -205,7 +196,7 @@ pinctrl_usbh: usbhgrp { fsl,pins = < @@ -55,7 +55,7 @@ index 4f27861bbb32..dead14b0d4bf 100644 MX6QDL_PAD_NANDF_CS2__CCM_CLKO2 0x130b0 >; }; -@@ -268,9 +259,16 @@ +@@ -282,9 +273,16 @@ &usbh1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usbh>; @@ -75,5 +75,5 @@ index 4f27861bbb32..dead14b0d4bf 100644 &usdhc3 { -- -2.19.0 +2.20.1 diff --git a/patches/soc/imx/udoo/0007-ARM-dts-imx6q-evi-Fix-onboard-hub-reset-line.patch b/patches/soc/imx/udoo/0007-ARM-dts-imx6q-evi-Fix-onboard-hub-reset-line.patch index 42b5ed6f1..e3edb758b 100644 --- a/patches/soc/imx/udoo/0007-ARM-dts-imx6q-evi-Fix-onboard-hub-reset-line.patch +++ b/patches/soc/imx/udoo/0007-ARM-dts-imx6q-evi-Fix-onboard-hub-reset-line.patch @@ -1,7 +1,7 @@ -From 5a4337a51d034235276947faee68c6e01a09daff Mon Sep 17 00:00:00 2001 +From 0ae59d1767a9cf9875b35a026b5df13eeb3694db Mon Sep 17 00:00:00 2001 From: Joshua Clayton <stillcompiling@gmail.com> Date: Thu, 18 May 2017 08:49:03 +0800 -Subject: [PATCH 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line +Subject: [PATCH 7/9] ARM: dts: imx6q-evi: Fix onboard hub reset line Previously the onboard hub was made to work by treating its reset gpio as a regulator enable. @@ -15,10 +15,10 @@ Signed-off-by: Peter Chen <peter.chen@nxp.com> 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/arch/arm/boot/dts/imx6q-evi.dts b/arch/arm/boot/dts/imx6q-evi.dts -index fd2220aa49e2..24fe093a66db 100644 +index c63f371ede8b..546d9d4e8ca1 100644 --- a/arch/arm/boot/dts/imx6q-evi.dts +++ b/arch/arm/boot/dts/imx6q-evi.dts -@@ -54,18 +54,6 @@ +@@ -55,18 +55,6 @@ reg = <0x10000000 0x40000000>; }; @@ -37,7 +37,7 @@ index fd2220aa49e2..24fe093a66db 100644 reg_usb_otg_vbus: regulator-usbotgvbus { compatible = "regulator-fixed"; regulator-name = "usb_otg_vbus"; -@@ -204,12 +192,18 @@ +@@ -214,12 +202,18 @@ }; &usbh1 { @@ -57,7 +57,7 @@ index fd2220aa49e2..24fe093a66db 100644 }; &usbotg { -@@ -465,11 +459,6 @@ +@@ -482,11 +476,6 @@ MX6QDL_PAD_GPIO_3__USB_H1_OC 0x1b0b0 /* usbh1_b OC */ MX6QDL_PAD_GPIO_0__GPIO1_IO00 0x1b0b0 @@ -70,5 +70,5 @@ index fd2220aa49e2..24fe093a66db 100644 >; }; -- -2.11.0 +2.20.1 diff --git a/patches/soc/imx/udoo/0008-ARM-dts-driver-imx6-udooqdl-add-arduino-manager-driv.patch b/patches/soc/imx/udoo/0008-ARM-dts-driver-imx6-udooqdl-add-arduino-manager-driv.patch index dec36b2d3..0c9623141 100644 --- a/patches/soc/imx/udoo/0008-ARM-dts-driver-imx6-udooqdl-add-arduino-manager-driv.patch +++ b/patches/soc/imx/udoo/0008-ARM-dts-driver-imx6-udooqdl-add-arduino-manager-driv.patch @@ -1,8 +1,8 @@ -From a35b9dfc80338cf2049c75b0f4af22776001d5d3 Mon Sep 17 00:00:00 2001 +From 9a4d8e886600c7c330590a2435dd74eb16d480ce Mon Sep 17 00:00:00 2001 From: Steve Arnold <nerdboy@gentoo.org> Date: Fri, 15 Dec 2017 16:43:22 -0800 -Subject: [PATCH] ARM: dts,driver: imx6,udooqdl: add arduino manager driver and - update dts +Subject: [PATCH 8/9] ARM: dts,driver: imx6,udooqdl: add arduino manager driver + and update dts * note this is required to upload sketches to sam3 from arduino IDE @@ -11,15 +11,15 @@ Signed-off-by: Steve Arnold <nerdboy@gentoo.org> arch/arm/boot/dts/imx6qdl-udoo.dtsi | 20 ++ drivers/misc/Kconfig | 7 + drivers/misc/Makefile | 1 + - drivers/misc/udoo_ard.c | 417 ++++++++++++++++++++++++++++++++++++ + drivers/misc/udoo_ard.c | 417 ++++++++++++++++++++++++++++ 4 files changed, 445 insertions(+) create mode 100755 drivers/misc/udoo_ard.c diff --git a/arch/arm/boot/dts/imx6qdl-udoo.dtsi b/arch/arm/boot/dts/imx6qdl-udoo.dtsi -index e28f90005130..fd404d3299a5 100644 +index 4781a9e04338..554f601eb72a 100644 --- a/arch/arm/boot/dts/imx6qdl-udoo.dtsi +++ b/arch/arm/boot/dts/imx6qdl-udoo.dtsi -@@ -89,6 +89,17 @@ +@@ -84,6 +84,17 @@ mux-int-port = <1>; mux-ext-port = <6>; }; @@ -37,7 +37,7 @@ index e28f90005130..fd404d3299a5 100644 }; &fec { -@@ -200,6 +211,15 @@ +@@ -201,6 +212,15 @@ >; }; @@ -54,10 +54,10 @@ index e28f90005130..fd404d3299a5 100644 fsl,pins = < MX6QDL_PAD_SD3_CMD__SD3_CMD 0x17059 diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index f1c4c891cda3..afd54fdc983d 100644 +index 5a1c54960685..78afa68ec86c 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig -@@ -536,6 +536,13 @@ config TIEQEP +@@ -543,6 +543,13 @@ config TIEQEP To compile this driver as a module, choose M here: the module will be called tieqep. @@ -72,10 +72,10 @@ index f1c4c891cda3..afd54fdc983d 100644 source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index 3225f1e37dfc..b68828f424c4 100644 +index 0a139ba5446a..07caf5326851 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile -@@ -57,6 +57,7 @@ obj-y += cape/ +@@ -56,6 +56,7 @@ obj-y += cape/ obj-$(CONFIG_ECHO) += echo/ obj-$(CONFIG_VEXPRESS_SYSCFG) += vexpress-syscfg.o obj-$(CONFIG_CXL_BASE) += cxl/ @@ -507,5 +507,5 @@ index 000000000000..2210738e09c0 +MODULE_ALIAS("platform:"DRIVER_NAME); +MODULE_LICENSE("GPL"); -- -2.15.0 +2.20.1 diff --git a/patches/soc/imx/udoo/0009-udoo-clk-imx6q.c-set-IMX6QDL_CLK_CKO.patch b/patches/soc/imx/udoo/0009-udoo-clk-imx6q.c-set-IMX6QDL_CLK_CKO.patch index 81352350b..abd622e0d 100644 --- a/patches/soc/imx/udoo/0009-udoo-clk-imx6q.c-set-IMX6QDL_CLK_CKO.patch +++ b/patches/soc/imx/udoo/0009-udoo-clk-imx6q.c-set-IMX6QDL_CLK_CKO.patch @@ -1,7 +1,7 @@ -From 280af39162d8282f1fd9e68f4976f468c92dcf81 Mon Sep 17 00:00:00 2001 +From 294bf7cb251ba9d3c0b516862297a988f78b9f44 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Tue, 9 Oct 2018 16:13:37 -0500 -Subject: [PATCH 10/10] udoo: clk-imx6q.c: set IMX6QDL_CLK_CKO +Subject: [PATCH 9/9] udoo: clk-imx6q.c: set IMX6QDL_CLK_CKO Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -9,10 +9,10 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 1 file changed, 5 insertions(+) diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c -index 8d518ad5dc13..00b2a7311072 100644 +index 708e7c5590dd..8b3fd77649a2 100644 --- a/drivers/clk/imx/clk-imx6q.c +++ b/drivers/clk/imx/clk-imx6q.c -@@ -920,5 +920,10 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) +@@ -983,5 +983,10 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) } imx_register_uart_clocks(uart_clks); @@ -24,5 +24,5 @@ index 8d518ad5dc13..00b2a7311072 100644 } CLK_OF_DECLARE(imx6q, "fsl,imx6q-ccm", imx6q_clocks_init); -- -2.19.0 +2.20.1 diff --git a/patches/soc/imx/wandboard/0001-ARM-i.MX6-Wandboard-add-wifi-bt-rfkill-driver.patch b/patches/soc/imx/wandboard/0001-ARM-i.MX6-Wandboard-add-wifi-bt-rfkill-driver.patch index d4c265c91..22cbc8728 100644 --- a/patches/soc/imx/wandboard/0001-ARM-i.MX6-Wandboard-add-wifi-bt-rfkill-driver.patch +++ b/patches/soc/imx/wandboard/0001-ARM-i.MX6-Wandboard-add-wifi-bt-rfkill-driver.patch @@ -1,7 +1,7 @@ -From e6fcd88ae89717086a01c199c21d75603e496ab5 Mon Sep 17 00:00:00 2001 +From 5af4ab4540557462402118a38b51729c711f9428 Mon Sep 17 00:00:00 2001 From: Vladimir Ermakov <vooon341@gmail.com> Date: Wed, 10 Jul 2013 03:06:54 +0400 -Subject: [PATCH 2/3] ARM i.MX6 Wandboard add wifi+bt rfkill driver +Subject: [PATCH 1/2] ARM i.MX6 Wandboard add wifi+bt rfkill driver BRCM WiFi module requires initialization for control gpio; Additional provides rfkill funcs. @@ -13,7 +13,7 @@ Signed-off-by: Vladimir Ermakov <vooon341@gmail.com> --- arch/arm/mach-imx/devices/Kconfig | 6 + arch/arm/mach-imx/devices/Makefile | 1 + - arch/arm/mach-imx/devices/wand-rfkill.c | 290 ++++++++++++++++++++++++++++++++ + arch/arm/mach-imx/devices/wand-rfkill.c | 290 ++++++++++++++++++++++++ 3 files changed, 297 insertions(+) create mode 100644 arch/arm/mach-imx/devices/wand-rfkill.c @@ -32,10 +32,10 @@ index 6ffe57267233..bb7bd885f5e2 100644 + default m + select RFKILL diff --git a/arch/arm/mach-imx/devices/Makefile b/arch/arm/mach-imx/devices/Makefile -index aa6cee870795..800ce9bfa812 100644 +index e44758aaa11c..c179a5500929 100644 --- a/arch/arm/mach-imx/devices/Makefile +++ b/arch/arm/mach-imx/devices/Makefile -@@ -25,3 +25,4 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o +@@ -26,3 +26,4 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_EMMA) += platform-mx2-emma.o @@ -337,5 +337,5 @@ index 000000000000..da7ef9f4268a +MODULE_DESCRIPTION("Wandboard rfkill driver"); +MODULE_LICENSE("GPL v2"); -- -2.13.2 +2.20.1 diff --git a/patches/soc/imx/wandboard/0002-ARM-dts-wandboard-add-binding-for-wand-rfkill-driver.patch b/patches/soc/imx/wandboard/0002-ARM-dts-wandboard-add-binding-for-wand-rfkill-driver.patch index 77fe44a3a..9f560e13d 100644 --- a/patches/soc/imx/wandboard/0002-ARM-dts-wandboard-add-binding-for-wand-rfkill-driver.patch +++ b/patches/soc/imx/wandboard/0002-ARM-dts-wandboard-add-binding-for-wand-rfkill-driver.patch @@ -1,7 +1,7 @@ -From 856577315fae37e5ae4f8669088d745f26672b91 Mon Sep 17 00:00:00 2001 +From 46800dd7295d2df7c27ed70dff5d67a52a66d6b7 Mon Sep 17 00:00:00 2001 From: Vladimir Ermakov <vooon341@gmail.com> Date: Fri, 16 Aug 2013 06:52:26 +0400 -Subject: [PATCH 3/3] ARM: dts: wandboard: add binding for wand-rfkill driver +Subject: [PATCH 2/2] ARM: dts: wandboard: add binding for wand-rfkill driver Required gpios pincontrol selected in hog. Add binding only. Disabled non-removable, because after unblocking need to redetect SDIO device. @@ -17,10 +17,10 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/imx6qdl-wandboard-revb1.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard-revb1.dtsi -index 855dc6f9df75..8476b8927f4c 100644 +index e781a45785ed..68daf5570ef2 100644 --- a/arch/arm/boot/dts/imx6qdl-wandboard-revb1.dtsi +++ b/arch/arm/boot/dts/imx6qdl-wandboard-revb1.dtsi -@@ -11,6 +11,24 @@ +@@ -6,6 +6,24 @@ #include "imx6qdl-wandboard.dtsi" @@ -45,7 +45,7 @@ index 855dc6f9df75..8476b8927f4c 100644 &iomuxc { pinctrl-0 = <&pinctrl_hog>; -@@ -36,6 +54,5 @@ +@@ -31,6 +49,5 @@ &usdhc2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usdhc2>; @@ -53,10 +53,10 @@ index 855dc6f9df75..8476b8927f4c 100644 status = "okay"; }; diff --git a/arch/arm/boot/dts/imx6qdl-wandboard-revc1.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard-revc1.dtsi -index 49a0a557e62e..a909ac63286e 100644 +index 3874e74703f0..be5445d3fe99 100644 --- a/arch/arm/boot/dts/imx6qdl-wandboard-revc1.dtsi +++ b/arch/arm/boot/dts/imx6qdl-wandboard-revc1.dtsi -@@ -11,6 +11,24 @@ +@@ -6,6 +6,24 @@ #include "imx6qdl-wandboard.dtsi" @@ -82,10 +82,10 @@ index 49a0a557e62e..a909ac63286e 100644 pinctrl-0 = <&pinctrl_hog>; diff --git a/arch/arm/boot/dts/imx6qdl-wandboard-revd1.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard-revd1.dtsi -index 69d9c8661439..e8a567ee81c4 100644 +index 93909796885a..d595f4e2358d 100644 --- a/arch/arm/boot/dts/imx6qdl-wandboard-revd1.dtsi +++ b/arch/arm/boot/dts/imx6qdl-wandboard-revd1.dtsi -@@ -12,6 +12,26 @@ +@@ -7,6 +7,26 @@ #include "imx6qdl-wandboard.dtsi" / { @@ -113,5 +113,5 @@ index 69d9c8661439..e8a567ee81c4 100644 compatible = "regulator-fixed"; regulator-name = "ETH_PHY"; -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/abbbi/0001-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch b/patches/soc/ti/abbbi/0001-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch index 3b280db96..ced4a9971 100644 --- a/patches/soc/ti/abbbi/0001-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch +++ b/patches/soc/ti/abbbi/0001-ARM-dts-add-Arrow-BeagleBone-Black-Industrial-dts.patch @@ -1,4 +1,4 @@ -From 5241b98d2dea74a1266dd294bb7a853b96848688 Mon Sep 17 00:00:00 2001 +From 6ac30bc189f96064ecb9251a766a093b16dc68c2 Mon Sep 17 00:00:00 2001 From: Matt Porter <mporter@konsulko.com> Date: Tue, 3 Nov 2015 15:37:54 -0500 Subject: [PATCH] ARM: dts: add Arrow BeagleBone Black Industrial dts @@ -11,16 +11,16 @@ tradtional BBB. Signed-off-by: Matt Porter <mporter@konsulko.com> Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- - arch/arm/boot/dts/am335x-abbbi.dts | 163 +++++++++++++++++++++++++++++ - 1 file changed, 163 insertions(+) + arch/arm/boot/dts/am335x-abbbi.dts | 162 +++++++++++++++++++++++++++++ + 1 file changed, 162 insertions(+) create mode 100644 arch/arm/boot/dts/am335x-abbbi.dts diff --git a/arch/arm/boot/dts/am335x-abbbi.dts b/arch/arm/boot/dts/am335x-abbbi.dts new file mode 100644 -index 000000000000..6d5339c336fc +index 000000000000..82bf99e47616 --- /dev/null +++ b/arch/arm/boot/dts/am335x-abbbi.dts -@@ -0,0 +1,163 @@ +@@ -0,0 +1,162 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright 2015 Konsulko Group @@ -34,7 +34,6 @@ index 000000000000..6d5339c336fc +#include "am33xx.dtsi" +#include "am335x-bone-common.dtsi" + -+ +/ { + model = "Arrow BeagleBone Black Industrial"; + compatible = "arrow,am335x-abbbi", "ti,am335x-bone", "ti,am33xx"; @@ -185,5 +184,5 @@ index 000000000000..6d5339c336fc + }; +}; -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/am335x/0001-sync-with-ti-4.4.patch b/patches/soc/ti/am335x/0001-sync-with-ti-4.4.patch index aff206186..a3b4fe0a3 100644 --- a/patches/soc/ti/am335x/0001-sync-with-ti-4.4.patch +++ b/patches/soc/ti/am335x/0001-sync-with-ti-4.4.patch @@ -1,7 +1,7 @@ -From d9e7680f97703246d2b131184fb0f923cc96829f Mon Sep 17 00:00:00 2001 +From 2265d02e53c8c9a2de4f10341e53de0568ab2557 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Tue, 1 Jan 2019 16:45:52 -0600 -Subject: [PATCH 1/8] sync: with ti-4.4 +Subject: [PATCH 1/6] sync: with ti-4.4 Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- diff --git a/patches/soc/ti/am335x/0002-ARM-dts-am335x-bone-common-update-leds-to-match-3.8..patch b/patches/soc/ti/am335x/0002-ARM-dts-am335x-bone-common-update-leds-to-match-3.8..patch index 8b44d8a9d..0c5848b50 100644 --- a/patches/soc/ti/am335x/0002-ARM-dts-am335x-bone-common-update-leds-to-match-3.8..patch +++ b/patches/soc/ti/am335x/0002-ARM-dts-am335x-bone-common-update-leds-to-match-3.8..patch @@ -1,7 +1,7 @@ -From b633cebe7b205734b1829ec54f8312c12d1de50b Mon Sep 17 00:00:00 2001 +From 3ca83138401c67a1bff6470aa8293c728a864aa0 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Wed, 27 Aug 2014 13:56:37 -0500 -Subject: [PATCH 2/8] ARM: dts: am335x-bone-common: update leds to match 3.8.13 +Subject: [PATCH 2/6] ARM: dts: am335x-bone-common: update leds to match 3.8.13 kernel https://groups.google.com/d/msg/beagleboard/634Xm1m3XA8/B028x1FzAyAJ @@ -13,7 +13,7 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi -index f10bf5059e4a..e90933cc6e74 100644 +index 3b71862b0eb8..102a70c1dd4b 100644 --- a/arch/arm/boot/dts/am335x-bone-common.dtsi +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi @@ -29,14 +29,14 @@ @@ -34,5 +34,5 @@ index f10bf5059e4a..e90933cc6e74 100644 linux,default-trigger = "mmc0"; default-state = "off"; -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/am335x/0003-ARM-dts-am335x-bone-common-add-collision-and-carrier.patch b/patches/soc/ti/am335x/0003-ARM-dts-am335x-bone-common-add-collision-and-carrier.patch deleted file mode 100644 index fc686fd0b..000000000 --- a/patches/soc/ti/am335x/0003-ARM-dts-am335x-bone-common-add-collision-and-carrier.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 3aeafac8ed50807c4075a6913c982afcfe47f364 Mon Sep 17 00:00:00 2001 -From: Schuyler Patton <spatton@ti.com> -Date: Mon, 5 Jan 2015 15:44:14 -0600 -Subject: [PATCH 3/8] ARM: dts: am335x-bone-common: add collision and carrier - sense pinmux - -Added pin mux definitions for collision and carrier sense errors coming -from the ethernet phy. Without these two signals the MAC ends up ignoring -the errors detected by the PHY which end up causing a lower throughput -problem when the phy is in half duplex mode such as connected through a hub. - -Fixes: 2ba3549 (ARM: dts: am335x-bone*: add DT for BeagleBone Black) -Cc: Koen Kooi <koen@dominion.thruhere.net> -Cc: Tom Rini <trini@ti.com> -Cc: Kevin Hilman <khilman@linaro.org> -Cc: <stable@vger.kernel.org> # v3.13+ -Signed-off-by: Schuyler Patton <spatton@ti.com> -Signed-off-by: Felipe Balbi <balbi@ti.com> ---- - arch/arm/boot/dts/am335x-bone-common.dtsi | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi -index e90933cc6e74..073dc44061f0 100644 ---- a/arch/arm/boot/dts/am335x-bone-common.dtsi -+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi -@@ -108,6 +108,8 @@ - cpsw_default: cpsw_default { - pinctrl-single,pins = < - /* Slave 1 */ -+ 0x108 (PIN_INPUT | MUX_MODE0) /* mii1_col.mii1_col */ -+ 0x10c (PIN_INPUT | MUX_MODE0) /* mii1_crs.mii1_crs */ - AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.mii1_rxerr */ - AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.mii1_txen */ - AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */ -@@ -127,6 +129,8 @@ - cpsw_sleep: cpsw_sleep { - pinctrl-single,pins = < - /* Slave 1 reset value */ -+ 0x108 (PIN_INPUT_PULLDOWN | MUX_MODE7) -+ 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7) - AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7) --- -2.19.2 - diff --git a/patches/soc/ti/am335x/0004-ARM-dts-am335x-bone-common-disable-running-JTAG.patch b/patches/soc/ti/am335x/0003-ARM-dts-am335x-bone-common-disable-running-JTAG.patch similarity index 96% rename from patches/soc/ti/am335x/0004-ARM-dts-am335x-bone-common-disable-running-JTAG.patch rename to patches/soc/ti/am335x/0003-ARM-dts-am335x-bone-common-disable-running-JTAG.patch index 2d1dfff3c..6c7f4e537 100644 --- a/patches/soc/ti/am335x/0004-ARM-dts-am335x-bone-common-disable-running-JTAG.patch +++ b/patches/soc/ti/am335x/0003-ARM-dts-am335x-bone-common-disable-running-JTAG.patch @@ -1,7 +1,7 @@ -From 3f26a7b64ad6a83d11ad5ebe71f90a29daa479ba Mon Sep 17 00:00:00 2001 +From 067243b870e060708703d43c62d3245caa9b7313 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Tue, 27 Nov 2018 14:35:14 -0600 -Subject: [PATCH 4/8] ARM: dts: am335x-bone-common: disable running JTAG +Subject: [PATCH 3/6] ARM: dts: am335x-bone-common: disable running JTAG Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -17,7 +17,7 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> create mode 100644 arch/arm/boot/dts/am335x-bone-jtag.dtsi diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi -index 073dc44061f0..31f145c29ea1 100644 +index 102a70c1dd4b..27489c9b2dc1 100644 --- a/arch/arm/boot/dts/am335x-bone-common.dtsi +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi @@ -66,9 +66,6 @@ @@ -130,7 +130,7 @@ index a8b4d969ce2a..575a5a93a89e 100644 / { model = "TI AM335x BeagleBone Green"; diff --git a/arch/arm/boot/dts/am335x-osd3358-sm-red.dts b/arch/arm/boot/dts/am335x-osd3358-sm-red.dts -index 85cd1d0a73ca..8eb4c065c7d8 100644 +index 95d54cf3849e..f9bc5255425d 100644 --- a/arch/arm/boot/dts/am335x-osd3358-sm-red.dts +++ b/arch/arm/boot/dts/am335x-osd3358-sm-red.dts @@ -13,6 +13,7 @@ @@ -165,5 +165,5 @@ index 85cd1d0a73ca..8eb4c065c7d8 100644 pinctrl-single,pins = < /* Slave 1 */ -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/am335x/0005-ARM-dts-am335x-bone-common-add-no-capemgr.dtsi.patch b/patches/soc/ti/am335x/0004-ARM-dts-am335x-bone-common-add-no-capemgr.dtsi.patch similarity index 95% rename from patches/soc/ti/am335x/0005-ARM-dts-am335x-bone-common-add-no-capemgr.dtsi.patch rename to patches/soc/ti/am335x/0004-ARM-dts-am335x-bone-common-add-no-capemgr.dtsi.patch index 2d0202463..c411630b6 100644 --- a/patches/soc/ti/am335x/0005-ARM-dts-am335x-bone-common-add-no-capemgr.dtsi.patch +++ b/patches/soc/ti/am335x/0004-ARM-dts-am335x-bone-common-add-no-capemgr.dtsi.patch @@ -1,20 +1,20 @@ -From f73a3c44b19df6d03c8fe665a05812c2a02564c1 Mon Sep 17 00:00:00 2001 +From 853a6cbf8028ebc91cdf357c09368e1623b1badf Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> -Date: Tue, 1 Jan 2019 17:04:50 -0600 -Subject: [PATCH 5/8] ARM: dts: am335x-bone-common: add no-capemgr.dtsi +Date: Fri, 5 Apr 2019 10:10:48 -0500 +Subject: [PATCH 4/6] ARM: dts: am335x-bone-common: add no-capemgr.dtsi Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- - .../dts/am335x-bone-common-no-capemgr.dtsi | 383 ++++++++++++++++++ - 1 file changed, 383 insertions(+) + .../dts/am335x-bone-common-no-capemgr.dtsi | 376 ++++++++++++++++++ + 1 file changed, 376 insertions(+) create mode 100644 arch/arm/boot/dts/am335x-bone-common-no-capemgr.dtsi diff --git a/arch/arm/boot/dts/am335x-bone-common-no-capemgr.dtsi b/arch/arm/boot/dts/am335x-bone-common-no-capemgr.dtsi new file mode 100644 -index 000000000000..e226b6e845d6 +index 000000000000..94ae0f9fa6dd --- /dev/null +++ b/arch/arm/boot/dts/am335x-bone-common-no-capemgr.dtsi -@@ -0,0 +1,383 @@ +@@ -0,0 +1,376 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * @@ -116,8 +116,6 @@ index 000000000000..e226b6e845d6 + cpsw_default: cpsw_default { + pinctrl-single,pins = < + /* Slave 1 */ -+ 0x108 (PIN_INPUT | MUX_MODE0) /* mii1_col.mii1_col */ -+ 0x10c (PIN_INPUT | MUX_MODE0) /* mii1_crs.mii1_crs */ + AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxerr.mii1_rxerr */ + AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mii1_txen.mii1_txen */ + AM33XX_IOPAD(0x918, PIN_INPUT_PULLUP | MUX_MODE0) /* mii1_rxdv.mii1_rxdv */ @@ -137,8 +135,6 @@ index 000000000000..e226b6e845d6 + cpsw_sleep: cpsw_sleep { + pinctrl-single,pins = < + /* Slave 1 reset value */ -+ 0x108 (PIN_INPUT_PULLDOWN | MUX_MODE7) -+ 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x910, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x914, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM33XX_IOPAD(0x918, PIN_INPUT_PULLDOWN | MUX_MODE7) @@ -266,6 +262,7 @@ index 000000000000..e226b6e845d6 + pinctrl-0 = <&i2c2_pins>; + + status = "okay"; ++ clock-frequency = <100000>; +}; + + @@ -394,10 +391,6 @@ index 000000000000..e226b6e845d6 + clock-names = "ext-clk", "int-clk"; + system-power-controller; +}; -+ -+//&pruss { -+// status = "okay"; -+//}; -- 2.20.1 diff --git a/patches/soc/ti/am335x/0006-ARM-dts-am335x-bone-common-add-am335x-bbw-bbb-base.h.patch b/patches/soc/ti/am335x/0005-ARM-dts-am335x-bone-common-add-am335x-bbw-bbb-base.h.patch similarity index 95% rename from patches/soc/ti/am335x/0006-ARM-dts-am335x-bone-common-add-am335x-bbw-bbb-base.h.patch rename to patches/soc/ti/am335x/0005-ARM-dts-am335x-bone-common-add-am335x-bbw-bbb-base.h.patch index a69eb2ffb..cda9250d5 100644 --- a/patches/soc/ti/am335x/0006-ARM-dts-am335x-bone-common-add-am335x-bbw-bbb-base.h.patch +++ b/patches/soc/ti/am335x/0005-ARM-dts-am335x-bone-common-add-am335x-bbw-bbb-base.h.patch @@ -1,7 +1,7 @@ -From 51f56552d649f5f675f4e27382dd6f4bbbdda537 Mon Sep 17 00:00:00 2001 +From d2864773f21abe4603b1b7a7e0d146e63dba887e Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Wed, 1 Mar 2017 12:47:12 -0600 -Subject: [PATCH 6/8] ARM: dts: am335x-bone-common: add am335x-bbw-bbb-base.h +Subject: [PATCH 5/6] ARM: dts: am335x-bone-common: add am335x-bbw-bbb-base.h Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -119,5 +119,5 @@ index 000000000000..35f6d57ef492 + +#endif -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/am335x/0007-ARM-dts-am335x-boneblack-common-remove-CEC-noise.patch b/patches/soc/ti/am335x/0006-ARM-dts-am335x-boneblack-common-remove-CEC-noise.patch similarity index 94% rename from patches/soc/ti/am335x/0007-ARM-dts-am335x-boneblack-common-remove-CEC-noise.patch rename to patches/soc/ti/am335x/0006-ARM-dts-am335x-boneblack-common-remove-CEC-noise.patch index a95f18613..118f5c7b0 100644 --- a/patches/soc/ti/am335x/0007-ARM-dts-am335x-boneblack-common-remove-CEC-noise.patch +++ b/patches/soc/ti/am335x/0006-ARM-dts-am335x-boneblack-common-remove-CEC-noise.patch @@ -1,7 +1,7 @@ -From a536e5d88da14b8ad6d69cdf89da1f8a8af82289 Mon Sep 17 00:00:00 2001 +From 78b90be979d6986933fe1daa008a8dad49f1c693 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Tue, 27 Nov 2018 14:43:39 -0600 -Subject: [PATCH 7/8] ARM: dts: am335x-boneblack-common: remove CEC noise +Subject: [PATCH 6/6] ARM: dts: am335x-boneblack-common: remove CEC noise Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -46,7 +46,7 @@ index e543c2bee8c2..4413a0afacd6 100644 /* Convert 24bit BGR to RGB, e.g. cross red and blue wiring */ /* video-ports = <0x234501>; */ diff --git a/arch/arm/boot/dts/am335x-osd3358-sm-red.dts b/arch/arm/boot/dts/am335x-osd3358-sm-red.dts -index 8eb4c065c7d8..b68b15fddb5f 100644 +index f9bc5255425d..7dc90e986dc2 100644 --- a/arch/arm/boot/dts/am335x-osd3358-sm-red.dts +++ b/arch/arm/boot/dts/am335x-osd3358-sm-red.dts @@ -41,7 +41,6 @@ @@ -82,5 +82,5 @@ index 8eb4c065c7d8..b68b15fddb5f 100644 /* Convert 24bit BGR to RGB, e.g. cross red and blue wiring */ /* video-ports = <0x234501>; */ -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/am335x/0008-am335x-osd335x-common.dtsi-add-pruss_soc_bus.patch b/patches/soc/ti/am335x/0008-am335x-osd335x-common.dtsi-add-pruss_soc_bus.patch deleted file mode 100644 index ba14b6a1c..000000000 --- a/patches/soc/ti/am335x/0008-am335x-osd335x-common.dtsi-add-pruss_soc_bus.patch +++ /dev/null @@ -1,25 +0,0 @@ -From cf39bfcbe83870c9c5befd41ad43479a60fc1184 Mon Sep 17 00:00:00 2001 -From: Robert Nelson <robertcnelson@gmail.com> -Date: Tue, 27 Nov 2018 15:08:24 -0600 -Subject: [PATCH 8/8] am335x-osd335x-common.dtsi: add pruss_soc_bus - -Signed-off-by: Robert Nelson <robertcnelson@gmail.com> ---- - arch/arm/boot/dts/am335x-osd335x-common.dtsi | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/arch/arm/boot/dts/am335x-osd335x-common.dtsi b/arch/arm/boot/dts/am335x-osd335x-common.dtsi -index f8ff473f94f0..5a5a1b95ec97 100644 ---- a/arch/arm/boot/dts/am335x-osd335x-common.dtsi -+++ b/arch/arm/boot/dts/am335x-osd335x-common.dtsi -@@ -122,3 +122,7 @@ - &sham { - status = "okay"; - }; -+ -+//&pruss { -+// status = "okay"; -+//}; --- -2.20.1 - diff --git a/patches/soc/ti/beaglebone_capes/0001-ARM-dts-am335x-boneblack-enable-wl1835mod-cape-suppo.patch b/patches/soc/ti/beaglebone_capes/0001-ARM-dts-am335x-boneblack-enable-wl1835mod-cape-suppo.patch deleted file mode 100644 index 923728442..000000000 --- a/patches/soc/ti/beaglebone_capes/0001-ARM-dts-am335x-boneblack-enable-wl1835mod-cape-suppo.patch +++ /dev/null @@ -1,211 +0,0 @@ -From 8478b3e6ddb4e4b6d46543b26f93ad027072ce03 Mon Sep 17 00:00:00 2001 -From: Eyal Reizer <eyalr@ti.com> -Date: Tue, 5 May 2015 11:33:42 +0300 -Subject: [PATCH 2/4] ARM: dts: am335x-boneblack: enable wl1835mod cape support - -Add support for the WL1835MOD cape. -This cape conflicts with the eMMC and HDMI on board the BeagleBone Black. - -This change requires that the board be booted from the SD card slot by -holding the user/boot button down at power on and reset. - -Signed-off-by: Eyal Reizer <eyalr@ti.com> ---- - .../boot/dts/am335x-boneblack-wl1835mod-cape.dtsi | 128 +++++++++++++++++++++ - arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts | 49 ++++++++ - 2 files changed, 177 insertions(+) - create mode 100644 arch/arm/boot/dts/am335x-boneblack-wl1835mod-cape.dtsi - create mode 100644 arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts - -diff --git a/arch/arm/boot/dts/am335x-boneblack-wl1835mod-cape.dtsi b/arch/arm/boot/dts/am335x-boneblack-wl1835mod-cape.dtsi -new file mode 100644 -index 000000000000..94caa2290301 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-boneblack-wl1835mod-cape.dtsi -@@ -0,0 +1,128 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+#include <dt-bindings/interrupt-controller/irq.h> -+ -+/ { -+ wlan_en_reg: fixedregulator@2 { -+ compatible = "regulator-fixed"; -+ regulator-name = "wlan-en-regulator"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ /* WL_EN */ -+ gpio = <&gpio0 26 0>; -+ enable-active-high; -+ }; -+ -+ kim { -+ compatible = "kim"; -+ nshutdown_gpio = <44>; /* Bank1, pin12 */ -+ dev_name = "/dev/ttyO4"; -+ flow_cntrl = <1>; -+ baud_rate = <3000000>; -+ }; -+ -+ btwilink { -+ compatible = "btwilink"; -+ }; -+}; -+ -+&am33xx_pinmux { -+ bt_pins: pinmux_bt_pins { -+ pinctrl-single,pins = < -+ 0x30 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_ad12.gpio1_12 */ -+ >; -+ }; -+ -+ mmc2_pins: pinmux_mmc2_pins { -+ pinctrl-single,pins = < -+ 0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk */ -+ 0x84 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn2.mmc1_cmd */ -+ 0x00 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0 */ -+ 0x04 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1 */ -+ 0x08 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2 */ -+ 0x0c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3 */ -+ >; -+ }; -+ -+ mmc2_pins_sleep: pinmux_mmc2_pins_sleep { -+ pinctrl-single,pins = < -+ 0x80 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn1.mmc1_clk */ -+ 0x84 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn2.mmc1_cmd */ -+ 0x00 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad0.mmc1_dat0 */ -+ 0x04 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad1.mmc1_dat1 */ -+ 0x08 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad2.mmc1_dat2 */ -+ 0x0c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad3.mmc1_dat3 */ -+ >; -+ }; -+ -+ /* wl18xx card enable/irq GPIOs. */ -+ wlan_pins: pinmux_wlan_pins { -+ pinctrl-single,pins = < -+ 0x28 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_ad10.gpio0_26 WL_EN*/ -+ 0x2C (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_ad11.gpio0_27 WL_IRQ*/ -+ 0x7C (PIN_OUTPUT_PULLUP | MUX_MODE0) /* gpmc_csn0.gpio1_29 BF_EN*/ -+ >; -+ }; -+ -+ /* wl18xx card enable/irq GPIOs. */ -+ wlan_pins_sleep: pinmux_wlan_pins_sleep { -+ pinctrl-single,pins = < -+ 0x28 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_ad10.gpio0_26 WL_EN*/ -+ 0x2C (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_ad11.gpio0_27 WL_IRQ*/ -+ 0x7C (PIN_OUTPUT_PULLUP | MUX_MODE0) /* gpmc_csn0.gpio1_29 BF_EN*/ -+ >; -+ }; -+ -+ uart4_pins_default: pinmux_uart4_pins_default { -+ pinctrl-single,pins = < -+ 0xD0 (PIN_INPUT | MUX_MODE6) /* lcd_data12.uart4_cts */ -+ 0xD4 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* lcd_data13.uart4_rts */ -+ 0x70 (PIN_INPUT_PULLUP | MUX_MODE6) /* gpmc_wait0.uart4_rxd */ -+ 0x74 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* gpmc_wpn.uart4_txd */ -+ >; -+ }; -+ -+ uart4_pins_sleep: pinmux_uart4_pins_sleep { -+ pinctrl-single,pins = < -+ 0xD0 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_data12.uart4_cts */ -+ 0xD4 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_data13.uart4_rts */ -+ 0x70 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_wait0.uart4_rxd */ -+ 0x74 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_wpn.uart4_txd */ -+ >; -+ }; -+}; -+ -+&mmc2 { -+ status = "okay"; -+ vmmc-supply = <&wlan_en_reg>; -+ bus-width = <4>; -+ pinctrl-names = "default", "sleep"; -+ pinctrl-0 = <&mmc2_pins &wlan_pins>; -+ pinctrl-1 = <&mmc2_pins_sleep &wlan_pins_sleep>; -+ ti,non-removable; -+ ti,needs-special-hs-handling; -+ cap-power-off-card; -+ keep-power-in-suspend; -+ -+ #address-cells = <1>; -+ #size-cells = <0>; -+ wlcore: wlcore@0 { -+ compatible = "ti,wl1835"; -+ reg = <2>; -+ interrupt-parent = <&gpio0>; -+ interrupts = <27 IRQ_TYPE_LEVEL_HIGH>; -+ }; -+}; -+ -+&uart4 { -+ pinctrl-names = "default", "sleep"; -+ pinctrl-0 = <&uart4_pins_default>; -+ pinctrl-1 = <&uart4_pins_sleep>; -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts b/arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts -new file mode 100644 -index 000000000000..be7cab35a94d ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-boneblack-wl1835mod.dts -@@ -0,0 +1,49 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+/dts-v1/; -+ -+#include "am33xx.dtsi" -+#include "am335x-bone-common-no-capemgr.dtsi" -+ -+/ { -+ model = "TI AM335x BeagleBone Black"; -+ compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; -+}; -+ -+&cpu0_opp_table { -+ /* -+ * All PG 2.0 silicon may not support 1GHz but some of the early -+ * BeagleBone Blacks have PG 2.0 silicon which is guaranteed -+ * to support 1GHz OPP so enable it for PG 2.0 on this board. -+ */ -+ oppnitro@1000000000 { -+ opp-supported-hw = <0x06 0x0100>; -+ }; -+}; -+ -+&ldo3_reg { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-always-on; -+}; -+ -+&mmc1 { -+ vmmc-supply = <&vmmcsd_fixed>; -+}; -+ -+/* EMMC in reset */ -+&gpio1 { -+ emmc_rst { -+ gpio-hog; -+ gpios = <20 0>; -+ output-high; -+ line-name = "EMMC ResetN"; -+ }; -+}; -+ -+#include "am335x-boneblack-wl1835mod-cape.dtsi" --- -2.11.0 - diff --git a/patches/soc/ti/beaglebone_capes/0002-add-am335x-boneblack-bbbmini.dts.patch b/patches/soc/ti/beaglebone_capes/0002-add-am335x-boneblack-bbbmini.dts.patch deleted file mode 100644 index a132bc955..000000000 --- a/patches/soc/ti/beaglebone_capes/0002-add-am335x-boneblack-bbbmini.dts.patch +++ /dev/null @@ -1,226 +0,0 @@ -From 518b7fa58c1bfbc8ffb1b6f6ec278c5a2247cdff Mon Sep 17 00:00:00 2001 -From: Robert Nelson <robertcnelson@gmail.com> -Date: Thu, 11 May 2017 10:33:18 -0500 -Subject: [PATCH 3/4] add: am335x-boneblack-bbbmini.dts - -Signed-off-by: Robert Nelson <robertcnelson@gmail.com> ---- - arch/arm/boot/dts/am335x-boneblack-bbbmini.dts | 206 +++++++++++++++++++++++++ - 1 file changed, 206 insertions(+) - create mode 100644 arch/arm/boot/dts/am335x-boneblack-bbbmini.dts - -diff --git a/arch/arm/boot/dts/am335x-boneblack-bbbmini.dts b/arch/arm/boot/dts/am335x-boneblack-bbbmini.dts -new file mode 100644 -index 000000000000..68c5a6bb9b1d ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-boneblack-bbbmini.dts -@@ -0,0 +1,206 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * Modified by Mirko Denecke <mirkix@gmail.com> -+ * -+ * 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. -+ */ -+/dts-v1/; -+ -+#include "am33xx.dtsi" -+#include "am335x-bone-common.dtsi" -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include <dt-bindings/pinctrl/am33xx.h> -+ -+/ { -+ model = "TI AM335x BeagleBone Black"; -+ compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; -+}; -+ -+&ldo3_reg { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-always-on; -+}; -+ -+&mmc1 { -+ vmmc-supply = <&vmmcsd_fixed>; -+}; -+ -+&mmc2 { -+ vmmc-supply = <&vmmcsd_fixed>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emmc_pins>; -+ bus-width = <8>; -+ status = "okay"; -+}; -+ -+&cpu0_opp_table { -+ /* -+ * All PG 2.0 silicon may not support 1GHz but some of the early -+ * BeagleBone Blacks have PG 2.0 silicon which is guaranteed -+ * to support 1GHz OPP so enable it for PG 2.0 on this board. -+ */ -+ oppnitro@1000000000 { -+ opp-supported-hw = <0x06 0x0100>; -+ }; -+}; -+ -+&am33xx_pinmux { -+ dcan1_pins: pinmux_dcan1_pins { -+ pinctrl-single,pins = < -+ /* P9_26: uart1_rxd.d_can1_tx */ -+ BONE_P9_26 (PIN_OUTPUT_PULLUP | MUX_MODE2) -+ /* P9_24: uart1_txd.d_can1_rx */ -+ BONE_P9_24 (PIN_INPUT_PULLUP | MUX_MODE2) -+ >; -+ }; -+ -+ pru_pins: pinmux_pru_pins { -+ pinctrl-single,pins = < -+ 0x03c 0x35 /* ecap0_in_pwm0_out.pr1_ecap0_ecap_capin, MODE5 | INPUT_PULLUP | PRU, PPM-sum, SBUS, DSM */ -+ -+ 0x0e8 0x25 /* lcd_pclk.pr1_pru1_pru_r30_10, MODE5 | OUTPUT | PRU, CH_1 */ -+ 0x0e0 0x25 /* lcd_vsync.pr1_pru1_pru_r30_8, MODE5 | OUTPUT | PRU, CH_2 */ -+ 0x0ec 0x25 /* lcd_ac_bias_en.pr1_pru1_pru_r30_11, MODE5 | OUTPUT | PRU, CH_3 */ -+ 0x0e4 0x25 /* lcd_hsync.pr1_pru1_pru_r30_9, MODE5 | OUTPUT | PRU, CH_4 */ -+ 0x0bc 0x25 /* lcd_data7.pr1_pru1_pru_r30_7, MODE5 | OUTPUT | PRU, CH_5 */ -+ 0x0b8 0x25 /* lcd_data6.pr1_pru1_pru_r30_6, MODE5 | OUTPUT | PRU, CH_6 */ -+ 0x0b4 0x25 /* lcd_data5.pr1_pru1_pru_r30_5, MODE5 | OUTPUT | PRU, CH_7 */ -+ 0x0b0 0x25 /* lcd_data4.pr1_pru1_pru_r30_4, MODE5 | OUTPUT | PRU, CH_8 */ -+ 0x0ac 0x25 /* lcd_data3.pr1_pru1_pru_r30_3, MODE5 | OUTPUT | PRU, CH_9 */ -+ 0x0a8 0x25 /* lcd_data2.pr1_pru1_pru_r30_2, MODE5 | OUTPUT | PRU, CH_10 */ -+ 0x0a4 0x25 /* lcd_data1.pr1_pru1_pru_r30_1, MODE5 | OUTPUT | PRU, CH_11 */ -+ 0x0a0 0x25 /* lcd_data0.pr1_pru1_pru_r30_0, MODE5 | OUTPUT | PRU, CH_12 */ -+ -+ BONE_P8_12 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* HC-SR04 TRIG */ -+ BONE_P8_16 (PIN_INPUT_PULLDOWN | MUX_MODE6) /* HC-SR04 ECHO */ -+ -+ BONE_P9_25 (PIN_INPUT_PULLDOWN | MUX_MODE6) /* MPU9250 INT */ -+ >; -+ }; -+ -+ spi0_pins: pinmux_spi0_pins { -+ pinctrl-single,pins = < -+ /* P9_22: spi0_sclk.spi0_sclk */ -+ BONE_P9_22 (PIN_INPUT_PULLUP | MUX_MODE0) -+ /* P9_21: spi0_d0.spi0_d0 */ -+ BONE_P9_21 (PIN_INPUT_PULLUP | MUX_MODE0) -+ /* P9_18: spi0_d1.spi0_d1 */ -+ BONE_P9_18 (PIN_OUTPUT_PULLUP | MUX_MODE0) -+ /* P9_17: spi0_cs0.spi0_cs0 */ -+ BONE_P9_17 (PIN_OUTPUT_PULLUP | MUX_MODE0) -+ >; -+ }; -+ -+ spi1_pins: pinmux_spi1_pins { -+ pinctrl-single,pins = < -+ /* P9_31: mcasp0_aclkx.spi1_sclk */ -+ BONE_P9_31 (PIN_INPUT_PULLUP | MUX_MODE3) -+ -+ /* P9_29: mcasp0_fsx.spi1_d0 */ -+ BONE_P9_29 (PIN_INPUT_PULLUP | MUX_MODE3) -+ -+ /* P9_30: mcasp0_axr0.spi1_d1 */ -+ BONE_P9_30 (PIN_OUTPUT_PULLUP | MUX_MODE3) -+ -+ /* P9_28: mcasp0_ahclkr.spi1_cs0 */ -+ BONE_P9_28 (PIN_OUTPUT_PULLUP | MUX_MODE3) -+ -+ /* P9_19: uart1_rtsn.spi1_cs1 */ -+/* BONE_P9_19 (PIN_OUTPUT_PULLUP | MUX_MODE4)*/ -+ -+ /* P9_42: ecap0_in_pwm0_out.spi1_cs1 */ -+ BONE_P9_42A (PIN_OUTPUT_PULLUP | MUX_MODE2) -+ >; -+ }; -+ -+ uart4_pins: pinmux_uart4_pins { -+ pinctrl-single,pins = < -+ /* P9_11: gpmc_wait0.uart4_rxd_mux2 */ -+ BONE_P9_11 (PIN_INPUT_PULLUP | MUX_MODE6) -+ /* P9_13: gpmc_wpn.uart4_txd_mux2 */ -+ BONE_P9_13 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) -+ >; -+ }; -+ -+ uart5_pins: pinmux_uart5_pins { -+ pinctrl-single,pins = < -+ /* P8_38: lcd_data9.uart5_rxd */ -+ BONE_P8_38 (PIN_INPUT_PULLUP | MUX_MODE4) -+ /* P8_37: lcd_data8.uart5_txd */ -+ BONE_P8_37 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) -+ >; -+ }; -+}; -+ -+&dcan1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&dcan1_pins>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ clock-frequency = <400000>; -+}; -+ -+&spi0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi0_pins>; -+ status = "okay"; -+ -+ spi0@0 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ spi-max-frequency = <24000000>; -+ reg = <0>; -+ compatible = "spidev"; -+ }; -+}; -+ -+&spi1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi1_pins>; -+ status = "okay"; -+ -+ spi1@0 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <0>; -+ spi-max-frequency = <24000000>; -+ compatible = "spidev"; -+ }; -+ -+ spi1@1 { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ reg = <1>; -+ spi-max-frequency = <24000000>; -+ compatible = "spidev"; -+ }; -+}; -+ -+&tscadc { -+ adc { -+ ti,adc-channels = <0 1>; -+ }; -+}; -+ -+//&pruss { -+// pinctrl-names = "default"; -+// pinctrl-0 = <&pru_pins>; -+// status = "okay"; -+//}; -+ -+&uart4 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart4_pins>; -+ status = "okay"; -+}; -+ -+&uart5 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart5_pins>; -+ status = "okay"; -+}; --- -2.11.0 - diff --git a/patches/soc/ti/beaglebone_capes/0003-add-lcd-am335x-boneblack-bbb-exp-c.dtb-am335x-bonebl.patch b/patches/soc/ti/beaglebone_capes/0003-add-lcd-am335x-boneblack-bbb-exp-c.dtb-am335x-bonebl.patch deleted file mode 100644 index d2ffca889..000000000 --- a/patches/soc/ti/beaglebone_capes/0003-add-lcd-am335x-boneblack-bbb-exp-c.dtb-am335x-bonebl.patch +++ /dev/null @@ -1,1105 +0,0 @@ -From 1fce8d1bdc60a0f9bd08354363a6f5b81fc586be Mon Sep 17 00:00:00 2001 -From: Robert Nelson <robertcnelson@gmail.com> -Date: Thu, 11 May 2017 10:35:39 -0500 -Subject: [PATCH 4/4] add: lcd: am335x-boneblack-bbb-exp-c.dtb - am335x-boneblack-bbb-exp-r.dtb - -Signed-off-by: Robert Nelson <robertcnelson@gmail.com> ---- - arch/arm/boot/dts/am335x-bone-pinmux-can0.dtsi | 45 ++++ - .../am335x-bone-pinmux-panel-1024x600-24bit.dtsi | 151 ++++++++++++++ - arch/arm/boot/dts/am335x-bone-pinmux-ttyS1.dtsi | 48 +++++ - arch/arm/boot/dts/am335x-bone-pinmux-ttyS2.dtsi | 48 +++++ - arch/arm/boot/dts/am335x-bone-pinmux-ttyS4.dtsi | 48 +++++ - arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts | 47 +++++ - arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts | 47 +++++ - arch/arm/boot/dts/am335x-cape-bbb-exp-c.dtsi | 227 +++++++++++++++++++++ - arch/arm/boot/dts/am335x-cape-bbb-exp-r.dtsi | 217 ++++++++++++++++++++ - arch/arm/boot/dts/am335x-peripheral-can0.dtsi | 13 ++ - .../am335x-peripheral-panel-1024x600-24bit.dtsi | 50 +++++ - arch/arm/boot/dts/am335x-peripheral-ttyS1.dtsi | 13 ++ - arch/arm/boot/dts/am335x-peripheral-ttyS2.dtsi | 13 ++ - arch/arm/boot/dts/am335x-peripheral-ttyS4.dtsi | 13 ++ - 14 files changed, 980 insertions(+) - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-can0.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-panel-1024x600-24bit.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-ttyS1.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-ttyS2.dtsi - create mode 100644 arch/arm/boot/dts/am335x-bone-pinmux-ttyS4.dtsi - create mode 100644 arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts - create mode 100644 arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts - create mode 100644 arch/arm/boot/dts/am335x-cape-bbb-exp-c.dtsi - create mode 100644 arch/arm/boot/dts/am335x-cape-bbb-exp-r.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-can0.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-panel-1024x600-24bit.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-ttyS1.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-ttyS2.dtsi - create mode 100644 arch/arm/boot/dts/am335x-peripheral-ttyS4.dtsi - -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-can0.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-can0.dtsi -new file mode 100644 -index 000000000000..09612160b10d ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-can0.dtsi -@@ -0,0 +1,45 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-can0.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P9_19_pinmux { -+ * mode = "can"; -+ * }; -+ * P9_20_pinmux { -+ * mode = "can"; -+ * }; -+ *}; -+ * -+ *&dcan0 { -+ * pinctrl-0 = <>; -+ *}; -+ * -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ dcan0_pins: pinmux_dcan0_pins { -+ pinctrl-single,pins = < -+ /* P9_20: uart1_ctsn.d_can0_tx */ -+ BONE_P9_20 (PIN_OUTPUT_PULLUP | MUX_MODE2) -+ /* P9_19: uart1_rtsn.d_can0_rx */ -+ BONE_P9_19 (PIN_INPUT_PULLUP | MUX_MODE2) -+ >; -+ }; -+}; -+ -+&dcan0 { -+ pinctrl-0 = <&dcan0_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-panel-1024x600-24bit.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-panel-1024x600-24bit.dtsi -new file mode 100644 -index 000000000000..65e5fbb0cfcc ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-panel-1024x600-24bit.dtsi -@@ -0,0 +1,151 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-panel-1024x600-24bit.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P8_27_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_28_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_29_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_30_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_31_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_32_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_33_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_34_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_35_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_36_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_37_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_38_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_39_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_40_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_41_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_42_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_43_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_44_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_45_pinmux { -+ * state = "disabled"; -+ * }; -+ * P8_46_pinmux { -+ * state = "disabled"; -+ * }; -+ *}; -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ lcd_24bit_pins: pinmux_lcd_24bit_pins { -+ pinctrl-single,pins = < -+ -+ /* P8_45: lcd_data0.lcd_data0 */ -+ BONE_P8_45 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_46: lcd_data1.lcd_data1 */ -+ BONE_P8_46 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_43: lcd_data2.lcd_data2 */ -+ BONE_P8_43 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_44: lcd_data3.lcd_data3 */ -+ BONE_P8_44 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_41: lcd_data4.lcd_data4 */ -+ BONE_P8_41 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_42: lcd_data5.lcd_data5 */ -+ BONE_P8_42 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_39: lcd_data6.lcd_data6 */ -+ BONE_P8_39 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_40: lcd_data7.lcd_data7 */ -+ BONE_P8_40 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_37: lcd_data8.lcd_data8 */ -+ BONE_P8_37 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_38: lcd_data9.lcd_data9 */ -+ BONE_P8_38 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_36: lcd_data10.lcd_data10 */ -+ BONE_P8_36 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_34: lcd_data11.lcd_data11 */ -+ BONE_P8_34 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_35: lcd_data12.lcd_data12 */ -+ BONE_P8_35 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_33: lcd_data13.lcd_data13 */ -+ BONE_P8_33 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_31: lcd_data14.lcd_data14 */ -+ BONE_P8_31 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_32: lcd_data15.lcd_data15 */ -+ BONE_P8_32 (PIN_OUTPUT | MUX_MODE0) -+ -+ /* gpmc_ad15.lcd_data16 */ -+ BONE_P8_15 (PIN_OUTPUT | MUX_MODE1) -+ /* gpmc_ad14.lcd_data17 */ -+ BONE_P8_16 (PIN_OUTPUT | MUX_MODE1) -+ /* gpmc_ad13.lcd_data18 */ -+ BONE_P8_11 (PIN_OUTPUT | MUX_MODE1) -+ /* gpmc_ad12.lcd_data19 */ -+ BONE_P8_12 (PIN_OUTPUT | MUX_MODE1) -+ /* gpmc_ad11.lcd_data20 */ -+ BONE_P8_17 (PIN_OUTPUT | MUX_MODE1) -+ /* gpmc_ad10.lcd_data21 */ -+ BONE_P8_14 (PIN_OUTPUT | MUX_MODE1) -+ /* gpmc_ad9.lcd_data22 */ -+ BONE_P8_13 (PIN_OUTPUT | MUX_MODE1) -+ /* gpmc_ad8.lcd_data23 */ -+ BONE_P8_19 (PIN_OUTPUT | MUX_MODE1) -+ -+ /* P8_27: lcd_vsync.lcd_vsync */ -+ BONE_P8_27 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_29: lcd_hsync.lcd_hsync */ -+ BONE_P8_29 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_28: lcd_pclk.lcd_pclk*/ -+ BONE_P8_28 (PIN_OUTPUT | MUX_MODE0) -+ /* P8_30: lcd_ac_bias_en.lcd_ac_bias_en */ -+ BONE_P8_30 (PIN_OUTPUT | MUX_MODE0) -+ >; -+ }; -+}; -+ -+/ { -+ panel { -+ pinctrl-0 = <&lcd_24bit_pins>; -+ }; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-ttyS1.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-ttyS1.dtsi -new file mode 100644 -index 000000000000..ae5b813f007a ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-ttyS1.dtsi -@@ -0,0 +1,48 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+/* Testing */ -+/* sudo /sbin/getty -L ttyS1 115200 vt102 */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-ttyS1.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P9_24_pinmux { -+ * mode = "uart"; -+ * }; -+ * P9_26_pinmux { -+ * mode = "uart"; -+ * }; -+ *}; -+ * -+ *&uart1 { -+ * pinctrl-0 = <>; -+ *}; -+ * -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ uart1_pins: pinmux_uart1_pins { -+ pinctrl-single,pins = < -+ /* P9_24: uart1_txd.uart1_txd */ -+ BONE_P9_24 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) -+ /* P9_26: uart1_rxd.uart1_rxd */ -+ BONE_P9_26 (PIN_INPUT_PULLUP | MUX_MODE0) -+ >; -+ }; -+}; -+ -+&uart1 { -+ pinctrl-0 = <&uart1_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-ttyS2.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-ttyS2.dtsi -new file mode 100644 -index 000000000000..5fa593ac31a5 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-ttyS2.dtsi -@@ -0,0 +1,48 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+/* Testing */ -+/* sudo /sbin/getty -L ttyS2 115200 vt102 */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-ttyS2.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P9_21_pinmux { -+ * mode = "uart"; -+ * }; -+ * P9_22_pinmux { -+ * mode = "uart"; -+ * }; -+ *}; -+ * -+ *&uart2 { -+ * pinctrl-0 = <>; -+ *}; -+ * -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ uart2_pins: pinmux_uart2_pins { -+ pinctrl-single,pins = < -+ /* P9_21: spi0_d0.uart2_txd */ -+ BONE_P9_21 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) -+ /* P9_22: spi0_sclk.uart2_rxd */ -+ BONE_P9_22 (PIN_INPUT_PULLUP | MUX_MODE1) -+ >; -+ }; -+}; -+ -+&uart2 { -+ pinctrl-0 = <&uart2_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-bone-pinmux-ttyS4.dtsi b/arch/arm/boot/dts/am335x-bone-pinmux-ttyS4.dtsi -new file mode 100644 -index 000000000000..1d22a95a23a2 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-bone-pinmux-ttyS4.dtsi -@@ -0,0 +1,48 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+/* Testing */ -+/* sudo /sbin/getty -L ttyS4 115200 vt102 */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+#include "am335x-peripheral-ttyS4.dtsi" -+ -+/* cape universal */ -+ -+/* -+ *&ocp { -+ * P9_11_pinmux { -+ * mode = "uart"; -+ * }; -+ * P9_13_pinmux { -+ * mode = "uart"; -+ * }; -+ *}; -+ * -+ *&uart4 { -+ * pinctrl-0 = <>; -+ *}; -+ * -+ */ -+ -+/* standard */ -+ -+&am33xx_pinmux { -+ uart4_pins: pinmux_uart4_pins { -+ pinctrl-single,pins = < -+ /* P9_11: gpmc_wait0.uart4_rxd_mux2 */ -+ BONE_P9_11 (PIN_INPUT_PULLUP | MUX_MODE6) -+ /* P9_13: gpmc_wpn.uart4_txd_mux2 */ -+ BONE_P9_13 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) -+ >; -+ }; -+}; -+ -+&uart4 { -+ pinctrl-0 = <&uart4_pins>; -+}; -diff --git a/arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts b/arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts -new file mode 100644 -index 000000000000..8d795c06572d ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-boneblack-bbb-exp-c.dts -@@ -0,0 +1,47 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+/dts-v1/; -+ -+#include "am33xx.dtsi" -+#include "am335x-bone-common-no-capemgr.dtsi" -+ -+/ { -+ model = "TI AM335x BeagleBone Black"; -+ compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; -+}; -+ -+&ldo3_reg { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-always-on; -+}; -+ -+&mmc1 { -+ vmmc-supply = <&vmmcsd_fixed>; -+}; -+ -+&mmc2 { -+ vmmc-supply = <&vmmcsd_fixed>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emmc_pins>; -+ bus-width = <8>; -+ status = "okay"; -+}; -+ -+&cpu0_opp_table { -+ /* -+ * All PG 2.0 silicon may not support 1GHz but some of the early -+ * BeagleBone Blacks have PG 2.0 silicon which is guaranteed -+ * to support 1GHz OPP so enable it for PG 2.0 on this board. -+ */ -+ oppnitro@1000000000 { -+ opp-supported-hw = <0x06 0x0100>; -+ }; -+}; -+ -+#include "am335x-cape-bbb-exp-c.dtsi" -diff --git a/arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts b/arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts -new file mode 100644 -index 000000000000..5df881eaac4c ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-boneblack-bbb-exp-r.dts -@@ -0,0 +1,47 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+/dts-v1/; -+ -+#include "am33xx.dtsi" -+#include "am335x-bone-common-no-capemgr.dtsi" -+ -+/ { -+ model = "TI AM335x BeagleBone Black"; -+ compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; -+}; -+ -+&ldo3_reg { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-always-on; -+}; -+ -+&mmc1 { -+ vmmc-supply = <&vmmcsd_fixed>; -+}; -+ -+&mmc2 { -+ vmmc-supply = <&vmmcsd_fixed>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emmc_pins>; -+ bus-width = <8>; -+ status = "okay"; -+}; -+ -+&cpu0_opp_table { -+ /* -+ * All PG 2.0 silicon may not support 1GHz but some of the early -+ * BeagleBone Blacks have PG 2.0 silicon which is guaranteed -+ * to support 1GHz OPP so enable it for PG 2.0 on this board. -+ */ -+ oppnitro@1000000000 { -+ opp-supported-hw = <0x06 0x0100>; -+ }; -+}; -+ -+#include "am335x-cape-bbb-exp-r.dtsi" -diff --git a/arch/arm/boot/dts/am335x-cape-bbb-exp-c.dtsi b/arch/arm/boot/dts/am335x-cape-bbb-exp-c.dtsi -new file mode 100644 -index 000000000000..d2704c692108 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-cape-bbb-exp-c.dtsi -@@ -0,0 +1,227 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+ -+#include "am335x-peripheral-can0.dtsi" -+#include "am335x-bone-pinmux-can0.dtsi" -+ -+#include "am335x-peripheral-ttyS1.dtsi" -+#include "am335x-bone-pinmux-ttyS1.dtsi" -+ -+#include "am335x-peripheral-ttyS2.dtsi" -+#include "am335x-bone-pinmux-ttyS2.dtsi" -+ -+#include "am335x-peripheral-ttyS4.dtsi" -+#include "am335x-bone-pinmux-ttyS4.dtsi" -+ -+&am33xx_pinmux { -+ user_leds_s1: user_leds_s1 { -+ pinctrl-single,pins = < -+ 0x98 0x7 /* gpmc_wen.gpio2_4, OUTPUT | MODE7 */ -+ 0x9c 0x7 /* gpmc_ben0_cle.gpio2_5, OUTPUT | MODE7 */ -+ >; -+ }; -+ -+ bb_lcd_pwm_backlight_pins: pinmux_bb_lcd_pwm_backlight_pins { -+ pinctrl-single,pins = < -+ BONE_P9_14 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* gpmc_a2.ehrpwm1a */ -+ >; -+ }; -+ -+ keymap3_pins: pinmux_keymap3_pins { -+ pinctrl-single,pins = < -+ 0x040 0x2f /* KEY_UP gpmc_a0.gpio1_16, INPUT | PULLDIS | MODE7 */ -+ 0x04c 0x2f /* KEY_DOWN gpmc_a3.gpio1_19, INPUT | PULLDIS | MODE7 */ -+ 0x078 0x2f /* KEY_RIGHT gpmc_ben1.gpio1_28, INPUT | PULLDIS | MODE7 */ -+ 0x164 0x2f /* KEY_LEFT ecap0_in_pwm0_out.gpio0_7, INPUT | PULLDIS | MODE7 */ -+ 0x1a4 0x2f /* KEY_ENTER mcasp0_fxr.gpio3_19, INPUT | PULLDIS | MODE7 */ -+ >; -+ }; -+ -+ edt_ft5306_ts_pins: pinmux_edt_ft5306_ts_pins { -+ pinctrl-single,pins = < -+ /* CAP_TSC gpmc_a1.gpio1_17, INPUT | MODE7 */ -+ BONE_P9_23 (PIN_INPUT_PULLDOWN | MUX_MODE7) -+ >; -+ }; -+ -+ i2c1_pins: pinmux_i2c1_pins { -+ pinctrl-single,pins = < -+ /* spi0_d1.i2c1_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */ -+ BONE_P9_18 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE2) -+ /* spi0_cs0.i2c1_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */ -+ BONE_P9_17 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE2) -+ >; -+ }; -+ -+ mcasp0_pins: pinmux_mcasp0_pins { -+ pinctrl-single,pins = < -+ 0x190 0x20 /* mcasp0_aclkx.mcasp0_aclkx, INPUT | MODE0 */ -+ 0x194 0x20 /* mcasp0_fsx.mcasp0_fsx, INPUT | MODE0 */ -+ 0x198 0x20 /* mcasp0_axr0.mcasp0_axr0, INPUT | MODE0 */ -+ 0x19c 0x22 /* mcasp0_ahclkr.mcasp0_axr2, INPUT | MODE2 */ -+ >; -+ }; -+}; -+ -+&epwmss1 { -+ status = "okay"; -+}; -+ -+ -+&ehrpwm1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bb_lcd_pwm_backlight_pins>; -+ status = "okay"; -+}; -+ -+&i2c1 { -+ status = "okay"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins>; -+ clock-frequency = <400000>; -+ -+ edt-ft5306@38 { -+ status = "okay"; -+ compatible = "edt,edt-ft5306", "edt,edt-ft5x06"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&edt_ft5306_ts_pins>; -+ -+ reg = <0x38>; -+ interrupt-parent = <&gpio1>; -+ interrupts = <17 0>; -+ -+ touchscreen-size-x = <600>; -+ touchscreen-size-y = <1024>; -+ touchscreen-inverted-x; -+ touchscreen-inverted-y; -+ touchscreen-swapped-x-y; -+ }; -+ -+ tlv320aic3x: tlv320aic3x@1b { -+ compatible = "ti,tlv320aic3x"; -+ reg = <0x1b>; -+ status = "okay"; -+ }; -+}; -+ -+&mcasp0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mcasp0_pins>; -+ -+ status = "okay"; -+ -+ op-mode = <0>; /* MCASP_IIS_MODE */ -+ tdm-slots = <2>; -+ num-serializer = <16>; -+ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ -+ 1 0 2 0 -+ 0 0 0 0 -+ 0 0 0 0 -+ 0 0 0 0 -+ >; -+ tx-num-evt = <1>; -+ rx-num-evt = <1>; -+}; -+ -+/ { -+ backlight { -+ status = "okay"; -+ compatible = "pwm-backlight"; -+ pwms = <&ehrpwm1 0 50000 0>; -+ brightness-levels = <0 51 53 56 62 75 101 152 255>; -+ default-brightness-level = <8>; -+ }; -+ -+ gpio_keys { -+ compatible = "gpio-keys"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&keymap3_pins>; -+ -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ button@1 { -+ debounce_interval = <50>; -+ linux,code = <105>; -+ label = "left"; -+ gpios = <&gpio0 7 0x1>; -+ gpio-key,wakeup; -+ autorepeat; -+ }; -+ button@2 { -+ debounce_interval = <50>; -+ linux,code = <106>; -+ label = "right"; -+ gpios = <&gpio1 28 0x1>; -+ gpio-key,wakeup; -+ autorepeat; -+ }; -+ button@3 { -+ debounce_interval = <50>; -+ linux,code = <103>; -+ label = "up"; -+ gpios = <&gpio1 16 0x1>; -+ gpio-key,wakeup; -+ autorepeat; -+ }; -+ button@4 { -+ debounce_interval = <50>; -+ linux,code = <108>; -+ label = "down"; -+ gpios = <&gpio1 19 0x1>; -+ gpio-key,wakeup; -+ autorepeat; -+ }; -+ button@5 { -+ debounce_interval = <50>; -+ linux,code = <28>; -+ label = "enter"; -+ gpios = <&gpio3 19 0x1>; -+ gpio-key,wakeup; -+ }; -+ }; -+ -+ gpio-leds-cape-lcd { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ -+ pinctrl-0 = <&user_leds_s1>; -+ -+ lcd-led0 { -+ label = "lcd:green:usr0"; -+ gpios = <&gpio2 4 0>; -+ linux,default-trigger = "heartbeat"; -+ default-state = "off"; -+ }; -+ -+ lcd-led1 { -+ label = "lcd:green:usr1"; -+ gpios = <&gpio2 5 0>; -+ linux,default-trigger = "mmc0"; -+ default-state = "off"; -+ }; -+ }; -+ -+ sound { -+ compatible = "ti,da830-evm-audio"; -+ ti,model = "DA830 EVM"; -+ ti,audio-codec = <&tlv320aic3x>; -+ ti,mcasp-controller = <&mcasp0>; -+ ti,codec-clock-rate = <12000000>; -+ ti,audio-routing = -+ "Headphone Jack", "HPLOUT", -+ "Headphone Jack", "HPROUT", -+ "MIC3L", "Mic Jack", -+ "MIC3R", "Mic Jack"; -+ }; -+}; -+ -+#include "am335x-peripheral-panel-1024x600-24bit.dtsi" -+#include "am335x-bone-pinmux-panel-1024x600-24bit.dtsi" -diff --git a/arch/arm/boot/dts/am335x-cape-bbb-exp-r.dtsi b/arch/arm/boot/dts/am335x-cape-bbb-exp-r.dtsi -new file mode 100644 -index 000000000000..539409c9fcd8 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-cape-bbb-exp-r.dtsi -@@ -0,0 +1,217 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+#include <dt-bindings/board/am335x-bbw-bbb-base.h> -+ -+#include "am335x-peripheral-can0.dtsi" -+#include "am335x-bone-pinmux-can0.dtsi" -+ -+#include "am335x-peripheral-ttyS1.dtsi" -+#include "am335x-bone-pinmux-ttyS1.dtsi" -+ -+#include "am335x-peripheral-ttyS2.dtsi" -+#include "am335x-bone-pinmux-ttyS2.dtsi" -+ -+#include "am335x-peripheral-ttyS4.dtsi" -+#include "am335x-bone-pinmux-ttyS4.dtsi" -+ -+&am33xx_pinmux { -+ user_leds_s1: user_leds_s1 { -+ pinctrl-single,pins = < -+ 0x98 0x7 /* gpmc_wen.gpio2_4, OUTPUT | MODE7 */ -+ 0x9c 0x7 /* gpmc_ben0_cle.gpio2_5, OUTPUT | MODE7 */ -+ >; -+ }; -+ -+ bb_lcd_pwm_backlight_pins: pinmux_bb_lcd_pwm_backlight_pins { -+ pinctrl-single,pins = < -+ BONE_P9_14 (PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* gpmc_a2.ehrpwm1a */ -+ >; -+ }; -+ -+ keymap3_pins: pinmux_keymap3_pins { -+ pinctrl-single,pins = < -+ 0x040 0x2f /* KEY_UP gpmc_a0.gpio1_16, INPUT | PULLDIS | MODE7 */ -+ 0x04c 0x2f /* KEY_DOWN gpmc_a3.gpio1_19, INPUT | PULLDIS | MODE7 */ -+ 0x078 0x2f /* KEY_RIGHT gpmc_ben1.gpio1_28, INPUT | PULLDIS | MODE7 */ -+ 0x164 0x2f /* KEY_LEFT ecap0_in_pwm0_out.gpio0_7, INPUT | PULLDIS | MODE7 */ -+ 0x1a4 0x2f /* KEY_ENTER mcasp0_fxr.gpio3_19, INPUT | PULLDIS | MODE7 */ -+ >; -+ }; -+ -+ i2c1_pins: pinmux_i2c1_pins { -+ pinctrl-single,pins = < -+ /* spi0_d1.i2c1_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */ -+ BONE_P9_18 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE2) -+ /* spi0_cs0.i2c1_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */ -+ BONE_P9_17 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE2) -+ >; -+ }; -+ -+ mcasp0_pins: pinmux_mcasp0_pins { -+ pinctrl-single,pins = < -+ 0x190 0x20 /* mcasp0_aclkx.mcasp0_aclkx, INPUT | MODE0 */ -+ 0x194 0x20 /* mcasp0_fsx.mcasp0_fsx, INPUT | MODE0 */ -+ 0x198 0x20 /* mcasp0_axr0.mcasp0_axr0, INPUT | MODE0 */ -+ 0x19c 0x22 /* mcasp0_ahclkr.mcasp0_axr2, INPUT | MODE2 */ -+ >; -+ }; -+}; -+ -+&epwmss1 { -+ status = "okay"; -+}; -+ -+ -+&ehrpwm1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bb_lcd_pwm_backlight_pins>; -+ status = "okay"; -+}; -+ -+&i2c1 { -+ status = "okay"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins>; -+ clock-frequency = <400000>; -+ -+ tlv320aic3x: tlv320aic3x@1b { -+ compatible = "ti,tlv320aic3x"; -+ reg = <0x1b>; -+ status = "okay"; -+ }; -+}; -+ -+&mcasp0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mcasp0_pins>; -+ -+ status = "okay"; -+ -+ op-mode = <0>; /* MCASP_IIS_MODE */ -+ tdm-slots = <2>; -+ num-serializer = <16>; -+ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ -+ 1 0 2 0 -+ 0 0 0 0 -+ 0 0 0 0 -+ 0 0 0 0 -+ >; -+ tx-num-evt = <1>; -+ rx-num-evt = <1>; -+}; -+ -+&tscadc { -+ status = "okay"; -+ tsc { -+ ti,wires = <4>; -+ ti,x-plate-resistance = <200>; -+ ti,coordinate-readouts = <5>; -+ ti,wire-config = <0x00 0x11 0x22 0x33>; -+ }; -+ -+ adc { -+ ti,adc-channels = <4 5 6 7>; -+ }; -+}; -+ -+/ { -+ backlight { -+ status = "okay"; -+ compatible = "pwm-backlight"; -+ pwms = <&ehrpwm1 0 50000 0>; -+ brightness-levels = <0 51 53 56 62 75 101 152 255>; -+ default-brightness-level = <8>; -+ }; -+ -+ gpio_keys { -+ compatible = "gpio-keys"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&keymap3_pins>; -+ -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ button@1 { -+ debounce_interval = <50>; -+ linux,code = <105>; -+ label = "left"; -+ gpios = <&gpio0 7 0x1>; -+ gpio-key,wakeup; -+ autorepeat; -+ }; -+ button@2 { -+ debounce_interval = <50>; -+ linux,code = <106>; -+ label = "right"; -+ gpios = <&gpio1 28 0x1>; -+ gpio-key,wakeup; -+ autorepeat; -+ }; -+ button@3 { -+ debounce_interval = <50>; -+ linux,code = <103>; -+ label = "up"; -+ gpios = <&gpio1 16 0x1>; -+ gpio-key,wakeup; -+ autorepeat; -+ }; -+ button@4 { -+ debounce_interval = <50>; -+ linux,code = <108>; -+ label = "down"; -+ gpios = <&gpio1 19 0x1>; -+ gpio-key,wakeup; -+ autorepeat; -+ }; -+ button@5 { -+ debounce_interval = <50>; -+ linux,code = <28>; -+ label = "enter"; -+ gpios = <&gpio3 19 0x1>; -+ gpio-key,wakeup; -+ }; -+ }; -+ -+ gpio-leds-cape-lcd { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ -+ pinctrl-0 = <&user_leds_s1>; -+ -+ lcd-led0 { -+ label = "lcd:green:usr0"; -+ gpios = <&gpio2 4 0>; -+ linux,default-trigger = "heartbeat"; -+ default-state = "off"; -+ }; -+ -+ lcd-led1 { -+ label = "lcd:green:usr1"; -+ gpios = <&gpio2 5 0>; -+ linux,default-trigger = "mmc0"; -+ default-state = "off"; -+ }; -+ }; -+ -+ sound { -+ compatible = "ti,da830-evm-audio"; -+ ti,model = "DA830 EVM"; -+ ti,audio-codec = <&tlv320aic3x>; -+ ti,mcasp-controller = <&mcasp0>; -+ ti,codec-clock-rate = <12000000>; -+ ti,audio-routing = -+ "Headphone Jack", "HPLOUT", -+ "Headphone Jack", "HPROUT", -+ "MIC3L", "Mic Jack", -+ "MIC3R", "Mic Jack"; -+ }; -+}; -+ -+#include "am335x-peripheral-panel-1024x600-24bit.dtsi" -+#include "am335x-bone-pinmux-panel-1024x600-24bit.dtsi" -diff --git a/arch/arm/boot/dts/am335x-peripheral-can0.dtsi b/arch/arm/boot/dts/am335x-peripheral-can0.dtsi -new file mode 100644 -index 000000000000..4335e39bf199 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-can0.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&dcan0 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-panel-1024x600-24bit.dtsi b/arch/arm/boot/dts/am335x-peripheral-panel-1024x600-24bit.dtsi -new file mode 100644 -index 000000000000..f7c8f8af499f ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-panel-1024x600-24bit.dtsi -@@ -0,0 +1,50 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&lcdc { -+ status = "okay"; -+ blue-and-red-wiring = "crossed"; -+}; -+ -+/ { -+ panel { -+ status = "okay"; -+ compatible = "ti,tilcdc,panel"; -+ pinctrl-names = "default"; -+ -+ panel-info { -+ ac-bias = <255>; -+ ac-bias-intrpt = <0>; -+ dma-burst-sz = <16>; -+ bpp = <32>; -+ fdd = <0x80>; -+ sync-edge = <0>; -+ sync-ctrl = <0>; -+ raster-order = <1>; -+ fifo-th = <0>; -+ }; -+ display-timings { -+ native-mode = <&timing0>; -+ timing0: 1024x600 { -+ clock-frequency = <36000000>; -+ hactive = <1024>; -+ vactive = <600>; -+ hfront-porch = <1>; -+ hback-porch = <45>; -+ hsync-len = <30>; -+ vback-porch = <22>; -+ vfront-porch = <12>; -+ vsync-len = <2>; -+ hsync-active = <1>; -+ vsync-active = <1>; -+ de-active = <1>; -+ pixelclk-active = <0>; -+ }; -+ }; -+ }; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-ttyS1.dtsi b/arch/arm/boot/dts/am335x-peripheral-ttyS1.dtsi -new file mode 100644 -index 000000000000..f59fa4c5025f ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-ttyS1.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&uart1 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-ttyS2.dtsi b/arch/arm/boot/dts/am335x-peripheral-ttyS2.dtsi -new file mode 100644 -index 000000000000..a25d6cfcb1d6 ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-ttyS2.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&uart2 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/am335x-peripheral-ttyS4.dtsi b/arch/arm/boot/dts/am335x-peripheral-ttyS4.dtsi -new file mode 100644 -index 000000000000..adc89f046fbb ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-peripheral-ttyS4.dtsi -@@ -0,0 +1,13 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+ -+&uart4 { -+ pinctrl-names = "default"; -+ -+ status = "okay"; -+}; --- -2.11.0 - diff --git a/patches/soc/ti/beaglebone_capes/0004-bb-audio-cape.patch b/patches/soc/ti/beaglebone_capes/0004-bb-audio-cape.patch deleted file mode 100644 index b8f42af47..000000000 --- a/patches/soc/ti/beaglebone_capes/0004-bb-audio-cape.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 3cbdd0f1389c14f5fcfaf6ffc5a3760381007c0b Mon Sep 17 00:00:00 2001 -From: Robert Nelson <robertcnelson@gmail.com> -Date: Thu, 11 May 2017 10:36:54 -0500 -Subject: [PATCH 5/5] bb: audio cape - -Signed-off-by: Robert Nelson <robertcnelson@gmail.com> ---- - arch/arm/boot/dts/am335x-boneblack-audio.dts | 50 ++++++++++++++++++++++++++++ - 1 file changed, 50 insertions(+) - create mode 100644 arch/arm/boot/dts/am335x-boneblack-audio.dts - -diff --git a/arch/arm/boot/dts/am335x-boneblack-audio.dts b/arch/arm/boot/dts/am335x-boneblack-audio.dts -new file mode 100644 -index 000000000000..a938c2c9ed1e ---- /dev/null -+++ b/arch/arm/boot/dts/am335x-boneblack-audio.dts -@@ -0,0 +1,50 @@ -+/* -+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ -+ * -+ * 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. -+ */ -+/dts-v1/; -+ -+#include "am33xx.dtsi" -+#include "am335x-bone-common.dtsi" -+ -+/ { -+ model = "TI AM335x BeagleBone Black"; -+ compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx"; -+ -+ clk_mcasp0_fixed: clk_mcasp0_fixed { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <24576000>; -+ }; -+ -+ clk_mcasp0: clk_mcasp0 { -+ #clock-cells = <0>; -+ compatible = "gpio-gate-clock"; -+ clocks = <&clk_mcasp0_fixed>; -+ enable-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>; /* BeagleBone Black Clk enable on GPIO1_27 */ -+ }; -+}; -+ -+&ldo3_reg { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-always-on; -+}; -+ -+&mmc1 { -+ vmmc-supply = <&vmmcsd_fixed>; -+}; -+ -+&cpu0_opp_table { -+ /* -+ * All PG 2.0 silicon may not support 1GHz but some of the early -+ * BeagleBone Blacks have PG 2.0 silicon which is guaranteed -+ * to support 1GHz OPP so enable it for PG 2.0 on this board. -+ */ -+ oppnitro@1000000000 { -+ opp-supported-hw = <0x06 0x0100>; -+ }; -+}; --- -2.11.0 - diff --git a/patches/soc/ti/blue/0001-am335x-boneblue.dts-force-1ghz-opp.patch b/patches/soc/ti/blue/0001-am335x-boneblue.dts-force-1ghz-opp.patch index ae1806c50..068e4dc04 100644 --- a/patches/soc/ti/blue/0001-am335x-boneblue.dts-force-1ghz-opp.patch +++ b/patches/soc/ti/blue/0001-am335x-boneblue.dts-force-1ghz-opp.patch @@ -1,7 +1,7 @@ -From ee53c9410a9060f693eb0babcc7204fe32e63c14 Mon Sep 17 00:00:00 2001 +From 046bb1ccda71c9abcdc505a259cce1b2deed6e40 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Thu, 15 Feb 2018 11:09:45 -0600 -Subject: [PATCH] am335x-boneblue.dts: force 1ghz opp +Subject: [PATCH 1/3] am335x-boneblue.dts: force 1ghz opp Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -9,7 +9,7 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 1 file changed, 11 insertions(+) diff --git a/arch/arm/boot/dts/am335x-boneblue.dts b/arch/arm/boot/dts/am335x-boneblue.dts -index 3f2480d05a3b..fee852cd2436 100644 +index ccb147e70d17..1e5f43953f46 100644 --- a/arch/arm/boot/dts/am335x-boneblue.dts +++ b/arch/arm/boot/dts/am335x-boneblue.dts @@ -127,6 +127,17 @@ @@ -31,5 +31,5 @@ index 3f2480d05a3b..fee852cd2436 100644 user_leds_s0: user_leds_s0 { pinctrl-single,pins = < -- -2.15.1 +2.20.1 diff --git a/patches/soc/ti/blue/0002-blue-add-pwm-eqep-spi-etc.patch b/patches/soc/ti/blue/0002-blue-add-pwm-eqep-spi-etc.patch index 62060c657..4cd177739 100644 --- a/patches/soc/ti/blue/0002-blue-add-pwm-eqep-spi-etc.patch +++ b/patches/soc/ti/blue/0002-blue-add-pwm-eqep-spi-etc.patch @@ -1,15 +1,15 @@ -From 18b3136034af8bbc150e53fe2a17ea4e2cbcdaef Mon Sep 17 00:00:00 2001 +From 472b4695af3448929c3e1cceff6ab98318e2f66a Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> -Date: Fri, 6 Apr 2018 12:15:46 -0500 -Subject: [PATCH 2/2] blue: add pwm/eqep/spi/etc +Date: Fri, 5 Apr 2019 10:30:21 -0500 +Subject: [PATCH 2/3] blue: add pwm/eqep/spi/etc Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- - arch/arm/boot/dts/am335x-boneblue.dts | 466 ++++++++++++++++++++++++++++++++-- - 1 file changed, 443 insertions(+), 23 deletions(-) + arch/arm/boot/dts/am335x-boneblue.dts | 468 ++++++++++++++++++++++++-- + 1 file changed, 445 insertions(+), 23 deletions(-) diff --git a/arch/arm/boot/dts/am335x-boneblue.dts b/arch/arm/boot/dts/am335x-boneblue.dts -index 356d25c232e9..a50911549877 100644 +index 1e5f43953f46..2a089c47a3a9 100644 --- a/arch/arm/boot/dts/am335x-boneblue.dts +++ b/arch/arm/boot/dts/am335x-boneblue.dts @@ -125,6 +125,18 @@ @@ -327,7 +327,7 @@ index 356d25c232e9..a50911549877 100644 &dcan1 { pinctrl-names = "default"; pinctrl-0 = <&dcan1_pins>; -@@ -544,3 +752,215 @@ +@@ -544,3 +752,217 @@ line-name = "LS_BUF_EN"; }; }; @@ -531,6 +531,7 @@ index 356d25c232e9..a50911549877 100644 + #address-cells = <1>; + #size-cells = <0>; + compatible = "spidev"; ++ symlink = "spi/1.0"; + reg = <0>; + spi-max-frequency = <24000000>; + }; @@ -539,10 +540,11 @@ index 356d25c232e9..a50911549877 100644 + #address-cells = <1>; + #size-cells = <0>; + compatible = "spidev"; ++ symlink = "spi/1.1"; + reg = <1>; + spi-max-frequency = <24000000>; + }; +}; -- -2.16.3 +2.20.1 diff --git a/patches/soc/ti/blue/0003-am335x-boneblue.dts-fix-rtc-off.patch b/patches/soc/ti/blue/0003-am335x-boneblue.dts-fix-rtc-off.patch index bfd221f91..c45d4dfc1 100644 --- a/patches/soc/ti/blue/0003-am335x-boneblue.dts-fix-rtc-off.patch +++ b/patches/soc/ti/blue/0003-am335x-boneblue.dts-fix-rtc-off.patch @@ -1,4 +1,4 @@ -From 2d2068183b7aa8baff39bc0569e70857f28d4f29 Mon Sep 17 00:00:00 2001 +From 660711bab04b5fd4a4081b62bed92a16fe59c4fa Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Thu, 5 Apr 2018 11:49:17 -0500 Subject: [PATCH 3/3] am335x-boneblue.dts: fix rtc off @@ -9,7 +9,7 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/am335x-boneblue.dts b/arch/arm/boot/dts/am335x-boneblue.dts -index 8bc9fb7f7fc1..49b965a4bf4e 100644 +index 2a089c47a3a9..1a24efdd1fc8 100644 --- a/arch/arm/boot/dts/am335x-boneblue.dts +++ b/arch/arm/boot/dts/am335x-boneblue.dts @@ -601,6 +601,8 @@ @@ -31,5 +31,5 @@ index 8bc9fb7f7fc1..49b965a4bf4e 100644 &wkup_m3_ipc { -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/omap3/0001-ARM-dts-omap3-beagle-add-i2c2.patch b/patches/soc/ti/omap3/0001-ARM-dts-omap3-beagle-add-i2c2.patch index 8bd8f1777..9fc82d833 100644 --- a/patches/soc/ti/omap3/0001-ARM-dts-omap3-beagle-add-i2c2.patch +++ b/patches/soc/ti/omap3/0001-ARM-dts-omap3-beagle-add-i2c2.patch @@ -1,4 +1,4 @@ -From 90b92e14581f065f86874fceaa4abad341c42536 Mon Sep 17 00:00:00 2001 +From 9ea607ee480b855f34d28f70fac647fb3ab886fe Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Thu, 13 Feb 2014 10:03:57 -0600 Subject: [PATCH 1/4] ARM: dts: omap3-beagle: add i2c2 @@ -24,5 +24,5 @@ index 91bb50ad9a4f..611c614899dc 100644 #include "twl4030_omap3.dtsi" -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/omap3/0002-ARM-dts-omap3-beagle-xm-spidev.patch b/patches/soc/ti/omap3/0002-ARM-dts-omap3-beagle-xm-spidev.patch index 6ca5841c5..6ae37748f 100644 --- a/patches/soc/ti/omap3/0002-ARM-dts-omap3-beagle-xm-spidev.patch +++ b/patches/soc/ti/omap3/0002-ARM-dts-omap3-beagle-xm-spidev.patch @@ -1,4 +1,4 @@ -From 38e96f800c68621198f38e9a896eb266c4b67afa Mon Sep 17 00:00:00 2001 +From 86d00a8f825fc8202ecb6716d68b6da7a8df4a79 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Wed, 19 Feb 2014 09:29:54 -0600 Subject: [PATCH 2/4] ARM: dts: omap3-beagle-xm: spidev @@ -76,5 +76,5 @@ index 9985ee2aae0c..e52577089d01 100644 ti,use-leds; /* pullups: BIT(1) */ -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/omap3/0003-ARM-DTS-omap3-beagle.dts-enable-twl4030-power-reset.patch b/patches/soc/ti/omap3/0003-ARM-DTS-omap3-beagle.dts-enable-twl4030-power-reset.patch index d04ae02dc..366e41d17 100644 --- a/patches/soc/ti/omap3/0003-ARM-DTS-omap3-beagle.dts-enable-twl4030-power-reset.patch +++ b/patches/soc/ti/omap3/0003-ARM-DTS-omap3-beagle.dts-enable-twl4030-power-reset.patch @@ -1,4 +1,4 @@ -From 178b139a44262d74e1a5cd4d48cd6ffd2fcbaf4e Mon Sep 17 00:00:00 2001 +From b951d9b51137bc1f1aabd5b251f3f3ddc153c2fe Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Fri, 2 May 2014 15:30:02 -0500 Subject: [PATCH 3/4] ARM: DTS: omap3-beagle.dts: enable twl4030-power-reset @@ -25,5 +25,5 @@ index 611c614899dc..cd018468b7a5 100644 }; -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/omap3/0004-omap3-beagle-fixes.patch b/patches/soc/ti/omap3/0004-omap3-beagle-fixes.patch index 8cded734f..59169d84e 100644 --- a/patches/soc/ti/omap3/0004-omap3-beagle-fixes.patch +++ b/patches/soc/ti/omap3/0004-omap3-beagle-fixes.patch @@ -1,4 +1,4 @@ -From cd03588e9bbdf7b53a6e2aad3182e55be0f9d7b9 Mon Sep 17 00:00:00 2001 +From 5fa544e0b537ed08955b3dc31ffd82d8b7ad25b9 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Tue, 13 Sep 2016 20:57:04 -0500 Subject: [PATCH 4/4] omap3-beagle: fixes @@ -59,5 +59,5 @@ index cd018468b7a5..80ebdfb782bd 100644 reg = <0x54010000 0x1000>; -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/omap4/0001-arm-dts-omap4-move-emif-so-panda-es-b3-now-boots.patch b/patches/soc/ti/omap4/0001-arm-dts-omap4-move-emif-so-panda-es-b3-now-boots.patch index c2243310e..f5b7c95d5 100644 --- a/patches/soc/ti/omap4/0001-arm-dts-omap4-move-emif-so-panda-es-b3-now-boots.patch +++ b/patches/soc/ti/omap4/0001-arm-dts-omap4-move-emif-so-panda-es-b3-now-boots.patch @@ -1,7 +1,7 @@ -From c73f9f4d0e764da548a4b0a8835303eb8eba00e0 Mon Sep 17 00:00:00 2001 +From 68fb9177e3c890cffbb687292c11222c4f17da9e Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Thu, 23 Aug 2018 17:22:01 -0500 -Subject: [PATCH] arm: dts: omap4: move emif so panda-es-b3 now boots +Subject: [PATCH 1/2] arm: dts: omap4: move emif so panda-es-b3 now boots Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- @@ -17,10 +17,10 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> create mode 100644 arch/arm/boot/dts/omap4-panda-es-b3.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 4495d22ad46e..da05ef56b5ba 100644 +index e71ea32fc787..8c528da71d45 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -738,6 +738,7 @@ dtb-$(CONFIG_ARCH_OMAP4) += \ +@@ -758,6 +758,7 @@ dtb-$(CONFIG_ARCH_OMAP4) += \ omap4-panda.dtb \ omap4-panda-a4.dtb \ omap4-panda-es.dtb \ @@ -52,10 +52,10 @@ index f1a6476af371..63b895b85eda 100644 &dss_hdmi_pins { pinctrl-single,pins = < diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi b/arch/arm/boot/dts/omap4-panda-common.dtsi -index 27895c1604b9..bcdfe29a4b84 100644 +index 926f018823a4..785d18a426a4 100644 --- a/arch/arm/boot/dts/omap4-panda-common.dtsi +++ b/arch/arm/boot/dts/omap4-panda-common.dtsi -@@ -491,16 +491,6 @@ +@@ -493,16 +493,6 @@ }; }; @@ -207,10 +207,10 @@ index a0e28b2e254e..3ee41ef824c0 100644 + status = "ok"; +}; diff --git a/arch/arm/boot/dts/omap4-sdp.dts b/arch/arm/boot/dts/omap4-sdp.dts -index 490726b52216..e24a7f216f3c 100644 +index c88817bdcc56..03ce4888a955 100644 --- a/arch/arm/boot/dts/omap4-sdp.dts +++ b/arch/arm/boot/dts/omap4-sdp.dts -@@ -502,11 +502,13 @@ +@@ -533,11 +533,13 @@ &emif1 { cs1-used; device-handle = <&elpida_ECB240ABACN>; @@ -245,5 +245,5 @@ index 1a96d4317c97..142ba6bf38a3 100644 timer5: timer@40138000 { -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/omap4/0002-HACK-PandaBoard-Bring-back-twl6030-clk32kg-regulator.patch b/patches/soc/ti/omap4/0002-HACK-PandaBoard-Bring-back-twl6030-clk32kg-regulator.patch index 7e420a4a5..8b1d528d4 100644 --- a/patches/soc/ti/omap4/0002-HACK-PandaBoard-Bring-back-twl6030-clk32kg-regulator.patch +++ b/patches/soc/ti/omap4/0002-HACK-PandaBoard-Bring-back-twl6030-clk32kg-regulator.patch @@ -1,4 +1,4 @@ -From 65a5eadd060f74c7df62a3f58859a4a799839a94 Mon Sep 17 00:00:00 2001 +From 8db8c4b6f9ef45c415aa8989e38b728922213e90 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Tue, 26 Feb 2019 12:38:20 -0600 Subject: [PATCH 2/2] HACK: PandaBoard: Bring back twl6030-clk32kg regulator @@ -26,10 +26,10 @@ index c45f97f37563..5ad5f8b993a3 100644 compatible = "ti,twl6030-usb"; interrupts = <4>, <10>; diff --git a/drivers/regulator/twl6030-regulator.c b/drivers/regulator/twl6030-regulator.c -index 219cbd910dbf..00b1e23e27ed 100644 +index 15f19df6bc5d..97c7788279a5 100644 --- a/drivers/regulator/twl6030-regulator.c +++ b/drivers/regulator/twl6030-regulator.c -@@ -317,6 +317,13 @@ static struct regulator_ops twl6030fixed_ops = { +@@ -293,6 +293,13 @@ static const struct regulator_ops twl6030fixed_ops = { .get_status = twl6030reg_get_status, }; @@ -43,7 +43,7 @@ index 219cbd910dbf..00b1e23e27ed 100644 /* * SMPS status and control */ -@@ -585,6 +592,19 @@ static const struct twlreg_info TWLSMPS_INFO_##label = { \ +@@ -566,6 +573,19 @@ static const struct twlreg_info TWLSMPS_INFO_##label = { \ }, \ } @@ -63,7 +63,7 @@ index 219cbd910dbf..00b1e23e27ed 100644 /* VUSBCP is managed *only* by the USB subchip */ /* 6030 REG with base as PMC Slave Misc : 0x0030 */ /* Turnon-delay and remap configuration values for 6030 are not -@@ -614,6 +634,7 @@ TWL6030_FIXED_LDO(VDAC, 0x64, 1800, 0); +@@ -595,6 +615,7 @@ TWL6030_FIXED_LDO(VDAC, 0x64, 1800, 0); TWL6030_FIXED_LDO(VUSB, 0x70, 3300, 0); TWL6030_FIXED_LDO(V1V8, 0x16, 1800, 0); TWL6030_FIXED_LDO(V2V1, 0x1c, 2100, 0); @@ -71,7 +71,7 @@ index 219cbd910dbf..00b1e23e27ed 100644 TWL6032_ADJUSTABLE_SMPS(SMPS3, 0x34); TWL6032_ADJUSTABLE_SMPS(SMPS4, 0x10); TWL6032_ADJUSTABLE_SMPS(VIO, 0x16); -@@ -645,6 +666,7 @@ static u8 twl_get_smps_mult(void) +@@ -626,6 +647,7 @@ static u8 twl_get_smps_mult(void) #define TWL6030_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWL6030, label) #define TWL6032_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWL6032, label) #define TWLFIXED_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLFIXED, label) @@ -79,7 +79,7 @@ index 219cbd910dbf..00b1e23e27ed 100644 #define TWLSMPS_OF_MATCH(comp, label) TWL_OF_MATCH(comp, TWLSMPS, label) static const struct of_device_id twl_of_match[] = { -@@ -672,6 +694,7 @@ static const struct of_device_id twl_of_match[] = { +@@ -653,6 +675,7 @@ static const struct of_device_id twl_of_match[] = { TWLFIXED_OF_MATCH("ti,twl6030-vusb", VUSB), TWLFIXED_OF_MATCH("ti,twl6030-v1v8", V1V8), TWLFIXED_OF_MATCH("ti,twl6030-v2v1", V2V1), diff --git a/patches/soc/ti/pocketbeagle/0001-am335x-pocketbeagle.dtb-config-pin.patch b/patches/soc/ti/pocketbeagle/0001-am335x-pocketbeagle.dtb-config-pin.patch index a4aa2e37c..f16b1519f 100644 --- a/patches/soc/ti/pocketbeagle/0001-am335x-pocketbeagle.dtb-config-pin.patch +++ b/patches/soc/ti/pocketbeagle/0001-am335x-pocketbeagle.dtb-config-pin.patch @@ -1,15 +1,15 @@ -From 851a44e8d5c0a64051cd8b1e41cea3a53e03262c Mon Sep 17 00:00:00 2001 +From 6a7227e9ffe0cc12cef219ed8e60fe602b4772a3 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Mon, 22 Oct 2018 11:00:23 -0500 -Subject: [PATCH] am335x-pocketbeagle.dtb: config-pin +Subject: [PATCH 1/2] am335x-pocketbeagle.dtb: config-pin Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- - arch/arm/boot/dts/am335x-pocketbeagle.dts | 2035 ++++++++++++++++++++- - 1 file changed, 1992 insertions(+), 43 deletions(-) + arch/arm/boot/dts/am335x-pocketbeagle.dts | 2039 ++++++++++++++++++++- + 1 file changed, 1996 insertions(+), 43 deletions(-) diff --git a/arch/arm/boot/dts/am335x-pocketbeagle.dts b/arch/arm/boot/dts/am335x-pocketbeagle.dts -index 62fe5cab9fae..a1b6a637d993 100644 +index 62fe5cab9fae..8f4163cc1a07 100644 --- a/arch/arm/boot/dts/am335x-pocketbeagle.dts +++ b/arch/arm/boot/dts/am335x-pocketbeagle.dts @@ -60,24 +60,24 @@ @@ -1022,7 +1022,7 @@ index 62fe5cab9fae..a1b6a637d993 100644 status = "okay"; }; -@@ -235,3 +1099,1088 @@ +@@ -235,3 +1099,1092 @@ &cppi41dma { status = "okay"; }; @@ -1036,6 +1036,7 @@ index 62fe5cab9fae..a1b6a637d993 100644 + #address-cells = <1>; + #size-cells = <0>; + compatible = "spidev"; ++ symlink = "spi/0.0"; + reg = <0>; + spi-max-frequency = <24000000>; + }; @@ -1044,6 +1045,7 @@ index 62fe5cab9fae..a1b6a637d993 100644 + #address-cells = <1>; + #size-cells = <0>; + compatible = "spidev"; ++ symlink = "spi/0.1"; + reg = <1>; + spi-max-frequency = <24000000>; + status = "disabled"; @@ -1059,6 +1061,7 @@ index 62fe5cab9fae..a1b6a637d993 100644 + #address-cells = <1>; + #size-cells = <0>; + compatible = "spidev"; ++ symlink = "spi/1.0"; + reg = <0>; + spi-max-frequency = <24000000>; + }; @@ -1067,6 +1070,7 @@ index 62fe5cab9fae..a1b6a637d993 100644 + #address-cells = <1>; + #size-cells = <0>; + compatible = "spidev"; ++ symlink = "spi/1.1"; + reg = <1>; + spi-max-frequency = <24000000>; + }; @@ -2112,5 +2116,5 @@ index 62fe5cab9fae..a1b6a637d993 100644 + }; +}; -- -2.19.1 +2.20.1 diff --git a/patches/soc/ti/pocketbeagle/0002-am335x-pocketbeagle.dts-microSD-mcasp0_aclkr.mmc0_sd.patch b/patches/soc/ti/pocketbeagle/0002-am335x-pocketbeagle.dts-microSD-mcasp0_aclkr.mmc0_sd.patch index 7887c0ef9..3118f5cf3 100644 --- a/patches/soc/ti/pocketbeagle/0002-am335x-pocketbeagle.dts-microSD-mcasp0_aclkr.mmc0_sd.patch +++ b/patches/soc/ti/pocketbeagle/0002-am335x-pocketbeagle.dts-microSD-mcasp0_aclkr.mmc0_sd.patch @@ -1,4 +1,4 @@ -From 0d5584ded05a764eb24e662790514a7084ac5e5a Mon Sep 17 00:00:00 2001 +From ada22f105592794ab69dc899293d5d6e8d30276c Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Mon, 18 Jun 2018 16:22:29 -0500 Subject: [PATCH 2/2] am335x-pocketbeagle.dts: microSD: mcasp0_aclkr.mmc0_sdwp @@ -10,7 +10,7 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> 1 file changed, 1 deletion(-) diff --git a/arch/arm/boot/dts/am335x-pocketbeagle.dts b/arch/arm/boot/dts/am335x-pocketbeagle.dts -index c5ffd7d8979d..0097faf21b72 100644 +index 8f4163cc1a07..9f4142c21ec6 100644 --- a/arch/arm/boot/dts/am335x-pocketbeagle.dts +++ b/arch/arm/boot/dts/am335x-pocketbeagle.dts @@ -88,7 +88,6 @@ @@ -22,5 +22,5 @@ index c5ffd7d8979d..0097faf21b72 100644 }; -- -2.17.1 +2.20.1 diff --git a/patches/soc/ti/uboot/0001-add-am335x-boneblack-uboot.dts.patch b/patches/soc/ti/uboot/0001-add-am335x-boneblack-uboot.dts.patch index e47015543..110c44373 100644 --- a/patches/soc/ti/uboot/0001-add-am335x-boneblack-uboot.dts.patch +++ b/patches/soc/ti/uboot/0001-add-am335x-boneblack-uboot.dts.patch @@ -1,4 +1,4 @@ -From 53eeb2d6dbb4016694283a212727ab2c5b9287f1 Mon Sep 17 00:00:00 2001 +From 83bd5aa634cb5ee51e9b7d21e7aaa7e57d81d765 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Wed, 20 Sep 2017 11:40:43 -0500 Subject: [PATCH 1/2] add: am335x-boneblack-uboot.dts @@ -53,5 +53,5 @@ index 000000000000..738fa396855b + vmmc-supply = <&vmmcsd_fixed>; +}; -- -2.19.2 +2.20.1 diff --git a/patches/soc/ti/uboot/0002-uboot-cape-universal-enablement.patch b/patches/soc/ti/uboot/0002-uboot-cape-universal-enablement.patch index 34e8749bb..d5c5ca25a 100644 --- a/patches/soc/ti/uboot/0002-uboot-cape-universal-enablement.patch +++ b/patches/soc/ti/uboot/0002-uboot-cape-universal-enablement.patch @@ -1,16 +1,16 @@ -From 9621109ba4fac93ba2bc98479511397da9ed7545 Mon Sep 17 00:00:00 2001 +From 1f3ca2d5b0349caedb548198417945c6db9d96c0 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Mon, 22 Oct 2018 11:04:45 -0500 Subject: [PATCH 2/2] uboot: cape-universal enablement Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- - .../arm/boot/dts/am335x-bone-common-univ.dtsi | 2919 +++++++++++++++++ + .../arm/boot/dts/am335x-bone-common-univ.dtsi | 2923 +++++++++++++++++ arch/arm/boot/dts/am335x-bone-uboot-univ.dts | 27 + .../boot/dts/am335x-boneblack-uboot-univ.dts | 38 + - ...am335x-bonegreen-wireless-common-univ.dtsi | 2793 ++++++++++++++++ + ...am335x-bonegreen-wireless-common-univ.dtsi | 2797 ++++++++++++++++ .../am335x-bonegreen-wireless-uboot-univ.dts | 53 + - 5 files changed, 5830 insertions(+) + 5 files changed, 5838 insertions(+) create mode 100644 arch/arm/boot/dts/am335x-bone-common-univ.dtsi create mode 100644 arch/arm/boot/dts/am335x-bone-uboot-univ.dts create mode 100644 arch/arm/boot/dts/am335x-boneblack-uboot-univ.dts @@ -19,10 +19,10 @@ Signed-off-by: Robert Nelson <robertcnelson@gmail.com> diff --git a/arch/arm/boot/dts/am335x-bone-common-univ.dtsi b/arch/arm/boot/dts/am335x-bone-common-univ.dtsi new file mode 100644 -index 000000000000..cdc9a971f717 +index 000000000000..037683957292 --- /dev/null +++ b/arch/arm/boot/dts/am335x-bone-common-univ.dtsi -@@ -0,0 +1,2919 @@ +@@ -0,0 +1,2923 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * @@ -1365,6 +1365,7 @@ index 000000000000..cdc9a971f717 + #size-cells = <0>; + + compatible = "spidev"; ++ symlink = "spi/0.0"; + + reg = <0>; + spi-max-frequency = <16000000>; @@ -1376,6 +1377,7 @@ index 000000000000..cdc9a971f717 + #size-cells = <0>; + + compatible = "spidev"; ++ symlink = "spi/0.1"; + + reg = <1>; + spi-max-frequency = <16000000>; @@ -1392,6 +1394,7 @@ index 000000000000..cdc9a971f717 + #size-cells = <0>; + + compatible = "spidev"; ++ symlink = "spi/1.0"; + + reg = <0>; + spi-max-frequency = <16000000>; @@ -1403,6 +1406,7 @@ index 000000000000..cdc9a971f717 + #size-cells = <0>; + + compatible = "spidev"; ++ symlink = "spi/1.1"; + + reg = <1>; + spi-max-frequency = <16000000>; @@ -3021,10 +3025,10 @@ index 000000000000..7b4bf9641b26 +}; diff --git a/arch/arm/boot/dts/am335x-bonegreen-wireless-common-univ.dtsi b/arch/arm/boot/dts/am335x-bonegreen-wireless-common-univ.dtsi new file mode 100644 -index 000000000000..ae2f79a78c3f +index 000000000000..455a8fa5f68b --- /dev/null +++ b/arch/arm/boot/dts/am335x-bonegreen-wireless-common-univ.dtsi -@@ -0,0 +1,2793 @@ +@@ -0,0 +1,2797 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * @@ -4315,6 +4319,7 @@ index 000000000000..ae2f79a78c3f + #size-cells = <0>; + + compatible = "spidev"; ++ symlink = "spi/0.0"; + + reg = <0>; + spi-max-frequency = <16000000>; @@ -4326,6 +4331,7 @@ index 000000000000..ae2f79a78c3f + #size-cells = <0>; + + compatible = "spidev"; ++ symlink = "spi/0.1"; + + reg = <1>; + spi-max-frequency = <16000000>; @@ -4342,6 +4348,7 @@ index 000000000000..ae2f79a78c3f + #size-cells = <0>; + + compatible = "spidev"; ++ symlink = "spi/1.0"; + + reg = <0>; + spi-max-frequency = <16000000>; @@ -4353,6 +4360,7 @@ index 000000000000..ae2f79a78c3f + #size-cells = <0>; + + compatible = "spidev"; ++ symlink = "spi/1.1"; + + reg = <1>; + spi-max-frequency = <16000000>; @@ -5878,5 +5886,5 @@ index 000000000000..5d87c70b45b3 + }; +}; -- -2.19.2 +2.20.1 diff --git a/scripts/gcc.sh b/scripts/gcc.sh index 33e02f423..e2bc6f739 100755 --- a/scripts/gcc.sh +++ b/scripts/gcc.sh @@ -44,7 +44,7 @@ dl_gcc_generic () { if [ ! -f "${gcc_dir}/${directory}/${datestamp}" ] ; then echo "Installing: ${toolchain_name}" echo "-----------------------------" - ${WGET} "${site}/${version}/${filename}" || ${WGET} "${archive_site}/${version}/${filename}" + ${WGET} "${site}/${version}${subdir}/${filename}" || ${WGET} "${archive_site}/${version}${subdir}/${filename}" if [ -d "${gcc_dir}/${directory}" ] ; then rm -rf "${gcc_dir}/${directory}" || true fi @@ -63,6 +63,7 @@ dl_gcc_generic () { } gcc_toolchain () { + subdir="" site="https://releases.linaro.org" archive_site="https://releases.linaro.org/archive" case "${toolchain}" in @@ -331,18 +332,20 @@ gcc_toolchain () { #https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2018.08/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf.tar.xz #https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2018.11/gcc-arm-8.2-2018.11-x86_64-arm-linux-gnueabihf.tar.xz #https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2019.01/gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf.tar.xz + #https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz # site="https://developer.arm.com/-/media/Files/downloads/gnu-a" archive_site="https://developer.arm.com/-/media/Files/downloads/gnu-a" - gcc_version="8.2" + gcc_version="8.3" gcc_minor="" - release="19.01" + release="19.03" target="arm-linux-gnueabihf" version="${gcc_version}-20${release}" filename="gcc-arm-${gcc_version}${gcc_minor}-20${release}-x86_64-${target}.tar.xz" directory="gcc-arm-${gcc_version}${gcc_minor}-20${release}-x86_64-${target}" + subdir="/binrel" datestamp="${gcc_version}-20${release}-${target}" @@ -417,18 +420,20 @@ gcc_toolchain () { #https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2018.08/gcc-arm-8.2-2018.08-x86_64-aarch64-linux-gnu.tar.xz #https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2018.11/gcc-arm-8.2-2018.11-x86_64-aarch64-linux-gnu.tar.xz #https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2019.01/gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu.tar.xz + #https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz # site="https://developer.arm.com/-/media/Files/downloads/gnu-a" archive_site="https://developer.arm.com/-/media/Files/downloads/gnu-a" - gcc_version="8.2" + gcc_version="8.3" gcc_minor="" - release="19.01" + release="19.03" target="aarch64-linux-gnu" version="${gcc_version}-20${release}" filename="gcc-arm-${gcc_version}${gcc_minor}-20${release}-x86_64-${target}.tar.xz" directory="gcc-arm-${gcc_version}${gcc_minor}-20${release}-x86_64-${target}" + subdir="/binrel" datestamp="${gcc_version}-20${release}-${target}" diff --git a/tools/host_det.sh b/tools/host_det.sh index 8d7eb4da1..882482fd7 100755 --- a/tools/host_det.sh +++ b/tools/host_det.sh @@ -393,6 +393,11 @@ debian_regs () { #https://blog.linuxmint.com/?p=3671 deb_distro="bionic" ;; + tina) + #19.2 + #https://blog.linuxmint.com/?p=3736 + deb_distro="bionic" + ;; esac #Future Debian Code names: @@ -426,7 +431,7 @@ debian_regs () { ;; bionic|cosmic) #18.04 bionic: (EOL: April 2023) lts: bionic -> xyz - #18.10 cosmic: (EOL: ) + #18.10 cosmic: (EOL: July 2019) unset warn_eol_distro ;; yakkety|zesty|artful) diff --git a/version.sh b/version.sh index 0f16981db..0be340e17 100644 --- a/version.sh +++ b/version.sh @@ -35,7 +35,7 @@ KERNEL_REL=5.1 KERNEL_TAG=${KERNEL_REL}-rc3 kernel_rt=".X-rtY" #Kernel Build -BUILD=${build_prefix}0 +BUILD=${build_prefix}0.1 #v5.X-rcX + upto SHA #prev_KERNEL_SHA="" -- GitLab