brcm63xx: remove kernel 4.9 support
authorKoen Vandeputte <koen.vandeputte@ncentric.com>
Mon, 6 May 2019 12:58:43 +0000 (14:58 +0200)
committerKoen Vandeputte <koen.vandeputte@ncentric.com>
Mon, 13 May 2019 17:17:41 +0000 (19:17 +0200)
This target got bumped to 4.14 a long time ago
in commit: 2308b87204206d84b6bf3dbc3d72591611cc6b78

Remove all leftover 4.9 files.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
204 files changed:
target/linux/brcm63xx/config-4.9 [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.12-01-spi-bcm63xx-make-spi-subsystem-aware-of-message-size.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.12-02-spi-bcm63xx-document-device-tree-bindings.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.12-03-spi-bcm63xx-add-support-for-probing-through-devicetr.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.12-04-spi-bcm63xx-hsspi-allow-providing-clock-rate-through.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.12-05-spi-bcm63xx-hsspi-document-device-tree-bindings.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.12-06-spi-bcm63xx-hsspi-add-support-for-probing-through-de.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.16-01-bcm63xx_enet-just-use-enet-as-the-clock-name.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.16-03-bcm63xx_enet-remove-pointless-mac_id-check.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.16-04-bcm63xx_enet-use-platform-device-id-directly-for-mii.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch [deleted file]
target/linux/brcm63xx/patches-4.9/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch [deleted file]
target/linux/brcm63xx/patches-4.9/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch [deleted file]
target/linux/brcm63xx/patches-4.9/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch [deleted file]
target/linux/brcm63xx/patches-4.9/102-MIPS-BCM63XX-move-code-touching-the-USB-private-regi.patch [deleted file]
target/linux/brcm63xx/patches-4.9/103-MIPS-BCM63XX-add-OHCI-EHCI-configuration-bits-to-com.patch [deleted file]
target/linux/brcm63xx/patches-4.9/104-MIPS-BCM63XX-introduce-BCM63XX_OHCI-configuration-sy.patch [deleted file]
target/linux/brcm63xx/patches-4.9/105-MIPS-BCM63XX-add-support-for-the-on-chip-OHCI-contro.patch [deleted file]
target/linux/brcm63xx/patches-4.9/106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch [deleted file]
target/linux/brcm63xx/patches-4.9/107-MIPS-BCM63XX-introduce-BCM63XX_EHCI-configuration-sy.patch [deleted file]
target/linux/brcm63xx/patches-4.9/108-MIPS-BCM63XX-add-support-for-the-on-chip-EHCI-contro.patch [deleted file]
target/linux/brcm63xx/patches-4.9/109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch [deleted file]
target/linux/brcm63xx/patches-4.9/110-MIPS-BCM63XX-EHCI-controller-does-not-support-overcu.patch [deleted file]
target/linux/brcm63xx/patches-4.9/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch [deleted file]
target/linux/brcm63xx/patches-4.9/121-mtd-bcm63xxpart-move-imagetag-parsing-to-its-own-par.patch [deleted file]
target/linux/brcm63xx/patches-4.9/122-mtd-bcm63xxpart-add-of_match_table.patch [deleted file]
target/linux/brcm63xx/patches-4.9/123-mtd-parser_bcm63xx_imagetag-add-of_match_table-suppo.patch [deleted file]
target/linux/brcm63xx/patches-4.9/130-pinctrl-add-bcm63xx-base-code.patch [deleted file]
target/linux/brcm63xx/patches-4.9/131-Documentation-add-BCM6328-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.9/132-pinctrl-add-a-pincontrol-driver-for-BCM6328.patch [deleted file]
target/linux/brcm63xx/patches-4.9/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.9/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch [deleted file]
target/linux/brcm63xx/patches-4.9/135-Documentation-add-BCM6358-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.9/136-pinctrl-add-a-pincontrol-driver-for-BCM6358.patch [deleted file]
target/linux/brcm63xx/patches-4.9/137-Documentation-add-BCM6362-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.9/138-pinctrl-add-a-pincontrol-driver-for-BCM6362.patch [deleted file]
target/linux/brcm63xx/patches-4.9/139-Documentation-add-BCM6368-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.9/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch [deleted file]
target/linux/brcm63xx/patches-4.9/141-Documentation-add-BCM63268-pincontroller-binding-doc.patch [deleted file]
target/linux/brcm63xx/patches-4.9/142-pinctrl-add-a-pincontrol-driver-for-BCM63268.patch [deleted file]
target/linux/brcm63xx/patches-4.9/143-gpio-fix-device-tree-gpio-hogs-on-dual-role-gpio-pin.patch [deleted file]
target/linux/brcm63xx/patches-4.9/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch [deleted file]
target/linux/brcm63xx/patches-4.9/207-MIPS-BCM63XX-move-device-registration-code-into-its-.patch [deleted file]
target/linux/brcm63xx/patches-4.9/208-MIPS-BCM63XX-pass-a-mac-addresss-allocator-to-board-.patch [deleted file]
target/linux/brcm63xx/patches-4.9/309-cfe_version_mod.patch [deleted file]
target/linux/brcm63xx/patches-4.9/310-cfe_simplify_detection.patch [deleted file]
target/linux/brcm63xx/patches-4.9/311-bcm63xxpart_use_cfedetection.patch [deleted file]
target/linux/brcm63xx/patches-4.9/320-irqchip-add-support-for-bcm6345-style-periphery-irq-.patch [deleted file]
target/linux/brcm63xx/patches-4.9/321-irqchip-add-support-for-bcm6345-style-external-inter.patch [deleted file]
target/linux/brcm63xx/patches-4.9/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch [deleted file]
target/linux/brcm63xx/patches-4.9/323-MIPS-BCM63XX-wire-up-BCM6358-s-external-interrupts-4.patch [deleted file]
target/linux/brcm63xx/patches-4.9/330-MIPS-BCM63XX-add-a-new-cpu-variant-helper.patch [deleted file]
target/linux/brcm63xx/patches-4.9/331-MIPS-BCM63XX-define-variant-id-field.patch [deleted file]
target/linux/brcm63xx/patches-4.9/332-MIPS-BCM63XX-detect-BCM6328-variants.patch [deleted file]
target/linux/brcm63xx/patches-4.9/333-MIPS-BCM63XX-detect-BCM6362-variants.patch [deleted file]
target/linux/brcm63xx/patches-4.9/334-MIPS-BCM63XX-detect-BCM6368-variants.patch [deleted file]
target/linux/brcm63xx/patches-4.9/335-MIPS-BCM63XX-fix-PCIe-memory-window-size.patch [deleted file]
target/linux/brcm63xx/patches-4.9/336-MIPS-BCM63XX-dynamically-set-the-pcie-memory-windows.patch [deleted file]
target/linux/brcm63xx/patches-4.9/337-MIPS-BCM63XX-widen-cpuid-field.patch [deleted file]
target/linux/brcm63xx/patches-4.9/338-MIPS-BCM63XX-increase-number-of-IRQs.patch [deleted file]
target/linux/brcm63xx/patches-4.9/339-MIPS-BCM63XX-add-support-for-BCM63268.patch [deleted file]
target/linux/brcm63xx/patches-4.9/340-MIPS-BCM63XX-add-pcie-support-for-BCM63268.patch [deleted file]
target/linux/brcm63xx/patches-4.9/341-MIPS-BCM63XX-add-support-for-BCM6318.patch [deleted file]
target/linux/brcm63xx/patches-4.9/342-MIPS-BCM63XX-split-PCIe-reset-signals.patch [deleted file]
target/linux/brcm63xx/patches-4.9/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch [deleted file]
target/linux/brcm63xx/patches-4.9/344-MIPS-BCM63XX-detect-flash-type-early-and-store-the-r.patch [deleted file]
target/linux/brcm63xx/patches-4.9/345-MIPS-BCM63XX-fixup-mapped-SPI-flash-access-on-boot.patch [deleted file]
target/linux/brcm63xx/patches-4.9/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch [deleted file]
target/linux/brcm63xx/patches-4.9/347-MIPS-BCM6318-USB-support.patch [deleted file]
target/linux/brcm63xx/patches-4.9/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch [deleted file]
target/linux/brcm63xx/patches-4.9/349-MIPS-BCM63XX-add-BCM63268-USB-support.patch [deleted file]
target/linux/brcm63xx/patches-4.9/350-MIPS-BCM63XX-support-settings-num-usbh-ports.patch [deleted file]
target/linux/brcm63xx/patches-4.9/351-set-board-usbh-ports.patch [deleted file]
target/linux/brcm63xx/patches-4.9/354-MIPS-BCM63XX-allow-building-support-for-more-than-on.patch [deleted file]
target/linux/brcm63xx/patches-4.9/355-MIPS-BCM63XX-allow-board-implementations-to-force-fl.patch [deleted file]
target/linux/brcm63xx/patches-4.9/356-MIPS-BCM63XX-move-fallback-sprom-support-into-its-ow.patch [deleted file]
target/linux/brcm63xx/patches-4.9/357-MIPS-BCM63XX-use-platform-data-for-the-sprom.patch [deleted file]
target/linux/brcm63xx/patches-4.9/358-MIPS-BCM63XX-make-fallback-sprom-optional.patch [deleted file]
target/linux/brcm63xx/patches-4.9/359-MIPS-BCM63XX-allow-different-types-of-sprom.patch [deleted file]
target/linux/brcm63xx/patches-4.9/360-MIPS-BCM63XX-add-support-for-raw-sproms.patch [deleted file]
target/linux/brcm63xx/patches-4.9/361-MIPS-BCM63XX-add-raw-fallback-sproms-for-most-common.patch [deleted file]
target/linux/brcm63xx/patches-4.9/362-MIPS-BCM63XX-also-register-a-fallback-sprom-for-bcma.patch [deleted file]
target/linux/brcm63xx/patches-4.9/363-MIPS-BCM63XX-add-BCMA-based-sprom-templates.patch [deleted file]
target/linux/brcm63xx/patches-4.9/364-MIPS-BCM63XX-allow-board-files-to-provide-sprom-fixu.patch [deleted file]
target/linux/brcm63xx/patches-4.9/365-MIPS-BCM63XX-allow-setting-a-pci-bus-device-for-fall.patch [deleted file]
target/linux/brcm63xx/patches-4.9/367-MIPS-BCM63XX-add-support-for-loading-DTB.patch [deleted file]
target/linux/brcm63xx/patches-4.9/368-MIPS-BCM63XX-add-support-for-matching-the-board_info.patch [deleted file]
target/linux/brcm63xx/patches-4.9/369-MIPS-BCM63XX-populate-the-compatible-to-board_info-l.patch [deleted file]
target/linux/brcm63xx/patches-4.9/371_add_of_node_available_by_alias.patch [deleted file]
target/linux/brcm63xx/patches-4.9/372_dont_register_pflash_when_available_in_dtb.patch [deleted file]
target/linux/brcm63xx/patches-4.9/373-MIPS-BCM63XX-register-interrupt-controllers-through-.patch [deleted file]
target/linux/brcm63xx/patches-4.9/374-gpio-add-a-simple-GPIO-driver-for-bcm63xx.patch [deleted file]
target/linux/brcm63xx/patches-4.9/375-MIPS-BCM63XX-switch-to-new-gpio-driver.patch [deleted file]
target/linux/brcm63xx/patches-4.9/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch [deleted file]
target/linux/brcm63xx/patches-4.9/378-MIPS-BCM63XX-do-not-register-gpio-controller-if-pres.patch [deleted file]
target/linux/brcm63xx/patches-4.9/379-MIPS-BCM63XX-provide-a-gpio-lookup-for-the-pcmcia-re.patch [deleted file]
target/linux/brcm63xx/patches-4.9/380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch [deleted file]
target/linux/brcm63xx/patches-4.9/381-Documentation-add-BCM6318-pincontroller-binding-docu.patch [deleted file]
target/linux/brcm63xx/patches-4.9/382-pinctrl-add-a-pincontrol-driver-for-BCM6318.patch [deleted file]
target/linux/brcm63xx/patches-4.9/383-bcm63xx_select_pinctrl.patch [deleted file]
target/linux/brcm63xx/patches-4.9/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch [deleted file]
target/linux/brcm63xx/patches-4.9/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch [deleted file]
target/linux/brcm63xx/patches-4.9/391-MIPS-BCM63XX-do-not-register-uart.patch [deleted file]
target/linux/brcm63xx/patches-4.9/392-MIPS-BCM63XX-remove-leds-and-buttons.patch [deleted file]
target/linux/brcm63xx/patches-4.9/400-bcm963xx_flashmap.patch [deleted file]
target/linux/brcm63xx/patches-4.9/401-bcm963xx_real_rootfs_length.patch [deleted file]
target/linux/brcm63xx/patches-4.9/402_bcm63xx_enet_vlan_incoming_fixed.patch [deleted file]
target/linux/brcm63xx/patches-4.9/403-6358-enet1-external-mii-clk.patch [deleted file]
target/linux/brcm63xx/patches-4.9/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch [deleted file]
target/linux/brcm63xx/patches-4.9/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch [deleted file]
target/linux/brcm63xx/patches-4.9/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch [deleted file]
target/linux/brcm63xx/patches-4.9/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch [deleted file]
target/linux/brcm63xx/patches-4.9/415-MIPS-BCM63XX-export-the-attached-flash-type.patch [deleted file]
target/linux/brcm63xx/patches-4.9/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch [deleted file]
target/linux/brcm63xx/patches-4.9/420-BCM63XX-add-endian-check-for-ath9k.patch [deleted file]
target/linux/brcm63xx/patches-4.9/421-BCM63XX-add-led-pin-for-ath9k.patch [deleted file]
target/linux/brcm63xx/patches-4.9/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch [deleted file]
target/linux/brcm63xx/patches-4.9/423-bcm63xx_enet_add_b53_support.patch [deleted file]
target/linux/brcm63xx/patches-4.9/424-bcm63xx_enet_no_request_mem_region.patch [deleted file]
target/linux/brcm63xx/patches-4.9/427-boards_probe_switch.patch [deleted file]
target/linux/brcm63xx/patches-4.9/499-allow_better_context_for_board_patches.patch [deleted file]
target/linux/brcm63xx/patches-4.9/500-board-D4PW.patch [deleted file]
target/linux/brcm63xx/patches-4.9/501-board-NB4.patch [deleted file]
target/linux/brcm63xx/patches-4.9/502-board-96338W2_E7T.patch [deleted file]
target/linux/brcm63xx/patches-4.9/503-board-CPVA642.patch [deleted file]
target/linux/brcm63xx/patches-4.9/504-board_dsl_274xb_rev_c.patch [deleted file]
target/linux/brcm63xx/patches-4.9/505-board_spw500v.patch [deleted file]
target/linux/brcm63xx/patches-4.9/506-board_gw6200_gw6000.patch [deleted file]
target/linux/brcm63xx/patches-4.9/507-board-MAGIC.patch [deleted file]
target/linux/brcm63xx/patches-4.9/508-board_hw553.patch [deleted file]
target/linux/brcm63xx/patches-4.9/509-board_rta1320_16m.patch [deleted file]
target/linux/brcm63xx/patches-4.9/510-board_spw303v.patch [deleted file]
target/linux/brcm63xx/patches-4.9/511-board_V2500V.patch [deleted file]
target/linux/brcm63xx/patches-4.9/512-board_BTV2110.patch [deleted file]
target/linux/brcm63xx/patches-4.9/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch [deleted file]
target/linux/brcm63xx/patches-4.9/514-board_ct536_ct5621.patch [deleted file]
target/linux/brcm63xx/patches-4.9/515-board_DWV-S0_fixes.patch [deleted file]
target/linux/brcm63xx/patches-4.9/516-board_96348A-122.patch [deleted file]
target/linux/brcm63xx/patches-4.9/519_board_CPVA502plus.patch [deleted file]
target/linux/brcm63xx/patches-4.9/520-bcm63xx-add-support-for-96368MVWG-board.patch [deleted file]
target/linux/brcm63xx/patches-4.9/521-bcm63xx-add-support-for-96368MVNgr-board.patch [deleted file]
target/linux/brcm63xx/patches-4.9/522-MIPS-BCM63XX-add-96328avng-reference-board.patch [deleted file]
target/linux/brcm63xx/patches-4.9/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch [deleted file]
target/linux/brcm63xx/patches-4.9/524-board_dsl_274xb_rev_f.patch [deleted file]
target/linux/brcm63xx/patches-4.9/525-board_96348w3.patch [deleted file]
target/linux/brcm63xx/patches-4.9/526-board_CT6373-1.patch [deleted file]
target/linux/brcm63xx/patches-4.9/527-board_dva-g3810bn-tl-1.patch [deleted file]
target/linux/brcm63xx/patches-4.9/528-board_nb6.patch [deleted file]
target/linux/brcm63xx/patches-4.9/529-board_fast2604.patch [deleted file]
target/linux/brcm63xx/patches-4.9/530-board_A4001N1.patch [deleted file]
target/linux/brcm63xx/patches-4.9/531-board_AR-5387un.patch [deleted file]
target/linux/brcm63xx/patches-4.9/532-board_AR-5381u.patch [deleted file]
target/linux/brcm63xx/patches-4.9/533-board_rta770bw.patch [deleted file]
target/linux/brcm63xx/patches-4.9/534-board_hw556.patch [deleted file]
target/linux/brcm63xx/patches-4.9/535-board_rta770w.patch [deleted file]
target/linux/brcm63xx/patches-4.9/536-board_fast2704.patch [deleted file]
target/linux/brcm63xx/patches-4.9/537-board_fast2504n.patch [deleted file]
target/linux/brcm63xx/patches-4.9/555-board_96318ref.patch [deleted file]
target/linux/brcm63xx/patches-4.9/556-board_96318ref_p300.patch [deleted file]
target/linux/brcm63xx/patches-4.9/557-board_bcm963269bhr.patch [deleted file]
target/linux/brcm63xx/patches-4.9/558-board_AR1004G.patch [deleted file]
target/linux/brcm63xx/patches-4.9/559-board_vw6339gu.patch [deleted file]
target/linux/brcm63xx/patches-4.9/560-board_963268gu_p300.patch [deleted file]
target/linux/brcm63xx/patches-4.9/561-board_WAP-5813n.patch [deleted file]
target/linux/brcm63xx/patches-4.9/562-board_VR-3025u.patch [deleted file]
target/linux/brcm63xx/patches-4.9/563-board_VR-3025un.patch [deleted file]
target/linux/brcm63xx/patches-4.9/564-board_P870HW-51a_v2.patch [deleted file]
target/linux/brcm63xx/patches-4.9/565-board_hw520.patch [deleted file]
target/linux/brcm63xx/patches-4.9/566-board_A4001N.patch [deleted file]
target/linux/brcm63xx/patches-4.9/567-board_dsl-2751b_e1.patch [deleted file]
target/linux/brcm63xx/patches-4.9/568-board_DGND3700v1_3800B.patch [deleted file]
target/linux/brcm63xx/patches-4.9/569-board_homehub2a.patch [deleted file]
target/linux/brcm63xx/patches-4.9/570-board_HG655b.patch [deleted file]
target/linux/brcm63xx/patches-4.9/571-board_fast2704n.patch [deleted file]
target/linux/brcm63xx/patches-4.9/572-board_VR-3026e.patch [deleted file]
target/linux/brcm63xx/patches-4.9/573-board_R5010UNv2.patch [deleted file]
target/linux/brcm63xx/patches-4.9/574-board_HG622.patch [deleted file]
target/linux/brcm63xx/patches-4.9/575-board_EVG2000.patch [deleted file]
target/linux/brcm63xx/patches-4.9/576-board_AV4202N.patch [deleted file]
target/linux/brcm63xx/patches-4.9/577-board_VH4032N.patch [deleted file]
target/linux/brcm63xx/patches-4.9/578-board_R1000H.patch [deleted file]
target/linux/brcm63xx/patches-4.9/579-board_AR-5315u.patch [deleted file]
target/linux/brcm63xx/patches-4.9/580-board_AD1018.patch [deleted file]
target/linux/brcm63xx/patches-4.9/598-board_sr102.patch [deleted file]
target/linux/brcm63xx/patches-4.9/800-wl_exports.patch [deleted file]
target/linux/brcm63xx/patches-4.9/801-ssb_export_fallback_sprom.patch [deleted file]
target/linux/brcm63xx/patches-4.9/802-rtl8367r_fix_RGMII_support.patch [deleted file]
target/linux/brcm63xx/patches-4.9/803-jffs2-work-around-unaligned-accesses-failing-on-bcm6.patch [deleted file]
target/linux/brcm63xx/patches-4.9/804-bcm63xx_enet_63268_rgmii_ports.patch [deleted file]

diff --git a/target/linux/brcm63xx/config-4.9 b/target/linux/brcm63xx/config-4.9
deleted file mode 100644 (file)
index f1c3471..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-CONFIG_ARCH_BINFMT_ELF_STATE=y
-CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_DISCARD_MEMBLOCK=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set
-# CONFIG_ARCH_HAS_SG_CHAIN is not set
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_BCM6345_EXT_IRQ=y
-CONFIG_BCM6345_PERIPH_IRQ=y
-CONFIG_BCM63XX=y
-CONFIG_BCM63XX_CPU_3368=y
-CONFIG_BCM63XX_CPU_6318=y
-CONFIG_BCM63XX_CPU_63268=y
-CONFIG_BCM63XX_CPU_6328=y
-CONFIG_BCM63XX_CPU_6338=y
-CONFIG_BCM63XX_CPU_6345=y
-CONFIG_BCM63XX_CPU_6348=y
-CONFIG_BCM63XX_CPU_6358=y
-CONFIG_BCM63XX_CPU_6362=y
-CONFIG_BCM63XX_CPU_6368=y
-CONFIG_BCM63XX_EHCI=y
-CONFIG_BCM63XX_ENET=y
-CONFIG_BCM63XX_OHCI=y
-CONFIG_BCM63XX_PHY=y
-CONFIG_BCM63XX_WDT=y
-CONFIG_BCMA=y
-CONFIG_BCMA_BLOCKIO=y
-# CONFIG_BCMA_DEBUG is not set
-# CONFIG_BCMA_DRIVER_GMAC_CMN is not set
-# CONFIG_BCMA_DRIVER_MIPS is not set
-CONFIG_BCMA_DRIVER_PCI=y
-# CONFIG_BCMA_DRIVER_PCI_HOSTMODE is not set
-CONFIG_BCMA_HOST_PCI=y
-CONFIG_BCMA_HOST_PCI_POSSIBLE=y
-# CONFIG_BCMA_HOST_SOC is not set
-CONFIG_BCM_NET_PHYLIB=y
-CONFIG_BLK_MQ_PCI=y
-CONFIG_BOARD_BCM63XX_DT=y
-CONFIG_BOARD_BCM963XX=y
-CONFIG_BOARD_LIVEBOX=y
-CONFIG_CEVT_R4K=y
-CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_CPU_BIG_ENDIAN=y
-CONFIG_CPU_BMIPS=y
-CONFIG_CPU_BMIPS32_3300=y
-CONFIG_CPU_BMIPS4350=y
-CONFIG_CPU_GENERIC_DUMP_TLB=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
-CONFIG_CPU_R4K_CACHE_TLB=y
-CONFIG_CPU_R4K_FPU=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_WORKQUEUE=y
-CONFIG_CSRC_R4K=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_DTC=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_FIRMWARE_IN_KERNEL=y
-CONFIG_FIXED_PHY=y
-CONFIG_GENERIC_ATOMIC64=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_CHIP=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_PCI_IOMAP=y
-CONFIG_GENERIC_PINCONF=y
-CONFIG_GENERIC_SCHED_CLOCK=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-CONFIG_GENERIC_TIME_VSYSCALL=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_BCM63XX=y
-CONFIG_GPIO_GENERIC=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_HANDLE_DOMAIN_IRQ=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT_MAP=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-# CONFIG_HAVE_ARCH_BITREVERSE is not set
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_CBPF_JIT=y
-CONFIG_HAVE_CC_STACKPROTECTOR=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_LATENCYTOP_SUPPORT=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
-CONFIG_HW_HAS_PCI=y
-CONFIG_HW_RANDOM=y
-CONFIG_HW_RANDOM_BCM63XX=y
-CONFIG_HZ=250
-# CONFIG_HZ_100 is not set
-CONFIG_HZ_250=y
-CONFIG_HZ_PERIODIC=y
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_IRQ_MIPS_CPU=y
-CONFIG_IRQ_WORK=y
-CONFIG_KEXEC=y
-CONFIG_KEXEC_CORE=y
-CONFIG_LEDS_BCM6328=y
-CONFIG_LEDS_BCM6358=y
-CONFIG_LEDS_GPIO=y
-CONFIG_LIBFDT=y
-CONFIG_MDIO_BOARDINFO=y
-CONFIG_MFD_SYSCON=y
-CONFIG_MIPS=y
-CONFIG_MIPS_ASID_BITS=8
-CONFIG_MIPS_ASID_SHIFT=0
-CONFIG_MIPS_CLOCK_VSYSCALL=y
-# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set
-# CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set
-CONFIG_MIPS_CMDLINE_FROM_DTB=y
-# CONFIG_MIPS_ELF_APPENDED_DTB is not set
-# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=4
-CONFIG_MIPS_L1_CACHE_SHIFT_4=y
-# CONFIG_MIPS_MACHINE is not set
-# CONFIG_MIPS_NO_APPENDED_DTB is not set
-CONFIG_MIPS_RAW_APPENDED_DTB=y
-CONFIG_MODULES_USE_ELF_REL=y
-CONFIG_MODULE_FORCE_LOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MTD_BCM63XX_PARTS=y
-CONFIG_MTD_CFI_ADV_OPTIONS=y
-CONFIG_MTD_CFI_BE_BYTE_SWAP=y
-# CONFIG_MTD_CFI_GEOMETRY is not set
-# CONFIG_MTD_CFI_NOSWAP is not set
-CONFIG_MTD_CFI_STAA=y
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_M25P80=y
-CONFIG_MTD_PARSER_IMAGETAG=y
-CONFIG_MTD_PHYSMAP=y
-CONFIG_MTD_REDBOOT_PARTS=y
-CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
-CONFIG_MTD_SPI_NOR=y
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NEED_PER_CPU_KM=y
-CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
-# CONFIG_NO_IOPORT_MAP is not set
-CONFIG_OF=y
-CONFIG_OF_ADDRESS=y
-CONFIG_OF_ADDRESS_PCI=y
-CONFIG_OF_EARLY_FLATTREE=y
-CONFIG_OF_FLATTREE=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_IRQ=y
-CONFIG_OF_MDIO=y
-CONFIG_OF_NET=y
-CONFIG_OF_PCI=y
-CONFIG_OF_PCI_IRQ=y
-CONFIG_PCI=y
-# CONFIG_PCIEAER is not set
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCI_DOMAINS=y
-CONFIG_PCI_DRIVERS_LEGACY=y
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_PGTABLE_LEVELS=2
-CONFIG_PHYLIB=y
-CONFIG_PINCTRL=y
-CONFIG_PINCTRL_BCM6318=y
-CONFIG_PINCTRL_BCM63268=y
-CONFIG_PINCTRL_BCM6328=y
-CONFIG_PINCTRL_BCM6348=y
-CONFIG_PINCTRL_BCM6358=y
-CONFIG_PINCTRL_BCM6362=y
-CONFIG_PINCTRL_BCM6368=y
-CONFIG_PINCTRL_BCM63XX=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_POSIX_MQUEUE_SYSCTL=y
-# CONFIG_RCU_STALL_COMMON is not set
-CONFIG_REGMAP=y
-CONFIG_REGMAP_MMIO=y
-CONFIG_RELAY=y
-CONFIG_RTL8366_SMI=y
-CONFIG_RTL8367_PHY=y
-# CONFIG_SCHED_INFO is not set
-# CONFIG_SCSI_DMA is not set
-# CONFIG_SERIAL_8250 is not set
-CONFIG_SERIAL_BCM63XX=y
-CONFIG_SERIAL_BCM63XX_CONSOLE=y
-CONFIG_SPI=y
-CONFIG_SPI_BCM63XX=y
-CONFIG_SPI_BCM63XX_HSSPI=y
-CONFIG_SPI_MASTER=y
-CONFIG_SQUASHFS_EMBEDDED=y
-CONFIG_SRCU=y
-CONFIG_SSB=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
-CONFIG_SSB_BLOCKIO=y
-# CONFIG_SSB_DRIVER_MIPS is not set
-CONFIG_SSB_DRIVER_PCICORE=y
-CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_PCIHOST_POSSIBLE=y
-CONFIG_SSB_SPROM=y
-CONFIG_SWAP_IO_SPACE=y
-CONFIG_SWCONFIG=y
-CONFIG_SWCONFIG_B53=y
-CONFIG_SWCONFIG_B53_MMAP_DRIVER=y
-CONFIG_SWCONFIG_B53_PHY_DRIVER=y
-CONFIG_SWCONFIG_B53_PHY_FIXUP=y
-CONFIG_SWCONFIG_B53_SPI_DRIVER=y
-# CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set
-CONFIG_SWPHY=y
-CONFIG_SYNC_R4K=y
-CONFIG_SYSCTL_EXCEPTION_TRACE=y
-CONFIG_SYS_HAS_CPU_BMIPS=y
-CONFIG_SYS_HAS_CPU_BMIPS32_3300=y
-CONFIG_SYS_HAS_CPU_BMIPS4350=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
-CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y
-CONFIG_SYS_SUPPORTS_SMP=y
-CONFIG_TICK_CPU_ACCOUNTING=y
-CONFIG_USB_SUPPORT=y
-CONFIG_USE_OF=y
-CONFIG_VM_EVENT_COUNTERS=y
-CONFIG_WATCHDOG_NOWAYOUT=y
-CONFIG_WEAK_ORDERING=y
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.12-01-spi-bcm63xx-make-spi-subsystem-aware-of-message-size.patch b/target/linux/brcm63xx/patches-4.9/001-4.12-01-spi-bcm63xx-make-spi-subsystem-aware-of-message-size.patch
deleted file mode 100644 (file)
index f049af0..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-From 3fcc36962c32ad0af2d5904103e2b2b824b6b1aa Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sat, 4 Feb 2017 12:32:59 +0100
-Subject: [PATCH 2/8] spi/bcm63xx: make spi subsystem aware of message size
- limits
-
-The bcm63xx LS SPI controller does not allow manual control of the CS
-lines and will toggle it automatically before after sending data, so we
-are limited to messages that fit in the FIFO buffer. Since the CS lines
-aren't available as GPIOs either, we will need to make slave drivers
-aware of this limitation and handle it accordingly.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/spi/spi-bcm63xx.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
---- a/drivers/spi/spi-bcm63xx.c
-+++ b/drivers/spi/spi-bcm63xx.c
-@@ -428,6 +428,13 @@ static irqreturn_t bcm63xx_spi_interrupt
-       return IRQ_HANDLED;
- }
-+static size_t bcm63xx_spi_max_length(struct spi_device *spi)
-+{
-+      struct bcm63xx_spi *bs = spi_master_get_devdata(spi->master);
-+
-+      return bs->fifo_size;
-+}
-+
- static const unsigned long bcm6348_spi_reg_offsets[] = {
-       [SPI_CMD]               = SPI_6348_CMD,
-       [SPI_INT_STATUS]        = SPI_6348_INT_STATUS,
-@@ -541,6 +548,8 @@ static int bcm63xx_spi_probe(struct plat
-       master->transfer_one_message = bcm63xx_spi_transfer_one;
-       master->mode_bits = MODEBITS;
-       master->bits_per_word_mask = SPI_BPW_MASK(8);
-+      master->max_transfer_size = bcm63xx_spi_max_length;
-+      master->max_message_size = bcm63xx_spi_max_length;
-       master->auto_runtime_pm = true;
-       bs->msg_type_shift = bs->reg_offsets[SPI_MSG_TYPE_SHIFT];
-       bs->msg_ctl_width = bs->reg_offsets[SPI_MSG_CTL_WIDTH];
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.12-02-spi-bcm63xx-document-device-tree-bindings.patch b/target/linux/brcm63xx/patches-4.9/001-4.12-02-spi-bcm63xx-document-device-tree-bindings.patch
deleted file mode 100644 (file)
index 524c50e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-From 0a0c39044332a75eaf4a3c5654079df953b0d839 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jogo@openwrt.org>
-Date: Mon, 7 Sep 2015 21:00:38 +0200
-Subject: [PATCH 3/8] spi/bcm63xx: document device tree bindings
-
-Add documentation for the bindings of the low speed SPI controller found
-on most bcm63xx SoCs.
-
-Signed-off-by: Jonas Gorski <jogo@openwrt.org>
----
- .../devicetree/bindings/spi/spi-bcm63xx.txt        | 33 ++++++++++++++++++++++
- 1 file changed, 33 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/spi/spi-bcm63xx.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/spi/spi-bcm63xx.txt
-@@ -0,0 +1,33 @@
-+Binding for Broadcom BCM6348/BCM6358 SPI controller
-+
-+Required properties:
-+- compatible: must contain one of "brcm,bcm6348-spi", "brcm,bcm6358-spi".
-+- reg: Base address and size of the controllers memory area.
-+- interrupts: Interrupt for the SPI block.
-+- clocks: phandle of the SPI clock.
-+- clock-names: has to be "spi".
-+- #address-cells: <1>, as required by generic SPI binding.
-+- #size-cells: <0>, also as required by generic SPI binding.
-+
-+Optional properties:
-+- num-cs: some controllers have less than 8 cs signals. Defaults to 8
-+  if absent.
-+
-+Child nodes as per the generic SPI binding.
-+
-+Example:
-+
-+      spi@10000800 {
-+              compatible = "brcm,bcm6368-spi", "brcm,bcm6358-spi";
-+              reg = <0x10000800 0x70c>;
-+
-+              interrupts = <1>;
-+
-+              clocks = <&clkctl 9>;
-+              clock-names = "spi";
-+
-+              num-cs = <5>;
-+
-+              #address-cells = <1>;
-+              #size-cells = <0>;
-+      };
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.12-03-spi-bcm63xx-add-support-for-probing-through-devicetr.patch b/target/linux/brcm63xx/patches-4.9/001-4.12-03-spi-bcm63xx-add-support-for-probing-through-devicetr.patch
deleted file mode 100644 (file)
index 97c596a..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-From 3353228a04a004ec67073871f40cf58dc4e209aa Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Mon, 7 Sep 2015 21:01:38 +0200
-Subject: [PATCH 4/8] spi/bcm63xx: add support for probing through devicetree
-
-Add required binding support to probe through device tree.
-
-Use the compatible instead of the resource size for identifiying the
-block type, and allow reducing the number of cs lines through OF.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/spi/spi-bcm63xx.c | 42 ++++++++++++++++++++++++++++++++++++------
- 1 file changed, 36 insertions(+), 6 deletions(-)
-
---- a/drivers/spi/spi-bcm63xx.c
-+++ b/drivers/spi/spi-bcm63xx.c
-@@ -26,6 +26,7 @@
- #include <linux/completion.h>
- #include <linux/err.h>
- #include <linux/pm_runtime.h>
-+#include <linux/of.h>
- /* BCM 6338/6348 SPI core */
- #define SPI_6348_RSET_SIZE            64
-@@ -484,21 +485,48 @@ static const struct platform_device_id b
-       },
- };
-+static const struct of_device_id bcm63xx_spi_of_match[] = {
-+      { .compatible = "brcm,bcm6348-spi", .data = &bcm6348_spi_reg_offsets },
-+      { .compatible = "brcm,bcm6358-spi", .data = &bcm6358_spi_reg_offsets },
-+      { },
-+};
-+
- static int bcm63xx_spi_probe(struct platform_device *pdev)
- {
-       struct resource *r;
-       const unsigned long *bcm63xx_spireg;
-       struct device *dev = &pdev->dev;
--      int irq;
-+      int irq, bus_num;
-       struct spi_master *master;
-       struct clk *clk;
-       struct bcm63xx_spi *bs;
-       int ret;
-+      u32 num_cs = BCM63XX_SPI_MAX_CS;
--      if (!pdev->id_entry->driver_data)
--              return -EINVAL;
-+      if (dev->of_node) {
-+              const struct of_device_id *match;
--      bcm63xx_spireg = (const unsigned long *)pdev->id_entry->driver_data;
-+              match = of_match_node(bcm63xx_spi_of_match, dev->of_node);
-+              if (!match)
-+                      return -EINVAL;
-+              bcm63xx_spireg = match->data;
-+
-+              of_property_read_u32(dev->of_node, "num-cs", &num_cs);
-+              if (num_cs > BCM63XX_SPI_MAX_CS) {
-+                      dev_warn(dev, "unsupported number of cs (%i), reducing to 8\n",
-+                               num_cs);
-+                      num_cs = BCM63XX_SPI_MAX_CS;
-+              }
-+
-+              bus_num = -1;
-+      } else if (pdev->id_entry->driver_data) {
-+              const struct platform_device_id *match = pdev->id_entry;
-+
-+              bcm63xx_spireg = (const unsigned long *)match->driver_data;
-+              bus_num = BCM63XX_SPI_BUS_NUM;
-+      } else {
-+              return -EINVAL;
-+      }
-       irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-@@ -543,8 +571,9 @@ static int bcm63xx_spi_probe(struct plat
-               goto out_err;
-       }
--      master->bus_num = BCM63XX_SPI_BUS_NUM;
--      master->num_chipselect = BCM63XX_SPI_MAX_CS;
-+      master->dev.of_node = dev->of_node;
-+      master->bus_num = bus_num;
-+      master->num_chipselect = num_cs;
-       master->transfer_one_message = bcm63xx_spi_transfer_one;
-       master->mode_bits = MODEBITS;
-       master->bits_per_word_mask = SPI_BPW_MASK(8);
-@@ -633,6 +662,7 @@ static struct platform_driver bcm63xx_sp
-       .driver = {
-               .name   = "bcm63xx-spi",
-               .pm     = &bcm63xx_spi_pm_ops,
-+              .of_match_table = bcm63xx_spi_of_match,
-       },
-       .id_table       = bcm63xx_spi_dev_match,
-       .probe          = bcm63xx_spi_probe,
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.12-04-spi-bcm63xx-hsspi-allow-providing-clock-rate-through.patch b/target/linux/brcm63xx/patches-4.9/001-4.12-04-spi-bcm63xx-hsspi-allow-providing-clock-rate-through.patch
deleted file mode 100644 (file)
index 30e6734..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-From d03f23df6ff47898d76f06b3aa5dadcfa1ec8f4f Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 19 Feb 2017 23:40:22 +0100
-Subject: [PATCH 1/3] spi/bcm63xx-hsspi: allow providing clock rate through a
- second clock
-
-Instead of requiring the hsspi clock to have a rate, allow using a second
-clock for providing the Hz rate, which is probably more correct anyway.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/spi/spi-bcm63xx-hsspi.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
---- a/drivers/spi/spi-bcm63xx-hsspi.c
-+++ b/drivers/spi/spi-bcm63xx-hsspi.c
-@@ -351,8 +351,16 @@ static int bcm63xx_hsspi_probe(struct pl
-               return PTR_ERR(clk);
-       rate = clk_get_rate(clk);
--      if (!rate)
--              return -EINVAL;
-+      if (!rate) {
-+              struct clk *pll_clk = devm_clk_get(dev, "pll");
-+
-+              if (IS_ERR(pll_clk))
-+                      return PTR_ERR(pll_clk);
-+
-+              rate = clk_get_rate(pll_clk);
-+              if (!rate)
-+                      return -EINVAL;
-+      }
-       ret = clk_prepare_enable(clk);
-       if (ret)
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.12-05-spi-bcm63xx-hsspi-document-device-tree-bindings.patch b/target/linux/brcm63xx/patches-4.9/001-4.12-05-spi-bcm63xx-hsspi-document-device-tree-bindings.patch
deleted file mode 100644 (file)
index 8f77f4e..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From ff759cc25db31bbb3469abb16a0306f110c4c7fa Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Thu, 10 Sep 2015 14:52:32 +0200
-Subject: [PATCH 2/3] dt-bindings: spi: document bcm63xx HS SPI devicetree
- bindings
-
-Add documentation for the bindings of the high speed SPI controller found
-on newer bcm63xx SoCs.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- .../devicetree/bindings/spi/spi-bcm63xx-hsspi.txt  | 33 ++++++++++++++++++++++
- 1 file changed, 33 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/spi/spi-bcm63xx-hsspi.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/spi/spi-bcm63xx-hsspi.txt
-@@ -0,0 +1,33 @@
-+Binding for Broadcom BCM6328 High Speed SPI controller
-+
-+Required properties:
-+- compatible: must contain of "brcm,bcm6328-hsspi".
-+- reg: Base address and size of the controllers memory area.
-+- interrupts: Interrupt for the SPI block.
-+- clocks: phandles of the SPI clock and the PLL clock.
-+- clock-names: must be "hsspi", "pll".
-+- #address-cells: <1>, as required by generic SPI binding.
-+- #size-cells: <0>, also as required by generic SPI binding.
-+
-+Optional properties:
-+- num-cs: some controllers have less than 8 cs signals. Defaults to 8
-+  if absent.
-+
-+Child nodes as per the generic SPI binding.
-+
-+Example:
-+
-+      spi@10001000 {
-+              compatible = "brcm,bcm6328-hsspi";
-+              reg = <0x10001000 0x600>;
-+
-+              interrupts = <29>;
-+
-+              clocks = <&clkctl 9>, <&hsspi_pll>;
-+              clock-names = "hsspi", "pll";
-+
-+              num-cs = <2>;
-+
-+              #address-cells = <1>;
-+              #size-cells = <0>;
-+      };
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.12-06-spi-bcm63xx-hsspi-add-support-for-probing-through-de.patch b/target/linux/brcm63xx/patches-4.9/001-4.12-06-spi-bcm63xx-hsspi-add-support-for-probing-through-de.patch
deleted file mode 100644 (file)
index aaf4a59..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-From 776041498c2b285a7f745c924e10fc11ef720eae Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Thu, 10 Sep 2015 14:53:53 +0200
-Subject: [PATCH 3/3] spi/bcm63xx-hsspi: allow for probing through devicetree
-
-Add required binding support to probe through device tree.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/spi/spi-bcm63xx-hsspi.c | 23 ++++++++++++++++++++---
- 1 file changed, 20 insertions(+), 3 deletions(-)
-
---- a/drivers/spi/spi-bcm63xx-hsspi.c
-+++ b/drivers/spi/spi-bcm63xx-hsspi.c
-@@ -19,6 +19,7 @@
- #include <linux/interrupt.h>
- #include <linux/spi/spi.h>
- #include <linux/mutex.h>
-+#include <linux/of.h>
- #define HSSPI_GLOBAL_CTRL_REG                 0x0
- #define GLOBAL_CTRL_CS_POLARITY_SHIFT         0
-@@ -91,6 +92,7 @@
- #define HSSPI_MAX_SYNC_CLOCK                  30000000
-+#define HSSPI_SPI_MAX_CS                      8
- #define HSSPI_BUS_NUM                         1 /* 0 is legacy SPI */
- struct bcm63xx_hsspi {
-@@ -332,7 +334,7 @@ static int bcm63xx_hsspi_probe(struct pl
-       struct device *dev = &pdev->dev;
-       struct clk *clk;
-       int irq, ret;
--      u32 reg, rate;
-+      u32 reg, rate, num_cs = HSSPI_SPI_MAX_CS;
-       irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-@@ -382,8 +384,17 @@ static int bcm63xx_hsspi_probe(struct pl
-       mutex_init(&bs->bus_mutex);
-       init_completion(&bs->done);
--      master->bus_num = HSSPI_BUS_NUM;
--      master->num_chipselect = 8;
-+      master->dev.of_node = dev->of_node;
-+      if (!dev->of_node)
-+              master->bus_num = HSSPI_BUS_NUM;
-+
-+      of_property_read_u32(dev->of_node, "num-cs", &num_cs);
-+      if (num_cs > 8) {
-+              dev_warn(dev, "unsupported number of cs (%i), reducing to 8\n",
-+                       num_cs);
-+              num_cs = HSSPI_SPI_MAX_CS;
-+      }
-+      master->num_chipselect = num_cs;
-       master->setup = bcm63xx_hsspi_setup;
-       master->transfer_one_message = bcm63xx_hsspi_transfer_one;
-       master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH |
-@@ -469,10 +480,16 @@ static int bcm63xx_hsspi_resume(struct d
- static SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend,
-                        bcm63xx_hsspi_resume);
-+static const struct of_device_id bcm63xx_hsspi_of_match[] = {
-+      { .compatible = "brcm,bcm6328-hsspi", },
-+      { },
-+};
-+
- static struct platform_driver bcm63xx_hsspi_driver = {
-       .driver = {
-               .name   = "bcm63xx-hsspi",
-               .pm     = &bcm63xx_hsspi_pm_ops,
-+              .of_match_table = bcm63xx_hsspi_of_match,
-       },
-       .probe          = bcm63xx_hsspi_probe,
-       .remove         = bcm63xx_hsspi_remove,
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch b/target/linux/brcm63xx/patches-4.9/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch
deleted file mode 100644 (file)
index eb72f6a..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-From 69226896ad636b94f6d2e55d75ff21a29c4de83b Mon Sep 17 00:00:00 2001
-From: Roger Quadros <rogerq@ti.com>
-Date: Fri, 21 Apr 2017 16:15:38 +0300
-Subject: [PATCH] mdio_bus: Issue GPIO RESET to PHYs.
-
-Some boards [1] leave the PHYs at an invalid state
-during system power-up or reset thus causing unreliability
-issues with the PHY which manifests as PHY not being detected
-or link not functional. To fix this, these PHYs need to be RESET
-via a GPIO connected to the PHY's RESET pin.
-
-Some boards have a single GPIO controlling the PHY RESET pin of all
-PHYs on the bus whereas some others have separate GPIOs controlling
-individual PHY RESETs.
-
-In both cases, the RESET de-assertion cannot be done in the PHY driver
-as the PHY will not probe till its reset is de-asserted.
-So do the RESET de-assertion in the MDIO bus driver.
-
-[1] - am572x-idk, am571x-idk, a437x-idk
-
-Signed-off-by: Roger Quadros <rogerq@ti.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- Documentation/devicetree/bindings/net/mdio.txt | 33 ++++++++++++++++++
- drivers/net/phy/mdio_bus.c                     | 47 ++++++++++++++++++++++++++
- drivers/of/of_mdio.c                           |  7 ++++
- include/linux/phy.h                            |  7 ++++
- 4 files changed, 94 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/net/mdio.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/net/mdio.txt
-@@ -0,0 +1,33 @@
-+Common MDIO bus properties.
-+
-+These are generic properties that can apply to any MDIO bus.
-+
-+Optional properties:
-+- reset-gpios: List of one or more GPIOs that control the RESET lines
-+  of the PHYs on that MDIO bus.
-+- reset-delay-us: RESET pulse width in microseconds as per PHY datasheet.
-+
-+A list of child nodes, one per device on the bus is expected. These
-+should follow the generic phy.txt, or a device specific binding document.
-+
-+Example :
-+This example shows these optional properties, plus other properties
-+required for the TI Davinci MDIO driver.
-+
-+      davinci_mdio: ethernet@0x5c030000 {
-+              compatible = "ti,davinci_mdio";
-+              reg = <0x5c030000 0x1000>;
-+              #address-cells = <1>;
-+              #size-cells = <0>;
-+
-+              reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
-+              reset-delay-us = <2>;   /* PHY datasheet states 1us min */
-+
-+              ethphy0: ethernet-phy@1 {
-+                      reg = <1>;
-+              };
-+
-+              ethphy1: ethernet-phy@3 {
-+                      reg = <3>;
-+              };
-+      };
---- a/drivers/net/phy/mdio_bus.c
-+++ b/drivers/net/phy/mdio_bus.c
-@@ -22,8 +22,11 @@
- #include <linux/init.h>
- #include <linux/delay.h>
- #include <linux/device.h>
-+#include <linux/gpio.h>
-+#include <linux/gpio/consumer.h>
- #include <linux/of_device.h>
- #include <linux/of_mdio.h>
-+#include <linux/of_gpio.h>
- #include <linux/netdevice.h>
- #include <linux/etherdevice.h>
- #include <linux/skbuff.h>
-@@ -304,6 +307,7 @@ int __mdiobus_register(struct mii_bus *b
- {
-       struct mdio_device *mdiodev;
-       int i, err;
-+      struct gpio_desc *gpiod;
-       if (NULL == bus || NULL == bus->name ||
-           NULL == bus->read || NULL == bus->write)
-@@ -329,6 +333,35 @@ int __mdiobus_register(struct mii_bus *b
-       if (bus->reset)
-               bus->reset(bus);
-+      /* de-assert bus level PHY GPIO resets */
-+      if (bus->num_reset_gpios > 0) {
-+              bus->reset_gpiod = devm_kcalloc(&bus->dev,
-+                                               bus->num_reset_gpios,
-+                                               sizeof(struct gpio_desc *),
-+                                               GFP_KERNEL);
-+              if (!bus->reset_gpiod)
-+                      return -ENOMEM;
-+      }
-+
-+      for (i = 0; i < bus->num_reset_gpios; i++) {
-+              gpiod = devm_gpiod_get_index(&bus->dev, "reset", i,
-+                                           GPIOD_OUT_LOW);
-+              if (IS_ERR(gpiod)) {
-+                      err = PTR_ERR(gpiod);
-+                      if (err != -ENOENT) {
-+                              dev_err(&bus->dev,
-+                                      "mii_bus %s couldn't get reset GPIO\n",
-+                                      bus->id);
-+                              return err;
-+                      }
-+              } else {
-+                      bus->reset_gpiod[i] = 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++) {
-               if ((bus->phy_mask & (1 << i)) == 0) {
-                       struct phy_device *phydev;
-@@ -354,6 +387,13 @@ error:
-               mdiodev->device_remove(mdiodev);
-               mdiodev->device_free(mdiodev);
-       }
-+
-+      /* Put PHYs in RESET to save power */
-+      for (i = 0; i < bus->num_reset_gpios; i++) {
-+              if (bus->reset_gpiod[i])
-+                      gpiod_set_value_cansleep(bus->reset_gpiod[i], 1);
-+      }
-+
-       device_del(&bus->dev);
-       return err;
- }
-@@ -375,6 +415,13 @@ void mdiobus_unregister(struct mii_bus *
-               mdiodev->device_remove(mdiodev);
-               mdiodev->device_free(mdiodev);
-       }
-+
-+      /* Put PHYs in RESET to save power */
-+      for (i = 0; i < bus->num_reset_gpios; i++) {
-+              if (bus->reset_gpiod[i])
-+                      gpiod_set_value_cansleep(bus->reset_gpiod[i], 1);
-+      }
-+
-       device_del(&bus->dev);
- }
- EXPORT_SYMBOL(mdiobus_unregister);
---- a/drivers/of/of_mdio.c
-+++ b/drivers/of/of_mdio.c
-@@ -22,6 +22,8 @@
- #include <linux/of_net.h>
- #include <linux/module.h>
-+#define DEFAULT_GPIO_RESET_DELAY      10      /* in microseconds */
-+
- MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>");
- MODULE_LICENSE("GPL");
-@@ -220,6 +222,11 @@ int of_mdiobus_register(struct mii_bus *
-       mdio->dev.of_node = np;
-+      /* Get bus level PHY reset GPIO details */
-+      mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY;
-+      of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us);
-+      mdio->num_reset_gpios = of_gpio_named_count(np, "reset-gpios");
-+
-       /* Register the MDIO bus */
-       rc = mdiobus_register(mdio);
-       if (rc)
---- a/include/linux/phy.h
-+++ b/include/linux/phy.h
-@@ -193,6 +193,13 @@ struct mii_bus {
-        * matching its address
-        */
-       int irq[PHY_MAX_ADDR];
-+
-+      /* GPIO reset pulse width in microseconds */
-+      int reset_delay_us;
-+      /* Number of reset GPIOs */
-+      int num_reset_gpios;
-+      /* Array of RESET GPIO descriptors */
-+      struct gpio_desc **reset_gpiod;
- };
- #define to_mii_bus(d) container_of(d, struct mii_bus, dev)
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch b/target/linux/brcm63xx/patches-4.9/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch
deleted file mode 100644 (file)
index 182ad62..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-From df0c8d911abf6ba97b2c2fc3c5a12769e0b081a3 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <f.fainelli@gmail.com>
-Date: Thu, 11 May 2017 11:24:16 -0700
-Subject: [PATCH] net: phy: Call bus->reset() after releasing PHYs from reset
-
-The API convention makes it that a given MDIO bus reset should be able
-to access PHY devices in its reset() callback and perform additional
-MDIO accesses in order to bring the bus and PHYs in a working state.
-
-Commit 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.") broke that
-contract by first calling bus->reset() and then release all PHYs from
-reset using their shared GPIO line, so restore the expected
-functionality here.
-
-Fixes: 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.")
-Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
----
- drivers/net/phy/mdio_bus.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/drivers/net/phy/mdio_bus.c
-+++ b/drivers/net/phy/mdio_bus.c
-@@ -330,9 +330,6 @@ int __mdiobus_register(struct mii_bus *b
-       mutex_init(&bus->mdio_lock);
--      if (bus->reset)
--              bus->reset(bus);
--
-       /* de-assert bus level PHY GPIO resets */
-       if (bus->num_reset_gpios > 0) {
-               bus->reset_gpiod = devm_kcalloc(&bus->dev,
-@@ -362,6 +359,9 @@ int __mdiobus_register(struct mii_bus *b
-               }
-       }
-+      if (bus->reset)
-+              bus->reset(bus);
-+
-       for (i = 0; i < PHY_MAX_ADDR; i++) {
-               if ((bus->phy_mask & (1 << i)) == 0) {
-                       struct phy_device *phydev;
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch b/target/linux/brcm63xx/patches-4.9/001-4.13-01-leds-bcm6328-fix-signal-source-assignment-for-high-l.patch
deleted file mode 100644 (file)
index 5280baf..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-From dc90895d776d7b8017bc3b14f588d569d8edbe1f Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Thu, 11 May 2017 13:36:52 +0200
-Subject: [PATCH] leds: bcm6328: fix signal source assignment for high leds
-
-Each nibble represents 4 LEDs, and in case of the higher register, bit 0
-represents LED 4, so we need to use modulus for the LED number as well.
-
-Fixes: fd7b025a238d0a5440bfa26c585eb78097bf48dc ("leds: add BCM6328 LED driver")
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/leds/leds-bcm6328.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/leds/leds-bcm6328.c
-+++ b/drivers/leds/leds-bcm6328.c
-@@ -242,7 +242,7 @@ static int bcm6328_hwled(struct device *
-               spin_lock_irqsave(lock, flags);
-               val = bcm6328_led_read(addr);
--              val |= (BIT(reg) << (((sel % 4) * 4) + 16));
-+              val |= (BIT(reg % 4) << (((sel % 4) * 4) + 16));
-               bcm6328_led_write(addr, val);
-               spin_unlock_irqrestore(lock, flags);
-       }
-@@ -269,7 +269,7 @@ static int bcm6328_hwled(struct device *
-               spin_lock_irqsave(lock, flags);
-               val = bcm6328_led_read(addr);
--              val |= (BIT(reg) << ((sel % 4) * 4));
-+              val |= (BIT(reg % 4) << ((sel % 4) * 4));
-               bcm6328_led_write(addr, val);
-               spin_unlock_irqrestore(lock, flags);
-       }
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch
deleted file mode 100644 (file)
index c193c72..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-From e74caf41aec5338b8cbbd0a1483650848f16f532 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:23:47 +0200
-Subject: [PATCH V2 1/8] MIPS: BCM63XX: add clkdev lookup support
-
-Enable clkdev lookup support to allow us providing clocks under
-different names to devices more easily, so we don't need to care
-about clock name clashes anymore.
-
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/Kconfig       |   1 +
- arch/mips/bcm63xx/clk.c | 150 +++++++++++++++++++++++++++++++++++++-----------
- 2 files changed, 116 insertions(+), 35 deletions(-)
-
---- a/arch/mips/Kconfig
-+++ b/arch/mips/Kconfig
-@@ -272,6 +272,7 @@ config BCM63XX
-       select GPIOLIB
-       select HAVE_CLK
-       select MIPS_L1_CACHE_SHIFT_4
-+      select CLKDEV_LOOKUP
-       help
-        Support for BCM63XX based boards
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -10,6 +10,7 @@
- #include <linux/mutex.h>
- #include <linux/err.h>
- #include <linux/clk.h>
-+#include <linux/clkdev.h>
- #include <linux/delay.h>
- #include <bcm63xx_cpu.h>
- #include <bcm63xx_io.h>
-@@ -355,44 +356,103 @@ long clk_round_rate(struct clk *clk, uns
- }
- EXPORT_SYMBOL_GPL(clk_round_rate);
--struct clk *clk_get(struct device *dev, const char *id)
--{
--      if (!strcmp(id, "enet0"))
--              return &clk_enet0;
--      if (!strcmp(id, "enet1"))
--              return &clk_enet1;
--      if (!strcmp(id, "enetsw"))
--              return &clk_enetsw;
--      if (!strcmp(id, "ephy"))
--              return &clk_ephy;
--      if (!strcmp(id, "usbh"))
--              return &clk_usbh;
--      if (!strcmp(id, "usbd"))
--              return &clk_usbd;
--      if (!strcmp(id, "spi"))
--              return &clk_spi;
--      if (!strcmp(id, "hsspi"))
--              return &clk_hsspi;
--      if (!strcmp(id, "xtm"))
--              return &clk_xtm;
--      if (!strcmp(id, "periph"))
--              return &clk_periph;
--      if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm"))
--              return &clk_pcm;
--      if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec"))
--              return &clk_ipsec;
--      if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie"))
--              return &clk_pcie;
--      return ERR_PTR(-ENOENT);
--}
--
--EXPORT_SYMBOL(clk_get);
--
--void clk_put(struct clk *clk)
--{
--}
--
--EXPORT_SYMBOL(clk_put);
-+static struct clk_lookup bcm3368_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT(NULL, "pcm", &clk_pcm),
-+};
-+
-+static struct clk_lookup bcm6328_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "hsspi", &clk_hsspi),
-+      CLKDEV_INIT(NULL, "pcie", &clk_pcie),
-+};
-+
-+static struct clk_lookup bcm6338_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+};
-+
-+static struct clk_lookup bcm6345_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+};
-+
-+static struct clk_lookup bcm6348_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+};
-+
-+static struct clk_lookup bcm6358_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-+      CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-+      CLKDEV_INIT(NULL, "ephy", &clk_ephy),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT(NULL, "pcm", &clk_pcm),
-+};
-+
-+static struct clk_lookup bcm6362_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT(NULL, "hsspi", &clk_hsspi),
-+      CLKDEV_INIT(NULL, "pcie", &clk_pcie),
-+      CLKDEV_INIT(NULL, "ipsec", &clk_ipsec),
-+};
-+
-+static struct clk_lookup bcm6368_clks[] = {
-+      /* fixed rate clocks */
-+      CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      /* gated clocks */
-+      CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-+      CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-+      CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-+      CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT(NULL, "xtm", &clk_xtm),
-+      CLKDEV_INIT(NULL, "ipsec", &clk_ipsec),
-+};
- #define HSSPI_PLL_HZ_6328     133333333
- #define HSSPI_PLL_HZ_6362     400000000
-@@ -400,11 +460,31 @@ EXPORT_SYMBOL(clk_put);
- static int __init bcm63xx_clk_init(void)
- {
-       switch (bcm63xx_get_cpu_id()) {
-+      case BCM3368_CPU_ID:
-+              clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks));
-+              break;
-       case BCM6328_CPU_ID:
-               clk_hsspi.rate = HSSPI_PLL_HZ_6328;
-+              clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks));
-+              break;
-+      case BCM6338_CPU_ID:
-+              clkdev_add_table(bcm6338_clks, ARRAY_SIZE(bcm6338_clks));
-+              break;
-+      case BCM6345_CPU_ID:
-+              clkdev_add_table(bcm6345_clks, ARRAY_SIZE(bcm6345_clks));
-+              break;
-+      case BCM6348_CPU_ID:
-+              clkdev_add_table(bcm6348_clks, ARRAY_SIZE(bcm6348_clks));
-+              break;
-+      case BCM6358_CPU_ID:
-+              clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks));
-               break;
-       case BCM6362_CPU_ID:
-               clk_hsspi.rate = HSSPI_PLL_HZ_6362;
-+              clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks));
-+              break;
-+      case BCM6368_CPU_ID:
-+              clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks));
-               break;
-       }
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch
deleted file mode 100644 (file)
index 5d4298d..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-From d0322bf7bebe87012b4f95c85be6b5ba0cb6f344 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:31:44 +0200
-Subject: [PATCH V2 2/8] MIPS: BCM63XX: provide periph clock as refclk for uart
-
-Add a lookup as "refclk" to describe its function for the uarts.
-
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/bcm63xx/clk.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -359,6 +359,8 @@ EXPORT_SYMBOL_GPL(clk_round_rate);
- static struct clk_lookup bcm3368_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -372,6 +374,8 @@ static struct clk_lookup bcm3368_clks[]
- static struct clk_lookup bcm6328_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-@@ -383,6 +387,7 @@ static struct clk_lookup bcm6328_clks[]
- static struct clk_lookup bcm6338_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -395,6 +400,7 @@ static struct clk_lookup bcm6338_clks[]
- static struct clk_lookup bcm6345_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -407,6 +413,7 @@ static struct clk_lookup bcm6345_clks[]
- static struct clk_lookup bcm6348_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -419,6 +426,8 @@ static struct clk_lookup bcm6348_clks[]
- static struct clk_lookup bcm6358_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enet0", &clk_enet0),
-       CLKDEV_INIT(NULL, "enet1", &clk_enet1),
-@@ -432,6 +441,8 @@ static struct clk_lookup bcm6358_clks[]
- static struct clk_lookup bcm6362_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-@@ -445,6 +456,8 @@ static struct clk_lookup bcm6362_clks[]
- static struct clk_lookup bcm6368_clks[] = {
-       /* fixed rate clocks */
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch
deleted file mode 100644 (file)
index 5152fbe..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From 8124706e6040b1cf0d2dd3a05759df6cec4bddfb Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:32:37 +0200
-Subject: [PATCH V2 3/8] tty/bcm63xx_uart: use refclk for the expected clock
- name
-
-We now have the clock available under refclk, so use that.
-
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/tty/serial/bcm63xx_uart.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/tty/serial/bcm63xx_uart.c
-+++ b/drivers/tty/serial/bcm63xx_uart.c
-@@ -842,7 +842,7 @@ static int bcm_uart_probe(struct platfor
-               return -ENODEV;
-       clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
--                                clk_get(&pdev->dev, "periph");
-+                                clk_get(&pdev->dev, "refclk");
-       if (IS_ERR(clk))
-               return -ENODEV;
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch
deleted file mode 100644 (file)
index a8fd5af..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-From 317f8659bba01b307cbe4e9902d4e3d333fd7164 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:39:17 +0200
-Subject: [PATCH V2 4/8] tty/bcm63xx_uart: allow naming clock in device tree
-
-Codify using a named clock for the refclk of the uart. This makes it
-easier if we might need to add a gating clock (like present on the
-BCM6345).
-
-Acked-by: Rob Herring <robh@kernel.org>
-Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | 6 ++++++
- drivers/tty/serial/bcm63xx_uart.c                              | 6 ++++--
- 2 files changed, 10 insertions(+), 2 deletions(-)
-
---- a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
-+++ b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt
-@@ -11,6 +11,11 @@ Required properties:
- - clocks: Clock driving the hardware; used to figure out the baud rate
-   divisor.
-+
-+Optional properties:
-+
-+- clock-names: Should be "refclk".
-+
- Example:
-       uart0: serial@14e00520 {
-@@ -19,6 +24,7 @@ Example:
-               interrupt-parent = <&periph_intc>;
-               interrupts = <2>;
-               clocks = <&periph_clk>;
-+              clock-names = "refclk";
-       };
-       clocks {
---- a/drivers/tty/serial/bcm63xx_uart.c
-+++ b/drivers/tty/serial/bcm63xx_uart.c
-@@ -841,8 +841,10 @@ static int bcm_uart_probe(struct platfor
-       if (!res_irq)
-               return -ENODEV;
--      clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) :
--                                clk_get(&pdev->dev, "refclk");
-+      clk = clk_get(&pdev->dev, "refclk");
-+      if (IS_ERR(clk) && pdev->dev.of_node)
-+              clk = of_clk_get(pdev->dev.of_node, 0);
-+
-       if (IS_ERR(clk))
-               return -ENODEV;
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch
deleted file mode 100644 (file)
index 2f6951b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-From cb86630379c8f3432c916d62045b5176f17f4123 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:57:21 +0200
-Subject: [PATCH V2 6/8] MIPS: BCM63XX: move the HSSPI PLL HZ into its own
- clock
-
-Split up the HSSPL clock into rate and a gate clock, to more closely
-match the actual hardware.
-
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/bcm63xx/clk.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
-
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -247,6 +247,10 @@ static struct clk clk_hsspi = {
-       .set    = hsspi_set,
- };
-+/*
-+ * HSSPI PLL
-+ */
-+static struct clk clk_hsspi_pll;
- /*
-  * XTM clock
-@@ -376,6 +380,7 @@ static struct clk_lookup bcm6328_clks[]
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-       CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-@@ -443,6 +448,7 @@ static struct clk_lookup bcm6362_clks[]
-       CLKDEV_INIT(NULL, "periph", &clk_periph),
-       CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph),
-       CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph),
-+      CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll),
-       /* gated clocks */
-       CLKDEV_INIT(NULL, "enetsw", &clk_enetsw),
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-@@ -477,7 +483,7 @@ static int __init bcm63xx_clk_init(void)
-               clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks));
-               break;
-       case BCM6328_CPU_ID:
--              clk_hsspi.rate = HSSPI_PLL_HZ_6328;
-+              clk_hsspi_pll.rate = HSSPI_PLL_HZ_6328;
-               clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks));
-               break;
-       case BCM6338_CPU_ID:
-@@ -493,7 +499,7 @@ static int __init bcm63xx_clk_init(void)
-               clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks));
-               break;
-       case BCM6362_CPU_ID:
--              clk_hsspi.rate = HSSPI_PLL_HZ_6362;
-+              clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362;
-               clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks));
-               break;
-       case BCM6368_CPU_ID:
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch
deleted file mode 100644 (file)
index d631013..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From 6d43970a2eb1c7ee88caf7328d201f9c001262e9 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:48:41 +0200
-Subject: [PATCH V2 7/8] MIPS: BCM63XX: provide enet clocks as "enet" to the
- ethernet devices
-
-Add lookups to provide the appropriate enetX clocks as just "enet" to
-the ethernet devices.
-
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/bcm63xx/clk.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -373,6 +373,8 @@ static struct clk_lookup bcm3368_clks[]
-       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-       CLKDEV_INIT(NULL, "spi", &clk_spi),
-       CLKDEV_INIT(NULL, "pcm", &clk_pcm),
-+      CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0),
-+      CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1),
- };
- static struct clk_lookup bcm6328_clks[] = {
-@@ -400,6 +402,7 @@ static struct clk_lookup bcm6338_clks[]
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-       CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc),
- };
- static struct clk_lookup bcm6345_clks[] = {
-@@ -413,6 +416,7 @@ static struct clk_lookup bcm6345_clks[]
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-       CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc),
- };
- static struct clk_lookup bcm6348_clks[] = {
-@@ -426,6 +430,8 @@ static struct clk_lookup bcm6348_clks[]
-       CLKDEV_INIT(NULL, "usbh", &clk_usbh),
-       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-       CLKDEV_INIT(NULL, "spi", &clk_spi),
-+      CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc),
-+      CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet_misc),
- };
- static struct clk_lookup bcm6358_clks[] = {
-@@ -441,6 +447,8 @@ static struct clk_lookup bcm6358_clks[]
-       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-       CLKDEV_INIT(NULL, "spi", &clk_spi),
-       CLKDEV_INIT(NULL, "pcm", &clk_pcm),
-+      CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0),
-+      CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1),
- };
- static struct clk_lookup bcm6362_clks[] = {
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch
deleted file mode 100644 (file)
index f9698c2..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-From b98027285bd1fa95da0645a4234a5fc1f1a83f92 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 26 Feb 2017 11:59:52 +0100
-Subject: [PATCH V2 8/8] MIPS: BCM63XX: split out swpkt_sar/usb clocks
-
-Make the secondary switch clocks their own clocks. This allows proper
-enable reference counting between SAR/XTM and the main switch clocks,
-and controlling them individually from drivers.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/bcm63xx/clk.c | 61 +++++++++++++++++++++++++++++++++++++++++--------
- 1 file changed, 51 insertions(+), 10 deletions(-)
-
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -121,21 +121,56 @@ static struct clk clk_ephy = {
- };
- /*
-+ * Ethernet switch SAR clock
-+ */
-+static void swpkt_sar_set(struct clk *clk, int enable)
-+{
-+      if (BCMCPU_IS_6368())
-+              bcm_hwclock_set(CKCTL_6368_SWPKT_SAR_EN, enable);
-+      else
-+              return;
-+}
-+
-+static struct clk clk_swpkt_sar = {
-+      .set    = swpkt_sar_set,
-+};
-+
-+/*
-+ * Ethernet switch USB clock
-+ */
-+static void swpkt_usb_set(struct clk *clk, int enable)
-+{
-+      if (BCMCPU_IS_6368())
-+              bcm_hwclock_set(CKCTL_6368_SWPKT_USB_EN, enable);
-+      else
-+              return;
-+}
-+
-+static struct clk clk_swpkt_usb = {
-+      .set    = swpkt_usb_set,
-+};
-+
-+/*
-  * Ethernet switch clock
-  */
- static void enetsw_set(struct clk *clk, int enable)
- {
--      if (BCMCPU_IS_6328())
-+      if (BCMCPU_IS_6328()) {
-               bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable);
--      else if (BCMCPU_IS_6362())
-+      } else if (BCMCPU_IS_6362()) {
-               bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable);
--      else if (BCMCPU_IS_6368())
--              bcm_hwclock_set(CKCTL_6368_ROBOSW_EN |
--                              CKCTL_6368_SWPKT_USB_EN |
--                              CKCTL_6368_SWPKT_SAR_EN,
--                              enable);
--      else
-+      } else if (BCMCPU_IS_6368()) {
-+              if (enable) {
-+                      clk_enable_unlocked(&clk_swpkt_sar);
-+                      clk_enable_unlocked(&clk_swpkt_usb);
-+              } else {
-+                      clk_disable_unlocked(&clk_swpkt_usb);
-+                      clk_disable_unlocked(&clk_swpkt_sar);
-+              }
-+              bcm_hwclock_set(CKCTL_6368_ROBOSW_EN, enable);
-+      } else {
-               return;
-+      }
-       if (enable) {
-               /* reset switch core afer clock change */
-@@ -260,8 +295,12 @@ static void xtm_set(struct clk *clk, int
-       if (!BCMCPU_IS_6368())
-               return;
--      bcm_hwclock_set(CKCTL_6368_SAR_EN |
--                      CKCTL_6368_SWPKT_SAR_EN, enable);
-+      if (enable)
-+              clk_enable_unlocked(&clk_swpkt_sar);
-+      else
-+              clk_disable_unlocked(&clk_swpkt_sar);
-+
-+      bcm_hwclock_set(CKCTL_6368_SAR_EN, enable);
-       if (enable) {
-               /* reset sar core afer clock change */
-@@ -447,6 +486,8 @@ static struct clk_lookup bcm6358_clks[]
-       CLKDEV_INIT(NULL, "usbd", &clk_usbd),
-       CLKDEV_INIT(NULL, "spi", &clk_spi),
-       CLKDEV_INIT(NULL, "pcm", &clk_pcm),
-+      CLKDEV_INIT(NULL, "swpkt_sar", &clk_swpkt_sar),
-+      CLKDEV_INIT(NULL, "swpkt_usb", &clk_swpkt_usb),
-       CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0),
-       CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1),
- };
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch
deleted file mode 100644 (file)
index e13b32e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From 71710bb6cbc82f411a4e5faafa0c3178e48e7137 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Tue, 30 May 2017 13:31:45 +0200
-Subject: [PATCH 3/6] bcm63xx_enet: do not rely on probe order
-
-Do not rely on the shared device being probed before the enet(sw)
-devices. This makes it easier to eventually move out the shared
-device as a dma controller driver (what it should be).
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
-
---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -1739,10 +1739,8 @@ static int bcm_enet_probe(struct platfor
-       const char *clk_name;
-       int i, ret;
--      /* stop if shared driver failed, assume driver->probe will be
--       * called in the same order we register devices (correct ?) */
-       if (!bcm_enet_shared_base[0])
--              return -ENODEV;
-+              return -EPROBE_DEFER;
-       res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-       res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
-@@ -2714,11 +2712,8 @@ static int bcm_enetsw_probe(struct platf
-       struct resource *res_mem;
-       int ret, irq_rx, irq_tx;
--      /* stop if shared driver failed, assume driver->probe will be
--       * called in the same order we register devices (correct ?)
--       */
-       if (!bcm_enet_shared_base[0])
--              return -ENODEV;
-+              return -EPROBE_DEFER;
-       res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       irq_rx = platform_get_irq(pdev, 0);
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch
deleted file mode 100644 (file)
index 7d7d18b..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-From 179a445ae4ef36ec44f4aea18e5f42d21334d186 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sat, 25 Feb 2017 12:39:25 +0100
-Subject: [PATCH 4/6] bcm63xx_enet: use managed functions for clock/ioremap
-
-Use managed functions where possible to reduce the amount of resource
-handling on error and remove paths.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 54 +++++++---------------------
- 1 file changed, 12 insertions(+), 42 deletions(-)
-
---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -1784,14 +1784,14 @@ static int bcm_enet_probe(struct platfor
-               clk_name = "enet1";
-       }
--      priv->mac_clk = clk_get(&pdev->dev, clk_name);
-+      priv->mac_clk = devm_clk_get(&pdev->dev, clk_name);
-       if (IS_ERR(priv->mac_clk)) {
-               ret = PTR_ERR(priv->mac_clk);
-               goto out;
-       }
-       ret = clk_prepare_enable(priv->mac_clk);
-       if (ret)
--              goto out_put_clk_mac;
-+              goto out;
-       /* initialize default and fetch platform data */
-       priv->rx_ring_size = BCMENET_DEF_RX_DESC;
-@@ -1819,7 +1819,7 @@ static int bcm_enet_probe(struct platfor
-       if (priv->mac_id == 0 && priv->has_phy && !priv->use_external_mii) {
-               /* using internal PHY, enable clock */
--              priv->phy_clk = clk_get(&pdev->dev, "ephy");
-+              priv->phy_clk = devm_clk_get(&pdev->dev, "ephy");
-               if (IS_ERR(priv->phy_clk)) {
-                       ret = PTR_ERR(priv->phy_clk);
-                       priv->phy_clk = NULL;
-@@ -1827,7 +1827,7 @@ static int bcm_enet_probe(struct platfor
-               }
-               ret = clk_prepare_enable(priv->phy_clk);
-               if (ret)
--                      goto out_put_clk_phy;
-+                      goto out_disable_clk_mac;
-       }
-       /* do minimal hardware init to be able to probe mii bus */
-@@ -1921,14 +1921,8 @@ out_uninit_hw:
-       if (priv->phy_clk)
-               clk_disable_unprepare(priv->phy_clk);
--out_put_clk_phy:
--      if (priv->phy_clk)
--              clk_put(priv->phy_clk);
--
- out_disable_clk_mac:
-       clk_disable_unprepare(priv->mac_clk);
--out_put_clk_mac:
--      clk_put(priv->mac_clk);
- out:
-       free_netdev(dev);
-       return ret;
-@@ -1964,12 +1958,10 @@ static int bcm_enet_remove(struct platfo
-       }
-       /* disable hw block clocks */
--      if (priv->phy_clk) {
-+      if (priv->phy_clk)
-               clk_disable_unprepare(priv->phy_clk);
--              clk_put(priv->phy_clk);
--      }
-+
-       clk_disable_unprepare(priv->mac_clk);
--      clk_put(priv->mac_clk);
-       free_netdev(dev);
-       return 0;
-@@ -2752,26 +2744,20 @@ static int bcm_enetsw_probe(struct platf
-       if (ret)
-               goto out;
--      if (!request_mem_region(res_mem->start, resource_size(res_mem),
--                              "bcm63xx_enetsw")) {
--              ret = -EBUSY;
-+      priv->base = devm_ioremap_resource(&pdev->dev, res_mem);
-+      if (IS_ERR(priv->base)) {
-+              ret = PTR_ERR(priv->base);
-               goto out;
-       }
--      priv->base = ioremap(res_mem->start, resource_size(res_mem));
--      if (priv->base == NULL) {
--              ret = -ENOMEM;
--              goto out_release_mem;
--      }
--
--      priv->mac_clk = clk_get(&pdev->dev, "enetsw");
-+      priv->mac_clk = devm_clk_get(&pdev->dev, "enetsw");
-       if (IS_ERR(priv->mac_clk)) {
-               ret = PTR_ERR(priv->mac_clk);
--              goto out_unmap;
-+              goto out;
-       }
-       ret = clk_prepare_enable(priv->mac_clk);
-       if (ret)
--              goto out_put_clk;
-+              goto out;
-       priv->rx_chan = 0;
-       priv->tx_chan = 1;
-@@ -2803,15 +2789,6 @@ static int bcm_enetsw_probe(struct platf
- out_disable_clk:
-       clk_disable_unprepare(priv->mac_clk);
--
--out_put_clk:
--      clk_put(priv->mac_clk);
--
--out_unmap:
--      iounmap(priv->base);
--
--out_release_mem:
--      release_mem_region(res_mem->start, resource_size(res_mem));
- out:
-       free_netdev(dev);
-       return ret;
-@@ -2823,20 +2800,13 @@ static int bcm_enetsw_remove(struct plat
- {
-       struct bcm_enet_priv *priv;
-       struct net_device *dev;
--      struct resource *res;
-       /* stop netdevice */
-       dev = platform_get_drvdata(pdev);
-       priv = netdev_priv(dev);
-       unregister_netdev(dev);
--      /* release device resources */
--      iounmap(priv->base);
--      res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
--      release_mem_region(res->start, resource_size(res));
--
-       clk_disable_unprepare(priv->mac_clk);
--      clk_put(priv->mac_clk);
-       free_netdev(dev);
-       return 0;
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch
deleted file mode 100644 (file)
index b81a94c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-From 555baec974ede81e616ca88ac6d3fca09239368f Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Tue, 18 Jul 2017 13:18:01 +0200
-Subject: [PATCH 5/6] bcm63xx_enet: drop unneeded NULL phy_clk check
-
-clk_disable and clk_unprepare are NULL-safe, so need to duplicate the
-NULL check of the functions.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++-----
- 1 file changed, 2 insertions(+), 5 deletions(-)
-
---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -1918,8 +1918,7 @@ out_free_mdio:
- out_uninit_hw:
-       /* turn off mdc clock */
-       enet_writel(priv, 0, ENET_MIISC_REG);
--      if (priv->phy_clk)
--              clk_disable_unprepare(priv->phy_clk);
-+      clk_disable_unprepare(priv->phy_clk);
- out_disable_clk_mac:
-       clk_disable_unprepare(priv->mac_clk);
-@@ -1958,9 +1957,7 @@ static int bcm_enet_remove(struct platfo
-       }
-       /* disable hw block clocks */
--      if (priv->phy_clk)
--              clk_disable_unprepare(priv->phy_clk);
--
-+      clk_disable_unprepare(priv->phy_clk);
-       clk_disable_unprepare(priv->mac_clk);
-       free_netdev(dev);
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch b/target/linux/brcm63xx/patches-4.9/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch
deleted file mode 100644 (file)
index 482bd58..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-From 77364ce98037972fb1c57d0ee0418eb1c2b26521 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Mon, 29 May 2017 13:11:14 +0200
-Subject: [PATCH 6/6] bcm63xx_enet: remove unneeded include
-
-We don't use anyhing from that file, so drop it.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/net/ethernet/broadcom/bcm63xx_enet.h | 1 -
- 1 file changed, 1 deletion(-)
-
---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h
-+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h
-@@ -8,7 +8,6 @@
- #include <linux/platform_device.h>
- #include <bcm63xx_regs.h>
--#include <bcm63xx_irq.h>
- #include <bcm63xx_io.h>
- #include <bcm63xx_iudma.h>
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.16-01-bcm63xx_enet-just-use-enet-as-the-clock-name.patch b/target/linux/brcm63xx/patches-4.9/001-4.16-01-bcm63xx_enet-just-use-enet-as-the-clock-name.patch
deleted file mode 100644 (file)
index d453153..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From 943b0832e0cf3afe5bd40ffb1885d06106122c5d Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 16 Jul 2017 12:49:49 +0200
-Subject: [PATCH 1/4] bcm63xx_enet: just use "enet" as the clock name
-
-Now that we have the individual clocks available as "enet" we
-don't need to rely on the device id for them anymore.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
-
---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -1736,7 +1736,6 @@ static int bcm_enet_probe(struct platfor
-       struct bcm63xx_enet_platform_data *pd;
-       struct resource *res_mem, *res_irq, *res_irq_rx, *res_irq_tx;
-       struct mii_bus *bus;
--      const char *clk_name;
-       int i, ret;
-       if (!bcm_enet_shared_base[0])
-@@ -1777,14 +1776,12 @@ static int bcm_enet_probe(struct platfor
-       if (priv->mac_id == 0) {
-               priv->rx_chan = 0;
-               priv->tx_chan = 1;
--              clk_name = "enet0";
-       } else {
-               priv->rx_chan = 2;
-               priv->tx_chan = 3;
--              clk_name = "enet1";
-       }
--      priv->mac_clk = devm_clk_get(&pdev->dev, clk_name);
-+      priv->mac_clk = devm_clk_get(&pdev->dev, "enet");
-       if (IS_ERR(priv->mac_clk)) {
-               ret = PTR_ERR(priv->mac_clk);
-               goto out;
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch b/target/linux/brcm63xx/patches-4.9/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch
deleted file mode 100644 (file)
index d858b81..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-From b7d1d1f345bb3b25c360c1df812d98866e2ee7fb Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sat, 30 Sep 2017 13:50:03 +0200
-Subject: [PATCH 2/4] bcm63xx_enet: use platform data for dma channel numbers
-
-To reduce the reliance on device ids, pass the dma channel numbers to
-the enet devices as platform data.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/bcm63xx/dev-enet.c                          |  8 ++++++++
- arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h |  4 ++++
- drivers/net/ethernet/broadcom/bcm63xx_enet.c          | 11 ++---------
- 3 files changed, 14 insertions(+), 9 deletions(-)
-
---- a/arch/mips/bcm63xx/dev-enet.c
-+++ b/arch/mips/bcm63xx/dev-enet.c
-@@ -265,6 +265,14 @@ int __init bcm63xx_enet_register(int uni
-               dpd->dma_chan_width = ENETDMA_CHAN_WIDTH;
-       }
-+      if (unit == 0) {
-+              dpd->rx_chan = 0;
-+              dpd->tx_chan = 1;
-+      } else {
-+              dpd->rx_chan = 2;
-+              dpd->tx_chan = 3;
-+      }
-+
-       ret = platform_device_register(pdev);
-       if (ret)
-               return ret;
---- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
-+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_enet.h
-@@ -54,6 +54,10 @@ struct bcm63xx_enet_platform_data {
-       /* DMA descriptor shift */
-       unsigned int dma_desc_shift;
-+
-+      /* dma channel ids */
-+      int rx_chan;
-+      int tx_chan;
- };
- /*
---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -1772,15 +1772,6 @@ static int bcm_enet_probe(struct platfor
-       priv->irq_tx = res_irq_tx->start;
-       priv->mac_id = pdev->id;
--      /* get rx & tx dma channel id for this mac */
--      if (priv->mac_id == 0) {
--              priv->rx_chan = 0;
--              priv->tx_chan = 1;
--      } else {
--              priv->rx_chan = 2;
--              priv->tx_chan = 3;
--      }
--
-       priv->mac_clk = devm_clk_get(&pdev->dev, "enet");
-       if (IS_ERR(priv->mac_clk)) {
-               ret = PTR_ERR(priv->mac_clk);
-@@ -1812,6 +1803,8 @@ static int bcm_enet_probe(struct platfor
-               priv->dma_chan_width = pd->dma_chan_width;
-               priv->dma_has_sram = pd->dma_has_sram;
-               priv->dma_desc_shift = pd->dma_desc_shift;
-+              priv->rx_chan = pd->rx_chan;
-+              priv->tx_chan = pd->tx_chan;
-       }
-       if (priv->mac_id == 0 && priv->has_phy && !priv->use_external_mii) {
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.16-03-bcm63xx_enet-remove-pointless-mac_id-check.patch b/target/linux/brcm63xx/patches-4.9/001-4.16-03-bcm63xx_enet-remove-pointless-mac_id-check.patch
deleted file mode 100644 (file)
index 85f2ca2..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From 8c61608e5dd2e15575c171ee9cd558ddc3b94962 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 17 Dec 2017 12:54:30 +0100
-Subject: [PATCH 3/4] bcm63xx_enet: remove pointless mac_id check
-
-Enabling the ephy clock for mac 1 is harmless, and the actual usage of
-the ephy is not restricted to mac 0, so we might as well remove the
-check.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -1807,7 +1807,7 @@ static int bcm_enet_probe(struct platfor
-               priv->tx_chan = pd->tx_chan;
-       }
--      if (priv->mac_id == 0 && priv->has_phy && !priv->use_external_mii) {
-+      if (priv->has_phy && !priv->use_external_mii) {
-               /* using internal PHY, enable clock */
-               priv->phy_clk = devm_clk_get(&pdev->dev, "ephy");
-               if (IS_ERR(priv->phy_clk)) {
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.16-04-bcm63xx_enet-use-platform-device-id-directly-for-mii.patch b/target/linux/brcm63xx/patches-4.9/001-4.16-04-bcm63xx_enet-use-platform-device-id-directly-for-mii.patch
deleted file mode 100644 (file)
index f6b7d7d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-From faea89cd893a1a7af81185f026a64dad603ef72f Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Sun, 17 Dec 2017 12:58:12 +0100
-Subject: [PATCH 4/4] bcm63xx_enet: use platform device id directly for miibus
- name
-
-Directly use the platform device for generating the miibus name. This removes
-the last user of bcm_enet_priv::mac_id and we can remove the field.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 +--
- drivers/net/ethernet/broadcom/bcm63xx_enet.h | 3 ---
- 2 files changed, 1 insertion(+), 5 deletions(-)
-
---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
-@@ -1770,7 +1770,6 @@ static int bcm_enet_probe(struct platfor
-       dev->irq = priv->irq = res_irq->start;
-       priv->irq_rx = res_irq_rx->start;
-       priv->irq_tx = res_irq_tx->start;
--      priv->mac_id = pdev->id;
-       priv->mac_clk = devm_clk_get(&pdev->dev, "enet");
-       if (IS_ERR(priv->mac_clk)) {
-@@ -1838,7 +1837,7 @@ static int bcm_enet_probe(struct platfor
-               bus->priv = priv;
-               bus->read = bcm_enet_mdio_read_phylib;
-               bus->write = bcm_enet_mdio_write_phylib;
--              sprintf(bus->id, "%s-%d", pdev->name, priv->mac_id);
-+              sprintf(bus->id, "%s-%d", pdev->name, pdev->id);
-               /* only probe bus where we think the PHY is, because
-                * the mdio read operation return 0 instead of 0xffff
---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h
-+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h
-@@ -192,9 +192,6 @@ struct bcm_enet_mib_counters {
- struct bcm_enet_priv {
--      /* mac id (from platform device id) */
--      int mac_id;
--
-       /* base remapped address of device */
-       void __iomem *base;
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch b/target/linux/brcm63xx/patches-4.9/001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch
deleted file mode 100644 (file)
index 307ac7b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From f1af8bb8e0879a3c2d9679a7274c2774335e9876 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 14 Nov 2018 12:06:41 +0100
-Subject: [PATCH] MIPS: BCM63XX: fix switch core reset on BCM6368
-
-The Ethernet Switch core mask was set to 0, causing the switch core to
-be not reset on BCM6368 on boot. Provide the proper mask so the switch
-core gets reset to a known good state.
-
-Fixes: 799faa626c71 ("MIPS: BCM63XX: add core reset helper")
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/bcm63xx/reset.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/arch/mips/bcm63xx/reset.c
-+++ b/arch/mips/bcm63xx/reset.c
-@@ -119,7 +119,7 @@
- #define BCM6368_RESET_DSL     0
- #define BCM6368_RESET_SAR     SOFTRESET_6368_SAR_MASK
- #define BCM6368_RESET_EPHY    SOFTRESET_6368_EPHY_MASK
--#define BCM6368_RESET_ENETSW  0
-+#define BCM6368_RESET_ENETSW  SOFTRESET_6368_ENETSW_MASK
- #define BCM6368_RESET_PCM     SOFTRESET_6368_PCM_MASK
- #define BCM6368_RESET_MPI     SOFTRESET_6368_MPI_MASK
- #define BCM6368_RESET_PCIE    0
diff --git a/target/linux/brcm63xx/patches-4.9/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch b/target/linux/brcm63xx/patches-4.9/001-4.22-01-MIPS-BCM63XX-drop-unused-and-broken-DSP-platform-dev.patch
deleted file mode 100644 (file)
index 16a22e1..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-From 51559154375fff4a94bbbc249fdd9248a80827b3 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Tue, 18 Dec 2018 10:19:02 +0100
-Subject: [PATCH] MIPS: BCM63XX: drop unused and broken DSP platform device
-
-Trying to register the DSP platform device results in a null pointer
-access:
-
-[    0.124184] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 804e305c, ra == 804e6f20
-[    0.135208] Oops[#1]:
-[    0.137514] CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.87
-...
-[    0.197117] epc   : 804e305c bcm63xx_dsp_register+0x80/0xa4
-[    0.202838] ra    : 804e6f20 board_register_devices+0x258/0x390
-...
-
-This happens because it tries to copy the passed platform data over the
-platform_device's unpopulated platform_data.
-
-Since this code has been broken since its submission, no driver was ever
-submitted for it, and apparently nobody was using it, just remove it
-instead of trying to fix it.
-
-Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.")
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- arch/mips/bcm63xx/Makefile                         |  6 +--
- arch/mips/bcm63xx/boards/board_bcm963xx.c          | 20 --------
- arch/mips/bcm63xx/dev-dsp.c                        | 56 ----------------------
- .../include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h     | 14 ------
- .../mips/include/asm/mach-bcm63xx/board_bcm963xx.h |  5 --
- 5 files changed, 3 insertions(+), 98 deletions(-)
- delete mode 100644 arch/mips/bcm63xx/dev-dsp.c
- delete mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
-
---- a/arch/mips/bcm63xx/Makefile
-+++ b/arch/mips/bcm63xx/Makefile
-@@ -1,7 +1,7 @@
- obj-y         += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \
--                 setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \
--                 dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \
--                 dev-wdt.o dev-usb-usbd.o
-+                 setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \
-+                 dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \
-+                 dev-usb-usbd.o
- obj-$(CONFIG_EARLY_PRINTK)    += early_printk.o
- obj-y         += boards/
---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
-+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -23,7 +23,6 @@
- #include <bcm63xx_nvram.h>
- #include <bcm63xx_dev_pci.h>
- #include <bcm63xx_dev_enet.h>
--#include <bcm63xx_dev_dsp.h>
- #include <bcm63xx_dev_flash.h>
- #include <bcm63xx_dev_hsspi.h>
- #include <bcm63xx_dev_pcmcia.h>
-@@ -289,14 +288,6 @@ static struct board_info __initdata boar
-       .has_pccard                     = 1,
-       .has_ehci0                      = 1,
--      .has_dsp                        = 1,
--      .dsp = {
--              .gpio_rst               = 6,
--              .gpio_int               = 34,
--              .cs                     = 2,
--              .ext_irq                = 2,
--      },
--
-       .leds = {
-               {
-                       .name           = "adsl-fail",
-@@ -401,14 +392,6 @@ static struct board_info __initdata boar
-       .has_ohci0 = 1,
--      .has_dsp                        = 1,
--      .dsp = {
--              .gpio_rst               = 6,
--              .gpio_int               = 34,
--              .ext_irq                = 2,
--              .cs                     = 2,
--      },
--
-       .leds = {
-               {
-                       .name           = "adsl-fail",
-@@ -898,9 +881,6 @@ int __init board_register_devices(void)
-       if (board.has_usbd)
-               bcm63xx_usbd_register(&board.usbd);
--      if (board.has_dsp)
--              bcm63xx_dsp_register(&board.dsp);
--
-       /* Generate MAC address for WLAN and register our SPROM,
-        * do this after registering enet devices
-        */
---- a/arch/mips/bcm63xx/dev-dsp.c
-+++ /dev/null
-@@ -1,56 +0,0 @@
--/*
-- * Broadcom BCM63xx VoIP DSP registration
-- *
-- * This file is subject to the terms and conditions of the GNU General Public
-- * License.  See the file "COPYING" in the main directory of this archive
-- * for more details.
-- *
-- * Copyright (C) 2009 Florian Fainelli <florian@openwrt.org>
-- */
--
--#include <linux/init.h>
--#include <linux/kernel.h>
--#include <linux/platform_device.h>
--
--#include <bcm63xx_cpu.h>
--#include <bcm63xx_dev_dsp.h>
--#include <bcm63xx_regs.h>
--#include <bcm63xx_io.h>
--
--static struct resource voip_dsp_resources[] = {
--      {
--              .start          = -1, /* filled at runtime */
--              .end            = -1, /* filled at runtime */
--              .flags          = IORESOURCE_MEM,
--      },
--      {
--              .start          = -1, /* filled at runtime */
--              .flags          = IORESOURCE_IRQ,
--      },
--};
--
--static struct platform_device bcm63xx_voip_dsp_device = {
--      .name           = "bcm63xx-voip-dsp",
--      .id             = -1,
--      .num_resources  = ARRAY_SIZE(voip_dsp_resources),
--      .resource       = voip_dsp_resources,
--};
--
--int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd)
--{
--      struct bcm63xx_dsp_platform_data *dpd;
--      u32 val;
--
--      /* Get the memory window */
--      val = bcm_mpi_readl(MPI_CSBASE_REG(pd->cs - 1));
--      val &= MPI_CSBASE_BASE_MASK;
--      voip_dsp_resources[0].start = val;
--      voip_dsp_resources[0].end = val + 0xFFFFFFF;
--      voip_dsp_resources[1].start = pd->ext_irq;
--
--      /* copy given platform data */
--      dpd = bcm63xx_voip_dsp_device.dev.platform_data;
--      memcpy(dpd, pd, sizeof (*pd));
--
--      return platform_device_register(&bcm63xx_voip_dsp_device);
--}
---- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
-+++ /dev/null
-@@ -1,13 +0,0 @@
--#ifndef __BCM63XX_DSP_H
--#define __BCM63XX_DSP_H
--
--struct bcm63xx_dsp_platform_data {
--      unsigned gpio_rst;
--      unsigned gpio_int;
--      unsigned cs;
--      unsigned ext_irq;
--};
--
--int __init bcm63xx_dsp_register(const struct bcm63xx_dsp_platform_data *pd);
--
--#endif /* __BCM63XX_DSP_H */
---- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
-+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
-@@ -6,7 +6,6 @@
- #include <linux/leds.h>
- #include <bcm63xx_dev_enet.h>
- #include <bcm63xx_dev_usb_usbd.h>
--#include <bcm63xx_dev_dsp.h>
- /*
-  * flash mapping
-@@ -30,7 +29,6 @@ struct board_info {
-       unsigned int    has_ohci0:1;
-       unsigned int    has_ehci0:1;
-       unsigned int    has_usbd:1;
--      unsigned int    has_dsp:1;
-       unsigned int    has_uart0:1;
-       unsigned int    has_uart1:1;
-@@ -42,9 +40,6 @@ struct board_info {
-       /* USB config */
-       struct bcm63xx_usbd_platform_data usbd;
--      /* DSP config */
--      struct bcm63xx_dsp_platform_data dsp;
--
-       /* GPIO LEDs */
-       struct gpio_led leds[5];
diff --git a/target/linux/brcm63xx/patches-4.9/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch b/target/linux/brcm63xx/patches-4.9/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch
deleted file mode 100644 (file)
index 67c5ef4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-From 80a2f983e9f44dbc3e01ae31c62d877846a7f791 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:19 +0100
-Subject: [PATCH 01/11] MIPS: BCM63XX: add USB host clock enable delay
-
-Knowledge of the clock setup delay should remain at the clock level (so
-it can be clock specific and CPU specific). Add the 100 milliseconds
-required clock delay for the USB host clock when it gets enabled.
-
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/clk.c |    5 +++++
- 1 file changed, 5 insertions(+)
-
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -213,6 +213,11 @@ static void usbh_set(struct clk *clk, in
-               bcm_hwclock_set(CKCTL_6362_USBH_EN, enable);
-       else if (BCMCPU_IS_6368())
-               bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
-+      else
-+              return;
-+
-+      if (enable)
-+              msleep(100);
- }
- static struct clk clk_usbh = {
diff --git a/target/linux/brcm63xx/patches-4.9/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch b/target/linux/brcm63xx/patches-4.9/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch
deleted file mode 100644 (file)
index 1c6fa7c..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-From 8e9bf528a122741f0171b89c297b63041116d704 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:20 +0100
-Subject: [PATCH 02/11] MIPS: BCM63XX: add USB device clock enable delay to
- clock code
-
-This patch adds the required 10 micro seconds delay to the USB device
-clock enable operation. Put this where the correct clock knowledege is,
-which is in the clock code, and remove this delay from the bcm63xx_udc
-gadget driver where it was before.
-
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/clk.c          |    5 +++++
- drivers/usb/gadget/bcm63xx_udc.c |    1 -
- 2 files changed, 5 insertions(+), 1 deletion(-)
-
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -235,6 +235,11 @@ static void usbd_set(struct clk *clk, in
-               bcm_hwclock_set(CKCTL_6362_USBD_EN, enable);
-       else if (BCMCPU_IS_6368())
-               bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
-+      else
-+              return;
-+
-+      if (enable)
-+              udelay(10);
- }
- static struct clk clk_usbd = {
---- a/drivers/usb/gadget/udc/bcm63xx_udc.c
-+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
-@@ -410,7 +410,6 @@ static inline void set_clocks(struct bcm
-       if (is_enabled) {
-               clk_enable(udc->usbh_clk);
-               clk_enable(udc->usbd_clk);
--              udelay(10);
-       } else {
-               clk_disable(udc->usbd_clk);
-               clk_disable(udc->usbh_clk);
diff --git a/target/linux/brcm63xx/patches-4.9/102-MIPS-BCM63XX-move-code-touching-the-USB-private-regi.patch b/target/linux/brcm63xx/patches-4.9/102-MIPS-BCM63XX-move-code-touching-the-USB-private-regi.patch
deleted file mode 100644 (file)
index 442eb37..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-From ac9b0b574d54be28b300bf99ffe092a2c589484f Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:21 +0100
-Subject: [PATCH 03/11] MIPS: BCM63XX: move code touching the USB private
- register
-
-This patch moves the code touching the USB private register in the
-bcm63xx USB gadget driver to arch/mips/bcm63xx/usb-common.c in
-preparation for adding support for OHCI and EHCI host controllers which
-will also touch the USB private register.
-
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/Makefile                         |    2 +-
- arch/mips/bcm63xx/usb-common.c                     |   53 ++++++++++++++++++++
- .../include/asm/mach-bcm63xx/bcm63xx_usb_priv.h    |    9 ++++
- drivers/usb/gadget/bcm63xx_udc.c                   |   27 ++--------
- 4 files changed, 67 insertions(+), 24 deletions(-)
- create mode 100644 arch/mips/bcm63xx/usb-common.c
- create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_usb_priv.h
-
---- a/arch/mips/bcm63xx/Makefile
-+++ b/arch/mips/bcm63xx/Makefile
-@@ -1,7 +1,7 @@
- obj-y         += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \
-                  setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \
-                  dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \
--                 dev-usb-usbd.o
-+                 dev-usb-usbd.o usb-common.o
- obj-$(CONFIG_EARLY_PRINTK)    += early_printk.o
- obj-y         += boards/
---- /dev/null
-+++ b/arch/mips/bcm63xx/usb-common.c
-@@ -0,0 +1,53 @@
-+/*
-+ * Broadcom BCM63xx common USB device configuration code
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2012 Kevin Cernekee <cernekee@gmail.com>
-+ * Copyright (C) 2012 Broadcom Corporation
-+ *
-+ */
-+#include <linux/export.h>
-+
-+#include <bcm63xx_cpu.h>
-+#include <bcm63xx_regs.h>
-+#include <bcm63xx_io.h>
-+#include <bcm63xx_usb_priv.h>
-+
-+void bcm63xx_usb_priv_select_phy_mode(u32 portmask, bool is_device)
-+{
-+      u32 val;
-+
-+      val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
-+      if (is_device) {
-+              val |= (portmask << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT);
-+              val |= (portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
-+      } else {
-+              val &= ~(portmask << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT);
-+              val &= ~(portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
-+      }
-+      bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_UTMI_CTL_6368_REG);
-+
-+      val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
-+      if (is_device)
-+              val |= USBH_PRIV_SWAP_USBD_MASK;
-+      else
-+              val &= ~USBH_PRIV_SWAP_USBD_MASK;
-+      bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_SWAP_6368_REG);
-+}
-+EXPORT_SYMBOL(bcm63xx_usb_priv_select_phy_mode);
-+
-+void bcm63xx_usb_priv_select_pullup(u32 portmask, bool is_on)
-+{
-+      u32 val;
-+
-+      val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
-+      if (is_on)
-+              val &= ~(portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
-+      else
-+              val |= (portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
-+      bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_UTMI_CTL_6368_REG);
-+}
-+EXPORT_SYMBOL(bcm63xx_usb_priv_select_pullup);
---- /dev/null
-+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_usb_priv.h
-@@ -0,0 +1,9 @@
-+#ifndef BCM63XX_USB_PRIV_H_
-+#define BCM63XX_USB_PRIV_H_
-+
-+#include <linux/types.h>
-+
-+void bcm63xx_usb_priv_select_phy_mode(u32 portmask, bool is_device);
-+void bcm63xx_usb_priv_select_pullup(u32 portmask, bool is_on);
-+
-+#endif /* BCM63XX_USB_PRIV_H_ */
---- a/drivers/usb/gadget/udc/bcm63xx_udc.c
-+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
-@@ -39,6 +39,7 @@
- #include <bcm63xx_dev_usb_usbd.h>
- #include <bcm63xx_io.h>
- #include <bcm63xx_regs.h>
-+#include <bcm63xx_usb_priv.h>
- #define DRV_MODULE_NAME               "bcm63xx_udc"
-@@ -887,22 +888,7 @@ static void bcm63xx_select_phy_mode(stru
-               bcm_gpio_writel(val, GPIO_PINMUX_OTHR_REG);
-       }
--      val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
--      if (is_device) {
--              val |= (portmask << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT);
--              val |= (portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
--      } else {
--              val &= ~(portmask << USBH_PRIV_UTMI_CTL_HOSTB_SHIFT);
--              val &= ~(portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
--      }
--      bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_UTMI_CTL_6368_REG);
--
--      val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
--      if (is_device)
--              val |= USBH_PRIV_SWAP_USBD_MASK;
--      else
--              val &= ~USBH_PRIV_SWAP_USBD_MASK;
--      bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_SWAP_6368_REG);
-+      bcm63xx_usb_priv_select_phy_mode(portmask, is_device);
- }
- /**
-@@ -916,14 +902,9 @@ static void bcm63xx_select_phy_mode(stru
-  */
- static void bcm63xx_select_pullup(struct bcm63xx_udc *udc, bool is_on)
- {
--      u32 val, portmask = BIT(udc->pd->port_no);
-+      u32 portmask = BIT(udc->pd->port_no);
--      val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
--      if (is_on)
--              val &= ~(portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
--      else
--              val |= (portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
--      bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_UTMI_CTL_6368_REG);
-+      bcm63xx_usb_priv_select_pullup(portmask, is_on);
- }
- /**
diff --git a/target/linux/brcm63xx/patches-4.9/103-MIPS-BCM63XX-add-OHCI-EHCI-configuration-bits-to-com.patch b/target/linux/brcm63xx/patches-4.9/103-MIPS-BCM63XX-add-OHCI-EHCI-configuration-bits-to-com.patch
deleted file mode 100644 (file)
index 40bbe08..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-From 28758a9da77954ed323f86123ef448c6a563c037 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:22 +0100
-Subject: [PATCH 04/11] MIPS: BCM63XX: add OHCI/EHCI configuration bits to
- common USB code
-
-This patch updates the common USB code touching the USB private
-registers with the specific bits to properly enable OHCI and EHCI
-controllers on BCM63xx SoCs. As a result we now need to protect access
-to Read Modify Write sequences using a spinlock because we cannot
-guarantee that any of the exposed helper will not be called
-concurrently.
-
-Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/usb-common.c                     |   97 ++++++++++++++++++++
- .../include/asm/mach-bcm63xx/bcm63xx_usb_priv.h    |    2 +
- 2 files changed, 99 insertions(+)
-
---- a/arch/mips/bcm63xx/usb-common.c
-+++ b/arch/mips/bcm63xx/usb-common.c
-@@ -5,10 +5,12 @@
-  * License.  See the file "COPYING" in the main directory of this archive
-  * for more details.
-  *
-+ * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
-  * Copyright (C) 2012 Kevin Cernekee <cernekee@gmail.com>
-  * Copyright (C) 2012 Broadcom Corporation
-  *
-  */
-+#include <linux/spinlock.h>
- #include <linux/export.h>
- #include <bcm63xx_cpu.h>
-@@ -16,9 +18,14 @@
- #include <bcm63xx_io.h>
- #include <bcm63xx_usb_priv.h>
-+static DEFINE_SPINLOCK(usb_priv_reg_lock);
-+
- void bcm63xx_usb_priv_select_phy_mode(u32 portmask, bool is_device)
- {
-       u32 val;
-+      unsigned long flags;
-+
-+      spin_lock_irqsave(&usb_priv_reg_lock, flags);
-       val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
-       if (is_device) {
-@@ -36,12 +43,17 @@ void bcm63xx_usb_priv_select_phy_mode(u3
-       else
-               val &= ~USBH_PRIV_SWAP_USBD_MASK;
-       bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_SWAP_6368_REG);
-+
-+      spin_unlock_irqrestore(&usb_priv_reg_lock, flags);
- }
- EXPORT_SYMBOL(bcm63xx_usb_priv_select_phy_mode);
- void bcm63xx_usb_priv_select_pullup(u32 portmask, bool is_on)
- {
-       u32 val;
-+      unsigned long flags;
-+
-+      spin_lock_irqsave(&usb_priv_reg_lock, flags);
-       val = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_UTMI_CTL_6368_REG);
-       if (is_on)
-@@ -49,5 +61,90 @@ void bcm63xx_usb_priv_select_pullup(u32
-       else
-               val |= (portmask << USBH_PRIV_UTMI_CTL_NODRIV_SHIFT);
-       bcm_rset_writel(RSET_USBH_PRIV, val, USBH_PRIV_UTMI_CTL_6368_REG);
-+
-+      spin_unlock_irqrestore(&usb_priv_reg_lock, flags);
- }
- EXPORT_SYMBOL(bcm63xx_usb_priv_select_pullup);
-+
-+/* The following array represents the meaning of the DESC/DATA
-+ * endian swapping with respect to the CPU configured endianness
-+ *
-+ * DATA       ENDN    mmio    descriptor
-+ * 0  0       BE      invalid
-+ * 0  1       BE      LE
-+ * 1  0       BE      BE
-+ * 1  1       BE      invalid
-+ *
-+ * Since BCM63XX SoCs are configured to be in big-endian mode
-+ * we want configuration at line 3.
-+ */
-+void bcm63xx_usb_priv_ohci_cfg_set(void)
-+{
-+      u32 reg;
-+      unsigned long flags;
-+
-+      spin_lock_irqsave(&usb_priv_reg_lock, flags);
-+
-+      if (BCMCPU_IS_6348())
-+              bcm_rset_writel(RSET_OHCI_PRIV, 0, OHCI_PRIV_REG);
-+      else if (BCMCPU_IS_6358()) {
-+              reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6358_REG);
-+              reg &= ~USBH_PRIV_SWAP_OHCI_ENDN_MASK;
-+              reg |= USBH_PRIV_SWAP_OHCI_DATA_MASK;
-+              bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_6358_REG);
-+              /*
-+               * The magic value comes for the original vendor BSP
-+               * and is needed for USB to work. Datasheet does not
-+               * help, so the magic value is used as-is.
-+               */
-+              bcm_rset_writel(RSET_USBH_PRIV, 0x1c0020,
-+                              USBH_PRIV_TEST_6358_REG);
-+
-+      } else if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) {
-+              reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
-+              reg &= ~USBH_PRIV_SWAP_OHCI_ENDN_MASK;
-+              reg |= USBH_PRIV_SWAP_OHCI_DATA_MASK;
-+              bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_6368_REG);
-+
-+              reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SETUP_6368_REG);
-+              reg |= USBH_PRIV_SETUP_IOC_MASK;
-+              bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SETUP_6368_REG);
-+      }
-+
-+      spin_unlock_irqrestore(&usb_priv_reg_lock, flags);
-+}
-+
-+void bcm63xx_usb_priv_ehci_cfg_set(void)
-+{
-+      u32 reg;
-+      unsigned long flags;
-+
-+      spin_lock_irqsave(&usb_priv_reg_lock, flags);
-+
-+      if (BCMCPU_IS_6358()) {
-+              reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6358_REG);
-+              reg &= ~USBH_PRIV_SWAP_EHCI_ENDN_MASK;
-+              reg |= USBH_PRIV_SWAP_EHCI_DATA_MASK;
-+              bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_6358_REG);
-+
-+              /*
-+               * The magic value comes for the original vendor BSP
-+               * and is needed for USB to work. Datasheet does not
-+               * help, so the magic value is used as-is.
-+               */
-+              bcm_rset_writel(RSET_USBH_PRIV, 0x1c0020,
-+                              USBH_PRIV_TEST_6358_REG);
-+
-+      } else if (BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) {
-+              reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SWAP_6368_REG);
-+              reg &= ~USBH_PRIV_SWAP_EHCI_ENDN_MASK;
-+              reg |= USBH_PRIV_SWAP_EHCI_DATA_MASK;
-+              bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SWAP_6368_REG);
-+
-+              reg = bcm_rset_readl(RSET_USBH_PRIV, USBH_PRIV_SETUP_6368_REG);
-+              reg |= USBH_PRIV_SETUP_IOC_MASK;
-+              bcm_rset_writel(RSET_USBH_PRIV, reg, USBH_PRIV_SETUP_6368_REG);
-+      }
-+
-+      spin_unlock_irqrestore(&usb_priv_reg_lock, flags);
-+}
---- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_usb_priv.h
-+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_usb_priv.h
-@@ -5,5 +5,7 @@
- void bcm63xx_usb_priv_select_phy_mode(u32 portmask, bool is_device);
- void bcm63xx_usb_priv_select_pullup(u32 portmask, bool is_on);
-+void bcm63xx_usb_priv_ohci_cfg_set(void);
-+void bcm63xx_usb_priv_ehci_cfg_set(void);
- #endif /* BCM63XX_USB_PRIV_H_ */
diff --git a/target/linux/brcm63xx/patches-4.9/104-MIPS-BCM63XX-introduce-BCM63XX_OHCI-configuration-sy.patch b/target/linux/brcm63xx/patches-4.9/104-MIPS-BCM63XX-introduce-BCM63XX_OHCI-configuration-sy.patch
deleted file mode 100644 (file)
index 768dcca..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-From 94ec618bd1a6b07fafbbfc9bcc54e7f9360ff9a0 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:23 +0100
-Subject: [PATCH 05/11] MIPS: BCM63XX: introduce BCM63XX_OHCI configuration
- symbol
-
-This configuration symbol can be used by CPUs supporting the on-chip
-OHCI controller, and ensures that all relevant OHCI-related
-configuration options are correctly selected. So far, OHCI support is
-available for the 6328, 6348, 6358 and 6358 SoCs.
-
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/Kconfig |   15 ++++++++++-----
- 1 file changed, 10 insertions(+), 5 deletions(-)
-
---- a/arch/mips/bcm63xx/Kconfig
-+++ b/arch/mips/bcm63xx/Kconfig
-@@ -6,10 +6,17 @@ config BCM63XX_CPU_3368
-       select SYS_HAS_CPU_BMIPS4350
-       select HW_HAS_PCI
-+config BCM63XX_OHCI
-+      bool
-+      select USB_ARCH_HAS_OHCI
-+      select USB_OHCI_BIG_ENDIAN_DESC if USB_OHCI_HCD
-+      select USB_OHCI_BIG_ENDIAN_MMIO if USB_OHCI_HCD
-+
- config BCM63XX_CPU_6328
-       bool "support 6328 CPU"
-       select SYS_HAS_CPU_BMIPS4350
-       select HW_HAS_PCI
-+      select BCM63XX_OHCI
- config BCM63XX_CPU_6338
-       bool "support 6338 CPU"
-@@ -24,21 +31,25 @@ config BCM63XX_CPU_6348
-       bool "support 6348 CPU"
-       select SYS_HAS_CPU_BMIPS32_3300
-       select HW_HAS_PCI
-+      select BCM63XX_OHCI
- config BCM63XX_CPU_6358
-       bool "support 6358 CPU"
-       select SYS_HAS_CPU_BMIPS4350
-       select HW_HAS_PCI
-+      select BCM63XX_OHCI
- config BCM63XX_CPU_6362
-       bool "support 6362 CPU"
-       select SYS_HAS_CPU_BMIPS4350
-       select HW_HAS_PCI
-+      select BCM63XX_OHCI
- config BCM63XX_CPU_6368
-       bool "support 6368 CPU"
-       select SYS_HAS_CPU_BMIPS4350
-       select HW_HAS_PCI
-+      select BCM63XX_OHCI
- endmenu
- source "arch/mips/bcm63xx/boards/Kconfig"
diff --git a/target/linux/brcm63xx/patches-4.9/105-MIPS-BCM63XX-add-support-for-the-on-chip-OHCI-contro.patch b/target/linux/brcm63xx/patches-4.9/105-MIPS-BCM63XX-add-support-for-the-on-chip-OHCI-contro.patch
deleted file mode 100644 (file)
index 76c6a5c..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-From 30d22baef255c99a12c4858ce4ab0d45f0d8c9ae Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:24 +0100
-Subject: [PATCH 06/11] MIPS: BCM63XX: add support for the on-chip OHCI
- controller
-
-Broadcom BCM63XX SoCs include an on-chip OHCI controller which can be
-driven by the ohci-platform generic driver by using specific power
-on/off/suspend callback to manage clocks and hardware specific
-configuration.
-
-Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/Makefile                         |    2 +-
- arch/mips/bcm63xx/dev-usb-ohci.c                   |   94 ++++++++++++++++++++
- .../asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h        |    6 ++
- 3 files changed, 101 insertions(+), 1 deletion(-)
- create mode 100644 arch/mips/bcm63xx/dev-usb-ohci.c
- create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
-
---- a/arch/mips/bcm63xx/Makefile
-+++ b/arch/mips/bcm63xx/Makefile
-@@ -1,7 +1,7 @@
- obj-y         += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \
-                  setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \
-                  dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \
--                 dev-usb-usbd.o usb-common.o
-+                 dev-usb-ohci.o dev-usb-usbd.o usb-common.o
- obj-$(CONFIG_EARLY_PRINTK)    += early_printk.o
- obj-y         += boards/
---- /dev/null
-+++ b/arch/mips/bcm63xx/dev-usb-ohci.c
-@@ -0,0 +1,94 @@
-+/*
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
-+ * Copyright (C) 2013 Florian Fainelli <florian@openwrt.org>
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/platform_device.h>
-+#include <linux/usb/ohci_pdriver.h>
-+#include <linux/dma-mapping.h>
-+#include <linux/clk.h>
-+#include <linux/delay.h>
-+
-+#include <bcm63xx_cpu.h>
-+#include <bcm63xx_regs.h>
-+#include <bcm63xx_io.h>
-+#include <bcm63xx_usb_priv.h>
-+#include <bcm63xx_dev_usb_ohci.h>
-+
-+static struct resource ohci_resources[] = {
-+      {
-+              .start          = -1, /* filled at runtime */
-+              .end            = -1, /* filled at runtime */
-+              .flags          = IORESOURCE_MEM,
-+      },
-+      {
-+              .start          = -1, /* filled at runtime */
-+              .flags          = IORESOURCE_IRQ,
-+      },
-+};
-+
-+static u64 ohci_dmamask = DMA_BIT_MASK(32);
-+
-+static struct clk *usb_host_clock;
-+
-+static int bcm63xx_ohci_power_on(struct platform_device *pdev)
-+{
-+      usb_host_clock = clk_get(&pdev->dev, "usbh");
-+      if (IS_ERR_OR_NULL(usb_host_clock))
-+              return -ENODEV;
-+
-+      clk_prepare_enable(usb_host_clock);
-+
-+      bcm63xx_usb_priv_ohci_cfg_set();
-+
-+      return 0;
-+}
-+
-+static void bcm63xx_ohci_power_off(struct platform_device *pdev)
-+{
-+      if (!IS_ERR_OR_NULL(usb_host_clock)) {
-+              clk_disable_unprepare(usb_host_clock);
-+              clk_put(usb_host_clock);
-+      }
-+}
-+
-+static struct usb_ohci_pdata bcm63xx_ohci_pdata = {
-+      .big_endian_desc        = 1,
-+      .big_endian_mmio        = 1,
-+      .no_big_frame_no        = 1,
-+      .num_ports              = 1,
-+      .power_on               = bcm63xx_ohci_power_on,
-+      .power_off              = bcm63xx_ohci_power_off,
-+      .power_suspend          = bcm63xx_ohci_power_off,
-+};
-+
-+static struct platform_device bcm63xx_ohci_device = {
-+      .name           = "ohci-platform",
-+      .id             = -1,
-+      .num_resources  = ARRAY_SIZE(ohci_resources),
-+      .resource       = ohci_resources,
-+      .dev            = {
-+              .platform_data          = &bcm63xx_ohci_pdata,
-+              .dma_mask               = &ohci_dmamask,
-+              .coherent_dma_mask      = DMA_BIT_MASK(32),
-+      },
-+};
-+
-+int __init bcm63xx_ohci_register(void)
-+{
-+      if (BCMCPU_IS_6345() || BCMCPU_IS_6338())
-+              return -ENODEV;
-+
-+      ohci_resources[0].start = bcm63xx_regset_address(RSET_OHCI0);
-+      ohci_resources[0].end = ohci_resources[0].start;
-+      ohci_resources[0].end += RSET_OHCI_SIZE - 1;
-+      ohci_resources[1].start = bcm63xx_get_irq_number(IRQ_OHCI0);
-+
-+      return platform_device_register(&bcm63xx_ohci_device);
-+}
---- /dev/null
-+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ohci.h
-@@ -0,0 +1,6 @@
-+#ifndef BCM63XX_DEV_USB_OHCI_H_
-+#define BCM63XX_DEV_USB_OHCI_H_
-+
-+int bcm63xx_ohci_register(void);
-+
-+#endif /* BCM63XX_DEV_USB_OHCI_H_ */
diff --git a/target/linux/brcm63xx/patches-4.9/106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch b/target/linux/brcm63xx/patches-4.9/106-MIPS-BCM63XX-register-OHCI-controller-if-board-enabl.patch
deleted file mode 100644 (file)
index 6fc5551..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-From 33ef960aed15f9a98a2c51d8d794cd72418e0be4 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:25 +0100
-Subject: [PATCH 07/11] MIPS: BCM63XX: register OHCI controller if board
- enables it
-
-BCM63XX-based boards can control the registration of the OHCI controller
-by setting their has_ohci0 flag to 1. Handle this in the generic
-code dealing with board registration and call the actual helper to
-register the OHCI controller.
-
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/boards/board_bcm963xx.c |    4 ++++
- 1 file changed, 4 insertions(+)
-
---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
-+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -27,6 +27,7 @@
- #include <bcm63xx_dev_hsspi.h>
- #include <bcm63xx_dev_pcmcia.h>
- #include <bcm63xx_dev_spi.h>
-+#include <bcm63xx_dev_usb_ohci.h>
- #include <bcm63xx_dev_usb_usbd.h>
- #include <board_bcm963xx.h>
-@@ -881,6 +882,9 @@ int __init board_register_devices(void)
-       if (board.has_usbd)
-               bcm63xx_usbd_register(&board.usbd);
-+      if (board.has_ohci0)
-+              bcm63xx_ohci_register();
-+
-       /* Generate MAC address for WLAN and register our SPROM,
-        * do this after registering enet devices
-        */
diff --git a/target/linux/brcm63xx/patches-4.9/107-MIPS-BCM63XX-introduce-BCM63XX_EHCI-configuration-sy.patch b/target/linux/brcm63xx/patches-4.9/107-MIPS-BCM63XX-introduce-BCM63XX_EHCI-configuration-sy.patch
deleted file mode 100644 (file)
index bce91e3..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-From 00da1683364e58c6430a4577123d01037f8faddc Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:26 +0100
-Subject: [PATCH 08/11] MIPS: BCM63XX: introduce BCM63XX_EHCI configuration
- symbol
-
-This configuration symbol can be used by CPUs supporting the on-chip
-EHCI controller, and ensures that all relevant EHCI-related
-configuration options are selected. So far BCM6328, BCM6358 and BCM6368
-have an EHCI controller and do select this symbol. Update
-drivers/usb/host/Kconfig with BCM63XX to update direct unmet
-dependencies.
-
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/Kconfig |    9 +++++++++
- drivers/usb/host/Kconfig  |    5 +++--
- 2 files changed, 12 insertions(+), 2 deletions(-)
-
---- a/arch/mips/bcm63xx/Kconfig
-+++ b/arch/mips/bcm63xx/Kconfig
-@@ -12,11 +12,18 @@ config BCM63XX_OHCI
-       select USB_OHCI_BIG_ENDIAN_DESC if USB_OHCI_HCD
-       select USB_OHCI_BIG_ENDIAN_MMIO if USB_OHCI_HCD
-+config BCM63XX_EHCI
-+      bool
-+      select USB_ARCH_HAS_EHCI
-+      select USB_EHCI_BIG_ENDIAN_DESC if USB_EHCI_HCD
-+      select USB_EHCI_BIG_ENDIAN_MMIO if USB_EHCI_HCD
-+
- config BCM63XX_CPU_6328
-       bool "support 6328 CPU"
-       select SYS_HAS_CPU_BMIPS4350
-       select HW_HAS_PCI
-       select BCM63XX_OHCI
-+      select BCM63XX_EHCI
- config BCM63XX_CPU_6338
-       bool "support 6338 CPU"
-@@ -38,18 +45,21 @@ config BCM63XX_CPU_6358
-       select SYS_HAS_CPU_BMIPS4350
-       select HW_HAS_PCI
-       select BCM63XX_OHCI
-+      select BCM63XX_EHCI
- config BCM63XX_CPU_6362
-       bool "support 6362 CPU"
-       select SYS_HAS_CPU_BMIPS4350
-       select HW_HAS_PCI
-       select BCM63XX_OHCI
-+      select BCM63XX_EHCI
- config BCM63XX_CPU_6368
-       bool "support 6368 CPU"
-       select SYS_HAS_CPU_BMIPS4350
-       select HW_HAS_PCI
-       select BCM63XX_OHCI
-+      select BCM63XX_EHCI
- endmenu
- source "arch/mips/bcm63xx/boards/Kconfig"
diff --git a/target/linux/brcm63xx/patches-4.9/108-MIPS-BCM63XX-add-support-for-the-on-chip-EHCI-contro.patch b/target/linux/brcm63xx/patches-4.9/108-MIPS-BCM63XX-add-support-for-the-on-chip-EHCI-contro.patch
deleted file mode 100644 (file)
index 94896d9..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-From e38f13bd6408769c0b565bb1079024f496eee121 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:27 +0100
-Subject: [PATCH 09/11] MIPS: BCM63XX: add support for the on-chip EHCI
- controller
-
-Broadcom BCM63XX SoCs include an on-chip EHCI controller which can be
-driven by the generic ehci-platform driver by using specific power
-on/off/suspend callbacks to manage clocks and hardware specific
-configuration.
-
-Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/Makefile                         |    2 +-
- arch/mips/bcm63xx/dev-usb-ehci.c                   |   92 ++++++++++++++++++++
- .../asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h        |    6 ++
- 3 files changed, 99 insertions(+), 1 deletion(-)
- create mode 100644 arch/mips/bcm63xx/dev-usb-ehci.c
- create mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
-
---- a/arch/mips/bcm63xx/Makefile
-+++ b/arch/mips/bcm63xx/Makefile
-@@ -1,7 +1,7 @@
- obj-y         += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \
-                  setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \
-                  dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \
--                 dev-usb-ohci.o dev-usb-usbd.o usb-common.o
-+                 dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o usb-common.o
- obj-$(CONFIG_EARLY_PRINTK)    += early_printk.o
- obj-y         += boards/
---- /dev/null
-+++ b/arch/mips/bcm63xx/dev-usb-ehci.c
-@@ -0,0 +1,92 @@
-+/*
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
-+ * Copyright (C) 2013 Florian Fainelli <florian@openwrt.org>
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/platform_device.h>
-+#include <linux/clk.h>
-+#include <linux/delay.h>
-+#include <linux/usb/ehci_pdriver.h>
-+#include <linux/dma-mapping.h>
-+
-+#include <bcm63xx_cpu.h>
-+#include <bcm63xx_regs.h>
-+#include <bcm63xx_io.h>
-+#include <bcm63xx_usb_priv.h>
-+#include <bcm63xx_dev_usb_ehci.h>
-+
-+static struct resource ehci_resources[] = {
-+      {
-+              .start          = -1, /* filled at runtime */
-+              .end            = -1, /* filled at runtime */
-+              .flags          = IORESOURCE_MEM,
-+      },
-+      {
-+              .start          = -1, /* filled at runtime */
-+              .flags          = IORESOURCE_IRQ,
-+      },
-+};
-+
-+static u64 ehci_dmamask = DMA_BIT_MASK(32);
-+
-+static struct clk *usb_host_clock;
-+
-+static int bcm63xx_ehci_power_on(struct platform_device *pdev)
-+{
-+      usb_host_clock = clk_get(&pdev->dev, "usbh");
-+      if (IS_ERR_OR_NULL(usb_host_clock))
-+              return -ENODEV;
-+
-+      clk_prepare_enable(usb_host_clock);
-+
-+      bcm63xx_usb_priv_ehci_cfg_set();
-+
-+      return 0;
-+}
-+
-+static void bcm63xx_ehci_power_off(struct platform_device *pdev)
-+{
-+      if (!IS_ERR_OR_NULL(usb_host_clock)) {
-+              clk_disable_unprepare(usb_host_clock);
-+              clk_put(usb_host_clock);
-+      }
-+}
-+
-+static struct usb_ehci_pdata bcm63xx_ehci_pdata = {
-+      .big_endian_desc        = 1,
-+      .big_endian_mmio        = 1,
-+      .power_on               = bcm63xx_ehci_power_on,
-+      .power_off              = bcm63xx_ehci_power_off,
-+      .power_suspend          = bcm63xx_ehci_power_off,
-+};
-+
-+static struct platform_device bcm63xx_ehci_device = {
-+      .name           = "ehci-platform",
-+      .id             = -1,
-+      .num_resources  = ARRAY_SIZE(ehci_resources),
-+      .resource       = ehci_resources,
-+      .dev            = {
-+              .platform_data          = &bcm63xx_ehci_pdata,
-+              .dma_mask               = &ehci_dmamask,
-+              .coherent_dma_mask      = DMA_BIT_MASK(32),
-+      },
-+};
-+
-+int __init bcm63xx_ehci_register(void)
-+{
-+      if (!BCMCPU_IS_6328() && !BCMCPU_IS_6358() && !BCMCPU_IS_6362() && !BCMCPU_IS_6368())
-+              return 0;
-+
-+      ehci_resources[0].start = bcm63xx_regset_address(RSET_EHCI0);
-+      ehci_resources[0].end = ehci_resources[0].start;
-+      ehci_resources[0].end += RSET_EHCI_SIZE - 1;
-+      ehci_resources[1].start = bcm63xx_get_irq_number(IRQ_EHCI0);
-+
-+      return platform_device_register(&bcm63xx_ehci_device);
-+}
---- /dev/null
-+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_usb_ehci.h
-@@ -0,0 +1,6 @@
-+#ifndef BCM63XX_DEV_USB_EHCI_H_
-+#define BCM63XX_DEV_USB_EHCI_H_
-+
-+int bcm63xx_ehci_register(void);
-+
-+#endif /* BCM63XX_DEV_USB_EHCI_H_ */
diff --git a/target/linux/brcm63xx/patches-4.9/109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch b/target/linux/brcm63xx/patches-4.9/109-MIPS-BCM63XX-register-EHCI-controller-if-board-enabl.patch
deleted file mode 100644 (file)
index 3db82bb..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-From 709ef2034f5ba06da35f89856ad7baf2b7a41287 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:28 +0100
-Subject: [PATCH 10/11] MIPS: BCM63XX: register EHCI controller if board
- enables it
-
-BCM63XX-based board can control the registration of the EHCI controller
-by setting their has_ehci0 flag to 1. Handle this in the generic
-code dealing with board registration and call the actual helper to register
-the EHCI controller.
-
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/boards/board_bcm963xx.c |    4 ++++
- 1 file changed, 4 insertions(+)
-
---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
-+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
-@@ -27,6 +27,7 @@
- #include <bcm63xx_dev_hsspi.h>
- #include <bcm63xx_dev_pcmcia.h>
- #include <bcm63xx_dev_spi.h>
-+#include <bcm63xx_dev_usb_ehci.h>
- #include <bcm63xx_dev_usb_ohci.h>
- #include <bcm63xx_dev_usb_usbd.h>
- #include <board_bcm963xx.h>
-@@ -882,6 +883,9 @@ int __init board_register_devices(void)
-       if (board.has_usbd)
-               bcm63xx_usbd_register(&board.usbd);
-+      if (board.has_ehci0)
-+              bcm63xx_ehci_register();
-+
-       if (board.has_ohci0)
-               bcm63xx_ohci_register();
diff --git a/target/linux/brcm63xx/patches-4.9/110-MIPS-BCM63XX-EHCI-controller-does-not-support-overcu.patch b/target/linux/brcm63xx/patches-4.9/110-MIPS-BCM63XX-EHCI-controller-does-not-support-overcu.patch
deleted file mode 100644 (file)
index 6d91129..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From 111bbd770441ab34f9da5bb1d85767a9b75227b4 Mon Sep 17 00:00:00 2001
-From: Florian Fainelli <florian@openwrt.org>
-Date: Mon, 28 Jan 2013 20:06:30 +0100
-Subject: [PATCH 12/12] MIPS: BCM63XX: EHCI controller does not support
- overcurrent
-
-This patch sets the ignore_oc flag for the BCM63XX EHCI controller as it
-does not support proper overcurrent reporting.
-
-Signed-off-by: Florian Fainelli <florian@openwrt.org>
----
- arch/mips/bcm63xx/dev-usb-ehci.c |    1 +
- 1 file changed, 1 insertion(+)
-
---- a/arch/mips/bcm63xx/dev-usb-ehci.c
-+++ b/arch/mips/bcm63xx/dev-usb-ehci.c
-@@ -61,6 +61,7 @@ static void bcm63xx_ehci_power_off(struc
- static struct usb_ehci_pdata bcm63xx_ehci_pdata = {
-       .big_endian_desc        = 1,
-       .big_endian_mmio        = 1,
-+      .ignore_oc              = 1,
-       .power_on               = bcm63xx_ehci_power_on,
-       .power_off              = bcm63xx_ehci_power_off,
-       .power_suspend          = bcm63xx_ehci_power_off,
diff --git a/target/linux/brcm63xx/patches-4.9/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch b/target/linux/brcm63xx/patches-4.9/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch
deleted file mode 100644 (file)
index bc4394e..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-From patchwork Tue Jul 18 10:17:27 2017
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 7bit
-Subject: [6/9] MIPS: BCM63XX: allow NULL clock for clk_get_rate
-X-Patchwork-Submitter: Jonas Gorski <jonas.gorski@gmail.com>
-X-Patchwork-Id: 16776
-Message-Id: <20170718101730.2541-7-jonas.gorski@gmail.com>
-To: unlisted-recipients:; (no To-header on input)
-Cc: Ralf Baechle <ralf@linux-mips.org>,
- Florian Fainelli <f.fainelli@gmail.com>,
- bcm-kernel-feedback-list@broadcom.com,
- James Hogan <james.hogan@imgtec.com>,
- linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
-Date: Tue, 18 Jul 2017 12:17:27 +0200
-From: Jonas Gorski <jonas.gorski@gmail.com>
-List-Id: linux-mips <linux-mips.eddie.linux-mips.org>
-
-Make the behaviour of clk_get_rate consistent with common clk's
-clk_get_rate by accepting NULL clocks as parameter. Some device
-drivers rely on this, and will cause an OOPS otherwise.
-
-Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.")
-Cc: Ralf Baechle <ralf@linux-mips.org>
-Cc: Florian Fainelli <f.fainelli@gmail.com>
-Cc: bcm-kernel-feedback-list@broadcom.com
-Cc: James Hogan <james.hogan@imgtec.com>
-Cc: linux-mips@linux-mips.org
-Cc: linux-kernel@vger.kernel.org
-Reported-by: Mathias Kresin <dev@kresin.me>
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
-Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
----
- arch/mips/bcm63xx/clk.c | 3 +++
- 1 file changed, 3 insertions(+)
-
---- a/arch/mips/bcm63xx/clk.c
-+++ b/arch/mips/bcm63xx/clk.c
-@@ -392,6 +392,9 @@ EXPORT_SYMBOL(clk_disable);
- unsigned long clk_get_rate(struct clk *clk)
- {
-+      if (!clk)
-+              return 0;
-+
-       return clk->rate;
- }
diff --git a/target/linux/brcm63xx/patches-4.9/121-mtd-bcm63xxpart-move-imagetag-parsing-to-its-own-par.patch b/target/linux/brcm63xx/patches-4.9/121-mtd-bcm63xxpart-move-imagetag-parsing-to-its-own-par.patch
deleted file mode 100644 (file)
index 6a714eb..0000000
+++ /dev/null
@@ -1,481 +0,0 @@
-From a2b8c7f648e168573905818dbb4cb90ca3957c65 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 28 Jun 2017 18:29:43 +0200
-Subject: [PATCH] mtd: bcm63xxpart: move imagetag parsing to its own parser
-
-Move the bcm963xx Image Tag parsing into its own partition parser. This
-Allows reusing the parser with different full flash parsers.
-
-While moving it, rename it to bcm963* to better reflect it isn't chip
-but board specific.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
-I tried to keep the code as-is, to keep the changes as small as
-possible.
-
-One side effect is that the partitions get renumbered, which means any
-root=/dev/mtdblock* will now point to the wrong mtd device. But since
-bcm963xx boards will require these hardcoded in the kernel commandline
-anyway this should b a non issue, as it can be easily updated.
-
-There is no such thing in the mips/bcm63xx defconfig, so nothing to update
-there.
-
- drivers/mtd/Kconfig                   |   1 +
- drivers/mtd/bcm63xxpart.c             | 155 ++----------------------
- drivers/mtd/parsers/Kconfig           |  11 ++
- drivers/mtd/parsers/Makefile          |   1 +
- drivers/mtd/parsers/parser_imagetag.c | 214 ++++++++++++++++++++++++++++++++++
- 5 files changed, 235 insertions(+), 147 deletions(-)
- create mode 100644 drivers/mtd/parsers/parser_imagetag.c
-
---- a/drivers/mtd/Kconfig
-+++ b/drivers/mtd/Kconfig
-@@ -163,6 +163,7 @@ config MTD_BCM63XX_PARTS
-       tristate "BCM63XX CFE partitioning support"
-       depends on BCM63XX || BMIPS_GENERIC || COMPILE_TEST
-       select CRC32
-+      select MTD_PARSER_IMAGETAG
-       help
-         This provides partions parsing for BCM63xx devices with CFE
-         bootloaders.
---- a/drivers/mtd/bcm63xxpart.c
-+++ b/drivers/mtd/bcm63xxpart.c
-@@ -93,51 +93,19 @@ static int bcm63xx_read_nvram(struct mtd
-       return 0;
- }
--static int bcm63xx_read_image_tag(struct mtd_info *master, const char *name,
--      loff_t tag_offset, struct bcm_tag *buf)
--{
--      int ret;
--      size_t retlen;
--      u32 computed_crc;
--
--      ret = mtd_read(master, tag_offset, sizeof(*buf), &retlen, (void *)buf);
--      if (ret)
--              return ret;
--
--      if (retlen != sizeof(*buf))
--              return -EIO;
--
--      computed_crc = crc32_le(IMAGETAG_CRC_START, (u8 *)buf,
--                              offsetof(struct bcm_tag, header_crc));
--      if (computed_crc == buf->header_crc) {
--              STR_NULL_TERMINATE(buf->board_id);
--              STR_NULL_TERMINATE(buf->tag_version);
--
--              pr_info("%s: CFE image tag found at 0x%llx with version %s, board type %s\n",
--                      name, tag_offset, buf->tag_version, buf->board_id);
--
--              return 0;
--      }
--
--      pr_warn("%s: CFE image tag at 0x%llx CRC invalid (expected %08x, actual %08x)\n",
--              name, tag_offset, buf->header_crc, computed_crc);
--      return 1;
--}
-+static const char * const bcm63xx_cfe_part_types[] = {
-+      "bcm963xx-imagetag",
-+      NULL,
-+};
- static int bcm63xx_parse_cfe_nor_partitions(struct mtd_info *master,
-       const struct mtd_partition **pparts, struct bcm963xx_nvram *nvram)
- {
--      /* CFE, NVRAM and global Linux are always present */
--      int nrparts = 3, curpart = 0;
--      struct bcm_tag *buf = NULL;
-       struct mtd_partition *parts;
--      int ret;
--      unsigned int rootfsaddr, kerneladdr, spareaddr;
--      unsigned int rootfslen, kernellen, sparelen, totallen;
-+      int nrparts = 3, curpart = 0;
-       unsigned int cfelen, nvramlen;
-       unsigned int cfe_erasesize;
-       int i;
--      bool rootfs_first = false;
-       cfe_erasesize = max_t(uint32_t, master->erasesize,
-                             BCM963XX_CFE_BLOCK_SIZE);
-@@ -146,83 +114,9 @@ static int bcm63xx_parse_cfe_nor_partiti
-       nvramlen = nvram->psi_size * SZ_1K;
-       nvramlen = roundup(nvramlen, cfe_erasesize);
--      buf = vmalloc(sizeof(struct bcm_tag));
--      if (!buf)
--              return -ENOMEM;
--
--      /* Get the tag */
--      ret = bcm63xx_read_image_tag(master, "rootfs", cfelen, buf);
--      if (!ret) {
--              STR_NULL_TERMINATE(buf->flash_image_start);
--              if (kstrtouint(buf->flash_image_start, 10, &rootfsaddr) ||
--                              rootfsaddr < BCM963XX_EXTENDED_SIZE) {
--                      pr_err("invalid rootfs address: %*ph\n",
--                              (int)sizeof(buf->flash_image_start),
--                              buf->flash_image_start);
--                      goto invalid_tag;
--              }
--
--              STR_NULL_TERMINATE(buf->kernel_address);
--              if (kstrtouint(buf->kernel_address, 10, &kerneladdr) ||
--                              kerneladdr < BCM963XX_EXTENDED_SIZE) {
--                      pr_err("invalid kernel address: %*ph\n",
--                              (int)sizeof(buf->kernel_address),
--                              buf->kernel_address);
--                      goto invalid_tag;
--              }
--
--              STR_NULL_TERMINATE(buf->kernel_length);
--              if (kstrtouint(buf->kernel_length, 10, &kernellen)) {
--                      pr_err("invalid kernel length: %*ph\n",
--                              (int)sizeof(buf->kernel_length),
--                              buf->kernel_length);
--                      goto invalid_tag;
--              }
--
--              STR_NULL_TERMINATE(buf->total_length);
--              if (kstrtouint(buf->total_length, 10, &totallen)) {
--                      pr_err("invalid total length: %*ph\n",
--                              (int)sizeof(buf->total_length),
--                              buf->total_length);
--                      goto invalid_tag;
--              }
--
--              kerneladdr = kerneladdr - BCM963XX_EXTENDED_SIZE;
--              rootfsaddr = rootfsaddr - BCM963XX_EXTENDED_SIZE;
--              spareaddr = roundup(totallen, master->erasesize) + cfelen;
--
--              if (rootfsaddr < kerneladdr) {
--                      /* default Broadcom layout */
--                      rootfslen = kerneladdr - rootfsaddr;
--                      rootfs_first = true;
--              } else {
--                      /* OpenWrt layout */
--                      rootfsaddr = kerneladdr + kernellen;
--                      rootfslen = spareaddr - rootfsaddr;
--              }
--      } else if (ret > 0) {
--invalid_tag:
--              kernellen = 0;
--              rootfslen = 0;
--              rootfsaddr = 0;
--              spareaddr = cfelen;
--      } else {
--              goto out;
--      }
--      sparelen = master->size - spareaddr - nvramlen;
--
--      /* Determine number of partitions */
--      if (rootfslen > 0)
--              nrparts++;
--
--      if (kernellen > 0)
--              nrparts++;
--
-       parts = kzalloc(sizeof(*parts) * nrparts + 10 * nrparts, GFP_KERNEL);
--      if (!parts) {
--              ret = -ENOMEM;
--              goto out;
--      }
-+      if (!parts)
-+              return -ENOMEM;
-       /* Start building partition list */
-       parts[curpart].name = "CFE";
-@@ -230,30 +124,6 @@ invalid_tag:
-       parts[curpart].size = cfelen;
-       curpart++;
--      if (kernellen > 0) {
--              int kernelpart = curpart;
--
--              if (rootfslen > 0 && rootfs_first)
--                      kernelpart++;
--              parts[kernelpart].name = "kernel";
--              parts[kernelpart].offset = kerneladdr;
--              parts[kernelpart].size = kernellen;
--              curpart++;
--      }
--
--      if (rootfslen > 0) {
--              int rootfspart = curpart;
--
--              if (kernellen > 0 && rootfs_first)
--                      rootfspart--;
--              parts[rootfspart].name = "rootfs";
--              parts[rootfspart].offset = rootfsaddr;
--              parts[rootfspart].size = rootfslen;
--              if (sparelen > 0  && !rootfs_first)
--                      parts[rootfspart].size += sparelen;
--              curpart++;
--      }
--
-       parts[curpart].name = "nvram";
-       parts[curpart].offset = master->size - nvramlen;
-       parts[curpart].size = nvramlen;
-@@ -263,22 +133,13 @@ invalid_tag:
-       parts[curpart].name = "linux";
-       parts[curpart].offset = cfelen;
-       parts[curpart].size = master->size - cfelen - nvramlen;
-+      parts[curpart].types = bcm63xx_cfe_part_types;
-       for (i = 0; i < nrparts; i++)
-               pr_info("Partition %d is %s offset %llx and length %llx\n", i,
-                       parts[i].name, parts[i].offset, parts[i].size);
--      pr_info("Spare partition is offset %x and length %x\n", spareaddr,
--              sparelen);
--
-       *pparts = parts;
--      ret = 0;
--
--out:
--      vfree(buf);
--
--      if (ret)
--              return ret;
-       return nrparts;
- }
---- a/drivers/mtd/parsers/Kconfig
-+++ b/drivers/mtd/parsers/Kconfig
-@@ -1,3 +1,14 @@
-+config MTD_PARSER_IMAGETAG
-+      tristate "Parser for BCM963XX Image Tag format partitions"
-+      depends on BCM63XX || BMIPS || COMPILE_TEST
-+      select CRC32
-+      help
-+        Image Tag is the firmware header used by broadcom on their xDSL line
-+        of devices. It is used to describe the offsets and lengths of kernel
-+        and rootfs partitions.
-+        This driver adds support for parsing a partition with an Image Tag
-+        header and creates up to two partitions, kernel and rootfs.
-+
- config MTD_PARSER_TRX
-       tristate "Parser for TRX format partitions"
-       depends on MTD && (BCM47XX || ARCH_BCM_5301X || COMPILE_TEST)
---- a/drivers/mtd/parsers/Makefile
-+++ b/drivers/mtd/parsers/Makefile
-@@ -1 +1,2 @@
-+obj-$(CONFIG_MTD_PARSER_IMAGETAG)     += parser_imagetag.o
- obj-$(CONFIG_MTD_PARSER_TRX)          += parser_trx.o
---- /dev/null
-+++ b/drivers/mtd/parsers/parser_imagetag.c
-@@ -0,0 +1,214 @@
-+/*
-+ * BCM63XX CFE image tag parser
-+ *
-+ * Copyright © 2006-2008  Florian Fainelli <florian@openwrt.org>
-+ *                      Mike Albon <malbon@openwrt.org>
-+ * Copyright © 2009-2010  Daniel Dickinson <openwrt@cshore.neomailbox.net>
-+ * Copyright © 2011-2013  Jonas Gorski <jonas.gorski@gmail.com>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ */
-+
-+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-+
-+#include <linux/bcm963xx_tag.h>
-+#include <linux/crc32.h>
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/sizes.h>
-+#include <linux/slab.h>
-+#include <linux/vmalloc.h>
-+#include <linux/mtd/mtd.h>
-+#include <linux/mtd/partitions.h>
-+
-+/* Ensure strings read from flash structs are null terminated */
-+#define STR_NULL_TERMINATE(x) \
-+      do { char *_str = (x); _str[sizeof(x) - 1] = 0; } while (0)
-+
-+static int bcm963xx_read_imagetag(struct mtd_info *master, const char *name,
-+      loff_t tag_offset, struct bcm_tag *buf)
-+{
-+      int ret;
-+      size_t retlen;
-+      u32 computed_crc;
-+
-+      ret = mtd_read(master, tag_offset, sizeof(*buf), &retlen, (void *)buf);
-+      if (ret)
-+              return ret;
-+
-+      if (retlen != sizeof(*buf))
-+              return -EIO;
-+
-+      computed_crc = crc32_le(IMAGETAG_CRC_START, (u8 *)buf,
-+                              offsetof(struct bcm_tag, header_crc));
-+      if (computed_crc == buf->header_crc) {
-+              STR_NULL_TERMINATE(buf->board_id);
-+              STR_NULL_TERMINATE(buf->tag_version);
-+
-+              pr_info("%s: CFE image tag found at 0x%llx with version %s, board type %s\n",
-+                      name, tag_offset, buf->tag_version, buf->board_id);
-+
-+              return 0;
-+      }
-+
-+      pr_warn("%s: CFE image tag at 0x%llx CRC invalid (expected %08x, actual %08x)\n",
-+              name, tag_offset, buf->header_crc, computed_crc);
-+      return -EINVAL;
-+}
-+
-+static int bcm963xx_parse_imagetag_partitions(struct mtd_info *master,
-+                                      const struct mtd_partition **pparts,
-+                                      struct mtd_part_parser_data *data)
-+{
-+      /* CFE, NVRAM and global Linux are always present */
-+      int nrparts = 0, curpart = 0;
-+      struct bcm_tag *buf = NULL;
-+      struct mtd_partition *parts;
-+      int ret;
-+      unsigned int rootfsaddr, kerneladdr, spareaddr, offset;
-+      unsigned int rootfslen, kernellen, sparelen, totallen;
-+      int i;
-+      bool rootfs_first = false;
-+
-+      buf = vmalloc(sizeof(struct bcm_tag));
-+      if (!buf)
-+              return -ENOMEM;
-+
-+      /* Get the tag */
-+      ret = bcm963xx_read_imagetag(master, "rootfs", 0, buf);
-+      if (!ret) {
-+              STR_NULL_TERMINATE(buf->flash_image_start);
-+              if (kstrtouint(buf->flash_image_start, 10, &rootfsaddr) ||
-+                              rootfsaddr < BCM963XX_EXTENDED_SIZE) {
-+                      pr_err("invalid rootfs address: %*ph\n",
-+                              (int)sizeof(buf->flash_image_start),
-+                              buf->flash_image_start);
-+                      goto out;
-+              }
-+
-+              STR_NULL_TERMINATE(buf->kernel_address);
-+              if (kstrtouint(buf->kernel_address, 10, &kerneladdr) ||
-+                              kerneladdr < BCM963XX_EXTENDED_SIZE) {
-+                      pr_err("invalid kernel address: %*ph\n",
-+                              (int)sizeof(buf->kernel_address),
-+                              buf->kernel_address);
-+                      goto out;
-+              }
-+
-+              STR_NULL_TERMINATE(buf->kernel_length);
-+              if (kstrtouint(buf->kernel_length, 10, &kernellen)) {
-+                      pr_err("invalid kernel length: %*ph\n",
-+                              (int)sizeof(buf->kernel_length),
-+                              buf->kernel_length);
-+                      goto out;
-+              }
-+
-+              STR_NULL_TERMINATE(buf->total_length);
-+              if (kstrtouint(buf->total_length, 10, &totallen)) {
-+                      pr_err("invalid total length: %*ph\n",
-+                              (int)sizeof(buf->total_length),
-+                              buf->total_length);
-+                      goto out;
-+              }
-+
-+              /*
-+               * Addresses are flash absolute, so convert to partition
-+               * relative addresses. Assume either kernel or rootfs will
-+               * directly follow the image tag.
-+               */
-+              if (rootfsaddr < kerneladdr)
-+                      offset = rootfsaddr - sizeof(struct bcm_tag);
-+              else
-+                      offset = kerneladdr - sizeof(struct bcm_tag);
-+
-+              kerneladdr = kerneladdr - offset;
-+              rootfsaddr = rootfsaddr - offset;
-+              spareaddr = roundup(totallen, master->erasesize);
-+
-+              if (rootfsaddr < kerneladdr) {
-+                      /* default Broadcom layout */
-+                      rootfslen = kerneladdr - rootfsaddr;
-+                      rootfs_first = true;
-+              } else {
-+                      /* OpenWrt layout */
-+                      rootfsaddr = kerneladdr + kernellen;
-+                      rootfslen = spareaddr - rootfsaddr;
-+              }
-+      } else {
-+              goto out;
-+      }
-+      sparelen = master->size - spareaddr;
-+
-+      /* Determine number of partitions */
-+      if (rootfslen > 0)
-+              nrparts++;
-+
-+      if (kernellen > 0)
-+              nrparts++;
-+
-+      parts = kzalloc(sizeof(*parts) * nrparts + 10 * nrparts, GFP_KERNEL);
-+      if (!parts) {
-+              ret = -ENOMEM;
-+              goto out;
-+      }
-+
-+      /* Start building partition list */
-+      if (kernellen > 0) {
-+              int kernelpart = curpart;
-+
-+              if (rootfslen > 0 && rootfs_first)
-+                      kernelpart++;
-+              parts[kernelpart].name = "kernel";
-+              parts[kernelpart].offset = kerneladdr;
-+              parts[kernelpart].size = kernellen;
-+              curpart++;
-+      }
-+
-+      if (rootfslen > 0) {
-+              int rootfspart = curpart;
-+
-+              if (kernellen > 0 && rootfs_first)
-+                      rootfspart--;
-+              parts[rootfspart].name = "rootfs";
-+              parts[rootfspart].offset = rootfsaddr;
-+              parts[rootfspart].size = rootfslen;
-+              if (sparelen > 0  && !rootfs_first)
-+                      parts[rootfspart].size += sparelen;
-+              curpart++;
-+      }
-+
-+      for (i = 0; i < nrparts; i++)
-+              pr_info("Partition %d is %s offset %llx and length %llx\n", i,
-+                      parts[i].name, parts[i].offset, parts[i].size);
-+
-+      pr_info("Spare partition is offset %x and length %x\n", spareaddr,
-+              sparelen);
-+
-+      *pparts = parts;
-+      ret = 0;
-+
-+out:
-+      vfree(buf);
-+
-+      if (ret)
-+              return ret;
-+
-+      return nrparts;
-+}
-+
-+static struct mtd_part_parser bcm963xx_imagetag_parser = {
-+      .parse_fn = bcm963xx_parse_imagetag_partitions,
-+      .name = "bcm963xx-imagetag",
-+};
-+module_mtd_part_parser(bcm963xx_imagetag_parser);
-+
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Daniel Dickinson <openwrt@cshore.neomailbox.net>");
-+MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
-+MODULE_AUTHOR("Mike Albon <malbon@openwrt.org>");
-+MODULE_AUTHOR("Jonas Gorski <jonas.gorski@gmail.com");
-+MODULE_DESCRIPTION("MTD parser for BCM963XX CFE Image Tag partitions");
diff --git a/target/linux/brcm63xx/patches-4.9/122-mtd-bcm63xxpart-add-of_match_table.patch b/target/linux/brcm63xx/patches-4.9/122-mtd-bcm63xxpart-add-of_match_table.patch
deleted file mode 100644 (file)
index 9b3f2c4..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From 89cd5efa4a0d342b860a726bb1d382e4db4b96a4 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 28 Jun 2017 18:34:42 +0200
-Subject: [PATCH 1/2] mtd: bcm63xxpart: add of_match_table
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/mtd/bcm63xxpart.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/drivers/mtd/bcm63xxpart.c
-+++ b/drivers/mtd/bcm63xxpart.c
-@@ -34,6 +34,7 @@
- #include <linux/vmalloc.h>
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/partitions.h>
-+#include <linux/of.h>
- #define BCM963XX_CFE_BLOCK_SIZE               SZ_64K  /* always at least 64KiB */
-@@ -172,9 +173,16 @@ out:
-       return ret;
- };
-+static const struct of_device_id parse_bcm63xx_cfe_match_table[] = {
-+      { .compatible = "brcm,bcm963xx-cfe-nor-partitions" },
-+      {},
-+};
-+MODULE_DEVICE_TABLE(of, parse_bcm63xx_cfe_match_table);
-+
- static struct mtd_part_parser bcm63xx_cfe_parser = {
-       .parse_fn = bcm63xx_parse_cfe_partitions,
-       .name = "bcm63xxpart",
-+      .of_match_table = parse_bcm63xx_cfe_match_table,
- };
- module_mtd_part_parser(bcm63xx_cfe_parser);
diff --git a/target/linux/brcm63xx/patches-4.9/123-mtd-parser_bcm63xx_imagetag-add-of_match_table-suppo.patch b/target/linux/brcm63xx/patches-4.9/123-mtd-parser_bcm63xx_imagetag-add-of_match_table-suppo.patch
deleted file mode 100644 (file)
index 04978b3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From 3303dd9f5b197cc2efd9cbd7b9b45fc1e510a393 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 28 Jun 2017 18:37:12 +0200
-Subject: [PATCH 2/2] mtd: parser_bcm63xx_imagetag: add of_match_table support
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/mtd/parsers/parser_imagetag.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/drivers/mtd/parsers/parser_imagetag.c
-+++ b/drivers/mtd/parsers/parser_imagetag.c
-@@ -24,6 +24,7 @@
- #include <linux/vmalloc.h>
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/partitions.h>
-+#include <linux/of.h>
- /* Ensure strings read from flash structs are null terminated */
- #define STR_NULL_TERMINATE(x) \
-@@ -200,9 +201,16 @@ out:
-       return nrparts;
- }
-+static const struct of_device_id parse_bcm963xx_imagetag_match_table[] = {
-+      { .compatible = "brcm,bcm963xx-imagetag" },
-+      {},
-+};
-+MODULE_DEVICE_TABLE(of, parse_bcm963xx_imagetag_match_table);
-+
- static struct mtd_part_parser bcm963xx_imagetag_parser = {
-       .parse_fn = bcm963xx_parse_imagetag_partitions,
-       .name = "bcm963xx-imagetag",
-+      .of_match_table = parse_bcm963xx_imagetag_match_table,
- };
- module_mtd_part_parser(bcm963xx_imagetag_parser);
diff --git a/target/linux/brcm63xx/patches-4.9/130-pinctrl-add-bcm63xx-base-code.patch b/target/linux/brcm63xx/patches-4.9/130-pinctrl-add-bcm63xx-base-code.patch
deleted file mode 100644 (file)
index cb90732..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-From ab2f33e35e35905a76204138143875251f3e1088 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Fri, 24 Jun 2016 22:07:42 +0200
-Subject: [PATCH 01/13] pinctrl: add bcm63xx base code
-
-Setup directory and add a helper for bcm63xx pinctrl support.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/pinctrl/Kconfig                   |   1 +
- drivers/pinctrl/Makefile                  |   1 +
- drivers/pinctrl/bcm63xx/Kconfig           |   3 +
- drivers/pinctrl/bcm63xx/Makefile          |   1 +
- drivers/pinctrl/bcm63xx/pinctrl-bcm63xx.c | 142 ++++++++++++++++++++++++++++++
- drivers/pinctrl/bcm63xx/pinctrl-bcm63xx.h |  14 +++
- 7 files changed, 163 insertions(+)
- create mode 100644 drivers/pinctrl/bcm63xx/Kconfig
- create mode 100644 drivers/pinctrl/bcm63xx/Makefile
- create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm63xx.c
- create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm63xx.h
-
---- a/drivers/pinctrl/Kconfig
-+++ b/drivers/pinctrl/Kconfig
-@@ -258,6 +258,7 @@ config PINCTRL_ZYNQ
- source "drivers/pinctrl/aspeed/Kconfig"
- source "drivers/pinctrl/bcm/Kconfig"
-+source "drivers/pinctrl/bcm63xx/Kconfig"
- source "drivers/pinctrl/berlin/Kconfig"
- source "drivers/pinctrl/freescale/Kconfig"
- source "drivers/pinctrl/intel/Kconfig"
---- a/drivers/pinctrl/Makefile
-+++ b/drivers/pinctrl/Makefile
-@@ -39,6 +39,7 @@ obj-$(CONFIG_PINCTRL_ZYNQ)   += pinctrl-zy
- obj-$(CONFIG_ARCH_ASPEED)     += aspeed/
- obj-y                         += bcm/
-+obj-y                         += bcm63xx/
- obj-$(CONFIG_PINCTRL_BERLIN)  += berlin/
- obj-y                         += freescale/
- obj-$(CONFIG_X86)             += intel/
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/Kconfig
-@@ -0,0 +1,3 @@
-+config PINCTRL_BCM63XX
-+      bool
-+      select GPIO_GENERIC
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/Makefile
-@@ -0,0 +1 @@
-+obj-$(CONFIG_PINCTRL_BCM63XX) += pinctrl-bcm63xx.o
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm63xx.c
-@@ -0,0 +1,155 @@
-+/*
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
-+ */
-+
-+#include <linux/bitops.h>
-+#include <linux/device.h>
-+#include <linux/gpio/driver.h>
-+#include <linux/of_irq.h>
-+
-+#include "pinctrl-bcm63xx.h"
-+#include "../core.h"
-+
-+#define BANK_SIZE     sizeof(u32)
-+#define PINS_PER_BANK (BANK_SIZE * BITS_PER_BYTE)
-+
-+#ifdef CONFIG_OF
-+static int bcm63xx_gpio_of_xlate(struct gpio_chip *gc,
-+                               const struct of_phandle_args *gpiospec,
-+                               u32 *flags)
-+{
-+      struct gpio_chip *base = gpiochip_get_data(gc);
-+      int pin = gpiospec->args[0];
-+
-+      if (gc != &base[pin / PINS_PER_BANK])
-+              return -EINVAL;
-+
-+      pin = pin % PINS_PER_BANK;
-+
-+      if (pin >= gc->ngpio)
-+              return -EINVAL;
-+
-+      if (flags)
-+              *flags = gpiospec->args[1];
-+
-+      return pin;
-+}
-+#endif
-+
-+static int bcm63xx_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
-+{
-+      struct gpio_chip *base = gpiochip_get_data(chip);
-+      char irq_name[7]; /* "gpioXX" */
-+
-+      /* FIXME: this is ugly */
-+      sprintf(irq_name, "gpio%d", gpio + PINS_PER_BANK * (chip - base));
-+      return of_irq_get_byname(chip->of_node, irq_name);
-+}
-+
-+static int bcm63xx_setup_gpio(struct device *dev, struct gpio_chip *gc,
-+                            void __iomem *dirout, void __iomem *data,
-+                            size_t sz, int ngpio)
-+
-+{
-+      int banks, chips, i, ret = -EINVAL;
-+
-+      chips = DIV_ROUND_UP(ngpio, PINS_PER_BANK);
-+      banks = sz / BANK_SIZE;
-+
-+      for (i = 0; i < chips; i++) {
-+              int offset, pins;
-+              int reg_offset;
-+              char *label;
-+
-+              label = devm_kasprintf(dev, GFP_KERNEL, "bcm63xx-gpio.%i", i);
-+              if (!label)
-+                      return -ENOMEM;
-+
-+              offset = i * PINS_PER_BANK;
-+              pins = min_t(int, ngpio - offset, PINS_PER_BANK);
-+
-+              /* the registers are treated like a huge big endian register */
-+              reg_offset = (banks - i - 1) * BANK_SIZE;
-+
-+              ret = bgpio_init(&gc[i], dev, BANK_SIZE, data + reg_offset,
-+                               NULL, NULL, dirout + reg_offset, NULL,
-+                               BGPIOF_BIG_ENDIAN_BYTE_ORDER);
-+              if (ret)
-+                      return ret;
-+
-+              gc[i].request = gpiochip_generic_request;
-+              gc[i].free = gpiochip_generic_free;
-+
-+              if (of_get_property(dev->of_node, "interrupt-names", NULL))
-+                      gc[i].to_irq = bcm63xx_gpio_to_irq;
-+
-+#ifdef CONFIG_OF
-+              gc[i].of_gpio_n_cells = 2;
-+              gc[i].of_xlate = bcm63xx_gpio_of_xlate;
-+#endif
-+
-+              gc[i].label = label;
-+              gc[i].ngpio = pins;
-+
-+              devm_gpiochip_add_data(dev, &gc[i], gc);
-+      }
-+
-+      return 0;
-+}
-+
-+static void bcm63xx_setup_pinranges(struct gpio_chip *gc, const char *name,
-+                                  int ngpio)
-+{
-+      int i, chips = DIV_ROUND_UP(ngpio, PINS_PER_BANK);
-+
-+      for (i = 0; i < chips; i++) {
-+              int offset, pins;
-+
-+              offset = i * PINS_PER_BANK;
-+              pins = min_t(int, ngpio - offset, PINS_PER_BANK);
-+
-+              gpiochip_add_pin_range(&gc[i], name, 0, offset, pins);
-+      }
-+}
-+
-+struct pinctrl_dev *bcm63xx_pinctrl_register(struct platform_device *pdev,
-+                                           struct pinctrl_desc *desc,
-+                                           void *priv, struct gpio_chip *gc,
-+                                           int ngpio)
-+{
-+      struct pinctrl_dev *pctldev;
-+      struct resource *res;
-+      void __iomem *dirout, *data;
-+      size_t sz;
-+      int ret;
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dirout");
-+      dirout = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(dirout))
-+              return ERR_CAST(dirout);
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dat");
-+      data = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(data))
-+              return ERR_CAST(data);
-+
-+      sz = resource_size(res);
-+
-+      ret = bcm63xx_setup_gpio(&pdev->dev, gc, dirout, data, sz, ngpio);
-+      if (ret)
-+              return ERR_PTR(ret);
-+
-+      pctldev = devm_pinctrl_register(&pdev->dev, desc, priv);
-+      if (IS_ERR(pctldev))
-+              return pctldev;
-+
-+      bcm63xx_setup_pinranges(gc, pinctrl_dev_get_devname(pctldev), ngpio);
-+
-+      dev_info(&pdev->dev, "registered at mmio %p\n", dirout);
-+
-+      return pctldev;
-+}
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm63xx.h
-@@ -0,0 +1,14 @@
-+#ifndef __PINCTRL_BCM63XX
-+#define __PINCTRL_BCM63XX
-+
-+#include <linux/kernel.h>
-+#include <linux/gpio.h>
-+#include <linux/pinctrl/pinctrl.h>
-+#include <linux/platform_device.h>
-+
-+struct pinctrl_dev *bcm63xx_pinctrl_register(struct platform_device *pdev,
-+                                           struct pinctrl_desc *desc,
-+                                           void *priv, struct gpio_chip *gc,
-+                                           int ngpio);
-+
-+#endif
diff --git a/target/linux/brcm63xx/patches-4.9/131-Documentation-add-BCM6328-pincontroller-binding-docu.patch b/target/linux/brcm63xx/patches-4.9/131-Documentation-add-BCM6328-pincontroller-binding-docu.patch
deleted file mode 100644 (file)
index 3a2a781..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-From 4bdd40849632608d5cb7d3a64380cd76e7eea07b Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 27 Jul 2016 11:33:56 +0200
-Subject: [PATCH 02/16] Documentation: add BCM6328 pincontroller binding
- documentation
-
-Add binding documentation for the pincontrol core found in BCM6328 SoCs.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- .../bindings/pinctrl/brcm,bcm6328-pinctrl.txt      | 61 ++++++++++++++++++++++
- 1 file changed, 61 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6328-pinctrl.txt
-@@ -0,0 +1,61 @@
-+* Broadcom BCM6328 pin controller
-+
-+Required properties:
-+- compatible: Must be "brcm,bcm6328-pinctrl".
-+- reg: Register specifies of dirout, dat, mode, mux registers.
-+- reg-names: Must be "dirout", "dat", "mode", "mux".
-+- gpio-controller: Identifies this node as a GPIO controller.
-+- #gpio-cells: Must be <2>
-+
-+Example:
-+
-+pinctrl: pin-controller@10000080 {
-+      compatible = "brcm,bcm6328-pinctrl";
-+      reg = <0x10000080 0x8>,
-+            <0x10000088 0x8>,
-+            <0x10000098 0x4>,
-+            <0x1000009c 0xc>;
-+      reg-names = "dirout", "dat", "mode", "mux";
-+
-+      gpio-controller;
-+      #gpio-cells = <2>;
-+};
-+
-+Available pins/groups and functions:
-+
-+name          pins    functions
-+-----------------------------------------------------------
-+gpio0         0       led
-+gpio1         1       led
-+gpio2         2       led
-+gpio3         3       led
-+gpio4         4       led
-+gpio5         5       led
-+gpio6         6       led, serial_led_data
-+gpio7         7       led, serial_led_clk
-+gpio8         8       led
-+gpio9         9       led
-+gpio10                10      led
-+gpio11                11      led
-+gpio12                12      led
-+gpio13                13      led
-+gpio14                14      led
-+gpio15                15      led
-+gpio16                16      led, pcie_clkreq
-+gpio17                17      led
-+gpio18                18      led
-+gpio19                19      led
-+gpio20                20      led
-+gpio21                21      led
-+gpio22                22      led
-+gpio23                23      led
-+gpio24                24      -
-+gpio25                25      ephy0_act_led
-+gpio26                26      ephy1_act_led
-+gpio27                27      ephy2_act_led
-+gpio28                28      ephy3_act_led
-+gpio29                29      -
-+gpio30                30      -
-+gpio31                31      -
-+hsspi_cs1     -       hsspi_cs1
-+usb_port1     -       usb_host_port, usb_device_port
diff --git a/target/linux/brcm63xx/patches-4.9/132-pinctrl-add-a-pincontrol-driver-for-BCM6328.patch b/target/linux/brcm63xx/patches-4.9/132-pinctrl-add-a-pincontrol-driver-for-BCM6328.patch
deleted file mode 100644 (file)
index 3c5f15b..0000000
+++ /dev/null
@@ -1,495 +0,0 @@
-From 393e9753f6492c1fdf55891ddee60d955ae8b119 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Fri, 24 Jun 2016 22:12:50 +0200
-Subject: [PATCH 03/16] pinctrl: add a pincontrol driver for BCM6328
-
-Add a pincontrol driver for BCM6328. BCM628 supports muxing 32 pins as
-GPIOs, as LEDs for the integrated LED controller, or various other
-functions. Its pincontrol mux registers also control other aspects, like
-switching the second USB port between host and device mode.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/pinctrl/bcm63xx/Kconfig           |   7 +
- drivers/pinctrl/bcm63xx/Makefile          |   1 +
- drivers/pinctrl/bcm63xx/pinctrl-bcm6328.c | 456 ++++++++++++++++++++++++++++++
- 3 files changed, 464 insertions(+)
- create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm6328.c
-
---- a/drivers/pinctrl/bcm63xx/Kconfig
-+++ b/drivers/pinctrl/bcm63xx/Kconfig
-@@ -1,3 +1,10 @@
- config PINCTRL_BCM63XX
-       bool
-       select GPIO_GENERIC
-+
-+config PINCTRL_BCM6328
-+      bool "BCM6328 pincontrol driver" if COMPILE_TEST
-+      select PINMUX
-+      select PINCONF
-+      select PINCTRL_BCM63XX
-+      select GENERIC_PINCONF
---- a/drivers/pinctrl/bcm63xx/Makefile
-+++ b/drivers/pinctrl/bcm63xx/Makefile
-@@ -1 +1,2 @@
- obj-$(CONFIG_PINCTRL_BCM63XX) += pinctrl-bcm63xx.o
-+obj-$(CONFIG_PINCTRL_BCM6328) += pinctrl-bcm6328.o
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6328.c
-@@ -0,0 +1,456 @@
-+/*
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
-+ */
-+
-+#include <linux/bitops.h>
-+#include <linux/gpio.h>
-+#include <linux/kernel.h>
-+#include <linux/slab.h>
-+#include <linux/spinlock.h>
-+#include <linux/of.h>
-+#include <linux/of_gpio.h>
-+#include <linux/platform_device.h>
-+
-+#include <linux/pinctrl/machine.h>
-+#include <linux/pinctrl/pinconf.h>
-+#include <linux/pinctrl/pinconf-generic.h>
-+#include <linux/pinctrl/pinmux.h>
-+
-+#include "../core.h"
-+#include "../pinctrl-utils.h"
-+
-+#include "pinctrl-bcm63xx.h"
-+
-+#define BCM6328_MUX_LO_REG    0x4
-+#define BCM6328_MUX_HI_REG    0x0
-+#define BCM6328_MUX_OTHER_REG 0x8
-+
-+#define BCM6328_NGPIO         32
-+
-+struct bcm6328_pingroup {
-+      const char *name;
-+      const unsigned * const pins;
-+      const unsigned num_pins;
-+};
-+
-+struct bcm6328_function {
-+      const char *name;
-+      const char * const *groups;
-+      const unsigned num_groups;
-+
-+      unsigned mode_val:1;
-+      unsigned mux_val:2;
-+};
-+
-+struct bcm6328_pinctrl {
-+      struct pinctrl_dev *pctldev;
-+      struct pinctrl_desc desc;
-+
-+      void __iomem *mode;
-+      void __iomem *mux[3];
-+
-+      /* register access lock */
-+      spinlock_t lock;
-+
-+      struct gpio_chip gpio;
-+};
-+
-+static const struct pinctrl_pin_desc bcm6328_pins[] = {
-+      PINCTRL_PIN(0, "gpio0"),
-+      PINCTRL_PIN(1, "gpio1"),
-+      PINCTRL_PIN(2, "gpio2"),
-+      PINCTRL_PIN(3, "gpio3"),
-+      PINCTRL_PIN(4, "gpio4"),
-+      PINCTRL_PIN(5, "gpio5"),
-+      PINCTRL_PIN(6, "gpio6"),
-+      PINCTRL_PIN(7, "gpio7"),
-+      PINCTRL_PIN(8, "gpio8"),
-+      PINCTRL_PIN(9, "gpio9"),
-+      PINCTRL_PIN(10, "gpio10"),
-+      PINCTRL_PIN(11, "gpio11"),
-+      PINCTRL_PIN(12, "gpio12"),
-+      PINCTRL_PIN(13, "gpio13"),
-+      PINCTRL_PIN(14, "gpio14"),
-+      PINCTRL_PIN(15, "gpio15"),
-+      PINCTRL_PIN(16, "gpio16"),
-+      PINCTRL_PIN(17, "gpio17"),
-+      PINCTRL_PIN(18, "gpio18"),
-+      PINCTRL_PIN(19, "gpio19"),
-+      PINCTRL_PIN(20, "gpio20"),
-+      PINCTRL_PIN(21, "gpio21"),
-+      PINCTRL_PIN(22, "gpio22"),
-+      PINCTRL_PIN(23, "gpio23"),
-+      PINCTRL_PIN(24, "gpio24"),
-+      PINCTRL_PIN(25, "gpio25"),
-+      PINCTRL_PIN(26, "gpio26"),
-+      PINCTRL_PIN(27, "gpio27"),
-+      PINCTRL_PIN(28, "gpio28"),
-+      PINCTRL_PIN(29, "gpio29"),
-+      PINCTRL_PIN(30, "gpio30"),
-+      PINCTRL_PIN(31, "gpio31"),
-+
-+      /*
-+       * No idea where they really are; so let's put them according
-+       * to their mux offsets.
-+       */
-+      PINCTRL_PIN(36, "hsspi_cs1"),
-+      PINCTRL_PIN(38, "usb_p2"),
-+};
-+
-+static unsigned gpio0_pins[] = { 0 };
-+static unsigned gpio1_pins[] = { 1 };
-+static unsigned gpio2_pins[] = { 2 };
-+static unsigned gpio3_pins[] = { 3 };
-+static unsigned gpio4_pins[] = { 4 };
-+static unsigned gpio5_pins[] = { 5 };
-+static unsigned gpio6_pins[] = { 6 };
-+static unsigned gpio7_pins[] = { 7 };
-+static unsigned gpio8_pins[] = { 8 };
-+static unsigned gpio9_pins[] = { 9 };
-+static unsigned gpio10_pins[] = { 10 };
-+static unsigned gpio11_pins[] = { 11 };
-+static unsigned gpio12_pins[] = { 12 };
-+static unsigned gpio13_pins[] = { 13 };
-+static unsigned gpio14_pins[] = { 14 };
-+static unsigned gpio15_pins[] = { 15 };
-+static unsigned gpio16_pins[] = { 16 };
-+static unsigned gpio17_pins[] = { 17 };
-+static unsigned gpio18_pins[] = { 18 };
-+static unsigned gpio19_pins[] = { 19 };
-+static unsigned gpio20_pins[] = { 20 };
-+static unsigned gpio21_pins[] = { 21 };
-+static unsigned gpio22_pins[] = { 22 };
-+static unsigned gpio23_pins[] = { 23 };
-+static unsigned gpio24_pins[] = { 24 };
-+static unsigned gpio25_pins[] = { 25 };
-+static unsigned gpio26_pins[] = { 26 };
-+static unsigned gpio27_pins[] = { 27 };
-+static unsigned gpio28_pins[] = { 28 };
-+static unsigned gpio29_pins[] = { 29 };
-+static unsigned gpio30_pins[] = { 30 };
-+static unsigned gpio31_pins[] = { 31 };
-+
-+static unsigned hsspi_cs1_pins[] = { 36 };
-+static unsigned usb_port1_pins[] = { 38 };
-+
-+#define BCM6328_GROUP(n)                                      \
-+      {                                                       \
-+              .name = #n,                                     \
-+              .pins = n##_pins,                               \
-+              .num_pins = ARRAY_SIZE(n##_pins),               \
-+      }
-+
-+static struct bcm6328_pingroup bcm6328_groups[] = {
-+      BCM6328_GROUP(gpio0),
-+      BCM6328_GROUP(gpio1),
-+      BCM6328_GROUP(gpio2),
-+      BCM6328_GROUP(gpio3),
-+      BCM6328_GROUP(gpio4),
-+      BCM6328_GROUP(gpio5),
-+      BCM6328_GROUP(gpio6),
-+      BCM6328_GROUP(gpio7),
-+      BCM6328_GROUP(gpio8),
-+      BCM6328_GROUP(gpio9),
-+      BCM6328_GROUP(gpio10),
-+      BCM6328_GROUP(gpio11),
-+      BCM6328_GROUP(gpio12),
-+      BCM6328_GROUP(gpio13),
-+      BCM6328_GROUP(gpio14),
-+      BCM6328_GROUP(gpio15),
-+      BCM6328_GROUP(gpio16),
-+      BCM6328_GROUP(gpio17),
-+      BCM6328_GROUP(gpio18),
-+      BCM6328_GROUP(gpio19),
-+      BCM6328_GROUP(gpio20),
-+      BCM6328_GROUP(gpio21),
-+      BCM6328_GROUP(gpio22),
-+      BCM6328_GROUP(gpio23),
-+      BCM6328_GROUP(gpio24),
-+      BCM6328_GROUP(gpio25),
-+      BCM6328_GROUP(gpio26),
-+      BCM6328_GROUP(gpio27),
-+      BCM6328_GROUP(gpio28),
-+      BCM6328_GROUP(gpio29),
-+      BCM6328_GROUP(gpio30),
-+      BCM6328_GROUP(gpio31),
-+
-+      BCM6328_GROUP(hsspi_cs1),
-+      BCM6328_GROUP(usb_port1),
-+};
-+
-+/* GPIO_MODE */
-+static const char * const led_groups[] = {
-+      "gpio0",
-+      "gpio1",
-+      "gpio2",
-+      "gpio3",
-+      "gpio4",
-+      "gpio5",
-+      "gpio6",
-+      "gpio7",
-+      "gpio8",
-+      "gpio9",
-+      "gpio10",
-+      "gpio11",
-+      "gpio12",
-+      "gpio13",
-+      "gpio14",
-+      "gpio15",
-+      "gpio16",
-+      "gpio17",
-+      "gpio18",
-+      "gpio19",
-+      "gpio20",
-+      "gpio21",
-+      "gpio22",
-+      "gpio23",
-+};
-+
-+/* PINMUX_SEL */
-+static const char * const serial_led_data_groups[] = {
-+      "gpio6",
-+};
-+
-+static const char * const serial_led_clk_groups[] = {
-+      "gpio7",
-+};
-+
-+static const char * const inet_act_led_groups[] = {
-+      "gpio11",
-+};
-+
-+static const char * const pcie_clkreq_groups[] = {
-+      "gpio16",
-+};
-+
-+static const char * const ephy0_act_led_groups[] = {
-+      "gpio25",
-+};
-+
-+static const char * const ephy1_act_led_groups[] = {
-+      "gpio26",
-+};
-+
-+static const char * const ephy2_act_led_groups[] = {
-+      "gpio27",
-+};
-+
-+static const char * const ephy3_act_led_groups[] = {
-+      "gpio28",
-+};
-+
-+static const char * const hsspi_cs1_groups[] = {
-+      "hsspi_cs1"
-+};
-+
-+static const char * const usb_host_port_groups[] = {
-+      "usb_port1",
-+};
-+
-+static const char * const usb_device_port_groups[] = {
-+      "usb_port1",
-+};
-+
-+#define BCM6328_MODE_FUN(n)                           \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+              .mode_val = 1,                          \
-+      }
-+
-+#define BCM6328_MUX_FUN(n, mux)                               \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+              .mux_val = mux,                         \
-+      }
-+
-+static const struct bcm6328_function bcm6328_funcs[] = {
-+      BCM6328_MODE_FUN(led),
-+      BCM6328_MUX_FUN(serial_led_data, 2),
-+      BCM6328_MUX_FUN(serial_led_clk, 2),
-+      BCM6328_MUX_FUN(inet_act_led, 1),
-+      BCM6328_MUX_FUN(pcie_clkreq, 2),
-+      BCM6328_MUX_FUN(ephy0_act_led, 1),
-+      BCM6328_MUX_FUN(ephy1_act_led, 1),
-+      BCM6328_MUX_FUN(ephy2_act_led, 1),
-+      BCM6328_MUX_FUN(ephy3_act_led, 1),
-+      BCM6328_MUX_FUN(hsspi_cs1, 2),
-+      BCM6328_MUX_FUN(usb_host_port, 1),
-+      BCM6328_MUX_FUN(usb_device_port, 2),
-+};
-+
-+static int bcm6328_pinctrl_get_group_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6328_groups);
-+}
-+
-+static const char *bcm6328_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
-+                                                unsigned group)
-+{
-+      return bcm6328_groups[group].name;
-+}
-+
-+static int bcm6328_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
-+                                        unsigned group, const unsigned **pins,
-+                                        unsigned *num_pins)
-+{
-+      *pins = bcm6328_groups[group].pins;
-+      *num_pins = bcm6328_groups[group].num_pins;
-+
-+      return 0;
-+}
-+
-+static int bcm6328_pinctrl_get_func_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6328_funcs);
-+}
-+
-+static const char *bcm6328_pinctrl_get_func_name(struct pinctrl_dev *pctldev,
-+                                               unsigned selector)
-+{
-+      return bcm6328_funcs[selector].name;
-+}
-+
-+static int bcm6328_pinctrl_get_groups(struct pinctrl_dev *pctldev,
-+                                    unsigned selector,
-+                                    const char * const **groups,
-+                                    unsigned * const num_groups)
-+{
-+      *groups = bcm6328_funcs[selector].groups;
-+      *num_groups = bcm6328_funcs[selector].num_groups;
-+
-+      return 0;
-+}
-+
-+static void bcm6328_rmw_mux(struct bcm6328_pinctrl *pctl, unsigned pin,
-+                          u32 mode, u32 mux)
-+{
-+      unsigned long flags;
-+      u32 reg;
-+
-+      spin_lock_irqsave(&pctl->lock, flags);
-+      if (pin < 32) {
-+              reg = __raw_readl(pctl->mode);
-+              reg &= ~BIT(pin);
-+              if (mode)
-+                      reg |= BIT(pin);
-+              __raw_writel(reg, pctl->mode);
-+      }
-+
-+      reg = __raw_readl(pctl->mux[pin / 16]);
-+      reg &= ~(3UL << ((pin % 16) * 2));
-+      reg |= mux << ((pin % 16) * 2);
-+      __raw_writel(reg, pctl->mux[pin / 16]);
-+
-+      spin_unlock_irqrestore(&pctl->lock, flags);
-+}
-+
-+static int bcm6328_pinctrl_set_mux(struct pinctrl_dev *pctldev,
-+                                 unsigned selector, unsigned group)
-+{
-+      struct bcm6328_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+      const struct bcm6328_pingroup *grp = &bcm6328_groups[group];
-+      const struct bcm6328_function *f = &bcm6328_funcs[selector];
-+
-+      bcm6328_rmw_mux(pctl, grp->pins[0], f->mode_val, f->mux_val);
-+
-+      return 0;
-+}
-+
-+static int bcm6328_gpio_request_enable(struct pinctrl_dev *pctldev,
-+                                     struct pinctrl_gpio_range *range,
-+                                     unsigned offset)
-+{
-+      struct bcm6328_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+
-+      /* disable all functions using this pin */
-+      bcm6328_rmw_mux(pctl, offset, 0, 0);
-+
-+      return 0;
-+}
-+
-+static struct pinctrl_ops bcm6328_pctl_ops = {
-+      .get_groups_count       = bcm6328_pinctrl_get_group_count,
-+      .get_group_name         = bcm6328_pinctrl_get_group_name,
-+      .get_group_pins         = bcm6328_pinctrl_get_group_pins,
-+#ifdef CONFIG_OF
-+      .dt_node_to_map         = pinconf_generic_dt_node_to_map_pin,
-+      .dt_free_map            = pinctrl_utils_free_map,
-+#endif
-+};
-+
-+static struct pinmux_ops bcm6328_pmx_ops = {
-+      .get_functions_count    = bcm6328_pinctrl_get_func_count,
-+      .get_function_name      = bcm6328_pinctrl_get_func_name,
-+      .get_function_groups    = bcm6328_pinctrl_get_groups,
-+      .set_mux                = bcm6328_pinctrl_set_mux,
-+      .gpio_request_enable    = bcm6328_gpio_request_enable,
-+      .strict                 = true,
-+};
-+
-+static int bcm6328_pinctrl_probe(struct platform_device *pdev)
-+{
-+      struct bcm6328_pinctrl *pctl;
-+      struct resource *res;
-+      void __iomem *mode, *mux;
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mode");
-+      mode = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(mode))
-+              return PTR_ERR(mode);
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mux");
-+      mux = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(mux))
-+              return PTR_ERR(mux);
-+
-+      pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
-+      if (!pctl)
-+              return -ENOMEM;
-+
-+      spin_lock_init(&pctl->lock);
-+
-+      pctl->mode = mode;
-+      pctl->mux[0] = mux + BCM6328_MUX_LO_REG;
-+      pctl->mux[1] = mux + BCM6328_MUX_HI_REG;
-+      pctl->mux[2] = mux + BCM6328_MUX_OTHER_REG;
-+
-+      pctl->desc.name = dev_name(&pdev->dev);
-+      pctl->desc.owner = THIS_MODULE;
-+      pctl->desc.pctlops = &bcm6328_pctl_ops;
-+      pctl->desc.pmxops = &bcm6328_pmx_ops;
-+
-+      pctl->desc.npins = ARRAY_SIZE(bcm6328_pins);
-+      pctl->desc.pins = bcm6328_pins;
-+
-+      platform_set_drvdata(pdev, pctl);
-+
-+      pctl->pctldev = bcm63xx_pinctrl_register(pdev, &pctl->desc, pctl,
-+                                               &pctl->gpio, BCM6328_NGPIO);
-+      if (IS_ERR(pctl->pctldev))
-+              return PTR_ERR(pctl->pctldev);
-+
-+      return 0;
-+}
-+
-+static const struct of_device_id bcm6328_pinctrl_match[] = {
-+      { .compatible = "brcm,bcm6328-pinctrl", },
-+      { },
-+};
-+
-+static struct platform_driver bcm6328_pinctrl_driver = {
-+      .probe = bcm6328_pinctrl_probe,
-+      .driver = {
-+              .name = "bcm6328-pinctrl",
-+              .of_match_table = bcm6328_pinctrl_match,
-+      },
-+};
-+
-+builtin_platform_driver(bcm6328_pinctrl_driver);
diff --git a/target/linux/brcm63xx/patches-4.9/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch b/target/linux/brcm63xx/patches-4.9/133-Documentation-add-BCM6348-pincontroller-binding-docu.patch
deleted file mode 100644 (file)
index 6bac903..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-From 962c46bf7f43df730e2d3698930e77958cc6b191 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 27 Jul 2016 11:35:45 +0200
-Subject: [PATCH 04/16] Documentation: add BCM6348 pincontroller binding
- documentation
-
-Add binding documentation for the pincontrol core found in BCM6348 SoCs.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- .../bindings/pinctrl/brcm,bcm6348-pinctrl.txt      | 32 ++++++++++++++++++++++
- 1 file changed, 32 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6348-pinctrl.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6348-pinctrl.txt
-@@ -0,0 +1,32 @@
-+* Broadcom BCM6348 pin controller
-+
-+Required properties:
-+- compatible: Must be "brcm,bcm6348-pinctrl".
-+- reg: register Specifiers of dirout, dat, mode registers.
-+- reg-names: Must be "dirout", "dat", "mode".
-+- gpio-controller: Identifies this node as a GPIO controller.
-+- #gpio-cells: Must be <2>.
-+
-+Example:
-+
-+pinctrl: pin-controller@fffe0080 {
-+      compatible = "brcm,bcm6348-pinctrl";
-+      reg = <0xfffe0080 0x8>,
-+            <0xfffe0088 0x8>,
-+            <0xfffe0098 0x4>;
-+      reg-names = "dirout", "dat", "mode";
-+
-+      gpio-controller;
-+      #gpio-cells = <2>;
-+};
-+
-+Available pins/groups and functions:
-+
-+name          pins    functions
-+-----------------------------------------------------------
-+group0                32-36   ext_mii, utopia, diag
-+group1                22-31   ext_ephy, mii_snoop, mii_pccard,
-+                      spi_master_uart, utopia, diag
-+group2                16-21   pci, diag
-+group3                8-15    ext_mii, utopia
-+group4                0-7     ext_ephy, mii_snoop, legacy_led, diag
diff --git a/target/linux/brcm63xx/patches-4.9/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch b/target/linux/brcm63xx/patches-4.9/134-pinctrl-add-a-pincontrol-driver-for-BCM6348.patch
deleted file mode 100644 (file)
index b48723c..0000000
+++ /dev/null
@@ -1,431 +0,0 @@
-From 45444cb631555e2dc16b95d779b10aa075c7482e Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Fri, 24 Jun 2016 22:14:13 +0200
-Subject: [PATCH 05/16] pinctrl: add a pincontrol driver for BCM6348
-
-Add a pincotrol driver for BCM6348. BCM6348 allow muxing five groups of
-up to ten gpios into fourteen potential functions. It does not allow
-muxing individual pins. Some functions require more than one group to be
-muxed to the same function.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/pinctrl/bcm63xx/Kconfig           |   7 +
- drivers/pinctrl/bcm63xx/Makefile          |   1 +
- drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c | 391 ++++++++++++++++++++++++++++++
- 3 files changed, 399 insertions(+)
- create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c
-
---- a/drivers/pinctrl/bcm63xx/Kconfig
-+++ b/drivers/pinctrl/bcm63xx/Kconfig
-@@ -8,3 +8,10 @@ config PINCTRL_BCM6328
-       select PINCONF
-       select PINCTRL_BCM63XX
-       select GENERIC_PINCONF
-+
-+config PINCTRL_BCM6348
-+      bool "BCM6348 pincontrol driver" if COMPILE_TEST
-+      select PINMUX
-+      select PINCONF
-+      select PINCTRL_BCM63XX
-+      select GENERIC_PINCONF
---- a/drivers/pinctrl/bcm63xx/Makefile
-+++ b/drivers/pinctrl/bcm63xx/Makefile
-@@ -1,2 +1,3 @@
- obj-$(CONFIG_PINCTRL_BCM63XX) += pinctrl-bcm63xx.o
- obj-$(CONFIG_PINCTRL_BCM6328) += pinctrl-bcm6328.o
-+obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6348.c
-@@ -0,0 +1,391 @@
-+/*
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/spinlock.h>
-+#include <linux/bitops.h>
-+#include <linux/gpio.h>
-+#include <linux/of.h>
-+#include <linux/of_gpio.h>
-+#include <linux/slab.h>
-+#include <linux/platform_device.h>
-+
-+#include <linux/pinctrl/machine.h>
-+#include <linux/pinctrl/pinconf.h>
-+#include <linux/pinctrl/pinconf-generic.h>
-+#include <linux/pinctrl/pinmux.h>
-+
-+#include "../core.h"
-+#include "../pinctrl-utils.h"
-+
-+#include "pinctrl-bcm63xx.h"
-+
-+#define BCM6348_NGPIO         37
-+
-+#define MAX_GROUP             4
-+#define PINS_PER_GROUP                8
-+#define PIN_TO_GROUP(pin)     (MAX_GROUP - ((pin) / PINS_PER_GROUP))
-+#define GROUP_SHIFT(pin)      (PIN_TO_GROUP(pin) * 4)
-+#define GROUP_MASK(pin)               (0xf << GROUP_SHIFT(pin))
-+
-+struct bcm6348_pingroup {
-+      const char *name;
-+      const unsigned * const pins;
-+      const unsigned num_pins;
-+};
-+
-+struct bcm6348_function {
-+      const char *name;
-+      const char * const *groups;
-+      const unsigned num_groups;
-+      unsigned int value;
-+};
-+
-+struct bcm6348_pinctrl {
-+      struct pinctrl_dev *pctldev;
-+      struct pinctrl_desc desc;
-+
-+      void __iomem *mode;
-+
-+      /* register access lock */
-+      spinlock_t lock;
-+
-+      struct gpio_chip gpio[2];
-+};
-+
-+#define BCM6348_PIN(a, b, group)              \
-+      {                                       \
-+              .number = a,                    \
-+              .name = b,                      \
-+              .drv_data = (void *)(group),    \
-+      }
-+
-+static const struct pinctrl_pin_desc bcm6348_pins[] = {
-+      BCM6348_PIN(0, "gpio0", 4),
-+      BCM6348_PIN(1, "gpio1", 4),
-+      BCM6348_PIN(2, "gpio2", 4),
-+      BCM6348_PIN(3, "gpio3", 4),
-+      BCM6348_PIN(4, "gpio4", 4),
-+      BCM6348_PIN(5, "gpio5", 4),
-+      BCM6348_PIN(6, "gpio6", 4),
-+      BCM6348_PIN(7, "gpio7", 4),
-+      BCM6348_PIN(8, "gpio8", 3),
-+      BCM6348_PIN(9, "gpio9", 3),
-+      BCM6348_PIN(10, "gpio10", 3),
-+      BCM6348_PIN(11, "gpio11", 3),
-+      BCM6348_PIN(12, "gpio12", 3),
-+      BCM6348_PIN(13, "gpio13", 3),
-+      BCM6348_PIN(14, "gpio14", 3),
-+      BCM6348_PIN(15, "gpio15", 3),
-+      BCM6348_PIN(16, "gpio16", 2),
-+      BCM6348_PIN(17, "gpio17", 2),
-+      BCM6348_PIN(18, "gpio18", 2),
-+      BCM6348_PIN(19, "gpio19", 2),
-+      BCM6348_PIN(20, "gpio20", 2),
-+      BCM6348_PIN(21, "gpio21", 2),
-+      BCM6348_PIN(22, "gpio22", 1),
-+      BCM6348_PIN(23, "gpio23", 1),
-+      BCM6348_PIN(24, "gpio24", 1),
-+      BCM6348_PIN(25, "gpio25", 1),
-+      BCM6348_PIN(26, "gpio26", 1),
-+      BCM6348_PIN(27, "gpio27", 1),
-+      BCM6348_PIN(28, "gpio28", 1),
-+      BCM6348_PIN(29, "gpio29", 1),
-+      BCM6348_PIN(30, "gpio30", 1),
-+      BCM6348_PIN(31, "gpio31", 1),
-+      BCM6348_PIN(32, "gpio32", 0),
-+      BCM6348_PIN(33, "gpio33", 0),
-+      BCM6348_PIN(34, "gpio34", 0),
-+      BCM6348_PIN(35, "gpio35", 0),
-+      BCM6348_PIN(36, "gpio36", 0),
-+};
-+
-+enum bcm6348_muxes {
-+      BCM6348_MUX_GPIO = 0,
-+      BCM6348_MUX_EXT_EPHY,
-+      BCM6348_MUX_MII_SNOOP,
-+      BCM6348_MUX_LEGACY_LED,
-+      BCM6348_MUX_MII_PCCARD,
-+      BCM6348_MUX_PCI,
-+      BCM6348_MUX_SPI_MASTER_UART,
-+      BCM6348_MUX_EXT_MII,
-+      BCM6348_MUX_UTOPIA,
-+      BCM6348_MUX_DIAG,
-+};
-+
-+static unsigned group0_pins[] = {
-+      32, 33, 34, 35, 36,
-+};
-+
-+static unsigned group1_pins[] = {
-+      22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-+};
-+
-+static unsigned group2_pins[] = {
-+      16, 17, 18, 19, 20, 21,
-+};
-+
-+static unsigned group3_pins[] = {
-+      8, 9, 10, 11, 12, 13, 14, 15,
-+};
-+
-+static unsigned group4_pins[] = {
-+      0, 1, 2, 3, 4, 5, 6, 7,
-+};
-+
-+#define BCM6348_GROUP(n)                              \
-+      {                                               \
-+              .name = #n,                             \
-+              .pins = n##_pins,                       \
-+              .num_pins = ARRAY_SIZE(n##_pins),       \
-+      } \
-+
-+static struct bcm6348_pingroup bcm6348_groups[] = {
-+      BCM6348_GROUP(group0),
-+      BCM6348_GROUP(group1),
-+      BCM6348_GROUP(group2),
-+      BCM6348_GROUP(group3),
-+      BCM6348_GROUP(group4),
-+};
-+
-+static const char * const ext_mii_groups[] = {
-+      "group0",
-+      "group3",
-+};
-+
-+static const char * const ext_ephy_groups[] = {
-+      "group1",
-+      "group4"
-+};
-+
-+static const char * const mii_snoop_groups[] = {
-+      "group1",
-+      "group4",
-+};
-+
-+static const char * const legacy_led_groups[] = {
-+      "group4",
-+};
-+
-+static const char * const mii_pccard_groups[] = {
-+      "group1",
-+};
-+
-+static const char * const pci_groups[] = {
-+      "group2",
-+};
-+
-+static const char * const spi_master_uart_groups[] = {
-+      "group1",
-+};
-+
-+static const char * const utopia_groups[] = {
-+      "group0",
-+      "group1",
-+      "group3",
-+};
-+
-+static const char * const diag_groups[] = {
-+      "group0",
-+      "group1",
-+      "group2",
-+      "group4",
-+};
-+
-+#define BCM6348_FUN(n, f)                             \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+              .value = BCM6348_MUX_##f,               \
-+      }
-+
-+static const struct bcm6348_function bcm6348_funcs[] = {
-+      BCM6348_FUN(ext_mii, EXT_MII),
-+      BCM6348_FUN(ext_ephy, EXT_EPHY),
-+      BCM6348_FUN(mii_snoop, MII_SNOOP),
-+      BCM6348_FUN(legacy_led, LEGACY_LED),
-+      BCM6348_FUN(mii_pccard, MII_PCCARD),
-+      BCM6348_FUN(pci, PCI),
-+      BCM6348_FUN(spi_master_uart, SPI_MASTER_UART),
-+      BCM6348_FUN(utopia, UTOPIA),
-+      BCM6348_FUN(diag, DIAG),
-+};
-+
-+static int bcm6348_pinctrl_get_group_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6348_groups);
-+}
-+
-+static const char *bcm6348_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
-+                                                unsigned group)
-+{
-+      return bcm6348_groups[group].name;
-+}
-+
-+static int bcm6348_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
-+                                        unsigned group, const unsigned **pins,
-+                                        unsigned *num_pins)
-+{
-+      *pins = bcm6348_groups[group].pins;
-+      *num_pins = bcm6348_groups[group].num_pins;
-+
-+      return 0;
-+}
-+
-+static int bcm6348_pinctrl_get_func_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6348_funcs);
-+}
-+
-+static const char *bcm6348_pinctrl_get_func_name(struct pinctrl_dev *pctldev,
-+                                               unsigned selector)
-+{
-+      return bcm6348_funcs[selector].name;
-+}
-+
-+static int bcm6348_pinctrl_get_groups(struct pinctrl_dev *pctldev,
-+                                    unsigned selector,
-+                                    const char * const **groups,
-+                                    unsigned * const num_groups)
-+{
-+      *groups = bcm6348_funcs[selector].groups;
-+      *num_groups = bcm6348_funcs[selector].num_groups;
-+
-+      return 0;
-+}
-+
-+static void bcm6348_rmw_mux(struct bcm6348_pinctrl *pctl, u32 mask, u32 val)
-+{
-+      unsigned long flags;
-+      u32 reg;
-+
-+      spin_lock_irqsave(&pctl->lock, flags);
-+
-+      reg = __raw_readl(pctl->mode);
-+      reg &= ~mask;
-+      reg |= val & mask;
-+      __raw_writel(reg, pctl->mode);
-+
-+      spin_unlock_irqrestore(&pctl->lock, flags);
-+}
-+
-+static int bcm6348_pinctrl_set_mux(struct pinctrl_dev *pctldev,
-+                                 unsigned selector, unsigned group)
-+{
-+      struct bcm6348_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+      const struct bcm6348_pingroup *grp = &bcm6348_groups[group];
-+      const struct bcm6348_function *f = &bcm6348_funcs[selector];
-+      u32 mask, val;
-+
-+      /*
-+       * pins n..(n+7) share the same group, so we only need to look at
-+       * the first pin.
-+       */
-+      mask = GROUP_MASK(grp->pins[0]);
-+      val = f->value << GROUP_SHIFT(grp->pins[0]);
-+
-+      bcm6348_rmw_mux(pctl, mask, val);
-+
-+      return 0;
-+}
-+
-+static int bcm6348_gpio_request_enable(struct pinctrl_dev *pctldev,
-+                                     struct pinctrl_gpio_range *range,
-+                                     unsigned offset)
-+{
-+      struct bcm6348_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+      struct pin_desc *desc;
-+      u32 mask;
-+
-+      /* don't reconfigure if already muxed */
-+      desc = pin_desc_get(pctldev, offset);
-+      if (desc->mux_usecount)
-+              return 0;
-+
-+      mask = GROUP_MASK(offset);
-+
-+      /* disable all functions using this pin */
-+      bcm6348_rmw_mux(pctl, mask, 0);
-+
-+      return 0;
-+}
-+
-+static struct pinctrl_ops bcm6348_pctl_ops = {
-+      .get_groups_count       = bcm6348_pinctrl_get_group_count,
-+      .get_group_name         = bcm6348_pinctrl_get_group_name,
-+      .get_group_pins         = bcm6348_pinctrl_get_group_pins,
-+#ifdef CONFIG_OF
-+      .dt_node_to_map         = pinconf_generic_dt_node_to_map_pin,
-+      .dt_free_map            = pinctrl_utils_free_map,
-+#endif
-+};
-+
-+static struct pinmux_ops bcm6348_pmx_ops = {
-+      .get_functions_count    = bcm6348_pinctrl_get_func_count,
-+      .get_function_name      = bcm6348_pinctrl_get_func_name,
-+      .get_function_groups    = bcm6348_pinctrl_get_groups,
-+      .set_mux                = bcm6348_pinctrl_set_mux,
-+      .gpio_request_enable    = bcm6348_gpio_request_enable,
-+      .strict                 = true,
-+};
-+
-+static int bcm6348_pinctrl_probe(struct platform_device *pdev)
-+{
-+      struct bcm6348_pinctrl *pctl;
-+      struct resource *res;
-+      void __iomem *mode;
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mode");
-+      mode = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(mode))
-+              return PTR_ERR(mode);
-+
-+      pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
-+      if (!pctl)
-+              return -ENOMEM;
-+
-+      spin_lock_init(&pctl->lock);
-+
-+      pctl->mode = mode;
-+
-+      /* disable all muxes by default */
-+      __raw_writel(0, pctl->mode);
-+
-+      pctl->desc.name = dev_name(&pdev->dev);
-+      pctl->desc.owner = THIS_MODULE;
-+      pctl->desc.pctlops = &bcm6348_pctl_ops;
-+      pctl->desc.pmxops = &bcm6348_pmx_ops;
-+
-+      pctl->desc.npins = ARRAY_SIZE(bcm6348_pins);
-+      pctl->desc.pins = bcm6348_pins;
-+
-+      platform_set_drvdata(pdev, pctl);
-+
-+      pctl->pctldev = bcm63xx_pinctrl_register(pdev, &pctl->desc, pctl,
-+                                               pctl->gpio, BCM6348_NGPIO);
-+      if (IS_ERR(pctl->pctldev))
-+              return PTR_ERR(pctl->pctldev);
-+
-+      return 0;
-+}
-+
-+static const struct of_device_id bcm6348_pinctrl_match[] = {
-+      { .compatible = "brcm,bcm6348-pinctrl", },
-+      { },
-+};
-+
-+static struct platform_driver bcm6348_pinctrl_driver = {
-+      .probe = bcm6348_pinctrl_probe,
-+      .driver = {
-+              .name = "bcm6348-pinctrl",
-+              .of_match_table = bcm6348_pinctrl_match,
-+      },
-+};
-+
-+builtin_platform_driver(bcm6348_pinctrl_driver);
diff --git a/target/linux/brcm63xx/patches-4.9/135-Documentation-add-BCM6358-pincontroller-binding-docu.patch b/target/linux/brcm63xx/patches-4.9/135-Documentation-add-BCM6358-pincontroller-binding-docu.patch
deleted file mode 100644 (file)
index e8a7479..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-From c7c8fa7f5b5ee9bea751fa7bdae8ff4acde8f26e Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 27 Jul 2016 11:36:00 +0200
-Subject: [PATCH 06/16] Documentation: add BCM6358 pincontroller binding
- documentation
-
-Add binding documentation for the pincontrol core found in BCM6358 SoCs.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- .../bindings/pinctrl/brcm,bcm6358-pinctrl.txt      | 44 ++++++++++++++++++++++
- 1 file changed, 44 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6358-pinctrl.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6358-pinctrl.txt
-@@ -0,0 +1,44 @@
-+* Broadcom BCM6358 pin controller
-+
-+Required properties:
-+- compatible: Must be "brcm,bcm6358-pinctrl".
-+- reg: Register specifiers of dirout, dat registers.
-+- reg-names: Must be "dirout", "dat".
-+- brcm,gpiomode: Phandle to the shared gpiomode register.
-+- gpio-controller: Identifies this node as a gpio-controller.
-+- #gpio-cells: Must be <2>.
-+
-+Example:
-+
-+pinctrl: pin-controller@fffe0080 {
-+      compatible = "brcm,bcm6358-pinctrl";
-+      reg = <0xfffe0080 0x8>,
-+            <0xfffe0088 0x8>,
-+            <0xfffe0098 0x4>;
-+      reg-names = "dirout", "dat";
-+      brcm,gpiomode = <&gpiomode>;
-+
-+      gpio-controller;
-+      #gpio-cells = <2>;
-+};
-+
-+gpiomode: syscon@fffe0098 {
-+      compatible = "brcm,bcm6358-gpiomode", "syscon";
-+      reg = <0xfffe0098 0x4>;
-+      native-endian;
-+};
-+
-+Available pins/groups and functions:
-+
-+name          pins            functions
-+-----------------------------------------------------------
-+ebi_cs_grp    30-31           ebi_cs
-+uart1_grp     28-31           uart1
-+spi_cs_grp    32-33           spi_cs
-+async_modem_grp       12-15           async_modem
-+legacy_led_grp        9-15            legacy_led
-+serial_led_grp        6-7             serial_led
-+led_grp               0-3             led
-+utopia_grp    12-15, 22-31    utopia
-+pwm_syn_clk_grp       8               pwm_syn_clk
-+sys_irq_grp   5               sys_irq
diff --git a/target/linux/brcm63xx/patches-4.9/136-pinctrl-add-a-pincontrol-driver-for-BCM6358.patch b/target/linux/brcm63xx/patches-4.9/136-pinctrl-add-a-pincontrol-driver-for-BCM6358.patch
deleted file mode 100644 (file)
index 87dc741..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-From fb00ef462f3f8b70ea8902151cc72810fe90b999 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Fri, 24 Jun 2016 22:16:01 +0200
-Subject: [PATCH 07/16] pinctrl: add a pincontrol driver for BCM6358
-
-Add a pincotrol driver for BCM6358. BCM6358 allow overlaying different
-functions onto the GPIO pins. It does not support configuring individual
-pins but only whole groups. These groups may overlap, and still require
-the directions to be set correctly in the GPIO register. In addition the
-functions register controls other, not directly mux related functions.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/pinctrl/bcm63xx/Kconfig           |   8 +
- drivers/pinctrl/bcm63xx/Makefile          |   1 +
- drivers/pinctrl/bcm63xx/pinctrl-bcm6358.c | 393 ++++++++++++++++++++++++++++++
- 3 files changed, 402 insertions(+)
- create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm6358.c
-
---- a/drivers/pinctrl/bcm63xx/Kconfig
-+++ b/drivers/pinctrl/bcm63xx/Kconfig
-@@ -15,3 +15,11 @@ config PINCTRL_BCM6348
-       select PINCONF
-       select PINCTRL_BCM63XX
-       select GENERIC_PINCONF
-+
-+config PINCTRL_BCM6358
-+      bool "BCM6358 pincontrol driver" if COMPILE_TEST
-+      select PINMUX
-+      select PINCONF
-+      select PINCTRL_BCM63XX
-+      select GENERIC_PINCONF
-+      select MFD_SYSCON
---- a/drivers/pinctrl/bcm63xx/Makefile
-+++ b/drivers/pinctrl/bcm63xx/Makefile
-@@ -1,3 +1,4 @@
- obj-$(CONFIG_PINCTRL_BCM63XX) += pinctrl-bcm63xx.o
- obj-$(CONFIG_PINCTRL_BCM6328) += pinctrl-bcm6328.o
- obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o
-+obj-$(CONFIG_PINCTRL_BCM6358) += pinctrl-bcm6358.o
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6358.c
-@@ -0,0 +1,393 @@
-+/*
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/bitops.h>
-+#include <linux/gpio.h>
-+#include <linux/gpio/driver.h>
-+#include <linux/mfd/syscon.h>
-+#include <linux/of.h>
-+#include <linux/of_gpio.h>
-+#include <linux/of_address.h>
-+#include <linux/slab.h>
-+#include <linux/regmap.h>
-+#include <linux/platform_device.h>
-+
-+#include <linux/pinctrl/pinconf.h>
-+#include <linux/pinctrl/pinconf-generic.h>
-+#include <linux/pinctrl/pinmux.h>
-+#include <linux/pinctrl/machine.h>
-+
-+#include "../core.h"
-+#include "../pinctrl-utils.h"
-+
-+#include "pinctrl-bcm63xx.h"
-+
-+/* GPIO_MODE register */
-+#define BCM6358_MODE_MUX_NONE         0
-+
-+/* overlays on gpio pins */
-+#define BCM6358_MODE_MUX_EBI_CS               BIT(5)
-+#define BCM6358_MODE_MUX_UART1                BIT(6)
-+#define BCM6358_MODE_MUX_SPI_CS               BIT(7)
-+#define BCM6358_MODE_MUX_ASYNC_MODEM  BIT(8)
-+#define BCM6358_MODE_MUX_LEGACY_LED   BIT(9)
-+#define BCM6358_MODE_MUX_SERIAL_LED   BIT(10)
-+#define BCM6358_MODE_MUX_LED          BIT(11)
-+#define BCM6358_MODE_MUX_UTOPIA               BIT(12)
-+#define BCM6358_MODE_MUX_CLKRST               BIT(13)
-+#define BCM6358_MODE_MUX_PWM_SYN_CLK  BIT(14)
-+#define BCM6358_MODE_MUX_SYS_IRQ      BIT(15)
-+
-+#define BCM6358_NGPIO                 40
-+
-+struct bcm6358_pingroup {
-+      const char *name;
-+      const unsigned * const pins;
-+      const unsigned num_pins;
-+
-+      const u16 mode_val;
-+
-+      /* non-GPIO function muxes require the gpio direction to be set */
-+      const u16 direction;
-+};
-+
-+struct bcm6358_function {
-+      const char *name;
-+      const char * const *groups;
-+      const unsigned num_groups;
-+};
-+
-+struct bcm6358_pinctrl {
-+      struct device *dev;
-+      struct pinctrl_dev *pctldev;
-+      struct pinctrl_desc desc;
-+
-+      struct regmap_field *overlays;
-+
-+      struct gpio_chip gpio[2];
-+};
-+
-+#define BCM6358_GPIO_PIN(a, b, bit1, bit2, bit3)              \
-+      {                                                       \
-+              .number = a,                                    \
-+              .name = b,                                      \
-+              .drv_data = (void *)(BCM6358_MODE_MUX_##bit1 |  \
-+                                   BCM6358_MODE_MUX_##bit2 |  \
-+                                   BCM6358_MODE_MUX_##bit3),  \
-+      }
-+
-+static const struct pinctrl_pin_desc bcm6358_pins[] = {
-+      BCM6358_GPIO_PIN(0, "gpio0", LED, NONE, NONE),
-+      BCM6358_GPIO_PIN(1, "gpio1", LED, NONE, NONE),
-+      BCM6358_GPIO_PIN(2, "gpio2", LED, NONE, NONE),
-+      BCM6358_GPIO_PIN(3, "gpio3", LED, NONE, NONE),
-+      PINCTRL_PIN(4, "gpio4"),
-+      BCM6358_GPIO_PIN(5, "gpio5", SYS_IRQ, NONE, NONE),
-+      BCM6358_GPIO_PIN(6, "gpio6", SERIAL_LED, NONE, NONE),
-+      BCM6358_GPIO_PIN(7, "gpio7", SERIAL_LED, NONE, NONE),
-+      BCM6358_GPIO_PIN(8, "gpio8", PWM_SYN_CLK, NONE, NONE),
-+      BCM6358_GPIO_PIN(9, "gpio09", LEGACY_LED, NONE, NONE),
-+      BCM6358_GPIO_PIN(10, "gpio10", LEGACY_LED, NONE, NONE),
-+      BCM6358_GPIO_PIN(11, "gpio11", LEGACY_LED, NONE, NONE),
-+      BCM6358_GPIO_PIN(12, "gpio12", LEGACY_LED, ASYNC_MODEM, UTOPIA),
-+      BCM6358_GPIO_PIN(13, "gpio13", LEGACY_LED, ASYNC_MODEM, UTOPIA),
-+      BCM6358_GPIO_PIN(14, "gpio14", LEGACY_LED, ASYNC_MODEM, UTOPIA),
-+      BCM6358_GPIO_PIN(15, "gpio15", LEGACY_LED, ASYNC_MODEM, UTOPIA),
-+      PINCTRL_PIN(16, "gpio16"),
-+      PINCTRL_PIN(17, "gpio17"),
-+      PINCTRL_PIN(18, "gpio18"),
-+      PINCTRL_PIN(19, "gpio19"),
-+      PINCTRL_PIN(20, "gpio20"),
-+      PINCTRL_PIN(21, "gpio21"),
-+      BCM6358_GPIO_PIN(22, "gpio22", UTOPIA, NONE, NONE),
-+      BCM6358_GPIO_PIN(23, "gpio23", UTOPIA, NONE, NONE),
-+      BCM6358_GPIO_PIN(24, "gpio24", UTOPIA, NONE, NONE),
-+      BCM6358_GPIO_PIN(25, "gpio25", UTOPIA, NONE, NONE),
-+      BCM6358_GPIO_PIN(26, "gpio26", UTOPIA, NONE, NONE),
-+      BCM6358_GPIO_PIN(27, "gpio27", UTOPIA, NONE, NONE),
-+      BCM6358_GPIO_PIN(28, "gpio28", UTOPIA, UART1, NONE),
-+      BCM6358_GPIO_PIN(29, "gpio29", UTOPIA, UART1, NONE),
-+      BCM6358_GPIO_PIN(30, "gpio30", UTOPIA, UART1, EBI_CS),
-+      BCM6358_GPIO_PIN(31, "gpio31", UTOPIA, UART1, EBI_CS),
-+      BCM6358_GPIO_PIN(32, "gpio32", SPI_CS, NONE, NONE),
-+      BCM6358_GPIO_PIN(33, "gpio33", SPI_CS, NONE, NONE),
-+      PINCTRL_PIN(34, "gpio34"),
-+      PINCTRL_PIN(35, "gpio35"),
-+      PINCTRL_PIN(36, "gpio36"),
-+      PINCTRL_PIN(37, "gpio37"),
-+      PINCTRL_PIN(38, "gpio38"),
-+      PINCTRL_PIN(39, "gpio39"),
-+};
-+
-+static unsigned ebi_cs_grp_pins[] = { 30, 31 };
-+
-+static unsigned uart1_grp_pins[] = { 28, 29, 30, 31 };
-+
-+static unsigned spi_cs_grp_pins[] = { 32, 33 };
-+
-+static unsigned async_modem_grp_pins[] = { 12, 13, 14, 15 };
-+
-+static unsigned serial_led_grp_pins[] = { 6, 7 };
-+
-+static unsigned legacy_led_grp_pins[] = { 9, 10, 11, 12, 13, 14, 15 };
-+
-+static unsigned led_grp_pins[] = { 0, 1, 2, 3 };
-+
-+static unsigned utopia_grp_pins[] = {
-+      12, 13, 14, 15, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-+};
-+
-+static unsigned pwm_syn_clk_grp_pins[] = { 8 };
-+
-+static unsigned sys_irq_grp_pins[] = { 5 };
-+
-+#define BCM6358_GPIO_MUX_GROUP(n, bit, dir)                   \
-+      {                                                       \
-+              .name = #n,                                     \
-+              .pins = n##_pins,                               \
-+              .num_pins = ARRAY_SIZE(n##_pins),               \
-+              .mode_val = BCM6358_MODE_MUX_##bit,             \
-+              .direction = dir,                               \
-+      }
-+
-+static const struct bcm6358_pingroup bcm6358_groups[] = {
-+      BCM6358_GPIO_MUX_GROUP(ebi_cs_grp, EBI_CS, 0x3),
-+      BCM6358_GPIO_MUX_GROUP(uart1_grp, UART1, 0x2),
-+      BCM6358_GPIO_MUX_GROUP(spi_cs_grp, SPI_CS, 0x6),
-+      BCM6358_GPIO_MUX_GROUP(async_modem_grp, ASYNC_MODEM, 0x6),
-+      BCM6358_GPIO_MUX_GROUP(legacy_led_grp, LEGACY_LED, 0x7f),
-+      BCM6358_GPIO_MUX_GROUP(serial_led_grp, SERIAL_LED, 0x3),
-+      BCM6358_GPIO_MUX_GROUP(led_grp, LED, 0xf),
-+      BCM6358_GPIO_MUX_GROUP(utopia_grp, UTOPIA, 0x000f),
-+      BCM6358_GPIO_MUX_GROUP(pwm_syn_clk_grp, PWM_SYN_CLK, 0x1),
-+      BCM6358_GPIO_MUX_GROUP(sys_irq_grp, SYS_IRQ, 0x1),
-+};
-+
-+static const char * const ebi_cs_groups[] = {
-+      "ebi_cs_grp"
-+};
-+
-+static const char * const uart1_groups[] = {
-+      "uart1_grp"
-+};
-+
-+static const char * const spi_cs_2_3_groups[] = {
-+      "spi_cs_2_3_grp"
-+};
-+
-+static const char * const async_modem_groups[] = {
-+      "async_modem_grp"
-+};
-+
-+static const char * const legacy_led_groups[] = {
-+      "legacy_led_grp",
-+};
-+
-+static const char * const serial_led_groups[] = {
-+      "serial_led_grp",
-+};
-+
-+static const char * const led_groups[] = {
-+      "led_grp",
-+};
-+
-+static const char * const clkrst_groups[] = {
-+      "clkrst_grp",
-+};
-+
-+static const char * const pwm_syn_clk_groups[] = {
-+      "pwm_syn_clk_grp",
-+};
-+
-+static const char * const sys_irq_groups[] = {
-+      "sys_irq_grp",
-+};
-+
-+#define BCM6358_FUN(n)                                        \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+      }
-+
-+static const struct bcm6358_function bcm6358_funcs[] = {
-+      BCM6358_FUN(ebi_cs),
-+      BCM6358_FUN(uart1),
-+      BCM6358_FUN(spi_cs_2_3),
-+      BCM6358_FUN(async_modem),
-+      BCM6358_FUN(legacy_led),
-+      BCM6358_FUN(serial_led),
-+      BCM6358_FUN(led),
-+      BCM6358_FUN(clkrst),
-+      BCM6358_FUN(pwm_syn_clk),
-+      BCM6358_FUN(sys_irq),
-+};
-+
-+static int bcm6358_pinctrl_get_group_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6358_groups);
-+}
-+
-+static const char *bcm6358_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
-+                                                unsigned group)
-+{
-+      return bcm6358_groups[group].name;
-+}
-+
-+static int bcm6358_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
-+                                        unsigned group, const unsigned **pins,
-+                                        unsigned *num_pins)
-+{
-+      *pins = bcm6358_groups[group].pins;
-+      *num_pins = bcm6358_groups[group].num_pins;
-+
-+      return 0;
-+}
-+
-+static int bcm6358_pinctrl_get_func_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6358_funcs);
-+}
-+
-+static const char *bcm6358_pinctrl_get_func_name(struct pinctrl_dev *pctldev,
-+                                               unsigned selector)
-+{
-+      return bcm6358_funcs[selector].name;
-+}
-+
-+static int bcm6358_pinctrl_get_groups(struct pinctrl_dev *pctldev,
-+                                    unsigned selector,
-+                                    const char * const **groups,
-+                                    unsigned * const num_groups)
-+{
-+      *groups = bcm6358_funcs[selector].groups;
-+      *num_groups = bcm6358_funcs[selector].num_groups;
-+
-+      return 0;
-+}
-+
-+static int bcm6358_pinctrl_set_mux(struct pinctrl_dev *pctldev,
-+                                 unsigned selector, unsigned group)
-+{
-+      struct bcm6358_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+      const struct bcm6358_pingroup *grp = &bcm6358_groups[group];
-+      u32 val = grp->mode_val;
-+      u32 mask = val;
-+      unsigned pin;
-+
-+      for (pin = 0; pin < grp->num_pins; pin++)
-+              mask |= (unsigned long)bcm6358_pins[pin].drv_data;
-+
-+      regmap_field_update_bits(pctl->overlays, mask, val);
-+
-+      for (pin = 0; pin < grp->num_pins; pin++) {
-+              int hw_gpio = bcm6358_pins[pin].number;
-+              struct gpio_chip *gc = &pctl->gpio[hw_gpio / 32];
-+
-+              if (grp->direction & BIT(pin))
-+                      gc->direction_output(gc, hw_gpio % 32, 0);
-+              else
-+                      gc->direction_input(gc, hw_gpio % 32);
-+      }
-+
-+      return 0;
-+}
-+
-+static int bcm6358_gpio_request_enable(struct pinctrl_dev *pctldev,
-+                                     struct pinctrl_gpio_range *range,
-+                                     unsigned offset)
-+{
-+      struct bcm6358_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+      u32 mask;
-+
-+      mask = (unsigned long)bcm6358_pins[offset].drv_data;
-+      if (!mask)
-+              return 0;
-+
-+      /* disable all functions using this pin */
-+      return regmap_field_update_bits(pctl->overlays, mask, 0);
-+}
-+
-+static struct pinctrl_ops bcm6358_pctl_ops = {
-+      .get_groups_count       = bcm6358_pinctrl_get_group_count,
-+      .get_group_name         = bcm6358_pinctrl_get_group_name,
-+      .get_group_pins         = bcm6358_pinctrl_get_group_pins,
-+#ifdef CONFIG_OF
-+      .dt_node_to_map         = pinconf_generic_dt_node_to_map_pin,
-+      .dt_free_map            = pinctrl_utils_free_map,
-+#endif
-+};
-+
-+static struct pinmux_ops bcm6358_pmx_ops = {
-+      .get_functions_count    = bcm6358_pinctrl_get_func_count,
-+      .get_function_name      = bcm6358_pinctrl_get_func_name,
-+      .get_function_groups    = bcm6358_pinctrl_get_groups,
-+      .set_mux                = bcm6358_pinctrl_set_mux,
-+      .gpio_request_enable    = bcm6358_gpio_request_enable,
-+      .strict                 = true,
-+};
-+
-+static int bcm6358_pinctrl_probe(struct platform_device *pdev)
-+{
-+      struct bcm6358_pinctrl *pctl;
-+      struct regmap *mode;
-+      struct reg_field overlays = REG_FIELD(0, 0, 15);
-+
-+      if (pdev->dev.of_node)
-+              mode = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
-+                                                     "brcm,gpiomode");
-+      else
-+              mode = syscon_regmap_lookup_by_pdevname("syscon.fffe0098");
-+
-+      if (IS_ERR(mode))
-+              return PTR_ERR(mode);
-+
-+      pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
-+      if (!pctl)
-+              return -ENOMEM;
-+
-+      pctl->overlays = devm_regmap_field_alloc(&pdev->dev, mode, overlays);
-+      if (IS_ERR(pctl->overlays))
-+              return PTR_ERR(pctl->overlays);
-+
-+      /* disable all muxes by default */
-+      regmap_field_write(pctl->overlays, 0);
-+
-+      pctl->desc.name = dev_name(&pdev->dev);
-+      pctl->desc.owner = THIS_MODULE;
-+      pctl->desc.pctlops = &bcm6358_pctl_ops;
-+      pctl->desc.pmxops = &bcm6358_pmx_ops;
-+
-+      pctl->desc.npins = ARRAY_SIZE(bcm6358_pins);
-+      pctl->desc.pins = bcm6358_pins;
-+
-+      platform_set_drvdata(pdev, pctl);
-+
-+      pctl->pctldev = bcm63xx_pinctrl_register(pdev, &pctl->desc, pctl,
-+                                               pctl->gpio, BCM6358_NGPIO);
-+      if (IS_ERR(pctl->pctldev))
-+              return PTR_ERR(pctl->pctldev);
-+
-+      return 0;
-+}
-+
-+static const struct of_device_id bcm6358_pinctrl_match[] = {
-+      { .compatible = "brcm,bcm6358-pinctrl", },
-+      { },
-+};
-+
-+static struct platform_driver bcm6358_pinctrl_driver = {
-+      .probe = bcm6358_pinctrl_probe,
-+      .driver = {
-+              .name = "bcm6358-pinctrl",
-+              .of_match_table = bcm6358_pinctrl_match,
-+      },
-+};
-+
-+builtin_platform_driver(bcm6358_pinctrl_driver);
diff --git a/target/linux/brcm63xx/patches-4.9/137-Documentation-add-BCM6362-pincontroller-binding-docu.patch b/target/linux/brcm63xx/patches-4.9/137-Documentation-add-BCM6362-pincontroller-binding-docu.patch
deleted file mode 100644 (file)
index 9fc424c..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-From ba03ea8ada2ca71c9095d96a1e4085c2c5cf0e69 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 27 Jul 2016 11:36:18 +0200
-Subject: [PATCH 08/16] Documentation: add BCM6362 pincontroller binding
- documentation
-
-Add binding documentation for the pincontrol core found in BCM6362 SoCs.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- .../bindings/pinctrl/brcm,bcm6362-pinctrl.txt      | 79 ++++++++++++++++++++++
- 1 file changed, 79 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6362-pinctrl.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6362-pinctrl.txt
-@@ -0,0 +1,79 @@
-+* Broadcom BCM6362 pin controller
-+
-+Required properties:
-+- compatible: Must be "brcm,bcm6362-pinctrl"
-+- reg: Register specifiers of dirout, dat, led, mode, ctrl, basemode registers.
-+- reg-names: Must be "dirout", "dat", "led", "mode", "ctrl", "basemode".
-+- gpio-controller: Identifies this node as a GPIO controller.
-+- #gpio-cells: Must be <2>.
-+
-+Example:
-+
-+pinctrl: pin-controller@10000080 {
-+      compatible = "brcm,bcm6362-pinctrl";
-+      reg = <0x10000080 0x8>,
-+            <0x10000088 0x8>,
-+            <0x10000090 0x4>,
-+            <0x10000098 0x4>,
-+            <0x1000009c 0x4>,
-+            <0x100000b8 0x4>;
-+      reg-names = "dirout", "dat", "led",
-+                  "mode", "ctrl", "basemode";
-+
-+      gpio-controller;
-+      #gpio-cells = <2>;
-+};
-+
-+Available pins/groups and functions:
-+
-+name          pins            functions
-+-----------------------------------------------------------
-+gpio0         0               led, usb_device_led
-+gpio1         1               led, sys_irq
-+gpio2         2               led, serial_led_clk
-+gpio3         3               led, serial_led_data
-+gpio4         4               led, robosw_led_data
-+gpio5         5               led, robosw_led_clk
-+gpio6         6               led, robosw_led0
-+gpio7         7               led, robosw_led1
-+gpio8         8               led, inet_led
-+gpio9         9               led, spi_cs2
-+gpio10                10              led, spi_cs3
-+gpio11                11              led, ntr_pulse
-+gpio12                12              led, uart1_scts
-+gpio13                13              led, uart1_srts
-+gpio14                14              led, uart1_sdin
-+gpio15                15              led, uart1_sdout
-+gpio16                16              led, adsl_spi_miso
-+gpio17                17              led, adsl_spi_mosi
-+gpio18                18              led, adsl_spi_clk
-+gpio19                19              led, adsl_spi_cs
-+gpio20                20              led, ephy0_led
-+gpio21                21              led, ephy1_led
-+gpio22                22              led, ephy2_led
-+gpio23                23              led, ephy3_led
-+gpio24                24              ext_irq0
-+gpio25                25              ext_irq1
-+gpio26                26              ext_irq2
-+gpio27                27              ext_irq3
-+gpio28                28              -
-+gpio29                29              -
-+gpio30                30              -
-+gpio31                31              -
-+gpio32                32              wifi
-+gpio33                33              wifi
-+gpio34                34              wifi
-+gpio35                35              wifi
-+gpio36                36              wifi
-+gpio37                37              wifi
-+gpio38                38              wifi
-+gpio39                39              wifi
-+gpio40                40              wifi
-+gpio41                41              wifi
-+gpio42                42              wifi
-+gpio43                43              wifi
-+gpio44                44              wifi
-+gpio45                45              wifi
-+gpio46                46              wifi
-+gpio47                47              wifi
-+nand_grp      8, 12-23, 27    nand
diff --git a/target/linux/brcm63xx/patches-4.9/138-pinctrl-add-a-pincontrol-driver-for-BCM6362.patch b/target/linux/brcm63xx/patches-4.9/138-pinctrl-add-a-pincontrol-driver-for-BCM6362.patch
deleted file mode 100644 (file)
index 726a97f..0000000
+++ /dev/null
@@ -1,733 +0,0 @@
-From eea6b96701d734095e2f823f3a82d9b063f553ae Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Fri, 24 Jun 2016 22:17:20 +0200
-Subject: [PATCH 09/16] pinctrl: add a pincontrol driver for BCM6362
-
-Add a pincotrol driver for BCM6362. BCM6362 allows muxing individual
-GPIO pins to the LED controller, to be available by the integrated
-wifi, or other functions. It also supports overlay groups, of which
-only NAND is documented.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/pinctrl/bcm63xx/Kconfig           |   7 +
- drivers/pinctrl/bcm63xx/Makefile          |   1 +
- drivers/pinctrl/bcm63xx/pinctrl-bcm6362.c | 692 ++++++++++++++++++++++++++++++
- 3 files changed, 700 insertions(+)
- create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm6362.c
-
---- a/drivers/pinctrl/bcm63xx/Kconfig
-+++ b/drivers/pinctrl/bcm63xx/Kconfig
-@@ -23,3 +23,10 @@ config PINCTRL_BCM6358
-       select PINCTRL_BCM63XX
-       select GENERIC_PINCONF
-       select MFD_SYSCON
-+
-+config PINCTRL_BCM6362
-+      bool "BCM6362 pincontrol driver" if COMPILE_TEST
-+      select PINMUX
-+      select PINCONF
-+      select PINCTRL_BCM63XX
-+      select GENERIC_PINCONF
---- a/drivers/pinctrl/bcm63xx/Makefile
-+++ b/drivers/pinctrl/bcm63xx/Makefile
-@@ -2,3 +2,4 @@ obj-$(CONFIG_PINCTRL_BCM63XX)  += pinctrl
- obj-$(CONFIG_PINCTRL_BCM6328) += pinctrl-bcm6328.o
- obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o
- obj-$(CONFIG_PINCTRL_BCM6358) += pinctrl-bcm6358.o
-+obj-$(CONFIG_PINCTRL_BCM6362) += pinctrl-bcm6362.o
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6362.c
-@@ -0,0 +1,692 @@
-+/*
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/spinlock.h>
-+#include <linux/bitops.h>
-+#include <linux/gpio.h>
-+#include <linux/of.h>
-+#include <linux/of_gpio.h>
-+#include <linux/slab.h>
-+#include <linux/platform_device.h>
-+
-+#include <linux/pinctrl/pinconf.h>
-+#include <linux/pinctrl/pinconf-generic.h>
-+#include <linux/pinctrl/pinmux.h>
-+#include <linux/pinctrl/machine.h>
-+
-+#include "../core.h"
-+#include "../pinctrl-utils.h"
-+
-+#include "pinctrl-bcm63xx.h"
-+
-+#define BCM6362_NGPIO 48
-+
-+/* GPIO_BASEMODE register */
-+#define BASEMODE_NAND BIT(2)
-+
-+enum bcm6362_pinctrl_reg {
-+      BCM6362_LEDCTRL,
-+      BCM6362_MODE,
-+      BCM6362_CTRL,
-+      BCM6362_BASEMODE,
-+};
-+
-+struct bcm6362_pingroup {
-+      const char *name;
-+      const unsigned * const pins;
-+      const unsigned num_pins;
-+};
-+
-+struct bcm6362_function {
-+      const char *name;
-+      const char * const *groups;
-+      const unsigned num_groups;
-+
-+      enum bcm6362_pinctrl_reg reg;
-+      u32 basemode_mask;
-+};
-+
-+struct bcm6362_pinctrl {
-+      struct pinctrl_dev *pctldev;
-+      struct pinctrl_desc desc;
-+
-+      void __iomem *led;
-+      void __iomem *mode;
-+      void __iomem *ctrl;
-+      void __iomem *basemode;
-+
-+      /* register access lock */
-+      spinlock_t lock;
-+
-+      struct gpio_chip gpio[2];
-+};
-+
-+#define BCM6362_PIN(a, b, mask)                       \
-+      {                                       \
-+              .number = a,                    \
-+              .name = b,                      \
-+              .drv_data = (void *)(mask),     \
-+      }
-+
-+static const struct pinctrl_pin_desc bcm6362_pins[] = {
-+      PINCTRL_PIN(0, "gpio0"),
-+      PINCTRL_PIN(1, "gpio1"),
-+      PINCTRL_PIN(2, "gpio2"),
-+      PINCTRL_PIN(3, "gpio3"),
-+      PINCTRL_PIN(4, "gpio4"),
-+      PINCTRL_PIN(5, "gpio5"),
-+      PINCTRL_PIN(6, "gpio6"),
-+      PINCTRL_PIN(7, "gpio7"),
-+      BCM6362_PIN(8, "gpio8", BASEMODE_NAND),
-+      PINCTRL_PIN(9, "gpio9"),
-+      PINCTRL_PIN(10, "gpio10"),
-+      PINCTRL_PIN(11, "gpio11"),
-+      BCM6362_PIN(12, "gpio12", BASEMODE_NAND),
-+      BCM6362_PIN(13, "gpio13", BASEMODE_NAND),
-+      BCM6362_PIN(14, "gpio14", BASEMODE_NAND),
-+      BCM6362_PIN(15, "gpio15", BASEMODE_NAND),
-+      BCM6362_PIN(16, "gpio16", BASEMODE_NAND),
-+      BCM6362_PIN(17, "gpio17", BASEMODE_NAND),
-+      BCM6362_PIN(18, "gpio18", BASEMODE_NAND),
-+      BCM6362_PIN(19, "gpio19", BASEMODE_NAND),
-+      BCM6362_PIN(20, "gpio20", BASEMODE_NAND),
-+      BCM6362_PIN(21, "gpio21", BASEMODE_NAND),
-+      BCM6362_PIN(22, "gpio22", BASEMODE_NAND),
-+      BCM6362_PIN(23, "gpio23", BASEMODE_NAND),
-+      PINCTRL_PIN(24, "gpio24"),
-+      PINCTRL_PIN(25, "gpio25"),
-+      PINCTRL_PIN(26, "gpio26"),
-+      BCM6362_PIN(27, "gpio27", BASEMODE_NAND),
-+      PINCTRL_PIN(28, "gpio28"),
-+      PINCTRL_PIN(29, "gpio29"),
-+      PINCTRL_PIN(30, "gpio30"),
-+      PINCTRL_PIN(31, "gpio31"),
-+      PINCTRL_PIN(32, "gpio32"),
-+      PINCTRL_PIN(33, "gpio33"),
-+      PINCTRL_PIN(34, "gpio34"),
-+      PINCTRL_PIN(35, "gpio35"),
-+      PINCTRL_PIN(36, "gpio36"),
-+      PINCTRL_PIN(37, "gpio37"),
-+      PINCTRL_PIN(38, "gpio38"),
-+      PINCTRL_PIN(39, "gpio39"),
-+      PINCTRL_PIN(40, "gpio40"),
-+      PINCTRL_PIN(41, "gpio41"),
-+      PINCTRL_PIN(42, "gpio42"),
-+      PINCTRL_PIN(43, "gpio43"),
-+      PINCTRL_PIN(44, "gpio44"),
-+      PINCTRL_PIN(45, "gpio45"),
-+      PINCTRL_PIN(46, "gpio46"),
-+      PINCTRL_PIN(47, "gpio47"),
-+};
-+
-+static unsigned gpio0_pins[] = { 0 };
-+static unsigned gpio1_pins[] = { 1 };
-+static unsigned gpio2_pins[] = { 2 };
-+static unsigned gpio3_pins[] = { 3 };
-+static unsigned gpio4_pins[] = { 4 };
-+static unsigned gpio5_pins[] = { 5 };
-+static unsigned gpio6_pins[] = { 6 };
-+static unsigned gpio7_pins[] = { 7 };
-+static unsigned gpio8_pins[] = { 8 };
-+static unsigned gpio9_pins[] = { 9 };
-+static unsigned gpio10_pins[] = { 10 };
-+static unsigned gpio11_pins[] = { 11 };
-+static unsigned gpio12_pins[] = { 12 };
-+static unsigned gpio13_pins[] = { 13 };
-+static unsigned gpio14_pins[] = { 14 };
-+static unsigned gpio15_pins[] = { 15 };
-+static unsigned gpio16_pins[] = { 16 };
-+static unsigned gpio17_pins[] = { 17 };
-+static unsigned gpio18_pins[] = { 18 };
-+static unsigned gpio19_pins[] = { 19 };
-+static unsigned gpio20_pins[] = { 20 };
-+static unsigned gpio21_pins[] = { 21 };
-+static unsigned gpio22_pins[] = { 22 };
-+static unsigned gpio23_pins[] = { 23 };
-+static unsigned gpio24_pins[] = { 24 };
-+static unsigned gpio25_pins[] = { 25 };
-+static unsigned gpio26_pins[] = { 26 };
-+static unsigned gpio27_pins[] = { 27 };
-+static unsigned gpio28_pins[] = { 28 };
-+static unsigned gpio29_pins[] = { 29 };
-+static unsigned gpio30_pins[] = { 30 };
-+static unsigned gpio31_pins[] = { 31 };
-+static unsigned gpio32_pins[] = { 32 };
-+static unsigned gpio33_pins[] = { 33 };
-+static unsigned gpio34_pins[] = { 34 };
-+static unsigned gpio35_pins[] = { 35 };
-+static unsigned gpio36_pins[] = { 36 };
-+static unsigned gpio37_pins[] = { 37 };
-+static unsigned gpio38_pins[] = { 38 };
-+static unsigned gpio39_pins[] = { 39 };
-+static unsigned gpio40_pins[] = { 40 };
-+static unsigned gpio41_pins[] = { 41 };
-+static unsigned gpio42_pins[] = { 42 };
-+static unsigned gpio43_pins[] = { 43 };
-+static unsigned gpio44_pins[] = { 44 };
-+static unsigned gpio45_pins[] = { 45 };
-+static unsigned gpio46_pins[] = { 46 };
-+static unsigned gpio47_pins[] = { 47 };
-+
-+static unsigned nand_grp_pins[] = {
-+      8, 12, 13, 14, 15, 16, 17,
-+      18, 19, 20, 21, 22, 23, 27,
-+};
-+
-+#define BCM6362_GROUP(n)                              \
-+      {                                               \
-+              .name = #n,                             \
-+              .pins = n##_pins,                       \
-+              .num_pins = ARRAY_SIZE(n##_pins),       \
-+      }
-+
-+static struct bcm6362_pingroup bcm6362_groups[] = {
-+      BCM6362_GROUP(gpio0),
-+      BCM6362_GROUP(gpio1),
-+      BCM6362_GROUP(gpio2),
-+      BCM6362_GROUP(gpio3),
-+      BCM6362_GROUP(gpio4),
-+      BCM6362_GROUP(gpio5),
-+      BCM6362_GROUP(gpio6),
-+      BCM6362_GROUP(gpio7),
-+      BCM6362_GROUP(gpio8),
-+      BCM6362_GROUP(gpio9),
-+      BCM6362_GROUP(gpio10),
-+      BCM6362_GROUP(gpio11),
-+      BCM6362_GROUP(gpio12),
-+      BCM6362_GROUP(gpio13),
-+      BCM6362_GROUP(gpio14),
-+      BCM6362_GROUP(gpio15),
-+      BCM6362_GROUP(gpio16),
-+      BCM6362_GROUP(gpio17),
-+      BCM6362_GROUP(gpio18),
-+      BCM6362_GROUP(gpio19),
-+      BCM6362_GROUP(gpio20),
-+      BCM6362_GROUP(gpio21),
-+      BCM6362_GROUP(gpio22),
-+      BCM6362_GROUP(gpio23),
-+      BCM6362_GROUP(gpio24),
-+      BCM6362_GROUP(gpio25),
-+      BCM6362_GROUP(gpio26),
-+      BCM6362_GROUP(gpio27),
-+      BCM6362_GROUP(gpio28),
-+      BCM6362_GROUP(gpio29),
-+      BCM6362_GROUP(gpio30),
-+      BCM6362_GROUP(gpio31),
-+      BCM6362_GROUP(gpio32),
-+      BCM6362_GROUP(gpio33),
-+      BCM6362_GROUP(gpio34),
-+      BCM6362_GROUP(gpio35),
-+      BCM6362_GROUP(gpio36),
-+      BCM6362_GROUP(gpio37),
-+      BCM6362_GROUP(gpio38),
-+      BCM6362_GROUP(gpio39),
-+      BCM6362_GROUP(gpio40),
-+      BCM6362_GROUP(gpio41),
-+      BCM6362_GROUP(gpio42),
-+      BCM6362_GROUP(gpio43),
-+      BCM6362_GROUP(gpio44),
-+      BCM6362_GROUP(gpio45),
-+      BCM6362_GROUP(gpio46),
-+      BCM6362_GROUP(gpio47),
-+      BCM6362_GROUP(nand_grp),
-+};
-+
-+static const char * const led_groups[] = {
-+      "gpio0",
-+      "gpio1",
-+      "gpio2",
-+      "gpio3",
-+      "gpio4",
-+      "gpio5",
-+      "gpio6",
-+      "gpio7",
-+      "gpio8",
-+      "gpio9",
-+      "gpio10",
-+      "gpio11",
-+      "gpio12",
-+      "gpio13",
-+      "gpio14",
-+      "gpio15",
-+      "gpio16",
-+      "gpio17",
-+      "gpio18",
-+      "gpio19",
-+      "gpio20",
-+      "gpio21",
-+      "gpio22",
-+      "gpio23",
-+};
-+
-+static const char * const usb_device_led_groups[] = {
-+      "gpio0",
-+};
-+
-+static const char * const sys_irq_groups[] = {
-+      "gpio1",
-+};
-+
-+static const char * const serial_led_clk_groups[] = {
-+      "gpio2",
-+};
-+
-+static const char * const serial_led_data_groups[] = {
-+      "gpio3",
-+};
-+
-+static const char * const robosw_led_data_groups[] = {
-+      "gpio4",
-+};
-+
-+static const char * const robosw_led_clk_groups[] = {
-+      "gpio5",
-+};
-+
-+static const char * const robosw_led0_groups[] = {
-+      "gpio6",
-+};
-+
-+static const char * const robosw_led1_groups[] = {
-+      "gpio7",
-+};
-+
-+static const char * const inet_led_groups[] = {
-+      "gpio8",
-+};
-+
-+static const char * const spi_cs2_groups[] = {
-+      "gpio9",
-+};
-+
-+static const char * const spi_cs3_groups[] = {
-+      "gpio10",
-+};
-+
-+static const char * const ntr_pulse_groups[] = {
-+      "gpio11",
-+};
-+
-+static const char * const uart1_scts_groups[] = {
-+      "gpio12",
-+};
-+
-+static const char * const uart1_srts_groups[] = {
-+      "gpio13",
-+};
-+
-+static const char * const uart1_sdin_groups[] = {
-+      "gpio14",
-+};
-+
-+static const char * const uart1_sdout_groups[] = {
-+      "gpio15",
-+};
-+
-+static const char * const adsl_spi_miso_groups[] = {
-+      "gpio16",
-+};
-+
-+static const char * const adsl_spi_mosi_groups[] = {
-+      "gpio17",
-+};
-+
-+static const char * const adsl_spi_clk_groups[] = {
-+      "gpio18",
-+};
-+
-+static const char * const adsl_spi_cs_groups[] = {
-+      "gpio19",
-+};
-+
-+static const char * const ephy0_led_groups[] = {
-+      "gpio20",
-+};
-+
-+static const char * const ephy1_led_groups[] = {
-+      "gpio21",
-+};
-+
-+static const char * const ephy2_led_groups[] = {
-+      "gpio22",
-+};
-+
-+static const char * const ephy3_led_groups[] = {
-+      "gpio23",
-+};
-+
-+static const char * const ext_irq0_groups[] = {
-+      "gpio24",
-+};
-+
-+static const char * const ext_irq1_groups[] = {
-+      "gpio25",
-+};
-+
-+static const char * const ext_irq2_groups[] = {
-+      "gpio26",
-+};
-+
-+static const char * const ext_irq3_groups[] = {
-+      "gpio27",
-+};
-+
-+static const char * const wifi_groups[] = {
-+      "gpio32",
-+      "gpio33",
-+      "gpio34",
-+      "gpio35",
-+      "gpio36",
-+      "gpio37",
-+      "gpio38",
-+      "gpio39",
-+      "gpio40",
-+      "gpio41",
-+      "gpio42",
-+      "gpio43",
-+      "gpio44",
-+      "gpio45",
-+      "gpio46",
-+      "gpio47",
-+};
-+
-+static const char * const nand_groups[] = {
-+      "nand_grp",
-+};
-+
-+#define BCM6362_LED_FUN(n)                            \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+              .reg = BCM6362_LEDCTRL,                 \
-+      }
-+
-+#define BCM6362_MODE_FUN(n)                           \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+              .reg = BCM6362_MODE,                    \
-+      }
-+
-+#define BCM6362_CTRL_FUN(n)                           \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+              .reg = BCM6362_CTRL,                    \
-+      }
-+
-+#define BCM6362_BASEMODE_FUN(n, mask)                 \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+              .reg = BCM6362_BASEMODE,                \
-+              .basemode_mask = (mask),                \
-+      }
-+
-+static const struct bcm6362_function bcm6362_funcs[] = {
-+      BCM6362_LED_FUN(led),
-+      BCM6362_MODE_FUN(usb_device_led),
-+      BCM6362_MODE_FUN(sys_irq),
-+      BCM6362_MODE_FUN(serial_led_clk),
-+      BCM6362_MODE_FUN(serial_led_data),
-+      BCM6362_MODE_FUN(robosw_led_data),
-+      BCM6362_MODE_FUN(robosw_led_clk),
-+      BCM6362_MODE_FUN(robosw_led0),
-+      BCM6362_MODE_FUN(robosw_led1),
-+      BCM6362_MODE_FUN(inet_led),
-+      BCM6362_MODE_FUN(spi_cs2),
-+      BCM6362_MODE_FUN(spi_cs3),
-+      BCM6362_MODE_FUN(ntr_pulse),
-+      BCM6362_MODE_FUN(uart1_scts),
-+      BCM6362_MODE_FUN(uart1_srts),
-+      BCM6362_MODE_FUN(uart1_sdin),
-+      BCM6362_MODE_FUN(uart1_sdout),
-+      BCM6362_MODE_FUN(adsl_spi_miso),
-+      BCM6362_MODE_FUN(adsl_spi_mosi),
-+      BCM6362_MODE_FUN(adsl_spi_clk),
-+      BCM6362_MODE_FUN(adsl_spi_cs),
-+      BCM6362_MODE_FUN(ephy0_led),
-+      BCM6362_MODE_FUN(ephy1_led),
-+      BCM6362_MODE_FUN(ephy2_led),
-+      BCM6362_MODE_FUN(ephy3_led),
-+      BCM6362_MODE_FUN(ext_irq0),
-+      BCM6362_MODE_FUN(ext_irq1),
-+      BCM6362_MODE_FUN(ext_irq2),
-+      BCM6362_MODE_FUN(ext_irq3),
-+      BCM6362_CTRL_FUN(wifi),
-+      BCM6362_BASEMODE_FUN(nand, BASEMODE_NAND),
-+};
-+
-+static int bcm6362_pinctrl_get_group_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6362_groups);
-+}
-+
-+static const char *bcm6362_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
-+                                                unsigned group)
-+{
-+      return bcm6362_groups[group].name;
-+}
-+
-+static int bcm6362_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
-+                                        unsigned group, const unsigned **pins,
-+                                        unsigned *num_pins)
-+{
-+      *pins = bcm6362_groups[group].pins;
-+      *num_pins = bcm6362_groups[group].num_pins;
-+
-+      return 0;
-+}
-+
-+static int bcm6362_pinctrl_get_func_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6362_funcs);
-+}
-+
-+static const char *bcm6362_pinctrl_get_func_name(struct pinctrl_dev *pctldev,
-+                                               unsigned selector)
-+{
-+      return bcm6362_funcs[selector].name;
-+}
-+
-+static int bcm6362_pinctrl_get_groups(struct pinctrl_dev *pctldev,
-+                                    unsigned selector,
-+                                    const char * const **groups,
-+                                    unsigned * const num_groups)
-+{
-+      *groups = bcm6362_funcs[selector].groups;
-+      *num_groups = bcm6362_funcs[selector].num_groups;
-+
-+      return 0;
-+}
-+
-+static void bcm6362_rmw_mux(struct bcm6362_pinctrl *pctl, void __iomem *reg,
-+                          u32 mask, u32 val)
-+{
-+      unsigned long flags;
-+      u32 tmp;
-+
-+      spin_lock_irqsave(&pctl->lock, flags);
-+      tmp = __raw_readl(reg);
-+      tmp &= ~mask;
-+      tmp |= val & mask;
-+      __raw_writel(tmp, reg);
-+
-+      spin_unlock_irqrestore(&pctl->lock, flags);
-+}
-+
-+static void bcm6362_set_gpio(struct bcm6362_pinctrl *pctl, unsigned pin)
-+{
-+      const struct pinctrl_pin_desc *desc = &bcm6362_pins[pin];
-+      u32 mask = BIT(pin % 32);
-+
-+      if (desc->drv_data)
-+              bcm6362_rmw_mux(pctl, pctl->basemode, (u32)desc->drv_data, 0);
-+
-+      if (pin < 32) {
-+              /* base mode 0 => gpio 1 => mux function */
-+              bcm6362_rmw_mux(pctl, pctl->mode, mask, 0);
-+
-+              /* pins 0-23 might be muxed to led */
-+              if (pin < 24)
-+                      bcm6362_rmw_mux(pctl, pctl->led, mask, 0);
-+      } else {
-+              /* ctrl reg 0 => wifi function 1 => gpio */
-+              bcm6362_rmw_mux(pctl, pctl->ctrl, mask, mask);
-+      }
-+}
-+
-+static int bcm6362_pinctrl_set_mux(struct pinctrl_dev *pctldev,
-+                                 unsigned selector, unsigned group)
-+{
-+      struct bcm6362_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+      const struct bcm6362_pingroup *grp = &bcm6362_groups[group];
-+      const struct bcm6362_function *f = &bcm6362_funcs[selector];
-+      unsigned i;
-+      void __iomem *reg;
-+      u32 val, mask;
-+
-+      for (i = 0; i < grp->num_pins; i++)
-+              bcm6362_set_gpio(pctl, grp->pins[i]);
-+
-+      switch (f->reg) {
-+      case BCM6362_LEDCTRL:
-+              reg = pctl->led;
-+              mask = BIT(grp->pins[0]);
-+              val = BIT(grp->pins[0]);
-+              break;
-+      case BCM6362_MODE:
-+              reg = pctl->ctrl;
-+              mask = BIT(grp->pins[0]);
-+              val = BIT(grp->pins[0]);
-+              break;
-+      case BCM6362_CTRL:
-+              reg = pctl->ctrl;
-+              mask = BIT(grp->pins[0]);
-+              val = 0;
-+              break;
-+      case BCM6362_BASEMODE:
-+              reg = pctl->basemode;
-+              mask = f->basemode_mask;
-+              val = f->basemode_mask;
-+              break;
-+      default:
-+              WARN_ON(1);
-+              return -EINVAL;
-+      }
-+
-+      bcm6362_rmw_mux(pctl, reg, mask, val);
-+
-+      return 0;
-+}
-+
-+static int bcm6362_gpio_request_enable(struct pinctrl_dev *pctldev,
-+                                     struct pinctrl_gpio_range *range,
-+                                     unsigned offset)
-+{
-+      struct bcm6362_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+
-+      /* disable all functions using this pin */
-+      bcm6362_set_gpio(pctl, offset);
-+
-+      return 0;
-+}
-+
-+static struct pinctrl_ops bcm6362_pctl_ops = {
-+      .get_groups_count       = bcm6362_pinctrl_get_group_count,
-+      .get_group_name         = bcm6362_pinctrl_get_group_name,
-+      .get_group_pins         = bcm6362_pinctrl_get_group_pins,
-+#ifdef CONFIG_OF
-+      .dt_node_to_map         = pinconf_generic_dt_node_to_map_pin,
-+      .dt_free_map            = pinctrl_utils_free_map,
-+#endif
-+};
-+
-+static struct pinmux_ops bcm6362_pmx_ops = {
-+      .get_functions_count    = bcm6362_pinctrl_get_func_count,
-+      .get_function_name      = bcm6362_pinctrl_get_func_name,
-+      .get_function_groups    = bcm6362_pinctrl_get_groups,
-+      .set_mux                = bcm6362_pinctrl_set_mux,
-+      .gpio_request_enable    = bcm6362_gpio_request_enable,
-+      .strict                 = true,
-+};
-+
-+static int bcm6362_pinctrl_probe(struct platform_device *pdev)
-+{
-+      struct bcm6362_pinctrl *pctl;
-+      struct resource *res;
-+      void __iomem *led, *mode, *ctrl, *basemode;
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "led");
-+      led = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(led))
-+              return PTR_ERR(led);
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mode");
-+      mode = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(mode))
-+              return PTR_ERR(mode);
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl");
-+      ctrl = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(ctrl))
-+              return PTR_ERR(ctrl);
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "basemode");
-+      basemode = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(basemode))
-+              return PTR_ERR(basemode);
-+
-+      pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
-+      if (!pctl)
-+              return -ENOMEM;
-+
-+      spin_lock_init(&pctl->lock);
-+
-+      pctl->led = led;
-+      pctl->mode = mode;
-+      pctl->ctrl = ctrl;
-+      pctl->basemode = basemode;
-+
-+      pctl->desc.name = dev_name(&pdev->dev);
-+      pctl->desc.owner = THIS_MODULE;
-+      pctl->desc.pctlops = &bcm6362_pctl_ops;
-+      pctl->desc.pmxops = &bcm6362_pmx_ops;
-+
-+      pctl->desc.npins = ARRAY_SIZE(bcm6362_pins);
-+      pctl->desc.pins = bcm6362_pins;
-+
-+      platform_set_drvdata(pdev, pctl);
-+
-+      pctl->pctldev = bcm63xx_pinctrl_register(pdev, &pctl->desc, pctl,
-+                                               pctl->gpio, BCM6362_NGPIO);
-+      if (IS_ERR(pctl->pctldev))
-+              return PTR_ERR(pctl->pctldev);
-+
-+      return 0;
-+}
-+
-+static const struct of_device_id bcm6362_pinctrl_match[] = {
-+      { .compatible = "brcm,bcm6362-pinctrl", },
-+      { },
-+};
-+
-+static struct platform_driver bcm6362_pinctrl_driver = {
-+      .probe = bcm6362_pinctrl_probe,
-+      .driver = {
-+              .name = "bcm6362-pinctrl",
-+              .of_match_table = bcm6362_pinctrl_match,
-+      },
-+};
-+
-+builtin_platform_driver(bcm6362_pinctrl_driver);
diff --git a/target/linux/brcm63xx/patches-4.9/139-Documentation-add-BCM6368-pincontroller-binding-docu.patch b/target/linux/brcm63xx/patches-4.9/139-Documentation-add-BCM6368-pincontroller-binding-docu.patch
deleted file mode 100644 (file)
index e0a698f..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-From 30594cf9bfff176a9e4b14c50dcd8b9d0cc3edec Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 27 Jul 2016 11:36:51 +0200
-Subject: [PATCH 10/16] Documentation: add BCM6368 pincontroller binding
- documentation
-
-Add binding documentation for the pincontrol core found in BCM6368 SoCs.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- .../bindings/pinctrl/brcm,bcm6368-pinctrl.txt      | 67 ++++++++++++++++++++++
- 1 file changed, 67 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm6368-pinctrl.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm6368-pinctrl.txt
-@@ -0,0 +1,67 @@
-+* Broadcom BCM6368 pin controller
-+
-+Required properties:
-+- compatible: Must be "brcm,bcm6368-pinctrl".
-+- reg: Register specifiers of dirout, dat, mode registers.
-+- reg-names: Must be "dirout", "dat", "mode".
-+- brcm,gpiobasemode: Phandle to the gpio basemode register.
-+- gpio-controller: Identifies this node as a GPIO controller.
-+- #gpio-cells: Must be <2>.
-+
-+Example:
-+
-+pinctrl: pin-controller@10000080 {
-+      compatible = "brcm,bcm6368-pinctrl";
-+      reg = <0x10000080 0x08>,
-+            <0x10000088 0x08>,
-+            <0x10000098 0x04>;
-+      reg-names = "dirout", "dat", "mode";
-+      brcm,gpiobasemode = <&gpiobasemode>;
-+
-+      gpio-controller;
-+      #gpio-cells = <2>;
-+};
-+
-+gpiobasemode: syscon@100000b8 {
-+      compatible = "brcm,bcm6368-gpiobasemode", "syscon";
-+      reg = <0x100000b8 4>;
-+      native-endian;
-+};
-+
-+Available pins/groups and functions:
-+
-+name          pins    functions
-+-----------------------------------------------------------
-+gpio0         0       analog_afe0
-+gpio1         1       analog_afe1
-+gpio2         2       sys_irq
-+gpio3         3       serial_led_data
-+gpio4         4       serial_led_clk
-+gpio5         5       inet_led
-+gpio6         6       ephy0_led
-+gpio7         7       ephy1_led
-+gpio8         8       ephy2_led
-+gpio9         9       ephy3_led
-+gpio10                10      robosw_led_data
-+gpio11                11      robosw_led_clk
-+gpio12                12      robosw_led0
-+gpio13                13      robosw_led1
-+gpio14                14      usb_device_led
-+gpio15                15      -
-+gpio16                16      pci_req1
-+gpio17                17      pci_gnt1
-+gpio18                18      pci_intb
-+gpio19                19      pci_req0
-+gpio20                20      pci_gnt0
-+gpio21                21      -
-+gpio22                22      pcmcia_cd1
-+gpio23                23      pcmcia_cd2
-+gpio24                24      pcmcia_vs1
-+gpio25                25      pcmcia_vs2
-+gpio26                26      ebi_cs2
-+gpio27                27      ebi_cs3
-+gpio28                28      spi_cs2
-+gpio29                29      spi_cs3
-+gpio30                30      spi_cs4
-+gpio31                31      spi_cs5
-+uart1_grp     30-33   uart1
diff --git a/target/linux/brcm63xx/patches-4.9/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch b/target/linux/brcm63xx/patches-4.9/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch
deleted file mode 100644 (file)
index 6a9b9e0..0000000
+++ /dev/null
@@ -1,620 +0,0 @@
-From 90be3cb4f1a45b8be4a4ec264cd66c2f8e893fcb Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Fri, 24 Jun 2016 22:18:25 +0200
-Subject: [PATCH 11/16] pinctrl: add a pincontrol driver for BCM6368
-
-Add a pincontrol driver for BCM6368. BCM6368 allows muxing the first 32
-GPIOs onto alternative functions. Not all are documented.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/pinctrl/bcm63xx/Kconfig           |  15 +
- drivers/pinctrl/bcm63xx/Makefile          |   1 +
- drivers/pinctrl/bcm63xx/pinctrl-bcm6368.c | 573 ++++++++++++++++++++++++++++++
- 3 files changed, 589 insertions(+)
- create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm6368.c
-
---- a/drivers/pinctrl/bcm63xx/Kconfig
-+++ b/drivers/pinctrl/bcm63xx/Kconfig
-@@ -30,3 +30,18 @@ config PINCTRL_BCM6362
-       select PINCONF
-       select PINCTRL_BCM63XX
-       select GENERIC_PINCONF
-+
-+config PINCTRL_BCM6368
-+      bool "BCM6368 pincontrol driver" if COMPILE_TEST
-+      select PINMUX
-+      select PINCONF
-+      select PINCTRL_BCM63XX
-+      select GENERIC_PINCONF
-+      select MFD_SYSCON
-+
-+config PINCTRL_BCM63268
-+      bool "BCM63268 pincontrol driver" if COMPILE_TEST
-+      select PINMUX
-+      select PINCONF
-+      select PINCTRL_BCM63XX
-+      select GENERIC_PINCONF
---- a/drivers/pinctrl/bcm63xx/Makefile
-+++ b/drivers/pinctrl/bcm63xx/Makefile
-@@ -3,3 +3,4 @@ obj-$(CONFIG_PINCTRL_BCM6328)  += pinctrl
- obj-$(CONFIG_PINCTRL_BCM6348) += pinctrl-bcm6348.o
- obj-$(CONFIG_PINCTRL_BCM6358) += pinctrl-bcm6358.o
- obj-$(CONFIG_PINCTRL_BCM6362) += pinctrl-bcm6362.o
-+obj-$(CONFIG_PINCTRL_BCM6368) += pinctrl-bcm6368.o
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm6368.c
-@@ -0,0 +1,573 @@
-+/*
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
-+ */
-+
-+#include <linux/bitops.h>
-+#include <linux/kernel.h>
-+#include <linux/gpio.h>
-+#include <linux/mfd/syscon.h>
-+#include <linux/of.h>
-+#include <linux/of_address.h>
-+#include <linux/of_gpio.h>
-+#include <linux/pinctrl/pinconf.h>
-+#include <linux/pinctrl/pinconf-generic.h>
-+#include <linux/pinctrl/pinmux.h>
-+#include <linux/pinctrl/machine.h>
-+#include <linux/platform_device.h>
-+#include <linux/regmap.h>
-+#include <linux/slab.h>
-+#include <linux/spinlock.h>
-+
-+#include "../core.h"
-+#include "../pinctrl-utils.h"
-+
-+#include "pinctrl-bcm63xx.h"
-+
-+#define BCM6368_NGPIO 38
-+
-+#define BCM6368_BASEMODE_MASK 0x7
-+#define BCM6368_BASEMODE_GPIO 0x0
-+#define BCM6368_BASEMODE_UART1        0x1
-+
-+struct bcm6368_pingroup {
-+      const char *name;
-+      const unsigned * const pins;
-+      const unsigned num_pins;
-+};
-+
-+struct bcm6368_function {
-+      const char *name;
-+      const char * const *groups;
-+      const unsigned num_groups;
-+
-+      unsigned dir_out:16;
-+      unsigned basemode:3;
-+};
-+
-+struct bcm6368_pinctrl {
-+      struct pinctrl_dev *pctldev;
-+      struct pinctrl_desc desc;
-+
-+      void __iomem *mode;
-+      struct regmap_field *overlay;
-+
-+      /* register access lock */
-+      spinlock_t lock;
-+
-+      struct gpio_chip gpio[2];
-+};
-+
-+#define BCM6368_BASEMODE_PIN(a, b)            \
-+      {                                       \
-+              .number = a,                    \
-+              .name = b,                      \
-+              .drv_data = (void *)true        \
-+      }
-+
-+static const struct pinctrl_pin_desc bcm6368_pins[] = {
-+      PINCTRL_PIN(0, "gpio0"),
-+      PINCTRL_PIN(1, "gpio1"),
-+      PINCTRL_PIN(2, "gpio2"),
-+      PINCTRL_PIN(3, "gpio3"),
-+      PINCTRL_PIN(4, "gpio4"),
-+      PINCTRL_PIN(5, "gpio5"),
-+      PINCTRL_PIN(6, "gpio6"),
-+      PINCTRL_PIN(7, "gpio7"),
-+      PINCTRL_PIN(8, "gpio8"),
-+      PINCTRL_PIN(9, "gpio9"),
-+      PINCTRL_PIN(10, "gpio10"),
-+      PINCTRL_PIN(11, "gpio11"),
-+      PINCTRL_PIN(12, "gpio12"),
-+      PINCTRL_PIN(13, "gpio13"),
-+      PINCTRL_PIN(14, "gpio14"),
-+      PINCTRL_PIN(15, "gpio15"),
-+      PINCTRL_PIN(16, "gpio16"),
-+      PINCTRL_PIN(17, "gpio17"),
-+      PINCTRL_PIN(18, "gpio18"),
-+      PINCTRL_PIN(19, "gpio19"),
-+      PINCTRL_PIN(20, "gpio20"),
-+      PINCTRL_PIN(21, "gpio21"),
-+      PINCTRL_PIN(22, "gpio22"),
-+      PINCTRL_PIN(23, "gpio23"),
-+      PINCTRL_PIN(24, "gpio24"),
-+      PINCTRL_PIN(25, "gpio25"),
-+      PINCTRL_PIN(26, "gpio26"),
-+      PINCTRL_PIN(27, "gpio27"),
-+      PINCTRL_PIN(28, "gpio28"),
-+      PINCTRL_PIN(29, "gpio29"),
-+      BCM6368_BASEMODE_PIN(30, "gpio30"),
-+      BCM6368_BASEMODE_PIN(31, "gpio31"),
-+      BCM6368_BASEMODE_PIN(32, "gpio32"),
-+      BCM6368_BASEMODE_PIN(33, "gpio33"),
-+      PINCTRL_PIN(34, "gpio34"),
-+      PINCTRL_PIN(35, "gpio35"),
-+      PINCTRL_PIN(36, "gpio36"),
-+      PINCTRL_PIN(37, "gpio37"),
-+};
-+
-+static unsigned gpio0_pins[] = { 0 };
-+static unsigned gpio1_pins[] = { 1 };
-+static unsigned gpio2_pins[] = { 2 };
-+static unsigned gpio3_pins[] = { 3 };
-+static unsigned gpio4_pins[] = { 4 };
-+static unsigned gpio5_pins[] = { 5 };
-+static unsigned gpio6_pins[] = { 6 };
-+static unsigned gpio7_pins[] = { 7 };
-+static unsigned gpio8_pins[] = { 8 };
-+static unsigned gpio9_pins[] = { 9 };
-+static unsigned gpio10_pins[] = { 10 };
-+static unsigned gpio11_pins[] = { 11 };
-+static unsigned gpio12_pins[] = { 12 };
-+static unsigned gpio13_pins[] = { 13 };
-+static unsigned gpio14_pins[] = { 14 };
-+static unsigned gpio15_pins[] = { 15 };
-+static unsigned gpio16_pins[] = { 16 };
-+static unsigned gpio17_pins[] = { 17 };
-+static unsigned gpio18_pins[] = { 18 };
-+static unsigned gpio19_pins[] = { 19 };
-+static unsigned gpio20_pins[] = { 20 };
-+static unsigned gpio21_pins[] = { 21 };
-+static unsigned gpio22_pins[] = { 22 };
-+static unsigned gpio23_pins[] = { 23 };
-+static unsigned gpio24_pins[] = { 24 };
-+static unsigned gpio25_pins[] = { 25 };
-+static unsigned gpio26_pins[] = { 26 };
-+static unsigned gpio27_pins[] = { 27 };
-+static unsigned gpio28_pins[] = { 28 };
-+static unsigned gpio29_pins[] = { 29 };
-+static unsigned gpio30_pins[] = { 30 };
-+static unsigned gpio31_pins[] = { 31 };
-+static unsigned uart1_grp_pins[] = { 30, 31, 32, 33 };
-+
-+#define BCM6368_GROUP(n)                              \
-+      {                                               \
-+              .name = #n,                             \
-+              .pins = n##_pins,                       \
-+              .num_pins = ARRAY_SIZE(n##_pins),       \
-+      }
-+
-+static struct bcm6368_pingroup bcm6368_groups[] = {
-+      BCM6368_GROUP(gpio0),
-+      BCM6368_GROUP(gpio1),
-+      BCM6368_GROUP(gpio2),
-+      BCM6368_GROUP(gpio3),
-+      BCM6368_GROUP(gpio4),
-+      BCM6368_GROUP(gpio5),
-+      BCM6368_GROUP(gpio6),
-+      BCM6368_GROUP(gpio7),
-+      BCM6368_GROUP(gpio8),
-+      BCM6368_GROUP(gpio9),
-+      BCM6368_GROUP(gpio10),
-+      BCM6368_GROUP(gpio11),
-+      BCM6368_GROUP(gpio12),
-+      BCM6368_GROUP(gpio13),
-+      BCM6368_GROUP(gpio14),
-+      BCM6368_GROUP(gpio15),
-+      BCM6368_GROUP(gpio16),
-+      BCM6368_GROUP(gpio17),
-+      BCM6368_GROUP(gpio18),
-+      BCM6368_GROUP(gpio19),
-+      BCM6368_GROUP(gpio20),
-+      BCM6368_GROUP(gpio21),
-+      BCM6368_GROUP(gpio22),
-+      BCM6368_GROUP(gpio23),
-+      BCM6368_GROUP(gpio24),
-+      BCM6368_GROUP(gpio25),
-+      BCM6368_GROUP(gpio26),
-+      BCM6368_GROUP(gpio27),
-+      BCM6368_GROUP(gpio28),
-+      BCM6368_GROUP(gpio29),
-+      BCM6368_GROUP(gpio30),
-+      BCM6368_GROUP(gpio31),
-+      BCM6368_GROUP(uart1_grp),
-+};
-+
-+static const char * const analog_afe_0_groups[] = {
-+      "gpio0",
-+};
-+
-+static const char * const analog_afe_1_groups[] = {
-+      "gpio1",
-+};
-+
-+static const char * const sys_irq_groups[] = {
-+      "gpio2",
-+};
-+
-+static const char * const serial_led_data_groups[] = {
-+      "gpio3",
-+};
-+
-+static const char * const serial_led_clk_groups[] = {
-+      "gpio4",
-+};
-+
-+static const char * const inet_led_groups[] = {
-+      "gpio5",
-+};
-+
-+static const char * const ephy0_led_groups[] = {
-+      "gpio6",
-+};
-+
-+static const char * const ephy1_led_groups[] = {
-+      "gpio7",
-+};
-+
-+static const char * const ephy2_led_groups[] = {
-+      "gpio8",
-+};
-+
-+static const char * const ephy3_led_groups[] = {
-+      "gpio9",
-+};
-+
-+static const char * const robosw_led_data_groups[] = {
-+      "gpio10",
-+};
-+
-+static const char * const robosw_led_clk_groups[] = {
-+      "gpio11",
-+};
-+
-+static const char * const robosw_led0_groups[] = {
-+      "gpio12",
-+};
-+
-+static const char * const robosw_led1_groups[] = {
-+      "gpio13",
-+};
-+
-+static const char * const usb_device_led_groups[] = {
-+      "gpio14",
-+};
-+
-+static const char * const pci_req1_groups[] = {
-+      "gpio16",
-+};
-+
-+static const char * const pci_gnt1_groups[] = {
-+      "gpio17",
-+};
-+
-+static const char * const pci_intb_groups[] = {
-+      "gpio18",
-+};
-+
-+static const char * const pci_req0_groups[] = {
-+      "gpio19",
-+};
-+
-+static const char * const pci_gnt0_groups[] = {
-+      "gpio20",
-+};
-+
-+static const char * const pcmcia_cd1_groups[] = {
-+      "gpio22",
-+};
-+
-+static const char * const pcmcia_cd2_groups[] = {
-+      "gpio23",
-+};
-+
-+static const char * const pcmcia_vs1_groups[] = {
-+      "gpio24",
-+};
-+
-+static const char * const pcmcia_vs2_groups[] = {
-+      "gpio25",
-+};
-+
-+static const char * const ebi_cs2_groups[] = {
-+      "gpio26",
-+};
-+
-+static const char * const ebi_cs3_groups[] = {
-+      "gpio27",
-+};
-+
-+static const char * const spi_cs2_groups[] = {
-+      "gpio28",
-+};
-+
-+static const char * const spi_cs3_groups[] = {
-+      "gpio29",
-+};
-+
-+static const char * const spi_cs4_groups[] = {
-+      "gpio30",
-+};
-+
-+static const char * const spi_cs5_groups[] = {
-+      "gpio31",
-+};
-+
-+static const char * const uart1_groups[] = {
-+      "uart1_grp",
-+};
-+
-+#define BCM6368_FUN(n, out)                           \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+              .dir_out = out,                         \
-+      }
-+
-+#define BCM6368_BASEMODE_FUN(n, val, out)             \
-+      {                                               \
-+              .name = #n,                             \
-+              .groups = n##_groups,                   \
-+              .num_groups = ARRAY_SIZE(n##_groups),   \
-+              .basemode = BCM6368_BASEMODE_##val,     \
-+              .dir_out = out,                         \
-+      }
-+
-+static const struct bcm6368_function bcm6368_funcs[] = {
-+      BCM6368_FUN(analog_afe_0, 1),
-+      BCM6368_FUN(analog_afe_1, 1),
-+      BCM6368_FUN(sys_irq, 1),
-+      BCM6368_FUN(serial_led_data, 1),
-+      BCM6368_FUN(serial_led_clk, 1),
-+      BCM6368_FUN(inet_led, 1),
-+      BCM6368_FUN(ephy0_led, 1),
-+      BCM6368_FUN(ephy1_led, 1),
-+      BCM6368_FUN(ephy2_led, 1),
-+      BCM6368_FUN(ephy3_led, 1),
-+      BCM6368_FUN(robosw_led_data, 1),
-+      BCM6368_FUN(robosw_led_clk, 1),
-+      BCM6368_FUN(robosw_led0, 1),
-+      BCM6368_FUN(robosw_led1, 1),
-+      BCM6368_FUN(usb_device_led, 1),
-+      BCM6368_FUN(pci_req1, 0),
-+      BCM6368_FUN(pci_gnt1, 0),
-+      BCM6368_FUN(pci_intb, 0),
-+      BCM6368_FUN(pci_req0, 0),
-+      BCM6368_FUN(pci_gnt0, 0),
-+      BCM6368_FUN(pcmcia_cd1, 0),
-+      BCM6368_FUN(pcmcia_cd2, 0),
-+      BCM6368_FUN(pcmcia_vs1, 0),
-+      BCM6368_FUN(pcmcia_vs2, 0),
-+      BCM6368_FUN(ebi_cs2, 1),
-+      BCM6368_FUN(ebi_cs3, 1),
-+      BCM6368_FUN(spi_cs2, 1),
-+      BCM6368_FUN(spi_cs3, 1),
-+      BCM6368_FUN(spi_cs4, 1),
-+      BCM6368_FUN(spi_cs5, 1),
-+      BCM6368_BASEMODE_FUN(uart1, UART1, 0x6),
-+};
-+
-+static int bcm6368_pinctrl_get_group_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6368_groups);
-+}
-+
-+static const char *bcm6368_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
-+                                                unsigned group)
-+{
-+      return bcm6368_groups[group].name;
-+}
-+
-+static int bcm6368_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
-+                                        unsigned group, const unsigned **pins,
-+                                        unsigned *num_pins)
-+{
-+      *pins = bcm6368_groups[group].pins;
-+      *num_pins = bcm6368_groups[group].num_pins;
-+
-+      return 0;
-+}
-+
-+static int bcm6368_pinctrl_get_func_count(struct pinctrl_dev *pctldev)
-+{
-+      return ARRAY_SIZE(bcm6368_funcs);
-+}
-+
-+static const char *bcm6368_pinctrl_get_func_name(struct pinctrl_dev *pctldev,
-+                                               unsigned selector)
-+{
-+      return bcm6368_funcs[selector].name;
-+}
-+
-+static int bcm6368_pinctrl_get_groups(struct pinctrl_dev *pctldev,
-+                                    unsigned selector,
-+                                    const char * const **groups,
-+                                    unsigned * const num_groups)
-+{
-+      *groups = bcm6368_funcs[selector].groups;
-+      *num_groups = bcm6368_funcs[selector].num_groups;
-+
-+      return 0;
-+}
-+
-+static void bcm6368_rmw_mux(struct bcm6368_pinctrl *pctl, void __iomem *reg,
-+                          u32 mask, u32 val)
-+{
-+      u32 tmp;
-+
-+      tmp = __raw_readl(reg);
-+      tmp &= ~mask;
-+      tmp |= (val & mask);
-+      __raw_writel(tmp, reg);
-+}
-+
-+static int bcm6368_pinctrl_set_mux(struct pinctrl_dev *pctldev,
-+                                 unsigned selector, unsigned group)
-+{
-+      struct bcm6368_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+      const struct bcm6368_pingroup *grp = &bcm6368_groups[group];
-+      const struct bcm6368_function *fun = &bcm6368_funcs[selector];
-+      unsigned long flags;
-+      int i, pin;
-+
-+      spin_lock_irqsave(&pctl->lock, flags);
-+      if (fun->basemode) {
-+              u32 mask = 0;
-+
-+              for (i = 0; i < grp->num_pins; i++) {
-+                      pin = grp->pins[i];
-+                      if (pin < 32)
-+                              mask |= BIT(pin);
-+              }
-+
-+              bcm6368_rmw_mux(pctl, pctl->mode, mask, 0);
-+              regmap_field_write(pctl->overlay, fun->basemode);
-+      } else {
-+              pin = grp->pins[0];
-+
-+              if (bcm6368_pins[pin].drv_data)
-+                      regmap_field_write(pctl->overlay,
-+                                         BCM6368_BASEMODE_GPIO);
-+
-+              bcm6368_rmw_mux(pctl, pctl->mode, BIT(pin), BIT(pin));
-+      }
-+      spin_unlock_irqrestore(&pctl->lock, flags);
-+
-+      for (pin = 0; pin < grp->num_pins; pin++) {
-+              int hw_gpio = bcm6368_pins[pin].number;
-+              struct gpio_chip *gc = &pctl->gpio[hw_gpio / 32];
-+
-+              if (fun->dir_out & BIT(pin))
-+                      gc->direction_output(gc, hw_gpio % 32, 0);
-+              else
-+                      gc->direction_input(gc, hw_gpio % 32);
-+      }
-+
-+      return 0;
-+}
-+
-+static int bcm6368_gpio_request_enable(struct pinctrl_dev *pctldev,
-+                                     struct pinctrl_gpio_range *range,
-+                                     unsigned offset)
-+{
-+      struct bcm6368_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
-+      unsigned long flags;
-+
-+      if (offset >= 32 && !bcm6368_pins[offset].drv_data)
-+              return 0;
-+
-+      spin_lock_irqsave(&pctl->lock, flags);
-+      /* disable all functions using this pin */
-+      if (offset < 32)
-+              bcm6368_rmw_mux(pctl, pctl->mode, BIT(offset), 0);
-+
-+      if (bcm6368_pins[offset].drv_data)
-+              regmap_field_write(pctl->overlay, BCM6368_BASEMODE_GPIO);
-+
-+      spin_unlock_irqrestore(&pctl->lock, flags);
-+
-+      return 0;
-+}
-+
-+static struct pinctrl_ops bcm6368_pctl_ops = {
-+      .get_groups_count       = bcm6368_pinctrl_get_group_count,
-+      .get_group_name         = bcm6368_pinctrl_get_group_name,
-+      .get_group_pins         = bcm6368_pinctrl_get_group_pins,
-+#ifdef CONFIG_OF
-+      .dt_node_to_map         = pinconf_generic_dt_node_to_map_pin,
-+      .dt_free_map            = pinctrl_utils_free_map,
-+#endif
-+};
-+
-+static struct pinmux_ops bcm6368_pmx_ops = {
-+      .get_functions_count    = bcm6368_pinctrl_get_func_count,
-+      .get_function_name      = bcm6368_pinctrl_get_func_name,
-+      .get_function_groups    = bcm6368_pinctrl_get_groups,
-+      .set_mux                = bcm6368_pinctrl_set_mux,
-+      .gpio_request_enable    = bcm6368_gpio_request_enable,
-+      .strict                 = true,
-+};
-+
-+static int bcm6368_pinctrl_probe(struct platform_device *pdev)
-+{
-+      struct bcm6368_pinctrl *pctl;
-+      struct resource *res;
-+      void __iomem *mode;
-+      struct regmap *basemode;
-+      struct reg_field overlay = REG_FIELD(0, 0, 3);
-+
-+      if (pdev->dev.of_node)
-+              basemode = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
-+                                                         "brcm,gpiobasemode");
-+      else
-+              basemode = syscon_regmap_lookup_by_pdevname("syscon.b00000b8");
-+
-+      if (IS_ERR(basemode))
-+              return PTR_ERR(basemode);
-+
-+      res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mode");
-+      mode = devm_ioremap_resource(&pdev->dev, res);
-+      if (IS_ERR(mode))
-+              return PTR_ERR(mode);
-+
-+      pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
-+      if (!pctl)
-+              return -ENOMEM;
-+
-+      pctl->overlay = devm_regmap_field_alloc(&pdev->dev, basemode, overlay);
-+      if (IS_ERR(pctl->overlay))
-+              return PTR_ERR(pctl->overlay);
-+
-+      spin_lock_init(&pctl->lock);
-+
-+      pctl->mode = mode;
-+
-+      /* disable all muxes by default */
-+      __raw_writel(0, pctl->mode);
-+
-+      pctl->desc.name = dev_name(&pdev->dev);
-+      pctl->desc.owner = THIS_MODULE;
-+      pctl->desc.pctlops = &bcm6368_pctl_ops;
-+      pctl->desc.pmxops = &bcm6368_pmx_ops;
-+
-+      pctl->desc.npins = ARRAY_SIZE(bcm6368_pins);
-+      pctl->desc.pins = bcm6368_pins;
-+
-+      platform_set_drvdata(pdev, pctl);
-+
-+      pctl->pctldev = bcm63xx_pinctrl_register(pdev, &pctl->desc, pctl,
-+                                               pctl->gpio, BCM6368_NGPIO);
-+      if (IS_ERR(pctl->pctldev))
-+              return PTR_ERR(pctl->pctldev);
-+
-+      return 0;
-+}
-+
-+static const struct of_device_id bcm6368_pinctrl_match[] = {
-+      { .compatible = "brcm,bcm6368-pinctrl", },
-+      { },
-+};
-+
-+static struct platform_driver bcm6368_pinctrl_driver = {
-+      .probe = bcm6368_pinctrl_probe,
-+      .driver = {
-+              .name = "bcm6368-pinctrl",
-+              .of_match_table = bcm6368_pinctrl_match,
-+      },
-+};
-+
-+builtin_platform_driver(bcm6368_pinctrl_driver);
diff --git a/target/linux/brcm63xx/patches-4.9/141-Documentation-add-BCM63268-pincontroller-binding-doc.patch b/target/linux/brcm63xx/patches-4.9/141-Documentation-add-BCM63268-pincontroller-binding-doc.patch
deleted file mode 100644 (file)
index ffe842f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-From 28cc80e4ada5d73d5305fd268297825cd8d01936 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Wed, 27 Jul 2016 11:37:08 +0200
-Subject: [PATCH 12/16] Documentation: add BCM63268 pincontroller binding
- documentation
-
-Add binding documentation for the pincontrol core found in the BCM63268
-family SoCs.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- .../bindings/pinctrl/brcm,bcm63268-pinctrl.txt     | 88 ++++++++++++++++++++++
- 1 file changed, 88 insertions(+)
- create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm63268-pinctrl.txt
-
---- /dev/null
-+++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm63268-pinctrl.txt
-@@ -0,0 +1,88 @@
-+* Broadcom BCM63268 pin controller
-+
-+Required properties:
-+- compatible: Must be "brcm,bcm6362-pinctrl".
-+- reg: Register specifiers of dirout, dat, led, mode, ctrl, basemode registers.
-+- reg-names: Must be "dirout", "dat", "led", "mode", "ctrl", "basemode".
-+- gpio-controller: Identifies this node as a GPIO controller.
-+- #gpio-cells: Must be <2>.
-+
-+Example:
-+
-+pinctrl: pin-controller@100000c0 {
-+      compatible = "brcm,bcm63268-pinctrl";
-+      reg = <0x100000c0 0x8>,
-+            <0x100000c8 0x8>,
-+            <0x100000d0 0x4>,
-+            <0x100000d8 0x4>,
-+            <0x100000dc 0x4>,
-+            <0x100000f8 0x4>;
-+      reg-names = "dirout", "dat", "led", "mode",
-+                  "ctrl", "basemode";
-+
-+      gpio-controller;
-+      #gpio-cells = <2>;
-+};
-+
-+Available pins/groups and functions:
-+
-+name          pins            functions
-+-----------------------------------------------------------
-+gpio0         0               led, serial_led_clk
-+gpio1         1               led, serial_led_data
-+gpio2         2               led,
-+gpio3         3               led,
-+gpio4         4               led,
-+gpio5         5               led,
-+gpio6         6               led,
-+gpio7         7               led,
-+gpio8         8               led, hsspi_cs6
-+gpio9         9               led, hsspi_cs7
-+gpio10                10              led, uart1_scts
-+gpio11                11              led, uart1_srts
-+gpio12                12              led, uart1_sdin
-+gpio13                13              led, uart1_sdout
-+gpio14                14              led, ntr_pulse_in
-+gpio15                15              led, dsl_ntr_pulse_out
-+gpio16                16              led, hsspi_cs4
-+gpio17                17              led, hsspi_cs5
-+gpio18                18              led, adsl_spi_miso
-+gpio19                19              led, adsl_spi_mosi
-+gpio20                20              led,
-+gpio21                21              led,
-+gpio22                22              led, vreg_clk
-+gpio23                23              led, pcie_clkreq_b
-+gpio24                24              uart1_scts
-+gpio25                25              uart1_srts
-+gpio26                26              uart1_sdin
-+gpio27                27              uart1_sdout
-+gpio28                28              ntr_pulse_in
-+gpio29                29              dsl_ntr_pulse_out
-+gpio30                30              switch_led_clk
-+gpio31                31              switch_led_data
-+gpio32                32              wifi
-+gpio33                33              wifi
-+gpio34                34              wifi
-+gpio35                35              wifi
-+gpio36                36              wifi
-+gpio37                37              wifi
-+gpio38                38              wifi
-+gpio39                39              wifi
-+gpio40                40              wifi
-+gpio41                41              wifi
-+gpio42                42              wifi
-+gpio43                43              wifi
-+gpio44                44              wifi
-+gpio45                45              wifi
-+gpio46                46              wifi
-+gpio47                47              wifi
-+gpio48                48              wifi
-+gpio49                49              wifi
-+gpio50                50              wifi
-+gpio51                51              wifi
-+nand_grp      2-7,24-31       nand
-+dect_pd_grp   8-9             dect_pd
-+vdsl_phy0_grp 10-11           vdsl_phy0
-+vdsl_phy1_grp 12-13           vdsl_phy1
-+vdsl_phy2_grp 24-25           vdsl_phy2
-+vdsl_phy3_grp 26-27           vdsl_phy3
diff --git a/target/linux/brcm63xx/patches-4.9/142-pinctrl-add-a-pincontrol-driver-for-BCM63268.patch b/target/linux/brcm63xx/patches-4.9/142-pinctrl-add-a-pincontrol-driver-for-BCM63268.patch
deleted file mode 100644 (file)
index 089d14e..0000000
+++ /dev/null
@@ -1,736 +0,0 @@
-From 8665d3ea63649cc155286c75f83f694a930580e5 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski@gmail.com>
-Date: Fri, 24 Jun 2016 22:19:12 +0200
-Subject: [PATCH 13/16] pinctrl: add a pincontrol driver for BCM63268
-
-Add a pincontrol driver for BCM63268. BCM63268 allows muxing GPIOs
-to different functions. Depending on the mux, these are either single
-pin configurations or whole pin groups.
-
-Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
----
- drivers/pinctrl/bcm63xx/Makefile           |   1 +
- drivers/pinctrl/bcm63xx/pinctrl-bcm63268.c | 710 +++++++++++++++++++++++++++++
- 2 files changed, 711 insertions(+)
- create mode 100644 drivers/pinctrl/bcm63xx/pinctrl-bcm63268.c
-
---- a/drivers/pinctrl/bcm63xx/Makefile
-+++ b/drivers/pinctrl/bcm63xx/Makefile
-@@ -4,3 +4,4 @@ obj-$(CONFIG_PINCTRL_BCM6348)  += pinctrl
- obj-$(CONFIG_PINCTRL_BCM6358) += pinctrl-bcm6358.o
- obj-$(CONFIG_PINCTRL_BCM6362) += pinctrl-bcm6362.o
- obj-$(CONFIG_PINCTRL_BCM6368) += pinctrl-bcm6368.o
-+obj-$(CONFIG_PINCTRL_BCM63268)        += pinctrl-bcm63268.o
---- /dev/null
-+++ b/drivers/pinctrl/bcm63xx/pinctrl-bcm63268.c
-@@ -0,0 +1,710 @@
-+/*
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License.  See the file "COPYING" in the main directory of this archive
-+ * for more details.
-+ *
-+ * Copyright (C) 2016 Jonas Gorski <jonas.gorski@gmail.com>
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/spinlock.h>
-+#include <linux/bitops.h>
-+#include <linux/gpio.h>
-+#include <linux/of.h>
-+#include <linux/of_gpio.h>
-+#include <linux/slab.h>
-+#include <linux/platform_device.h>
-+
-+#include <linux/pinctrl/pinconf.h>
-+#include <linux/pinctrl/pinconf-generic.h>
-+#include <linux/pinctrl/pinmux.h>
-+#include <linux/pinctrl/machine.h>
-+
-+#include "../core.h"
-+#include "../pinctrl-utils.h"
-+
-+#include "pinctrl-bcm63xx.h"
-+
-+#define BCM63268_NGPIO                        52
-+
-+/* GPIO_BASEMODE register */
-+#define BASEMODE_NAND                 BIT(2) /* GPIOs 2-7, 24-31 */
-+#define BASEMODE_GPIO35                       BIT(4) /* GPIO 35 */
-+#define BASEMODE_DECTPD                       BIT(5) /* GPIOs 8/9 */
-+#define BASEMODE_VDSL_PHY_0           BIT(6) /* GPIOs 10/11 */
-+#define BASEMODE_VDSL_PHY_1           BIT(7) /* GPIOs 12/13 */
-+#define BASEMODE_VDSL_PHY_2           BIT(8) /* GPIOs 24/25 */
-+#define BASEMODE_VDSL_PHY_3           BIT(9) /* GPIOs 26/27 */
-+
-+enum bcm63268_pinctrl_reg {
-+      BCM63268_LEDCTRL,
-+      BCM63268_MODE,
-+      BCM63268_CTRL,
-+      BCM63268_BASEMODE,
-+};
-+
-+struct bcm63268_pingroup {
-+      const char *name;
-+      const unsigned * const pins;
-+      const unsigned num_pins;
-+};
-+
-+struct bcm63268_function {
-+      const char *name;
-+      const char * const *groups;
-+      const unsigned num_groups;
-+
-+      enum bcm63268_pinctrl_reg reg;
-+      u32 mask;
-+};
-+
-+struct bcm63268_pinctrl {
-+      struct pinctrl_dev *pctldev;
-+      struct pinctrl_desc desc;
-+
-+      void __iomem *led;
-+      void __iomem *mode;
-+      void __iomem *ctrl;
-+      void __iomem *basemode;
-+
-+      /* register access lock */
-+      spinlock_t lock;
-+
-+      struct gpio_chip gpio[2];
-+};
-+
-+#define BCM63268_PIN(a, b, basemode)                  \
-+      {                                               \
-+              .number = a,                            \
-+              .name = b,                              \
-+              .drv_data = (void *)(basemode)          \
-+      }
-+
-+static const struct pinctrl_pin_desc bcm63268_pins[] = {
-+      PINCTRL_PIN(0, "gpio0"),
-+      PINCTRL_PIN(1, "gpio1"),
-+      BCM63268_PIN(2, "gpio2", BASEMODE_NAND),
-+      BCM63268_PIN(3, "gpio3", BASEMODE_NAND),
-+      BCM63268_PIN(4, "gpio4", BASEMODE_NAND),
-+      BCM63268_PIN(5, "gpio5", BASEMODE_NAND),
-+      BCM63268_PIN(6, "gpio6", BASEMODE_NAND),
-+      BCM63268_PIN(7, "gpio7", BASEMODE_NAND),
-+      BCM63268_PIN(8, "gpio8", BASEMODE_DECTPD),
-+      BCM63268_PIN(9, "gpio9", BASEMODE_DECTPD),
-+      BCM63268_PIN(10, "gpio10", BASEMODE_VDSL_PHY_0),
-+      BCM63268_PIN(11, "gpio11", BASEMODE_VDSL_PHY_0),
-+      BCM63268_PIN(12, "gpio12", BASEMODE_VDSL_PHY_1),
-+      BCM63268_PIN(13, "gpio13", BASEMODE_VDSL_PHY_1),
-+      PINCTRL_PIN(14, "gpio14"),
-+      PINCTRL_PIN(15, "gpio15"),
-+      PINCTRL_PIN(16, "gpio16"),
-+      PINCTRL_PIN(17, "gpio17"),
-+      PINCTRL_PIN(18, "gpio18"),
-+      PINCTRL_PIN(19, "gpio19"),
-+      PINCTRL_PIN(20, "gpio20"),
-+      PINCTRL_PIN(21, "gpio21"),
-+      PINCTRL_PIN(22, "gpio22"),
-+      PINCTRL_PIN(23, "gpio23"),
-+      BCM63268_PIN(24, "gpio24", BASEMODE_NAND | BASEMODE_VDSL_PHY_2),
-+      BCM63268_PIN(25, "gpio25", BASEMODE_NAND | BASEMODE_VDSL_PHY_2),
-+      BCM63268_PIN(26, "gpio26", BASEMODE_NAND | BASEMODE_VDSL_PHY_3),
-+      BCM63268_PIN(27, "gpio27", BASEMODE_NAND | BASEMODE_VDSL_PHY_3),
-+      BCM63268_PIN(28, "gpio28", BASEMODE_NAND),
-+      BCM63268_PIN(29, "gpio29", BASEMODE_NAND),
-+      BCM63268_PIN(30, "gpio30", BASEMODE_NAND),
-+      BCM63268_PIN(31, "gpio31", BASEMODE_NAND),
-+      PINCTRL_PIN(32, "gpio32"),
-+      PINCTRL_PIN(33, "gpio33"),
-+      PINCTRL_PIN(34, "gpio34"),
-+      PINCTRL_PIN(35, "gpio35"),
-+      PINCTRL_PIN(36, "gpio36"),
-+      PINCTRL_PIN(37, "gpio37"),
-+      PINCTRL_PIN(38, "gpio38"),
-+      PINCTRL_PIN(39, "gpio39"),
-+      PINCTRL_PIN(40, "gpio40"),
-+      PINCTRL_PIN(41, "gpio41"),
-+      PINCTRL_PIN(42, "gpio42"),
-+      PINCTRL_PIN(43, "gpio43"),
-+      PINCTRL_PIN(44, "gpio44"),
-+      PINCTRL_PIN(45, "gpio45"),
-+      PINCTRL_PIN(46, "gpio46"),
-+      PINCTRL_PIN(47, "gpio47"),
-+      PINCTRL_PIN(48, "gpio48"),
-+      PINCTRL_PIN(49, "gpio49"),
-+      PINCTRL_PIN(50, "gpio50"),
-+      PINCTRL_PIN(51, "gpio51"),
-+};
-+
-+static unsigned gpio0_pins[] = { 0 };
-+static unsigned gpio1_pins[] = { 1 };
-+static unsigned gpio2_pins[] = { 2 };
-+static unsigned gpio3_pins[] = { 3 };
-+static unsigned gpio4_pins[] = { 4 };
-+static unsigned gpio5_pins[] = { 5 };
-+static unsigned gpio6_pins[] = { 6 };
-+static unsigned gpio7_pins[] = { 7 };
-+static unsigned gpio8_pins[] = { 8 };
-+static unsigned gpio9_pins[] = { 9 };
-+static unsigned gpio10_pins[] = { 10 };
-+static unsigned gpio11_pins[] = { 11 };
-+static unsigned gpio12_pins[] = { 12 };
-+static unsigned gpio13_pins[] = { 13 };
-+static unsigned gpio14_pins[] = { 14 };
-+static unsigned gpio15_pins[] = { 15 };
-+static unsigned gpio16_pins[] = { 16 };
-+static unsigned gpio17_pins[] = { 17 };
-+static unsigned gpio18_pins[] = { 18 };
-+static unsigned gpio19_pins[] = { 19 };
-+static unsigned gpio20_pins[] = { 20 };
-+static unsigned gpio21_pins[] = { 21 };
-+static unsigned gpio22_pins[] = { 22 };
-+static unsigned gpio23_pins[] = { 23 };
-+static unsigned gpio24_pins[] = { 24 };
-+static unsigned gpio25_pins[] = { 25 };
-+static unsigned gpio26_pins[] = { 26 };
-+static unsigned gpio27_pins[] = { 27 };
-+static unsigned gpio28_pins[] = { 28 };
-+static unsigned gpio29_pins[] = { 29 };
-+static unsigned gpio30_pins[] = { 30 };
-+static unsigned gpio31_pins[] = { 31 };
-+static unsigned gpio32_pins[] = { 32 };
-+static unsigned gpio33_pins[] = { 33 };
-+static unsigned gpio34_pins[] = { 34 };
-+static unsigned gpio35_pins[] = { 35 };
-+static unsigned gpio36_pins[] = { 36 };
-+static unsigned gpio37_pins[] = { 37 };
-+static unsigned gpio38_pins[] = { 38 };
-+static unsigned gpio39_pins[] = { 39 };
-+static unsigned gpio40_pins[] = { 40 };
-+static unsigned gpio41_pins[] = { 41 };
-+static unsigned gpio42_pins[] = { 42 };
-+static unsigned gpio43_pins[] = { 43 };
-+static unsigned gpio44_pins[] = { 44 };
-+static unsigned gpio45_pins[] = { 45 };
-+static unsigned gpio46_pins[] = { 46 };
-+static unsigned gpio47_pins[] = { 47 };
-+static unsigned gpio48_pins[] = { 48 };
-+static unsigned gpio49_pins[] = { 49 };
-+static unsigned gpio50_pins[] = { 50 };
-+static unsigned gpio51_pins[] = { 51 };
-+
-+static unsigned nand_grp_pins[] = {
-+      2, 3, 4, 5, 6, 7, 24,
-+      25, 26, 27, 28, 29, 30, 31,
-+};
-+
-+static unsigned dectpd_grp_pins[] = { 8, 9 };
-+static unsigned vdsl_phy0_grp_pins[] = { 10, 11 };
-+static unsigned vdsl_phy1_grp_pins[] = { 12, 13 };
-+static unsigned vdsl_phy2_grp_pins[] = { 24, 25 };
-+static unsigned vdsl_phy3_grp_pins[] = { 26, 27 };
-+
-+#define BCM63268_GROUP(n)                                     \
-+      {                                                       \
-+              .name = #n,                                     \
-+              .pins = n##_pins,                               \
-+              .num_pins = ARRAY_SIZE(n##_pins),               \
-+      }
-+
-+static struct bcm63268_pingroup bcm63268_groups[] = {
-+      BCM63268_GROUP(gpio0),
-+      BCM63268_GROUP(gpio1),
-+      BCM63268_GROUP(gpio2),
-+      BCM63268_GROUP(gpio3),
-+      BCM63268_GROUP(gpio4),
-+      BCM63268_GROUP(gpio5),
-+      BCM63268_GROUP(gpio6),
-+      BCM63268_GROUP(gpio7),
-+      BCM63268_GROUP(gpio8),
-+      BCM63268_GROUP(gpio9),
-+      BCM63268_GROUP(gpio10),
-+      BCM63268_GROUP(gpio11),
-+      BCM63268_GROUP(gpio12),
-+      BCM63268_GROUP(gpio13),
-+      BCM63268_GROUP(gpio14),
-+      BCM63268_GROUP(gpio15),
-+      BCM63268_GROUP(gpio16),
-+      BCM63268_GROUP(gpio17),
-+      BCM63268_GROUP(gpio18),
-+      BCM63268_GROUP(gpio19),
-+      BCM63268_GROUP(gpio20),
-+      BCM63268_GROUP(gpio21),
-+      BCM63268_GROUP(gpio22),
-+      BCM63268_GROUP(gpio23),
-+      BCM63268_GROUP(gpio24),
-+      BCM63268_GROUP(gpio25),
-+      BCM63268_GROUP(gpio26),
-+      BCM63268_GROUP(gpio27),
-+      BCM63268_GROUP(gpio28),
-+      BCM63268_GROUP(gpio29),
-+      BCM63268_GROUP(gpio30),
-+      BCM63268_GROUP(gpio31),
-+      BCM63268_GROUP(gpio32),
-+      BCM63268_GROUP(gpio33),
-+      BCM63268_GROUP(gpio34),
-+      BCM63268_GROUP(gpio35),
-+      BCM63268_GROUP(gpio36),
-+      BCM63268_GROUP(gpio37),
-+      BCM63268_GROUP(gpio38),
-+      BCM63268_GROUP(gpio39),
-+      BCM63268_GROUP(gpio40),
-+      BCM63268_GROUP(gpio41),
-+      BCM63268_GROUP(gpio42),
-+      BCM63268_GROUP(gpio43),
-+      BCM63268_GROUP(gpio44),
-+      BCM63268_GROUP(gpio45),
-+      BCM63268_GROUP(gpio46),
-+      BCM63268_GROUP(gpio47),
-+      BCM63268_GROUP(gpio48),
-+      BCM63268_GROUP(gpio49),
-+      BCM63268_GROUP(gpio50),
-+      BCM63268_GROUP(gpio51),
-+
-+      /* multi pin groups */
-+      BCM63268_GROUP(nand_grp),
-+      BCM63268_GROUP(dectpd_grp),
-+      BCM63268_GROUP(vdsl_phy0_grp),
-+      BCM63268_GROUP(vdsl_phy1_grp),
-+      BCM63268_GROUP(vdsl_phy2_grp),
-+      BCM63268_GROUP(vdsl_phy3_grp),
-+};
-+
-+static const char * const led_groups[] = {
-+      "gpio0",
-+      "gpio1",
-+      "gpio2",
-+      "gpio3",
-+      "gpio4",
-+      "gpio5",
-+      "gpio6",
-+      "gpio7",
-+      "gpio8",
-+      "gpio9",
-+      "gpio10",
-+      "gpio11",
-+      "gpio12",
-+      "gpio13",
-+      "gpio14",
-+      "gpio15",
-+      "gpio16",
-+      "gpio17",
-+      "gpio18",
-+      "gpio19",
-+      "gpio20",
-+      "gpio21",
-+      "gpio22",
-+      "gpio23",
-+};
-+
-+static const char * const serial_led_clk_groups[] = {
-+      "gpio0",
-+};
-+
-+static const char * const serial_led_data_groups[] = {
-+      "gpio1",
-+};
-+
-+static const char * const hsspi_cs4_groups[] = {
-+      "gpio16",
-+};
-+
-+static const char * const hsspi_cs5_groups[] = {
-+      "gpio17",
-+};
-+
-+static const char * const hsspi_cs6_groups[] = {
-+      "gpio8",
-+};
-+
-+static const char * const hsspi_cs7_groups[] = {
-+      "gpio9",
-+};
-+
-+static const char * const uart1_scts_groups[] = {
-+      "gpio10",
-+      "gpio24",
-+};
-+
-+static const char * const uart1_srts_groups[] = {
-+      "gpio11",
-+      "gpio25",
-+};
-+
-+static const char * const uart1_sdin_groups[] = {
-+      "gpio12",
-+      "gpio26",
-+};
-+
-+static const char *