From 03e969ff384443079b40b171b05b2b232aacf631 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 25 Dec 2017 10:45:33 +0800 Subject: [PATCH] update kernel 4.4/4.9 to the lastest version --- README | Bin 4570 -> 4564 bytes include/kernel-version.mk | 8 +- package/libs/libiconv-full/Makefile | 2 +- .../patches-4.9/300-add-ac49x-platform.patch | 2 +- .../432-spi-rb4xx-spi-driver.patch | 2 +- .../433-spi-rb4xx-cpld-driver.patch | 2 +- .../patches-4.9/435-spi-vsc7385_driver.patch | 2 +- ...U-port-fixes-for-devices-not-using-p.patch | 4 +- .../950-0031-Add-dwc_otg-driver.patch | 2 +- ...o_user-and-__copy_from_user-performa.patch | 2 +- .../brcm63xx/base-files/etc/board.d/01_leds | 3 + .../base-files/etc/board.d/02_network | 1 + target/linux/brcm63xx/base-files/etc/diag.sh | 3 + .../linux/brcm63xx/base-files/lib/brcm63xx.sh | 3 + target/linux/brcm63xx/config-4.4 | 1 + target/linux/brcm63xx/dts/a226g.dts | 5 + target/linux/brcm63xx/dts/a226m-fwb.dts | 5 + target/linux/brcm63xx/dts/a226m.dts | 5 + target/linux/brcm63xx/dts/a4001n.dts | 5 + target/linux/brcm63xx/dts/a4001n1.dts | 5 + target/linux/brcm63xx/dts/ad1018-nor.dts | 141 ++ target/linux/brcm63xx/dts/agpf-s0.dts | 5 + target/linux/brcm63xx/dts/ar-5315u.dts | 5 + target/linux/brcm63xx/dts/ar-5381u.dts | 5 + target/linux/brcm63xx/dts/ar-5387un.dts | 5 + target/linux/brcm63xx/dts/ar1004g.dts | 5 + target/linux/brcm63xx/dts/av4202n.dts | 5 + target/linux/brcm63xx/dts/bcm3368.dtsi | 28 + target/linux/brcm63xx/dts/bcm6318.dtsi | 14 + target/linux/brcm63xx/dts/bcm63268.dtsi | 28 + target/linux/brcm63xx/dts/bcm6328.dtsi | 28 + target/linux/brcm63xx/dts/bcm6338.dtsi | 14 + target/linux/brcm63xx/dts/bcm6345.dtsi | 14 + target/linux/brcm63xx/dts/bcm6348.dtsi | 14 + target/linux/brcm63xx/dts/bcm6358.dtsi | 28 + target/linux/brcm63xx/dts/bcm6362.dtsi | 28 + target/linux/brcm63xx/dts/bcm6368.dtsi | 28 + target/linux/brcm63xx/dts/bcm96318ref.dts | 5 + .../linux/brcm63xx/dts/bcm96318ref_p300.dts | 5 + .../linux/brcm63xx/dts/bcm963268bu_p300.dts | 5 + target/linux/brcm63xx/dts/bcm963269bhr.dts | 5 + target/linux/brcm63xx/dts/bcm963281TAN.dts | 5 + target/linux/brcm63xx/dts/bcm96328avng.dts | 5 + target/linux/brcm63xx/dts/bcm96338GW.dts | 5 + target/linux/brcm63xx/dts/bcm96338W.dts | 5 + target/linux/brcm63xx/dts/bcm96345GW2.dts | 5 + target/linux/brcm63xx/dts/bcm96348GW-10.dts | 5 + target/linux/brcm63xx/dts/bcm96348GW-11.dts | 5 + target/linux/brcm63xx/dts/bcm96348GW.dts | 5 + target/linux/brcm63xx/dts/bcm96348R.dts | 5 + target/linux/brcm63xx/dts/bcm96358VW.dts | 5 + target/linux/brcm63xx/dts/bcm96358VW2.dts | 5 + target/linux/brcm63xx/dts/bcm96368MVNgr.dts | 5 + target/linux/brcm63xx/dts/bcm96368MVWG.dts | 5 + target/linux/brcm63xx/dts/cpva502plus.dts | 5 + target/linux/brcm63xx/dts/cpva642.dts | 5 + target/linux/brcm63xx/dts/ct-5365.dts | 5 + target/linux/brcm63xx/dts/ct-6373.dts | 5 + target/linux/brcm63xx/dts/ct536plus.dts | 5 + target/linux/brcm63xx/dts/cvg834g.dts | 9 + target/linux/brcm63xx/dts/dg834g_v4.dts | 5 + target/linux/brcm63xx/dts/dg834gtpn.dts | 5 + target/linux/brcm63xx/dts/dgnd3700v1.dts | 5 + target/linux/brcm63xx/dts/dsl-2640b-b.dts | 5 + target/linux/brcm63xx/dts/dsl-2640u.dts | 5 + target/linux/brcm63xx/dts/dsl-2650u.dts | 5 + target/linux/brcm63xx/dts/dsl-274xb-c.dts | 5 + target/linux/brcm63xx/dts/dsl-274xb-f.dts | 5 + target/linux/brcm63xx/dts/dsl-275xb-d.dts | 5 + target/linux/brcm63xx/dts/dv-201amr.dts | 5 + target/linux/brcm63xx/dts/dva-g3810bn_tl.dts | 5 + target/linux/brcm63xx/dts/evg2000.dts | 5 + target/linux/brcm63xx/dts/f5d7633.dts | 5 + target/linux/brcm63xx/dts/fast2404.dts | 5 + target/linux/brcm63xx/dts/fast2504n.dts | 5 + target/linux/brcm63xx/dts/fast2604.dts | 5 + target/linux/brcm63xx/dts/fast2704n.dts | 5 + target/linux/brcm63xx/dts/fast2704v2.dts | 5 + target/linux/brcm63xx/dts/gw6000.dts | 5 + target/linux/brcm63xx/dts/gw6200.dts | 5 + target/linux/brcm63xx/dts/hg520v.dts | 5 + target/linux/brcm63xx/dts/hg553.dts | 5 + target/linux/brcm63xx/dts/hg556a-a.dts | 5 + target/linux/brcm63xx/dts/hg556a-b.dts | 5 + target/linux/brcm63xx/dts/hg556a-c.dts | 5 + target/linux/brcm63xx/dts/hg622.dts | 5 + target/linux/brcm63xx/dts/hg655b.dts | 5 + target/linux/brcm63xx/dts/homehub2a.dts | 5 + target/linux/brcm63xx/dts/livebox-blue-5g.dts | 5 + target/linux/brcm63xx/dts/magic.dts | 5 + target/linux/brcm63xx/dts/nb4-fxc-r1.dts | 5 + target/linux/brcm63xx/dts/nb4-ser-r0.dts | 5 + target/linux/brcm63xx/dts/nb6-ser-r0.dts | 5 + target/linux/brcm63xx/dts/p870hw-51a-v2.dts | 5 + target/linux/brcm63xx/dts/r1000h.dts | 9 + target/linux/brcm63xx/dts/r5010unv2.dts | 5 + target/linux/brcm63xx/dts/rg100a.dts | 5 + target/linux/brcm63xx/dts/rta1025w.dts | 5 + target/linux/brcm63xx/dts/rta1320.dts | 5 + target/linux/brcm63xx/dts/rta770bw.dts | 5 + target/linux/brcm63xx/dts/rta770w.dts | 5 + target/linux/brcm63xx/dts/spw303v.dts | 5 + target/linux/brcm63xx/dts/spw500v.dts | 5 + target/linux/brcm63xx/dts/td-w8900gb.dts | 5 + target/linux/brcm63xx/dts/usr9108.dts | 5 + target/linux/brcm63xx/dts/v2110.dts | 5 + target/linux/brcm63xx/dts/v2500v-bb.dts | 5 + target/linux/brcm63xx/dts/vg50.dts | 5 + target/linux/brcm63xx/dts/vh4032n.dts | 5 + target/linux/brcm63xx/dts/vr-3025u.dts | 5 + target/linux/brcm63xx/dts/vr-3025un.dts | 5 + target/linux/brcm63xx/dts/vr-3026e.dts | 5 + target/linux/brcm63xx/dts/wap-5813n.dts | 5 + target/linux/brcm63xx/image/bcm63xx.mk | 12 + ...-mtd-nand-spi-nor-assign-MTD-of_node.patch | 2 +- ...cm63xx_uart-use-correct-alias-naming.patch | 37 + ...07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch | 192 ++ ...-reset-after-releasing-PHYs-from-res.patch | 43 + ...us-handle-only-single-PHY-reset-GPIO.patch | 120 + ...mdio_bus-use-devm_gpiod_get_optional.patch | 39 + ...PS-BCM63XX-add-clkdev-lookup-support.patch | 210 ++ ...vide-periph-clock-as-refclk-for-uart.patch | 84 + ...-use-refclk-for-the-expected-clock-n.patch | 26 + ...rt-allow-naming-clock-in-device-tree.patch | 55 + ...e-the-HSSPI-PLL-HZ-into-its-own-cloc.patch | 62 + ...vide-enet-clocks-as-enet-to-the-ethe.patch | 60 + ...M63XX-split-out-swpkt_sar-usb-clocks.patch | 105 + ...-08-bcm63xx_enet-correct-clock-usage.patch | 101 + ...not-write-to-random-DMA-channel-on-B.patch | 29 + ...63xx_enet-do-not-rely-on-probe-order.patch | 41 + ...-managed-functions-for-clock-ioremap.patch | 150 ++ ...net-drop-unneeded-NULL-phy_clk-check.patch | 36 + ...bcm63xx_enet-remove-unneeded-include.patch | 22 + ...63XX-add-USB-host-clock-enable-delay.patch | 2 +- ...-USB-device-clock-enable-delay-to-cl.patch | 2 +- ...XX-allow-NULL-clock-for-clk_get_rate.patch | 2 +- .../130-pinctrl-add-bcm63xx-base-code.patch | 2 +- ...-add-a-pincontrol-driver-for-BCM6368.patch | 2 +- ...IPS-BCM63XX-add-support-for-BCM63268.patch | 73 +- ...MIPS-BCM63XX-add-support-for-BCM6318.patch | 40 +- ...BCM63XX-add-PCIe-support-for-BCM6318.patch | 13 +- ...-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch | 22 +- ...-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch | 4 +- ...t-use-named-gpio-for-ephy-reset-gpio.patch | 46 - ...-register-lookup-for-ephy-reset-gpio.patch | 2 +- ...81-net-bcm63xx_enet-fully-reset-ephy.patch | 28 - ...X-add-clkdev-lookups-for-device-tree.patch | 105 + ...63XX-do-not-register-SPI-controllers.patch | 135 ++ ...91-MIPS-BCM63XX-do-not-register-uart.patch | 257 ++ ...IPS-BCM63XX-remove-leds-and-buttons.patch} | 36 +- .../403-6358-enet1-external-mii-clk.patch | 2 +- ...-move-phy_-dis-connect-into-probe-re.patch | 14 +- ...enable-rgmii-clock-on-external-ports.patch | 2 +- ...CM63XX-Register-SPI-flash-if-present.patch | 18 +- ...w-providing-fixup-data-in-board-data.patch | 12 +- ...M63XX-export-the-attached-flash-type.patch | 2 +- ...CM63XX-add-a-fixup-for-ath9k-devices.patch | 5 +- ...0-BCM63XX-add-endian-check-for-ath9k.patch | 4 +- .../421-BCM63XX-add-led-pin-for-ath9k.patch | 4 +- ...M63XX-add-a-fixup-for-rt2x00-devices.patch | 8 +- .../423-bcm63xx_enet_add_b53_support.patch | 30 +- ...4-bcm63xx_enet_no_request_mem_region.patch | 20 +- .../patches-4.4/427-boards_probe_switch.patch | 46 +- ...low_better_context_for_board_patches.patch | 20 +- .../brcm63xx/patches-4.4/500-board-D4PW.patch | 7 +- .../brcm63xx/patches-4.4/501-board-NB4.patch | 8 +- .../patches-4.4/502-board-96338W2_E7T.patch | 8 +- .../patches-4.4/503-board-CPVA642.patch | 9 +- .../504-board_dsl_274xb_rev_c.patch | 7 +- .../patches-4.4/505-board_spw500v.patch | 7 +- .../patches-4.4/506-board_gw6200_gw6000.patch | 8 +- .../patches-4.4/507-board-MAGIC.patch | 7 +- .../patches-4.4/508-board_hw553.patch | 8 +- .../patches-4.4/509-board_rta1320_16m.patch | 7 +- .../patches-4.4/510-board_spw303v.patch | 7 +- .../patches-4.4/511-board_V2500V.patch | 13 +- .../patches-4.4/512-board_BTV2110.patch | 9 +- ...BCM63XX-add-inventel-Livebox-support.patch | 5 +- .../patches-4.4/514-board_ct536_ct5621.patch | 7 +- .../patches-4.4/515-board_DWV-S0_fixes.patch | 11 +- .../patches-4.4/516-board_96348A-122.patch | 7 +- .../517-RTA1205W_16_uart_fixes.patch | 10 - .../patches-4.4/519_board_CPVA502plus.patch | 7 +- ...63xx-add-support-for-96368MVWG-board.patch | 9 +- ...3xx-add-support-for-96368MVNgr-board.patch | 7 +- ...CM63XX-add-96328avng-reference-board.patch | 6 +- ...CM63XX-add-963281TAN-reference-board.patch | 7 +- .../524-board_dsl_274xb_rev_f.patch | 7 +- .../patches-4.4/525-board_96348w3.patch | 7 +- .../patches-4.4/526-board_CT6373-1.patch | 7 +- .../527-board_dva-g3810bn-tl-1.patch | 7 +- .../brcm63xx/patches-4.4/528-board_nb6.patch | 8 +- .../patches-4.4/529-board_fast2604.patch | 7 +- .../patches-4.4/530-board_A4001N1.patch | 7 +- .../patches-4.4/531-board_AR-5387un.patch | 7 +- .../patches-4.4/532-board_AR-5381u.patch | 7 +- .../patches-4.4/533-board_rta770bw.patch | 12 +- .../patches-4.4/534-board_hw556.patch | 9 +- .../patches-4.4/535-board_rta770w.patch | 8 +- .../patches-4.4/536-board_fast2704.patch | 7 +- .../patches-4.4/537-board_fast2504n.patch | 8 +- .../patches-4.4/555-board_96318ref.patch | 7 +- .../patches-4.4/556-board_96318ref_p300.patch | 7 +- .../patches-4.4/557-board_bcm963269bhr.patch | 8 +- .../patches-4.4/558-board_AR1004G.patch | 7 +- .../patches-4.4/559-board_vw6339gu.patch | 8 +- .../patches-4.4/560-board_963268gu_p300.patch | 8 +- .../patches-4.4/561-board_WAP-5813n.patch | 7 +- .../patches-4.4/562-board_VR-3025u.patch | 7 +- .../patches-4.4/563-board_VR-3025un.patch | 7 +- .../patches-4.4/564-board_P870HW-51a_v2.patch | 7 +- .../patches-4.4/565-board_hw520.patch | 7 +- .../patches-4.4/566-board_A4001N.patch | 7 +- .../patches-4.4/567-board_dsl-2751b_e1.patch | 7 +- .../568-board_DGND3700v1_3800B.patch | 7 +- .../patches-4.4/569-board_homehub2a.patch | 7 +- .../patches-4.4/570-board_HG655b.patch | 7 +- .../patches-4.4/571-board_fast2704n.patch | 7 +- .../patches-4.4/572-board_VR-3026e.patch | 7 +- .../patches-4.4/573-board_R5010UNv2.patch | 7 +- .../patches-4.4/574-board_HG622.patch | 7 +- .../patches-4.4/575-board_EVG2000.patch | 7 +- .../patches-4.4/576-board_AV4202N.patch | 7 +- .../patches-4.4/577-board_VH4032N.patch | 7 +- .../patches-4.4/578-board_R1000H.patch | 8 +- .../patches-4.4/579-board_AR-5315u.patch | 7 +- .../patches-4.4/580-board_AD1018.patch | 92 + .../804-bcm63xx_enet_63268_rgmii_ports.patch | 2 +- .../011-kbuild-export-SUBARCH.patch | 2 +- ...90-net-generalize-napi_complete_done.patch | 6 +- target/linux/generic/config-4.14 | 5 + .../hack-4.9/202-reduce_module_size.patch | 6 +- .../hack-4.9/207-disable-modorder.patch | 4 +- .../generic/hack-4.9/220-gc_sections.patch | 6 +- .../301-mips_image_cmdline_hack.patch | 2 +- .../321-powerpc_crtsavres_prereq.patch | 2 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 4 +- .../494-mtd-ubi-add-EOF-marker-support.patch | 2 +- .../002-phy_drivers_backport.patch | 16 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 6 +- .../494-mtd-ubi-add-EOF-marker-support.patch | 2 +- .../pending-4.4/630-packet_socket_type.patch | 18 +- ...ng-with-source-address-failed-policy.patch | 8 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 +- .../generic/pending-4.4/721-phy_packets.patch | 2 +- .../pending-4.4/902-debloat_proc.patch | 8 +- .../pending-4.4/904-debloat_dma_buf.patch | 2 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- .../pending-4.9/201-extra_optimization.patch | 2 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 4 +- .../494-mtd-ubi-add-EOF-marker-support.patch | 2 +- .../pending-4.9/630-packet_socket_type.patch | 18 +- target/linux/ixp4xx/Makefile | 5 +- target/linux/ixp4xx/config-4.9 | 247 ++ .../patches-4.4/160-delayed_uart_io.patch | 4 +- .../207-npe_driver_multiphy_support.patch | 28 +- ...ohorent_dma_mask-for-ethernet-platfo.patch | 136 ++ ...se-parent-device-for-dma-allocations.patch | 95 + .../patches-4.9/020-gateworks_i2c_pld.patch | 424 ++++ .../patches-4.9/030-gpio_line_config.patch | 73 + .../patches-4.9/040-arm_mach_types.patch | 18 + .../090-increase_entropy_pools.patch | 17 + ...00-wg302v2_gateway7001_mac_plat_info.patch | 78 + .../patches-4.9/105-wg302v1_support.patch | 261 ++ .../110-pronghorn_series_support.patch | 393 ++++ .../111-pronghorn_swap_uarts.patch | 44 + .../patches-4.9/115-sidewinder_support.patch | 286 +++ .../116-sidewinder_fis_location.patch | 30 + .../patches-4.9/120-compex_support.patch | 199 ++ .../patches-4.9/130-wrt300nv2_support.patch | 227 ++ .../131-wrt300nv2_mac_plat_info.patch | 42 + .../patches-4.9/132-wrt300nv2_mac_fix.patch | 72 + .../150-lanready_ap1000_support.patch | 201 ++ .../151-lanready_ap1000_mac_plat_info.patch | 44 + .../patches-4.9/160-delayed_uart_io.patch | 133 ++ .../patches-4.9/162-wg302v1_mem_fixup.patch | 37 + .../170-ixdpg425_mac_plat_info.patch | 51 + .../175-avila_hss_audio_support.patch | 2093 +++++++++++++++++ .../patches-4.9/180-tw5334_support.patch | 287 +++ .../patches-4.9/185-mi424wr_support.patch | 504 ++++ .../patches-4.9/190-cambria_support.patch | 1131 +++++++++ ...01-npe_driver_print_license_location.patch | 11 + ...05-npe_driver_separate_phy_functions.patch | 127 + ...-npe_driver_add_update_link_function.patch | 100 + .../207-npe_driver_multiphy_support.patch | 153 ++ .../patches-4.9/295-latch_led_driver.patch | 201 ++ .../patches-4.9/300-avila_support.patch | 726 ++++++ .../304-ixp4xx_eth_jumboframe.patch | 6 +- .../patches-4.9/310-gtwx5717_spi_bus.patch | 57 + .../311-gtwx5717_mac_plat_info.patch | 50 + .../312-ixp4xx_pata_optimization.patch | 137 ++ .../patches-4.9/500-usr8200_support.patch | 347 +++ .../patches-4.9/520-tw2662_support.patch | 316 +++ .../patches-4.9/530-ap42x_support.patch | 282 +++ .../patches-4.9/600-skb_avoid_dmabounce.patch | 23 + .../900-ixp4xx-crypto-include-module.h.patch | 10 + .../patches-4.9/910-ixp4xx-nr_irq_lines.patch | 22 + ...dd-support-for-Lantiq-SSC-SPI-contro.patch | 2 +- .../lantiq/patches-4.9/0152-lantiq-VPE.patch | 2 +- .../804-crypto-support-layerscape.patch | 94 +- .../807-gpu-support-layerscape.patch | 16 +- .../810-iommu-support-layerscape.patch | 8 +- ...ackport-v4.7-0day-patches-from-Boris.patch | 42 +- ...mtd-nand-import-nand_hw_control_init.patch | 2 +- .../oxnas/patches-4.4/330-oxnas-pinctrl.patch | 2 +- ...25-pinctrl-ralink-add-pinctrl-driver.patch | 2 +- ...IO-ralink-add-mt7621-gpio-controller.patch | 2 +- ...SPI-ralink-add-Ralink-SoC-spi-driver.patch | 2 +- .../0043-spi-add-mt7621-support.patch | 2 +- .../patches-4.9/0050-stmmac-form-4-10.patch | 100 +- .../patches-4.9/0051-stmmac-form-4-11.patch | 22 +- .../patches-4.9/0052-stmmac-form-4-12.patch | 100 +- .../patches-4.9/0053-stmmac-form-4-13.patch | 16 +- 314 files changed, 13186 insertions(+), 888 deletions(-) create mode 100644 target/linux/brcm63xx/dts/ad1018-nor.dts create mode 100644 target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch delete mode 100644 target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch delete mode 100644 target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch create mode 100644 target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch create mode 100644 target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch rename target/linux/brcm63xx/patches-4.4/{550-MIPS-BCM63XX-remove-leds-and-buttons.patch => 392-MIPS-BCM63XX-remove-leds-and-buttons.patch} (85%) delete mode 100644 target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch create mode 100644 target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch create mode 100644 target/linux/ixp4xx/config-4.9 create mode 100644 target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch create mode 100644 target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch create mode 100644 target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch create mode 100644 target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch create mode 100644 target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch create mode 100644 target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch create mode 100644 target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch create mode 100644 target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch create mode 100644 target/linux/ixp4xx/patches-4.9/120-compex_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch create mode 100644 target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch create mode 100644 target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch create mode 100644 target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/190-cambria_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch create mode 100644 target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch create mode 100644 target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch create mode 100644 target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch create mode 100644 target/linux/ixp4xx/patches-4.9/300-avila_support.patch rename target/linux/ixp4xx/{patches-4.4 => patches-4.9}/304-ixp4xx_eth_jumboframe.patch (90%) create mode 100644 target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch create mode 100644 target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch create mode 100644 target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch create mode 100644 target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch create mode 100644 target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch diff --git a/README b/README index 67e86acf72892f6e0a204dfb965554dd29352760..ca910714b1bad99a97e513f35af2895b5de0a8f4 100644 GIT binary patch delta 20 ccmcbmd_{S~HD>l4hE#?WhSbfEnZNS_091|#yZ`_I delta 15 Xcmcbjd`o%5HRg#f0-GN&f8hlHI^zcV diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 623d20493..762c2a723 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,13 +3,13 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 -LINUX_VERSION-4.4 = .100 -LINUX_VERSION-4.9 = .67 +LINUX_VERSION-4.4 = .107 +LINUX_VERSION-4.9 = .70 LINUX_VERSION-4.14 = .6 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 -LINUX_KERNEL_HASH-4.4.100 = 9936cd99c4bd35f6bc6962c9acdd1fa2ac8999e07a9be6a94a03b5492f1bd14f -LINUX_KERNEL_HASH-4.9.67 = 7fbaa7dcc17877dfa0c96fb9a7d2f4ffed20ceeb13cbbeb18d77213c6cf75f7d +LINUX_KERNEL_HASH-4.4.107 = d25dc23c8b05d34518ede68f03668cd344f805049a16bc4f189da90533881a17 +LINUX_KERNEL_HASH-4.9.70 = baaf45f3826fa0d257a42005240cced402a12c99adf2a8d77402738304d5300a LINUX_KERNEL_HASH-4.14.6 = 0907678ba9ea146ddbdecd0a0b6363f56b896b5c61c9a15e809effb3ea346ccc ifdef KERNEL_PATCHVER diff --git a/package/libs/libiconv-full/Makefile b/package/libs/libiconv-full/Makefile index 9776711a7..ac7bfddf5 100644 --- a/package/libs/libiconv-full/Makefile +++ b/package/libs/libiconv-full/Makefile @@ -51,7 +51,7 @@ define Package/iconv TITLE+= utility endef -TARGET_CFLAGS += $(FPIC) -DUSE_DOS +TARGET_CFLAGS += $(FPIC) -DUSE_DOS -std=gnu89 CONFIGURE_ARGS += \ --enable-shared \ diff --git a/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch index c17ae69aa..67ed3e494 100644 --- a/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch +++ b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch @@ -46,7 +46,7 @@ config ATH25 bool "Atheros AR231x/AR531x SoC support" -@@ -1002,6 +1002,7 @@ config MIPS_PARAVIRT +@@ -1004,6 +1004,7 @@ config MIPS_PARAVIRT endchoice source "arch/mips/alchemy/Kconfig" diff --git a/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch b/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch index 5428d3d1c..e896d0bdf 100644 --- a/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch +++ b/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -534,6 +534,12 @@ config SPI_QUP +@@ -533,6 +533,12 @@ config SPI_QUP This driver can also be built as a module. If so, the module will be called spi_qup. diff --git a/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch b/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch index b1cd6a545..c44acab32 100644 --- a/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch +++ b/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -762,6 +762,13 @@ config SPI_TLE62X0 +@@ -761,6 +761,13 @@ config SPI_TLE62X0 sysfs interface, with each line presented as a kind of GPIO exposing both switch control and diagnostic feedback. diff --git a/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch b/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch index fe6acde70..f9f1f7a1e 100644 --- a/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch +++ b/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -769,6 +769,11 @@ config SPI_RB4XX_CPLD +@@ -768,6 +768,11 @@ config SPI_RB4XX_CPLD SPI driver for the Xilinx CPLD chip present on the MikroTik RB4xx boards. diff --git a/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch b/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch index 244a4a658..91bb4fae1 100644 --- a/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch +++ b/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/phy/b53/b53_common.c +++ b/drivers/net/phy/b53/b53_common.c -@@ -27,6 +27,7 @@ +@@ -28,6 +28,7 @@ #include #include #include @@ -21,7 +21,7 @@ Signed-off-by: Rafał Miłecki #include "b53_regs.h" #include "b53_priv.h" -@@ -1578,6 +1579,28 @@ static int b53_switch_init(struct b53_de +@@ -1579,6 +1580,28 @@ static int b53_switch_init(struct b53_de return ret; } diff --git a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch index c3862fc07..8569e4a83 100644 --- a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch +++ b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch @@ -696,7 +696,7 @@ Signed-off-by: Noralf Trønnes } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5045,7 +5045,7 @@ static void port_event(struct usb_hub *h +@@ -5054,7 +5054,7 @@ static void port_event(struct usb_hub *h if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; diff --git a/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch index a7ce64ba3..016d48dd2 100644 --- a/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch +++ b/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch @@ -65,7 +65,7 @@ Signed-off-by: Phil Elwell +__copy_from_user_std(void *to, const void __user *from, unsigned long n); + static inline unsigned long __must_check - __copy_from_user(void *to, const void __user *from, unsigned long n) + __arch_copy_from_user(void *to, const void __user *from, unsigned long n) { --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile diff --git a/target/linux/brcm63xx/base-files/etc/board.d/01_leds b/target/linux/brcm63xx/base-files/etc/board.d/01_leds index ef70cde79..d25d37e84 100755 --- a/target/linux/brcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/brcm63xx/base-files/etc/board.d/01_leds @@ -15,6 +15,9 @@ a4001n1) a4001n) ucidef_set_led_usbdev "usb" "USB" "A4001N:green:usb" "1-1" ;; +ad1018-nor) + ucidef_set_led_netdev "wlan0" "WLAN" "AD1018:green:wifi" "wlan0" + ;; ar-5315u) ucidef_set_led_usbdev "usb" "USB" "AR-5315u:green:usb" "1-1" ;; diff --git a/target/linux/brcm63xx/base-files/etc/board.d/02_network b/target/linux/brcm63xx/base-files/etc/board.d/02_network index 9addba654..06b4b6ece 100755 --- a/target/linux/brcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network @@ -98,6 +98,7 @@ vr-3026e) "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "8t@eth0" ;; +ad1018-nor|\ ar-5315u |\ vh4032n) ucidef_add_switch "switch0" \ diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh index 700c9ea85..acb179521 100644 --- a/target/linux/brcm63xx/base-files/etc/diag.sh +++ b/target/linux/brcm63xx/base-files/etc/diag.sh @@ -12,6 +12,9 @@ set_state() { a4001n) status_led="A4001N:green:power" ;; + ad1018-nor) + status_led="AD1018:green:power" + ;; ar-5315u) status_led="AR-5315u:green:power" ;; diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh index 3f46633fa..82abd737c 100755 --- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh +++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh @@ -228,6 +228,9 @@ brcm63xx_dt_detect() { "Sagem F@ST2704V2") board_name="fast2704v2" ;; + "Sercomm AD1018 (SPI flash mod)") + board_name="ad1018-nor" + ;; "SFR Neuf Box 4"*) board_name="neufbox4" ;; diff --git a/target/linux/brcm63xx/config-4.4 b/target/linux/brcm63xx/config-4.4 index f74459be3..755590f53 100644 --- a/target/linux/brcm63xx/config-4.4 +++ b/target/linux/brcm63xx/config-4.4 @@ -47,6 +47,7 @@ CONFIG_BOARD_BCM963XX=y CONFIG_BOARD_LIVEBOX=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y +CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y CONFIG_CPU_BIG_ENDIAN=y CONFIG_CPU_BMIPS=y diff --git a/target/linux/brcm63xx/dts/a226g.dts b/target/linux/brcm63xx/dts/a226g.dts index f7a0b72b7..921e46c79 100644 --- a/target/linux/brcm63xx/dts/a226g.dts +++ b/target/linux/brcm63xx/dts/a226g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -111,3 +112,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a226m-fwb.dts b/target/linux/brcm63xx/dts/a226m-fwb.dts index 43a82bbe1..c21d06ec5 100644 --- a/target/linux/brcm63xx/dts/a226m-fwb.dts +++ b/target/linux/brcm63xx/dts/a226m-fwb.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -111,3 +112,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a226m.dts b/target/linux/brcm63xx/dts/a226m.dts index 269c4edea..7c8bdabf7 100644 --- a/target/linux/brcm63xx/dts/a226m.dts +++ b/target/linux/brcm63xx/dts/a226m.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -111,3 +112,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a4001n.dts b/target/linux/brcm63xx/dts/a4001n.dts index d29b834a3..db835434d 100644 --- a/target/linux/brcm63xx/dts/a4001n.dts +++ b/target/linux/brcm63xx/dts/a4001n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -90,3 +91,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a4001n1.dts b/target/linux/brcm63xx/dts/a4001n1.dts index 325489730..ad1590d7a 100644 --- a/target/linux/brcm63xx/dts/a4001n1.dts +++ b/target/linux/brcm63xx/dts/a4001n1.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -118,3 +119,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ad1018-nor.dts b/target/linux/brcm63xx/dts/ad1018-nor.dts new file mode 100644 index 000000000..7a630a185 --- /dev/null +++ b/target/linux/brcm63xx/dts/ad1018-nor.dts @@ -0,0 +1,141 @@ +/dts-v1/; + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Sercomm AD1018 (SPI flash mod)"; + compatible = "sercomm,ad1018-nor", "brcm,bcm6328"; + + chosen { + bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + debounce-interval = <60>; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + }; + wifi { + label = "wifi"; + gpios = <&pinctrl 25 1>; + linux,code = ; + }; + reset { + label = "reset"; + gpios = <&pinctrl 31 1>; + linux,code = ; + }; + }; + +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio0", "gpio1"; + }; +}; + +&leds { + status = "ok"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds &pinctrl_serial_led + &pinctrl_ephy0_spd_led &pinctrl_ephy1_act_led + &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; + + brcm,serial-leds; + brcm,serial-shift-inv; + brcm,serial-dat-low; + + inet_red@0 { + reg = <0>; + active-low; + label = "AD1018:red:internet"; + }; + + inet_green@1 { + reg = <1>; + active-low; + label = "AD1018:green:internet"; + }; + + power_green@8 { + reg = <8>; + active-low; + label = "AD1018:green:power"; + default-state = "on"; + }; + + adsl_green@10 { + reg = <10>; + active-low; + label = "AD1018:green:adsl"; + }; + + adsl_red@11 { + reg = <11>; + active-low; + label = "AD1018:red:adsl"; + }; + + phone_green@12 { + reg = <12>; + active-low; + label = "AD1018:green:phone"; + }; + + wps_green@13 { + reg = <13>; + active-low; + label = "AD1018:green:wps"; + }; + + wifi_green@14 { + reg = <14>; + active-low; + label = "AD1018:green:wifi"; + }; + + usb_green@15 { + reg = <15>; + active-low; + label = "AD1018:green:usb"; + }; + + ephy0_spd@17 { + reg = <17>; + brcm,hardware-controlled; + }; +}; + +&hsspi { + status = "ok"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + linux,part-probe = "bcm63xxpart"; + }; +}; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/agpf-s0.dts b/target/linux/brcm63xx/dts/agpf-s0.dts index be1f9fb4f..6ac3801c3 100644 --- a/target/linux/brcm63xx/dts/agpf-s0.dts +++ b/target/linux/brcm63xx/dts/agpf-s0.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -115,3 +116,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar-5315u.dts b/target/linux/brcm63xx/dts/ar-5315u.dts index 63883f048..e359fe4eb 100644 --- a/target/linux/brcm63xx/dts/ar-5315u.dts +++ b/target/linux/brcm63xx/dts/ar-5315u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -104,3 +105,7 @@ pinctrl-0 = <&pinctrl_ephy0_act_led &pinctrl_ephy1_act_led &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar-5381u.dts b/target/linux/brcm63xx/dts/ar-5381u.dts index 883198c6b..9da5b7e3c 100644 --- a/target/linux/brcm63xx/dts/ar-5381u.dts +++ b/target/linux/brcm63xx/dts/ar-5381u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -77,3 +78,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar-5387un.dts b/target/linux/brcm63xx/dts/ar-5387un.dts index a0e07fb4f..4dd71459f 100644 --- a/target/linux/brcm63xx/dts/ar-5387un.dts +++ b/target/linux/brcm63xx/dts/ar-5387un.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -85,3 +86,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar1004g.dts b/target/linux/brcm63xx/dts/ar1004g.dts index eb6d9a2b2..e7265f4d4 100644 --- a/target/linux/brcm63xx/dts/ar1004g.dts +++ b/target/linux/brcm63xx/dts/ar1004g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -71,3 +72,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ext_mii &pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/av4202n.dts b/target/linux/brcm63xx/dts/av4202n.dts index 4babd3b12..ef6160788 100644 --- a/target/linux/brcm63xx/dts/av4202n.dts +++ b/target/linux/brcm63xx/dts/av4202n.dts @@ -11,6 +11,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -88,3 +89,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm3368.dtsi b/target/linux/brcm63xx/dts/bcm3368.dtsi index 29dae01d7..66cb6ab8a 100644 --- a/target/linux/brcm63xx/dts/bcm3368.dtsi +++ b/target/linux/brcm63xx/dts/bcm3368.dtsi @@ -7,6 +7,8 @@ pflash = &pflash; gpio0 = &gpio0; gpio1 = &gpio1; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; }; @@ -93,6 +95,32 @@ #gpio-cells = <2>; }; + uart0: serial@fff8c100 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfff8c100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@fff8c120 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfff8c120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fff8c800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6318.dtsi b/target/linux/brcm63xx/dts/bcm6318.dtsi index 7c4505157..a902c1bd5 100644 --- a/target/linux/brcm63xx/dts/bcm6318.dtsi +++ b/target/linux/brcm63xx/dts/bcm6318.dtsi @@ -5,6 +5,7 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; spi1 = &hsspi; }; @@ -166,6 +167,19 @@ }; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <28>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + leds: led-controller@10000200 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm63268.dtsi b/target/linux/brcm63xx/dts/bcm63268.dtsi index 94c7dd013..1b4b3e617 100644 --- a/target/linux/brcm63xx/dts/bcm63268.dtsi +++ b/target/linux/brcm63xx/dts/bcm63268.dtsi @@ -5,6 +5,8 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; spi1 = &hsspi; }; @@ -193,6 +195,32 @@ }; }; + uart0: serial@10000180 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000180 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <5>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@100001a0 { + compatible = "brcm,bcm6345-uart"; + reg = <0x100001a0 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <34>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6328.dtsi b/target/linux/brcm63xx/dts/bcm6328.dtsi index 7a79aed26..d08b6bab7 100644 --- a/target/linux/brcm63xx/dts/bcm6328.dtsi +++ b/target/linux/brcm63xx/dts/bcm6328.dtsi @@ -5,6 +5,8 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi1 = &hsspi; }; @@ -151,6 +153,32 @@ }; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <28>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@10000120 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <39>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + leds: led-controller@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6338.dtsi b/target/linux/brcm63xx/dts/bcm6338.dtsi index 1811acfed..3d1c06835 100644 --- a/target/linux/brcm63xx/dts/bcm6338.dtsi +++ b/target/linux/brcm63xx/dts/bcm6338.dtsi @@ -6,6 +6,7 @@ aliases { pflash = &pflash; gpio0 = &gpio0; + serial0 = &uart0; spi0 = &lsspi; }; @@ -79,6 +80,19 @@ ngpios = <8>; }; + uart0: serial@fffe0300 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0300 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fffe0c00 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6345.dtsi b/target/linux/brcm63xx/dts/bcm6345.dtsi index b16c132ce..7d5f79be3 100644 --- a/target/linux/brcm63xx/dts/bcm6345.dtsi +++ b/target/linux/brcm63xx/dts/bcm6345.dtsi @@ -5,6 +5,7 @@ aliases { pflash = &pflash; + serial0 = &uart0; gpio0 = &gpio0; }; @@ -67,6 +68,19 @@ interrupts = <3>, <4>, <5>, <6>; }; + uart0: serial@fffe0300 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0300 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + gpio0: gpio-controller@fffe0404 { compatible = "brcm,bcm6345-gpio"; reg = <0xfffe0404 4>, <0xfffe0408 4>; diff --git a/target/linux/brcm63xx/dts/bcm6348.dtsi b/target/linux/brcm63xx/dts/bcm6348.dtsi index b6dafeeae..f3e17be53 100644 --- a/target/linux/brcm63xx/dts/bcm6348.dtsi +++ b/target/linux/brcm63xx/dts/bcm6348.dtsi @@ -6,6 +6,7 @@ aliases { pflash = &pflash; pinctrl = &pinctrl; + serial0 = &uart0; spi0 = &lsspi; }; @@ -126,6 +127,19 @@ }; }; + uart0: serial@fffe0300 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0300 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fffe0c00 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6358.dtsi b/target/linux/brcm63xx/dts/bcm6358.dtsi index 8feb3dd61..a78cdef37 100644 --- a/target/linux/brcm63xx/dts/bcm6358.dtsi +++ b/target/linux/brcm63xx/dts/bcm6358.dtsi @@ -6,6 +6,8 @@ aliases { pflash = &pflash; pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; }; @@ -163,6 +165,32 @@ status = "disabled"; }; + uart0: serial@fffe0100 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@fffe0120 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fffe0800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6362.dtsi b/target/linux/brcm63xx/dts/bcm6362.dtsi index 076fc6a3a..2ff5c52ad 100644 --- a/target/linux/brcm63xx/dts/bcm6362.dtsi +++ b/target/linux/brcm63xx/dts/bcm6362.dtsi @@ -5,6 +5,8 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; spi1 = &hsspi; }; @@ -237,6 +239,32 @@ }; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@10000120 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <4>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6368.dtsi b/target/linux/brcm63xx/dts/bcm6368.dtsi index 3efe76c6c..b834f9ef0 100644 --- a/target/linux/brcm63xx/dts/bcm6368.dtsi +++ b/target/linux/brcm63xx/dts/bcm6368.dtsi @@ -6,6 +6,8 @@ aliases { pflash = &pflash; pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; }; @@ -270,6 +272,32 @@ status = "disabled"; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@10000120 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm96318ref.dts b/target/linux/brcm63xx/dts/bcm96318ref.dts index 5780ccba4..e48c0bf46 100644 --- a/target/linux/brcm63xx/dts/bcm96318ref.dts +++ b/target/linux/brcm63xx/dts/bcm96318ref.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -73,3 +74,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_pwron>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96318ref_p300.dts b/target/linux/brcm63xx/dts/bcm96318ref_p300.dts index 8fae7fa78..db9d5eccd 100644 --- a/target/linux/brcm63xx/dts/bcm96318ref_p300.dts +++ b/target/linux/brcm63xx/dts/bcm96318ref_p300.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_pwron>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm963268bu_p300.dts b/target/linux/brcm63xx/dts/bcm963268bu_p300.dts index a96bed761..2bccb57a9 100644 --- a/target/linux/brcm63xx/dts/bcm963268bu_p300.dts +++ b/target/linux/brcm63xx/dts/bcm963268bu_p300.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -49,3 +50,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm963269bhr.dts b/target/linux/brcm63xx/dts/bcm963269bhr.dts index 4984f8fe7..d3c709877 100644 --- a/target/linux/brcm63xx/dts/bcm963269bhr.dts +++ b/target/linux/brcm63xx/dts/bcm963269bhr.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -57,3 +58,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm963281TAN.dts b/target/linux/brcm63xx/dts/bcm963281TAN.dts index a1c5d7ad7..d0d19a355 100644 --- a/target/linux/brcm63xx/dts/bcm963281TAN.dts +++ b/target/linux/brcm63xx/dts/bcm963281TAN.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -59,3 +60,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96328avng.dts b/target/linux/brcm63xx/dts/bcm96328avng.dts index e74a60a1f..d0d67880e 100644 --- a/target/linux/brcm63xx/dts/bcm96328avng.dts +++ b/target/linux/brcm63xx/dts/bcm96328avng.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -64,3 +65,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_port1_device>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96338GW.dts b/target/linux/brcm63xx/dts/bcm96338GW.dts index 7815962cd..d6ff449d3 100644 --- a/target/linux/brcm63xx/dts/bcm96338GW.dts +++ b/target/linux/brcm63xx/dts/bcm96338GW.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96338W.dts b/target/linux/brcm63xx/dts/bcm96338W.dts index 21190706e..f91ca9a39 100644 --- a/target/linux/brcm63xx/dts/bcm96338W.dts +++ b/target/linux/brcm63xx/dts/bcm96338W.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96345GW2.dts b/target/linux/brcm63xx/dts/bcm96345GW2.dts index 521f1b38a..a7b3fad13 100644 --- a/target/linux/brcm63xx/dts/bcm96345GW2.dts +++ b/target/linux/brcm63xx/dts/bcm96345GW2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -18,3 +19,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348GW-10.dts b/target/linux/brcm63xx/dts/bcm96348GW-10.dts index d78805787..59850b5a1 100644 --- a/target/linux/brcm63xx/dts/bcm96348GW-10.dts +++ b/target/linux/brcm63xx/dts/bcm96348GW-10.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -63,3 +64,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348GW-11.dts b/target/linux/brcm63xx/dts/bcm96348GW-11.dts index 9ef82e62a..3caca0970 100644 --- a/target/linux/brcm63xx/dts/bcm96348GW-11.dts +++ b/target/linux/brcm63xx/dts/bcm96348GW-11.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -63,3 +64,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348GW.dts b/target/linux/brcm63xx/dts/bcm96348GW.dts index d7511b052..c213ac7a1 100644 --- a/target/linux/brcm63xx/dts/bcm96348GW.dts +++ b/target/linux/brcm63xx/dts/bcm96348GW.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -63,3 +64,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348R.dts b/target/linux/brcm63xx/dts/bcm96348R.dts index 3042693b0..b56869b3e 100644 --- a/target/linux/brcm63xx/dts/bcm96348R.dts +++ b/target/linux/brcm63xx/dts/bcm96348R.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -49,3 +50,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96358VW.dts b/target/linux/brcm63xx/dts/bcm96358VW.dts index c2fe5b01b..e097c0518 100644 --- a/target/linux/brcm63xx/dts/bcm96358VW.dts +++ b/target/linux/brcm63xx/dts/bcm96358VW.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96358VW2.dts b/target/linux/brcm63xx/dts/bcm96358VW2.dts index cc4a8b581..5c242c215 100644 --- a/target/linux/brcm63xx/dts/bcm96358VW2.dts +++ b/target/linux/brcm63xx/dts/bcm96358VW2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -40,3 +41,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96368MVNgr.dts b/target/linux/brcm63xx/dts/bcm96368MVNgr.dts index 1078be713..6c4ef091a 100644 --- a/target/linux/brcm63xx/dts/bcm96368MVNgr.dts +++ b/target/linux/brcm63xx/dts/bcm96368MVNgr.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -49,3 +50,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96368MVWG.dts b/target/linux/brcm63xx/dts/bcm96368MVWG.dts index 0f7c42b3c..ed1dd9016 100644 --- a/target/linux/brcm63xx/dts/bcm96368MVWG.dts +++ b/target/linux/brcm63xx/dts/bcm96368MVWG.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -49,3 +50,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/cpva502plus.dts b/target/linux/brcm63xx/dts/cpva502plus.dts index dbe7aae97..6d8455e91 100644 --- a/target/linux/brcm63xx/dts/cpva502plus.dts +++ b/target/linux/brcm63xx/dts/cpva502plus.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -67,3 +68,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/cpva642.dts b/target/linux/brcm63xx/dts/cpva642.dts index 108997df7..212bf6c32 100644 --- a/target/linux/brcm63xx/dts/cpva642.dts +++ b/target/linux/brcm63xx/dts/cpva642.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -99,3 +100,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ct-5365.dts b/target/linux/brcm63xx/dts/ct-5365.dts index f0676497d..ac3b80954 100644 --- a/target/linux/brcm63xx/dts/ct-5365.dts +++ b/target/linux/brcm63xx/dts/ct-5365.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -81,3 +82,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ct-6373.dts b/target/linux/brcm63xx/dts/ct-6373.dts index 8ddcacb4d..579b514f9 100644 --- a/target/linux/brcm63xx/dts/ct-6373.dts +++ b/target/linux/brcm63xx/dts/ct-6373.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -97,3 +98,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ct536plus.dts b/target/linux/brcm63xx/dts/ct536plus.dts index 8aa47575b..f9bc7e136 100644 --- a/target/linux/brcm63xx/dts/ct536plus.dts +++ b/target/linux/brcm63xx/dts/ct536plus.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -67,3 +68,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/cvg834g.dts b/target/linux/brcm63xx/dts/cvg834g.dts index 519f1f53a..fa14c8bbd 100644 --- a/target/linux/brcm63xx/dts/cvg834g.dts +++ b/target/linux/brcm63xx/dts/cvg834g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,11 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; + +&uart1 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dg834g_v4.dts b/target/linux/brcm63xx/dts/dg834g_v4.dts index 0af695d90..369a67c22 100644 --- a/target/linux/brcm63xx/dts/dg834g_v4.dts +++ b/target/linux/brcm63xx/dts/dg834g_v4.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dg834gtpn.dts b/target/linux/brcm63xx/dts/dg834gtpn.dts index 84ef9b2c0..794c701da 100644 --- a/target/linux/brcm63xx/dts/dg834gtpn.dts +++ b/target/linux/brcm63xx/dts/dg834gtpn.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dgnd3700v1.dts b/target/linux/brcm63xx/dts/dgnd3700v1.dts index ea917e8f3..2d23f19b7 100644 --- a/target/linux/brcm63xx/dts/dgnd3700v1.dts +++ b/target/linux/brcm63xx/dts/dgnd3700v1.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -169,3 +170,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-2640b-b.dts b/target/linux/brcm63xx/dts/dsl-2640b-b.dts index fce774d32..df7f4adc0 100644 --- a/target/linux/brcm63xx/dts/dsl-2640b-b.dts +++ b/target/linux/brcm63xx/dts/dsl-2640b-b.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-2640u.dts b/target/linux/brcm63xx/dts/dsl-2640u.dts index 3b94a4abc..8fea2acb2 100644 --- a/target/linux/brcm63xx/dts/dsl-2640u.dts +++ b/target/linux/brcm63xx/dts/dsl-2640u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -54,3 +55,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-2650u.dts b/target/linux/brcm63xx/dts/dsl-2650u.dts index 4b4515103..c9b189b8b 100644 --- a/target/linux/brcm63xx/dts/dsl-2650u.dts +++ b/target/linux/brcm63xx/dts/dsl-2650u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -56,3 +57,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-274xb-c.dts b/target/linux/brcm63xx/dts/dsl-274xb-c.dts index fb67fc985..3468dea8b 100644 --- a/target/linux/brcm63xx/dts/dsl-274xb-c.dts +++ b/target/linux/brcm63xx/dts/dsl-274xb-c.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -74,3 +75,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-274xb-f.dts b/target/linux/brcm63xx/dts/dsl-274xb-f.dts index be1d16b36..00a5a9e99 100644 --- a/target/linux/brcm63xx/dts/dsl-274xb-f.dts +++ b/target/linux/brcm63xx/dts/dsl-274xb-f.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -105,3 +106,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-275xb-d.dts b/target/linux/brcm63xx/dts/dsl-275xb-d.dts index 9ac4ea1c2..d8f8c08e1 100644 --- a/target/linux/brcm63xx/dts/dsl-275xb-d.dts +++ b/target/linux/brcm63xx/dts/dsl-275xb-d.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -119,3 +120,7 @@ pinctrl-0 = <&pinctrl_ephy0_act_led &pinctrl_ephy1_act_led &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dv-201amr.dts b/target/linux/brcm63xx/dts/dv-201amr.dts index e6955190f..42a825f92 100644 --- a/target/linux/brcm63xx/dts/dv-201amr.dts +++ b/target/linux/brcm63xx/dts/dv-201amr.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -39,3 +40,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts b/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts index 4ebb25d01..2945165ce 100644 --- a/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts +++ b/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -74,3 +75,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/evg2000.dts b/target/linux/brcm63xx/dts/evg2000.dts index 07c98f11a..10e0ddcc9 100644 --- a/target/linux/brcm63xx/dts/evg2000.dts +++ b/target/linux/brcm63xx/dts/evg2000.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -110,3 +111,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/f5d7633.dts b/target/linux/brcm63xx/dts/f5d7633.dts index 27e81a3e5..89c646b92 100644 --- a/target/linux/brcm63xx/dts/f5d7633.dts +++ b/target/linux/brcm63xx/dts/f5d7633.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2404.dts b/target/linux/brcm63xx/dts/fast2404.dts index ce52af6d4..c0a30a08e 100644 --- a/target/linux/brcm63xx/dts/fast2404.dts +++ b/target/linux/brcm63xx/dts/fast2404.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -39,3 +40,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2504n.dts b/target/linux/brcm63xx/dts/fast2504n.dts index 296bc0993..8b644fb8f 100644 --- a/target/linux/brcm63xx/dts/fast2504n.dts +++ b/target/linux/brcm63xx/dts/fast2504n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -94,3 +95,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2604.dts b/target/linux/brcm63xx/dts/fast2604.dts index 952b66811..14339408b 100644 --- a/target/linux/brcm63xx/dts/fast2604.dts +++ b/target/linux/brcm63xx/dts/fast2604.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2704n.dts b/target/linux/brcm63xx/dts/fast2704n.dts index ee343a633..217ef12d7 100644 --- a/target/linux/brcm63xx/dts/fast2704n.dts +++ b/target/linux/brcm63xx/dts/fast2704n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -119,3 +120,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2704v2.dts b/target/linux/brcm63xx/dts/fast2704v2.dts index bbd23da36..eeed6b1da 100644 --- a/target/linux/brcm63xx/dts/fast2704v2.dts +++ b/target/linux/brcm63xx/dts/fast2704v2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -103,3 +104,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/gw6000.dts b/target/linux/brcm63xx/dts/gw6000.dts index 5645ae0a8..31555b3ad 100644 --- a/target/linux/brcm63xx/dts/gw6000.dts +++ b/target/linux/brcm63xx/dts/gw6000.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -53,3 +54,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/gw6200.dts b/target/linux/brcm63xx/dts/gw6200.dts index 3e0037a86..acc100c74 100644 --- a/target/linux/brcm63xx/dts/gw6200.dts +++ b/target/linux/brcm63xx/dts/gw6200.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -74,3 +75,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg520v.dts b/target/linux/brcm63xx/dts/hg520v.dts index f0eefc0c0..bfd30693c 100644 --- a/target/linux/brcm63xx/dts/hg520v.dts +++ b/target/linux/brcm63xx/dts/hg520v.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -57,3 +58,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg553.dts b/target/linux/brcm63xx/dts/hg553.dts index a00821fb1..a459976c4 100644 --- a/target/linux/brcm63xx/dts/hg553.dts +++ b/target/linux/brcm63xx/dts/hg553.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -96,3 +97,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg556a-a.dts b/target/linux/brcm63xx/dts/hg556a-a.dts index de17500ce..906ee611b 100644 --- a/target/linux/brcm63xx/dts/hg556a-a.dts +++ b/target/linux/brcm63xx/dts/hg556a-a.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -128,3 +129,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg556a-b.dts b/target/linux/brcm63xx/dts/hg556a-b.dts index 782beda98..4285e17bc 100644 --- a/target/linux/brcm63xx/dts/hg556a-b.dts +++ b/target/linux/brcm63xx/dts/hg556a-b.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -128,3 +129,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg556a-c.dts b/target/linux/brcm63xx/dts/hg556a-c.dts index 36f298be6..48c601e12 100644 --- a/target/linux/brcm63xx/dts/hg556a-c.dts +++ b/target/linux/brcm63xx/dts/hg556a-c.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -123,3 +124,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg622.dts b/target/linux/brcm63xx/dts/hg622.dts index f96af2bf2..419439d02 100644 --- a/target/linux/brcm63xx/dts/hg622.dts +++ b/target/linux/brcm63xx/dts/hg622.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; @@ -84,3 +85,7 @@ &pinctrl_pci_intb &pinctrl_pci_gnt1 &pinctrl_pci_req1>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg655b.dts b/target/linux/brcm63xx/dts/hg655b.dts index 63e13090c..0336a633e 100644 --- a/target/linux/brcm63xx/dts/hg655b.dts +++ b/target/linux/brcm63xx/dts/hg655b.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -105,3 +106,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/homehub2a.dts b/target/linux/brcm63xx/dts/homehub2a.dts index 6192687d1..1f55265bc 100644 --- a/target/linux/brcm63xx/dts/homehub2a.dts +++ b/target/linux/brcm63xx/dts/homehub2a.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -155,3 +156,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/livebox-blue-5g.dts b/target/linux/brcm63xx/dts/livebox-blue-5g.dts index 8a060736c..10a88669b 100644 --- a/target/linux/brcm63xx/dts/livebox-blue-5g.dts +++ b/target/linux/brcm63xx/dts/livebox-blue-5g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/magic.dts b/target/linux/brcm63xx/dts/magic.dts index 9053c26e6..c78b836df 100644 --- a/target/linux/brcm63xx/dts/magic.dts +++ b/target/linux/brcm63xx/dts/magic.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/nb4-fxc-r1.dts b/target/linux/brcm63xx/dts/nb4-fxc-r1.dts index e11ec4678..9d341ec1a 100644 --- a/target/linux/brcm63xx/dts/nb4-fxc-r1.dts +++ b/target/linux/brcm63xx/dts/nb4-fxc-r1.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -103,3 +104,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/nb4-ser-r0.dts b/target/linux/brcm63xx/dts/nb4-ser-r0.dts index 8a33c6601..e97d9f219 100644 --- a/target/linux/brcm63xx/dts/nb4-ser-r0.dts +++ b/target/linux/brcm63xx/dts/nb4-ser-r0.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -103,3 +104,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/nb6-ser-r0.dts b/target/linux/brcm63xx/dts/nb6-ser-r0.dts index 8fb434f34..70d719e1e 100644 --- a/target/linux/brcm63xx/dts/nb6-ser-r0.dts +++ b/target/linux/brcm63xx/dts/nb6-ser-r0.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -82,3 +83,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/p870hw-51a-v2.dts b/target/linux/brcm63xx/dts/p870hw-51a-v2.dts index eea30219e..d7e5d3e3f 100644 --- a/target/linux/brcm63xx/dts/p870hw-51a-v2.dts +++ b/target/linux/brcm63xx/dts/p870hw-51a-v2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -84,3 +85,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/r1000h.dts b/target/linux/brcm63xx/dts/r1000h.dts index 37cfa15da..299b520a6 100644 --- a/target/linux/brcm63xx/dts/r1000h.dts +++ b/target/linux/brcm63xx/dts/r1000h.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -91,3 +92,11 @@ reg = <0x1fe0000 0x20000>; }; }; + +&uart0 { + status = "ok"; +}; + +&uart1 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/r5010unv2.dts b/target/linux/brcm63xx/dts/r5010unv2.dts index 0bd88b2e4..c0b0a85c4 100644 --- a/target/linux/brcm63xx/dts/r5010unv2.dts +++ b/target/linux/brcm63xx/dts/r5010unv2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; @@ -99,3 +100,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rg100a.dts b/target/linux/brcm63xx/dts/rg100a.dts index e96e310fd..871aada25 100644 --- a/target/linux/brcm63xx/dts/rg100a.dts +++ b/target/linux/brcm63xx/dts/rg100a.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -56,3 +57,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta1025w.dts b/target/linux/brcm63xx/dts/rta1025w.dts index 16c3abf85..e4de95dbe 100644 --- a/target/linux/brcm63xx/dts/rta1025w.dts +++ b/target/linux/brcm63xx/dts/rta1025w.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -39,3 +40,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta1320.dts b/target/linux/brcm63xx/dts/rta1320.dts index 6dbf0a5a9..aedc9d30f 100644 --- a/target/linux/brcm63xx/dts/rta1320.dts +++ b/target/linux/brcm63xx/dts/rta1320.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -56,3 +57,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta770bw.dts b/target/linux/brcm63xx/dts/rta770bw.dts index bb92d1ec0..0f7146758 100644 --- a/target/linux/brcm63xx/dts/rta770bw.dts +++ b/target/linux/brcm63xx/dts/rta770bw.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -72,3 +73,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta770w.dts b/target/linux/brcm63xx/dts/rta770w.dts index 7cefa5008..ce9f0be37 100644 --- a/target/linux/brcm63xx/dts/rta770w.dts +++ b/target/linux/brcm63xx/dts/rta770w.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -72,3 +73,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/spw303v.dts b/target/linux/brcm63xx/dts/spw303v.dts index 0040540a4..7a0002023 100644 --- a/target/linux/brcm63xx/dts/spw303v.dts +++ b/target/linux/brcm63xx/dts/spw303v.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -83,3 +84,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/spw500v.dts b/target/linux/brcm63xx/dts/spw500v.dts index a9603b388..c7a4c7dfd 100644 --- a/target/linux/brcm63xx/dts/spw500v.dts +++ b/target/linux/brcm63xx/dts/spw500v.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/td-w8900gb.dts b/target/linux/brcm63xx/dts/td-w8900gb.dts index b52670b9b..e5c02e63a 100644 --- a/target/linux/brcm63xx/dts/td-w8900gb.dts +++ b/target/linux/brcm63xx/dts/td-w8900gb.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/usr9108.dts b/target/linux/brcm63xx/dts/usr9108.dts index 81af20bcd..4852d65ad 100644 --- a/target/linux/brcm63xx/dts/usr9108.dts +++ b/target/linux/brcm63xx/dts/usr9108.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -52,3 +53,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/v2110.dts b/target/linux/brcm63xx/dts/v2110.dts index 23378a472..93a5d9443 100644 --- a/target/linux/brcm63xx/dts/v2110.dts +++ b/target/linux/brcm63xx/dts/v2110.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -78,3 +79,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/v2500v-bb.dts b/target/linux/brcm63xx/dts/v2500v-bb.dts index b6370ee1c..d6b5964f8 100644 --- a/target/linux/brcm63xx/dts/v2500v-bb.dts +++ b/target/linux/brcm63xx/dts/v2500v-bb.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -78,3 +79,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vg50.dts b/target/linux/brcm63xx/dts/vg50.dts index 2180802db..f1d48ea3c 100644 --- a/target/linux/brcm63xx/dts/vg50.dts +++ b/target/linux/brcm63xx/dts/vg50.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -49,3 +50,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vh4032n.dts b/target/linux/brcm63xx/dts/vh4032n.dts index 1b646ce5c..78a708ac0 100644 --- a/target/linux/brcm63xx/dts/vh4032n.dts +++ b/target/linux/brcm63xx/dts/vh4032n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -100,3 +101,7 @@ reg = <0x1fe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vr-3025u.dts b/target/linux/brcm63xx/dts/vr-3025u.dts index 2c53f516b..fd2a56769 100644 --- a/target/linux/brcm63xx/dts/vr-3025u.dts +++ b/target/linux/brcm63xx/dts/vr-3025u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -80,3 +81,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vr-3025un.dts b/target/linux/brcm63xx/dts/vr-3025un.dts index f9aed5175..61e197251 100644 --- a/target/linux/brcm63xx/dts/vr-3025un.dts +++ b/target/linux/brcm63xx/dts/vr-3025un.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -80,3 +81,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vr-3026e.dts b/target/linux/brcm63xx/dts/vr-3026e.dts index da75df8a1..01cb98817 100644 --- a/target/linux/brcm63xx/dts/vr-3026e.dts +++ b/target/linux/brcm63xx/dts/vr-3026e.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -80,3 +81,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/wap-5813n.dts b/target/linux/brcm63xx/dts/wap-5813n.dts index 8b47b200b..1a71426ca 100644 --- a/target/linux/brcm63xx/dts/wap-5813n.dts +++ b/target/linux/brcm63xx/dts/wap-5813n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -141,3 +142,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/image/bcm63xx.mk b/target/linux/brcm63xx/image/bcm63xx.mk index 4e90eb050..918dfc798 100644 --- a/target/linux/brcm63xx/image/bcm63xx.mk +++ b/target/linux/brcm63xx/image/bcm63xx.mk @@ -971,6 +971,18 @@ define Device/FAST2704V2 endef TARGET_DEVICES += FAST2704V2 +### Sercomm ### +define Device/AD1018-SPI_flash + $(Device/bcm63xx) + DEVICE_TITLE := Sercomm AD1018 (SPI flash mod) + DEVICE_DTS := ad1018-nor + CFE_BOARD_ID := 96328avngr + CFE_CHIP_ID := 6328 + DEVICE_PACKAGES := \ + $(B43_PACKAGES) $(USB2_PACKAGES) +endef +TARGET_DEVICES += AD1018-SPI_flash + ### SFR ### define Device/NEUFBOX4-SER $(Device/bcm63xx) diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch index 14eaca354..6b0a12132 100644 --- a/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch +++ b/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch @@ -15,7 +15,7 @@ Reviewed-by: Boris Brezillon --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -3989,6 +3989,9 @@ int nand_scan_ident(struct mtd_info *mtd +@@ -3992,6 +3992,9 @@ int nand_scan_ident(struct mtd_info *mtd int ret; if (chip->flash_node) { diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch new file mode 100644 index 000000000..9f4e21aab --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch @@ -0,0 +1,37 @@ +From a59388668d0ce19dadea909e09f4eb905a27b1ce Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Wed, 8 Jun 2016 12:08:43 +0200 +Subject: [PATCH] serial/bcm63xx_uart: use correct alias naming + +The bcm63xx_uart driver uses the of alias for determing its id. Recent +changes in dts files changed the expected 'uartX' to the recommended +'serialX', breaking serial output. Fix this by checking for a 'serialX' +alias as well. + +Fixes: e3b992d028f8 ("MIPS: BMIPS: Improve BCM6328 device tree") +Fixes: 2d52ee82b475 ("MIPS: BMIPS: Improve BCM6368 device tree") +Fixes: 7537d273e2f3 ("MIPS: BMIPS: Add device tree example for BCM6358") +Signed-off-by: Jonas Gorski +Acked-by: Florian Fainelli +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/bcm63xx_uart.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/tty/serial/bcm63xx_uart.c ++++ b/drivers/tty/serial/bcm63xx_uart.c +@@ -813,8 +813,12 @@ static int bcm_uart_probe(struct platfor + struct clk *clk; + int ret; + +- if (pdev->dev.of_node) +- pdev->id = of_alias_get_id(pdev->dev.of_node, "uart"); ++ if (pdev->dev.of_node) { ++ pdev->id = of_alias_get_id(pdev->dev.of_node, "serial"); ++ ++ if (pdev->id < 0) ++ pdev->id = of_alias_get_id(pdev->dev.of_node, "uart"); ++ } + + if (pdev->id < 0 || pdev->id >= BCM63XX_NR_UARTS) + return -EINVAL; diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch new file mode 100644 index 000000000..aa813f3d9 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch @@ -0,0 +1,192 @@ +From 69226896ad636b94f6d2e55d75ff21a29c4de83b Mon Sep 17 00:00:00 2001 +From: Roger Quadros +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 +Signed-off-by: David S. Miller +--- + 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 + #include + #include ++#include ++#include + #include + #include ++#include + #include + #include + #include +@@ -252,6 +255,7 @@ static inline void of_mdiobus_link_phyde + int __mdiobus_register(struct mii_bus *bus, struct module *owner) + { + int i, err; ++ struct gpio_desc *gpiod; + + if (NULL == bus || NULL == bus->name || + NULL == bus->read || NULL == bus->write) +@@ -278,6 +282,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; +@@ -302,6 +335,13 @@ error: + phy_device_free(phydev); + } + } ++ ++ /* 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; + } +@@ -321,6 +361,13 @@ void mdiobus_unregister(struct mii_bus * + phy_device_free(phydev); + } + } ++ ++ /* 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 +@@ -21,6 +21,8 @@ + #include + #include + ++#define DEFAULT_GPIO_RESET_DELAY 10 /* in microseconds */ ++ + MODULE_AUTHOR("Grant Likely "); + MODULE_LICENSE("GPL"); + +@@ -140,6 +142,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 +@@ -187,6 +187,13 @@ struct mii_bus { + * interrupt at the index matching its address + */ + int *irq; ++ ++ /* 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.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch new file mode 100644 index 000000000..5788a37de --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch @@ -0,0 +1,43 @@ +From df0c8d911abf6ba97b2c2fc3c5a12769e0b081a3 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +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 +Signed-off-by: David S. Miller +--- + 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 +@@ -279,9 +279,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, +@@ -311,6 +308,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.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch new file mode 100644 index 000000000..7ce5eb59c --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch @@ -0,0 +1,120 @@ +From d396e84c56047b303cac378dde4b2e5cc430b336 Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Mon, 12 Jun 2017 23:55:38 +0300 +Subject: [PATCH] mdio_bus: handle only single PHY reset GPIO + +Commit 4c5e7a2c0501 ("dt-bindings: mdio: Clarify binding document") +declared that a MDIO reset GPIO property should have only a single GPIO +reference/specifier, however the supporting code was left intact, still +burdening the kernel with now apparently useless loops -- get rid of them. + +Signed-off-by: Sergei Shtylyov +Signed-off-by: David S. Miller +--- + drivers/net/phy/mdio_bus.c | 53 +++++++++++++++++----------------------------- + drivers/of/of_mdio.c | 1 - + include/linux/phy.h | 6 ++---- + 3 files changed, 21 insertions(+), 39 deletions(-) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -279,33 +279,22 @@ int __mdiobus_register(struct mii_bus *b + + mutex_init(&bus->mdio_lock); + +- /* 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); ++ /* de-assert bus level PHY GPIO reset */ ++ gpiod = devm_gpiod_get(&bus->dev, "reset", 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 = gpiod; ++ ++ gpiod_set_value_cansleep(gpiod, 1); ++ udelay(bus->reset_delay_us); ++ gpiod_set_value_cansleep(gpiod, 0); + } + + if (bus->reset) +@@ -337,10 +326,8 @@ error: + } + + /* 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); +- } ++ if (bus->reset_gpiod) ++ gpiod_set_value_cansleep(bus->reset_gpiod, 1); + + device_del(&bus->dev); + return err; +@@ -363,10 +350,8 @@ void mdiobus_unregister(struct mii_bus * + } + + /* 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); +- } ++ if (bus->reset_gpiod) ++ gpiod_set_value_cansleep(bus->reset_gpiod, 1); + + device_del(&bus->dev); + } +--- a/drivers/of/of_mdio.c ++++ b/drivers/of/of_mdio.c +@@ -145,7 +145,6 @@ int of_mdiobus_register(struct mii_bus * + /* 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); +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -190,10 +190,8 @@ struct mii_bus { + + /* 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; ++ /* RESET GPIO descriptor pointer */ ++ 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.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch new file mode 100644 index 000000000..d7ac6234c --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch @@ -0,0 +1,39 @@ +From fe0e4052fb11d5c713961ab7e136520be40052a3 Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Mon, 12 Jun 2017 23:55:39 +0300 +Subject: [PATCH] mdio_bus: use devm_gpiod_get_optional() + +The MDIO reset GPIO is really a classical optional GPIO property case, +so devm_gpiod_get_optional() should have been used, not devm_gpiod_get(). +Doing this saves several LoCs... + +Signed-off-by: Sergei Shtylyov +Signed-off-by: David S. Miller +--- + drivers/net/phy/mdio_bus.c | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -280,16 +280,12 @@ int __mdiobus_register(struct mii_bus *b + mutex_init(&bus->mdio_lock); + + /* de-assert bus level PHY GPIO reset */ +- gpiod = devm_gpiod_get(&bus->dev, "reset", GPIOD_OUT_LOW); ++ gpiod = devm_gpiod_get_optional(&bus->dev, "reset", 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 { ++ dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n", ++ bus->id); ++ return PTR_ERR(gpiod); ++ } else if (gpiod) { + bus->reset_gpiod = gpiod; + + gpiod_set_value_cansleep(gpiod, 1); diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch new file mode 100644 index 000000000..08511d69f --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch @@ -0,0 +1,210 @@ +From e74caf41aec5338b8cbbd0a1483650848f16f532 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +Signed-off-by: Jonas Gorski +--- + 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 +@@ -214,6 +214,7 @@ config BCM63XX + select ARCH_REQUIRE_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 + #include + #include ++#include + #include + #include + #include +@@ -352,44 +353,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 +@@ -397,11 +457,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.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch new file mode 100644 index 000000000..2b3ca16de --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch @@ -0,0 +1,84 @@ +From d0322bf7bebe87012b4f95c85be6b5ba0cb6f344 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -356,6 +356,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), +@@ -369,6 +371,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), +@@ -380,6 +384,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), +@@ -392,6 +397,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), +@@ -404,6 +410,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), +@@ -416,6 +423,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), +@@ -429,6 +438,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), +@@ -442,6 +453,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.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch new file mode 100644 index 000000000..5152fbe24 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch @@ -0,0 +1,26 @@ +From 8124706e6040b1cf0d2dd3a05759df6cec4bddfb Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + 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.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch new file mode 100644 index 000000000..a8fd5afcb --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch @@ -0,0 +1,55 @@ +From 317f8659bba01b307cbe4e9902d4e3d333fd7164 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +Acked-by: Greg Kroah-Hartman +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + 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.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch new file mode 100644 index 000000000..3d9deee79 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch @@ -0,0 +1,62 @@ +From cb86630379c8f3432c916d62045b5176f17f4123 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +Signed-off-by: Jonas Gorski +--- + 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 +@@ -373,6 +377,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), +@@ -440,6 +445,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), +@@ -474,7 +480,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: +@@ -490,7 +496,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.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch new file mode 100644 index 000000000..0eafe5f72 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch @@ -0,0 +1,60 @@ +From 6d43970a2eb1c7ee88caf7328d201f9c001262e9 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -370,6 +370,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[] = { +@@ -397,6 +399,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[] = { +@@ -410,6 +413,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[] = { +@@ -423,6 +427,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[] = { +@@ -438,6 +444,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.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch new file mode 100644 index 000000000..b53660182 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch @@ -0,0 +1,105 @@ +From b98027285bd1fa95da0645a4234a5fc1f1a83f92 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +--- + 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 */ +@@ -444,6 +483,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.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch new file mode 100644 index 000000000..b85f38b59 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch @@ -0,0 +1,101 @@ +From d0423d3e4fa7ae305729cb50369427f075ccb279 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 25 Feb 2017 12:41:28 +0100 +Subject: [PATCH 1/6] bcm63xx_enet: correct clock usage + +Check the return code of prepare_enable and change one last instance of +enable only to prepare_enable. Also properly disable and release the +clock in error paths and on remove for enetsw. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 31 +++++++++++++++++++++------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1787,7 +1787,9 @@ static int bcm_enet_probe(struct platfor + ret = PTR_ERR(priv->mac_clk); + goto out; + } +- clk_prepare_enable(priv->mac_clk); ++ ret = clk_prepare_enable(priv->mac_clk); ++ if (ret) ++ goto out_put_clk_mac; + + /* initialize default and fetch platform data */ + priv->rx_ring_size = BCMENET_DEF_RX_DESC; +@@ -1819,9 +1821,11 @@ static int bcm_enet_probe(struct platfor + if (IS_ERR(priv->phy_clk)) { + ret = PTR_ERR(priv->phy_clk); + priv->phy_clk = NULL; +- goto out_put_clk_mac; ++ goto out_disable_clk_mac; + } +- clk_prepare_enable(priv->phy_clk); ++ ret = clk_prepare_enable(priv->phy_clk); ++ if (ret) ++ goto out_put_clk_phy; + } + + /* do minimal hardware init to be able to probe mii bus */ +@@ -1921,13 +1925,16 @@ out_free_mdio: + out_uninit_hw: + /* turn off mdc clock */ + enet_writel(priv, 0, ENET_MIISC_REG); +- if (priv->phy_clk) { ++ if (priv->phy_clk) + clk_disable_unprepare(priv->phy_clk); ++ ++out_put_clk_phy: ++ if (priv->phy_clk) + clk_put(priv->phy_clk); +- } + +-out_put_clk_mac: ++out_disable_clk_mac: + clk_disable_unprepare(priv->mac_clk); ++out_put_clk_mac: + clk_put(priv->mac_clk); + out: + free_netdev(dev); +@@ -2772,7 +2779,9 @@ static int bcm_enetsw_probe(struct platf + ret = PTR_ERR(priv->mac_clk); + goto out_unmap; + } +- clk_enable(priv->mac_clk); ++ ret = clk_prepare_enable(priv->mac_clk); ++ if (ret) ++ goto out_put_clk; + + priv->rx_chan = 0; + priv->tx_chan = 1; +@@ -2793,7 +2802,7 @@ static int bcm_enetsw_probe(struct platf + + ret = register_netdev(dev); + if (ret) +- goto out_put_clk; ++ goto out_disable_clk; + + netif_carrier_off(dev); + platform_set_drvdata(pdev, dev); +@@ -2802,6 +2811,9 @@ static int bcm_enetsw_probe(struct platf + + return 0; + ++out_disable_clk: ++ clk_disable_unprepare(priv->mac_clk); ++ + out_put_clk: + clk_put(priv->mac_clk); + +@@ -2833,6 +2845,9 @@ static int bcm_enetsw_remove(struct plat + 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.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch new file mode 100644 index 000000000..22c6d0187 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch @@ -0,0 +1,29 @@ +From 23d94cb855b6f4f0ee1c01679224472104ac6440 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 30 Sep 2017 14:10:18 +0200 +Subject: [PATCH 2/6] bcm63xx_enet: do not write to random DMA channel on + BCM6345 + +The DMA controller regs actually point to DMA channel 0, so the write to +ENETDMA_CFG_REG will actually modify a random DMA channel. + +Since DMA controller registers do not exist on BCM6345, guard the write +with the usual check for dma_has_sram. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1063,7 +1063,8 @@ static int bcm_enet_open(struct net_devi + val = enet_readl(priv, ENET_CTL_REG); + val |= ENET_CTL_ENABLE_MASK; + enet_writel(priv, val, ENET_CTL_REG); +- enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); ++ if (priv->dma_has_sram) ++ enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); + enet_dmac_writel(priv, priv->dma_chan_en_mask, + ENETDMAC_CHANCFG, priv->rx_chan); + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch new file mode 100644 index 000000000..b14dedcd7 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch @@ -0,0 +1,41 @@ +From 71710bb6cbc82f411a4e5faafa0c3178e48e7137 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +--- + 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 +@@ -1736,10 +1736,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); +@@ -2720,11 +2718,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.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch new file mode 100644 index 000000000..ae009064b --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch @@ -0,0 +1,150 @@ +From 179a445ae4ef36ec44f4aea18e5f42d21334d186 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +--- + 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 +@@ -1781,14 +1781,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; +@@ -1816,7 +1816,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; +@@ -1824,7 +1824,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 */ +@@ -1927,14 +1927,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; +@@ -1970,12 +1964,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; +@@ -2758,26 +2750,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; +@@ -2809,15 +2795,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; +@@ -2829,20 +2806,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.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch new file mode 100644 index 000000000..957c0f372 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch @@ -0,0 +1,36 @@ +From 555baec974ede81e616ca88ac6d3fca09239368f Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +--- + 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 +@@ -1924,8 +1924,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); +@@ -1964,9 +1963,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.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch new file mode 100644 index 000000000..482bd5892 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch @@ -0,0 +1,22 @@ +From 77364ce98037972fb1c57d0ee0418eb1c2b26521 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +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 +--- + 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 + + #include +-#include + #include + #include + diff --git a/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch b/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch index 63d385be4..67c5ef450 100644 --- a/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch +++ b/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch @@ -14,7 +14,7 @@ Signed-off-by: Florian Fainelli --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -177,6 +177,11 @@ static void usbh_set(struct clk *clk, in +@@ -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); diff --git a/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch b/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch index 43bbcd10e..1001df375 100644 --- a/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch +++ b/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch @@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -199,6 +199,11 @@ static void usbd_set(struct clk *clk, in +@@ -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); diff --git a/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch b/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch index 75a3a23a9..0a96e1bbb 100644 --- a/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch +++ b/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch @@ -36,7 +36,7 @@ Reviewed-by: Florian Fainelli --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -345,6 +345,9 @@ EXPORT_SYMBOL(clk_disable); +@@ -389,6 +389,9 @@ EXPORT_SYMBOL(clk_disable); unsigned long clk_get_rate(struct clk *clk) { diff --git a/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch b/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch index 57614c270..27c2d0908 100644 --- a/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch +++ b/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch @@ -21,7 +21,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig -@@ -247,6 +247,7 @@ config PINCTRL_ZYNQ +@@ -248,6 +248,7 @@ config PINCTRL_ZYNQ This selectes the pinctrl driver for Xilinx Zynq. source "drivers/pinctrl/bcm/Kconfig" diff --git a/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch b/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch index 9d086a65f..6a9b9e080 100644 --- a/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch +++ b/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch @@ -575,7 +575,7 @@ Signed-off-by: Jonas Gorski + if (!pctl) + return -ENOMEM; + -+ pctl->overlay = devm_regmap_field_alloc(&pdev->dev, mode, overlay); ++ pctl->overlay = devm_regmap_field_alloc(&pdev->dev, basemode, overlay); + if (IS_ERR(pctl->overlay)) + return PTR_ERR(pctl->overlay); + diff --git a/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch b/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch index 25b0df5dc..85abad4d3 100644 --- a/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch +++ b/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch @@ -46,16 +46,16 @@ Signed-off-by: Jonas Gorski val = bcm_mpi_readl(MPI_CSBASE_REG(0)); --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -133,6 +133,8 @@ static void enetsw_set(struct clk *clk, - CKCTL_6368_SWPKT_USB_EN | - CKCTL_6368_SWPKT_SAR_EN, - enable); -+ else if (BCMCPU_IS_63268()) +@@ -168,6 +168,8 @@ static void enetsw_set(struct clk *clk, + clk_disable_unlocked(&clk_swpkt_sar); + } + bcm_hwclock_set(CKCTL_6368_ROBOSW_EN, enable); ++ } else if (BCMCPU_IS_63268()) { + bcm_hwclock_set(CKCTL_63268_ROBOSW_EN, enable); - else + } else { return; - -@@ -177,6 +179,8 @@ static void usbh_set(struct clk *clk, in + } +@@ -213,6 +215,8 @@ 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); @@ -64,7 +64,7 @@ Signed-off-by: Jonas Gorski else return; -@@ -199,6 +203,8 @@ static void usbd_set(struct clk *clk, in +@@ -235,6 +239,8 @@ 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); @@ -73,7 +73,7 @@ Signed-off-by: Jonas Gorski else return; -@@ -225,9 +231,13 @@ static void spi_set(struct clk *clk, int +@@ -261,9 +267,13 @@ static void spi_set(struct clk *clk, int mask = CKCTL_6358_SPI_EN; else if (BCMCPU_IS_6362()) mask = CKCTL_6362_SPI_EN; @@ -89,7 +89,7 @@ Signed-off-by: Jonas Gorski bcm_hwclock_set(mask, enable); } -@@ -246,6 +256,8 @@ static void hsspi_set(struct clk *clk, i +@@ -282,6 +292,8 @@ static void hsspi_set(struct clk *clk, i mask = CKCTL_6328_HSSPI_EN; else if (BCMCPU_IS_6362()) mask = CKCTL_6362_HSSPI_EN; @@ -98,7 +98,7 @@ Signed-off-by: Jonas Gorski else return; -@@ -307,6 +319,8 @@ static void pcie_set(struct clk *clk, in +@@ -351,6 +363,8 @@ static void pcie_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable); else if (BCMCPU_IS_6362()) bcm_hwclock_set(CKCTL_6362_PCIE_EN, enable); @@ -107,28 +107,39 @@ Signed-off-by: Jonas Gorski } static struct clk clk_pcie = { -@@ -389,9 +403,11 @@ struct clk *clk_get(struct device *dev, - 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")) -+ if ((BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268()) && -+ !strcmp(id, "ipsec")) - return &clk_ipsec; -- if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie")) -+ if ((BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) && -+ !strcmp(id, "pcie")) - return &clk_pcie; - return ERR_PTR(-ENOENT); - } -@@ -414,6 +430,7 @@ static int __init bcm63xx_clk_init(void) - clk_hsspi.rate = HSSPI_PLL_HZ_6328; +@@ -532,6 +546,21 @@ static struct clk_lookup bcm6368_clks[] + CLKDEV_INIT(NULL, "ipsec", &clk_ipsec), + }; + ++static struct clk_lookup bcm63268_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), ++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ /* 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), ++}; ++ + #define HSSPI_PLL_HZ_6328 133333333 + #define HSSPI_PLL_HZ_6362 400000000 + +@@ -564,6 +593,10 @@ static int __init bcm63xx_clk_init(void) + case BCM6368_CPU_ID: + clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks)); break; - case BCM6362_CPU_ID: + case BCM63268_CPU_ID: - clk_hsspi.rate = HSSPI_PLL_HZ_6362; - break; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362; ++ clkdev_add_table(bcm63268_clks, ARRAY_SIZE(bcm63268_clks)); ++ break; } + + return 0; --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c @@ -101,6 +101,15 @@ static const int bcm6368_irqs[] = { diff --git a/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch b/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch index 3b0995afc..3b5da024b 100644 --- a/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch +++ b/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch @@ -46,7 +46,7 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318 val = bcm_mpi_readl(MPI_CSBASE_REG(0)); --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -252,7 +252,9 @@ static void hsspi_set(struct clk *clk, i +@@ -288,7 +288,9 @@ static void hsspi_set(struct clk *clk, i { u32 mask; @@ -57,23 +57,45 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318 mask = CKCTL_6328_HSSPI_EN; else if (BCMCPU_IS_6362()) mask = CKCTL_6362_HSSPI_EN; -@@ -420,12 +422,16 @@ void clk_put(struct clk *clk) +@@ -440,6 +442,19 @@ static struct clk_lookup bcm3368_clks[] + CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), + }; - EXPORT_SYMBOL(clk_put); ++static struct clk_lookup bcm6318_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "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), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbh), ++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), ++ CLKDEV_INIT(NULL, "pcie", &clk_pcie), ++}; ++ + static struct clk_lookup bcm6328_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), +@@ -561,6 +576,7 @@ static struct clk_lookup bcm63268_clks[] + CLKDEV_INIT(NULL, "pcie", &clk_pcie), + }; +#define HSSPI_PLL_HZ_6318 250000000 #define HSSPI_PLL_HZ_6328 133333333 #define HSSPI_PLL_HZ_6362 400000000 - static int __init bcm63xx_clk_init(void) - { - switch (bcm63xx_get_cpu_id()) { +@@ -570,6 +586,10 @@ static int __init bcm63xx_clk_init(void) + case BCM3368_CPU_ID: + clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks)); + break; + case BCM6318_CPU_ID: -+ clk_hsspi.rate = HSSPI_PLL_HZ_6318; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6318; ++ clkdev_add_table(bcm6318_clks, ARRAY_SIZE(bcm6318_clks)); + break; case BCM6328_CPU_ID: - clk_hsspi.rate = HSSPI_PLL_HZ_6328; - break; + clk_hsspi_pll.rate = HSSPI_PLL_HZ_6328; + clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks)); --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c @@ -41,6 +41,14 @@ static const int bcm3368_irqs[] = { diff --git a/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch b/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch index 3e28a38e0..cc2937c57 100644 --- a/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch +++ b/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch @@ -13,7 +13,7 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318 --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -50,6 +50,18 @@ static void bcm_hwclock_set(u32 mask, in +@@ -51,6 +51,18 @@ static void bcm_hwclock_set(u32 mask, in bcm_perf_writel(reg, PERF_CKCTL_REG); } @@ -32,7 +32,7 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318 /* * Ethernet MAC "misc" clock: dma clocks and main clock on 6348 */ -@@ -317,12 +329,17 @@ static struct clk clk_ipsec = { +@@ -361,12 +373,17 @@ static struct clk clk_ipsec = { static void pcie_set(struct clk *clk, int enable) { @@ -53,15 +53,6 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318 } static struct clk clk_pcie = { -@@ -408,7 +425,7 @@ struct clk *clk_get(struct device *dev, - if ((BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268()) && - !strcmp(id, "ipsec")) - return &clk_ipsec; -- if ((BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) && -+ if ((BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) && - !strcmp(id, "pcie")) - return &clk_pcie; - return ERR_PTR(-ENOENT); --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h @@ -40,6 +40,12 @@ diff --git a/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch b/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch index 947f7223f..8e4efeb8d 100644 --- a/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch +++ b/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch @@ -1,19 +1,19 @@ --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -136,7 +136,11 @@ static struct clk clk_ephy = { +@@ -167,7 +167,11 @@ static struct clk clk_swpkt_usb = { */ static void enetsw_set(struct clk *clk, int enable) { -- if (BCMCPU_IS_6328()) +- if (BCMCPU_IS_6328()) { + if (BCMCPU_IS_6318()) { + bcm_hwclock_set(CKCTL_6318_ROBOSW250_EN | + CKCTL_6318_ROBOSW025_EN, enable); + bcm_ub_hwclock_set(UB_CKCTL_6318_ROBOSW_EN, enable); -+ } else if (BCMCPU_IS_6328()) ++ } else 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); -@@ -183,18 +187,22 @@ static struct clk clk_pcm = { +@@ -219,18 +223,22 @@ static struct clk clk_pcm = { */ static void usbh_set(struct clk *clk, int enable) { @@ -42,15 +42,3 @@ if (enable) msleep(100); -@@ -408,9 +416,9 @@ struct clk *clk_get(struct device *dev, - return &clk_enetsw; - if (!strcmp(id, "ephy")) - return &clk_ephy; -- if (!strcmp(id, "usbh")) -+ if (!strcmp(id, "usbh") || (BCMCPU_IS_6318() && !strcmp(id, "usbd"))) - return &clk_usbh; -- if (!strcmp(id, "usbd")) -+ if (!strcmp(id, "usbd") && !BCMCPU_IS_6318()) - return &clk_usbd; - if (!strcmp(id, "spi")) - return &clk_spi; diff --git a/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch b/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch index 10edbc4dd..0b8a5a170 100644 --- a/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch +++ b/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch @@ -24,7 +24,7 @@ #define STRAPBUS_6328_FCVO_MASK (0x1f << STRAPBUS_6328_FCVO_SHIFT) --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -62,6 +62,26 @@ static void bcm_ub_hwclock_set(u32 mask, +@@ -63,6 +63,26 @@ static void bcm_ub_hwclock_set(u32 mask, bcm_perf_writel(reg, PERF_UB_CKCTL_REG); } @@ -51,7 +51,7 @@ /* * Ethernet MAC "misc" clock: dma clocks and main clock on 6348 */ -@@ -199,7 +219,17 @@ static void usbh_set(struct clk *clk, in +@@ -235,7 +255,17 @@ static void usbh_set(struct clk *clk, in } else if (BCMCPU_IS_6368()) { bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); } else if (BCMCPU_IS_63268()) { diff --git a/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch b/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch deleted file mode 100644 index db3fc5bc3..000000000 --- a/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch +++ /dev/null @@ -1,46 +0,0 @@ -From ec905f2ea78ec40602a685ede31c5e4f9893d196 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Sat, 21 Feb 2015 16:35:07 +0100 -Subject: [PATCH 3/6] net: bcm63xx_enet: use named gpio for ephy reset gpio - -Allow using a named optional gpio for ephy reset gpio registration. ---- - drivers/net/ethernet/broadcom/bcm63xx_enet.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c -+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #include - #include "bcm63xx_enet.h" -@@ -2851,10 +2852,15 @@ static int bcm_enet_shared_probe(struct - { - struct resource *res; - void __iomem *p[3]; -+ struct gpio_desc *ephy_reset; - unsigned int i; - - memset(bcm_enet_shared_base, 0, sizeof(bcm_enet_shared_base)); - -+ ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_ASIS); -+ if (IS_ERR(ephy_reset)) -+ return PTR_ERR(ephy_reset); -+ - for (i = 0; i < 3; i++) { - res = platform_get_resource(pdev, IORESOURCE_MEM, i); - p[i] = devm_ioremap_resource(&pdev->dev, res); -@@ -2864,6 +2870,9 @@ static int bcm_enet_shared_probe(struct - - memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base)); - -+ if (ephy_reset) -+ gpiod_direction_output(ephy_reset, 0); -+ - return 0; - } - diff --git a/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch b/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch index e71791fc6..2259b024a 100644 --- a/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch +++ b/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch @@ -72,7 +72,7 @@ Signed-off-by: Jonas Gorski } + +static struct gpiod_lookup_table ephy_reset = { -+ .dev_id = "bcm63xx_enet_shared.0", ++ .dev_id = "bcm63xx_enet-0", + .table = { + { /* filled at runtime */ }, + { }, diff --git a/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch b/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch deleted file mode 100644 index dc9e3c134..000000000 --- a/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Jonas Gorski -Subject: [PATCH] net: bcm63xx_enet: fully reset ephy - -Signed-off-by: Jonas Gorski ---- - drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 ++-- - 1 file changed, 2 insertions(+), , 1 deletions(-) - ---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c -+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2857,7 +2857,7 @@ static int bcm_enet_shared_probe(struct - - memset(bcm_enet_shared_base, 0, sizeof(bcm_enet_shared_base)); - -- ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_ASIS); -+ ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_OUT_HIGH); - if (IS_ERR(ephy_reset)) - return PTR_ERR(ephy_reset); - -@@ -2871,7 +2871,7 @@ static int bcm_enet_shared_probe(struct - memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base)); - - if (ephy_reset) -- gpiod_direction_output(ephy_reset, 0); -+ gpiod_set_value(ephy_reset, 0); - - return 0; - } diff --git a/target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch b/target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch new file mode 100644 index 000000000..3b2dda121 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch @@ -0,0 +1,105 @@ +From cad8f63047c0691e8185d3c9c6a2705b83310c9c Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 31 Jul 2017 20:10:36 +0200 +Subject: [PATCH] MIPS: BCM63XX: add clkdev lookups for device tree + +--- + arch/mips/bcm63xx/clk.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -485,6 +485,8 @@ static struct clk_lookup bcm3368_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("fff8c100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("fff8c120.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -501,7 +503,9 @@ static struct clk_lookup bcm6318_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("10000100.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10003000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -515,7 +519,10 @@ 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("10000100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("10000120.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10001000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -528,6 +535,7 @@ static struct clk_lookup bcm6338_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0300.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -542,6 +550,7 @@ static struct clk_lookup bcm6345_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0300.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -556,6 +565,7 @@ static struct clk_lookup bcm6348_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0300.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -572,6 +582,8 @@ static struct clk_lookup bcm6358_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("fffe0100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0120.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -591,7 +603,10 @@ 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("10000100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("10000120.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10001000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -607,6 +622,8 @@ static struct clk_lookup bcm6368_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("10000100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("10000120.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -621,7 +638,10 @@ static struct clk_lookup bcm63268_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("10000180.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("100001a0.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10001000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), diff --git a/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch b/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch index 10db690b5..084ef9ee8 100644 --- a/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch +++ b/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch @@ -33,3 +33,138 @@ Signed-off-by: Jonas Gorski bcm63xx_flash_register(); bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds); +--- a/arch/mips/bcm63xx/Makefile ++++ b/arch/mips/bcm63xx/Makefile +@@ -1,6 +1,6 @@ + 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-pcmcia.o dev-rng.o dev-uart.o \ + dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ + usb-common.o sprom.o + obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +--- a/arch/mips/bcm63xx/dev-hsspi.c ++++ /dev/null +@@ -1,48 +0,0 @@ +-/* +- * 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 Jonas Gorski +- */ +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-static struct resource spi_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_hsspi_device = { +- .name = "bcm63xx-hsspi", +- .id = 0, +- .num_resources = ARRAY_SIZE(spi_resources), +- .resource = spi_resources, +-}; +- +-int __init bcm63xx_hsspi_register(void) +-{ +- if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6362() && +- !BCMCPU_IS_63268()) +- return -ENODEV; +- +- spi_resources[0].start = bcm63xx_regset_address(RSET_HSSPI); +- spi_resources[0].end = spi_resources[0].start; +- spi_resources[0].end += RSET_HSSPI_SIZE - 1; +- spi_resources[1].start = bcm63xx_get_irq_number(IRQ_HSSPI); +- +- return platform_device_register(&bcm63xx_hsspi_device); +-} +--- a/arch/mips/bcm63xx/dev-spi.c ++++ /dev/null +@@ -1,60 +0,0 @@ +-/* +- * 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-2011 Florian Fainelli +- * Copyright (C) 2010 Tanguy Bouzeloc +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-static struct resource spi_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_spi_device = { +- .id = -1, +- .num_resources = ARRAY_SIZE(spi_resources), +- .resource = spi_resources, +-}; +- +-int __init bcm63xx_spi_register(void) +-{ +- if (BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6345()) +- return -ENODEV; +- +- spi_resources[0].start = bcm63xx_regset_address(RSET_SPI); +- spi_resources[0].end = spi_resources[0].start; +- spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); +- +- if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { +- bcm63xx_spi_device.name = "bcm6348-spi", +- spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1; +- } +- +- if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() || +- BCMCPU_IS_6368() || BCMCPU_IS_63268()) { +- bcm63xx_spi_device.name = "bcm6358-spi", +- spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1; +- } +- +- return platform_device_register(&bcm63xx_spi_device); +-} +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_hsspi.h ++++ /dev/null +@@ -1,8 +0,0 @@ +-#ifndef BCM63XX_DEV_HSSPI_H +-#define BCM63XX_DEV_HSSPI_H +- +-#include +- +-int bcm63xx_hsspi_register(void); +- +-#endif /* BCM63XX_DEV_HSSPI_H */ diff --git a/target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch b/target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch new file mode 100644 index 000000000..e033ea3a4 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch @@ -0,0 +1,257 @@ +--- a/arch/mips/bcm63xx/Makefile ++++ b/arch/mips/bcm63xx/Makefile +@@ -1,6 +1,6 @@ + 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-uart.o \ ++ dev-pcmcia.o dev-rng.o \ + dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ + usb-common.o sprom.o + obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +--- a/arch/mips/bcm63xx/dev-uart.c ++++ /dev/null +@@ -1,76 +0,0 @@ +-/* +- * 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 +- */ +- +-#include +-#include +-#include +-#include +- +-static struct resource uart0_resources[] = { +- { +- /* start & end filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- /* start filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct resource uart1_resources[] = { +- { +- /* start & end filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- /* start filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct platform_device bcm63xx_uart_devices[] = { +- { +- .name = "bcm63xx_uart", +- .id = 0, +- .num_resources = ARRAY_SIZE(uart0_resources), +- .resource = uart0_resources, +- }, +- +- { +- .name = "bcm63xx_uart", +- .id = 1, +- .num_resources = ARRAY_SIZE(uart1_resources), +- .resource = uart1_resources, +- } +-}; +- +-int __init bcm63xx_uart_register(unsigned int id) +-{ +- if (id >= ARRAY_SIZE(bcm63xx_uart_devices)) +- return -ENODEV; +- +- if (id == 1 && (!BCMCPU_IS_3368() && !BCMCPU_IS_6358() && +- !BCMCPU_IS_6368())) +- return -ENODEV; +- +- if (id == 0) { +- uart0_resources[0].start = bcm63xx_regset_address(RSET_UART0); +- uart0_resources[0].end = uart0_resources[0].start + +- RSET_UART_SIZE - 1; +- uart0_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0); +- } +- +- if (id == 1) { +- uart1_resources[0].start = bcm63xx_regset_address(RSET_UART1); +- uart1_resources[0].end = uart1_resources[0].start + +- RSET_UART_SIZE - 1; +- uart1_resources[1].start = bcm63xx_get_irq_number(IRQ_UART1); +- } +- +- return platform_device_register(&bcm63xx_uart_devices[id]); +-} +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h ++++ /dev/null +@@ -1,6 +0,0 @@ +-#ifndef BCM63XX_DEV_UART_H_ +-#define BCM63XX_DEV_UART_H_ +- +-int bcm63xx_uart_register(unsigned int id); +- +-#endif /* BCM63XX_DEV_UART_H_ */ +--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h ++++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h +@@ -33,8 +33,6 @@ struct board_info { + 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; + unsigned int use_fallback_sprom:1; + + /* ethernet config */ +--- a/arch/mips/bcm63xx/boards/board_common.c ++++ b/arch/mips/bcm63xx/boards/board_common.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -189,12 +188,6 @@ int __init board_register_devices(void) + + bcm63xx_gpio_init(); + +- if (board.has_uart0) +- bcm63xx_uart_register(0); +- +- if (board.has_uart1) +- bcm63xx_uart_register(1); +- + if (board.has_pccard) + bcm63xx_pcmcia_register(); + +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -35,9 +35,6 @@ static struct board_info __initdata boar + .name = "CVG834G_E15R3921", + .expected_cpu_id = 0x3368, + +- .has_uart0 = 1, +- .has_uart1 = 1, +- + .has_enet0 = 1, + .has_pci = 1, + +@@ -67,7 +64,6 @@ static struct board_info __initdata boar + .name = "96328avng", + .expected_cpu_id = 0x6328, + +- .has_uart0 = 1, + .has_pci = 1, + .has_usbd = 0, + .use_fallback_sprom = 1, +@@ -116,7 +112,6 @@ static struct board_info __initdata boar + .name = "96338GW", + .expected_cpu_id = 0x6338, + +- .has_uart0 = 1, + .has_enet0 = 1, + .enet0 = { + .force_speed_100 = 1, +@@ -159,7 +154,6 @@ static struct board_info __initdata boar + .name = "96338W", + .expected_cpu_id = 0x6338, + +- .has_uart0 = 1, + .has_enet0 = 1, + .enet0 = { + .force_speed_100 = 1, +@@ -204,8 +198,6 @@ static struct board_info __initdata boar + static struct board_info __initdata board_96345gw2 = { + .name = "96345GW2", + .expected_cpu_id = 0x6345, +- +- .has_uart0 = 1, + }; + #endif + +@@ -217,7 +209,6 @@ static struct board_info __initdata boar + .name = "96348R", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, +@@ -262,7 +253,6 @@ static struct board_info __initdata boar + .name = "96348GW-10", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -323,7 +313,6 @@ static struct board_info __initdata boar + .name = "96348GW-11", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -378,7 +367,6 @@ static struct board_info __initdata boar + .name = "96348GW", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -437,7 +425,6 @@ static struct board_info __initdata boar + .name = "F@ST2404", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -482,7 +469,6 @@ static struct board_info __initdata boar + .name = "DV201AMR", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, +@@ -503,7 +489,6 @@ static struct board_info __initdata boar + .name = "96348GW-A", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -530,7 +515,6 @@ static struct board_info __initdata boar + .name = "96358VW", + .expected_cpu_id = 0x6358, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -583,7 +567,6 @@ static struct board_info __initdata boar + .name = "96358VW2", + .expected_cpu_id = 0x6358, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -633,7 +616,6 @@ static struct board_info __initdata boar + .name = "AGPF-S0", + .expected_cpu_id = 0x6358, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, diff --git a/target/linux/brcm63xx/patches-4.4/550-MIPS-BCM63XX-remove-leds-and-buttons.patch b/target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch similarity index 85% rename from target/linux/brcm63xx/patches-4.4/550-MIPS-BCM63XX-remove-leds-and-buttons.patch rename to target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch index 2ae8107ac..1bbbf9144 100644 --- a/target/linux/brcm63xx/patches-4.4/550-MIPS-BCM63XX-remove-leds-and-buttons.patch +++ b/target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch @@ -9,7 +9,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -47,14 +47,6 @@ static struct board_info __initdata boar +@@ -43,14 +43,6 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, @@ -24,10 +24,11 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons .ephy_reset_gpio = 36, .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, }; -@@ -78,35 +70,6 @@ static struct board_info __initdata boar +@@ -72,35 +64,6 @@ static struct board_info __initdata boar + .use_fullspeed = 0, .port_no = 0, }, - +- - .leds = { - { - .name = "96328avng::ppp-fail", @@ -56,11 +57,10 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - .active_low = 1, - }, - }, -- - .has_enetsw = 1, + }; + #endif - .enetsw = { -@@ -445,35 +408,6 @@ static struct board_info __initdata boar +@@ -119,35 +82,6 @@ static struct board_info __initdata boar }, .has_ohci0 = 1, @@ -96,7 +96,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96338w = { -@@ -488,35 +422,6 @@ static struct board_info __initdata boar +@@ -159,35 +93,6 @@ static struct board_info __initdata boar .force_speed_100 = 1, .force_duplex_full = 1, }, @@ -130,9 +130,9 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, - }, }; + #endif - static struct board_info __initdata board_96338w2_e7t = { -@@ -615,36 +520,6 @@ static struct board_info __initdata boar +@@ -217,36 +122,6 @@ static struct board_info __initdata boar .has_phy = 1, .use_internal_phy = 1, }, @@ -169,7 +169,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96348gw_10 = { -@@ -679,35 +554,6 @@ static struct board_info __initdata boar +@@ -278,35 +153,6 @@ static struct board_info __initdata boar .cs = 2, .ext_irq = 2, }, @@ -205,7 +205,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96348gw_11 = { -@@ -736,35 +582,6 @@ static struct board_info __initdata boar +@@ -332,35 +178,6 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_pccard = 1, .has_ehci0 = 1, @@ -240,8 +240,8 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, }; - -@@ -897,35 +714,6 @@ static struct board_info __initdata boar + static struct board_info __initdata board_96348gw = { +@@ -390,35 +207,6 @@ static struct board_info __initdata boar .ext_irq = 2, .cs = 2, }, @@ -276,8 +276,8 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, }; - static struct board_info __initdata board_gw6200 = { -@@ -1262,33 +1050,6 @@ static struct board_info __initdata boar + static struct board_info __initdata board_FAST2404 = { +@@ -534,33 +322,6 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_pccard = 1, .has_ehci0 = 1, @@ -311,7 +311,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96358vw2 = { -@@ -1318,29 +1079,6 @@ static struct board_info __initdata boar +@@ -587,29 +348,6 @@ static struct board_info __initdata boar .has_pccard = 1, .has_ehci0 = 1, .num_usbh_ports = 2, @@ -340,4 +340,4 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, }; - static struct board_info __initdata board_CPVA642 = { + static struct board_info __initdata board_AGPFS0 = { diff --git a/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch b/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch index 334a93422..9227eb28a 100644 --- a/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch +++ b/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -99,6 +99,8 @@ void __init board_early_setup(const stru +@@ -98,6 +98,8 @@ void __init board_early_setup(const stru if (BCMCPU_IS_6348()) val |= GPIO_MODE_6348_G3_EXT_MII | GPIO_MODE_6348_G0_EXT_MII; diff --git a/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch b/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch index a1acd614a..7c2b686a9 100644 --- a/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch +++ b/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -871,10 +871,8 @@ static int bcm_enet_open(struct net_devi +@@ -870,10 +870,8 @@ static int bcm_enet_open(struct net_devi struct bcm_enet_priv *priv; struct sockaddr addr; struct device *kdev; @@ -26,7 +26,7 @@ Signed-off-by: Jonas Gorski void *p; u32 val; -@@ -882,40 +880,10 @@ static int bcm_enet_open(struct net_devi +@@ -881,40 +879,10 @@ static int bcm_enet_open(struct net_devi kdev = &priv->pdev->dev; if (priv->has_phy) { @@ -68,7 +68,7 @@ Signed-off-by: Jonas Gorski } /* mask all interrupts and request them */ -@@ -925,7 +893,7 @@ static int bcm_enet_open(struct net_devi +@@ -924,7 +892,7 @@ static int bcm_enet_open(struct net_devi ret = request_irq(dev->irq, bcm_enet_isr_mac, 0, dev->name, dev); if (ret) @@ -100,7 +100,7 @@ Signed-off-by: Jonas Gorski return 0; } -@@ -1830,6 +1789,8 @@ static int bcm_enet_probe(struct platfor +@@ -1832,6 +1791,8 @@ static int bcm_enet_probe(struct platfor /* MII bus registration */ if (priv->has_phy) { @@ -109,7 +109,7 @@ Signed-off-by: Jonas Gorski priv->mii_bus = mdiobus_alloc(); if (!priv->mii_bus) { -@@ -1867,6 +1828,38 @@ static int bcm_enet_probe(struct platfor +@@ -1869,6 +1830,38 @@ static int bcm_enet_probe(struct platfor dev_err(&pdev->dev, "unable to register mdio bus\n"); goto out_free_mdio; } @@ -148,7 +148,7 @@ Signed-off-by: Jonas Gorski } else { /* run platform code to initialize PHY device */ -@@ -1912,6 +1905,9 @@ static int bcm_enet_probe(struct platfor +@@ -1914,6 +1907,9 @@ static int bcm_enet_probe(struct platfor return 0; out_unregister_mdio: @@ -158,7 +158,7 @@ Signed-off-by: Jonas Gorski if (priv->mii_bus) mdiobus_unregister(priv->mii_bus); -@@ -1953,6 +1949,8 @@ static int bcm_enet_remove(struct platfo +@@ -1951,6 +1947,8 @@ static int bcm_enet_remove(struct platfo enet_writel(priv, 0, ENET_MIISC_REG); if (priv->has_phy) { diff --git a/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch b/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch index 1cff9c1ff..cf3715e4f 100644 --- a/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch +++ b/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch @@ -32,7 +32,7 @@ Subject: [PATCH 54/81] bcm63xx_enet: enable rgmii clock on external ports #define ENETSW_MDIOC_EXT_MASK (1 << 16) --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2229,6 +2229,18 @@ static int bcm_enetsw_open(struct net_de +@@ -2223,6 +2223,18 @@ static int bcm_enetsw_open(struct net_de priv->sw_port_link[i] = 0; } diff --git a/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch b/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch index 6dab40d7e..608ad8e39 100644 --- a/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch +++ b/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch @@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/dev-flash.c +++ b/arch/mips/bcm63xx/dev-flash.c -@@ -17,9 +17,13 @@ +@@ -17,6 +17,9 @@ #include #include #include @@ -21,11 +21,7 @@ Signed-off-by: Jonas Gorski #include #include -+#include - #include - #include - -@@ -66,6 +70,41 @@ void __init bcm63xx_flash_force_phys_bas +@@ -66,6 +69,41 @@ void __init bcm63xx_flash_force_phys_bas mtd_resources[0].end = end; } @@ -67,7 +63,7 @@ Signed-off-by: Jonas Gorski static int __init bcm63xx_detect_flash_type(void) { u32 val; -@@ -73,9 +112,15 @@ static int __init bcm63xx_detect_flash_t +@@ -73,9 +111,15 @@ static int __init bcm63xx_detect_flash_t switch (bcm63xx_get_cpu_id()) { case BCM6318_CPU_ID: /* only support serial flash */ @@ -83,7 +79,7 @@ Signed-off-by: Jonas Gorski if (val & STRAPBUS_6328_BOOT_SEL_SERIAL) return BCM63XX_FLASH_TYPE_SERIAL; else -@@ -94,12 +139,20 @@ static int __init bcm63xx_detect_flash_t +@@ -94,12 +138,20 @@ static int __init bcm63xx_detect_flash_t return BCM63XX_FLASH_TYPE_SERIAL; case BCM6362_CPU_ID: val = bcm_misc_readl(MISC_STRAPBUS_6362_REG); @@ -104,7 +100,7 @@ Signed-off-by: Jonas Gorski switch (val & STRAPBUS_6368_BOOT_SEL_MASK) { case STRAPBUS_6368_BOOT_SEL_NAND: return BCM63XX_FLASH_TYPE_NAND; -@@ -110,6 +163,11 @@ static int __init bcm63xx_detect_flash_t +@@ -110,6 +162,11 @@ static int __init bcm63xx_detect_flash_t } case BCM63268_CPU_ID: val = bcm_misc_readl(MISC_STRAPBUS_63268_REG); @@ -116,7 +112,7 @@ Signed-off-by: Jonas Gorski if (val & STRAPBUS_63268_BOOT_SEL_SERIAL) return BCM63XX_FLASH_TYPE_SERIAL; else -@@ -176,6 +234,7 @@ void __init bcm63xx_flash_detect(void) +@@ -176,6 +233,7 @@ void __init bcm63xx_flash_detect(void) int __init bcm63xx_flash_register(void) { @@ -124,7 +120,7 @@ Signed-off-by: Jonas Gorski u32 val; switch (flash_type) { -@@ -195,8 +254,14 @@ int __init bcm63xx_flash_register(void) +@@ -195,8 +253,14 @@ int __init bcm63xx_flash_register(void) return platform_device_register(&mtd_dev); case BCM63XX_FLASH_TYPE_SERIAL: diff --git a/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch b/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch index d86e6a05f..a0ad6e6ce 100644 --- a/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch +++ b/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch @@ -10,7 +10,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -33,6 +33,7 @@ +@@ -32,6 +32,7 @@ #include #include #include @@ -18,7 +18,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data #include "board_common.h" -@@ -179,6 +180,7 @@ static struct of_device_id of_ids[] = { +@@ -178,6 +179,7 @@ static struct of_device_id of_ids[] = { int __init board_register_devices(void) { int usbh_ports = 0; @@ -26,7 +26,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data #if CONFIG_OF if (of_have_populated_dt()) { -@@ -252,6 +254,10 @@ int __init board_register_devices(void) +@@ -245,6 +247,10 @@ int __init board_register_devices(void) board.ephy_reset_gpio_flags); } @@ -59,9 +59,9 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data /* * board definition */ -@@ -36,6 +42,10 @@ struct board_info { - unsigned int has_uart0:1; - unsigned int has_uart1:1; +@@ -34,6 +40,10 @@ struct board_info { + unsigned int has_usbd:1; + unsigned int has_dsp:1; unsigned int use_fallback_sprom:1; + unsigned int has_caldata:2; + diff --git a/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch b/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch index 9eb4e5e09..94c63c5e8 100644 --- a/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch +++ b/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch @@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/dev-flash.c +++ b/arch/mips/bcm63xx/dev-flash.c -@@ -271,3 +271,8 @@ int __init bcm63xx_flash_register(void) +@@ -270,3 +270,8 @@ int __init bcm63xx_flash_register(void) return -ENODEV; } } diff --git a/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch b/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch index 7d012167c..0f6706a6b 100644 --- a/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch +++ b/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch @@ -15,7 +15,7 @@ Subject: [PATCH 61/72] BCM63XX: add a fixup for ath9k devices +++ b/arch/mips/bcm63xx/Makefile @@ -2,7 +2,7 @@ obj-y += clk.o cpu.o cs.o gpio.o irq.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-pcmcia.o dev-rng.o \ dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ - usb-common.o sprom.o + pci-ath9k-fixup.o usb-common.o sprom.o @@ -24,7 +24,7 @@ Subject: [PATCH 61/72] BCM63XX: add a fixup for ath9k devices obj-y += boards/ --- /dev/null +++ b/arch/mips/bcm63xx/pci-ath9k-fixup.c -@@ -0,0 +1,201 @@ +@@ -0,0 +1,200 @@ +/* + * Broadcom BCM63XX Ath9k EEPROM fixup helper. + * @@ -52,7 +52,6 @@ Subject: [PATCH 61/72] BCM63XX: add a fixup for ath9k devices +#include +#include +#include -+#include +#include + +#define bcm_hsspi_writel(v, o) bcm_rset_writel(RSET_HSSPI, (v), (o)) diff --git a/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch b/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch index f314e018f..8921f2d9b 100644 --- a/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch +++ b/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch @@ -21,7 +21,7 @@ /* --- a/arch/mips/bcm63xx/pci-ath9k-fixup.c +++ b/arch/mips/bcm63xx/pci-ath9k-fixup.c -@@ -183,12 +183,14 @@ static void ath9k_pci_fixup(struct pci_d +@@ -182,12 +182,14 @@ static void ath9k_pci_fixup(struct pci_d } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID, ath9k_pci_fixup); @@ -39,7 +39,7 @@ return; --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -256,7 +256,8 @@ int __init board_register_devices(void) +@@ -249,7 +249,8 @@ int __init board_register_devices(void) /* register any fixups */ for (i = 0; i < board.has_caldata; i++) diff --git a/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch b/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch index ccd3160a3..3ccf6dcdf 100644 --- a/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch +++ b/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -257,7 +257,7 @@ int __init board_register_devices(void) +@@ -250,7 +250,7 @@ int __init board_register_devices(void) /* register any fixups */ for (i = 0; i < board.has_caldata; i++) pci_enable_ath9k_fixup(board.caldata[i].slot, board.caldata[i].caldata_offset, @@ -11,7 +11,7 @@ } --- a/arch/mips/bcm63xx/pci-ath9k-fixup.c +++ b/arch/mips/bcm63xx/pci-ath9k-fixup.c -@@ -184,13 +184,15 @@ static void ath9k_pci_fixup(struct pci_d +@@ -183,13 +183,15 @@ static void ath9k_pci_fixup(struct pci_d DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID, ath9k_pci_fixup); void __init pci_enable_ath9k_fixup(unsigned slot, u32 offset, diff --git a/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch b/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch index 5731cb34a..d021b3690 100644 --- a/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch +++ b/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch @@ -19,7 +19,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices +++ b/arch/mips/bcm63xx/Makefile @@ -2,7 +2,7 @@ obj-y += clk.o cpu.o cs.o gpio.o irq.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-pcmcia.o dev-rng.o \ dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ - pci-ath9k-fixup.o usb-common.o sprom.o + pci-ath9k-fixup.o pci-rt2x00-fixup.o usb-common.o sprom.o @@ -28,7 +28,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices obj-y += boards/ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -34,6 +34,7 @@ +@@ -33,6 +33,7 @@ #include #include #include @@ -36,7 +36,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices #include "board_common.h" -@@ -255,9 +256,19 @@ int __init board_register_devices(void) +@@ -248,9 +249,19 @@ int __init board_register_devices(void) } /* register any fixups */ @@ -162,7 +162,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices }; /* -@@ -48,7 +53,7 @@ struct board_info { +@@ -46,7 +51,7 @@ struct board_info { unsigned int has_caldata:2; /* wifi calibration data config */ diff --git a/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch b/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch index 19d790511..c905cb2d4 100644 --- a/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch +++ b/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h -@@ -336,6 +336,9 @@ struct bcm_enet_priv { +@@ -335,6 +335,9 @@ struct bcm_enet_priv { struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT]; int sw_port_link[ENETSW_MAX_PORT]; @@ -12,15 +12,15 @@ spinlock_t enetsw_mdio_lock; --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -31,6 +31,7 @@ +@@ -30,6 +30,7 @@ + #include #include #include - #include +#include #include #include "bcm63xx_enet.h" -@@ -1974,7 +1975,8 @@ static int bcm_enet_remove(struct platfo +@@ -1968,7 +1969,8 @@ static int bcm_enet_remove(struct platfo return 0; } @@ -30,7 +30,7 @@ .probe = bcm_enet_probe, .remove = bcm_enet_remove, .driver = { -@@ -1983,6 +1985,42 @@ struct platform_driver bcm63xx_enet_driv +@@ -1977,6 +1979,42 @@ struct platform_driver bcm63xx_enet_driv }, }; @@ -73,7 +73,7 @@ /* * switch mii access callbacks */ -@@ -2241,29 +2279,6 @@ static int bcm_enetsw_open(struct net_de +@@ -2235,29 +2273,6 @@ static int bcm_enetsw_open(struct net_de enetsw_writeb(priv, rgmii_ctrl, ENETSW_RGMII_CTRL_REG(i)); } @@ -103,7 +103,7 @@ /* initialize flow control buffer allocation */ enet_dma_writel(priv, ENETDMA_BUFALLOC_FORCE_MASK | 0, ENETDMA_BUFALLOC_REG(priv->rx_chan)); -@@ -2722,6 +2737,9 @@ static int bcm_enetsw_probe(struct platf +@@ -2716,6 +2731,9 @@ static int bcm_enetsw_probe(struct platf struct bcm63xx_enetsw_platform_data *pd; struct resource *res_mem; int ret, irq_rx, irq_tx; @@ -111,9 +111,9 @@ + u16 port_mask = BIT(8); + u8 val; - /* stop if shared driver failed, assume driver->probe will be - * called in the same order we register devices (correct ?) -@@ -2811,6 +2829,43 @@ static int bcm_enetsw_probe(struct platf + if (!bcm_enet_shared_base[0]) + return -EPROBE_DEFER; +@@ -2798,6 +2816,43 @@ static int bcm_enetsw_probe(struct platf priv->pdev = pdev; priv->net_dev = dev; @@ -156,14 +156,14 @@ + return 0; - out_put_clk: -@@ -2839,6 +2894,9 @@ static int bcm_enetsw_remove(struct plat + out_disable_clk: +@@ -2819,6 +2874,9 @@ static int bcm_enetsw_remove(struct plat priv = netdev_priv(dev); unregister_netdev(dev); + /* remove switch */ + bcmenet_switch_unregister(priv); + - /* release device resources */ - iounmap(priv->base); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + clk_disable_unprepare(priv->mac_clk); + + free_netdev(dev); diff --git a/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch b/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch index 24dd27a29..f1c7589c4 100644 --- a/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch +++ b/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch @@ -1,15 +1,15 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2784,12 +2784,6 @@ static int bcm_enetsw_probe(struct platf +@@ -2775,9 +2775,9 @@ 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; -- goto out; -- } -- - priv->base = ioremap(res_mem->start, resource_size(res_mem)); - if (priv->base == NULL) { - ret = -ENOMEM; +- priv->base = devm_ioremap_resource(&pdev->dev, res_mem); +- if (IS_ERR(priv->base)) { +- ret = PTR_ERR(priv->base); ++ priv->base = devm_ioremap(&pdev->dev, res_mem->start, resource_size(res_mem)); ++ if (priv->base == NULL) { ++ ret = -ENOMEM; + goto out; + } + diff --git a/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch b/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch index 4c4eb7d67..ec03e4cee 100644 --- a/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch +++ b/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -119,6 +119,8 @@ static struct board_info __initdata boar - .has_uart0 = 1, +@@ -77,6 +77,8 @@ static struct board_info __initdata boar + .has_enet0 = 1, .enet0 = { + .has_phy = 1, @@ -9,8 +9,8 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -162,6 +164,8 @@ static struct board_info __initdata boar - .has_uart0 = 1, +@@ -90,6 +92,8 @@ static struct board_info __initdata boar + .has_enet0 = 1, .enet0 = { + .has_phy = 1, @@ -18,7 +18,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -273,6 +277,8 @@ static struct board_info __initdata boar +@@ -138,6 +142,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -27,7 +27,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -335,6 +341,8 @@ static struct board_info __initdata boar +@@ -170,6 +176,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -36,7 +36,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -389,6 +397,8 @@ static struct board_info __initdata boar +@@ -194,6 +202,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -45,7 +45,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -449,6 +459,8 @@ static struct board_info __initdata boar +@@ -224,6 +234,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -54,7 +54,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -472,6 +484,8 @@ static struct board_info __initdata boar +@@ -247,6 +259,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -63,16 +63,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -491,6 +505,8 @@ static struct board_info __initdata boar - .has_enet1 = 1, - .enet0 = { - .has_phy = 1, -+ .phy_id = 0, -+ .has_phy = 1, - .use_internal_phy = 1, - }, - .enet1 = { -@@ -514,6 +530,8 @@ static struct board_info __initdata boar +@@ -268,6 +282,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -81,7 +72,16 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -542,6 +560,8 @@ static struct board_info __initdata boar +@@ -287,6 +303,8 @@ static struct board_info __initdata boar + .use_internal_phy = 1, + }, + .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, + .force_speed_100 = 1, + .force_duplex_full = 1, + }, +@@ -314,6 +332,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -90,7 +90,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -595,6 +615,8 @@ static struct board_info __initdata boar +@@ -339,6 +359,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -99,7 +99,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -644,6 +666,8 @@ static struct board_info __initdata boar +@@ -364,6 +386,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -108,7 +108,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -667,6 +691,8 @@ static struct board_info __initdata boar +@@ -387,6 +411,8 @@ static struct board_info __initdata boar }, .enet1 = { diff --git a/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch b/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch index 98292d539..ad9c5b30e 100644 --- a/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch +++ b/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -57,7 +57,7 @@ static struct board_info __initdata boar +@@ -46,7 +46,7 @@ static struct board_info __initdata boar .ephy_reset_gpio = 36, .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, }; @@ -9,8 +9,8 @@ /* * known 6328 boards -@@ -106,7 +106,7 @@ static struct board_info __initdata boar - }, +@@ -65,7 +65,7 @@ static struct board_info __initdata boar + .port_no = 0, }, }; -#endif @@ -18,8 +18,8 @@ /* * known 6338 boards -@@ -199,7 +199,7 @@ static struct board_info __initdata boar - }, +@@ -98,7 +98,7 @@ static struct board_info __initdata boar + .force_duplex_full = 1, }, }; -#endif @@ -27,16 +27,16 @@ /* * known 6345 boards -@@ -211,7 +211,7 @@ static struct board_info __initdata boar - - .has_uart0 = 1, +@@ -108,7 +108,7 @@ static struct board_info __initdata boar + .name = "96345GW2", + .expected_cpu_id = 0x6345, }; -#endif +#endif /* CONFIG_BCM63XX_CPU_6345 */ /* * known 6348 boards -@@ -538,7 +538,7 @@ static struct board_info __initdata boar +@@ -311,7 +311,7 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -45,7 +45,7 @@ /* * known 6358 boards -@@ -699,7 +699,7 @@ static struct board_info __initdata boar +@@ -419,7 +419,7 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; diff --git a/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch b/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch index c2b2d330a..31757c464 100644 --- a/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch +++ b/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -538,6 +538,22 @@ static struct board_info __initdata boar +@@ -311,6 +311,21 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -11,7 +11,6 @@ + + .has_enet1 = 1, + .has_pci = 1, -+ .has_uart0 = 1, + + .enet1 = { + .has_phy = 1, @@ -23,7 +22,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -727,6 +743,7 @@ static const struct board_info __initcon +@@ -447,6 +462,7 @@ static const struct board_info __initcon &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, @@ -31,7 +30,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -758,6 +775,7 @@ static struct of_device_id const bcm963x +@@ -478,6 +494,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, diff --git a/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch b/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch index c55221cf9..fe228c6b0 100644 --- a/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch +++ b/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -715,6 +715,62 @@ static struct board_info __initdata boar +@@ -434,6 +434,60 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -9,7 +9,6 @@ + .name = "NB4-SER-r0", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -37,7 +36,6 @@ + .name = "NB4-FXC-r1", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -63,7 +61,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -751,6 +807,8 @@ static const struct board_info __initcon +@@ -470,6 +524,8 @@ static const struct board_info __initcon &board_96358vw2, &board_AGPFS0, &board_DWVS0, @@ -72,7 +70,7 @@ #endif }; -@@ -792,6 +850,8 @@ static struct of_device_id const bcm963x +@@ -511,6 +567,8 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,a226m", .data = &board_DWVS0, }, { .compatible = "pirelli,a226m-fwb", .data = &board_DWVS0, }, { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, diff --git a/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch b/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch index e4036b25c..64edf76e5 100644 --- a/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch +++ b/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -199,6 +199,20 @@ static struct board_info __initdata boar - }, +@@ -98,6 +98,20 @@ static struct board_info __initdata boar + .force_duplex_full = 1, }, }; + @@ -21,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -786,6 +800,7 @@ static const struct board_info __initcon +@@ -503,6 +517,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, &board_96338w, @@ -29,7 +29,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -823,6 +838,7 @@ static struct of_device_id const bcm963x +@@ -540,6 +555,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch b/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch index d38aa3405..2639aa6fd 100644 --- a/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch +++ b/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch @@ -1,14 +1,13 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -681,6 +681,26 @@ static struct board_info __initdata boar - }, +@@ -401,6 +401,25 @@ static struct board_info __initdata boar + .num_usbh_ports = 2, }; +static struct board_info __initdata board_CPVA642 = { + .name = "CPVA642", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -27,7 +26,7 @@ static struct board_info __initdata board_AGPFS0 = { .name = "AGPF-S0", .expected_cpu_id = 0x6358, -@@ -821,6 +841,7 @@ static const struct board_info __initcon +@@ -538,6 +557,7 @@ static const struct board_info __initcon &board_96358vw, &board_96358vw2, &board_AGPFS0, @@ -35,7 +34,7 @@ &board_DWVS0, &board_nb4_ser_r0, &board_nb4_fxc_r1, -@@ -868,6 +889,7 @@ static struct of_device_id const bcm963x +@@ -585,6 +605,7 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, { .compatible = "sfr,nb4-ser-r0", .data = &board_nb4_ser_r0, }, { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, diff --git a/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch b/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch index 032085fde..c125b3e0a 100644 --- a/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch +++ b/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -750,6 +750,23 @@ static struct board_info __initdata boar +@@ -468,6 +468,22 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -9,7 +9,6 @@ + .name = "AW4139", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -24,7 +23,7 @@ static struct board_info __initdata board_nb4_ser_r0 = { .name = "NB4-SER-r0", .expected_cpu_id = 0x6358, -@@ -843,6 +860,7 @@ static const struct board_info __initcon +@@ -559,6 +575,7 @@ static const struct board_info __initcon &board_AGPFS0, &board_CPVA642, &board_DWVS0, @@ -32,7 +31,7 @@ &board_nb4_ser_r0, &board_nb4_fxc_r1, #endif -@@ -882,6 +900,7 @@ static struct of_device_id const bcm963x +@@ -598,6 +615,7 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch b/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch index a9847c1b7..c6bc4ec2d 100644 --- a/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch +++ b/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -568,6 +568,45 @@ static struct board_info __initdata boar +@@ -340,6 +340,44 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -17,7 +17,6 @@ + .name = "SPW500V", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, @@ -46,7 +45,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -852,6 +891,7 @@ static const struct board_info __initcon +@@ -567,6 +605,7 @@ static const struct board_info __initcon &board_96348gw_a, &board_rta1025w_16, &board_96348_D4PW, @@ -54,7 +53,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -893,6 +933,7 @@ static struct of_device_id const bcm963x +@@ -608,6 +647,7 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, { .compatible = "sagem,f@st2404", .data = &board_FAST2404, }, diff --git a/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch b/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch index 3bb22ba34..fb28302eb 100644 --- a/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch +++ b/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -457,6 +457,66 @@ static struct board_info __initdata boar +@@ -233,6 +233,64 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "GW6200", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -37,7 +36,6 @@ + .name = "GW6000", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -67,7 +65,7 @@ static struct board_info __initdata board_FAST2404 = { .name = "F@ST2404", .expected_cpu_id = 0x6348, -@@ -884,6 +944,8 @@ static const struct board_info __initcon +@@ -598,6 +656,8 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, &board_96348gw, @@ -76,7 +74,7 @@ &board_96348gw_10, &board_96348gw_11, &board_FAST2404, -@@ -934,6 +996,8 @@ static struct of_device_id const bcm963x +@@ -648,6 +708,8 @@ static struct of_device_id const bcm963x { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, { .compatible = "sagem,f@st2404", .data = &board_FAST2404, }, { .compatible = "t-com,spw500v", .data = &board_spw500v, }, diff --git a/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch b/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch index 198045b91..9ba7d8c23 100644 --- a/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch +++ b/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -667,6 +667,40 @@ static struct board_info __initdata boar +@@ -436,6 +436,39 @@ static struct board_info __initdata boar .num_board_fixups = ARRAY_SIZE(spw500v_fixups), }, }; @@ -9,7 +9,6 @@ + .name = "MAGIC", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -41,7 +40,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -954,6 +988,7 @@ static const struct board_info __initcon +@@ -666,6 +699,7 @@ static const struct board_info __initcon &board_rta1025w_16, &board_96348_D4PW, &board_spw500v, @@ -49,7 +48,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -998,6 +1033,7 @@ static struct of_device_id const bcm963x +@@ -710,6 +744,7 @@ static struct of_device_id const bcm963x { .compatible = "t-com,spw500v", .data = &board_spw500v, }, { .compatible = "tecom,gw6000", .data = &board_gw6000, }, { .compatible = "tecom,gw6200", .data = &board_gw6200, }, diff --git a/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch b/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch index 50a0dc7b6..34800672c 100644 --- a/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch +++ b/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -955,6 +955,34 @@ static struct board_info __initdata boar +@@ -666,6 +666,32 @@ static struct board_info __initdata boar .has_ehci0 = 1, .num_usbh_ports = 2, }; @@ -9,8 +9,6 @@ + .name = "HW553", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, -+ + .has_enet1 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, @@ -35,7 +33,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1000,6 +1028,7 @@ static const struct board_info __initcon +@@ -711,6 +737,7 @@ static const struct board_info __initcon &board_dsl_274xb_rev_c, &board_nb4_ser_r0, &board_nb4_fxc_r1, @@ -43,7 +41,7 @@ #endif }; -@@ -1043,6 +1072,7 @@ static struct of_device_id const bcm963x +@@ -754,6 +781,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch b/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch index b744c3138..f30dfbee1 100644 --- a/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch +++ b/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -213,6 +213,21 @@ static struct board_info __initdata boar +@@ -112,6 +112,20 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -9,7 +9,6 @@ + .name = "RTA1320_16M", + .expected_cpu_id = 0x6338, + -+ .has_uart0 = 1, + .has_enet0 = 1, + + .enet0 = { @@ -22,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -999,6 +1014,7 @@ static const struct board_info __initcon +@@ -708,6 +722,7 @@ static const struct board_info __initcon &board_96338gw, &board_96338w, &board_96338w2_e7t, @@ -30,7 +29,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -1043,6 +1059,7 @@ static struct of_device_id const bcm963x +@@ -752,6 +767,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch b/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch index 37dec2ce7..30ef4e051 100644 --- a/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch +++ b/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -998,6 +998,21 @@ static struct board_info __initdata boar +@@ -706,6 +706,20 @@ static struct board_info __initdata boar .pci_dev = 1, }, }; @@ -10,7 +10,6 @@ + .name = "96358-502V", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_pci = 1, + @@ -22,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1045,6 +1060,7 @@ static const struct board_info __initcon +@@ -753,6 +767,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_HW553, @@ -30,7 +29,7 @@ #endif }; -@@ -1096,6 +1112,7 @@ static struct of_device_id const bcm963x +@@ -804,6 +819,7 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, { .compatible = "sfr,nb4-ser-r0", .data = &board_nb4_ser_r0, }, { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, diff --git a/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch b/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch index 3ac6c1800..46909b073 100644 --- a/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch +++ b/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -716,6 +716,27 @@ static struct board_info __initdata boar +@@ -483,6 +483,26 @@ static struct board_info __initdata boar .ext_irq = 2, }, }; @@ -9,7 +9,6 @@ + .name = "V2500V_BB", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -28,7 +27,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -1048,6 +1069,7 @@ static const struct board_info __initcon +@@ -755,6 +775,7 @@ static const struct board_info __initcon &board_96348_D4PW, &board_spw500v, &board_96348sv, @@ -36,7 +35,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1087,6 +1109,7 @@ static struct of_device_id const bcm963x +@@ -794,6 +815,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, @@ -44,7 +43,7 @@ { .compatible = "d-link,dsl-2640b-b", .data = &board_96348_D4PW, }, { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, }, { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, -@@ -1146,6 +1169,22 @@ void __init board_bcm963xx_init(void) +@@ -853,6 +875,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); @@ -76,8 +75,8 @@ +#include #include #include - #include -@@ -248,6 +249,13 @@ int __init bcm63xx_flash_register(void) + #include +@@ -247,6 +248,13 @@ int __init bcm63xx_flash_register(void) val = bcm_mpi_readl(MPI_CSBASE_REG(0)); val &= MPI_CSBASE_BASE_MASK; diff --git a/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch b/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch index a3e24049b..f58e294eb 100644 --- a/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch +++ b/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -411,6 +411,25 @@ static struct board_info __initdata boar - }, +@@ -216,6 +216,24 @@ static struct board_info __initdata boar + .has_ehci0 = 1, }; + @@ -10,7 +10,6 @@ + .name = "V2110", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -26,7 +25,7 @@ static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -1070,6 +1089,7 @@ static const struct board_info __initcon +@@ -776,6 +794,7 @@ static const struct board_info __initcon &board_spw500v, &board_96348sv, &board_V2500V_BB, @@ -34,7 +33,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1109,6 +1129,7 @@ static struct of_device_id const bcm963x +@@ -815,6 +834,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, diff --git a/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch b/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch index 28462e059..769be5a17 100644 --- a/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch +++ b/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch @@ -33,7 +33,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support +obj-$(CONFIG_BOARD_LIVEBOX) += board_livebox.o --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -56,7 +56,7 @@ void __init board_prom_init(void) +@@ -55,7 +55,7 @@ void __init board_prom_init(void) if (fw_arg3 == CFE_EPTSEAL) board_bcm963xx_init(); else @@ -57,7 +57,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support #endif /* __BOARD_COMMON_H */ --- /dev/null +++ b/arch/mips/bcm63xx/boards/board_livebox.c -@@ -0,0 +1,164 @@ +@@ -0,0 +1,163 @@ +/* + * 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 @@ -92,7 +92,6 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support + .name = "Livebox-blue-5g", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, diff --git a/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch b/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch index b3b9125a9..d111d97d6 100644 --- a/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch +++ b/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -430,6 +430,34 @@ static struct board_info __initdata boar +@@ -234,6 +234,33 @@ static struct board_info __initdata boar }; @@ -8,7 +8,6 @@ + .name = "CT536_CT5621", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 0, + .has_enet1 = 1, + .has_pci = 1, @@ -35,7 +34,7 @@ static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -1090,6 +1118,7 @@ static const struct board_info __initcon +@@ -795,6 +822,7 @@ static const struct board_info __initcon &board_96348sv, &board_V2500V_BB, &board_V2110, @@ -43,7 +42,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1131,6 +1160,8 @@ static struct of_device_id const bcm963x +@@ -836,6 +864,8 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, { .compatible = "bt,v2110", .data = &board_V2110, }, { .compatible = "bt,v2500v-bb", .data = &board_V2500V_BB, }, diff --git a/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch b/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch index c2cef899f..8e053b293 100644 --- a/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch +++ b/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch @@ -1,15 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -946,6 +946,8 @@ static struct board_info __initdata boar - .name = "DWV-S0", - .expected_cpu_id = 0x6358, - -+ .has_uart0 = 1, -+ - .has_enet0 = 1, - .has_enet1 = 1, - .has_pci = 1, -@@ -964,6 +966,7 @@ static struct board_info __initdata boar +@@ -674,6 +674,7 @@ static struct board_info __initdata boar }, .has_ohci0 = 1, diff --git a/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch b/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch index 5eea5369a..29dc2620d 100644 --- a/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch +++ b/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -458,6 +458,31 @@ static struct board_info __initdata boar +@@ -261,6 +261,30 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "96348A-122", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, @@ -32,7 +31,7 @@ static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -1122,6 +1147,7 @@ static const struct board_info __initcon +@@ -824,6 +848,7 @@ static const struct board_info __initcon &board_V2500V_BB, &board_V2110, &board_ct536_ct5621, @@ -40,7 +39,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1164,6 +1190,7 @@ static struct of_device_id const bcm963x +@@ -866,6 +891,7 @@ static struct of_device_id const bcm963x { .compatible = "bt,v2110", .data = &board_V2110, }, { .compatible = "bt,v2500v-bb", .data = &board_V2500V_BB, }, { .compatible = "comtrend,ct-536+", .data = &board_ct536_ct5621, }, diff --git a/target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch b/target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch deleted file mode 100644 index 9b637fcca..000000000 --- a/target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -635,6 +635,7 @@ static struct board_info __initdata boar - .name = "RTA1025W_16", - .expected_cpu_id = 0x6348, - -+ .has_uart0 = 1, - .has_enet0 = 1, - .has_enet1 = 1, - .has_pci = 1, diff --git a/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch b/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch index 5dc69e468..5af1060df 100644 --- a/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch +++ b/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -429,6 +429,34 @@ static struct board_info __initdata boar +@@ -233,6 +233,33 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "CPVA502+", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -35,7 +34,7 @@ static struct board_info __initdata board_ct536_ct5621 = { .name = "CT536_CT5621", -@@ -1149,6 +1177,7 @@ static const struct board_info __initcon +@@ -849,6 +876,7 @@ static const struct board_info __initcon &board_V2110, &board_ct536_ct5621, &board_96348A_122, @@ -43,7 +42,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1201,6 +1230,7 @@ static struct of_device_id const bcm963x +@@ -901,6 +929,7 @@ static struct of_device_id const bcm963x { .compatible = "t-com,spw500v", .data = &board_spw500v, }, { .compatible = "tecom,gw6000", .data = &board_gw6000, }, { .compatible = "tecom,gw6200", .data = &board_gw6200, }, diff --git a/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch b/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch index 0175104d3..31002842f 100644 --- a/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch +++ b/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch @@ -10,7 +10,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1141,6 +1141,59 @@ static struct board_info __initdata boar +@@ -840,6 +840,58 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6358 */ /* @@ -21,7 +21,6 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. + .name = "96368MVWG", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_usbd = 1, @@ -70,7 +69,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -1192,6 +1245,10 @@ static const struct board_info __initcon +@@ -891,6 +943,10 @@ static const struct board_info __initcon &board_HW553, &board_spw303v, #endif @@ -81,7 +80,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1252,6 +1309,7 @@ static struct of_device_id const bcm963x +@@ -951,6 +1007,7 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 @@ -91,7 +90,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. #endif --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -83,12 +83,25 @@ void __init board_early_setup(const stru +@@ -82,12 +82,25 @@ void __init board_early_setup(const stru bcm63xx_pci_enabled = 1; if (BCMCPU_IS_6348()) val |= GPIO_MODE_6348_G2_PCI; diff --git a/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch b/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch index 0a5cd6c5b..f719c2428 100644 --- a/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch +++ b/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch @@ -9,7 +9,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1191,6 +1191,46 @@ static struct board_info __initdata boar +@@ -889,6 +889,45 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -18,7 +18,6 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. + .name = "96368MVNgr", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_enetsw = 1, + @@ -56,7 +55,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. #endif /* CONFIG_BCM63XX_CPU_6368 */ /* -@@ -1248,6 +1288,7 @@ static const struct board_info __initcon +@@ -946,6 +985,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, @@ -64,7 +63,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. #endif }; -@@ -1309,6 +1350,7 @@ static struct of_device_id const bcm963x +@@ -1007,6 +1047,7 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch b/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch index 030382bb8..e482b2093 100644 --- a/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch +++ b/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch @@ -9,9 +9,9 @@ Subject: [PATCH] MIPS: BCM63XX: add 96328avng reference board --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -105,6 +105,33 @@ static struct board_info __initdata boar - .active_low = 1, - }, +@@ -64,6 +64,33 @@ static struct board_info __initdata boar + .use_fullspeed = 0, + .port_no = 0, }, + + .has_enetsw = 1, diff --git a/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch b/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch index d6f732a88..c0f235bee 100644 --- a/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch +++ b/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch @@ -9,7 +9,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -133,6 +133,41 @@ static struct board_info __initdata boar +@@ -92,6 +92,40 @@ static struct board_info __initdata boar }, }, }; @@ -18,7 +18,6 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board + .name = "963281TAN", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_enetsw = 1, @@ -51,7 +50,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1269,6 +1304,7 @@ static const struct board_info __initcon +@@ -966,6 +1000,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -59,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1325,6 +1361,7 @@ static struct of_device_id const bcm963x +@@ -1022,6 +1057,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, #endif #ifdef CONFIG_BCM63XX_CPU_6328 diff --git a/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch b/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch index f89f01f99..e3be8926d 100644 --- a/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch +++ b/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch @@ -10,7 +10,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -168,6 +168,52 @@ static struct board_info __initdata boar +@@ -126,6 +126,51 @@ static struct board_info __initdata boar }, }, }; @@ -19,7 +19,6 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link + .name = "AW4339U", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_caldata = 1, @@ -63,7 +62,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1305,6 +1351,7 @@ static const struct board_info __initcon +@@ -1001,6 +1046,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_963281TAN, @@ -71,7 +70,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1363,6 +1410,7 @@ static struct of_device_id const bcm963x +@@ -1059,6 +1105,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6328 { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch b/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch index 7f9b3caa4..8fd0e85b6 100644 --- a/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch +++ b/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -837,6 +837,25 @@ static struct board_info __initdata boar +@@ -600,6 +600,24 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -9,7 +9,6 @@ + .name = "96348W3", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -26,7 +25,7 @@ static struct board_info __initdata board_96348_D4PW = { .name = "D-4P-W", .expected_cpu_id = 0x6348, -@@ -1381,6 +1400,7 @@ static const struct board_info __initcon +@@ -1076,6 +1094,7 @@ static const struct board_info __initcon &board_ct536_ct5621, &board_96348A_122, &board_CPVA502plus, @@ -34,7 +33,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1436,6 +1456,7 @@ static struct of_device_id const bcm963x +@@ -1131,6 +1150,7 @@ static struct of_device_id const bcm963x { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, }, { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, diff --git a/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch b/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch index 52839a34a..f9257d29d 100644 --- a/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch +++ b/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1223,6 +1223,31 @@ static struct board_info __initdata boar +@@ -922,6 +922,30 @@ static struct board_info __initdata boar .num_usbh_ports = 2, }; @@ -8,7 +8,6 @@ + .name = "CT6373-1", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -32,7 +31,7 @@ static struct board_info __initdata board_HW553 = { .name = "HW553", .expected_cpu_id = 0x6358, -@@ -1412,6 +1437,7 @@ static const struct board_info __initcon +@@ -1106,6 +1130,7 @@ static const struct board_info __initcon &board_dsl_274xb_rev_c, &board_nb4_ser_r0, &board_nb4_fxc_r1, @@ -40,7 +39,7 @@ &board_HW553, &board_spw303v, #endif -@@ -1470,6 +1496,7 @@ static struct of_device_id const bcm963x +@@ -1164,6 +1189,7 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch b/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch index 7d211f973..6936fa4d5 100644 --- a/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch +++ b/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1290,6 +1290,36 @@ static struct board_info __initdata boar +@@ -985,6 +985,35 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, }; @@ -10,7 +10,6 @@ + .name = "DVAG3810BN", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -37,7 +36,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1440,6 +1470,7 @@ static const struct board_info __initcon +@@ -1133,6 +1162,7 @@ static const struct board_info __initcon &board_ct6373_1, &board_HW553, &board_spw303v, @@ -45,7 +44,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6368 -@@ -1499,6 +1530,7 @@ static struct of_device_id const bcm963x +@@ -1192,6 +1222,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ct-6373", .data = &board_ct6373_1, }, { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch b/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch index 915d48dea..55cc9ab86 100644 --- a/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch +++ b/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1322,6 +1322,34 @@ static struct board_info __initdata boar +@@ -1016,6 +1016,32 @@ static struct board_info __initdata boar }; #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -9,8 +9,6 @@ + .name = "NB6", + .expected_cpu_id = 0x6362, + -+ .has_uart0 = 1, -+ + .has_ohci0 = 1, + .has_ehci0 = 1, + .num_usbh_ports = 2, @@ -35,7 +33,7 @@ /* * known 6368 boards */ -@@ -1473,6 +1501,10 @@ static const struct board_info __initcon +@@ -1165,6 +1191,10 @@ static const struct board_info __initcon &board_DVAG3810BN, #endif @@ -46,7 +44,7 @@ #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, -@@ -1541,6 +1573,9 @@ static struct of_device_id const bcm963x +@@ -1233,6 +1263,9 @@ static struct of_device_id const bcm963x { .compatible = "t-com,spw303v", .data = &board_spw303v, }, { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif diff --git a/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch b/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch index 09cf1b7a9..2bca04aa8 100644 --- a/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch +++ b/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -767,6 +767,23 @@ static struct board_info __initdata boar +@@ -533,6 +533,22 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -8,7 +8,6 @@ + .name = "F@ST2604", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + @@ -24,7 +23,7 @@ static struct board_info __initdata board_rta1025w_16 = { .name = "RTA1025W_16", .expected_cpu_id = 0x6348, -@@ -1472,6 +1489,7 @@ static const struct board_info __initcon +@@ -1162,6 +1178,7 @@ static const struct board_info __initcon &board_96348gw_10, &board_96348gw_11, &board_FAST2404, @@ -32,7 +31,7 @@ &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, -@@ -1547,6 +1565,7 @@ static struct of_device_id const bcm963x +@@ -1237,6 +1254,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, { .compatible = "netgear,dg834g-v4", .data = &board_96348W3, }, { .compatible = "sagem,f@st2404", .data = &board_FAST2404, }, diff --git a/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch b/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch index 8094c3652..ec0695cc0 100644 --- a/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch +++ b/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -169,6 +169,50 @@ static struct board_info __initdata boar +@@ -127,6 +127,49 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "963281T_TEF", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -51,7 +50,7 @@ static struct board_info __initdata board_dsl_274xb_f1 = { .name = "AW4339U", .expected_cpu_id = 0x6328, -@@ -1470,6 +1514,7 @@ static const struct board_info __initcon +@@ -1159,6 +1202,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_963281TAN, @@ -59,7 +58,7 @@ &board_dsl_274xb_f1, #endif #ifdef CONFIG_BCM63XX_CPU_6338 -@@ -1535,6 +1580,7 @@ static struct of_device_id const bcm963x +@@ -1224,6 +1268,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, #endif #ifdef CONFIG_BCM63XX_CPU_6328 diff --git a/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch b/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch index 5cac3be43..d38cb3bb1 100644 --- a/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch +++ b/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -134,6 +134,79 @@ static struct board_info __initdata boar +@@ -93,6 +93,78 @@ static struct board_info __initdata boar }, }; @@ -35,7 +35,6 @@ + .name = "96328A-1441N1", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -80,7 +79,7 @@ static struct board_info __initdata board_963281TAN = { .name = "963281TAN", .expected_cpu_id = 0x6328, -@@ -1513,6 +1586,7 @@ static const struct board_info __initcon +@@ -1201,6 +1273,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -88,7 +87,7 @@ &board_963281TAN, &board_A4001N1, &board_dsl_274xb_f1, -@@ -1583,6 +1657,7 @@ static struct of_device_id const bcm963x +@@ -1271,6 +1344,7 @@ static struct of_device_id const bcm963x { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch b/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch index ef8b2200c..07015caaa 100644 --- a/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch +++ b/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -134,6 +134,61 @@ static struct board_info __initdata boar +@@ -93,6 +93,60 @@ static struct board_info __initdata boar }, }; @@ -17,7 +17,6 @@ + .name = "96328A-1241N", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -62,7 +61,7 @@ static struct sprom_fixup __initdata ar5387un_fixups[] = { { .offset = 2, .value = 0x05bb }, { .offset = 65, .value = 0x1204 }, -@@ -1586,6 +1641,7 @@ static const struct board_info __initcon +@@ -1273,6 +1327,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -70,7 +69,7 @@ &board_AR5387un, &board_963281TAN, &board_A4001N1, -@@ -1657,6 +1713,7 @@ static struct of_device_id const bcm963x +@@ -1344,6 +1399,7 @@ static struct of_device_id const bcm963x { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch b/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch index 61f3ee23a..3ac6161bc 100644 --- a/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch +++ b/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch @@ -1,16 +1,14 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -520,6 +520,22 @@ static struct board_info __initdata boar - - .has_uart0 = 1, +@@ -411,6 +411,20 @@ static struct board_info __initdata boar + .name = "96345GW2", + .expected_cpu_id = 0x6345, }; + +static struct board_info __initdata board_rta770bw = { + .name = "RTA770BW", + .expected_cpu_id = 0x6345, + -+ .has_uart0 = 1, -+ + .has_enet0 = 1, + + .enet0 = { @@ -23,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1655,6 +1671,7 @@ static const struct board_info __initcon +@@ -1341,6 +1355,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, @@ -31,7 +29,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1725,6 +1742,7 @@ static struct of_device_id const bcm963x +@@ -1411,6 +1426,7 @@ static struct of_device_id const bcm963x #endif #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch b/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch index e59f1aa02..604ffe7a3 100644 --- a/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch +++ b/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -1481,6 +1482,95 @@ static struct board_info __initdata boar +@@ -1171,6 +1172,92 @@ static struct board_info __initdata boar }, }; @@ -16,7 +16,6 @@ + .name = "HW556_C", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -44,7 +43,6 @@ + .name = "HW556_A", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -74,7 +72,6 @@ + .name = "HW556_B", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -104,7 +101,7 @@ /* T-Home Speedport W 303V Typ B */ static struct board_info __initdata board_spw303v = { .name = "96358-502V", -@@ -1707,6 +1797,9 @@ static const struct board_info __initcon +@@ -1391,6 +1478,9 @@ static const struct board_info __initcon &board_nb4_fxc_r1, &board_ct6373_1, &board_HW553, @@ -114,7 +111,7 @@ &board_spw303v, &board_DVAG3810BN, #endif -@@ -1779,6 +1872,9 @@ static struct of_device_id const bcm963x +@@ -1463,6 +1553,9 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, { .compatible = "d-link,dva-g3810bn/tl", .data = &board_DVAG3810BN, }, { .compatible = "huawei,hg553", .data = &board_HW553, }, diff --git a/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch b/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch index e3b7724b8..7149ed748 100644 --- a/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch +++ b/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -537,6 +537,27 @@ static struct board_info __initdata boar +@@ -426,6 +426,25 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -14,8 +14,6 @@ + .name = "RTA770W", + .expected_cpu_id = 0x6345, + -+ .has_uart0 = 1, -+ + .has_enet0 = 1, + + .enet0 = { @@ -28,7 +26,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1762,6 +1783,7 @@ static const struct board_info __initcon +@@ -1443,6 +1462,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, &board_rta770bw, @@ -36,7 +34,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1836,6 +1858,7 @@ static struct of_device_id const bcm963x +@@ -1517,6 +1537,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, { .compatible = "dynalink,rta770bw", .data = &board_rta770bw, }, diff --git a/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch b/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch index 1cdef8b30..888854a9c 100644 --- a/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch +++ b/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch @@ -12,7 +12,7 @@ Signed-off-by: Marcin Jurkowski --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -387,6 +387,44 @@ static struct board_info __initdata boar +@@ -341,6 +341,43 @@ static struct board_info __initdata boar }, }, }; @@ -21,7 +21,6 @@ Signed-off-by: Marcin Jurkowski + .name = "F@ST2704V2", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -57,7 +56,7 @@ Signed-off-by: Marcin Jurkowski #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1773,6 +1811,7 @@ static const struct board_info __initcon +@@ -1452,6 +1489,7 @@ static const struct board_info __initcon &board_963281TAN, &board_A4001N1, &board_dsl_274xb_f1, @@ -65,7 +64,7 @@ Signed-off-by: Marcin Jurkowski #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1848,6 +1887,7 @@ static struct of_device_id const bcm963x +@@ -1527,6 +1565,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, diff --git a/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch b/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch index d5ecc3c4c..3472d90e9 100644 --- a/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch +++ b/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch @@ -6,7 +6,7 @@ Signed-off-by: Max Staudt --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1702,6 +1702,43 @@ static struct board_info __initdata boar +@@ -1382,6 +1382,41 @@ static struct board_info __initdata boar }, }, }; @@ -15,8 +15,6 @@ Signed-off-by: Max Staudt + .name = "F@ST2504n", + .expected_cpu_id = 0x6362, + -+ .has_uart0 = 1, -+ + .has_enetsw = 1, + + .enetsw = { @@ -50,7 +48,7 @@ Signed-off-by: Max Staudt #endif /* CONFIG_BCM63XX_CPU_6362 */ /* -@@ -1867,6 +1904,7 @@ static const struct board_info __initcon +@@ -1545,6 +1580,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6362 &board_nb6, @@ -58,7 +56,7 @@ Signed-off-by: Max Staudt #endif #ifdef CONFIG_BCM63XX_CPU_6368 -@@ -1948,6 +1986,7 @@ static struct of_device_id const bcm963x +@@ -1626,6 +1662,7 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch b/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch index f0949f9ed..c7eadf1b8 100644 --- a/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch +++ b/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -53,6 +53,56 @@ static struct board_info __initdata boar +@@ -50,6 +50,55 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_3368 */ /* @@ -11,7 +11,6 @@ + .name = "96318REF", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_usbd = 1, @@ -57,7 +56,7 @@ * known 6328 boards */ #ifdef CONFIG_BCM63XX_CPU_6328 -@@ -1579,6 +1629,9 @@ static const struct board_info __initcon +@@ -1517,6 +1566,9 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_3368 &board_cvg834g, #endif @@ -67,7 +66,7 @@ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_AR5381u, -@@ -1656,6 +1709,9 @@ static struct of_device_id const bcm963x +@@ -1594,6 +1646,9 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_3368 { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, #endif diff --git a/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch b/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch index eda826e13..162ecb7c3 100644 --- a/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch +++ b/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -100,6 +100,51 @@ static struct board_info __initdata boar +@@ -96,6 +96,50 @@ static struct board_info __initdata boar }, }, }; @@ -9,7 +9,6 @@ + .name = "96318REF_P300", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_usbd = 1, @@ -52,7 +51,7 @@ #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -1631,6 +1676,7 @@ static const struct board_info __initcon +@@ -1568,6 +1612,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, @@ -60,7 +59,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -1711,6 +1757,7 @@ static struct of_device_id const bcm963x +@@ -1648,6 +1693,7 @@ static struct of_device_id const bcm963x #endif #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, diff --git a/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch b/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch index 2d5dc607b..be0e7e783 100644 --- a/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch +++ b/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1668,6 +1668,52 @@ static struct board_info __initdata boar +@@ -1604,6 +1604,50 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -11,8 +11,6 @@ + .name = "963269BHR", + .expected_cpu_id = 0x63268, + -+ .has_uart0 = 1, -+ + .has_pci = 1, + + .has_ehci0 = 1, @@ -53,7 +51,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -1748,6 +1794,9 @@ static const struct board_info __initcon +@@ -1684,6 +1728,9 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, #endif @@ -63,7 +61,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1835,6 +1884,7 @@ static struct of_device_id const bcm963x +@@ -1771,6 +1818,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, #endif #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch b/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch index a312b4137..dc3c13ef4 100644 --- a/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch +++ b/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch @@ -8,7 +8,7 @@ Signed-off-by: Adrian Feliks --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -679,6 +679,22 @@ static struct board_info __initdata boar +@@ -655,6 +655,21 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -16,7 +16,6 @@ Signed-off-by: Adrian Feliks + .name = "AR1004G", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -31,7 +30,7 @@ Signed-off-by: Adrian Feliks /* BT Voyager 2110 */ static struct board_info __initdata board_V2110 = { -@@ -1765,6 +1781,7 @@ static const struct board_info __initcon +@@ -1699,6 +1714,7 @@ static const struct board_info __initcon &board_96348A_122, &board_CPVA502plus, &board_96348W3, @@ -39,7 +38,7 @@ Signed-off-by: Adrian Feliks #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1829,6 +1846,7 @@ static struct of_device_id const bcm963x +@@ -1763,6 +1779,7 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, #endif #ifdef CONFIG_BCM63XX_CPU_6348 diff --git a/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch b/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch index b9dd163d6..dff30121b 100644 --- a/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch +++ b/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1727,6 +1727,53 @@ static struct board_info __initdata boar +@@ -1660,6 +1660,51 @@ static struct board_info __initdata boar }, }, }; @@ -9,8 +9,6 @@ + .name = "VW6339GU", + .expected_cpu_id = 0x63268, + -+ .has_uart0 = 1, -+ + .has_ehci0 = 1, + .has_ohci0 = 1, + .num_usbh_ports = 1, @@ -54,7 +52,7 @@ #endif /* CONFIG_BCM63XX_CPU_63268 */ /* -@@ -1813,6 +1860,7 @@ static const struct board_info __initcon +@@ -1746,6 +1791,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_63268 &board_963269bhr, @@ -62,7 +60,7 @@ #endif }; -@@ -1903,6 +1951,7 @@ static struct of_device_id const bcm963x +@@ -1836,6 +1882,7 @@ static struct of_device_id const bcm963x #endif #ifdef CONFIG_BCM63XX_CPU_63268 { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, diff --git a/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch b/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch index 7a8575e70..4819fc545 100644 --- a/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch +++ b/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1687,6 +1687,66 @@ static struct board_info __initdata boar +@@ -1622,6 +1622,64 @@ static struct board_info __initdata boar * known 63268/63269 boards */ #ifdef CONFIG_BCM63XX_CPU_63268 @@ -8,8 +8,6 @@ + .name = "963268BU_P300", + .expected_cpu_id = 0x63268, + -+ .has_uart0 = 1, -+ + .has_ehci0 = 1, + .has_ohci0 = 1, + .num_usbh_ports = 1, @@ -67,7 +65,7 @@ static struct board_info __initdata board_963269bhr = { .name = "963269BHR", .expected_cpu_id = 0x63268, -@@ -1859,6 +1919,7 @@ static const struct board_info __initcon +@@ -1790,6 +1848,7 @@ static const struct board_info __initcon &board_96368mvngr, #endif #ifdef CONFIG_BCM63XX_CPU_63268 @@ -75,7 +73,7 @@ &board_963269bhr, &board_vw6339gu, #endif -@@ -1950,6 +2011,7 @@ static struct of_device_id const bcm963x +@@ -1881,6 +1940,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, #endif #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch b/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch index 38c92b110..675185035 100644 --- a/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch +++ b/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch @@ -9,7 +9,7 @@ #include #include #include -@@ -1681,6 +1683,48 @@ static struct board_info __initdata boar +@@ -1616,6 +1618,47 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -27,7 +27,6 @@ + .name = "96369R-1231N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -58,7 +57,7 @@ #endif /* CONFIG_BCM63XX_CPU_6368 */ /* -@@ -1917,6 +1961,7 @@ static const struct board_info __initcon +@@ -1846,6 +1889,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -66,7 +65,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_63268 &board_963268bu_p300, -@@ -2009,6 +2054,7 @@ static struct of_device_id const bcm963x +@@ -1938,6 +1982,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6368 { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, diff --git a/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch b/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch index 5f56c0e97..29413e947 100644 --- a/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch +++ b/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1684,6 +1684,60 @@ static struct board_info __initdata boar +@@ -1619,6 +1619,59 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -17,7 +17,6 @@ + .name = "96368M-1541N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -61,7 +60,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -1961,6 +2015,7 @@ static const struct board_info __initcon +@@ -1889,6 +1942,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -69,7 +68,7 @@ &board_WAP5813n, #endif #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2054,6 +2109,7 @@ static struct of_device_id const bcm963x +@@ -1982,6 +2036,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6368 { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, diff --git a/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch b/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch index c2c17fdc2..81ac7021c 100644 --- a/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch +++ b/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1738,6 +1738,60 @@ static struct board_info __initdata boar +@@ -1672,6 +1672,59 @@ static struct board_info __initdata boar }, }; @@ -17,7 +17,6 @@ + .name = "96368M-1341N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -61,7 +60,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2016,6 +2070,7 @@ static const struct board_info __initcon +@@ -1943,6 +1996,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_VR3025u, @@ -69,7 +68,7 @@ &board_WAP5813n, #endif #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2110,6 +2165,7 @@ static struct of_device_id const bcm963x +@@ -2037,6 +2091,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, diff --git a/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch b/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch index 2fd368a60..cdab8de25 100644 --- a/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch +++ b/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1693,6 +1693,49 @@ static struct sprom_fixup __initdata vr3 +@@ -1628,6 +1628,48 @@ static struct sprom_fixup __initdata vr3 { .offset = 115, .value = 0xfad9 }, }; @@ -8,7 +8,6 @@ + .name = "P870HW-51a_v2", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -50,7 +49,7 @@ static struct board_info __initdata board_VR3025u = { .name = "96368M-1541N", .expected_cpu_id = 0x6368, -@@ -2069,6 +2112,7 @@ static const struct board_info __initcon +@@ -1995,6 +2037,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -58,7 +57,7 @@ &board_VR3025u, &board_VR3025un, &board_WAP5813n, -@@ -2167,6 +2211,7 @@ static struct of_device_id const bcm963x +@@ -2093,6 +2136,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch b/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch index 070e3ec82..75b7ef96e 100644 --- a/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch +++ b/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1364,6 +1364,37 @@ static struct board_info __initdata boar +@@ -1312,6 +1312,36 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "HW6358GW_B", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -38,7 +37,7 @@ static struct board_info __initdata board_HW553 = { .name = "HW553", .expected_cpu_id = 0x6358, -@@ -2096,6 +2127,7 @@ static const struct board_info __initcon +@@ -2021,6 +2051,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_ct6373_1, @@ -46,7 +45,7 @@ &board_HW553, &board_HW556_A, &board_HW556_B, -@@ -2188,6 +2220,7 @@ static struct of_device_id const bcm963x +@@ -2113,6 +2144,7 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, { .compatible = "d-link,dva-g3810bn/tl", .data = &board_DVAG3810BN, }, diff --git a/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch b/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch index dfddf193b..2e194a54f 100644 --- a/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch +++ b/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -358,6 +358,50 @@ static struct board_info __initdata boar +@@ -349,6 +349,49 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "96328dg2x2", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -51,7 +50,7 @@ static struct board_info __initdata board_A4001N1 = { .name = "963281T_TEF", .expected_cpu_id = 0x6328, -@@ -2078,6 +2122,7 @@ static const struct board_info __initcon +@@ -2002,6 +2045,7 @@ static const struct board_info __initcon &board_AR5381u, &board_AR5387un, &board_963281TAN, @@ -59,7 +58,7 @@ &board_A4001N1, &board_dsl_274xb_f1, &board_FAST2704V2, -@@ -2166,6 +2211,7 @@ static struct of_device_id const bcm963x +@@ -2090,6 +2134,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, #endif #ifdef CONFIG_BCM63XX_CPU_6328 diff --git a/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch b/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch index 24c15fd2e..9852f3460 100644 --- a/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch +++ b/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -147,6 +147,75 @@ static struct board_info __initdata boar +@@ -142,6 +142,74 @@ static struct board_info __initdata boar }, }, }; @@ -30,7 +30,6 @@ + .name = "AW5200B", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + @@ -76,7 +75,7 @@ #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -2116,6 +2185,7 @@ static const struct board_info __initcon +@@ -2039,6 +2107,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, &board_96318ref_p300, @@ -84,7 +83,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -2209,6 +2279,7 @@ static struct of_device_id const bcm963x +@@ -2132,6 +2201,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, diff --git a/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch b/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch index a07ebdb9e..cc31a8188 100644 --- a/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch +++ b/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1828,6 +1828,31 @@ static struct board_info __initdata boar +@@ -1760,6 +1760,30 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -8,7 +8,6 @@ + .name = "DGND3700v1_3800B", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -32,7 +31,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2259,6 +2284,7 @@ static const struct board_info __initcon +@@ -2181,6 +2205,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -40,7 +39,7 @@ &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, -@@ -2361,6 +2387,7 @@ static struct of_device_id const bcm963x +@@ -2283,6 +2308,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch b/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch index e094882e3..8dca58683 100644 --- a/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch +++ b/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1477,6 +1477,32 @@ static struct board_info __initdata boar +@@ -1423,6 +1423,31 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "HOMEHUB2A", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -33,7 +32,7 @@ static struct board_info __initdata board_HW520 = { .name = "HW6358GW_B", .expected_cpu_id = 0x6358, -@@ -2267,6 +2293,7 @@ static const struct board_info __initcon +@@ -2188,6 +2213,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_ct6373_1, @@ -41,7 +40,7 @@ &board_HW520, &board_HW553, &board_HW556_A, -@@ -2376,6 +2403,7 @@ static struct of_device_id const bcm963x +@@ -2297,6 +2323,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, { .compatible = "t-com,spw303v", .data = &board_spw303v, }, { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, diff --git a/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch b/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch index 2a13400f2..8fa9112b8 100644 --- a/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch +++ b/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1879,6 +1879,53 @@ static struct board_info __initdata boar +@@ -1809,6 +1809,52 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "HW65x", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -54,7 +53,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2312,6 +2359,7 @@ static const struct board_info __initcon +@@ -2232,6 +2278,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -62,7 +61,7 @@ &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, -@@ -2415,6 +2463,7 @@ static struct of_device_id const bcm963x +@@ -2335,6 +2382,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch b/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch index c62f2ac8c..bdae1a7e4 100644 --- a/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch +++ b/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -216,6 +216,46 @@ static struct board_info __initdata boar +@@ -210,6 +210,45 @@ static struct board_info __initdata boar .num_board_fixups = ARRAY_SIZE(dsl2751b_e1_fixups), }, }; @@ -9,7 +9,6 @@ + .name = "F@ST2704N", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + @@ -47,7 +46,7 @@ #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -2284,6 +2324,7 @@ static const struct board_info __initcon +@@ -2203,6 +2242,7 @@ static const struct board_info __initcon &board_96318ref, &board_96318ref_p300, &board_dsl_2751b_d1, @@ -55,7 +54,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -2381,6 +2422,7 @@ static struct of_device_id const bcm963x +@@ -2300,6 +2340,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, { .compatible = "d-link,dsl-275xb-d", .data = &board_dsl_2751b_d1, }, diff --git a/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch b/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch index 5a7d200e5..260424bee 100644 --- a/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch +++ b/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2117,6 +2117,60 @@ static struct board_info __initdata boar +@@ -2042,6 +2042,59 @@ static struct board_info __initdata boar }, }; @@ -17,7 +17,6 @@ + .name = "96368MT-1341N1", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -61,7 +60,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2404,6 +2458,7 @@ static const struct board_info __initcon +@@ -2322,6 +2375,7 @@ static const struct board_info __initcon &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, @@ -69,7 +68,7 @@ &board_WAP5813n, #endif #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2504,6 +2559,7 @@ static struct of_device_id const bcm963x +@@ -2422,6 +2476,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, diff --git a/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch b/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch index cda9c4169..2764846a0 100644 --- a/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch +++ b/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -638,6 +638,51 @@ static struct board_info __initdata boar +@@ -623,6 +623,50 @@ static struct board_info __initdata boar }, }, }; @@ -9,7 +9,6 @@ + .name = "96328ang", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -52,7 +51,7 @@ #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -2389,6 +2434,7 @@ static const struct board_info __initcon +@@ -2306,6 +2350,7 @@ static const struct board_info __initcon &board_A4001N1, &board_dsl_274xb_f1, &board_FAST2704V2, @@ -60,7 +59,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -2487,6 +2533,7 @@ static struct of_device_id const bcm963x +@@ -2404,6 +2449,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, diff --git a/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch b/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch index 3ec2d139d..860c0e787 100644 --- a/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch +++ b/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2011,6 +2011,53 @@ static struct board_info __initdata boar +@@ -1938,6 +1938,52 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "96368MVWG_hg622", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -54,7 +53,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2500,6 +2547,7 @@ static const struct board_info __initcon +@@ -2416,6 +2462,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -62,7 +61,7 @@ &board_HG655b, &board_P870HW51A_V2, &board_VR3025u, -@@ -2608,6 +2656,7 @@ static struct of_device_id const bcm963x +@@ -2524,6 +2571,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch b/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch index cbec9492f..4c9d19ac6 100644 --- a/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch +++ b/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1964,6 +1964,43 @@ static struct board_info __initdata boar +@@ -1892,6 +1892,42 @@ static struct board_info __initdata boar }, }; @@ -12,7 +12,6 @@ + .name = "96369PVG", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -44,7 +43,7 @@ static struct board_info __initdata board_HG655b = { .name = "HW65x", .expected_cpu_id = 0x6368, -@@ -2547,6 +2584,7 @@ static const struct board_info __initcon +@@ -2462,6 +2498,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -52,7 +51,7 @@ &board_HG622, &board_HG655b, &board_P870HW51A_V2, -@@ -2659,6 +2697,7 @@ static struct of_device_id const bcm963x +@@ -2574,6 +2611,7 @@ static struct of_device_id const bcm963x { .compatible = "huawei,hg622", .data = &board_HG622, }, { .compatible = "huawei,hg655b", .data = &board_HG655b, }, { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, }, diff --git a/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch b/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch index f3d08eb2a..927ce2735 100644 --- a/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch +++ b/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1851,6 +1851,52 @@ static struct board_info __initdata boar +@@ -1782,6 +1782,51 @@ static struct board_info __initdata boar * known 6368 boards */ #ifdef CONFIG_BCM63XX_CPU_6368 @@ -8,7 +8,6 @@ + .name = "96368_Swiss_S1", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -53,7 +52,7 @@ static struct board_info __initdata board_96368mvwg = { .name = "96368MVWG", .expected_cpu_id = 0x6368, -@@ -2581,6 +2627,7 @@ static const struct board_info __initcon +@@ -2495,6 +2540,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6368 @@ -61,7 +60,7 @@ &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, -@@ -2688,6 +2735,7 @@ static struct of_device_id const bcm963x +@@ -2602,6 +2648,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,nb6-ser-r0", .data = &board_nb6, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch b/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch index 74f1b5006..e9bf9a768 100644 --- a/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch +++ b/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2346,6 +2346,45 @@ static struct board_info __initdata boar +@@ -2266,6 +2266,44 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "VH4032N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -46,7 +45,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2635,6 +2674,7 @@ static const struct board_info __initcon +@@ -2548,6 +2586,7 @@ static const struct board_info __initcon &board_HG622, &board_HG655b, &board_P870HW51A_V2, @@ -54,7 +53,7 @@ &board_VR3025u, &board_VR3025un, &board_VR3026e, -@@ -2746,6 +2786,7 @@ static struct of_device_id const bcm963x +@@ -2659,6 +2698,7 @@ static struct of_device_id const bcm963x { .compatible = "huawei,hg655b", .data = &board_HG655b, }, { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, }, { .compatible = "netgear,evg2000", .data = &board_EVG2000, }, diff --git a/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch b/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch index d1a1b0363..4b4b1a0de 100644 --- a/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch +++ b/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2193,6 +2193,31 @@ static struct board_info __initdata boar +@@ -2116,6 +2116,29 @@ static struct board_info __initdata boar }, }; @@ -8,8 +8,6 @@ + .name = "R1000H", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, -+ .has_uart1 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -32,7 +30,7 @@ static struct board_info __initdata board_VR3025u = { .name = "96368M-1541N", .expected_cpu_id = 0x6368, -@@ -2674,6 +2699,7 @@ static const struct board_info __initcon +@@ -2586,6 +2609,7 @@ static const struct board_info __initcon &board_HG622, &board_HG655b, &board_P870HW51A_V2, @@ -40,7 +38,7 @@ &board_VH4032N, &board_VR3025u, &board_VR3025un, -@@ -2775,6 +2801,7 @@ static struct of_device_id const bcm963x +@@ -2687,6 +2711,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,nb6-ser-r0", .data = &board_nb6, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch b/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch index 6f7f26c32..1974ccd81 100644 --- a/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch +++ b/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -148,6 +148,68 @@ static struct board_info __initdata boar +@@ -143,6 +143,67 @@ static struct board_info __initdata boar }, }; @@ -22,7 +22,6 @@ + .name = "96318A-1441N1", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + @@ -69,7 +68,7 @@ static struct sprom_fixup __initdata dsl2751b_e1_fixups[] = { { .offset = 96, .value = 0x2046 }, { .offset = 97, .value = 0xfe9d }, -@@ -2616,6 +2678,7 @@ static const struct board_info __initcon +@@ -2526,6 +2587,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, &board_96318ref_p300, @@ -77,7 +76,7 @@ &board_dsl_2751b_d1, &board_FAST2704N, #endif -@@ -2721,6 +2784,7 @@ static struct of_device_id const bcm963x +@@ -2631,6 +2693,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, diff --git a/target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch b/target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch new file mode 100644 index 000000000..7b28a24e3 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch @@ -0,0 +1,92 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -357,6 +357,73 @@ static struct board_info __initdata boar + }, + }; + ++static struct sprom_fixup __initdata ad1018_fixups[] = { ++ { .offset = 6, .value = 0x1c00 }, ++ { .offset = 65, .value = 0x1256 }, ++ { .offset = 96, .value = 0x2046 }, ++ { .offset = 97, .value = 0xfe69 }, ++ { .offset = 98, .value = 0x1726 }, ++ { .offset = 99, .value = 0xfa5c }, ++ { .offset = 112, .value = 0x2046 }, ++ { .offset = 113, .value = 0xfea8 }, ++ { .offset = 114, .value = 0x1978 }, ++ { .offset = 115, .value = 0xfa26 }, ++ { .offset = 161, .value = 0x2222 }, ++ { .offset = 169, .value = 0x2222 }, ++ { .offset = 171, .value = 0x2222 }, ++ { .offset = 173, .value = 0x2222 }, ++ { .offset = 174, .value = 0x4444 }, ++ { .offset = 175, .value = 0x2222 }, ++ { .offset = 176, .value = 0x4444 }, ++}; ++ ++static struct board_info __initdata board_AD1018 = { ++ .name = "96328avngr", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .use_fallback_sprom = 1, ++ ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "FIBRE", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN3", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN2", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN1", ++ }, ++ }, ++ }, ++ ++ .fallback_sprom = { ++ .type = SPROM_BCM43217, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ .board_fixups = ad1018_fixups, ++ .num_board_fixups = ARRAY_SIZE(ad1018_fixups), ++ }, ++}; ++ + static struct sprom_fixup __initdata ar5381u_fixups[] = { + { .offset = 97, .value = 0xfee5 }, + { .offset = 98, .value = 0x157c }, +@@ -2593,6 +2660,7 @@ static const struct board_info __initcon + #endif + #ifdef CONFIG_BCM63XX_CPU_6328 + &board_96328avng, ++ &board_AD1018, + &board_AR5381u, + &board_AR5387un, + &board_963281TAN, +@@ -2707,6 +2775,7 @@ static struct of_device_id const bcm963x + { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, + { .compatible = "nucom,r5010unv2", .data = &board_R5010UNV2, }, + { .compatible = "sagem,f@st2704v2", .data = &board_FAST2704V2, }, ++ { .compatible = "sercomm,ad1018-nor", .data = &board_AD1018, }, + #endif + #ifdef CONFIG_BCM63XX_CPU_6338 + { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, diff --git a/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch b/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch index 99075c6b9..a573d2166 100644 --- a/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch +++ b/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2276,6 +2276,10 @@ static int bcm_enetsw_open(struct net_de +@@ -2270,6 +2270,10 @@ static int bcm_enetsw_open(struct net_de rgmii_ctrl = enetsw_readb(priv, ENETSW_RGMII_CTRL_REG(i)); rgmii_ctrl |= ENETSW_RGMII_CTRL_GMII_CLK_EN; diff --git a/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch index d3d11e104..a191f9b2c 100644 --- a/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch +++ b/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -414,8 +414,8 @@ KERNELRELEASE = $(shell cat include/conf +@@ -409,8 +409,8 @@ KERNELRELEASE = $(shell cat include/conf KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index d234651fd..f951a0daf 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -582,7 +582,7 @@ Signed-off-by: David S. Miller dnet_writel(bp, int_enable, INTR_ENB); --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c -@@ -3346,7 +3346,7 @@ int be_poll(struct napi_struct *napi, in +@@ -3344,7 +3344,7 @@ int be_poll(struct napi_struct *napi, in be_process_mcc(adapter); if (max_work < budget) { @@ -712,7 +712,7 @@ Signed-off-by: David S. Miller * then check once more to make sure we are done. --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c -@@ -999,7 +999,7 @@ restart_poll: +@@ -1009,7 +1009,7 @@ restart_poll: if (frames_processed < budget) { enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]); @@ -1095,7 +1095,7 @@ Signed-off-by: David S. Miller dma_intr_ena = smsc9420_reg_read(pd, DMAC_INTR_ENA); --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -2677,7 +2677,7 @@ static int stmmac_poll(struct napi_struc +@@ -2678,7 +2678,7 @@ static int stmmac_poll(struct napi_struc work_done = stmmac_rx(priv, budget); if (work_done < budget) { diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index 060f64341..d1b41d3e2 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -722,8 +722,10 @@ CONFIG_CC_STACKPROTECTOR_NONE=y # CONFIG_CFG80211 is not set # CONFIG_CFG80211_CERTIFICATION_ONUS is not set # CONFIG_CGROUPS is not set +# CONFIG_CGROUP_BPF is not set # CONFIG_CGROUP_DEBUG is not set # CONFIG_CGROUP_NET_PRIO is not set +# CONFIG_CGROUP_RDMA is not set # CONFIG_CHARGER_BQ2415X is not set # CONFIG_CHARGER_BQ24190 is not set # CONFIG_CHARGER_BQ24257 is not set @@ -1960,6 +1962,7 @@ CONFIG_INPUT_MISC=y # CONFIG_INTEL_RST is not set # CONFIG_INTEL_SMARTCONNECT is not set # CONFIG_INTEL_SOC_PMIC is not set +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set # CONFIG_INTEL_TH is not set # CONFIG_INTEL_VBTN is not set # CONFIG_INTEL_XWAY_PHY is not set @@ -4236,6 +4239,7 @@ CONFIG_SLUB=y CONFIG_SLUB_CPU_PARTIAL=y # CONFIG_SLUB_DEBUG is not set # CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_MEMCG_SYSFS_ON is not set # CONFIG_SLUB_STATS is not set # CONFIG_SMARTJOYPLUS_FF is not set # CONFIG_SMC911X is not set @@ -5589,3 +5593,4 @@ CONFIG_ZONE_DMA=y # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set # CONFIG_ZX_TDM is not set +# CONFIG_SHORTCUT_FE is not set \ No newline at end of file diff --git a/target/linux/generic/hack-4.9/202-reduce_module_size.patch b/target/linux/generic/hack-4.9/202-reduce_module_size.patch index 1b4e19a4a..6e5fc9cd4 100644 --- a/target/linux/generic/hack-4.9/202-reduce_module_size.patch +++ b/target/linux/generic/hack-4.9/202-reduce_module_size.patch @@ -13,12 +13,12 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -407,7 +407,7 @@ KBUILD_CFLAGS_KERNEL := - KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE) +@@ -401,7 +401,7 @@ KBUILD_AFLAGS_KERNEL := + KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE -KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds +KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := # Read KERNELRELEASE from include/config/kernel.release (if it exists) - KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch index 354052d8b..1b0262a06 100644 --- a/target/linux/generic/hack-4.9/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1196,7 +1196,6 @@ all: modules +@@ -1197,7 +1197,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1226,7 +1225,6 @@ _modinst_: +@@ -1227,7 +1226,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch index eda8bb8b2..e39f0f5f4 100644 --- a/target/linux/generic/hack-4.9/220-gc_sections.patch +++ b/target/linux/generic/hack-4.9/220-gc_sections.patch @@ -21,9 +21,9 @@ Signed-off-by: Gabor Juhos --- a/Makefile +++ b/Makefile -@@ -409,6 +409,11 @@ KBUILD_AFLAGS_MODULE := -DMODULE - KBUILD_CFLAGS_MODULE := -DMODULE +@@ -404,6 +404,11 @@ KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := +ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION +KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,) @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -@@ -633,11 +638,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -634,11 +639,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context) diff --git a/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch b/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch index a3df4fbe3..7c3e38efc 100644 --- a/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch +++ b/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1150,6 +1150,10 @@ config SYNC_R4K +@@ -1155,6 +1155,10 @@ config SYNC_R4K config MIPS_MACHINE def_bool n diff --git a/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch b/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch index c22a4823f..8c6ed8c20 100644 --- a/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch +++ b/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch @@ -16,7 +16,7 @@ Signed-off-by: Alexandros C. Couloumbis --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile -@@ -179,7 +179,6 @@ else +@@ -188,7 +188,6 @@ else CHECKFLAGS += -D__LITTLE_ENDIAN__ endif diff --git a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 523a69c87..180d1407d 100644 --- a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -33,7 +33,7 @@ Signed-off-by: Daniel Golle + /* check for a valid ubi magic */ + err = mtd_read(mtd, 0, 4, &len, (void *) magic); + if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d", mtd->index); ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + put_mtd_device(mtd); + return; + } @@ -48,7 +48,7 @@ Signed-off-by: Daniel Golle + err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); + mutex_unlock(&ubi_devices_mutex); + if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d", mtd->index); ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); + put_mtd_device(mtd); + } + } diff --git a/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch index 99cc0f6cd..c8e25710b 100644 --- a/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch @@ -36,7 +36,7 @@ Signed-off-by: Gabor Juhos + return err; + + if (ec_hdr_has_eof(ech)) { -+ pr_notice("UBI: EOF marker found, PEBs from %d will be erased", ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased\n", + pnum); + ai->eof_found = true; + } diff --git a/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch b/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch index 5d83aa3bb..6c9f30a97 100644 --- a/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch +++ b/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch @@ -464,7 +464,7 @@ module_init(psb6970_init); --- a/drivers/net/phy/rtl8306.c +++ b/drivers/net/phy/rtl8306.c -@@ -876,7 +876,7 @@ rtl8306_config_init(struct phy_device *p +@@ -877,7 +877,7 @@ rtl8306_config_init(struct phy_device *p int err; /* Only init the switch for the primary PHY */ @@ -473,7 +473,7 @@ return 0; val.value.i = 1; -@@ -886,7 +886,7 @@ rtl8306_config_init(struct phy_device *p +@@ -887,7 +887,7 @@ rtl8306_config_init(struct phy_device *p priv->dev.ops = &rtl8306_ops; priv->do_cpu = 0; priv->page = -1; @@ -482,7 +482,7 @@ chipid = rtl_get(dev, RTL_REG_CHIPID); chipver = rtl_get(dev, RTL_REG_CHIPVER); -@@ -932,13 +932,13 @@ rtl8306_fixup(struct phy_device *pdev) +@@ -933,13 +933,13 @@ rtl8306_fixup(struct phy_device *pdev) u16 chipid; /* Attach to primary LAN port and WAN port */ @@ -498,7 +498,7 @@ chipid = rtl_get(&priv.dev, RTL_REG_CHIPID); if (chipid == 0x5988) pdev->phy_id = RTL8306_MAGIC; -@@ -956,14 +956,14 @@ rtl8306_probe(struct phy_device *pdev) +@@ -957,14 +957,14 @@ rtl8306_probe(struct phy_device *pdev) * share one rtl_priv instance between virtual phy * devices on the same bus */ @@ -515,7 +515,7 @@ found: pdev->priv = priv; -@@ -984,7 +984,7 @@ rtl8306_config_aneg(struct phy_device *p +@@ -985,7 +985,7 @@ rtl8306_config_aneg(struct phy_device *p struct rtl_priv *priv = pdev->priv; /* Only for WAN */ @@ -524,7 +524,7 @@ return 0; /* Restart autonegotiation */ -@@ -1000,7 +1000,7 @@ rtl8306_read_status(struct phy_device *p +@@ -1001,7 +1001,7 @@ rtl8306_read_status(struct phy_device *p struct rtl_priv *priv = pdev->priv; struct switch_dev *dev = &priv->dev; @@ -533,7 +533,7 @@ /* WAN */ pdev->speed = rtl_get(dev, RTL_PORT_REG(4, SPEED)) ? SPEED_100 : SPEED_10; pdev->duplex = rtl_get(dev, RTL_PORT_REG(4, DUPLEX)) ? DUPLEX_FULL : DUPLEX_HALF; -@@ -1041,6 +1041,7 @@ static struct phy_driver rtl8306_driver +@@ -1044,6 +1044,7 @@ static struct phy_driver rtl8306_driver .config_init = &rtl8306_config_init, .config_aneg = &rtl8306_config_aneg, .read_status = &rtl8306_read_status, @@ -541,7 +541,7 @@ }; -@@ -1048,7 +1049,7 @@ static int __init +@@ -1051,7 +1052,7 @@ static int __init rtl_init(void) { phy_register_fixup_for_id(PHY_ANY_ID, rtl8306_fixup); diff --git a/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 6c9b12c2e..a53be2d15 100644 --- a/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -75,7 +75,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5357,7 +5357,7 @@ static void __init_refok alloc_node_mem_ +@@ -5372,7 +5372,7 @@ static void __init_refok alloc_node_mem_ mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index f08f9b4a7..b15066f75 100644 --- a/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle + /* check for a valid ubi magic */ + err = mtd_read(mtd, 0, 4, &len, (void *) magic); + if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d", mtd->index); ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + put_mtd_device(mtd); + return; + } @@ -47,11 +47,11 @@ Signed-off-by: Daniel Golle + mtd->type == MTD_DATAFLASH || + mtd->type == MTD_MLCNANDFLASH) { + mutex_lock(&ubi_devices_mutex); -+ pr_notice("UBI: auto-attach mtd%d", mtd->index); ++ pr_notice("UBI: auto-attach mtd%d\n", mtd->index); + err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); + mutex_unlock(&ubi_devices_mutex); + if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d", mtd->index); ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); + put_mtd_device(mtd); + } + } diff --git a/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch index dd5ee306e..749232a39 100644 --- a/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch @@ -27,7 +27,7 @@ + return err; + + if (ec_hdr_has_eof(ech)) { -+ pr_notice("UBI: EOF marker found, PEBs from %d will be erased", ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased\n", + pnum); + ai->eof_found = true; + } diff --git a/target/linux/generic/pending-4.4/630-packet_socket_type.patch b/target/linux/generic/pending-4.4/630-packet_socket_type.patch index a427165f4..0314938ac 100644 --- a/target/linux/generic/pending-4.4/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.4/630-packet_socket_type.patch @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1784,6 +1784,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1777,6 +1777,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1791,6 +1792,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1784,6 +1785,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1803,7 +1805,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1796,7 +1798,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2006,12 +2008,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -1999,12 +2001,12 @@ static int packet_rcv(struct sk_buff *sk int skb_len = skb->len; unsigned int snaplen, res; @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2131,12 +2133,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2124,12 +2126,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3127,6 +3129,7 @@ static int packet_create(struct net *net +@@ -3126,6 +3128,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3756,6 +3759,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3755,6 +3758,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -108,7 +108,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3809,6 +3822,13 @@ static int packet_getsockopt(struct sock +@@ -3807,6 +3820,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -124,7 +124,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -129,6 +129,7 @@ struct packet_sock { +@@ -128,6 +128,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index c5f3e195d..4bf34c128 100644 --- a/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3597,6 +3636,17 @@ static int __net_init ip6_route_net_init +@@ -3601,6 +3640,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -220,7 +220,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3615,6 +3665,8 @@ out: +@@ -3619,6 +3669,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -229,7 +229,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3632,6 +3684,7 @@ static void __net_exit ip6_route_net_exi +@@ -3636,6 +3688,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -237,7 +237,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3705,6 +3758,9 @@ void __init ip6_route_init_special_entri +@@ -3709,6 +3762,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index b7ba384f4..d91db1fe7 100644 --- a/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4259,6 +4259,9 @@ static enum gro_result dev_gro_receive(s +@@ -4260,6 +4260,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5425,6 +5428,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5426,6 +5429,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *private) -@@ -5496,6 +5541,7 @@ static int __netdev_upper_dev_link(struc +@@ -5497,6 +5542,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); return 0; -@@ -5622,6 +5668,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -5623,6 +5669,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6162,6 +6209,7 @@ int dev_set_mac_address(struct net_devic +@@ -6163,6 +6210,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-4.4/721-phy_packets.patch b/target/linux/generic/pending-4.4/721-phy_packets.patch index a7a23278d..716c1a027 100644 --- a/target/linux/generic/pending-4.4/721-phy_packets.patch +++ b/target/linux/generic/pending-4.4/721-phy_packets.patch @@ -86,7 +86,7 @@ help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2746,10 +2746,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2747,10 +2747,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/pending-4.4/902-debloat_proc.patch b/target/linux/generic/pending-4.4/902-debloat_proc.patch index 1ef9f9800..5aada68e3 100644 --- a/target/linux/generic/pending-4.4/902-debloat_proc.patch +++ b/target/linux/generic/pending-4.4/902-debloat_proc.patch @@ -34,7 +34,7 @@ } --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c -@@ -143,7 +143,10 @@ static const struct file_operations proc +@@ -144,7 +144,10 @@ static const struct file_operations proc void proc_tty_register_driver(struct tty_driver *driver) { struct proc_dir_entry *ent; @@ -46,7 +46,7 @@ if (!driver->driver_name || driver->proc_entry || !driver->ops->proc_fops) return; -@@ -160,6 +163,9 @@ void proc_tty_unregister_driver(struct t +@@ -161,6 +164,9 @@ void proc_tty_unregister_driver(struct t { struct proc_dir_entry *ent; @@ -56,7 +56,7 @@ ent = driver->proc_entry; if (!ent) return; -@@ -174,6 +180,9 @@ void proc_tty_unregister_driver(struct t +@@ -175,6 +181,9 @@ void proc_tty_unregister_driver(struct t */ void __init proc_tty_init(void) { @@ -133,7 +133,7 @@ } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1553,10 +1553,12 @@ static int __init setup_vmstat(void) +@@ -1555,10 +1555,12 @@ static int __init setup_vmstat(void) cpu_notifier_register_done(); #endif #ifdef CONFIG_PROC_FS diff --git a/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch b/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch index 10613de85..eac39669d 100644 --- a/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch +++ b/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch @@ -34,7 +34,7 @@ +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2097,6 +2097,7 @@ int wake_up_state(struct task_struct *p, +@@ -2096,6 +2096,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 826496b41..794280eec 100644 --- a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5930,7 +5930,7 @@ static void __ref alloc_node_mem_map(str +@@ -5923,7 +5923,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.9/201-extra_optimization.patch b/target/linux/generic/pending-4.9/201-extra_optimization.patch index 74acc3571..6a8467a8b 100644 --- a/target/linux/generic/pending-4.9/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.9/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -639,12 +639,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata +@@ -640,12 +640,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE diff --git a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index a8dcad458..76d031002 100644 --- a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -33,7 +33,7 @@ Signed-off-by: Daniel Golle + /* check for a valid ubi magic */ + err = mtd_read(mtd, 0, 4, &len, (void *) magic); + if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d", mtd->index); ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + put_mtd_device(mtd); + return; + } @@ -48,7 +48,7 @@ Signed-off-by: Daniel Golle + err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); + mutex_unlock(&ubi_devices_mutex); + if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d", mtd->index); ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); + put_mtd_device(mtd); + } + } diff --git a/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch index c6ba444b4..0b2314955 100644 --- a/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch @@ -36,7 +36,7 @@ Signed-off-by: Gabor Juhos + return err; + + if (ec_hdr_has_eof(ech)) { -+ pr_notice("UBI: EOF marker found, PEBs from %d will be erased", ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased\n", + pnum); + ai->eof_found = true; + } diff --git a/target/linux/generic/pending-4.9/630-packet_socket_type.patch b/target/linux/generic/pending-4.9/630-packet_socket_type.patch index e943a47a8..092011d0e 100644 --- a/target/linux/generic/pending-4.9/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.9/630-packet_socket_type.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1780,6 +1780,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1773,6 +1773,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1787,6 +1788,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1780,6 +1781,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1799,7 +1801,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1792,7 +1794,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2037,12 +2039,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2030,12 +2032,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2168,12 +2170,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2161,12 +2163,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3252,6 +3254,7 @@ static int packet_create(struct net *net +@@ -3251,6 +3253,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3838,6 +3841,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3837,6 +3840,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3891,6 +3904,13 @@ static int packet_getsockopt(struct sock +@@ -3889,6 +3902,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -128,7 +128,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -129,6 +129,7 @@ struct packet_sock { +@@ -128,6 +128,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile index a185ce8df..e1964331a 100644 --- a/target/linux/ixp4xx/Makefile +++ b/target/linux/ixp4xx/Makefile @@ -10,10 +10,11 @@ ARCH:=armeb BOARD:=ixp4xx BOARDNAME:=Intel IXP4xx FEATURES:=squashfs -MAINTAINER:=Imre Kaloz +MAINTAINER:=Ted Hess , \ + Imre Kaloz SUBTARGETS:=generic harddisk -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/ixp4xx/config-4.9 b/target/linux/ixp4xx/config-4.9 new file mode 100644 index 000000000..c9b1be930 --- /dev/null +++ b/target/linux/ixp4xx/config-4.9 @@ -0,0 +1,247 @@ +CONFIG_ALIGNMENT_TRAP=y +# CONFIG_ARCH_ADI_COYOTE is not set +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_IXCDP1100=y +CONFIG_ARCH_IXDP425=y +CONFIG_ARCH_IXDP4XX=y +CONFIG_ARCH_IXP4XX=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_NR_GPIO=0 +# CONFIG_ARCH_PRPMC1100 is not set +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +# CONFIG_ARM_CPU_SUSPEND is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_THUMB is not set +CONFIG_ATAGS=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BOUNCE=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200" +CONFIG_CMDLINE_FROM_BOOTLOADER=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_ENDIAN_BE32=y +# CONFIG_CPU_ENDIAN_BE8 is not set +CONFIG_CPU_IXP43X=y +CONFIG_CPU_IXP46X=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CPU_XSCALE=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_UART_8250=y +# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set +CONFIG_DEBUG_UART_8250_SHIFT=2 +# CONFIG_DEBUG_UART_8250_WORD is not set +CONFIG_DEBUG_UART_PHYS=0xc8000003 +CONFIG_DEBUG_UART_VIRT=0xfef00003 +# CONFIG_DEBUG_USER is not set +CONFIG_DMABOUNCE=y +CONFIG_DNOTIFY=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_AT24=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=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_AUDITSYSCALL=y +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_PFN_VALID=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_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HWMON=y +CONFIG_HWMON_VID=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_IXP4XX=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_GPIO=y +# CONFIG_I2C_IOP3XX is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_IWMMXT is not set +CONFIG_IXP4XX_ETH=y +# CONFIG_IXP4XX_INDIRECT_PCI is not set +CONFIG_IXP4XX_NPE=y +CONFIG_IXP4XX_QMGR=y +CONFIG_IXP4XX_WATCHDOG=y +CONFIG_LEDS_FSG=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_LATCH=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MACH_AP1000=y +CONFIG_MACH_AP42X=y +# CONFIG_MACH_ARCOM_VULCAN is not set +CONFIG_MACH_AVILA=y +CONFIG_MACH_CAMBRIA=y +CONFIG_MACH_COMPEXWP18=y +# CONFIG_MACH_DEVIXP is not set +CONFIG_MACH_DSMG600=y +CONFIG_MACH_FSG=y +CONFIG_MACH_GATEWAY7001=y +# CONFIG_MACH_GORAMO_MLR is not set +# CONFIG_MACH_GTWX5715 is not set +# CONFIG_MACH_IXDP465 is not set +CONFIG_MACH_IXDPG425=y +# CONFIG_MACH_KIXRP435 is not set +CONFIG_MACH_LOFT=y +CONFIG_MACH_MI424WR=y +# CONFIG_MACH_MIC256 is not set +# CONFIG_MACH_MICCPT is not set +CONFIG_MACH_NAS100D=y +CONFIG_MACH_NSLU2=y +CONFIG_MACH_PRONGHORN=y +CONFIG_MACH_PRONGHORNMETRO=y +CONFIG_MACH_SIDEWINDER=y +CONFIG_MACH_TW2662=y +CONFIG_MACH_TW5334=y +CONFIG_MACH_USR8200=y +CONFIG_MACH_WG302V1=y +CONFIG_MACH_WG302V2=y +CONFIG_MACH_WRT300NV2=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +# CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_IXP4XX=y +CONFIG_MTD_OTP=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_MACH_IO_H=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_VENDOR_XSCALE=y +CONFIG_NO_BOOTMEM=y +CONFIG_NVMEM=y +# CONFIG_OF is not set +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +# CONFIG_PCI_DOMAINS_GENERIC is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1672=y +CONFIG_RTC_DRV_ISL1208=y +CONFIG_RTC_DRV_PCF8563=y +CONFIG_RTC_DRV_X1205=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SCHED_INFO is not set +# CONFIG_SCSI_DMA is not set +CONFIG_SENSORS_AD7418=y +CONFIG_SENSORS_MAX6650=y +CONFIG_SENSORS_W83781D=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h" +CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y +CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_SUPPORT=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WATCHDOG_NOWAYOUT=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch index 2bcc801b1..937a65e43 100644 --- a/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch +++ b/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch @@ -115,7 +115,7 @@ case UPIO_AU: p->serial_out(p, offset, value); p->serial_in(p, UART_LCR); /* safe, no side-effects */ -@@ -2457,6 +2477,7 @@ static int serial8250_request_std_resour +@@ -2460,6 +2480,7 @@ static int serial8250_request_std_resour case UPIO_MEM32: case UPIO_MEM32BE: case UPIO_MEM: @@ -123,7 +123,7 @@ if (!port->mapbase) break; -@@ -2494,6 +2515,7 @@ static void serial8250_release_std_resou +@@ -2497,6 +2518,7 @@ static void serial8250_release_std_resou case UPIO_MEM32: case UPIO_MEM32BE: case UPIO_MEM: diff --git a/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch b/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch index 207ccc533..33c3327ee 100644 --- a/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch +++ b/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch @@ -66,7 +66,18 @@ TODO: take care of additional PHYs through the PHY abstraction layer snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, mdio_bus->id, plat->phy); port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, -@@ -632,21 +663,32 @@ static void ixp4xx_phy_disconnect(struct +@@ -625,6 +656,10 @@ static int ixp4xx_phy_connect(struct net + + port->phydev->irq = PHY_POLL; + ++ port->link = 0; ++ port->speed = 0; ++ port->duplex = -1; ++ + return 0; + } + +@@ -632,21 +667,32 @@ static void ixp4xx_phy_disconnect(struct { struct port *port = netdev_priv(dev); @@ -102,7 +113,7 @@ TODO: take care of additional PHYs through the PHY abstraction layer } static inline void debug_pkt(struct net_device *dev, const char *func, -@@ -1048,6 +1090,9 @@ static int eth_ioctl(struct net_device * +@@ -1048,6 +1094,9 @@ static int eth_ioctl(struct net_device * return hwtstamp_get(dev, req); } @@ -112,7 +123,7 @@ TODO: take care of additional PHYs through the PHY abstraction layer return phy_mii_ioctl(port->phydev, req, cmd); } -@@ -1068,18 +1113,30 @@ static void ixp4xx_get_drvinfo(struct ne +@@ -1068,18 +1117,30 @@ static void ixp4xx_get_drvinfo(struct ne static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { struct port *port = netdev_priv(dev); @@ -143,3 +154,14 @@ TODO: take care of additional PHYs through the PHY abstraction layer return phy_start_aneg(port->phydev); } +@@ -1529,10 +1590,6 @@ static int eth_init_one(struct platform_ + if ((err = register_netdev(dev))) + goto err_phy_dis; + +- port->link = 0; +- port->speed = 0; +- port->duplex = -1; +- + printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, + npe_name(port->npe)); + diff --git a/target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch b/target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch new file mode 100644 index 000000000..3ca3eb76a --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch @@ -0,0 +1,136 @@ +From 7113f56b683c5123df5c20724ac813cee66fa21a Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 1 Jul 2013 16:49:05 +0200 +Subject: [PATCH 1/2] arm: ixp4xx: set cohorent_dma_mask for ethernet platform + devices + +ARM requires the cohorent_dma_mask set, so set it for the platform +devices so that the ethernet driver has access to it. + +Signed-off-by: Jonas Gorski +--- + arch/arm/mach-ixp4xx/fsg-setup.c | 2 ++ + arch/arm/mach-ixp4xx/goramo_mlr.c | 2 ++ + arch/arm/mach-ixp4xx/ixdp425-setup.c | 3 +++ + arch/arm/mach-ixp4xx/nas100d-setup.c | 1 + + arch/arm/mach-ixp4xx/nslu2-setup.c | 1 + + arch/arm/mach-ixp4xx/omixp-setup.c | 3 +++ + arch/arm/mach-ixp4xx/vulcan-setup.c | 2 ++ + 7 files changed, 14 insertions(+) + +--- a/arch/arm/mach-ixp4xx/fsg-setup.c ++++ b/arch/arm/mach-ixp4xx/fsg-setup.c +@@ -142,12 +142,14 @@ static struct platform_device fsg_eth[] + .id = IXP4XX_ETH_NPEB, + .dev = { + .platform_data = fsg_plat_eth, ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev = { + .platform_data = fsg_plat_eth + 1, ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + } + }; +--- a/arch/arm/mach-ixp4xx/goramo_mlr.c ++++ b/arch/arm/mach-ixp4xx/goramo_mlr.c +@@ -295,10 +295,12 @@ static struct platform_device device_eth + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = eth_plat, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev.platform_data = eth_plat + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -196,10 +197,12 @@ static struct platform_device ixdp425_et + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = ixdp425_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev.platform_data = ixdp425_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/nas100d-setup.c ++++ b/arch/arm/mach-ixp4xx/nas100d-setup.c +@@ -170,6 +170,7 @@ static struct platform_device nas100d_et + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = nas100d_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/nslu2-setup.c ++++ b/arch/arm/mach-ixp4xx/nslu2-setup.c +@@ -182,6 +182,7 @@ static struct platform_device nslu2_eth[ + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = nslu2_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/omixp-setup.c ++++ b/arch/arm/mach-ixp4xx/omixp-setup.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -188,10 +189,12 @@ static struct platform_device ixdp425_et + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = ixdp425_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev.platform_data = ixdp425_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, + }; + +--- a/arch/arm/mach-ixp4xx/vulcan-setup.c ++++ b/arch/arm/mach-ixp4xx/vulcan-setup.c +@@ -139,6 +139,7 @@ static struct platform_device vulcan_eth + .id = IXP4XX_ETH_NPEB, + .dev = { + .platform_data = &vulcan_plat_eth[0], ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + }, + [1] = { +@@ -146,6 +147,7 @@ static struct platform_device vulcan_eth + .id = IXP4XX_ETH_NPEC, + .dev = { + .platform_data = &vulcan_plat_eth[1], ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + }, + }; diff --git a/target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch b/target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch new file mode 100644 index 000000000..b369b56f0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch @@ -0,0 +1,95 @@ +From 1d67040af0144c549f4db8144d2ccc253ff8639c Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 1 Jul 2013 16:39:28 +0200 +Subject: [PATCH 2/2] net: ixp4xx_eth: use parent device for dma allocations + +Now that the platfomr device provides a dma_cohorent_mask, use it for +dma operations. + +This fixes ethernet on ixp4xx which was broken since 3.7. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/xscale/ixp4xx_eth.c | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -656,10 +656,10 @@ static inline void queue_put_desc(unsign + static inline void dma_unmap_tx(struct port *port, struct desc *desc) + { + #ifdef __ARMEB__ +- dma_unmap_single(&port->netdev->dev, desc->data, ++ dma_unmap_single(port->netdev->dev.parent, desc->data, + desc->buf_len, DMA_TO_DEVICE); + #else +- dma_unmap_single(&port->netdev->dev, desc->data & ~3, ++ dma_unmap_single(port->netdev->dev.parent, desc->data & ~3, + ALIGN((desc->data & 3) + desc->buf_len, 4), + DMA_TO_DEVICE); + #endif +@@ -725,9 +725,9 @@ static int eth_poll(struct napi_struct * + + #ifdef __ARMEB__ + if ((skb = netdev_alloc_skb(dev, RX_BUFF_SIZE))) { +- phys = dma_map_single(&dev->dev, skb->data, ++ phys = dma_map_single(dev->dev.parent, skb->data, + RX_BUFF_SIZE, DMA_FROM_DEVICE); +- if (dma_mapping_error(&dev->dev, phys)) { ++ if (dma_mapping_error(dev->dev.parent, phys)) { + dev_kfree_skb(skb); + skb = NULL; + } +@@ -750,10 +750,11 @@ static int eth_poll(struct napi_struct * + #ifdef __ARMEB__ + temp = skb; + skb = port->rx_buff_tab[n]; +- dma_unmap_single(&dev->dev, desc->data - NET_IP_ALIGN, ++ dma_unmap_single(dev->dev.parent, desc->data - NET_IP_ALIGN, + RX_BUFF_SIZE, DMA_FROM_DEVICE); + #else +- dma_sync_single_for_cpu(&dev->dev, desc->data - NET_IP_ALIGN, ++ dma_sync_single_for_cpu(dev->dev.parent, ++ desc->data - NET_IP_ALIGN, + RX_BUFF_SIZE, DMA_FROM_DEVICE); + memcpy_swab32((u32 *)skb->data, (u32 *)port->rx_buff_tab[n], + ALIGN(NET_IP_ALIGN + desc->pkt_len, 4) / 4); +@@ -872,7 +873,7 @@ static int eth_xmit(struct sk_buff *skb, + memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4); + #endif + +- phys = dma_map_single(&dev->dev, mem, bytes, DMA_TO_DEVICE); ++ phys = dma_map_single(dev->dev.parent, mem, bytes, DMA_TO_DEVICE); + if (dma_mapping_error(&dev->dev, phys)) { + dev_kfree_skb(skb); + #ifndef __ARMEB__ +@@ -1107,7 +1108,7 @@ static int init_queues(struct port *port + int i; + + if (!ports_open) { +- dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev, ++ dma_pool = dma_pool_create(DRV_NAME, port->netdev->dev.parent, + POOL_ALLOC_SIZE, 32, 0); + if (!dma_pool) + return -ENOMEM; +@@ -1135,9 +1136,9 @@ static int init_queues(struct port *port + data = buff; + #endif + desc->buf_len = MAX_MRU; +- desc->data = dma_map_single(&port->netdev->dev, data, ++ desc->data = dma_map_single(port->netdev->dev.parent, data, + RX_BUFF_SIZE, DMA_FROM_DEVICE); +- if (dma_mapping_error(&port->netdev->dev, desc->data)) { ++ if (dma_mapping_error(port->netdev->dev.parent, desc->data)) { + free_buffer(buff); + return -EIO; + } +@@ -1157,7 +1158,7 @@ static void destroy_queues(struct port * + struct desc *desc = rx_desc_ptr(port, i); + buffer_t *buff = port->rx_buff_tab[i]; + if (buff) { +- dma_unmap_single(&port->netdev->dev, ++ dma_unmap_single(port->netdev->dev.parent, + desc->data - NET_IP_ALIGN, + RX_BUFF_SIZE, DMA_FROM_DEVICE); + free_buffer(buff); diff --git a/target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch b/target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch new file mode 100644 index 000000000..185a09fff --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch @@ -0,0 +1,424 @@ +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -656,6 +656,14 @@ config GPIO_WS16C48 + parameter. The interrupt line numbers for the devices may be + configured via the irq module parameter. + ++config GPIO_GW_I2C_PLD ++ tristate "Gateworks I2C PLD GPIO Expander" ++ depends on I2C ++ help ++ Say yes here to provide access to the Gateworks I2C PLD GPIO ++ Expander. This is used at least on the GW2358-4. ++ ++ + endmenu + + menu "I2C GPIO expanders" +--- a/drivers/gpio/Makefile ++++ b/drivers/gpio/Makefile +@@ -48,6 +48,7 @@ obj-$(CONFIG_GPIO_F7188X) += gpio-f7188x + obj-$(CONFIG_GPIO_GE_FPGA) += gpio-ge.o + obj-$(CONFIG_GPIO_GPIO_MM) += gpio-gpio-mm.o + obj-$(CONFIG_GPIO_GRGPIO) += gpio-grgpio.o ++obj-$(CONFIG_GPIO_GW_I2C_PLD) += gw_i2c_pld.o + obj-$(CONFIG_HTC_EGPIO) += gpio-htc-egpio.o + obj-$(CONFIG_GPIO_ICH) += gpio-ich.o + obj-$(CONFIG_GPIO_IOP) += gpio-iop.o +--- /dev/null ++++ b/drivers/gpio/gw_i2c_pld.c +@@ -0,0 +1,371 @@ ++/* ++ * Gateworks I2C PLD GPIO expander ++ * ++ * Copyright (C) 2009 Gateworks Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static const struct i2c_device_id gw_i2c_pld_id[] = { ++ { "gw_i2c_pld", 8 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, gw_i2c_pld_id); ++ ++/* ++ * The Gateworks I2C PLD chip only expose one read and one ++ * write register. Writing a "one" bit (to match the reset state) lets ++ * that pin be used as an input. It is an open-drain model. ++ */ ++ ++struct gw_i2c_pld { ++ struct gpio_chip chip; ++ struct i2c_client *client; ++ unsigned out; /* software latch */ ++}; ++ ++/*-------------------------------------------------------------------------*/ ++ ++/* ++ * The Gateworks I2C PLD chip does not properly send the acknowledge bit ++ * thus we cannot use standard i2c_smbus functions. We have recreated ++ * our own here, but we still use the rt_mutex_lock to lock the i2c_bus ++ * as the device still exists on the I2C bus. ++*/ ++ ++#define PLD_SCL_GPIO 6 ++#define PLD_SDA_GPIO 7 ++ ++#define SCL_LO() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_LOW) ++#define SCL_HI() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_HIGH) ++#define SCL_EN() gpio_line_config(PLD_SCL_GPIO, IXP4XX_GPIO_OUT) ++#define SDA_LO() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_LOW) ++#define SDA_HI() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_HIGH) ++#define SDA_EN() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_OUT) ++#define SDA_DIS() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_IN) ++#define SDA_IN(x) gpio_line_get(PLD_SDA_GPIO, &x); ++ ++static int i2c_pld_write_byte(int address, int byte) ++{ ++ int i; ++ ++ address = (address << 1) & ~0x1; ++ ++ SDA_HI(); ++ SDA_EN(); ++ SCL_EN(); ++ SCL_HI(); ++ SDA_LO(); ++ SCL_LO(); ++ ++ for (i = 7; i >= 0; i--) ++ { ++ if (address & (1 << i)) ++ SDA_HI(); ++ else ++ SDA_LO(); ++ ++ SCL_HI(); ++ SCL_LO(); ++ } ++ ++ SDA_DIS(); ++ SCL_HI(); ++ SDA_IN(i); ++ SCL_LO(); ++ SDA_EN(); ++ ++ for (i = 7; i >= 0; i--) ++ { ++ if (byte & (1 << i)) ++ SDA_HI(); ++ else ++ SDA_LO(); ++ SCL_HI(); ++ SCL_LO(); ++ } ++ ++ SDA_DIS(); ++ SCL_HI(); ++ SDA_IN(i); ++ SCL_LO(); ++ ++ SDA_HI(); ++ SDA_EN(); ++ ++ SDA_LO(); ++ SCL_HI(); ++ SDA_HI(); ++ SCL_LO(); ++ SCL_HI(); ++ ++ return 0; ++} ++ ++static unsigned int i2c_pld_read_byte(int address) ++{ ++ int i = 0, byte = 0; ++ int bit; ++ ++ address = (address << 1) | 0x1; ++ ++ SDA_HI(); ++ SDA_EN(); ++ SCL_EN(); ++ SCL_HI(); ++ SDA_LO(); ++ SCL_LO(); ++ ++ for (i = 7; i >= 0; i--) ++ { ++ if (address & (1 << i)) ++ SDA_HI(); ++ else ++ SDA_LO(); ++ ++ SCL_HI(); ++ SCL_LO(); ++ } ++ ++ SDA_DIS(); ++ SCL_HI(); ++ SDA_IN(i); ++ SCL_LO(); ++ SDA_EN(); ++ ++ SDA_DIS(); ++ for (i = 7; i >= 0; i--) ++ { ++ SCL_HI(); ++ SDA_IN(bit); ++ byte |= bit << i; ++ SCL_LO(); ++ } ++ ++ SDA_LO(); ++ SCL_HI(); ++ SDA_HI(); ++ SCL_LO(); ++ SCL_HI(); ++ ++ return byte; ++} ++ ++ ++static int gw_i2c_pld_input8(struct gpio_chip *chip, unsigned offset) ++{ ++ int ret; ++ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); ++ struct i2c_adapter *adap = gpio->client->adapter; ++ ++ if (in_atomic() || irqs_disabled()) { ++ ret = rt_mutex_trylock(&adap->bus_lock); ++ if (!ret) ++ /* I2C activity is ongoing. */ ++ return -EAGAIN; ++ } else { ++ rt_mutex_lock(&adap->bus_lock); ++ } ++ ++ gpio->out |= (1 << offset); ++ ++ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); ++ ++ rt_mutex_unlock(&adap->bus_lock); ++ ++ return ret; ++} ++ ++static int gw_i2c_pld_get8(struct gpio_chip *chip, unsigned offset) ++{ ++ int ret; ++ s32 value; ++ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); ++ struct i2c_adapter *adap = gpio->client->adapter; ++ ++ if (in_atomic() || irqs_disabled()) { ++ ret = rt_mutex_trylock(&adap->bus_lock); ++ if (!ret) ++ /* I2C activity is ongoing. */ ++ return -EAGAIN; ++ } else { ++ rt_mutex_lock(&adap->bus_lock); ++ } ++ ++ value = i2c_pld_read_byte(gpio->client->addr); ++ ++ rt_mutex_unlock(&adap->bus_lock); ++ ++ return (value < 0) ? 0 : (value & (1 << offset)); ++} ++ ++static int gw_i2c_pld_output8(struct gpio_chip *chip, unsigned offset, int value) ++{ ++ int ret; ++ ++ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); ++ struct i2c_adapter *adap = gpio->client->adapter; ++ ++ unsigned bit = 1 << offset; ++ ++ if (in_atomic() || irqs_disabled()) { ++ ret = rt_mutex_trylock(&adap->bus_lock); ++ if (!ret) ++ /* I2C activity is ongoing. */ ++ return -EAGAIN; ++ } else { ++ rt_mutex_lock(&adap->bus_lock); ++ } ++ ++ ++ if (value) ++ gpio->out |= bit; ++ else ++ gpio->out &= ~bit; ++ ++ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); ++ ++ rt_mutex_unlock(&adap->bus_lock); ++ ++ return ret; ++} ++ ++static void gw_i2c_pld_set8(struct gpio_chip *chip, unsigned offset, int value) ++{ ++ gw_i2c_pld_output8(chip, offset, value); ++} ++ ++/*-------------------------------------------------------------------------*/ ++ ++static int gw_i2c_pld_probe(struct i2c_client *client, ++ const struct i2c_device_id *id) ++{ ++ struct gw_i2c_pld_platform_data *pdata; ++ struct gw_i2c_pld *gpio; ++ int status; ++ ++ pdata = client->dev.platform_data; ++ if (!pdata) ++ return -ENODEV; ++ ++ /* Allocate, initialize, and register this gpio_chip. */ ++ gpio = kzalloc(sizeof *gpio, GFP_KERNEL); ++ if (!gpio) ++ return -ENOMEM; ++ ++ gpio->chip.base = pdata->gpio_base; ++ gpio->chip.can_sleep = 1; ++ gpio->chip.dev = &client->dev; ++ gpio->chip.owner = THIS_MODULE; ++ ++ gpio->chip.ngpio = pdata->nr_gpio; ++ gpio->chip.direction_input = gw_i2c_pld_input8; ++ gpio->chip.get = gw_i2c_pld_get8; ++ gpio->chip.direction_output = gw_i2c_pld_output8; ++ gpio->chip.set = gw_i2c_pld_set8; ++ ++ gpio->chip.label = client->name; ++ ++ gpio->client = client; ++ i2c_set_clientdata(client, gpio); ++ ++ gpio->out = 0xFF; ++ ++ status = gpiochip_add(&gpio->chip); ++ if (status < 0) ++ goto fail; ++ ++ dev_info(&client->dev, "gpios %d..%d on a %s%s\n", ++ gpio->chip.base, ++ gpio->chip.base + gpio->chip.ngpio - 1, ++ client->name, ++ client->irq ? " (irq ignored)" : ""); ++ ++ /* Let platform code set up the GPIOs and their users. ++ * Now is the first time anyone could use them. ++ */ ++ if (pdata->setup) { ++ status = pdata->setup(client, ++ gpio->chip.base, gpio->chip.ngpio, ++ pdata->context); ++ if (status < 0) ++ dev_warn(&client->dev, "setup --> %d\n", status); ++ } ++ ++ return 0; ++ ++fail: ++ dev_dbg(&client->dev, "probe error %d for '%s'\n", ++ status, client->name); ++ kfree(gpio); ++ return status; ++} ++ ++static int gw_i2c_pld_remove(struct i2c_client *client) ++{ ++ struct gw_i2c_pld_platform_data *pdata = client->dev.platform_data; ++ struct gw_i2c_pld *gpio = i2c_get_clientdata(client); ++ int status = 0; ++ ++ if (pdata->teardown) { ++ status = pdata->teardown(client, ++ gpio->chip.base, gpio->chip.ngpio, ++ pdata->context); ++ if (status < 0) { ++ dev_err(&client->dev, "%s --> %d\n", ++ "teardown", status); ++ return status; ++ } ++ } ++ ++ gpiochip_remove(&gpio->chip); ++ kfree(gpio); ++ return 0; ++} ++ ++static struct i2c_driver gw_i2c_pld_driver = { ++ .driver = { ++ .name = "gw_i2c_pld", ++ .owner = THIS_MODULE, ++ }, ++ .probe = gw_i2c_pld_probe, ++ .remove = gw_i2c_pld_remove, ++ .id_table = gw_i2c_pld_id, ++}; ++ ++static int __init gw_i2c_pld_init(void) ++{ ++ return i2c_add_driver(&gw_i2c_pld_driver); ++} ++module_init(gw_i2c_pld_init); ++ ++static void __exit gw_i2c_pld_exit(void) ++{ ++ i2c_del_driver(&gw_i2c_pld_driver); ++} ++module_exit(gw_i2c_pld_exit); ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Chris Lang"); +--- /dev/null ++++ b/include/linux/i2c/gw_i2c_pld.h +@@ -0,0 +1,20 @@ ++#ifndef __LINUX_GW_I2C_PLD_H ++#define __LINUX_GW_I2C_PLD_H ++ ++/** ++ * The Gateworks I2C PLD Implements an additional 8 bits of GPIO through the PLD ++ */ ++ ++struct gw_i2c_pld_platform_data { ++ unsigned gpio_base; ++ unsigned nr_gpio; ++ int (*setup)(struct i2c_client *client, ++ int gpio, unsigned ngpio, ++ void *context); ++ int (*teardown)(struct i2c_client *client, ++ int gpio, unsigned ngpio, ++ void *context); ++ void *context; ++}; ++ ++#endif /* __LINUX_GW_I2C_PLD_H */ diff --git a/target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch b/target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch new file mode 100644 index 000000000..0e5179327 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch @@ -0,0 +1,73 @@ +--- a/arch/arm/mach-ixp4xx/common.c ++++ b/arch/arm/mach-ixp4xx/common.c +@@ -93,22 +93,7 @@ void __init ixp4xx_map_io(void) + /* + * GPIO-functions + */ +-/* +- * The following converted to the real HW bits the gpio_line_config +- */ +-/* GPIO pin types */ +-#define IXP4XX_GPIO_OUT 0x1 +-#define IXP4XX_GPIO_IN 0x2 +- +-/* GPIO signal types */ +-#define IXP4XX_GPIO_LOW 0 +-#define IXP4XX_GPIO_HIGH 1 +- +-/* GPIO Clocks */ +-#define IXP4XX_GPIO_CLK_0 14 +-#define IXP4XX_GPIO_CLK_1 15 +- +-static void gpio_line_config(u8 line, u32 direction) ++void gpio_line_config(u8 line, u32 direction) + { + if (direction == IXP4XX_GPIO_IN) + *IXP4XX_GPIO_GPOER |= (1 << line); +@@ -116,17 +101,17 @@ static void gpio_line_config(u8 line, u3 + *IXP4XX_GPIO_GPOER &= ~(1 << line); + } + +-static void gpio_line_get(u8 line, int *value) ++void gpio_line_get(u8 line, int *value) + { + *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1; + } + +-static void gpio_line_set(u8 line, int value) ++void gpio_line_set(u8 line, int value) + { +- if (value == IXP4XX_GPIO_HIGH) +- *IXP4XX_GPIO_GPOUTR |= (1 << line); +- else if (value == IXP4XX_GPIO_LOW) ++ if (value == IXP4XX_GPIO_LOW) + *IXP4XX_GPIO_GPOUTR &= ~(1 << line); ++ else ++ *IXP4XX_GPIO_GPOUTR |= (1 << line); + } + + /************************************************************************* +--- a/arch/arm/mach-ixp4xx/include/mach/platform.h ++++ b/arch/arm/mach-ixp4xx/include/mach/platform.h +@@ -131,5 +131,21 @@ struct pci_sys_data; + extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); + extern struct pci_ops ixp4xx_ops; + ++/* GPIO pin types */ ++#define IXP4XX_GPIO_OUT 0x1 ++#define IXP4XX_GPIO_IN 0x2 ++ ++/* GPIO signal types */ ++#define IXP4XX_GPIO_LOW 0 ++#define IXP4XX_GPIO_HIGH 1 ++ ++/* GPIO Clocks */ ++#define IXP4XX_GPIO_CLK_0 14 ++#define IXP4XX_GPIO_CLK_1 15 ++ ++void gpio_line_config(u8 line, u32 direction); ++void gpio_line_get(u8 line, int *value); ++void gpio_line_set(u8 line, int value); ++ + #endif // __ASSEMBLY__ + diff --git a/target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch b/target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch new file mode 100644 index 000000000..c6392ef2f --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch @@ -0,0 +1,18 @@ +--- a/arch/arm/tools/mach-types ++++ b/arch/arm/tools/mach-types +@@ -1006,3 +1006,15 @@ eco5_bx2 MACH_ECO5_BX2 ECO5_BX2 4572 + eukrea_cpuimx28sd MACH_EUKREA_CPUIMX28SD EUKREA_CPUIMX28SD 4573 + domotab MACH_DOMOTAB DOMOTAB 4574 + pfla03 MACH_PFLA03 PFLA03 4575 ++wg302v1 MACH_WG302V1 WG302V1 889 ++pronghorn MACH_PRONGHORN PRONGHORN 928 ++pronghorn_metro MACH_PRONGHORNMETRO PRONGHORNMETRO 1040 ++sidewinder MACH_SIDEWINDER SIDEWINDER 1041 ++wrt300nv2 MACH_WRT300NV2 WRT300NV2 1077 ++compex42x MACH_COMPEXWP18 COMPEXWP18 1273 ++cambria MACH_CAMBRIA CAMBRIA 1468 ++ap1000 MACH_AP1000 AP1000 1543 ++tw2662 MACH_TW2662 TW2662 1658 ++tw5334 MACH_TW5334 TW5334 1664 ++usr8200 MACH_USR8200 USR8200 1762 ++mi424wr MACH_MI424WR MI424WR 1778 diff --git a/target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch b/target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch new file mode 100644 index 000000000..2b4db053c --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch @@ -0,0 +1,17 @@ +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -278,11 +278,11 @@ + /* + * Configuration information + */ +-#define INPUT_POOL_SHIFT 12 ++#define INPUT_POOL_SHIFT 13 + #define INPUT_POOL_WORDS (1 << (INPUT_POOL_SHIFT-5)) +-#define OUTPUT_POOL_SHIFT 10 ++#define OUTPUT_POOL_SHIFT 11 + #define OUTPUT_POOL_WORDS (1 << (OUTPUT_POOL_SHIFT-5)) +-#define SEC_XFER_SIZE 512 ++#define SEC_XFER_SIZE 1024 + #define EXTRACT_SIZE 10 + + #define DEBUG_RANDOM_BOOT 0 diff --git a/target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch new file mode 100644 index 000000000..317103fda --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch @@ -0,0 +1,78 @@ +--- a/arch/arm/mach-ixp4xx/gateway7001-setup.c ++++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -75,9 +76,37 @@ static struct platform_device gateway700 + .resource = &gateway7001_uart_resource, + }; + ++static struct eth_plat_info gateway7001_plat_eth[] = { ++ { ++ .phy = 1, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 2, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device gateway7001_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = gateway7001_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = gateway7001_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ + static struct platform_device *gateway7001_devices[] __initdata = { + &gateway7001_flash, +- &gateway7001_uart ++ &gateway7001_uart, ++ &gateway7001_eth[0], ++ &gateway7001_eth[1], + }; + + static void __init gateway7001_init(void) +--- a/arch/arm/mach-ixp4xx/wg302v2-setup.c ++++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c +@@ -76,9 +76,26 @@ static struct platform_device wg302v2_ua + .resource = &wg302v2_uart_resource, + }; + ++static struct eth_plat_info wg302v2_plat_eth[] = { ++ { ++ .phy = 8, ++ .rxq = 3, ++ .txreadyq = 20, ++ } ++}; ++ ++static struct platform_device wg302v2_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = wg302v2_plat_eth, ++ } ++}; ++ + static struct platform_device *wg302v2_devices[] __initdata = { + &wg302v2_flash, + &wg302v2_uart, ++ &wg302v2_eth[0], + }; + + static void __init wg302v2_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch b/target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch new file mode 100644 index 000000000..8793549c6 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch @@ -0,0 +1,261 @@ +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -13,6 +13,7 @@ CONFIG_MACH_AVILA=y + CONFIG_MACH_LOFT=y + CONFIG_ARCH_ADI_COYOTE=y + CONFIG_MACH_GATEWAY7001=y ++CONFIG_MACH_WG302V1=y + CONFIG_MACH_WG302V2=y + CONFIG_ARCH_IXDP425=y + CONFIG_MACH_IXDPG425=y +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -45,6 +45,14 @@ config MACH_GATEWAY7001 + 7001 Access Point. For more information on this platform, + see http://openwrt.org + ++config MACH_WG302V1 ++ bool "Netgear WG302 v1 / WAG302 v1" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Netgear's ++ WG302 v1 or WAG302 v1 Access Points. For more information ++ on this platform, see http://openwrt.org ++ + config MACH_WG302V2 + bool "Netgear WG302 v2 / WAG302 v2" + select PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -15,6 +15,7 @@ obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-p + obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o + obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o + obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o ++obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o + obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o + obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o +@@ -33,6 +34,7 @@ obj-$(CONFIG_MACH_NSLU2) += nslu2-setup. + obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o + obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o + obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o ++obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o + obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o + obj-$(CONFIG_MACH_FSG) += fsg-setup.o + obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wg302v1-pci.c +@@ -0,0 +1,63 @@ ++/* ++ * arch/arch/mach-ixp4xx/wg302v1-pci.c ++ * ++ * PCI setup routines for the Netgear WG302 v1 and WAG302 v1 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Software, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init wg302v1_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init wg302v1_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO8; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else ++ return -1; ++} ++ ++struct hw_pci wg302v1_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = wg302v1_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = wg302v1_map_irq, ++}; ++ ++int __init wg302v1_pci_init(void) ++{ ++ if (machine_is_wg302v1()) ++ pci_common_init(&wg302v1_pci); ++ return 0; ++} ++ ++subsys_initcall(wg302v1_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c +@@ -0,0 +1,147 @@ ++/* ++ * arch/arm/mach-ixp4xx/wg302v1-setup.c ++ * ++ * Board setup for the Netgear WG302 v1 and WAG302 v1 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data wg302v1_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource wg302v1_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device wg302v1_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &wg302v1_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &wg302v1_flash_resource, ++}; ++ ++static struct resource wg302v1_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++static struct plat_serial8250_port wg302v1_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device wg302v1_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = wg302v1_uart_data, ++ }, ++ .num_resources = 2, ++ .resource = wg302v1_uart_resources, ++}; ++ ++static struct eth_plat_info wg302v1_plat_eth[] = { ++ { ++ .phy = 30, ++ .rxq = 3, ++ .txreadyq = 20, ++ } ++}; ++ ++static struct platform_device wg302v1_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = wg302v1_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *wg302v1_devices[] __initdata = { ++ &wg302v1_flash, ++ &wg302v1_uart, ++ &wg302v1_eth[0], ++}; ++ ++static void __init wg302v1_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices)); ++} ++ ++#ifdef CONFIG_MACH_WG302V1 ++MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1") ++ /* Maintainer: Imre Kaloz */ ++ .fixup = wg302v1_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = wg302v1_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch b/target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch new file mode 100644 index 000000000..d1fdfcba4 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch @@ -0,0 +1,393 @@ +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -15,6 +15,8 @@ CONFIG_ARCH_ADI_COYOTE=y + CONFIG_MACH_GATEWAY7001=y + CONFIG_MACH_WG302V1=y + CONFIG_MACH_WG302V2=y ++CONFIG_MACH_PRONGHORN=y ++CONFIG_MACH_PRONGHORNMETRO=y + CONFIG_ARCH_IXDP425=y + CONFIG_MACH_IXDPG425=y + CONFIG_MACH_IXDP465=y +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -61,6 +61,22 @@ config MACH_WG302V2 + WG302 v2 or WAG302 v2 Access Points. For more information + on this platform, see http://openwrt.org + ++config MACH_PRONGHORN ++ bool "ADI Pronghorn series" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the ADI ++ Engineering Pronghorn series. For more ++ information on this platform, see http://www.adiengineering.com ++ ++# ++# There're only minimal differences kernel-wise between the Pronghorn and ++# Pronghorn Metro boards - they use different chip selects to drive the ++# CF slot connected to the expansion bus, so we just enable them together. ++# ++config MACH_PRONGHORNMETRO ++ def_bool MACH_PRONGHORN ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_WG302V1) += wg302 + obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o + obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o ++obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o + + obj-y += common.o + +@@ -39,6 +40,7 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se + obj-$(CONFIG_MACH_FSG) += fsg-setup.o + obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o + obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o ++obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -42,7 +42,8 @@ static __inline__ void __arch_decomp_set + */ + if (machine_is_adi_coyote() || machine_is_gtwx5715() || + machine_is_gateway7001() || machine_is_wg302v2() || +- machine_is_devixp() || machine_is_miccpt() || machine_is_mic256()) ++ machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || ++ machine_is_pronghorn() || machine_is_pronghorn_metro()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/pronghorn-pci.c +@@ -0,0 +1,69 @@ ++/* ++ * arch/arch/mach-ixp4xx/pronghorn-pci.c ++ * ++ * PCI setup routines for ADI Engineering Pronghorn series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init pronghorn_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init pronghorn_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 13) ++ return IRQ_IXP4XX_GPIO4; ++ else if (slot == 14) ++ return IRQ_IXP4XX_GPIO6; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 16) ++ return IRQ_IXP4XX_GPIO1; ++ else ++ return -1; ++} ++ ++struct hw_pci pronghorn_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = pronghorn_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = pronghorn_map_irq, ++}; ++ ++int __init pronghorn_pci_init(void) ++{ ++ if (machine_is_pronghorn() || machine_is_pronghorn_metro()) ++ pci_common_init(&pronghorn_pci); ++ return 0; ++} ++ ++subsys_initcall(pronghorn_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c +@@ -0,0 +1,252 @@ ++/* ++ * arch/arm/mach-ixp4xx/pronghorn-setup.c ++ * ++ * Board setup for the ADI Engineering Pronghorn series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data pronghorn_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource pronghorn_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device pronghorn_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &pronghorn_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &pronghorn_flash_resource, ++}; ++ ++static struct resource pronghorn_uart_resources [] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port pronghorn_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device pronghorn_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = pronghorn_uart_data, ++ }, ++ .num_resources = 2, ++ .resource = pronghorn_uart_resources, ++}; ++ ++static struct i2c_gpio_platform_data pronghorn_i2c_gpio_data = { ++ .sda_pin = 9, ++ .scl_pin = 10, ++}; ++ ++static struct platform_device pronghorn_i2c_gpio = { ++ .name = "i2c-gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &pronghorn_i2c_gpio_data, ++ }, ++}; ++ ++static struct gpio_led pronghorn_led_pin[] = { ++ { ++ .name = "pronghorn:green:status", ++ .gpio = 7, ++ } ++}; ++ ++static struct gpio_led_platform_data pronghorn_led_data = { ++ .num_leds = 1, ++ .leds = pronghorn_led_pin, ++}; ++ ++static struct platform_device pronghorn_led = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &pronghorn_led_data, ++}; ++ ++static struct resource pronghorn_pata_resources[] = { ++ { ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "intrq", ++ .start = IRQ_IXP4XX_GPIO0, ++ .end = IRQ_IXP4XX_GPIO0, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct ixp4xx_pata_data pronghorn_pata_data = { ++ .cs0_bits = 0xbfff0043, ++ .cs1_bits = 0xbfff0043, ++}; ++ ++static struct platform_device pronghorn_pata = { ++ .name = "pata_ixp4xx_cf", ++ .id = 0, ++ .dev.platform_data = &pronghorn_pata_data, ++ .num_resources = ARRAY_SIZE(pronghorn_pata_resources), ++ .resource = pronghorn_pata_resources, ++}; ++ ++static struct eth_plat_info pronghorn_plat_eth[] = { ++ { ++ .phy = 0, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device pronghorn_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = pronghorn_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = pronghorn_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *pronghorn_devices[] __initdata = { ++ &pronghorn_flash, ++ &pronghorn_uart, ++ &pronghorn_led, ++ &pronghorn_eth[0], ++ &pronghorn_eth[1], ++}; ++ ++static void __init pronghorn_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ pronghorn_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ pronghorn_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(pronghorn_devices, ARRAY_SIZE(pronghorn_devices)); ++ ++ if (machine_is_pronghorn()) { ++ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(2); ++ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(2); ++ ++ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(3); ++ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(3); ++ ++ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS2; ++ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS3; ++ } else { ++ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(3); ++ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(3); ++ ++ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(4); ++ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(4); ++ ++ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS3; ++ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS4; ++ ++ platform_device_register(&pronghorn_i2c_gpio); ++ } ++ ++ platform_device_register(&pronghorn_pata); ++} ++ ++MACHINE_START(PRONGHORN, "ADI Engineering Pronghorn") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = pronghorn_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++ ++MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = pronghorn_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch b/target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch new file mode 100644 index 000000000..ed9f7a785 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch @@ -0,0 +1,44 @@ +--- a/arch/arm/mach-ixp4xx/pronghorn-setup.c ++++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c +@@ -52,31 +52,31 @@ static struct platform_device pronghorn_ + + static struct resource pronghorn_uart_resources [] = { + { +- .start = IXP4XX_UART1_BASE_PHYS, +- .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, + .flags = IORESOURCE_MEM + }, + { +- .start = IXP4XX_UART2_BASE_PHYS, +- .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, + .flags = IORESOURCE_MEM + } + }; + + static struct plat_serial8250_port pronghorn_uart_data[] = { + { +- .mapbase = IXP4XX_UART1_BASE_PHYS, +- .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, +- .irq = IRQ_IXP4XX_UART1, ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = IXP4XX_UART_XTAL, + }, + { +- .mapbase = IXP4XX_UART2_BASE_PHYS, +- .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, +- .irq = IRQ_IXP4XX_UART2, ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + .iotype = UPIO_MEM, + .regshift = 2, diff --git a/target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch b/target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch new file mode 100644 index 000000000..20adbb5c0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch @@ -0,0 +1,286 @@ +From 95dac4a842a3c66f69f949b48f9075e16275f77b Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 30 Jun 2013 15:48:47 +0200 +Subject: [PATCH 07/36] 115-sidewinder_support.patch + +--- + arch/arm/mach-ixp4xx/Kconfig | 10 +- + arch/arm/mach-ixp4xx/Makefile | 2 + + arch/arm/mach-ixp4xx/sidewinder-pci.c | 68 ++++++++++++++ + arch/arm/mach-ixp4xx/sidewinder-setup.c | 151 +++++++++++++++++++++++++++++++ + 4 files changed, 230 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/mach-ixp4xx/sidewinder-pci.c + create mode 100644 arch/arm/mach-ixp4xx/sidewinder-setup.c + +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -77,6 +77,14 @@ config MACH_PRONGHORN + config MACH_PRONGHORNMETRO + def_bool MACH_PRONGHORN + ++config MACH_SIDEWINDER ++ bool "ADI Sidewinder" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the ADI ++ Engineering Sidewinder board. For more information on this ++ platform, see http://www.adiengineering.com ++ + config ARCH_IXDP425 + bool "IXDP425" + help +@@ -173,7 +181,7 @@ config MACH_ARCOM_VULCAN + # + config CPU_IXP46X + bool +- depends on MACH_IXDP465 ++ depends on MACH_IXDP465 || MACH_SIDEWINDER + default y + + config CPU_IXP43X +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -20,6 +20,7 @@ obj-pci-$(CONFIG_MACH_WG302V2) += wg302 + obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o + obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o ++obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o + + obj-y += common.o + +@@ -41,6 +42,7 @@ obj-$(CONFIG_MACH_FSG) += fsg-setup.o + obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o + obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o + obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o ++obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/sidewinder-pci.c +@@ -0,0 +1,67 @@ ++/* ++ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c ++ * ++ * PCI setup routines for ADI Engineering Sidewinder ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++void __init sidewinder_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init sidewinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else if (slot == 3) ++ return IRQ_IXP4XX_GPIO9; ++ else ++ return -1; ++} ++ ++struct hw_pci sidewinder_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = sidewinder_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = sidewinder_map_irq, ++}; ++ ++int __init sidewinder_pci_init(void) ++{ ++ if (machine_is_sidewinder()) ++ pci_common_init(&sidewinder_pci); ++ return 0; ++} ++ ++subsys_initcall(sidewinder_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/sidewinder-setup.c +@@ -0,0 +1,155 @@ ++/* ++ * arch/arm/mach-ixp4xx/sidewinder-setup.c ++ * ++ * Board setup for the ADI Engineering Sidewinder ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++static struct flash_platform_data sidewinder_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource sidewinder_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device sidewinder_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &sidewinder_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &sidewinder_flash_resource, ++}; ++ ++static struct resource sidewinder_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++static struct plat_serial8250_port sidewinder_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device sidewinder_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = sidewinder_uart_data, ++ }, ++ .num_resources = ARRAY_SIZE(sidewinder_uart_resources), ++ .resource = sidewinder_uart_resources, ++}; ++ ++static struct eth_plat_info sidewinder_plat_eth[] = { ++ { ++ .phy = 5, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, ++ .rxq = 4, ++ .txreadyq = 21, ++ }, { ++ .phy = 31, ++ .rxq = 2, ++ .txreadyq = 19, ++ } ++}; ++ ++static struct platform_device sidewinder_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = sidewinder_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = sidewinder_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEA, ++ .dev.platform_data = sidewinder_plat_eth + 2, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *sidewinder_devices[] __initdata = { ++ &sidewinder_flash, ++ &sidewinder_uart, ++ &sidewinder_eth[0], ++ &sidewinder_eth[1], ++ &sidewinder_eth[2], ++}; ++ ++static void __init sidewinder_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices)); ++} ++ ++MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = sidewinder_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch b/target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch new file mode 100644 index 000000000..7d633f713 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch @@ -0,0 +1,30 @@ +--- a/drivers/mtd/redboot.c ++++ b/drivers/mtd/redboot.c +@@ -30,6 +30,8 @@ + #include + #include + ++#include ++ + struct fis_image_desc { + unsigned char name[16]; // Null terminated name + uint32_t flash_base; // Address within FLASH of image +@@ -47,7 +49,8 @@ struct fis_list { + struct fis_list *next; + }; + +-static int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; ++int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; ++ + module_param(directory, int, 0); + + static inline int redboot_checksum(struct fis_image_desc *img) +@@ -75,6 +78,8 @@ static int parse_redboot_partitions(stru + #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED + static char nullstring[] = "unallocated"; + #endif ++ if (machine_is_sidewinder()) ++ directory = -5; + + if ( directory < 0 ) { + offset = master->size + directory * master->erasesize; diff --git a/target/linux/ixp4xx/patches-4.9/120-compex_support.patch b/target/linux/ixp4xx/patches-4.9/120-compex_support.patch new file mode 100644 index 000000000..2abc159f0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/120-compex_support.patch @@ -0,0 +1,199 @@ +From 24025a2dcf1248079dd3019fac6ed955252d277f Mon Sep 17 00:00:00 2001 +From: Imre Kaloz +Date: Mon, 14 Jul 2008 21:56:34 +0200 +Subject: [PATCH] Add support for the Compex WP18 / NP18A boards + +Signed-off-by: Imre Kaloz +--- + +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -85,6 +85,14 @@ config MACH_SIDEWINDER + Engineering Sidewinder board. For more information on this + platform, see http://www.adiengineering.com + ++config MACH_COMPEXWP18 ++ bool "Compex WP18 / NP18A" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Compex' ++ WP18 or NP18A boards. For more information on this ++ platform, see http://www.compex.com.sg/home/OEM/product_ap.htm ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -21,6 +21,7 @@ obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o + obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o + obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o ++obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + + obj-y += common.o + +@@ -43,6 +44,7 @@ obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_ + obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o + obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o + obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o ++obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/compex42x-setup.c +@@ -0,0 +1,141 @@ ++/* ++ * arch/arm/mach-ixp4xx/compex-setup.c ++ * ++ * Compex WP18 / NP18A board-setup ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++static struct flash_platform_data compex42x_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource compex42x_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device compex42x_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &compex42x_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &compex42x_flash_resource, ++}; ++ ++static struct resource compex42x_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port compex42x_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device compex42x_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = compex42x_uart_data, ++ .num_resources = 2, ++ .resource = compex42x_uart_resources, ++}; ++ ++static struct eth_plat_info compex42x_plat_eth[] = { ++ { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0xf0000, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 3, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device compex42x_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = compex42x_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = compex42x_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *compex42x_devices[] __initdata = { ++ &compex42x_flash, ++ &compex42x_uart, ++ &compex42x_eth[0], ++ &compex42x_eth[1], ++}; ++ ++static void __init compex42x_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ compex42x_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ compex42x_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ platform_add_devices(compex42x_devices, ARRAY_SIZE(compex42x_devices)); ++} ++ ++MACHINE_START(COMPEXWP18, "Compex WP18 / NP18A") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = compex42x_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END +--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c +@@ -69,7 +69,8 @@ struct hw_pci ixdp425_pci __initdata = { + int __init ixdp425_pci_init(void) + { + if (machine_is_ixdp425() || machine_is_ixcdp1100() || +- machine_is_ixdp465() || machine_is_kixrp435()) ++ machine_is_ixdp465() || machine_is_kixrp435() || ++ machine_is_compex42x()) + pci_common_init(&ixdp425_pci); + return 0; + } diff --git a/target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch b/target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch new file mode 100644 index 000000000..49359be44 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch @@ -0,0 +1,227 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -93,6 +93,14 @@ config MACH_COMPEXWP18 + WP18 or NP18A boards. For more information on this + platform, see http://www.compex.com.sg/home/OEM/product_ap.htm + ++config MACH_WRT300NV2 ++ bool "Linksys WRT300N v2" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Linksys' ++ WRT300N v2 router. For more information on this ++ platform, see http://openwrt.org ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -22,6 +22,7 @@ obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += v + obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o + obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o ++obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + + obj-y += common.o + +@@ -45,6 +46,7 @@ obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulca + obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o + obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o ++obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -43,7 +43,8 @@ static __inline__ void __arch_decomp_set + if (machine_is_adi_coyote() || machine_is_gtwx5715() || + machine_is_gateway7001() || machine_is_wg302v2() || + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || +- machine_is_pronghorn() || machine_is_pronghorn_metro()) ++ machine_is_pronghorn() || machine_is_pronghorn_metro() || ++ machine_is_wrt300nv2()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-pci.c +@@ -0,0 +1,64 @@ ++/* ++ * arch/arch/mach-ixp4xx/wrt300nv2-pci.c ++ * ++ * PCI setup routines for Linksys WRT300N v2 ++ * ++ * Copyright (C) 2007 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++extern void ixp4xx_pci_preinit(void); ++extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); ++extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); ++ ++void __init wrt300nv2_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init wrt300nv2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO8; ++ else return -1; ++} ++ ++struct hw_pci wrt300nv2_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = wrt300nv2_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = wrt300nv2_map_irq, ++}; ++ ++int __init wrt300nv2_pci_init(void) ++{ ++ if (machine_is_wrt300nv2()) ++ pci_common_init(&wrt300nv2_pci); ++ return 0; ++} ++ ++subsys_initcall(wrt300nv2_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c +@@ -0,0 +1,110 @@ ++/* ++ * arch/arm/mach-ixp4xx/wrt300nv2-setup.c ++ * ++ * Board setup for the Linksys WRT300N v2 ++ * ++ * Copyright (C) 2007 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data wrt300nv2_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource wrt300nv2_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device wrt300nv2_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &wrt300nv2_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &wrt300nv2_flash_resource, ++}; ++ ++static struct resource wrt300nv2_uart_resource = { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port wrt300nv2_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device wrt300nv2_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = wrt300nv2_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &wrt300nv2_uart_resource, ++}; ++ ++static struct platform_device *wrt300nv2_devices[] __initdata = { ++ &wrt300nv2_flash, ++ &wrt300nv2_uart ++}; ++ ++static void __init wrt300nv2_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices)); ++} ++ ++#ifdef CONFIG_MACH_WRT300NV2 ++MACHINE_START(WRT300NV2, "Linksys WRT300N v2") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = wrt300nv2_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch new file mode 100644 index 000000000..5debbf107 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch @@ -0,0 +1,42 @@ +--- a/arch/arm/mach-ixp4xx/wrt300nv2-setup.c ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c +@@ -76,9 +76,38 @@ static struct platform_device wrt300nv2_ + .resource = &wrt300nv2_uart_resource, + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info wrt300nv2_plat_eth[] = { ++ { ++ .phy = -1, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device wrt300nv2_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = wrt300nv2_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = wrt300nv2_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ + static struct platform_device *wrt300nv2_devices[] __initdata = { + &wrt300nv2_flash, +- &wrt300nv2_uart ++ &wrt300nv2_uart, ++ &wrt300nv2_eth[0], ++ &wrt300nv2_eth[1], + }; + + static void __init wrt300nv2_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch b/target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch new file mode 100644 index 000000000..99db2673d --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch @@ -0,0 +1,72 @@ +--- a/arch/arm/mach-ixp4xx/wrt300nv2-setup.c ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c +@@ -3,6 +3,7 @@ + * + * Board setup for the Linksys WRT300N v2 + * ++ * Copyright (C) 2010 Alexandros C. Couloumbis + * Copyright (C) 2007 Imre Kaloz + * + * based on coyote-setup.c: +@@ -18,6 +19,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -79,7 +81,8 @@ static struct platform_device wrt300nv2_ + /* Built-in 10/100 Ethernet MAC interfaces */ + static struct eth_plat_info wrt300nv2_plat_eth[] = { + { +- .phy = -1, ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x0F0000, + .rxq = 3, + .txreadyq = 20, + }, { +@@ -112,6 +115,10 @@ static struct platform_device *wrt300nv2 + + static void __init wrt300nv2_init(void) + { ++ uint8_t __iomem *f; ++ int offset = 0; ++ int i; ++ + ixp4xx_sys_init(); + + wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); +@@ -121,6 +128,32 @@ static void __init wrt300nv2_init(void) + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; + + platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices)); ++ ++ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x60000); ++ ++ if (f) { ++ for (i = 0; i < 6; i++) { ++#ifdef __ARMEB__ ++ wrt300nv2_plat_eth[0].hwaddr[i] = readb(f + 0x5FFA0 + i); ++ if (i == 5) ++ offset = 1; ++ wrt300nv2_plat_eth[1].hwaddr[i] = (wrt300nv2_plat_eth[0].hwaddr[i] + offset); ++#else ++ wrt300nv2_plat_eth[0].hwaddr[i] = readb(f + 0x5FFA0 + (i^3)); ++ if (i == 5) ++ offset = 1; ++ wrt300nv2_plat_eth[1].hwaddr[i] = (wrt300nv2_plat_eth[0].hwaddr[i] + offset); ++#endif ++ } ++ iounmap(f); ++ } ++ ++ if (!(is_valid_ether_addr(wrt300nv2_plat_eth[0].hwaddr))) ++ random_ether_addr(wrt300nv2_plat_eth[0].hwaddr); ++ if (!(is_valid_ether_addr(wrt300nv2_plat_eth[1].hwaddr))) { ++ memcpy(wrt300nv2_plat_eth[1].hwaddr, wrt300nv2_plat_eth[0].hwaddr, ETH_ALEN); ++ wrt300nv2_plat_eth[1].hwaddr[5] = (wrt300nv2_plat_eth[0].hwaddr[5] + 1); ++ } + } + + #ifdef CONFIG_MACH_WRT300NV2 diff --git a/target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch b/target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch new file mode 100644 index 000000000..fb5c3adb7 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch @@ -0,0 +1,201 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -101,6 +101,14 @@ config MACH_WRT300NV2 + WRT300N v2 router. For more information on this + platform, see http://openwrt.org + ++config MACH_AP1000 ++ bool "Lanready AP-1000" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Lanready's ++ AP1000 board. For more information on this ++ platform, see http://openwrt.org ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -23,6 +23,7 @@ obj-pci-$(CONFIG_MACH_PRONGHORN) += pron + obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o ++obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o + + obj-y += common.o + +@@ -47,6 +48,7 @@ obj-$(CONFIG_MACH_PRONGHORN) += pronghor + obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o ++obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/ap1000-setup.c +@@ -0,0 +1,152 @@ ++/* ++ * arch/arm/mach-ixp4xx/ap1000-setup.c ++ * ++ * Lanready AP-1000 ++ * ++ * Copyright (C) 2007 Imre Kaloz ++ * ++ * based on ixdp425-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data ap1000_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource ap1000_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device ap1000_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &ap1000_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &ap1000_flash_resource, ++}; ++ ++static struct resource ap1000_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port ap1000_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device ap1000_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = ap1000_uart_data, ++ .num_resources = 2, ++ .resource = ap1000_uart_resources ++}; ++ ++static struct platform_device *ap1000_devices[] __initdata = { ++ &ap1000_flash, ++ &ap1000_uart ++}; ++ ++static char ap1000_mem_fixup[] __initdata = "mem=64M "; ++ ++static void __init ap1000_fixup(struct tag *tags, char **cmdline) ++{ ++ struct tag *t = tags; ++ char *p = *cmdline; ++ ++ /* Find the end of the tags table, taking note of any cmdline tag. */ ++ for (; t->hdr.size; t = tag_next(t)) { ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ } ++ } ++ ++ /* Overwrite the end of the table with a new cmdline tag. */ ++ t->hdr.tag = ATAG_CMDLINE; ++ t->hdr.size = (sizeof (struct tag_header) + ++ strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2; ++ strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE); ++ strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p, ++ COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup)); ++ ++ /* Terminate the table. */ ++ t = tag_next(t); ++ t->hdr.tag = ATAG_NONE; ++ t->hdr.size = 0; ++} ++ ++static void __init ap1000_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ ap1000_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ ++ platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices)); ++} ++ ++#ifdef CONFIG_MACH_AP1000 ++MACHINE_START(AP1000, "Lanready AP-1000") ++ /* Maintainer: Imre Kaloz */ ++ .fixup = ap1000_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = ap1000_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif +--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c +@@ -70,7 +70,7 @@ int __init ixdp425_pci_init(void) + { + if (machine_is_ixdp425() || machine_is_ixcdp1100() || + machine_is_ixdp465() || machine_is_kixrp435() || +- machine_is_compex42x()) ++ machine_is_compex42x() || machine_is_ap1000()) + pci_common_init(&ixdp425_pci); + return 0; + } diff --git a/target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch new file mode 100644 index 000000000..a3ed2d066 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch @@ -0,0 +1,44 @@ +--- a/arch/arm/mach-ixp4xx/ap1000-setup.c ++++ b/arch/arm/mach-ixp4xx/ap1000-setup.c +@@ -91,9 +91,39 @@ static struct platform_device ap1000_uar + .resource = ap1000_uart_resources + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info ap1000_plat_eth[] = { ++ { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 5, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device ap1000_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = ap1000_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = ap1000_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ + static struct platform_device *ap1000_devices[] __initdata = { +- &ap1000_flash, +- &ap1000_uart ++ &ap1000_flash, ++ &ap1000_uart, ++ &ap1000_eth[0], ++ &ap1000_eth[1], + }; + + static char ap1000_mem_fixup[] __initdata = "mem=64M "; diff --git a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch new file mode 100644 index 000000000..1ac9e5f9f --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch @@ -0,0 +1,133 @@ +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -833,6 +833,7 @@ static int serial8250_probe(struct platf + uart.port.get_mctrl = p->get_mctrl; + uart.port.pm = p->pm; + uart.port.dev = &dev->dev; ++ uart.port.rw_delay = p->rw_delay; + uart.port.irqflags |= irqflag; + ret = serial8250_register_8250_port(&uart); + if (ret < 0) { +@@ -989,6 +990,7 @@ int serial8250_register_8250_port(struct + uart->bugs = up->bugs; + uart->port.mapbase = up->port.mapbase; + uart->port.mapsize = up->port.mapsize; ++ uart->port.rw_delay = up->port.rw_delay; + uart->port.private_data = up->port.private_data; + uart->tx_loadsz = up->tx_loadsz; + uart->capabilities = up->capabilities; +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -2229,6 +2229,7 @@ uart_report_port(struct uart_driver *drv + snprintf(address, sizeof(address), + "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); + break; ++ case UPIO_MEM_DELAY: + case UPIO_MEM: + case UPIO_MEM16: + case UPIO_MEM32: +@@ -2893,6 +2894,7 @@ int uart_match_port(struct uart_port *po + case UPIO_HUB6: + return (port1->iobase == port2->iobase) && + (port1->hub6 == port2->hub6); ++ case UPIO_MEM_DELAY: + case UPIO_MEM: + case UPIO_MEM16: + case UPIO_MEM32: +--- a/include/linux/serial_8250.h ++++ b/include/linux/serial_8250.h +@@ -28,6 +28,7 @@ struct plat_serial8250_port { + void *private_data; + unsigned char regshift; /* register shift */ + unsigned char iotype; /* UPIO_* */ ++ unsigned int rw_delay; /* udelay for slower busses IXP4XX Expansion Bus */ + unsigned char hub6; + upf_t flags; /* UPF_* flags */ + unsigned int type; /* If UPF_FIXED_TYPE */ +--- a/include/linux/serial_core.h ++++ b/include/linux/serial_core.h +@@ -152,6 +152,7 @@ struct uart_port { + #define UPIO_TSI (SERIAL_IO_TSI) /* Tsi108/109 type IO */ + #define UPIO_MEM32BE (SERIAL_IO_MEM32BE) /* 32b big endian */ + #define UPIO_MEM16 (SERIAL_IO_MEM16) /* 16b little endian */ ++#define UPIO_MEM_DELAY (SERIAL_IO_MEM_DELAY) + + unsigned int read_status_mask; /* driver specific */ + unsigned int ignore_status_mask; /* driver specific */ +@@ -233,6 +234,7 @@ struct uart_port { + int hw_stopped; /* sw-assisted CTS flow state */ + unsigned int mctrl; /* current modem ctrl settings */ + unsigned int timeout; /* character-based timeout */ ++ unsigned int rw_delay; /* udelay for slow busses, IXP4XX Expansion Bus */ + unsigned int type; /* port type */ + const struct uart_ops *ops; + unsigned int custom_divisor; +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -384,6 +384,20 @@ static unsigned int mem16_serial_in(stru + return readw(p->membase + offset); + } + ++static unsigned int memdelay_serial_in(struct uart_port *p, int offset) ++{ ++ struct uart_8250_port *up = (struct uart_8250_port *)p; ++ udelay(up->port.rw_delay); ++ return mem_serial_in(p, offset); ++} ++ ++static void memdelay_serial_out(struct uart_port *p, int offset, int value) ++{ ++ struct uart_8250_port *up = (struct uart_8250_port *)p; ++ udelay(up->port.rw_delay); ++ mem_serial_out(p, offset, value); ++} ++ + static void mem32_serial_out(struct uart_port *p, int offset, int value) + { + offset = offset << p->regshift; +@@ -456,6 +470,11 @@ static void set_io_from_upio(struct uart + p->serial_out = mem32be_serial_out; + break; + ++ case UPIO_MEM_DELAY: ++ p->serial_in = memdelay_serial_in; ++ p->serial_out = memdelay_serial_out; ++ break; ++ + #ifdef CONFIG_SERIAL_8250_RT288X + case UPIO_AU: + p->serial_in = au_serial_in; +@@ -483,6 +502,7 @@ serial_port_out_sync(struct uart_port *p + case UPIO_MEM16: + case UPIO_MEM32: + case UPIO_MEM32BE: ++ case UPIO_MEM_DELAY: + case UPIO_AU: + p->serial_out(p, offset, value); + p->serial_in(p, UART_LCR); /* safe, no side-effects */ +@@ -2759,6 +2779,7 @@ static int serial8250_request_std_resour + case UPIO_MEM32BE: + case UPIO_MEM16: + case UPIO_MEM: ++ case UPIO_MEM_DELAY: + if (!port->mapbase) + break; + +@@ -2797,6 +2818,7 @@ static void serial8250_release_std_resou + case UPIO_MEM32BE: + case UPIO_MEM16: + case UPIO_MEM: ++ case UPIO_MEM_DELAY: + if (!port->mapbase) + break; + +--- a/include/uapi/linux/serial.h ++++ b/include/uapi/linux/serial.h +@@ -70,6 +70,7 @@ struct serial_struct { + #define SERIAL_IO_TSI 5 + #define SERIAL_IO_MEM32BE 6 + #define SERIAL_IO_MEM16 7 ++#define SERIAL_IO_MEM_DELAY 10 + + #define UART_CLEAR_FIFO 0x01 + #define UART_USE_FIFO 0x02 diff --git a/target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch b/target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch new file mode 100644 index 000000000..efa389d78 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch @@ -0,0 +1,37 @@ +--- a/arch/arm/mach-ixp4xx/wg302v1-setup.c ++++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c +@@ -117,6 +117,34 @@ static struct platform_device *wg302v1_d + &wg302v1_eth[0], + }; + ++static char wg302v1_mem_fixup[] __initdata = " mem=32M"; ++ ++static void __init wg302v1_fixup(struct tag *tags, char **cmdline) ++{ ++ struct tag *t = tags; ++ char *p = *cmdline; ++ size_t fixlen, cmdlen; ++ ++ /* Find the end of the tags table, taking note of any cmdline tag. */ ++ for (; t->hdr.size; t = tag_next(t)) { ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ } ++ } ++ ++ fixlen = strlen(wg302v1_mem_fixup); ++ cmdlen = strlen(p); ++ if (fixlen + cmdlen >= COMMAND_LINE_SIZE) ++ return; ++ ++ /* append the fixup to the cmdline */ ++ memmove(p + cmdlen, wg302v1_mem_fixup, fixlen + 1); ++ ++ /* Adjust the size of the atag if there was one */ ++ if (t->hdr.size) ++ t->hdr.size += fixlen; ++} ++ + static void __init wg302v1_init(void) + { + ixp4xx_sys_init(); diff --git a/target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch new file mode 100644 index 000000000..f7090cd1b --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch @@ -0,0 +1,51 @@ +--- a/arch/arm/mach-ixp4xx/coyote-setup.c ++++ b/arch/arm/mach-ixp4xx/coyote-setup.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -81,9 +82,39 @@ static struct platform_device coyote_uar + .resource = &coyote_uart_resource, + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info ixdpg425_plat_eth[] = { ++ { ++ .phy = 5, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 4, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device ixdpg425_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = ixdpg425_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = ixdpg425_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++ + static struct platform_device *coyote_devices[] __initdata = { + &coyote_flash, +- &coyote_uart ++ &coyote_uart, ++ &ixdpg425_eth[0], ++ &ixdpg425_eth[1], + }; + + static void __init coyote_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch b/target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch new file mode 100644 index 000000000..398344d18 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch @@ -0,0 +1,2093 @@ +--- a/sound/soc/Kconfig ++++ b/sound/soc/Kconfig +@@ -47,6 +47,7 @@ source "sound/soc/cirrus/Kconfig" + source "sound/soc/davinci/Kconfig" + source "sound/soc/dwc/Kconfig" + source "sound/soc/fsl/Kconfig" ++source "sound/soc/gw-avila/Kconfig" + source "sound/soc/jz4740/Kconfig" + source "sound/soc/nuc900/Kconfig" + source "sound/soc/omap/Kconfig" +--- a/sound/soc/Makefile ++++ b/sound/soc/Makefile +@@ -27,6 +27,7 @@ obj-$(CONFIG_SND_SOC) += cirrus/ + obj-$(CONFIG_SND_SOC) += davinci/ + obj-$(CONFIG_SND_SOC) += dwc/ + obj-$(CONFIG_SND_SOC) += fsl/ ++obj-$(CONFIG_SND_SOC) += gw-avila/ + obj-$(CONFIG_SND_SOC) += jz4740/ + obj-$(CONFIG_SND_SOC) += img/ + obj-$(CONFIG_SND_SOC) += intel/ +--- /dev/null ++++ b/sound/soc/gw-avila/Kconfig +@@ -0,0 +1,17 @@ ++config SND_GW_AVILA_SOC_PCM ++ tristate ++ ++config SND_GW_AVILA_SOC_HSS ++ tristate ++ ++config SND_GW_AVILA_SOC ++ tristate "SoC Audio for the Gateworks AVILA Family" ++ depends on ARCH_IXP4XX && SND_SOC ++ select SND_GW_AVILA_SOC_PCM ++ select SND_GW_AVILA_SOC_HSS ++ select SND_SOC_TLV320AIC3X ++ help ++ Say Y or M if you want to add support for codecs attached to ++ the Gateworks HSS interface. You will also need ++ to select the audio interfaces to support below. ++ +--- /dev/null ++++ b/sound/soc/gw-avila/Makefile +@@ -0,0 +1,8 @@ ++# Gateworks Avila HSS Platform Support ++snd-soc-gw-avila-objs := gw-avila.o ixp4xx_hss.o ++snd-soc-gw-avila-pcm-objs := gw-avila-pcm.o ++snd-soc-gw-avila-hss-objs := gw-avila-hss.o ++ ++obj-$(CONFIG_SND_GW_AVILA_SOC) += snd-soc-gw-avila.o ++obj-$(CONFIG_SND_GW_AVILA_SOC_PCM) += snd-soc-gw-avila-pcm.o ++obj-$(CONFIG_SND_GW_AVILA_SOC_HSS) += snd-soc-gw-avila-hss.o +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-hss.c +@@ -0,0 +1,103 @@ ++/* ++ * gw-avila-hss.c -- HSS Audio Support for Gateworks Avila ++ * ++ * Author: Chris Lang ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include "ixp4xx_hss.h" ++#include "gw-avila-hss.h" ++ ++#define gw_avila_hss_suspend NULL ++#define gw_avila_hss_resume NULL ++ ++struct snd_soc_dai_driver gw_avila_hss_dai = { ++ .playback = { ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | ++ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | ++ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | ++ SNDRV_PCM_RATE_KNOT), ++ .formats = SNDRV_PCM_FMTBIT_S16_LE, }, ++ .capture = { ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | ++ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | ++ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | ++ SNDRV_PCM_RATE_KNOT), ++ .formats = SNDRV_PCM_FMTBIT_S16_LE, }, ++}; ++ ++static const struct snd_soc_component_driver gw_avila_hss_component = { ++ .name = "gw_avila_hss", ++}; ++ ++static int gw_avila_hss_probe(struct platform_device *pdev) ++{ ++ int port = (pdev->id < 2) ? 0 : 1; ++ int channel = (pdev->id % 2); ++ ++ hss_handle[pdev->id] = hss_init(port, channel); ++ if (!hss_handle[pdev->id]) { ++ return -ENODEV; ++ } ++ ++ return snd_soc_register_component(&pdev->dev, &gw_avila_hss_component, ++ &gw_avila_hss_dai, 1); ++} ++ ++static int gw_avila_hss_remove(struct platform_device *pdev) ++{ ++ snd_soc_unregister_component(&pdev->dev); ++ ++ return 0; ++} ++ ++static struct platform_driver gw_avila_hss_driver = { ++ .probe = gw_avila_hss_probe, ++ .remove = gw_avila_hss_remove, ++ .driver = { ++ .name = "gw_avila_hss", ++ .owner = THIS_MODULE, ++ } ++}; ++ ++static int __init gw_avila_hss_init(void) ++{ ++ return platform_driver_register(&gw_avila_hss_driver); ++} ++module_init(gw_avila_hss_init); ++ ++static void __exit gw_avila_hss_exit(void) ++{ ++ platform_driver_unregister(&gw_avila_hss_driver); ++} ++module_exit(gw_avila_hss_exit); ++ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("HSS Audio Driver for Gateworks Avila"); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-hss.h +@@ -0,0 +1,12 @@ ++/* ++ * Author: Chris Lang ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#ifndef _GW_AVILA_HSS_H ++#define _GW_AVILA_HSS_H ++ ++#endif +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-pcm.c +@@ -0,0 +1,327 @@ ++/* ++ * ALSA PCM interface for the TI DAVINCI processor ++ * ++ * Author: Chris Lang, ++ * Copyright: (C) 2009 Gateworks Corporation ++ * ++ * Based On: davinci-evm.c, Author: Vladimir Barinov, ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "gw-avila-pcm.h" ++#include "gw-avila-hss.h" ++#include "ixp4xx_hss.h" ++ ++#define GW_AVILA_PCM_DEBUG 0 ++#if GW_AVILA_PCM_DEBUG ++#define DPRINTK(x...) printk(KERN_DEBUG x) ++#else ++#define DPRINTK(x...) ++#endif ++ ++static struct snd_pcm_hardware gw_avila_pcm_hardware = { ++ .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | ++ SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID), ++/* SNDRV_PCM_INFO_PAUSE),*/ ++ .formats = (SNDRV_PCM_FMTBIT_S16_LE), ++ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | ++ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | ++ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | ++ SNDRV_PCM_RATE_KNOT), ++ .rate_min = 8000, ++ .rate_max = 8000, ++ .channels_min = 2, ++ .channels_max = 2, ++ .buffer_bytes_max = 64 * 1024, // All of the lines below may need to be changed ++ .period_bytes_min = 128, ++ .period_bytes_max = 4 * 1024, ++ .periods_min = 16, ++ .periods_max = 32, ++ .fifo_size = 0, ++}; ++ ++struct gw_avila_runtime_data { ++ spinlock_t lock; ++ int period; /* current DMA period */ ++ int master_lch; /* Master DMA channel */ ++ int slave_lch; /* Slave DMA channel */ ++ struct gw_avila_pcm_dma_params *params; /* DMA params */ ++}; ++ ++static void gw_avila_dma_irq(void *data) ++{ ++ struct snd_pcm_substream *substream = data; ++ snd_pcm_period_elapsed(substream); ++} ++ ++static int gw_avila_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ int ret = 0; ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ hss_tx_start(hdev); ++ else ++ hss_rx_start(hdev); ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ hss_tx_stop(hdev); ++ else ++ hss_rx_stop(hdev); ++ break; ++ default: ++ ret = -EINVAL; ++ break; ++ } ++ return ret; ++} ++ ++static int gw_avila_pcm_prepare(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ++ hss_set_tx_callback(hdev, gw_avila_dma_irq, substream); ++ hss_config_tx_dma(hdev, runtime->dma_area, runtime->buffer_size, runtime->period_size); ++ } else { ++ hss_set_rx_callback(hdev, gw_avila_dma_irq, substream); ++ hss_config_rx_dma(hdev, runtime->dma_area, runtime->buffer_size, runtime->period_size); ++ } ++ ++ return 0; ++} ++ ++static snd_pcm_uframes_t ++gw_avila_pcm_pointer(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ ++ unsigned int curr = 0; ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ curr = hss_curr_offset_tx(hdev); ++ else ++ curr = hss_curr_offset_rx(hdev); ++ return curr; ++} ++ ++static int gw_avila_pcm_open(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ snd_soc_set_runtime_hwparams(substream, &gw_avila_pcm_hardware); ++ ++ if (hss_handle[cpu_dai->id] != NULL) ++ runtime->private_data = hss_handle[cpu_dai->id]; ++ else { ++ pr_err("hss_handle is NULL\n"); ++ return -1; ++ } ++ ++ hss_chan_open(hss_handle[cpu_dai->id]); ++ ++ return 0; ++} ++ ++static int gw_avila_pcm_close(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ++ memset(hdev->tx_buf, 0, runtime->buffer_size); ++ } else ++ memset(hdev->rx_buf, 0, runtime->buffer_size); ++ ++ hss_chan_close(hdev); ++ ++ return 0; ++} ++ ++static int gw_avila_pcm_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *hw_params) ++{ ++ return snd_pcm_lib_malloc_pages(substream, ++ params_buffer_bytes(hw_params)); ++} ++ ++static int gw_avila_pcm_hw_free(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ memset(runtime->dma_area, 0, runtime->buffer_size); ++ ++ return snd_pcm_lib_free_pages(substream); ++} ++ ++static int gw_avila_pcm_mmap(struct snd_pcm_substream *substream, ++ struct vm_area_struct *vma) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ ++ return dma_mmap_writecombine(substream->pcm->card->dev, vma, ++ runtime->dma_area, ++ runtime->dma_addr, ++ runtime->dma_bytes); ++} ++ ++struct snd_pcm_ops gw_avila_pcm_ops = { ++ .open = gw_avila_pcm_open, ++ .close = gw_avila_pcm_close, ++ .ioctl = snd_pcm_lib_ioctl, ++ .hw_params = gw_avila_pcm_hw_params, ++ .hw_free = gw_avila_pcm_hw_free, ++ .prepare = gw_avila_pcm_prepare, ++ .trigger = gw_avila_pcm_trigger, ++ .pointer = gw_avila_pcm_pointer, ++ .mmap = gw_avila_pcm_mmap, ++}; ++ ++static int gw_avila_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) ++{ ++ struct snd_pcm_substream *substream = pcm->streams[stream].substream; ++ struct snd_dma_buffer *buf = &substream->dma_buffer; ++ size_t size = gw_avila_pcm_hardware.buffer_bytes_max; ++ ++ buf->dev.type = SNDRV_DMA_TYPE_DEV; ++ buf->dev.dev = pcm->card->dev; ++ buf->private_data = NULL; ++ ++ buf->area = dma_alloc_coherent(pcm->card->dev, size, ++ &buf->addr, GFP_KERNEL); ++ ++ if (!buf->area) { ++ return -ENOMEM; ++ } ++ ++ memset(buf->area, 0xff, size); ++ ++ DPRINTK("preallocate_dma_buffer: area=%p, addr=%p, size=%d\n", ++ (void *) buf->area, (void *) buf->addr, size); ++ ++ buf->bytes = size; ++ ++ return 0; ++} ++ ++static void gw_avila_pcm_free(struct snd_pcm *pcm) ++{ ++ struct snd_pcm_substream *substream; ++ struct snd_dma_buffer *buf; ++ int stream; ++ ++ for (stream = 0; stream < 2; stream++) { ++ substream = pcm->streams[stream].substream; ++ if (!substream) ++ continue; ++ ++ buf = &substream->dma_buffer; ++ if (!buf->area) ++ continue; ++ ++ dma_free_coherent(NULL, buf->bytes, buf->area, 0); ++ buf->area = NULL; ++ } ++} ++ ++static u64 gw_avila_pcm_dmamask = 0xFFFFFFFF; ++ ++static int gw_avila_pcm_new(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_card *card = rtd->card->snd_card; ++ struct snd_pcm *pcm = rtd->pcm; ++ struct snd_soc_dai *dai = rtd->codec_dai; ++ int ret; ++ ++ if (!card->dev->dma_mask) ++ card->dev->dma_mask = &gw_avila_pcm_dmamask; ++ if (!card->dev->coherent_dma_mask) ++ card->dev->coherent_dma_mask = 0xFFFFFFFF; ++ ++ if (dai->driver->playback.channels_min) { ++ ret = gw_avila_pcm_preallocate_dma_buffer(pcm, ++ SNDRV_PCM_STREAM_PLAYBACK); ++ if (ret) ++ return ret; ++ } ++ ++ if (dai->driver->capture.channels_min) { ++ ret = gw_avila_pcm_preallocate_dma_buffer(pcm, ++ SNDRV_PCM_STREAM_CAPTURE); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} ++ ++struct snd_soc_platform_driver gw_avila_soc_platform = { ++ .ops = &gw_avila_pcm_ops, ++ .pcm_new = gw_avila_pcm_new, ++ .pcm_free = gw_avila_pcm_free, ++}; ++ ++static int gw_avila_pcm_platform_probe(struct platform_device *pdev) ++{ ++ return snd_soc_register_platform(&pdev->dev, &gw_avila_soc_platform); ++} ++ ++static int gw_avila_pcm_platform_remove(struct platform_device *pdev) ++{ ++ snd_soc_unregister_platform(&pdev->dev); ++ return 0; ++} ++ ++static struct platform_driver gw_avila_pcm_driver = { ++ .driver = { ++ .name = "gw_avila-audio", ++ .owner = THIS_MODULE, ++ }, ++ .probe = gw_avila_pcm_platform_probe, ++ .remove = gw_avila_pcm_platform_remove, ++}; ++ ++static int __init gw_avila_soc_platform_init(void) ++{ ++ return platform_driver_register(&gw_avila_pcm_driver); ++} ++module_init(gw_avila_soc_platform_init); ++ ++static void __exit gw_avila_soc_platform_exit(void) ++{ ++ platform_driver_unregister(&gw_avila_pcm_driver); ++} ++module_exit(gw_avila_soc_platform_exit); ++ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("Gateworks Avila PCM DMA module"); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-pcm.h +@@ -0,0 +1,32 @@ ++/* ++ * ALSA PCM interface for the Gateworks Avila platform ++ * ++ * Author: Chris Lang, ++ * Copyright: (C) 2009 Gateworks Corporation ++ * ++ * Based On: davinci-evm.c, Author: Vladimir Barinov, ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#ifndef _GW_AVILA_PCM_H ++#define _GW_AVILA_PCM_H ++ ++#if 0 ++struct gw_avila_pcm_dma_params { ++ char *name; /* stream identifier */ ++ int channel; /* sync dma channel ID */ ++ dma_addr_t dma_addr; /* device physical address for DMA */ ++ unsigned int data_type; /* xfer data type */ ++}; ++ ++struct gw_avila_snd_platform_data { ++ int tx_dma_ch; // XXX Do we need this? ++ int rx_dma_ch; // XXX Do we need this ++}; ++extern struct snd_soc_platform gw_avila_soc_platform[]; ++#endif ++ ++#endif +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila.c +@@ -0,0 +1,244 @@ ++/* ++ * File: sound/soc/gw-avila/gw_avila.c ++ * Author: Chris Lang ++ * ++ * Created: Tue June 06 2008 ++ * Description: Board driver for Gateworks Avila ++ * ++ * Modified: ++ * Copyright 2009 Gateworks Corporation ++ * ++ * Bugs: What Bugs? ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see the file COPYING, or write ++ * to the Free Software Foundation, Inc., ++ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ixp4xx_hss.h" ++#include "gw-avila-hss.h" ++#include "gw-avila-pcm.h" ++ ++#define CODEC_FREQ 33333000 ++ ++static int gw_avila_board_startup(struct snd_pcm_substream *substream) ++{ ++ pr_debug("%s enter\n", __func__); ++ return 0; ++} ++ ++static int gw_avila_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ int ret = 0; ++ ++ /* set codec DAI configuration */ ++ if (cpu_dai->id % 2) { ++ ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBS_CFS); ++ snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 1, 32); ++ } else { ++ ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBM_CFM); ++ snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 0, 32); ++ } ++ ++ if (ret < 0) ++ return ret; ++ ++ /* set the codec system clock */ ++ ret = snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_FREQ, SND_SOC_CLOCK_OUT); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = { ++ SND_SOC_DAPM_HP("Headphone Jack", NULL), ++ SND_SOC_DAPM_LINE("Line Out", NULL), ++ SND_SOC_DAPM_LINE("Line In", NULL), ++}; ++ ++static const struct snd_soc_dapm_route audio_map[] = { ++ {"Headphone Jack", NULL, "HPLOUT"}, ++ {"Headphone Jack", NULL, "HPROUT"}, ++ ++ /* Line Out connected to LLOUT, RLOUT */ ++ {"Line Out", NULL, "LLOUT"}, ++ {"Line Out", NULL, "RLOUT"}, ++ ++ /* Line In connected to (LINE1L | LINE2L), (LINE1R | LINE2R) */ ++ {"LINE1L", NULL, "Line In"}, ++ {"LINE1R", NULL, "Line In"}, ++}; ++ ++/* Logic for a aic3x as connected on a davinci-evm */ ++static int avila_aic3x_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); ++ ++ /* Add davinci-evm specific widgets */ ++ snd_soc_dapm_new_controls(dapm, aic3x_dapm_widgets, ++ ARRAY_SIZE(aic3x_dapm_widgets)); ++ ++ /* Set up davinci-evm specific audio path audio_map */ ++ snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); ++ ++ /* not connected */ ++ snd_soc_dapm_disable_pin(dapm, "MONO_LOUT"); ++ //snd_soc_dapm_disable_pin(dapm, "HPLCOM"); ++ //snd_soc_dapm_disable_pin(dapm, "HPRCOM"); ++ snd_soc_dapm_disable_pin(dapm, "MIC3L"); ++ snd_soc_dapm_disable_pin(dapm, "MIC3R"); ++ snd_soc_dapm_disable_pin(dapm, "LINE2L"); ++ snd_soc_dapm_disable_pin(dapm, "LINE2R"); ++ ++ /* always connected */ ++ snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); ++ snd_soc_dapm_enable_pin(dapm, "Line Out"); ++ snd_soc_dapm_enable_pin(dapm, "Line In"); ++ ++ snd_soc_dapm_sync(dapm); ++ ++ return 0; ++} ++ ++static struct snd_soc_ops gw_avila_board_ops = { ++ .startup = gw_avila_board_startup, ++ .hw_params = gw_avila_hw_params, ++}; ++ ++static struct snd_soc_dai_link gw_avila_board_dai[] = { ++ { ++ .name = "HSS-0", ++ .stream_name = "HSS-0", ++ .cpu_dai_name = "gw_avila_hss.0", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-001b", ++ .platform_name = "gw_avila-audio.0", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ },{ ++ .name = "HSS-1", ++ .stream_name = "HSS-1", ++ .cpu_dai_name = "gw_avila_hss.1", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-001a", ++ .platform_name = "gw_avila-audio.1", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ },{ ++ .name = "HSS-2", ++ .stream_name = "HSS-2", ++ .cpu_dai_name = "gw_avila_hss.2", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-0019", ++ .platform_name = "gw_avila-audio.2", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ },{ ++ .name = "HSS-3", ++ .stream_name = "HSS-3", ++ .cpu_dai_name = "gw_avila_hss.3", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-0018", ++ .platform_name = "gw_avila-audio.3", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ }, ++}; ++ ++static struct snd_soc_card gw_avila_board[] = { ++ { ++ .name = "gw_avila-board.0", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[0], ++ .num_links = 1, ++ },{ ++ .name = "gw_avila-board.1", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[1], ++ .num_links = 1, ++ },{ ++ .name = "gw_avila-board.2", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[2], ++ .num_links = 1, ++ },{ ++ .name = "gw_avila-board.3", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[3], ++ .num_links = 1, ++ } ++}; ++ ++static struct platform_device *gw_avila_board_snd_device[4]; ++ ++static int __init gw_avila_board_init(void) ++{ ++ int ret; ++ struct port *port; ++ int i; ++ ++ if ((hss_port[0] = kzalloc(sizeof(*port), GFP_KERNEL)) == NULL) ++ return -ENOMEM; ++ ++ if ((hss_port[1] = kzalloc(sizeof(*port), GFP_KERNEL)) == NULL) ++ return -ENOMEM; ++ ++ for (i = 0; i < 4; i++) { ++ gw_avila_board_snd_device[i] = platform_device_alloc("soc-audio", i); ++ if (!gw_avila_board_snd_device[i]) { ++ return -ENOMEM; ++ } ++ ++ platform_set_drvdata(gw_avila_board_snd_device[i], &gw_avila_board[i]); ++ ret = platform_device_add(gw_avila_board_snd_device[i]); ++ ++ if (ret) { ++ platform_device_put(gw_avila_board_snd_device[i]); ++ } ++ } ++ return ret; ++} ++ ++static void __exit gw_avila_board_exit(void) ++{ ++ int i; ++ for (i = 0; i < 4; i++) ++ platform_device_unregister(gw_avila_board_snd_device[i]); ++} ++ ++module_init(gw_avila_board_init); ++module_exit(gw_avila_board_exit); ++ ++/* Module information */ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("ALSA SoC HSS Audio gw_avila board"); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/sound/soc/gw-avila/ixp4xx_hss.c +@@ -0,0 +1,902 @@ ++/* ++ * Intel IXP4xx HSS (synchronous serial port) driver for Linux ++ * ++ * Copyright (C) 2009 Chris Lang ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of version 2 of the GNU General Public License ++ * as published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "ixp4xx_hss.h" ++ ++/***************************************************************************** ++ * global variables ++ ****************************************************************************/ ++ ++void hss_chan_read(unsigned long data); ++static char lock_init = 0; ++static spinlock_t npe_lock; ++static struct npe *npe; ++ ++static const struct { ++ int tx, txdone, rx, rxfree, chan; ++}queue_ids[2] = {{HSS0_PKT_TX0_QUEUE, HSS0_PKT_TXDONE_QUEUE, HSS0_PKT_RX_QUEUE, ++ HSS0_PKT_RXFREE0_QUEUE, HSS0_CHL_RXTRIG_QUEUE}, ++ {HSS1_PKT_TX0_QUEUE, HSS1_PKT_TXDONE_QUEUE, HSS1_PKT_RX_QUEUE, ++ HSS1_PKT_RXFREE0_QUEUE, HSS1_CHL_RXTRIG_QUEUE}, ++}; ++ ++struct port *hss_port[2]; ++struct hss_device *hss_handle[32]; ++EXPORT_SYMBOL(hss_handle); ++ ++/***************************************************************************** ++ * utility functions ++ ****************************************************************************/ ++ ++#ifndef __ARMEB__ ++static inline void memcpy_swab32(u32 *dest, u32 *src, int cnt) ++{ ++ int i; ++ for (i = 0; i < cnt; i++) ++ dest[i] = swab32(src[i]); ++} ++#endif ++ ++static inline unsigned int sub_offset(unsigned int a, unsigned int b, ++ unsigned int modulo) ++{ ++ return (modulo /* make sure the result >= 0 */ + a - b) % modulo; ++} ++ ++/***************************************************************************** ++ * HSS access ++ ****************************************************************************/ ++ ++static void hss_config_load(struct port *port) ++{ ++ struct msg msg; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_LOAD; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "HSS_LOAD_CONFIG")) ++ break; ++ if (npe_recv_message(npe, &msg, "HSS_LOAD_CONFIG")) ++ break; ++ ++ /* HSS_LOAD_CONFIG for port #1 returns port_id = #4 */ ++ if (msg.cmd != PORT_CONFIG_LOAD || msg.data32) ++ break; ++ ++ /* HDLC may stop working without this */ ++ npe_recv_message(npe, &msg, "FLUSH_IT"); ++ return; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to reload HSS configuration\n", ++ port->id); ++ BUG(); ++} ++ ++static void hss_config_set_pcr(struct port *port) ++{ ++ struct msg msg; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_TX_PCR; ++#if 0 ++ msg.data32 = PCR_FRM_SYNC_RISINGEDGE | PCR_MSB_ENDIAN | ++ PCR_TX_DATA_ENABLE | PCR_TX_UNASS_HIGH_IMP | PCR_TX_V56K_HIGH_IMP | PCR_TX_FB_HIGH_IMP; ++#else ++ msg.data32 = PCR_FRM_SYNC_RISINGEDGE | PCR_MSB_ENDIAN | ++ PCR_TX_DATA_ENABLE | PCR_TX_FB_HIGH_IMP | PCR_DCLK_EDGE_RISING; ++#endif ++ if (port->frame_size % 8 == 0) ++ msg.data32 |= PCR_SOF_NO_FBIT; ++ ++ if (npe_send_message(npe, &msg, "HSS_SET_TX_PCR")) ++ break; ++ ++ msg.index = HSS_CONFIG_RX_PCR; ++ msg.data32 &= ~ (PCR_DCLK_EDGE_RISING | PCR_FCLK_EDGE_RISING | PCR_TX_DATA_ENABLE); ++ ++ if (npe_send_message(npe, &msg, "HSS_SET_RX_PCR")) ++ break; ++ return; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to set HSS PCR registers\n", port->id); ++ BUG(); ++} ++ ++static void hss_config_set_core(struct port *port) ++{ ++ struct msg msg; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_CORE_CR; ++#if 0 ++ msg.data32 = 0 | CCR_LOOPBACK | ++ (port->id ? CCR_SECOND_HSS : 0); ++#else ++ msg.data32 = 0 | ++ (port->id ? CCR_SECOND_HSS : 0); ++#endif ++ if (npe_send_message(npe, &msg, "HSS_SET_CORE_CR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS core control" ++ " register\n", port->id); ++ BUG(); ++ } ++} ++ ++static void hss_config_set_line(struct port *port) ++{ ++ struct msg msg; ++ ++ hss_config_set_pcr(port); ++ hss_config_set_core(port); ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_CLOCK_CR; ++ msg.data32 = CLK42X_SPEED_8192KHZ /* FIXME */; ++ if (npe_send_message(npe, &msg, "HSS_SET_CLOCK_CR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS clock control" ++ " register\n", port->id); ++ BUG(); ++ } ++} ++ ++static void hss_config_set_rx_frame(struct port *port) ++{ ++ struct msg msg; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_RX_FCR; ++ msg.data16a = port->frame_sync_offset; ++ msg.data16b = port->frame_size - 1; ++ if (npe_send_message(npe, &msg, "HSS_SET_RX_FCR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS RX frame size" ++ " and offset\n", port->id); ++ BUG(); ++ } ++} ++ ++static void hss_config_set_frame(struct port *port) ++{ ++ struct msg msg; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_TX_FCR; ++ msg.data16a = TX_FRAME_SYNC_OFFSET; ++ msg.data16b = port->frame_size - 1; ++ if (npe_send_message(npe, &msg, "HSS_SET_TX_FCR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS TX frame size" ++ " and offset\n", port->id); ++ BUG(); ++ } ++ hss_config_set_rx_frame(port); ++} ++ ++static void hss_config_set_lut(struct port *port) ++{ ++ struct msg msg; ++ int chan_count = 32; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ ++ msg.index = HSS_CONFIG_TX_LUT; ++ msg.data32 = 0xffffffff; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.data32 = 0x0; ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ ++ msg.index = HSS_CONFIG_RX_LUT; ++ msg.data32 = 0xffffffff; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.data32 = 0x0; ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ ++ hss_config_set_frame(port); ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_NUM_CHANS_WRITE; ++ msg.hss_port = port->id; ++ msg.data8a = chan_count; ++ if (npe_send_message(npe, &msg, "CHAN_NUM_CHANS_WRITE")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS channel count\n", ++ port->id); ++ BUG(); ++ } ++} ++ ++static u32 hss_config_get_status(struct port *port) ++{ ++ struct msg msg; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_ERROR_READ; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "PORT_ERROR_READ")) ++ break; ++ if (npe_recv_message(npe, &msg, "PORT_ERROR_READ")) ++ break; ++ ++ return msg.data32; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to read HSS status\n", port->id); ++ BUG(); ++} ++ ++static void hss_config_start_chan(struct port *port) ++{ ++ struct msg msg; ++ ++ port->chan_last_tx = 0; ++ port->chan_last_rx = 0; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_RX_BUF_ADDR_WRITE; ++ msg.hss_port = port->id; ++ msg.data32 = port->chan_rx_buf_phys; ++ if (npe_send_message(npe, &msg, "CHAN_RX_BUF_ADDR_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_TX_BUF_ADDR_WRITE; ++ msg.hss_port = port->id; ++ msg.data32 = port->chan_tx_pointers_phys; ++ if (npe_send_message(npe, &msg, "CHAN_TX_BUF_ADDR_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_FLOW_ENABLE; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "CHAN_FLOW_ENABLE")) ++ break; ++ port->chan_started = 1; ++ return; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to start channelized flow\n", ++ port->id); ++ BUG(); ++} ++ ++static void hss_config_stop_chan(struct port *port) ++{ ++ struct msg msg; ++ ++ if (!port->chan_started) ++ return; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_FLOW_DISABLE; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "CHAN_FLOW_DISABLE")) { ++ printk(KERN_CRIT "HSS-%i: unable to stop channelized flow\n", ++ port->id); ++ BUG(); ++ } ++ hss_config_get_status(port); /* make sure it's halted */ ++ port->chan_started = 0; ++} ++ ++static int hss_config_load_firmware(struct port *port) ++{ ++ struct msg msg; ++ ++ if (port->initialized) ++ return 0; ++ ++ if (!npe_running(npe)) { ++ int err; ++ if ((err = npe_load_firmware(npe, "NPE-A-HSS", ++ port->dev))) ++ return err; ++ } ++ ++ do { ++ /* HSS main configuration */ ++ hss_config_set_line(port); ++ ++ hss_config_set_frame(port); ++ ++ /* Channelized operation settings */ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_TX_BLK_CFG_WRITE; ++ msg.hss_port = port->id; ++ msg.data8b = (CHAN_TX_LIST_FRAMES & ~7) / 2; ++ msg.data8a = msg.data8b / 4; ++ msg.data8d = CHAN_TX_LIST_FRAMES - msg.data8b; ++ msg.data8c = msg.data8d / 4; ++ if (npe_send_message(npe, &msg, "CHAN_TX_BLK_CFG_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_RX_BUF_CFG_WRITE; ++ msg.hss_port = port->id; ++ msg.data8a = CHAN_RX_TRIGGER / 8; ++ msg.data8b = CHAN_RX_FRAMES; ++ if (npe_send_message(npe, &msg, "CHAN_RX_BUF_CFG_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_TX_BUF_SIZE_WRITE; ++ msg.hss_port = port->id; ++ msg.data8a = CHAN_TX_LISTS; ++ if (npe_send_message(npe, &msg, "CHAN_TX_BUF_SIZE_WRITE")) ++ break; ++ ++ port->initialized = 1; ++ return 0; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to start HSS operation\n", port->id); ++ BUG(); ++} ++ ++void hss_chan_irq(void *pdev) ++{ ++ struct port *port = pdev; ++ ++ qmgr_disable_irq(queue_ids[port->id].chan); ++ ++ tasklet_hi_schedule(&port->task); ++} ++ ++ ++int hss_prepare_chan(struct port *port) ++{ ++ int err, i, j; ++ u32 *temp; ++ u32 temp2; ++ u8 *temp3; ++ ++ if (port->initialized) ++ return 0; ++ ++ if ((err = hss_config_load_firmware(port))) ++ return err; ++ ++ if ((err = qmgr_request_queue(queue_ids[port->id].chan, ++ CHAN_QUEUE_LEN, 0, 0, "%s:hss", "hss"))) ++ return err; ++ ++ port->chan_tx_buf = dma_alloc_coherent(port->dev, chan_tx_buf_len(port), &port->chan_tx_buf_phys, GFP_DMA); ++ memset(port->chan_tx_buf, 0, chan_tx_buf_len(port)); ++ ++ port->chan_tx_pointers = dma_alloc_coherent(port->dev, chan_tx_buf_len(port) / CHAN_TX_LIST_FRAMES * 4, &port->chan_tx_pointers_phys, GFP_DMA); ++ ++ temp3 = port->chan_tx_buf; ++ for (i = 0; i < CHAN_TX_LISTS; i++) { ++ for (j = 0; j < 8; j++) { ++ port->tx_lists[i][j] = temp3; ++ temp3 += CHAN_TX_LIST_FRAMES * 4; ++ } ++ } ++ ++ temp = port->chan_tx_pointers; ++ temp2 = port->chan_tx_buf_phys; ++ for (i = 0; i < CHAN_TX_LISTS; i++) ++ { ++ for (j = 0; j < 32; j++) ++ { ++ *temp = temp2; ++ temp2 += CHAN_TX_LIST_FRAMES; ++ temp++; ++ } ++ } ++ ++ port->chan_rx_buf = dma_alloc_coherent(port->dev, chan_rx_buf_len(port), &port->chan_rx_buf_phys, GFP_DMA); ++ ++ for (i = 0; i < 8; i++) { ++ temp3 = port->chan_rx_buf + (i * 4 * 128); ++ for (j = 0; j < 8; j++) { ++ port->rx_frames[i][j] = temp3; ++ temp3 += CHAN_RX_TRIGGER; ++ } ++ } ++ ++ qmgr_set_irq(queue_ids[port->id].chan, QUEUE_IRQ_SRC_NOT_EMPTY, ++ hss_chan_irq, port); ++ ++ return 0; ++ ++} ++ ++int hss_tx_start(struct hss_device *hdev) ++{ ++ unsigned long flags; ++ struct port *port = hdev->port; ++ ++ hdev->tx_loc = 0; ++ hdev->tx_frame = 0; ++ ++ set_bit((1 << hdev->id), &port->chan_tx_bitmap); ++ ++ if (!port->chan_started) ++ { ++ qmgr_enable_irq(queue_ids[port->id].chan); ++ spin_lock_irqsave(&npe_lock, flags); ++ hss_config_start_chan(port); ++ spin_unlock_irqrestore(&npe_lock, flags); ++ hss_chan_irq(port); ++ } ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_tx_start); ++ ++int hss_rx_start(struct hss_device *hdev) ++{ ++ unsigned long flags; ++ struct port *port = hdev->port; ++ ++ hdev->rx_loc = 0; ++ hdev->rx_frame = 0; ++ ++ set_bit((1 << hdev->id), &port->chan_rx_bitmap); ++ ++ if (!port->chan_started) ++ { ++ qmgr_enable_irq(queue_ids[port->id].chan); ++ spin_lock_irqsave(&npe_lock, flags); ++ hss_config_start_chan(port); ++ spin_unlock_irqrestore(&npe_lock, flags); ++ hss_chan_irq(port); ++ } ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_rx_start); ++ ++int hss_tx_stop(struct hss_device *hdev) ++{ ++ struct port *port = hdev->port; ++ ++ clear_bit((1 << hdev->id), &port->chan_tx_bitmap); ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_tx_stop); ++ ++int hss_rx_stop(struct hss_device *hdev) ++{ ++ struct port *port = hdev->port; ++ ++ clear_bit((1 << hdev->id), &port->chan_rx_bitmap); ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_rx_stop); ++ ++int hss_chan_open(struct hss_device *hdev) ++{ ++ struct port *port = hdev->port; ++ int i, err = 0; ++ ++ if (port->chan_open) ++ return 0; ++ ++ if (port->mode == MODE_HDLC) { ++ err = -ENOSYS; ++ goto out; ++ } ++ ++ if (port->mode == MODE_G704 && port->channels[0] == hdev->id) { ++ err = -EBUSY; /* channel #0 is used for G.704 signaling */ ++ goto out; ++ } ++ ++ for (i = MAX_CHANNELS; i > port->frame_size / 8; i--) ++ if (port->channels[i - 1] == hdev->id) { ++ err = -ECHRNG; /* frame too short */ ++ goto out; ++ } ++ ++ hdev->rx_loc = hdev->tx_loc = 0; ++ hdev->rx_frame = hdev->tx_frame = 0; ++ ++ //clear_bit((1 << hdev->id), &port->chan_rx_bitmap); ++ //clear_bit((1 << hdev->id), &port->chan_tx_bitmap); ++ ++ if (!port->initialized) { ++ hss_prepare_chan(port); ++ ++ hss_config_stop_chan(port); ++ hdev->open_count++; ++ port->chan_open_count++; ++ ++ hss_config_set_lut(port); ++ hss_config_load(port); ++ ++ } ++ port->chan_open = 1; ++ ++out: ++ return err; ++} ++EXPORT_SYMBOL(hss_chan_open); ++ ++int hss_chan_close(struct hss_device *hdev) ++{ ++ return 0; ++} ++EXPORT_SYMBOL(hss_chan_close); ++ ++void hss_chan_read(unsigned long data) ++{ ++ struct port *port = (void *)data; ++ struct hss_device *hdev; ++ u8 *hw_buf, *save_buf; ++ u8 *buf; ++ u32 v; ++ unsigned int tx_list, rx_frame; ++ int i, j, channel; ++ u8 more_work = 0; ++ ++/* ++ My Data in the hardware buffer is scattered by channels into 4 trunks ++ as follows for rx ++ ++ channel 0 channel 1 channel 2 channel 3 ++Trunk 1 = 0 -> 127 128 -> 255 256 -> 383 384 -> 512 ++Trunk 2 = 513 -> 639 640 -> 768 769 -> 895 896 -> 1023 ++Trunk 3 = 1024 -> 1151 1152 -> 1207 1208 -> 1407 1408 -> 1535 ++Trunk 4 = 1535 -> 1663 1664 -> 1791 1792 -> 1920 1921 -> 2047 ++ ++ I will get CHAN_RX_TRIGGER worth of bytes out of each channel on each trunk ++ with each IRQ ++ ++ For TX Data, it is split into 8 lists with each list containing 16 bytes per ++ channel ++ ++Trunk 1 = 0 -> 16 17 -> 32 33 -> 48 49 -> 64 ++Trunk 2 = 65 -> 80 81 -> 96 97 -> 112 113 -> 128 ++Trunk 3 = 129 -> 144 145 -> 160 161 -> 176 177 -> 192 ++Trunk 4 = 193 -> 208 209 -> 224 225 -> 240 241 -> 256 ++ ++*/ ++ ++ ++ while ((v = qmgr_get_entry(queue_ids[port->id].chan))) ++ { ++ tx_list = (v >> 8) & 0xFF; ++ rx_frame = v & 0xFF; ++ ++ if (tx_list == 7) ++ tx_list = 0; ++ else ++ tx_list++; ++ for (channel = 0; channel < 8; channel++) { ++ ++ hdev = port->chan_devices[channel]; ++ if (!hdev) ++ continue; ++ ++ if (test_bit(1 << channel, &port->chan_tx_bitmap)) { ++ buf = (u8 *)hdev->tx_buf + hdev->tx_loc; ++#if 0 ++ hw_buf = (u8 *)port->chan_tx_buf; ++ hw_buf += (tx_list * CHAN_TX_LIST_FRAMES * 32); ++ hw_buf += (4 * CHAN_TX_LIST_FRAMES * channel); ++ save_buf = hw_buf; ++#else ++ save_buf = port->tx_lists[tx_list][channel]; ++#endif ++ for (i = 0; i < CHAN_TX_LIST_FRAMES; i++) { ++ hw_buf = save_buf + i; ++ for (j = 0; j < 4; j++) { ++ *hw_buf = *(buf++); ++ hw_buf += CHAN_TX_LIST_FRAMES; ++ } ++ ++ hdev->tx_loc += 4; ++ hdev->tx_frame++; ++ if (hdev->tx_loc >= hdev->tx_buffer_size) { ++ hdev->tx_loc = 0; ++ buf = (u8 *)hdev->tx_buf; ++ } ++ } ++ } else { ++#if 0 ++ hw_buf = (u8 *)port->chan_tx_buf; ++ hw_buf += (tx_list * CHAN_TX_LIST_FRAMES * 32); ++ hw_buf += (4 * CHAN_TX_LIST_FRAMES * channel); ++#else ++ hw_buf = port->tx_lists[tx_list][channel]; ++#endif ++ memset(hw_buf, 0, 64); ++ } ++ ++ if (hdev->tx_frame >= hdev->tx_period_size && test_bit(1 << channel, &port->chan_tx_bitmap)) ++ { ++ hdev->tx_frame %= hdev->tx_period_size; ++ if (hdev->tx_callback) ++ hdev->tx_callback(hdev->tx_data); ++ more_work = 1; ++ } ++ ++ if (test_bit(1 << channel, &port->chan_rx_bitmap)) { ++ buf = (u8 *)hdev->rx_buf + hdev->rx_loc; ++#if 0 ++ hw_buf = (u8 *)port->chan_rx_buf; ++ hw_buf += (4 * CHAN_RX_FRAMES * channel); ++ hw_buf += rx_frame; ++ save_buf = hw_buf; ++#else ++ save_buf = port->rx_frames[channel][rx_frame >> 4]; ++#endif ++ for (i = 0; i < CHAN_RX_TRIGGER; i++) { ++ hw_buf = save_buf + i; ++ for (j = 0; j < 4; j++) { ++ *(buf++) = *hw_buf; ++ hw_buf += CHAN_RX_FRAMES; ++ } ++ hdev->rx_loc += 4; ++ hdev->rx_frame++; ++ if (hdev->rx_loc >= hdev->rx_buffer_size) { ++ hdev->rx_loc = 0; ++ buf = (u8 *)hdev->rx_buf; ++ } ++ } ++ } ++ ++ if (hdev->rx_frame >= hdev->rx_period_size && test_bit(1 << channel, &port->chan_rx_bitmap)) ++ { ++ hdev->rx_frame %= hdev->rx_period_size; ++ if (hdev->rx_callback) ++ hdev->rx_callback(hdev->rx_data); ++ more_work = 1; ++ } ++ } ++#if 0 ++ if (more_work) ++ { ++ tasklet_hi_schedule(&port->task); ++ return; ++ } ++#endif ++ } ++ ++ qmgr_enable_irq(queue_ids[port->id].chan); ++ ++ return; ++ ++} ++ ++struct hss_device *hss_chan_create(struct port *port, unsigned int channel) ++{ ++ struct hss_device *chan_dev; ++ unsigned long flags; ++ ++ chan_dev = kzalloc(sizeof(struct hss_device), GFP_KERNEL); ++ ++ spin_lock_irqsave(&npe_lock, flags); ++ ++ chan_dev->id = channel; ++ chan_dev->port = port; ++ ++ port->channels[channel] = channel; ++ ++ port->chan_devices[channel] = chan_dev; ++ ++ spin_unlock_irqrestore(&npe_lock, flags); ++ ++ return chan_dev; ++} ++ ++/***************************************************************************** ++ * initialization ++ ****************************************************************************/ ++ ++static struct platform_device gw_avila_hss_device_0 = { ++ .name = "ixp4xx_hss", ++ .id = 0, ++}; ++ ++static struct platform_device gw_avila_hss_device_1 = { ++ .name = "ixp4xx_hss", ++ .id = 1, ++}; ++ ++static struct platform_device *gw_avila_hss_port_0; ++static struct platform_device *gw_avila_hss_port_1; ++static u64 hss_dmamask = 0xFFFFFFFF; ++ ++struct hss_device *hss_init(int id, int channel) ++{ ++ struct port *port = hss_port[id]; ++ struct hss_device *hdev; ++ int ret; ++ ++ if (!lock_init) ++ { ++ spin_lock_init(&npe_lock); ++ lock_init = 1; ++ npe = npe_request(0); ++ } ++ ++ if (!port->init) { ++ if (id == 0) { ++ gw_avila_hss_port_0 = platform_device_alloc("hss-port", 0); ++ ++ platform_set_drvdata(gw_avila_hss_port_0, &gw_avila_hss_device_0); ++ port->dev = &gw_avila_hss_port_0->dev; ++ ++ if (!port->dev->dma_mask) ++ port->dev->dma_mask = &hss_dmamask; ++ if (!port->dev->coherent_dma_mask) ++ port->dev->coherent_dma_mask = 0xFFFFFFFF; ++ ++ ret = platform_device_add(gw_avila_hss_port_0); ++ ++ if (ret) ++ platform_device_put(gw_avila_hss_port_0); ++ ++ tasklet_init(&port->task, hss_chan_read, (unsigned long) port); ++ } ++ else ++ { ++ gw_avila_hss_port_1 = platform_device_alloc("hss-port", 1); ++ ++ platform_set_drvdata(gw_avila_hss_port_1, &gw_avila_hss_device_1); ++ port->dev = &gw_avila_hss_port_1->dev; ++ ++ if (!port->dev->dma_mask) ++ port->dev->dma_mask = &hss_dmamask; ++ if (!port->dev->coherent_dma_mask) ++ port->dev->coherent_dma_mask = 0xFFFFFFFF; ++ ++ ret = platform_device_add(gw_avila_hss_port_1); ++ ++ if (ret) ++ platform_device_put(gw_avila_hss_port_1); ++ ++ tasklet_init(&port->task, hss_chan_read, (unsigned long) port); ++ } ++ ++ port->init = 1; ++ port->id = id; ++ port->clock_type = CLOCK_EXT; ++ port->clock_rate = 8192000; ++ port->frame_size = 256; /* E1 */ ++ port->mode = MODE_RAW; ++ port->next_rx_frame = 0; ++ memset(port->channels, CHANNEL_UNUSED, sizeof(port->channels)); ++ } ++ ++ hdev = hss_chan_create(port, channel); ++ ++ return hdev; ++} ++EXPORT_SYMBOL(hss_init); ++ ++int hss_set_tx_callback(struct hss_device *hdev, void (*tx_callback)(void *), void *tx_data) ++{ ++ BUG_ON(tx_callback == NULL); ++ hdev->tx_callback = tx_callback; ++ hdev->tx_data = tx_data; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_set_tx_callback); ++ ++int hss_set_rx_callback(struct hss_device *hdev, void (*rx_callback)(void *), void *rx_data) ++{ ++ BUG_ON(rx_callback == NULL); ++ hdev->rx_callback = rx_callback; ++ hdev->rx_data = rx_data; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_set_rx_callback); ++ ++int hss_config_rx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size) ++{ ++ /* ++ * Period Size and Buffer Size are in Frames which are u32 ++ * We convert the u32 *buf to u8 in order to make channel reads ++ * and rx_loc easier ++ */ ++ ++ hdev->rx_buf = (u8 *)buf; ++ hdev->rx_buffer_size = buffer_size << 2; ++ hdev->rx_period_size = period_size; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_config_rx_dma); ++ ++int hss_config_tx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size) ++{ ++ /* ++ * Period Size and Buffer Size are in Frames which are u32 ++ * We convert the u32 *buf to u8 in order to make channel reads ++ * and rx_loc easier ++ */ ++ ++ hdev->tx_buf = (u8 *)buf; ++ hdev->tx_buffer_size = buffer_size << 2; ++ hdev->tx_period_size = period_size; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_config_tx_dma); ++ ++unsigned long hss_curr_offset_rx(struct hss_device *hdev) ++{ ++ return hdev->rx_loc >> 2; ++} ++EXPORT_SYMBOL(hss_curr_offset_rx); ++ ++unsigned long hss_curr_offset_tx(struct hss_device *hdev) ++{ ++ return hdev->tx_loc >> 2; ++} ++EXPORT_SYMBOL(hss_curr_offset_tx); ++ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("Intel IXP4xx HSS Audio driver"); ++MODULE_LICENSE("GPL v2"); +--- /dev/null ++++ b/sound/soc/gw-avila/ixp4xx_hss.h +@@ -0,0 +1,401 @@ ++/* ++ * ++ * ++ * Copyright (C) 2009 Gateworks Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of version 2 of the GNU General Public License ++ * as published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++//#include XXX We aren't HDLC ++ ++#define DEBUG_QUEUES 0 ++#define DEBUG_DESC 0 ++#define DEBUG_RX 0 ++#define DEBUG_TX 0 ++#define DEBUG_PKT_BYTES 0 ++#define DEBUG_CLOSE 0 ++#define DEBUG_FRAMER 0 ++ ++#define DRV_NAME "ixp4xx_hss" ++ ++#define PKT_EXTRA_FLAGS 0 /* orig 1 */ ++#define TX_FRAME_SYNC_OFFSET 0 /* channelized */ ++#define PKT_NUM_PIPES 1 /* 1, 2 or 4 */ ++#define PKT_PIPE_FIFO_SIZEW 4 /* total 4 dwords per HSS */ ++ ++#define RX_DESCS 512 /* also length of all RX queues */ ++#define TX_DESCS 512 /* also length of all TX queues */ ++ ++//#define POOL_ALLOC_SIZE (sizeof(struct desc) * (RX_DESCS + TX_DESCS)) ++#define RX_SIZE (HDLC_MAX_MRU + 4) /* NPE needs more space */ ++#define MAX_CLOSE_WAIT 1000 /* microseconds */ ++#define HSS_COUNT 2 ++#define MIN_FRAME_SIZE 16 /* bits */ ++#define MAX_FRAME_SIZE 257 /* 256 bits + framing bit */ ++#define MAX_CHANNELS (MAX_FRAME_SIZE / 8) ++#define MAX_CHAN_DEVICES 32 ++#define CHANNEL_HDLC 0xFE ++#define CHANNEL_UNUSED 0xFF ++ ++#define NAPI_WEIGHT 16 ++#define CHAN_RX_TRIGGER 16 /* 8 RX frames = 1 ms @ E1 */ ++#define CHAN_RX_FRAMES 128 ++#define CHAN_RX_TRUNKS 1 ++#define MAX_CHAN_RX_BAD_SYNC (CHAN_RX_TRIGGER / 2 /* pairs */ - 3) ++ ++#define CHAN_TX_LIST_FRAMES CHAN_RX_TRIGGER /* bytes/channel per list, 16 - 48 */ ++#define CHAN_TX_LISTS 8 ++#define CHAN_TX_TRUNKS CHAN_RX_TRUNKS ++#define CHAN_TX_FRAMES (CHAN_TX_LIST_FRAMES * CHAN_TX_LISTS) ++ ++#define CHAN_QUEUE_LEN 32 /* minimum possible */ ++ ++#define chan_rx_buf_len(port) (port->frame_size / 8 * CHAN_RX_FRAMES * CHAN_RX_TRUNKS) ++#define chan_tx_buf_len(port) (port->frame_size / 8 * CHAN_TX_FRAMES * CHAN_TX_TRUNKS) ++ ++/* Queue IDs */ ++#define HSS0_CHL_RXTRIG_QUEUE 12 /* orig size = 32 dwords */ ++#define HSS0_PKT_RX_QUEUE 13 /* orig size = 32 dwords */ ++#define HSS0_PKT_TX0_QUEUE 14 /* orig size = 16 dwords */ ++#define HSS0_PKT_TX1_QUEUE 15 ++#define HSS0_PKT_TX2_QUEUE 16 ++#define HSS0_PKT_TX3_QUEUE 17 ++#define HSS0_PKT_RXFREE0_QUEUE 18 /* orig size = 16 dwords */ ++#define HSS0_PKT_RXFREE1_QUEUE 19 ++#define HSS0_PKT_RXFREE2_QUEUE 20 ++#define HSS0_PKT_RXFREE3_QUEUE 21 ++#define HSS0_PKT_TXDONE_QUEUE 22 /* orig size = 64 dwords */ ++ ++#define HSS1_CHL_RXTRIG_QUEUE 10 ++#define HSS1_PKT_RX_QUEUE 0 ++#define HSS1_PKT_TX0_QUEUE 5 ++#define HSS1_PKT_TX1_QUEUE 6 ++#define HSS1_PKT_TX2_QUEUE 7 ++#define HSS1_PKT_TX3_QUEUE 8 ++#define HSS1_PKT_RXFREE0_QUEUE 1 ++#define HSS1_PKT_RXFREE1_QUEUE 2 ++#define HSS1_PKT_RXFREE2_QUEUE 3 ++#define HSS1_PKT_RXFREE3_QUEUE 4 ++#define HSS1_PKT_TXDONE_QUEUE 9 ++ ++#define NPE_PKT_MODE_HDLC 0 ++#define NPE_PKT_MODE_RAW 1 ++#define NPE_PKT_MODE_56KMODE 2 ++#define NPE_PKT_MODE_56KENDIAN_MSB 4 ++ ++/* PKT_PIPE_HDLC_CFG_WRITE flags */ ++#define PKT_HDLC_IDLE_ONES 0x1 /* default = flags */ ++#define PKT_HDLC_CRC_32 0x2 /* default = CRC-16 */ ++#define PKT_HDLC_MSB_ENDIAN 0x4 /* default = LE */ ++ ++ ++/* hss_config, PCRs */ ++/* Frame sync sampling, default = active low */ ++#define PCR_FRM_SYNC_ACTIVE_HIGH 0x40000000 ++#define PCR_FRM_SYNC_FALLINGEDGE 0x80000000 ++#define PCR_FRM_SYNC_RISINGEDGE 0xC0000000 ++ ++/* Frame sync pin: input (default) or output generated off a given clk edge */ ++#define PCR_FRM_SYNC_OUTPUT_FALLING 0x20000000 ++#define PCR_FRM_SYNC_OUTPUT_RISING 0x30000000 ++ ++/* Frame and data clock sampling on edge, default = falling */ ++#define PCR_FCLK_EDGE_RISING 0x08000000 ++#define PCR_DCLK_EDGE_RISING 0x04000000 ++ ++/* Clock direction, default = input */ ++#define PCR_SYNC_CLK_DIR_OUTPUT 0x02000000 ++ ++/* Generate/Receive frame pulses, default = enabled */ ++#define PCR_FRM_PULSE_DISABLED 0x01000000 ++ ++ /* Data rate is full (default) or half the configured clk speed */ ++#define PCR_HALF_CLK_RATE 0x00200000 ++ ++/* Invert data between NPE and HSS FIFOs? (default = no) */ ++#define PCR_DATA_POLARITY_INVERT 0x00100000 ++ ++/* TX/RX endianness, default = LSB */ ++#define PCR_MSB_ENDIAN 0x00080000 ++ ++/* Normal (default) / open drain mode (TX only) */ ++#define PCR_TX_PINS_OPEN_DRAIN 0x00040000 ++ ++/* No framing bit transmitted and expected on RX? (default = framing bit) */ ++#define PCR_SOF_NO_FBIT 0x00020000 ++ ++/* Drive data pins? */ ++#define PCR_TX_DATA_ENABLE 0x00010000 ++ ++/* Voice 56k type: drive the data pins low (default), high, high Z */ ++#define PCR_TX_V56K_HIGH 0x00002000 ++#define PCR_TX_V56K_HIGH_IMP 0x00004000 ++ ++/* Unassigned type: drive the data pins low (default), high, high Z */ ++#define PCR_TX_UNASS_HIGH 0x00000800 ++#define PCR_TX_UNASS_HIGH_IMP 0x00001000 ++ ++/* T1 @ 1.544MHz only: Fbit dictated in FIFO (default) or high Z */ ++#define PCR_TX_FB_HIGH_IMP 0x00000400 ++ ++/* 56k data endiannes - which bit unused: high (default) or low */ ++#define PCR_TX_56KE_BIT_0_UNUSED 0x00000200 ++ ++/* 56k data transmission type: 32/8 bit data (default) or 56K data */ ++#define PCR_TX_56KS_56K_DATA 0x00000100 ++ ++/* hss_config, cCR */ ++/* Number of packetized clients, default = 1 */ ++#define CCR_NPE_HFIFO_2_HDLC 0x04000000 ++#define CCR_NPE_HFIFO_3_OR_4HDLC 0x08000000 ++ ++/* default = no loopback */ ++#define CCR_LOOPBACK 0x02000000 ++ ++/* HSS number, default = 0 (first) */ ++#define CCR_SECOND_HSS 0x01000000 ++ ++ ++/* hss_config, clkCR: main:10, num:10, denom:12 */ ++#define CLK42X_SPEED_EXP ((0x3FF << 22) | ( 2 << 12) | 15) /*65 KHz*/ ++ ++#define CLK42X_SPEED_512KHZ (( 130 << 22) | ( 2 << 12) | 15) ++#define CLK42X_SPEED_1536KHZ (( 43 << 22) | ( 18 << 12) | 47) ++#define CLK42X_SPEED_1544KHZ (( 43 << 22) | ( 33 << 12) | 192) ++#define CLK42X_SPEED_2048KHZ (( 32 << 22) | ( 34 << 12) | 63) ++#define CLK42X_SPEED_4096KHZ (( 16 << 22) | ( 34 << 12) | 127) ++#define CLK42X_SPEED_8192KHZ (( 8 << 22) | ( 34 << 12) | 255) ++ ++#define CLK46X_SPEED_512KHZ (( 130 << 22) | ( 24 << 12) | 127) ++#define CLK46X_SPEED_1536KHZ (( 43 << 22) | (152 << 12) | 383) ++#define CLK46X_SPEED_1544KHZ (( 43 << 22) | ( 66 << 12) | 385) ++#define CLK46X_SPEED_2048KHZ (( 32 << 22) | (280 << 12) | 511) ++#define CLK46X_SPEED_4096KHZ (( 16 << 22) | (280 << 12) | 1023) ++#define CLK46X_SPEED_8192KHZ (( 8 << 22) | (280 << 12) | 2047) ++ ++ ++/* hss_config, LUT entries */ ++#define TDMMAP_UNASSIGNED 0 ++#define TDMMAP_HDLC 1 /* HDLC - packetized */ ++#define TDMMAP_VOICE56K 2 /* Voice56K - 7-bit channelized */ ++#define TDMMAP_VOICE64K 3 /* Voice64K - 8-bit channelized */ ++ ++/* offsets into HSS config */ ++#define HSS_CONFIG_TX_PCR 0x00 /* port configuration registers */ ++#define HSS_CONFIG_RX_PCR 0x04 ++#define HSS_CONFIG_CORE_CR 0x08 /* loopback control, HSS# */ ++#define HSS_CONFIG_CLOCK_CR 0x0C /* clock generator control */ ++#define HSS_CONFIG_TX_FCR 0x10 /* frame configuration registers */ ++#define HSS_CONFIG_RX_FCR 0x14 ++#define HSS_CONFIG_TX_LUT 0x18 /* channel look-up tables */ ++#define HSS_CONFIG_RX_LUT 0x38 ++ ++ ++/* NPE command codes */ ++/* writes the ConfigWord value to the location specified by offset */ ++#define PORT_CONFIG_WRITE 0x40 ++ ++/* triggers the NPE to load the contents of the configuration table */ ++#define PORT_CONFIG_LOAD 0x41 ++ ++/* triggers the NPE to return an HssErrorReadResponse message */ ++#define PORT_ERROR_READ 0x42 ++ ++/* reset NPE internal status and enable the HssChannelized operation */ ++#define CHAN_FLOW_ENABLE 0x43 ++#define CHAN_FLOW_DISABLE 0x44 ++#define CHAN_IDLE_PATTERN_WRITE 0x45 ++#define CHAN_NUM_CHANS_WRITE 0x46 ++#define CHAN_RX_BUF_ADDR_WRITE 0x47 ++#define CHAN_RX_BUF_CFG_WRITE 0x48 ++#define CHAN_TX_BLK_CFG_WRITE 0x49 ++#define CHAN_TX_BUF_ADDR_WRITE 0x4A ++#define CHAN_TX_BUF_SIZE_WRITE 0x4B ++#define CHAN_TSLOTSWITCH_ENABLE 0x4C ++#define CHAN_TSLOTSWITCH_DISABLE 0x4D ++ ++/* downloads the gainWord value for a timeslot switching channel associated ++ with bypassNum */ ++#define CHAN_TSLOTSWITCH_GCT_DOWNLOAD 0x4E ++ ++/* triggers the NPE to reset internal status and enable the HssPacketized ++ operation for the flow specified by pPipe */ ++#define PKT_PIPE_FLOW_ENABLE 0x50 ++#define PKT_PIPE_FLOW_DISABLE 0x51 ++#define PKT_NUM_PIPES_WRITE 0x52 ++#define PKT_PIPE_FIFO_SIZEW_WRITE 0x53 ++#define PKT_PIPE_HDLC_CFG_WRITE 0x54 ++#define PKT_PIPE_IDLE_PATTERN_WRITE 0x55 ++#define PKT_PIPE_RX_SIZE_WRITE 0x56 ++#define PKT_PIPE_MODE_WRITE 0x57 ++ ++/* HDLC packet status values - desc->status */ ++#define ERR_SHUTDOWN 1 /* stop or shutdown occurrance */ ++#define ERR_HDLC_ALIGN 2 /* HDLC alignment error */ ++#define ERR_HDLC_FCS 3 /* HDLC Frame Check Sum error */ ++#define ERR_RXFREE_Q_EMPTY 4 /* RX-free queue became empty while receiving ++ this packet (if buf_len < pkt_len) */ ++#define ERR_HDLC_TOO_LONG 5 /* HDLC frame size too long */ ++#define ERR_HDLC_ABORT 6 /* abort sequence received */ ++#define ERR_DISCONNECTING 7 /* disconnect is in progress */ ++ ++#define CLOCK_EXT 0 ++#define CLOCK_INT 1 ++ ++enum mode {MODE_HDLC = 0, MODE_RAW, MODE_G704}; ++enum rx_tx_bit { ++ TX_BIT = 0, ++ RX_BIT = 1 ++}; ++enum chan_bit { ++ CHAN_0 = (1 << 0), ++ CHAN_1 = (1 << 1), ++ CHAN_2 = (1 << 2), ++ CHAN_3 = (1 << 3), ++ CHAN_4 = (1 << 4), ++ CHAN_5 = (1 << 5), ++ CHAN_6 = (1 << 6), ++ CHAN_7 = (1 << 7), ++ CHAN_8 = (1 << 8), ++ CHAN_9 = (1 << 9), ++ CHAN_10 = (1 << 10), ++ CHAN_11 = (1 << 11), ++ CHAN_12 = (1 << 12), ++ CHAN_13 = (1 << 13), ++ CHAN_14 = (1 << 14), ++ CHAN_15 = (1 << 15) ++}; ++ ++enum alignment { NOT_ALIGNED = 0, EVEN_FIRST, ODD_FIRST }; ++ ++#ifdef __ARMEB__ ++typedef struct sk_buff buffer_t; ++#define free_buffer dev_kfree_skb ++#define free_buffer_irq dev_kfree_skb_irq ++#else ++typedef void buffer_t; ++#define free_buffer kfree ++#define free_buffer_irq kfree ++#endif ++ ++struct hss_device { ++ struct port *port; ++ unsigned int open_count, excl_open; ++ unsigned long tx_loc, rx_loc; /* bytes */ ++ unsigned long tx_frame, rx_frame; /* Frames */ ++ u8 id, chan_count; ++ u8 log_channels[MAX_CHANNELS]; ++ ++ u8 *rx_buf; ++ u8 *tx_buf; ++ ++ size_t rx_buffer_size; ++ size_t rx_period_size; ++ size_t tx_buffer_size; ++ size_t tx_period_size; ++ ++ void (*rx_callback)(void *data); ++ void *rx_data; ++ void (*tx_callback)(void *data); ++ void *tx_data; ++ void *private_data; ++}; ++ ++extern struct hss_device *hss_handle[32]; ++extern struct port *hss_port[2]; ++ ++struct port { ++ unsigned char init; ++ ++ struct device *dev; ++ ++ struct tasklet_struct task; ++ unsigned int id; ++ unsigned long chan_rx_bitmap; ++ unsigned long chan_tx_bitmap; ++ unsigned char chan_open; ++ ++ /* the following fields must be protected by npe_lock */ ++ enum mode mode; ++ unsigned int clock_type, clock_rate, loopback; ++ unsigned int frame_size, frame_sync_offset; ++ unsigned int next_rx_frame; ++ ++ struct hss_device *chan_devices[MAX_CHAN_DEVICES]; ++ u32 chan_tx_buf_phys, chan_rx_buf_phys; ++ u32 chan_tx_pointers_phys; ++ u32 *chan_tx_pointers; ++ u8 *chan_rx_buf; ++ u8 *chan_tx_buf; ++ u8 *tx_lists[CHAN_TX_LISTS][8]; ++ u8 *rx_frames[8][CHAN_TX_LISTS]; ++ unsigned int chan_open_count, hdlc_open; ++ unsigned int chan_started, initialized, just_set_offset; ++ unsigned int chan_last_rx, chan_last_tx; ++ ++ /* assigned channels, may be invalid with given frame length or mode */ ++ u8 channels[MAX_CHANNELS]; ++ int msg_count; ++}; ++ ++/* NPE message structure */ ++struct msg { ++#ifdef __ARMEB__ ++ u8 cmd, unused, hss_port, index; ++ union { ++ struct { u8 data8a, data8b, data8c, data8d; }; ++ struct { u16 data16a, data16b; }; ++ struct { u32 data32; }; ++ }; ++#else ++ u8 index, hss_port, unused, cmd; ++ union { ++ struct { u8 data8d, data8c, data8b, data8a; }; ++ struct { u16 data16b, data16a; }; ++ struct { u32 data32; }; ++ }; ++#endif ++}; ++ ++#define rx_desc_phys(port, n) ((port)->desc_tab_phys + \ ++ (n) * sizeof(struct desc)) ++#define rx_desc_ptr(port, n) (&(port)->desc_tab[n]) ++ ++#define tx_desc_phys(port, n) ((port)->desc_tab_phys + \ ++ ((n) + RX_DESCS) * sizeof(struct desc)) ++#define tx_desc_ptr(port, n) (&(port)->desc_tab[(n) + RX_DESCS]) ++ ++int hss_prepare_chan(struct port *port); ++void hss_chan_stop(struct port *port); ++ ++struct hss_device *hss_init(int id, int channel); ++int hss_chan_open(struct hss_device *hdev); ++int hss_chan_close(struct hss_device *hdev); ++ ++int hss_set_tx_callback(struct hss_device *hdev, void (*tx_callback)(void *), void *tx_data); ++int hss_set_rx_callback(struct hss_device *hdev, void (*rx_callback)(void *), void *rx_data); ++int hss_tx_start(struct hss_device *hdev); ++int hss_tx_stop(struct hss_device *hdev); ++int hss_rx_start(struct hss_device *hdev); ++int hss_rx_stop(struct hss_device *hdev); ++ ++int hss_config_rx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size); ++int hss_config_tx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size); ++unsigned long hss_curr_offset_rx(struct hss_device *hdev); ++unsigned long hss_curr_offset_tx(struct hss_device *hdev); ++ diff --git a/target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch b/target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch new file mode 100644 index 000000000..b56fbb732 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch @@ -0,0 +1,287 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -160,6 +160,14 @@ config ARCH_PRPMC1100 + PrPCM1100 Processor Mezanine Module. For more information on + this platform, see . + ++config MACH_TW5334 ++ bool "Titan Wireless TW-533-4" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the Titan ++ Wireless TW533-4. For more information on this platform, ++ see http://openwrt.org ++ + config MACH_NAS100D + bool + prompt "NAS100D" +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -24,6 +24,7 @@ obj-pci-$(CONFIG_MACH_SIDEWINDER) += sid + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o ++obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o + + obj-y += common.o + +@@ -49,6 +50,7 @@ obj-$(CONFIG_MACH_SIDEWINDER) += sidewin + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o ++obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -44,7 +44,7 @@ static __inline__ void __arch_decomp_set + machine_is_gateway7001() || machine_is_wg302v2() || + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || +- machine_is_wrt300nv2()) ++ machine_is_wrt300nv2() || machine_is_tw5334()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw5334-pci.c +@@ -0,0 +1,68 @@ ++/* ++ * arch/arch/mach-ixp4xx/tw5334-pci.c ++ * ++ * PCI setup routines for the Titan Wireless TW-533-4 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init tw5334_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO0, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init tw5334_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 12) ++ return IRQ_IXP4XX_GPIO6; ++ else if (slot == 13) ++ return IRQ_IXP4XX_GPIO2; ++ else if (slot == 14) ++ return IRQ_IXP4XX_GPIO1; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO0; ++ else return -1; ++} ++ ++struct hw_pci tw5334_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = tw5334_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = tw5334_map_irq, ++}; ++ ++int __init tw5334_pci_init(void) ++{ ++ if (machine_is_tw5334()) ++ pci_common_init(&tw5334_pci); ++ return 0; ++} ++ ++subsys_initcall(tw5334_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw5334-setup.c +@@ -0,0 +1,167 @@ ++/* ++ * arch/arm/mach-ixp4xx/tw5334-setup.c ++ * ++ * Board setup for the Titan Wireless TW-533-4 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data tw5334_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource tw5334_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device tw5334_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &tw5334_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &tw5334_flash_resource, ++}; ++ ++static struct resource tw5334_uart_resource = { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port tw5334_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device tw5334_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = tw5334_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &tw5334_uart_resource, ++}; ++ ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info tw5334_plat_eth[] = { ++ { ++ .phy = 0, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device tw5334_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = tw5334_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = tw5334_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *tw5334_devices[] __initdata = { ++ &tw5334_flash, ++ &tw5334_uart, ++ &tw5334_eth[0], ++ &tw5334_eth[1], ++}; ++ ++static void __init tw5334_init(void) ++{ ++ uint8_t __iomem *f; ++ int i; ++ ++ ixp4xx_sys_init(); ++ ++ tw5334_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ tw5334_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(tw5334_devices, ARRAY_SIZE(tw5334_devices)); ++ ++ /* ++ * Map in a portion of the flash and read the MAC addresses. ++ * Since it is stored in BE in the flash itself, we need to ++ * byteswap it if we're in LE mode. ++ */ ++ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000); ++ if (f) { ++ for (i = 0; i < 6; i++) { ++#ifdef __ARMEB__ ++ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + i); ++ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + i); ++#else ++ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + (i^3)); ++ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + (i^3)); ++#endif ++ } ++ iounmap(f); ++ } ++ ++ printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 0\n", ++ tw5334_plat_eth[0].hwaddr); ++ printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 1\n", ++ tw5334_plat_eth[1].hwaddr); ++} ++ ++#ifdef CONFIG_MACH_TW5334 ++MACHINE_START(TW5334, "Titan Wireless TW-533-4") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = tw5334_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch b/target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch new file mode 100644 index 000000000..7c229276f --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch @@ -0,0 +1,504 @@ +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -26,6 +26,7 @@ CONFIG_MACH_NAS100D=y + CONFIG_MACH_DSMG600=y + CONFIG_MACH_FSG=y + CONFIG_MACH_GTWX5715=y ++CONFIG_MACH_MI424WR=y + CONFIG_IXP4XX_QMGR=y + CONFIG_IXP4XX_NPE=y + # CONFIG_ARM_THUMB is not set +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -258,6 +258,13 @@ config MACH_MIC256 + Say 'Y' here if you want your kernel to support the MIC256 + board from OMICRON electronics GmbH. + ++config MACH_MI424WR ++ bool "Actiontec MI424WR" ++ depends on ARCH_IXP4XX ++ select PCI ++ help ++ Add support for the Actiontec MI424-WR. ++ + comment "IXP4xx Options" + + config IXP4XX_INDIRECT_PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -25,6 +25,7 @@ obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixd + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o ++obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o + + obj-y += common.o + +@@ -51,6 +52,7 @@ obj-$(CONFIG_MACH_COMPEXWP18) += compex4 + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o + obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o ++obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/mi424wr-pci.c +@@ -0,0 +1,70 @@ ++/* ++ * arch/arm/mach-ixp4xx/mi424wr-pci.c ++ * ++ * Actiontec MI424WR board-level PCI initialization ++ * ++ * Copyright (C) 2008 Jose Vasconcellos ++ * ++ * Maintainer: Jose Vasconcellos ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++/* PCI controller GPIO to IRQ pin mappings ++ * This information was obtained from Actiontec's GPL release. ++ * ++ * INTA INTB ++ * SLOT 13 8 6 ++ * SLOT 14 7 8 ++ * SLOT 15 6 7 ++ */ ++ ++void __init mi424wr_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init mi424wr_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 13) ++ return IRQ_IXP4XX_GPIO8; ++ if (slot == 14) ++ return IRQ_IXP4XX_GPIO7; ++ if (slot == 15) ++ return IRQ_IXP4XX_GPIO6; ++ ++ return -1; ++} ++ ++struct hw_pci mi424wr_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = mi424wr_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = mi424wr_map_irq, ++}; ++ ++int __init mi424wr_pci_init(void) ++{ ++ if (machine_is_mi424wr()) ++ pci_common_init(&mi424wr_pci); ++ return 0; ++} ++ ++subsys_initcall(mi424wr_pci_init); ++ +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/mi424wr-setup.c +@@ -0,0 +1,384 @@ ++/* ++ * arch/arm/mach-ixp4xx/mi424wr-setup.c ++ * ++ * Actiontec MI424-WR board setup ++ * Copyright (c) 2008 Jose Vasconcellos ++ * ++ * Based on Gemtek GTWX5715 by ++ * Copyright (C) 2004 George T. Joseph ++ * Derived from Coyote ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * GPIO 2,3,4 and 9 are hard wired to the Micrel/Kendin KS8995M Switch ++ * and operate as an SPI type interface. The details of the interface ++ * are available on Kendin/Micrel's web site. ++ */ ++ ++#define MI424WR_KSSPI_SELECT 9 ++#define MI424WR_KSSPI_TXD 4 ++#define MI424WR_KSSPI_CLOCK 2 ++#define MI424WR_KSSPI_RXD 3 ++ ++/* ++ * The "reset" button is wired to GPIO 10. ++ * The GPIO is brought "low" when the button is pushed. ++ */ ++ ++#define MI424WR_BUTTON_GPIO 10 ++#define MI424WR_BUTTON_IRQ IRQ_IXP4XX_GPIO10 ++ ++#define MI424WR_MOCA_WAN_LED 11 ++ ++/* Latch on CS1 - taken from Actiontec's 2.4 source code ++ * ++ * default latch value ++ * 0 - power alarm led (red) 0 (off) ++ * 1 - power led (green) 0 (off) ++ * 2 - wireless led (green) 1 (off) ++ * 3 - no internet led (red) 0 (off) ++ * 4 - internet ok led (green) 0 (off) ++ * 5 - moca LAN 0 (off) ++ * 6 - WAN alarm led (red) 0 (off) ++ * 7 - PCI reset 1 (not reset) ++ * 8 - IP phone 1 led (green) 1 (off) ++ * 9 - IP phone 2 led (green) 1 (off) ++ * 10 - VOIP ready led (green) 1 (off) ++ * 11 - PSTN relay 1 control 0 (PSTN) ++ * 12 - PSTN relay 1 control 0 (PSTN) ++ * 13 - N/A ++ * 14 - N/A ++ * 15 - N/A ++ */ ++ ++#define MI424WR_LATCH_MASK 0x04 ++#define MI424WR_LATCH_DEFAULT 0x1f86 ++ ++#define MI424WR_LATCH_ALARM_LED 0x00 ++#define MI424WR_LATCH_POWER_LED 0x01 ++#define MI424WR_LATCH_WIRELESS_LED 0x02 ++#define MI424WR_LATCH_INET_DOWN_LED 0x03 ++#define MI424WR_LATCH_INET_OK_LED 0x04 ++#define MI424WR_LATCH_MOCA_LAN_LED 0x05 ++#define MI424WR_LATCH_WAN_ALARM_LED 0x06 ++#define MI424WR_LATCH_PCI_RESET 0x07 ++#define MI424WR_LATCH_PHONE1_LED 0x08 ++#define MI424WR_LATCH_PHONE2_LED 0x09 ++#define MI424WR_LATCH_VOIP_LED 0x10 ++#define MI424WR_LATCH_PSTN_RELAY1 0x11 ++#define MI424WR_LATCH_PSTN_RELAY2 0x12 ++ ++/* initialize CS1 to default timings, Intel style, 16-bit bus */ ++#define MI424WR_CS1_CONFIG 0x80000002 ++ ++/* Define both UARTs but they are not easily accessible. ++ */ ++ ++static struct resource mi424wr_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++ ++static struct plat_serial8250_port mi424wr_uart_platform_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device mi424wr_uart_device = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = mi424wr_uart_platform_data, ++ .num_resources = ARRAY_SIZE(mi424wr_uart_resources), ++ .resource = mi424wr_uart_resources, ++}; ++ ++static struct flash_platform_data mi424wr_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource mi424wr_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device mi424wr_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev.platform_data = &mi424wr_flash_data, ++ .num_resources = 1, ++ .resource = &mi424wr_flash_resource, ++}; ++ ++static struct spi_gpio_platform_data mi424wr_spi_platform_data = { ++ .sck = MI424WR_KSSPI_CLOCK, ++ .mosi = MI424WR_KSSPI_TXD, ++ .miso = MI424WR_KSSPI_RXD, ++ .num_chipselect = 1, ++}; ++ ++static struct platform_device mi424wr_spi_device = { ++ .name = "spi-gpio", ++ .id = 1, ++ .dev.platform_data = &mi424wr_spi_platform_data, ++}; ++ ++static struct spi_board_info mi424wr_spi_devices[] __initdata = { ++ { ++ .modalias = "spi-ks8995", ++ .max_speed_hz = 500000, ++ .mode = SPI_MODE_0, ++ .bus_num = 1, ++ .chip_select = 0, ++ .controller_data = (void *)MI424WR_KSSPI_SELECT, ++ } ++}; ++ ++static struct gpio_led mi424wr_gpio_led[] = { ++ { ++ .name = "moca-wan", /* green led */ ++ .gpio = MI424WR_MOCA_WAN_LED, ++ .active_low = 0, ++ } ++}; ++ ++static struct gpio_led_platform_data mi424wr_gpio_leds_data = { ++ .num_leds = 1, ++ .leds = mi424wr_gpio_led, ++}; ++ ++static struct platform_device mi424wr_gpio_leds = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &mi424wr_gpio_leds_data, ++}; ++ ++static uint16_t latch_value = MI424WR_LATCH_DEFAULT; ++static uint16_t __iomem *iobase; ++ ++static void mi424wr_latch_set_led(u8 bit, enum led_brightness value) ++{ ++ ++ if (((MI424WR_LATCH_MASK >> bit) & 1) ^ (value == LED_OFF)) ++ latch_value &= ~(0x1 << bit); ++ else ++ latch_value |= (0x1 << bit); ++ ++ __raw_writew(latch_value, iobase); ++ ++} ++ ++static struct latch_led mi424wr_latch_led[] = { ++ { ++ .name = "power-alarm", ++ .bit = MI424WR_LATCH_ALARM_LED, ++ }, ++ { ++ .name = "power-ok", ++ .bit = MI424WR_LATCH_POWER_LED, ++ }, ++ { ++ .name = "wireless", /* green led */ ++ .bit = MI424WR_LATCH_WIRELESS_LED, ++ }, ++ { ++ .name = "inet-down", /* red led */ ++ .bit = MI424WR_LATCH_INET_DOWN_LED, ++ }, ++ { ++ .name = "inet-up", /* green led */ ++ .bit = MI424WR_LATCH_INET_OK_LED, ++ }, ++ { ++ .name = "moca-lan", /* green led */ ++ .bit = MI424WR_LATCH_MOCA_LAN_LED, ++ }, ++ { ++ .name = "wan-alarm", /* red led */ ++ .bit = MI424WR_LATCH_WAN_ALARM_LED, ++ } ++}; ++ ++static struct latch_led_platform_data mi424wr_latch_leds_data = { ++ .num_leds = ARRAY_SIZE(mi424wr_latch_led), ++ .mem = 0x51000000, ++ .leds = mi424wr_latch_led, ++ .set_led = mi424wr_latch_set_led, ++}; ++ ++static struct platform_device mi424wr_latch_leds = { ++ .name = "leds-latch", ++ .id = -1, ++ .dev.platform_data = &mi424wr_latch_leds_data, ++}; ++ ++static struct eth_plat_info mi424wr_wan_data = { ++ .phy = 17, /* KS8721 */ ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct eth_plat_info mi424wr_lan_data = { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct platform_device mi424wr_npe_devices[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &mi424wr_lan_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = &mi424wr_wan_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct eth_plat_info mi424wr_wanD_data = { ++ .phy = 5, ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct eth_plat_info mi424wr_lanD_data = { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct platform_device mi424wr_npeD_devices[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = &mi424wr_lanD_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &mi424wr_wanD_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *mi424wr_devices[] __initdata = { ++ &mi424wr_uart_device, ++ &mi424wr_flash, ++ &mi424wr_spi_device, ++ &mi424wr_gpio_leds, ++ &mi424wr_latch_leds, ++}; ++ ++static void __init mi424wr_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ mi424wr_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ mi424wr_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = MI424WR_CS1_CONFIG; ++ ++ /* configure button as input ++ */ ++ gpio_line_config(MI424WR_BUTTON_GPIO, IXP4XX_GPIO_IN); ++ ++ /* Initialize LEDs and enables PCI bus. ++ */ ++ iobase = ioremap_nocache(IXP4XX_EXP_BUS_BASE(1), 0x1000); ++ __raw_writew(latch_value, iobase); ++ ++ spi_register_board_info(mi424wr_spi_devices, ARRAY_SIZE(mi424wr_spi_devices)); ++ platform_add_devices(mi424wr_devices, ARRAY_SIZE(mi424wr_devices)); ++ ++ /* Need to figure out how to detect revD. ++ * Look for a revision argument sent by redboot. ++ */ ++#define revD 4 ++ if (system_rev == revD) { ++ platform_device_register(&mi424wr_npeD_devices[0]); ++ platform_device_register(&mi424wr_npeD_devices[1]); ++ } else { ++ platform_device_register(&mi424wr_npe_devices[0]); ++ platform_device_register(&mi424wr_npe_devices[1]); ++ } ++} ++ ++ ++MACHINE_START(MI424WR, "Actiontec MI424WR") ++ /* Maintainer: Jose Vasconcellos */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = mi424wr_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++ diff --git a/target/linux/ixp4xx/patches-4.9/190-cambria_support.patch b/target/linux/ixp4xx/patches-4.9/190-cambria_support.patch new file mode 100644 index 000000000..83a331926 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/190-cambria_support.patch @@ -0,0 +1,1131 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -21,6 +21,14 @@ config MACH_AVILA + Avila Network Platform. For more information on this platform, + see . + ++config MACH_CAMBRIA ++ bool "Cambria" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the Gateworks ++ Cambria series. For more information on this platform, ++ see . ++ + config MACH_LOFT + bool "Loft" + depends on MACH_AVILA +@@ -218,7 +226,7 @@ config CPU_IXP46X + + config CPU_IXP43X + bool +- depends on MACH_KIXRP435 ++ depends on MACH_KIXRP435 || MACH_CAMBRIA + default y + + config MACH_GTWX5715 +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -7,6 +7,7 @@ obj-pci-n := + + obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o ++obj-pci-$(CONFIG_MACH_CAMBRIA) += cambria-pci.o + obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o + obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o + obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o +@@ -31,6 +32,7 @@ obj-y += common.o + + obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o + obj-$(CONFIG_MACH_AVILA) += avila-setup.o ++obj-$(CONFIG_MACH_CAMBRIA) += cambria-setup.o + obj-$(CONFIG_MACH_IXDPG425) += coyote-setup.o + obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o + obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/cambria-pci.c +@@ -0,0 +1,78 @@ ++/* ++ * arch/arch/mach-ixp4xx/cambria-pci.c ++ * ++ * PCI setup routines for Gateworks Cambria series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++extern void ixp4xx_pci_preinit(void); ++extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); ++extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); ++ ++void __init cambria_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init cambria_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else if (slot == 3) ++ return IRQ_IXP4XX_GPIO9; ++ else if (slot == 4) ++ return IRQ_IXP4XX_GPIO8; ++ else if (slot == 6) ++ return IRQ_IXP4XX_GPIO10; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO8; ++ ++ else return -1; ++} ++ ++struct hw_pci cambria_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = cambria_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = cambria_map_irq, ++}; ++ ++int __init cambria_pci_init(void) ++{ ++ if (machine_is_cambria()) ++ pci_common_init(&cambria_pci); ++ return 0; ++} ++ ++subsys_initcall(cambria_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/cambria-setup.c +@@ -0,0 +1,1003 @@ ++/* ++ * arch/arm/mach-ixp4xx/cambria-setup.c ++ * ++ * Board setup for the Gateworks Cambria series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * Copyright (C) 2012 Gateworks Corporation ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ * Tim Harvey ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) ++ ++struct cambria_board_info { ++ unsigned char *model; ++ void (*setup)(void); ++}; ++ ++static struct cambria_board_info *cambria_info __initdata; ++ ++static struct flash_platform_data cambria_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource cambria_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device cambria_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &cambria_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &cambria_flash_resource, ++}; ++ ++static struct i2c_gpio_platform_data cambria_i2c_gpio_data = { ++ .sda_pin = 7, ++ .scl_pin = 6, ++}; ++ ++static struct platform_device cambria_i2c_gpio = { ++ .name = "i2c-gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &cambria_i2c_gpio_data, ++ }, ++}; ++ ++#ifdef SFP_SERIALID ++static struct i2c_gpio_platform_data cambria_i2c_gpio_sfpa_data = { ++ .sda_pin = 113, ++ .scl_pin = 112, ++ .sda_is_open_drain = 0, ++ .scl_is_open_drain = 0, ++}; ++ ++static struct platform_device cambria_i2c_gpio_sfpa = { ++ .name = "i2c-gpio", ++ .id = 1, ++ .dev = { ++ .platform_data = &cambria_i2c_gpio_sfpa_data, ++ }, ++}; ++ ++static struct i2c_gpio_platform_data cambria_i2c_gpio_sfpb_data = { ++ .sda_pin = 115, ++ .scl_pin = 114, ++ .sda_is_open_drain = 0, ++ .scl_is_open_drain = 0, ++}; ++ ++static struct platform_device cambria_i2c_gpio_sfpb = { ++ .name = "i2c-gpio", ++ .id = 2, ++ .dev = { ++ .platform_data = &cambria_i2c_gpio_sfpb_data, ++ }, ++}; ++#endif // #ifdef SFP_SERIALID ++ ++static struct eth_plat_info cambria_npec_data = { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct eth_plat_info cambria_npea_data = { ++ .phy = 2, ++ .rxq = 2, ++ .txreadyq = 19, ++}; ++ ++static struct platform_device cambria_npec_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &cambria_npec_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct platform_device cambria_npea_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEA, ++ .dev.platform_data = &cambria_npea_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct resource cambria_uart_resource = { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port cambria_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device cambria_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = cambria_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &cambria_uart_resource, ++}; ++ ++static struct resource cambria_optional_uart_resources[] = { ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x53000000, ++ .end = 0x53000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x53000000, ++ .end = 0x53000fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port cambria_optional_uart_data[] = { ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM_DELAY, ++ .regshift = 0, ++ .uartclk = 1843200, ++ .rw_delay = 10, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM_DELAY, ++ .regshift = 0, ++ .uartclk = 1843200, ++ .rw_delay = 10, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { }, ++}; ++ ++static struct platform_device cambria_optional_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM1, ++ .dev.platform_data = cambria_optional_uart_data, ++ .num_resources = 2, ++ .resource = cambria_optional_uart_resources, ++}; ++ ++static struct resource cambria_pata_resources[] = { ++ { ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "intrq", ++ .start = IRQ_IXP4XX_GPIO12, ++ .end = IRQ_IXP4XX_GPIO12, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct ixp4xx_pata_data cambria_pata_data = { ++ .cs0_bits = 0xbfff3c03, ++ .cs1_bits = 0xbfff3c03, ++}; ++ ++static struct platform_device cambria_pata = { ++ .name = "pata_ixp4xx_cf", ++ .id = 0, ++ .dev.platform_data = &cambria_pata_data, ++ .num_resources = ARRAY_SIZE(cambria_pata_resources), ++ .resource = cambria_pata_resources, ++}; ++ ++static struct gpio_led cambria_gpio_leds[] = { ++ { ++ .name = "user", ++ .gpio = 5, ++ .active_low = 1, ++ }, ++ { ++ .name = "user2", ++ .gpio = 0, ++ .active_low = 1, ++ }, ++ { ++ .name = "user3", ++ .gpio = 0, ++ .active_low = 1, ++ }, ++ { ++ .name = "user4", ++ .gpio = 0, ++ .active_low = 1, ++ } ++}; ++ ++static struct gpio_led_platform_data cambria_gpio_leds_data = { ++ .num_leds = 1, ++ .leds = cambria_gpio_leds, ++}; ++ ++static struct platform_device cambria_gpio_leds_device = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &cambria_gpio_leds_data, ++}; ++ ++static struct resource cambria_gpio_resources[] = { ++ { ++ .name = "gpio", ++ .flags = 0, ++ }, ++}; ++ ++static struct gpio cambria_gpios_gw2350[] = { ++ // ARM GPIO ++#if 0 // configured from bootloader ++ { 0, GPIOF_IN, "ARM_DIO0" }, ++ { 1, GPIOF_IN, "ARM_DIO1" }, ++ { 2, GPIOF_IN, "ARM_DIO2" }, ++ { 3, GPIOF_IN, "ARM_DIO3" }, ++ { 4, GPIOF_IN, "ARM_DIO4" }, ++ { 5, GPIOF_IN, "ARM_DIO5" }, ++ { 12, GPIOF_OUT_INIT_HIGH, "WDOGEN#" }, ++#endif ++ { 8, GPIOF_IN, "ARM_DIO8" }, ++ { 9, GPIOF_IN, "ARM_DIO9" }, ++}; ++ ++static struct gpio cambria_gpios_gw2358[] = { ++ // ARM GPIO ++#if 0 // configured from bootloader ++ { 0, GPIOF_IN, "*VINLOW#" }, ++ { 2, GPIOF_IN, "*GPS_PPS" }, ++ { 3, GPIOF_IN, "*GPS_IRQ#" }, ++ { 4, GPIOF_IN, "*RS485_IRQ#" }, ++ { 5, GPIOF_IN, "*SER_EN#" }, ++ { 14, GPIOF_OUT_INIT_HIGH, "*WDOGEN#" }, ++#endif ++}; ++ ++static struct gpio cambria_gpios_gw2359[] = { ++ // ARM GPIO ++#if 0 // configured from bootloader ++ { 0, GPIOF_IN, "*PCA_IRQ#" }, ++ { 1, GPIOF_IN, "ARM_DIO1" }, ++ { 2, GPIOF_IN, "ARM_DIO2" }, ++ { 3, GPIOF_IN, "ARM_DIO3" }, ++ { 4, GPIOF_IN, "ARM_DIO4" }, ++ { 5, GPIOF_IN, "ARM_DIO5" }, ++ { 8, GPIOF_OUT_INIT_HIGH, "*WDOGEN#" }, ++#endif ++ { 11, GPIOF_OUT_INIT_HIGH, "*SER_EN" }, // console serial enable ++ { 12, GPIOF_IN, "*GSC_IRQ#" }, ++ { 13, GPIOF_OUT_INIT_HIGH, "*PCIE_RST#"}, ++ // GSC GPIO ++#if !(IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ {100, GPIOF_IN, "*USER_PB#" }, ++#endif ++ {103, GPIOF_OUT_INIT_HIGH, "*5V_EN" }, // 5V aux supply enable ++ {108, GPIOF_IN, "*SMUXDA0" }, ++ {109, GPIOF_IN, "*SMUXDA1" }, ++ {110, GPIOF_IN, "*SMUXDA2" }, ++ {111, GPIOF_IN, "*SMUXDB0" }, ++ {112, GPIOF_IN, "*SMUXDB1" }, ++ {113, GPIOF_IN, "*SMUXDB2" }, ++ // PCA GPIO ++ {118, GPIOF_IN, "*USIM2_DET#"}, // USIM2 Detect ++ {120, GPIOF_OUT_INIT_LOW, "*USB1_PCI_SEL"}, // USB1 Select (1=PCI, 0=FP) ++ {121, GPIOF_OUT_INIT_LOW, "*USB2_PCI_SEL"}, // USB2 Select (1=PCI, 0=FP) ++ {122, GPIOF_IN, "*USIM1_DET#"}, // USIM1 Detect ++ {123, GPIOF_OUT_INIT_HIGH, "*COM1_DTR#" }, // J21/J10 ++ {124, GPIOF_IN, "*COM1_DSR#" }, // J21/J10 ++ {127, GPIOF_IN, "PCA_DIO0" }, ++ {128, GPIOF_IN, "PCA_DIO1" }, ++ {129, GPIOF_IN, "PCA_DIO2" }, ++ {130, GPIOF_IN, "PCA_DIO3" }, ++ {131, GPIOF_IN, "PCA_DIO4" }, ++}; ++ ++static struct gpio cambria_gpios_gw2360[] = { ++ // ARM GPIO ++ { 0, GPIOF_IN, "*PCA_IRQ#" }, ++ { 11, GPIOF_OUT_INIT_LOW, "*SER0_EN#" }, ++ { 12, GPIOF_IN, "*GSC_IRQ#" }, ++ { 13, GPIOF_OUT_INIT_HIGH, "*PCIE_RST#"}, ++ // GSC GPIO ++#if !(IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ {100, GPIOF_IN, "*USER_PB#" }, ++#endif ++ {108, GPIOF_OUT_INIT_LOW, "*ENET1_EN#" }, // ENET1 TX Enable ++ {109, GPIOF_IN, "*ENET1_PRES#" }, // ENET1 Detect (0=SFP present) ++ {110, GPIOF_OUT_INIT_LOW, "*ENET2_EN#" }, // ENET2 TX Enable ++ {111, GPIOF_IN, "*ENET2_PRES#"}, // ENET2 Detect (0=SFP present) ++ // PCA GPIO ++ {116, GPIOF_OUT_INIT_HIGH, "*USIM2_LOC"}, // USIM2 Select (1=Loc, 0=Rem) ++ {117, GPIOF_IN, "*USIM2_DET_LOC#" },// USIM2 Detect (Local Slot) ++ {118, GPIOF_IN, "*USIM2_DET_REM#" },// USIM2 Detect (Remote Slot) ++ {120, GPIOF_OUT_INIT_LOW, "*USB1_PCI_SEL"}, // USB1 Select (1=PCIe1, 0=J1) ++ {121, GPIOF_OUT_INIT_LOW, "*USB2_PCI_SEL"}, // USB2 Select (1=PCIe2, 0=J1) ++ {122, GPIOF_IN, "*USIM1_DET#"}, // USIM1 Detect ++ {127, GPIOF_IN, "DIO0" }, ++ {128, GPIOF_IN, "DIO1" }, ++ {129, GPIOF_IN, "DIO2" }, ++ {130, GPIOF_IN, "DIO3" }, ++ {131, GPIOF_IN, "DIO4" }, ++}; ++ ++static struct latch_led cambria_latch_leds[] = { ++ { ++ .name = "ledA", /* green led */ ++ .bit = 0, ++ }, ++ { ++ .name = "ledB", /* green led */ ++ .bit = 1, ++ }, ++ { ++ .name = "ledC", /* green led */ ++ .bit = 2, ++ }, ++ { ++ .name = "ledD", /* green led */ ++ .bit = 3, ++ }, ++ { ++ .name = "ledE", /* green led */ ++ .bit = 4, ++ }, ++ { ++ .name = "ledF", /* green led */ ++ .bit = 5, ++ }, ++ { ++ .name = "ledG", /* green led */ ++ .bit = 6, ++ }, ++ { ++ .name = "ledH", /* green led */ ++ .bit = 7, ++ } ++}; ++ ++static struct latch_led_platform_data cambria_latch_leds_data = { ++ .num_leds = 8, ++ .leds = cambria_latch_leds, ++ .mem = 0x53F40000, ++}; ++ ++static struct platform_device cambria_latch_leds_device = { ++ .name = "leds-latch", ++ .id = -1, ++ .dev.platform_data = &cambria_latch_leds_data, ++}; ++ ++static struct resource cambria_usb0_resources[] = { ++ { ++ .start = 0xCD000000, ++ .end = 0xCD000300, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = 32, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct resource cambria_usb1_resources[] = { ++ { ++ .start = 0xCE000000, ++ .end = 0xCE000300, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = 33, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static u64 ehci_dma_mask = ~(u32)0; ++ ++static struct usb_ehci_pdata cambria_usb_pdata = { ++ .big_endian_desc = 1, ++ .big_endian_mmio = 1, ++ .has_tt = 1, ++ .caps_offset = 0x100, ++}; ++ ++static struct platform_device cambria_usb0_device = { ++ .name = "ehci-platform", ++ .id = 0, ++ .resource = cambria_usb0_resources, ++ .num_resources = ARRAY_SIZE(cambria_usb0_resources), ++ .dev = { ++ .dma_mask = &ehci_dma_mask, ++ .coherent_dma_mask = 0xffffffff, ++ .platform_data = &cambria_usb_pdata, ++ }, ++}; ++ ++static struct platform_device cambria_usb1_device = { ++ .name = "ehci-platform", ++ .id = 1, ++ .resource = cambria_usb1_resources, ++ .num_resources = ARRAY_SIZE(cambria_usb1_resources), ++ .dev = { ++ .dma_mask = &ehci_dma_mask, ++ .coherent_dma_mask = 0xffffffff, ++ .platform_data = &cambria_usb_pdata, ++ }, ++}; ++ ++static struct gw_i2c_pld_platform_data gw_i2c_pld_data0 = { ++ .gpio_base = 16, ++ .nr_gpio = 8, ++}; ++ ++static struct gw_i2c_pld_platform_data gw_i2c_pld_data1 = { ++ .gpio_base = 24, ++ .nr_gpio = 2, ++}; ++ ++ ++static struct gpio_keys_button cambria_gpio_buttons[] = { ++ { ++ .desc = "user", ++ .type = EV_KEY, ++ .code = BTN_0, ++ .debounce_interval = 6, ++ .gpio = 25, ++ } ++}; ++ ++static struct gpio_keys_platform_data cambria_gpio_buttons_data = { ++ .poll_interval = 500, ++ .nbuttons = 1, ++ .buttons = cambria_gpio_buttons, ++}; ++ ++static struct platform_device cambria_gpio_buttons_device = { ++ .name = "gpio-keys-polled", ++ .id = -1, ++ .dev.platform_data = &cambria_gpio_buttons_data, ++}; ++ ++static struct platform_device *cambria_devices[] __initdata = { ++ &cambria_i2c_gpio, ++ &cambria_flash, ++ &cambria_uart, ++}; ++ ++static int cambria_register_gpio(struct gpio *array, size_t num) ++{ ++ int i, err, ret; ++ ++ ret = 0; ++ for (i = 0; i < num; i++, array++) { ++ const char *label = array->label; ++ if (label[0] == '*') ++ label++; ++ err = gpio_request_one(array->gpio, array->flags, label); ++ if (err) ++ ret = err; ++ else { ++ err = gpio_export(array->gpio, array->label[0] != '*'); ++ } ++ } ++ return ret; ++} ++ ++static void __init cambria_gw23xx_setup(void) ++{ ++ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ ++ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); ++ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; ++ ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++} ++ ++static void __init cambria_gw2350_setup(void) ++{ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[0].mapbase = 0x52FF0000; ++ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52FF0000, 0x0fff); ++ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; ++ ++ *IXP4XX_EXP_CS3 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[1].mapbase = 0x53FF0000; ++ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53FF0000, 0x0fff); ++ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; ++ ++ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ ++ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); ++ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; ++ ++ platform_device_register(&cambria_optional_uart); ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ platform_device_register(&cambria_gpio_leds_device); ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2350)); ++} ++ ++static void __init cambria_gw2358_setup(void) ++{ ++ *IXP4XX_EXP_CS3 = 0xBFFF3C43; // bit0 = 16bit vs 8bit bus ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[0].mapbase = 0x53FC0000; ++ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x53FC0000, 0x0fff); ++ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; ++ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[1].mapbase = 0x53F80000; ++ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff); ++ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; ++ ++ cambria_gpio_resources[0].start = (1 << 14) | (1 << 16) | (1 << 17) | (1 << 18) |\ ++ (1 << 19) | (1 << 20) | (1 << 24) | (1 << 25); ++ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; ++ ++ platform_device_register(&cambria_optional_uart); ++ ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ platform_device_register(&cambria_pata); ++ ++ cambria_gpio_leds[0].gpio = 24; ++ platform_device_register(&cambria_gpio_leds_device); ++ ++ platform_device_register(&cambria_latch_leds_device); ++ ++ platform_device_register(&cambria_gpio_buttons_device); ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2358)); ++} ++ ++static void __init cambria_gw2359_setup(void) ++{ ++#if defined(CONFIG_MVSWITCH_PHY) || defined(CONFIG_MVSWITCH_PHY_MODULE) ++ /* The mvswitch driver has some hard-coded values which could ++ * easily be turned into a platform resource if needed. For now they ++ * match our hardware configuration: ++ * MV_BASE 0x10 - phy base address ++ * MV_WANPORT 0 - Port0 (ENET2) is WAN (SFP module) ++ * MV_CPUPORT 5 - Port5 is CPU NPEA (eth1) ++ * ++ * The mvswitch driver registers a fixup which forces a driver match ++ * if phy_addr matches MV_BASE ++ * ++ * Two static defautl VLAN's are created: WAN port in 1, and all other ports ++ * in the other. ++ */ ++ cambria_npea_data.phy = 0x10; // mvswitch driver catches this ++#else ++ // Switch Port5 to CPU is MII<->MII (no PHY) - this disables the genphy driver ++ cambria_npea_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ // CPU NPE-C is in bridge bypass mode to Port4 PHY@0x14 ++ cambria_npec_data.phy = 0x14; ++#endif ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ cambria_gpio_leds_data.num_leds = 3; ++ cambria_gpio_leds[0].name = "user1"; ++ cambria_gpio_leds[0].gpio = 125; // PNLLED1# ++ cambria_gpio_leds[1].gpio = 126; // PNLLED3# ++ cambria_gpio_leds[2].gpio = 119; // PNLLED4# ++ platform_device_register(&cambria_gpio_leds_device); ++ ++#if (IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ cambria_gpio_buttons[0].gpio = 100; ++ platform_device_register(&cambria_gpio_buttons_device); ++#endif ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2359)); ++} ++ ++static void __init cambria_gw2360_setup(void) ++{ ++ /* The GW2360 has 8 UARTs in addition to the 1 IXP4xxx UART. ++ * The chip-selects are expanded via a 3-to-8 decoder and CS2 ++ * and they are 8bit devices ++ */ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ cambria_optional_uart_data[0].mapbase = 0x52000000; ++ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52000000, 0x0fff); ++ cambria_optional_uart_data[0].uartclk = 18432000; ++ cambria_optional_uart_data[0].iotype = UPIO_MEM; ++ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO2; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[1].mapbase = 0x52000008; ++ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x52000008, 0x0fff); ++ cambria_optional_uart_data[1].uartclk = 18432000; ++ cambria_optional_uart_data[1].iotype = UPIO_MEM; ++ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO3; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[2].mapbase = 0x52000010; ++ cambria_optional_uart_data[2].membase = (void __iomem *)ioremap(0x52000010, 0x0fff); ++ cambria_optional_uart_data[2].uartclk = 18432000; ++ cambria_optional_uart_data[2].iotype = UPIO_MEM; ++ cambria_optional_uart_data[2].irq = IRQ_IXP4XX_GPIO4; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[3].mapbase = 0x52000018; ++ cambria_optional_uart_data[3].membase = (void __iomem *)ioremap(0x52000018, 0x0fff); ++ cambria_optional_uart_data[3].uartclk = 18432000; ++ cambria_optional_uart_data[3].iotype = UPIO_MEM; ++ cambria_optional_uart_data[3].irq = IRQ_IXP4XX_GPIO5; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO5, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[4].mapbase = 0x52000020; ++ cambria_optional_uart_data[4].membase = (void __iomem *)ioremap(0x52000020, 0x0fff); ++ cambria_optional_uart_data[4].uartclk = 18432000; ++ cambria_optional_uart_data[4].iotype = UPIO_MEM; ++ cambria_optional_uart_data[4].irq = IRQ_IXP4XX_GPIO8; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[5].mapbase = 0x52000028; ++ cambria_optional_uart_data[5].membase = (void __iomem *)ioremap(0x52000028, 0x0fff); ++ cambria_optional_uart_data[5].uartclk = 18432000; ++ cambria_optional_uart_data[5].iotype = UPIO_MEM; ++ cambria_optional_uart_data[5].irq = IRQ_IXP4XX_GPIO9; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[6].mapbase = 0x52000030; ++ cambria_optional_uart_data[6].membase = (void __iomem *)ioremap(0x52000030, 0x0fff); ++ cambria_optional_uart_data[6].uartclk = 18432000; ++ cambria_optional_uart_data[6].iotype = UPIO_MEM; ++ cambria_optional_uart_data[6].irq = IRQ_IXP4XX_GPIO10; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart.num_resources = 7, ++ platform_device_register(&cambria_optional_uart); ++ ++#if defined(CONFIG_MVSWITCH_PHY) || defined(CONFIG_MVSWITCH_PHY_MODULE) ++ /* The mvswitch driver has some hard-coded values which could ++ * easily be turned into a platform resource if needed. For now they ++ * match our hardware configuration: ++ * MV_BASE 0x10 - phy base address ++ * MV_WANPORT 0 - Port0 (ENET2) is WAN (SFP module) ++ * MV_CPUPORT 5 - Port5 is CPU NPEA (eth1) ++ * ++ * The mvswitch driver registers a fixup which forces a driver match ++ * if phy_addr matches MV_BASE ++ * ++ * Two static defautl VLAN's are created: WAN port in 1, and all other ports ++ * in the other. ++ */ ++ cambria_npea_data.phy = 0x10; // mvswitch driver catches this ++#else ++ // Switch Port5 to CPU is MII<->MII (no PHY) - this disables the generic PHY driver ++ cambria_npea_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++#endif ++ ++ // disable genphy autonegotiation on NPE-C PHY (eth1) as its 100BaseFX ++ //cambria_npec_data.noautoneg = 1; // disable autoneg ++ cambria_npec_data.speed_10 = 0; // 100mbps ++ cambria_npec_data.half_duplex = 0; // full-duplex ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ cambria_gpio_leds_data.num_leds = 3; ++ cambria_gpio_leds[0].name = "user1"; ++ cambria_gpio_leds[0].gpio = 125; ++ cambria_gpio_leds[1].gpio = 126; ++ cambria_gpio_leds[2].gpio = 119; ++ platform_device_register(&cambria_gpio_leds_device); ++ ++#if (IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ cambria_gpio_buttons[0].gpio = 100; ++ platform_device_register(&cambria_gpio_buttons_device); ++#endif ++ ++#ifdef SFP_SERIALID ++ /* the SFP modules each have an i2c bus for serial ident via GSC GPIO ++ * To use these the i2c-gpio driver must be changed to use the _cansleep ++ * varients of gpio_get_value/gpio_set_value (I don't know why it doesn't ++ * use that anyway as it doesn't operate in an IRQ context). ++ * Additionally the i2c-gpio module must set the gpio to output-high prior ++ * to changing direction to an input to enable internal Pullups ++ */ ++ platform_device_register(&cambria_i2c_gpio_sfpa); ++ platform_device_register(&cambria_i2c_gpio_sfpb); ++#endif ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2360)); ++} ++ ++static struct cambria_board_info cambria_boards[] __initdata = { ++ { ++ .model = "GW2350", ++ .setup = cambria_gw2350_setup, ++ }, { ++ .model = "GW2351", ++ .setup = cambria_gw2350_setup, ++ }, { ++ .model = "GW2358", ++ .setup = cambria_gw2358_setup, ++ }, { ++ .model = "GW2359", ++ .setup = cambria_gw2359_setup, ++ }, { ++ .model = "GW2360", ++ .setup = cambria_gw2360_setup, ++ }, { ++ .model = "GW2371", ++ .setup = cambria_gw2358_setup, ++ } ++}; ++ ++static struct cambria_board_info * __init cambria_find_board_info(char *model) ++{ ++ int i; ++ model[6] = '\0'; ++ ++ for (i = 0; i < ARRAY_SIZE(cambria_boards); i++) { ++ struct cambria_board_info *info = &cambria_boards[i]; ++ if (strcmp(info->model, model) == 0) ++ return info; ++ } ++ ++ return NULL; ++} ++ ++static struct nvmem_device *at24_nvmem; ++ ++static void at24_setup(struct nvmem_device *mem_acc, void *context) ++{ ++ char mac_addr[ETH_ALEN]; ++ char model[7]; ++ ++ at24_nvmem = mem_acc; ++ ++ /* Read MAC addresses */ ++ if (nvmem_device_read(at24_nvmem, 0x0, 6, mac_addr) == 6) { ++ memcpy(&cambria_npec_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ if (nvmem_device_read(at24_nvmem, 0x6, 6, mac_addr) == 6) { ++ memcpy(&cambria_npea_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ ++ /* Read the first 6 bytes of the model number */ ++ if (nvmem_device_read(at24_nvmem, 0x20, 6, model) == 6) { ++ cambria_info = cambria_find_board_info(model); ++ } ++ ++} ++ ++static struct at24_platform_data cambria_eeprom_info = { ++ .byte_len = 1024, ++ .page_size = 16, ++ .flags = AT24_FLAG_READONLY, ++ .setup = at24_setup, ++}; ++ ++static struct pca953x_platform_data cambria_pca_data = { ++ .gpio_base = 100, ++ .irq_base = -1, ++}; ++ ++static struct pca953x_platform_data cambria_pca2_data = { ++ .gpio_base = 116, ++ .irq_base = -1, ++}; ++ ++static struct i2c_board_info __initdata cambria_i2c_board_info[] = { ++ { ++ I2C_BOARD_INFO("pca9555", 0x23), ++ .platform_data = &cambria_pca_data, ++ }, ++ { ++ I2C_BOARD_INFO("pca9555", 0x27), ++ .platform_data = &cambria_pca2_data, ++ }, ++ { ++ I2C_BOARD_INFO("ds1672", 0x68), ++ }, ++ { ++ I2C_BOARD_INFO("gsp", 0x29), ++ }, ++ { ++ I2C_BOARD_INFO("ad7418", 0x28), ++ }, ++ { ++ I2C_BOARD_INFO("24c08", 0x51), ++ .platform_data = &cambria_eeprom_info ++ }, ++ { ++ I2C_BOARD_INFO("gw_i2c_pld", 0x56), ++ .platform_data = &gw_i2c_pld_data0, ++ }, ++ { ++ I2C_BOARD_INFO("gw_i2c_pld", 0x57), ++ .platform_data = &gw_i2c_pld_data1, ++ }, ++}; ++ ++static void __init cambria_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ cambria_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ cambria_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; // make sure window is writable ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(ARRAY_AND_SIZE(cambria_devices)); ++ ++ cambria_pata_resources[0].start = 0x53e00000; ++ cambria_pata_resources[0].end = 0x53e3ffff; ++ ++ cambria_pata_resources[1].start = 0x53e40000; ++ cambria_pata_resources[1].end = 0x53e7ffff; ++ ++ cambria_pata_data.cs0_cfg = IXP4XX_EXP_CS3; ++ cambria_pata_data.cs1_cfg = IXP4XX_EXP_CS3; ++ ++ i2c_register_board_info(0, ARRAY_AND_SIZE(cambria_i2c_board_info)); ++} ++ ++static int __init cambria_model_setup(void) ++{ ++ if (!machine_is_cambria()) ++ return 0; ++ ++ if (cambria_info) { ++ printk(KERN_DEBUG "Running on Gateworks Cambria %s\n", ++ cambria_info->model); ++ cambria_info->setup(); ++ } else { ++ printk(KERN_INFO "Unknown/missing Cambria model number" ++ " -- defaults will be used\n"); ++ cambria_gw23xx_setup(); ++ } ++ ++ return 0; ++} ++late_initcall(cambria_model_setup); ++ ++MACHINE_START(CAMBRIA, "Gateworks Cambria series") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = cambria_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch b/target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch new file mode 100644 index 000000000..f46b9c61b --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch @@ -0,0 +1,11 @@ +--- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c ++++ b/arch/arm/mach-ixp4xx/ixp4xx_npe.c +@@ -586,6 +586,8 @@ int npe_load_firmware(struct npe *npe, c + npe_reset(npe); + #endif + ++ print_npe(KERN_INFO, npe, "firmware's license can be found in /usr/share/doc/LICENSE.IPL\n"); ++ + print_npe(KERN_INFO, npe, "firmware functionality 0x%X, " + "revision 0x%X:%X\n", (image->id >> 16) & 0xFF, + (image->id >> 8) & 0xFF, image->id & 0xFF); diff --git a/target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch b/target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch new file mode 100644 index 000000000..cc77c5ddd --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch @@ -0,0 +1,127 @@ +From e3eab80fb5d0a7d7fdb0f2f231b27161d5ec3804 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 30 Jun 2013 15:52:53 +0200 +Subject: [PATCH 23/36] 205-npe_driver_separate_phy_functions.patch + +--- + drivers/net/ethernet/xscale/ixp4xx_eth.c | 70 ++++++++++++++++++++++-------- + 1 file changed, 51 insertions(+), 19 deletions(-) + +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -588,6 +588,51 @@ static void ixp4xx_adjust_link(struct ne + dev->name, port->speed, port->duplex ? "full" : "half"); + } + ++static int ixp4xx_phy_connect(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ struct eth_plat_info *plat = port->plat; ++ char phy_id[MII_BUS_ID_SIZE + 3]; ++ ++ snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, ++ mdio_bus->id, plat->phy); ++ port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, ++ PHY_INTERFACE_MODE_MII); ++ if (IS_ERR(port->phydev)) { ++ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); ++ return PTR_ERR(port->phydev); ++ } ++ ++ /* mask with MAC supported features */ ++ port->phydev->supported &= PHY_BASIC_FEATURES; ++ port->phydev->advertising = port->phydev->supported; ++ ++ port->phydev->irq = PHY_POLL; ++ ++ return 0; ++} ++ ++static void ixp4xx_phy_disconnect(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ ++ phy_disconnect(port->phydev); ++} ++ ++static void ixp4xx_phy_start(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ ++ port->speed = 0; /* force "link up" message */ ++ phy_start(port->phydev); ++} ++ ++static void ixp4xx_phy_stop(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ ++ phy_stop(port->phydev); ++} + + static inline void debug_pkt(struct net_device *dev, const char *func, + u8 *data, int len) +@@ -1242,8 +1287,7 @@ static int eth_open(struct net_device *d + return err; + } + +- port->speed = 0; /* force "link up" message */ +- phy_start(dev->phydev); ++ ixp4xx_phy_start(dev); + + for (i = 0; i < ETH_ALEN; i++) + __raw_writel(dev->dev_addr[i], &port->regs->hw_addr[i]); +@@ -1364,7 +1408,7 @@ static int eth_close(struct net_device * + printk(KERN_CRIT "%s: unable to disable loopback\n", + dev->name); + +- phy_stop(dev->phydev); ++ ixp4xx_phy_stop(dev); + + if (!ports_open) + qmgr_disable_irq(TXDONE_QUEUE); +@@ -1391,7 +1435,6 @@ static int eth_init_one(struct platform_ + struct eth_plat_info *plat = dev_get_platdata(&pdev->dev); + struct phy_device *phydev = NULL; + u32 regs_phys; +- char phy_id[MII_BUS_ID_SIZE + 3]; + int err; + + if (!(dev = alloc_etherdev(sizeof(struct port)))) +@@ -1449,16 +1492,9 @@ static int eth_init_one(struct platform_ + __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); + udelay(50); + +- snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, +- mdio_bus->id, plat->phy); +- phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, +- PHY_INTERFACE_MODE_MII); +- if (IS_ERR(phydev)) { +- err = PTR_ERR(phydev); ++ err = ixp4xx_phy_connect(dev); ++ if (err) + goto err_free_mem; +- } +- +- phydev->irq = PHY_POLL; + + if ((err = register_netdev(dev))) + goto err_phy_dis; +@@ -1469,7 +1505,7 @@ static int eth_init_one(struct platform_ + return 0; + + err_phy_dis: +- phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(phydev); + err_free_mem: + npe_port_tab[NPE_ID(port->id)] = NULL; + release_resource(port->mem_res); +@@ -1487,7 +1523,7 @@ static int eth_remove_one(struct platfor + struct port *port = netdev_priv(dev); + + unregister_netdev(dev); +- phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(phydev); + npe_port_tab[NPE_ID(port->id)] = NULL; + npe_release(port->npe); + release_resource(port->mem_res); diff --git a/target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch b/target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch new file mode 100644 index 000000000..e12764e05 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch @@ -0,0 +1,100 @@ +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -171,12 +171,13 @@ struct port { + struct npe *npe; + struct net_device *netdev; + struct napi_struct napi; ++ struct phy_device *phydev; + struct eth_plat_info *plat; + buffer_t *rx_buff_tab[RX_DESCS], *tx_buff_tab[TX_DESCS]; + struct desc *desc_tab; /* coherent */ + u32 desc_tab_phys; + int id; /* logical port ID */ +- int speed, duplex; ++ int link, speed, duplex; + u8 firmware[4]; + int hwts_tx_en; + int hwts_rx_en; +@@ -558,36 +559,46 @@ static void ixp4xx_mdio_remove(void) + } + + +-static void ixp4xx_adjust_link(struct net_device *dev) ++static void ixp4xx_update_link(struct net_device *dev) + { + struct port *port = netdev_priv(dev); +- struct phy_device *phydev = dev->phydev; +- +- if (!phydev->link) { +- if (port->speed) { +- port->speed = 0; +- printk(KERN_INFO "%s: link down\n", dev->name); +- } +- return; +- } +- +- if (port->speed == phydev->speed && port->duplex == phydev->duplex) +- return; +- +- port->speed = phydev->speed; +- port->duplex = phydev->duplex; + +- if (port->duplex) ++ if (port->duplex == DUPLEX_FULL) + __raw_writel(DEFAULT_TX_CNTRL0 & ~TX_CNTRL0_HALFDUPLEX, + &port->regs->tx_control[0]); + else + __raw_writel(DEFAULT_TX_CNTRL0 | TX_CNTRL0_HALFDUPLEX, + &port->regs->tx_control[0]); + ++ netif_carrier_on(dev); + printk(KERN_INFO "%s: link up, speed %u Mb/s, %s duplex\n", + dev->name, port->speed, port->duplex ? "full" : "half"); + } + ++static void ixp4xx_adjust_link(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ struct phy_device *phydev = port->phydev; ++ int status_change = 0; ++ ++ if (phydev->link) { ++ if (port->duplex != phydev->duplex ++ || port->speed != phydev->speed) { ++ status_change = 1; ++ } ++ } ++ ++ if (phydev->link != port->link) ++ status_change = 1; ++ ++ port->link = phydev->link; ++ port->speed = phydev->speed; ++ port->duplex = phydev->duplex; ++ ++ if (status_change) ++ ixp4xx_update_link(dev); ++} ++ + static int ixp4xx_phy_connect(struct net_device *dev) + { + struct port *port = netdev_priv(dev); +@@ -623,7 +634,6 @@ static void ixp4xx_phy_start(struct net_ + { + struct port *port = netdev_priv(dev); + +- port->speed = 0; /* force "link up" message */ + phy_start(port->phydev); + } + +@@ -1499,6 +1509,10 @@ static int eth_init_one(struct platform_ + if ((err = register_netdev(dev))) + goto err_phy_dis; + ++ port->link = 0; ++ port->speed = 0; ++ port->duplex = -1; ++ + printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, + npe_name(port->npe)); + diff --git a/target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch b/target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch new file mode 100644 index 000000000..a23644a16 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch @@ -0,0 +1,153 @@ +TODO: take care of additional PHYs through the PHY abstraction layer + +--- a/arch/arm/mach-ixp4xx/include/mach/platform.h ++++ b/arch/arm/mach-ixp4xx/include/mach/platform.h +@@ -95,12 +95,23 @@ struct ixp4xx_pata_data { + #define IXP4XX_ETH_NPEB 0x10 + #define IXP4XX_ETH_NPEC 0x20 + ++#define IXP4XX_ETH_PHY_MAX_ADDR 32 ++ + /* Information about built-in Ethernet MAC interfaces */ + struct eth_plat_info { + u8 phy; /* MII PHY ID, 0 - 31 */ + u8 rxq; /* configurable, currently 0 - 31 only */ + u8 txreadyq; + u8 hwaddr[6]; ++ ++ u32 phy_mask; ++#if 0 ++ int speed; ++ int duplex; ++#else ++ int speed_10; ++ int half_duplex; ++#endif + }; + + /* Information about built-in HSS (synchronous serial) interfaces */ +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -605,6 +605,37 @@ static int ixp4xx_phy_connect(struct net + struct eth_plat_info *plat = port->plat; + char phy_id[MII_BUS_ID_SIZE + 3]; + ++ if (plat->phy == IXP4XX_ETH_PHY_MAX_ADDR) { ++#if 0 ++ switch (plat->speed) { ++ case SPEED_10: ++ case SPEED_100: ++ break; ++ default: ++ printk(KERN_ERR "%s: invalid speed (%d)\n", ++ dev->name, plat->speed); ++ return -EINVAL; ++ } ++ ++ switch (plat->duplex) { ++ case DUPLEX_HALF: ++ case DUPLEX_FULL: ++ break; ++ default: ++ printk(KERN_ERR "%s: invalid duplex mode (%d)\n", ++ dev->name, plat->duplex); ++ return -EINVAL; ++ } ++ port->speed = plat->speed; ++ port->duplex = plat->duplex; ++#else ++ port->speed = plat->speed_10 ? SPEED_10 : SPEED_100; ++ port->duplex = plat->half_duplex ? DUPLEX_HALF : DUPLEX_FULL; ++#endif ++ ++ return 0; ++ } ++ + snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, + mdio_bus->id, plat->phy); + port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, +@@ -627,21 +658,32 @@ static void ixp4xx_phy_disconnect(struct + { + struct port *port = netdev_priv(dev); + +- phy_disconnect(port->phydev); ++ if (port->phydev) ++ phy_disconnect(port->phydev); + } + + static void ixp4xx_phy_start(struct net_device *dev) + { + struct port *port = netdev_priv(dev); + +- phy_start(port->phydev); ++ if (port->phydev) { ++ phy_start(port->phydev); ++ } else { ++ port->link = 1; ++ ixp4xx_update_link(dev); ++ } + } + + static void ixp4xx_phy_stop(struct net_device *dev) + { + struct port *port = netdev_priv(dev); + +- phy_stop(port->phydev); ++ if (port->phydev) { ++ phy_stop(port->phydev); ++ } else { ++ port->link = 0; ++ ixp4xx_update_link(dev); ++ } + } + + static inline void debug_pkt(struct net_device *dev, const char *func, +@@ -1030,6 +1072,8 @@ static void eth_set_mcast_list(struct ne + + static int eth_ioctl(struct net_device *dev, struct ifreq *req, int cmd) + { ++ struct port *port = netdev_priv(dev); ++ + if (!netif_running(dev)) + return -EINVAL; + +@@ -1040,6 +1084,9 @@ static int eth_ioctl(struct net_device * + return hwtstamp_get(dev, req); + } + ++ if (!port->phydev) ++ return -EOPNOTSUPP; ++ + return phy_mii_ioctl(dev->phydev, req, cmd); + } + +@@ -1059,6 +1106,11 @@ static void ixp4xx_get_drvinfo(struct ne + + static int ixp4xx_nway_reset(struct net_device *dev) + { ++ struct port *port = netdev_priv(dev); ++ ++ if (!port->phydev) ++ return -EOPNOTSUPP; ++ + return phy_start_aneg(dev->phydev); + } + +@@ -1519,7 +1571,7 @@ static int eth_init_one(struct platform_ + return 0; + + err_phy_dis: +- ixp4xx_phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(port->netdev); + err_free_mem: + npe_port_tab[NPE_ID(port->id)] = NULL; + release_resource(port->mem_res); +@@ -1537,7 +1589,7 @@ static int eth_remove_one(struct platfor + struct port *port = netdev_priv(dev); + + unregister_netdev(dev); +- ixp4xx_phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(port->netdev); + npe_port_tab[NPE_ID(port->id)] = NULL; + npe_release(port->npe); + release_resource(port->mem_res); diff --git a/target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch b/target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch new file mode 100644 index 000000000..66bc3e86b --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch @@ -0,0 +1,201 @@ +--- a/drivers/leds/Kconfig ++++ b/drivers/leds/Kconfig +@@ -312,6 +312,12 @@ config LEDS_LP8860 + on the LP8860 4 channel LED driver using the I2C communication + bus. + ++config LEDS_LATCH ++ tristate "LED Support for Memory Latched LEDs" ++ depends on LEDS_CLASS ++ help ++ -- To Do -- ++ + config LEDS_CLEVO_MAIL + tristate "Mail LED on Clevo notebook" + depends on LEDS_CLASS +--- a/drivers/leds/Makefile ++++ b/drivers/leds/Makefile +@@ -25,6 +25,7 @@ obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunf + obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o + obj-$(CONFIG_LEDS_GPIO_REGISTER) += leds-gpio-register.o + obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o ++obj-$(CONFIG_LEDS_LATCH) += leds-latch.o + obj-$(CONFIG_LEDS_LP3944) += leds-lp3944.o + obj-$(CONFIG_LEDS_LP3952) += leds-lp3952.o + obj-$(CONFIG_LEDS_LP55XX_COMMON) += leds-lp55xx-common.o +--- /dev/null ++++ b/drivers/leds/leds-latch.c +@@ -0,0 +1,152 @@ ++/* ++ * LEDs driver for Memory Latched Devices ++ * ++ * Copyright (C) 2008 Gateworks Corp. ++ * Chris Lang ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static unsigned int mem_keep = 0xFF; ++static spinlock_t mem_lock; ++static unsigned char *iobase; ++ ++struct latch_led_data { ++ struct led_classdev cdev; ++ struct work_struct work; ++ u8 new_level; ++ u8 bit; ++ void (*set_led)(u8 bit, enum led_brightness value); ++}; ++ ++static void latch_set_led(u8 bit, enum led_brightness value) ++{ ++ if (value == LED_OFF) ++ mem_keep |= (0x1 << bit); ++ else ++ mem_keep &= ~(0x1 << bit); ++ ++ writeb(mem_keep, iobase); ++} ++ ++static void latch_led_set(struct led_classdev *led_cdev, ++ enum led_brightness value) ++{ ++ struct latch_led_data *led_dat = ++ container_of(led_cdev, struct latch_led_data, cdev); ++ ++ raw_spin_lock(mem_lock); ++ ++ led_dat->set_led(led_dat->bit, value); ++ ++ raw_spin_unlock(mem_lock); ++} ++ ++static int latch_led_probe(struct platform_device *pdev) ++{ ++ struct latch_led_platform_data *pdata = pdev->dev.platform_data; ++ struct latch_led *cur_led; ++ struct latch_led_data *leds_data, *led_dat; ++ int i, ret = 0; ++ ++ if (!pdata) ++ return -EBUSY; ++ ++ leds_data = kzalloc(sizeof(struct latch_led_data) * pdata->num_leds, ++ GFP_KERNEL); ++ if (!leds_data) ++ return -ENOMEM; ++ ++ for (i = 0; i < pdata->num_leds; i++) { ++ cur_led = &pdata->leds[i]; ++ led_dat = &leds_data[i]; ++ ++ led_dat->cdev.name = cur_led->name; ++ led_dat->cdev.default_trigger = cur_led->default_trigger; ++ led_dat->cdev.brightness_set = latch_led_set; ++ led_dat->cdev.brightness = LED_OFF; ++ led_dat->bit = cur_led->bit; ++ led_dat->set_led = pdata->set_led ? pdata->set_led : latch_set_led; ++ ++ ret = led_classdev_register(&pdev->dev, &led_dat->cdev); ++ if (ret < 0) { ++ goto err; ++ } ++ } ++ ++ if (!pdata->set_led) { ++ iobase = ioremap_nocache(pdata->mem, 0x1000); ++ writeb(0xFF, iobase); ++ } ++ platform_set_drvdata(pdev, leds_data); ++ ++ return 0; ++ ++err: ++ if (i > 0) { ++ for (i = i - 1; i >= 0; i--) { ++ led_classdev_unregister(&leds_data[i].cdev); ++ } ++ } ++ ++ kfree(leds_data); ++ ++ return ret; ++} ++ ++static int latch_led_remove(struct platform_device *pdev) ++{ ++ int i; ++ struct latch_led_platform_data *pdata = pdev->dev.platform_data; ++ struct latch_led_data *leds_data; ++ ++ leds_data = platform_get_drvdata(pdev); ++ ++ for (i = 0; i < pdata->num_leds; i++) { ++ led_classdev_unregister(&leds_data[i].cdev); ++ cancel_work_sync(&leds_data[i].work); ++ } ++ ++ kfree(leds_data); ++ ++ return 0; ++} ++ ++static struct platform_driver latch_led_driver = { ++ .probe = latch_led_probe, ++ .remove = latch_led_remove, ++ .driver = { ++ .name = "leds-latch", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __init latch_led_init(void) ++{ ++ return platform_driver_register(&latch_led_driver); ++} ++ ++static void __exit latch_led_exit(void) ++{ ++ platform_driver_unregister(&latch_led_driver); ++} ++ ++module_init(latch_led_init); ++module_exit(latch_led_exit); ++ ++MODULE_AUTHOR("Chris Lang "); ++MODULE_DESCRIPTION("Latch LED driver"); +--- a/include/linux/leds.h ++++ b/include/linux/leds.h +@@ -423,4 +423,18 @@ static inline void ledtrig_cpu(enum cpu_ + } + #endif + ++/* For the leds-latch driver */ ++struct latch_led { ++ const char *name; ++ char *default_trigger; ++ unsigned bit; ++}; ++ ++struct latch_led_platform_data { ++ int num_leds; ++ u32 mem; ++ struct latch_led *leds; ++ void (*set_led)(u8 bit, enum led_brightness value); ++}; ++ + #endif /* __LINUX_LEDS_H_INCLUDED */ diff --git a/target/linux/ixp4xx/patches-4.9/300-avila_support.patch b/target/linux/ixp4xx/patches-4.9/300-avila_support.patch new file mode 100644 index 000000000..c801607f4 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/300-avila_support.patch @@ -0,0 +1,726 @@ +--- a/arch/arm/mach-ixp4xx/avila-pci.c ++++ b/arch/arm/mach-ixp4xx/avila-pci.c +@@ -27,8 +27,8 @@ + #include + #include + +-#define AVILA_MAX_DEV 4 +-#define LOFT_MAX_DEV 6 ++#define AVILA_MAX_DEV 6 ++ + #define IRQ_LINES 4 + + /* PCI controller GPIO to IRQ pin mappings */ +@@ -55,10 +55,8 @@ static int __init avila_map_irq(const st + IXP4XX_GPIO_IRQ(INTD) + }; + +- if (slot >= 1 && +- slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) && +- pin >= 1 && pin <= IRQ_LINES) +- return pci_irq_table[(slot + pin - 2) % 4]; ++ if (slot >= 1 && slot <= AVILA_MAX_DEV && pin >= 1 && pin <= IRQ_LINES) ++ return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; + + return -1; + } +--- a/arch/arm/mach-ixp4xx/avila-setup.c ++++ b/arch/arm/mach-ixp4xx/avila-setup.c +@@ -14,9 +14,16 @@ + #include + #include + #include ++#include ++#include ++#include + #include + #include + #include ++#include ++#include ++#include ++#include + #include + #include + #include +@@ -26,10 +33,25 @@ + #include + #include + #include ++#include + + #define AVILA_SDA_PIN 7 + #define AVILA_SCL_PIN 6 + ++/* User LEDs */ ++#define AVILA_GW23XX_LED_USER_GPIO 3 ++#define AVILA_GW23X7_LED_USER_GPIO 4 ++ ++/* gpio mask used by platform device */ ++#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9) ++ ++struct avila_board_info { ++ unsigned char *model; ++ void (*setup)(void); ++}; ++ ++static struct avila_board_info *avila_info __initdata; ++ + static struct flash_platform_data avila_flash_data = { + .map_name = "cfi_probe", + .width = 2, +@@ -105,14 +127,69 @@ static struct platform_device avila_uart + .resource = avila_uart_resources + }; + +-static struct resource avila_pata_resources[] = { ++static struct resource avila_optional_uart_resources[] = { + { +- .flags = IORESOURCE_MEM +- }, ++ .start = 0x54000000, ++ .end = 0x54000fff, ++ .flags = IORESOURCE_MEM ++ },{ ++ .start = 0x55000000, ++ .end = 0x55000fff, ++ .flags = IORESOURCE_MEM ++ },{ ++ .start = 0x56000000, ++ .end = 0x56000fff, ++ .flags = IORESOURCE_MEM ++ },{ ++ .start = 0x57000000, ++ .end = 0x57000fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port avila_optional_uart_data[] = { + { +- .flags = IORESOURCE_MEM, ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, ++ },{ ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, ++ },{ ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, ++ },{ ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, + }, ++ { } ++}; ++ ++static struct platform_device avila_optional_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM1, ++ .dev.platform_data = avila_optional_uart_data, ++ .num_resources = 4, ++ .resource = avila_optional_uart_resources, ++}; ++ ++static struct resource avila_pata_resources[] = { + { ++ .flags = IORESOURCE_MEM ++ },{ ++ .flags = IORESOURCE_MEM, ++ },{ + .name = "intrq", + .start = IRQ_IXP4XX_GPIO12, + .end = IRQ_IXP4XX_GPIO12, +@@ -133,21 +210,237 @@ static struct platform_device avila_pata + .resource = avila_pata_resources, + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info avila_npeb_data = { ++ .phy = 0, ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct eth_plat_info avila_npec_data = { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct platform_device avila_npeb_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = &avila_npeb_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct platform_device avila_npec_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &avila_npec_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct gpio_led avila_gpio_leds[] = { ++ { ++ .name = "user", /* green led */ ++ .gpio = AVILA_GW23XX_LED_USER_GPIO, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio1", /* green led */ ++ .gpio = 104, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio2", /* green led */ ++ .gpio = 105, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio3", /* green led */ ++ .gpio = 106, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio4", /* green led */ ++ .gpio = 107, ++ .active_low = 1, ++ }, ++ ++}; ++ ++static struct gpio_led_platform_data avila_gpio_leds_data = { ++ .num_leds = 1, ++ .leds = avila_gpio_leds, ++}; ++ ++static struct platform_device avila_gpio_leds_device = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &avila_gpio_leds_data, ++}; ++ ++static struct latch_led avila_latch_leds[] = { ++ { ++ .name = "led0", /* green led */ ++ .bit = 0, ++ }, ++ { ++ .name = "led1", /* green led */ ++ .bit = 1, ++ }, ++ { ++ .name = "led2", /* green led */ ++ .bit = 2, ++ }, ++ { ++ .name = "led3", /* green led */ ++ .bit = 3, ++ }, ++ { ++ .name = "led4", /* green led */ ++ .bit = 4, ++ }, ++ { ++ .name = "led5", /* green led */ ++ .bit = 5, ++ }, ++ { ++ .name = "led6", /* green led */ ++ .bit = 6, ++ }, ++ { ++ .name = "led7", /* green led */ ++ .bit = 7, ++ } ++}; ++ ++static struct latch_led_platform_data avila_latch_leds_data = { ++ .num_leds = 8, ++ .leds = avila_latch_leds, ++ .mem = 0x51000000, ++}; ++ ++static struct platform_device avila_latch_leds_device = { ++ .name = "leds-latch", ++ .id = -1, ++ .dev.platform_data = &avila_latch_leds_data, ++}; ++ + static struct platform_device *avila_devices[] __initdata = { + &avila_i2c_gpio, +- &avila_flash, + &avila_uart + }; + +-static void __init avila_init(void) ++/* ++ * Audio Devices ++ */ ++ ++static struct platform_device avila_hss_device[] = { ++ { ++ .name = "gw_avila_hss", ++ .id = 0, ++ },{ ++ .name = "gw_avila_hss", ++ .id = 1, ++ },{ ++ .name = "gw_avila_hss", ++ .id = 2, ++ },{ ++ .name = "gw_avila_hss", ++ .id = 3, ++ }, ++}; ++ ++static struct platform_device avila_pcm_device[] = { ++ { ++ .name = "gw_avila-audio", ++ .id = 0, ++ },{ ++ .name = "gw_avila-audio", ++ .id = 1, ++ },{ ++ .name = "gw_avila-audio", ++ .id = 2, ++ },{ ++ .name = "gw_avila-audio", ++ .id = 3, ++ } ++}; ++ ++static void setup_audio_devices(void) { ++ platform_device_register(&avila_hss_device[0]); ++ platform_device_register(&avila_hss_device[1]); ++ platform_device_register(&avila_hss_device[2]); ++ platform_device_register(&avila_hss_device[3]); ++ ++ platform_device_register(&avila_pcm_device[0]); ++ platform_device_register(&avila_pcm_device[1]); ++ platform_device_register(&avila_pcm_device[2]); ++ platform_device_register(&avila_pcm_device[3]); ++} ++ ++static void __init avila_gw23xx_setup(void) + { +- ixp4xx_sys_init(); ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_npec_device); + +- avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); +- avila_flash_resource.end = +- IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ platform_device_register(&avila_gpio_leds_device); ++} + +- platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices)); ++static void __init avila_gw2342_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_npec_device); ++ ++ platform_device_register(&avila_gpio_leds_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; ++ ++ platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2345_setup(void) ++{ ++ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */ ++ platform_device_register(&avila_npec_device); ++ ++ platform_device_register(&avila_gpio_leds_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; ++ ++ platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2347_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; ++ platform_device_register(&avila_gpio_leds_device); ++} ++ ++static void __init avila_gw2348_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_npec_device); ++ ++ platform_device_register(&avila_gpio_leds_device); + + avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); + avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); +@@ -159,8 +452,335 @@ static void __init avila_init(void) + avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; + + platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2353_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_gpio_leds_device); ++} ++ ++static void __init avila_gw2355_setup(void) ++{ ++ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 16; ++ platform_device_register(&avila_npec_device); ++ ++ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ *IXP4XX_EXP_CS4 |= 0xbfff3c03; ++ avila_latch_leds[0].name = "RXD"; ++ avila_latch_leds[1].name = "TXD"; ++ avila_latch_leds[2].name = "POL"; ++ avila_latch_leds[3].name = "LNK"; ++ avila_latch_leds[4].name = "ERR"; ++ avila_latch_leds_data.num_leds = 5; ++ avila_latch_leds_data.mem = 0x54000000; ++ platform_device_register(&avila_latch_leds_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; ++ ++ platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2357_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ *IXP4XX_EXP_CS1 |= 0xbfff3c03; ++ platform_device_register(&avila_latch_leds_device); ++} ++ ++static void __init avila_gw2365_setup(void) ++{ ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS4 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO0, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[0].mapbase = 0x54000000; ++ avila_optional_uart_data[0].membase = (void __iomem *)ioremap(0x54000000, 0x0fff); ++ avila_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO0; ++ ++ *IXP4XX_EXP_CS5 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[1].mapbase = 0x55000000; ++ avila_optional_uart_data[1].membase = (void __iomem *)ioremap(0x55000000, 0x0fff); ++ avila_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO1; ++ ++ *IXP4XX_EXP_CS6 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[2].mapbase = 0x56000000; ++ avila_optional_uart_data[2].membase = (void __iomem *)ioremap(0x56000000, 0x0fff); ++ avila_optional_uart_data[2].irq = IRQ_IXP4XX_GPIO2; ++ ++ *IXP4XX_EXP_CS7 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[3].mapbase = 0x57000000; ++ avila_optional_uart_data[3].membase = (void __iomem *)ioremap(0x57000000, 0x0fff); ++ avila_optional_uart_data[3].irq = IRQ_IXP4XX_GPIO3; ++ ++ platform_device_register(&avila_optional_uart); ++ ++ avila_npeb_data.phy = 1; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 2; ++ platform_device_register(&avila_npec_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(3); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(3); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS2; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS3; ++ ++ platform_device_register(&avila_pata); ++ ++ avila_gpio_leds[0].gpio = 109; ++ avila_gpio_leds_data.num_leds = 5; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ setup_audio_devices(); ++} ++ ++static void __init avila_gw2369_setup(void) ++{ ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ avila_npeb_data.phy = 1; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 2; ++ platform_device_register(&avila_npec_device); ++ ++ setup_audio_devices(); ++} ++ ++static void __init avila_gw2370_setup(void) ++{ ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ avila_npeb_data.phy = 5; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ avila_npec_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ ++ platform_device_register(&avila_npec_device); ++ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[0].mapbase = 0x52000000; ++ avila_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52000000, 0x0fff); ++ avila_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO2; ++ ++ *IXP4XX_EXP_CS3 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[1].mapbase = 0x53000000; ++ avila_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53000000, 0x0fff); ++ avila_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO3; ++ ++ avila_optional_uart.num_resources = 2; ++ ++ platform_device_register(&avila_optional_uart); ++ ++ avila_gpio_leds[0].gpio = 101; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ setup_audio_devices(); ++} ++ ++static void __init avila_gw2375_setup(void) ++{ ++ avila_npeb_data.phy = 1; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 2; ++ platform_device_register(&avila_npec_device); ++ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[0].mapbase = 0x52000000; ++ avila_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52000000, 0x0fff); ++ avila_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO10; ++ ++ avila_optional_uart.num_resources = 1; ++ ++ platform_device_register(&avila_optional_uart); ++ ++ setup_audio_devices(); ++} ++ ++ ++static struct avila_board_info avila_boards[] __initdata = { ++ { ++ .model = "GW2342", ++ .setup = avila_gw2342_setup, ++ }, { ++ .model = "GW2345", ++ .setup = avila_gw2345_setup, ++ }, { ++ .model = "GW2347", ++ .setup = avila_gw2347_setup, ++ }, { ++ .model = "GW2348", ++ .setup = avila_gw2348_setup, ++ }, { ++ .model = "GW2353", ++ .setup = avila_gw2353_setup, ++ }, { ++ .model = "GW2355", ++ .setup = avila_gw2355_setup, ++ }, { ++ .model = "GW2357", ++ .setup = avila_gw2357_setup, ++ }, { ++ .model = "GW2365", ++ .setup = avila_gw2365_setup, ++ }, { ++ .model = "GW2369", ++ .setup = avila_gw2369_setup, ++ }, { ++ .model = "GW2370", ++ .setup = avila_gw2370_setup, ++ }, { ++ .model = "GW2373", ++ .setup = avila_gw2369_setup, ++ }, { ++ .model = "GW2375", ++ .setup = avila_gw2375_setup, ++ } ++}; ++ ++static struct avila_board_info * __init avila_find_board_info(char *model) ++{ ++ int i; ++ model[6] = '\0'; ++ ++ for (i = 0; i < ARRAY_SIZE(avila_boards); i++) { ++ struct avila_board_info *info = &avila_boards[i]; ++ if (strcmp(info->model, model) == 0) ++ return info; ++ } ++ ++ return NULL; ++} ++ ++static struct nvmem_device *at24_nvmem; ++ ++static void at24_setup(struct nvmem_device *mem_acc, void *context) ++{ ++ char mac_addr[ETH_ALEN]; ++ char model[7]; ++ ++ at24_nvmem = mem_acc; ++ ++ /* Read MAC addresses */ ++ if (nvmem_device_read(at24_nvmem, 0x0, 6, mac_addr) == 6) { ++ memcpy(&avila_npeb_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ if (nvmem_device_read(at24_nvmem, 0x6, 6, mac_addr) == 6) { ++ memcpy(&avila_npec_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ ++ /* Read the first 6 bytes of the model number */ ++ if (nvmem_device_read(at24_nvmem, 0x20, 6, model) == 6) { ++ avila_info = avila_find_board_info(model); ++ } ++ ++} ++ ++static struct at24_platform_data avila_eeprom_info = { ++ .byte_len = 1024, ++ .page_size = 16, ++// .flags = AT24_FLAG_READONLY, ++ .setup = at24_setup, ++}; ++ ++static struct pca953x_platform_data avila_pca_data = { ++ .gpio_base = 100, ++}; ++ ++static struct i2c_board_info __initdata avila_i2c_board_info[] = { ++ { ++ I2C_BOARD_INFO("ds1672", 0x68), ++ }, ++ { ++ I2C_BOARD_INFO("gsp", 0x29), ++ }, ++ { ++ I2C_BOARD_INFO("pca9555", 0x23), ++ .platform_data = &avila_pca_data, ++ }, ++ { ++ I2C_BOARD_INFO("ad7418", 0x28), ++ }, ++ { ++ I2C_BOARD_INFO("24c08", 0x51), ++ .platform_data = &avila_eeprom_info ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x1b), ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x1a), ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x19), ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x18), ++ }, ++}; ++ ++static void __init avila_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices)); ++ ++ i2c_register_board_info(0, avila_i2c_board_info, ++ ARRAY_SIZE(avila_i2c_board_info)); ++} ++ ++static int __init avila_model_setup(void) ++{ ++ if (!machine_is_avila()) ++ return 0; ++ ++ /* default 16MB flash */ ++ avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1; ++ ++ if (avila_info) { ++ printk(KERN_DEBUG "Running on Gateworks Avila %s\n", ++ avila_info->model); ++ avila_info->setup(); ++ } else { ++ printk(KERN_INFO "Unknown/missing Avila model number" ++ " -- defaults will be used\n"); ++ avila_gw23xx_setup(); ++ } ++ platform_device_register(&avila_flash); + ++ return 0; + } ++late_initcall(avila_model_setup); + + MACHINE_START(AVILA, "Gateworks Avila Network Platform") + /* Maintainer: Deepak Saxena */ diff --git a/target/linux/ixp4xx/patches-4.4/304-ixp4xx_eth_jumboframe.patch b/target/linux/ixp4xx/patches-4.9/304-ixp4xx_eth_jumboframe.patch similarity index 90% rename from target/linux/ixp4xx/patches-4.4/304-ixp4xx_eth_jumboframe.patch rename to target/linux/ixp4xx/patches-4.9/304-ixp4xx_eth_jumboframe.patch index b16086bbc..108fbcb37 100644 --- a/target/linux/ixp4xx/patches-4.4/304-ixp4xx_eth_jumboframe.patch +++ b/target/linux/ixp4xx/patches-4.9/304-ixp4xx_eth_jumboframe.patch @@ -9,7 +9,7 @@ #define RX_BUFF_SIZE ALIGN((NET_IP_ALIGN) + MAX_MRU, 4) #define NAPI_WEIGHT 16 -@@ -1315,6 +1315,32 @@ static void destroy_queues(struct port * +@@ -1289,6 +1289,32 @@ static void destroy_queues(struct port * } } @@ -42,7 +42,7 @@ static int eth_open(struct net_device *dev) { struct port *port = netdev_priv(dev); -@@ -1366,6 +1392,8 @@ static int eth_open(struct net_device *d +@@ -1340,6 +1366,8 @@ static int eth_open(struct net_device *d if (npe_send_recv_message(port->npe, &msg, "ETH_SET_FIREWALL_MODE")) return -EIO; @@ -51,7 +51,7 @@ if ((err = request_queues(port)) != 0) return err; -@@ -1505,7 +1533,26 @@ static int eth_close(struct net_device * +@@ -1479,7 +1507,26 @@ static int eth_close(struct net_device * return 0; } diff --git a/target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch b/target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch new file mode 100644 index 000000000..51f3f1451 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch @@ -0,0 +1,57 @@ +--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c ++++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c +@@ -27,6 +27,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -146,9 +148,37 @@ static struct platform_device gtwx5715_f + .resource = >wx5715_flash_resource, + }; + ++static struct spi_gpio_platform_data gtwx5715_spi_platform_data = { ++ .sck = GTWX5715_KSSPI_CLOCK, ++ .mosi = GTWX5715_KSSPI_TXD, ++ .miso = GTWX5715_KSSPI_RXD, ++ .num_chipselect = 1, ++}; ++ ++static struct platform_device gtwx5715_spi_device = { ++ .name = "spi_gpio", ++ .id = 1, ++ .dev = { ++ .platform_data = >wx5715_spi_platform_data, ++ } ++}; ++ ++static struct spi_board_info gtwx5715_spi_devices[] __initdata = { ++ { ++ .modalias = "spi-ks8995", ++ .max_speed_hz = 5000000, ++ .mode = SPI_MODE_0, ++ .bus_num = 1, ++ .chip_select = 0, ++ .controller_data = (void *)GTWX5715_KSSPI_SELECT, ++ } ++}; ++ ++ + static struct platform_device *gtwx5715_devices[] __initdata = { + >wx5715_uart_device, + >wx5715_flash, ++ >wx5715_spi_device, + }; + + static void __init gtwx5715_init(void) +@@ -158,6 +188,7 @@ static void __init gtwx5715_init(void) + gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); + gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; + ++ spi_register_board_info(gtwx5715_spi_devices, ARRAY_SIZE(gtwx5715_spi_devices)); + platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices)); + } + diff --git a/target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch new file mode 100644 index 000000000..85a8f162c --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch @@ -0,0 +1,50 @@ +--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c ++++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -174,11 +175,39 @@ static struct spi_board_info gtwx5715_sp + } + }; + ++static struct eth_plat_info gtwx5715_npeb_data = { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct eth_plat_info gtwx5715_npec_data = { ++ .phy = 5, /* port 5 of the KS8995 switch */ ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct platform_device gtwx5715_npeb_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = >wx5715_npeb_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct platform_device gtwx5715_npec_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = >wx5715_npec_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; + + static struct platform_device *gtwx5715_devices[] __initdata = { + >wx5715_uart_device, + >wx5715_flash, + >wx5715_spi_device, ++ >wx5715_npeb_device, ++ >wx5715_npec_device, + }; + + static void __init gtwx5715_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch b/target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch new file mode 100644 index 000000000..59c2837f0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch @@ -0,0 +1,137 @@ +--- a/drivers/ata/pata_ixp4xx_cf.c ++++ b/drivers/ata/pata_ixp4xx_cf.c +@@ -24,16 +24,58 @@ + #include + + #define DRV_NAME "pata_ixp4xx_cf" +-#define DRV_VERSION "0.2" ++#define DRV_VERSION "0.3" + + static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error) + { ++ struct ixp4xx_pata_data *data = link->ap->host->dev->platform_data; ++ unsigned int pio_mask; + struct ata_device *dev; + + ata_for_each_dev(dev, link, ENABLED) { +- ata_dev_info(dev, "configured for PIO0\n"); +- dev->pio_mode = XFER_PIO_0; +- dev->xfer_mode = XFER_PIO_0; ++ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)) { ++ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; ++ if (pio_mask & (1 << 1)) { ++ pio_mask = 4; ++ } else { ++ pio_mask = 3; ++ } ++ } else { ++ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); ++ } ++ ++ switch (pio_mask){ ++ case 0: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); ++ dev->pio_mode = XFER_PIO_0; ++ dev->xfer_mode = XFER_PIO_0; ++ *data->cs0_cfg = 0x8a473c03; ++ break; ++ case 1: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO1\n"); ++ dev->pio_mode = XFER_PIO_1; ++ dev->xfer_mode = XFER_PIO_1; ++ *data->cs0_cfg = 0x86433c03; ++ break; ++ case 2: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO2\n"); ++ dev->pio_mode = XFER_PIO_2; ++ dev->xfer_mode = XFER_PIO_2; ++ *data->cs0_cfg = 0x82413c03; ++ break; ++ case 3: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO3\n"); ++ dev->pio_mode = XFER_PIO_3; ++ dev->xfer_mode = XFER_PIO_3; ++ *data->cs0_cfg = 0x80823c03; ++ break; ++ case 4: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO4\n"); ++ dev->pio_mode = XFER_PIO_4; ++ dev->xfer_mode = XFER_PIO_4; ++ *data->cs0_cfg = 0x80403c03; ++ break; ++ } + dev->xfer_shift = ATA_SHIFT_PIO; + dev->flags |= ATA_DFLAG_PIO; + } +@@ -46,6 +88,7 @@ static unsigned int ixp4xx_mmio_data_xfe + unsigned int i; + unsigned int words = buflen >> 1; + u16 *buf16 = (u16 *) buf; ++ unsigned int pio_mask; + struct ata_port *ap = dev->link->ap; + void __iomem *mmio = ap->ioaddr.data_addr; + struct ixp4xx_pata_data *data = dev_get_platdata(ap->host->dev); +@@ -53,8 +96,34 @@ static unsigned int ixp4xx_mmio_data_xfe + /* set the expansion bus in 16bit mode and restore + * 8 bit mode after the transaction. + */ +- *data->cs0_cfg &= ~(0x01); +- udelay(100); ++ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)){ ++ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; ++ if (pio_mask & (1 << 1)){ ++ pio_mask = 4; ++ }else{ ++ pio_mask = 3; ++ } ++ }else{ ++ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); ++ } ++ switch (pio_mask){ ++ case 0: ++ *data->cs0_cfg = 0xa9643c42; ++ break; ++ case 1: ++ *data->cs0_cfg = 0x85033c42; ++ break; ++ case 2: ++ *data->cs0_cfg = 0x80b23c42; ++ break; ++ case 3: ++ *data->cs0_cfg = 0x80823c42; ++ break; ++ case 4: ++ *data->cs0_cfg = 0x80403c42; ++ break; ++ } ++ udelay(5); + + /* Transfer multiple of 2 bytes */ + if (rw == READ) +@@ -79,8 +148,24 @@ static unsigned int ixp4xx_mmio_data_xfe + words++; + } + +- udelay(100); +- *data->cs0_cfg |= 0x01; ++ udelay(5); ++ switch (pio_mask){ ++ case 0: ++ *data->cs0_cfg = 0x8a473c03; ++ break; ++ case 1: ++ *data->cs0_cfg = 0x86433c03; ++ break; ++ case 2: ++ *data->cs0_cfg = 0x82413c03; ++ break; ++ case 3: ++ *data->cs0_cfg = 0x80823c03; ++ break; ++ case 4: ++ *data->cs0_cfg = 0x80403c03; ++ break; ++ } + + return words << 1; + } diff --git a/target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch b/target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch new file mode 100644 index 000000000..fb7f03ee1 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch @@ -0,0 +1,347 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -93,6 +93,14 @@ config MACH_SIDEWINDER + Engineering Sidewinder board. For more information on this + platform, see http://www.adiengineering.com + ++config MACH_USR8200 ++ bool "USRobotics USR8200" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the USRobotics ++ USR8200 router board. For more information on this platform, see ++ http://openwrt.org ++ + config MACH_COMPEXWP18 + bool "Compex WP18 / NP18A" + select PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -27,6 +27,7 @@ obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o + obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o ++obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o + + obj-y += common.o + +@@ -55,6 +56,7 @@ obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o + obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o + obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o ++obj-$(CONFIG_MACH_USR8200) += usr8200-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -44,7 +44,8 @@ static __inline__ void __arch_decomp_set + machine_is_gateway7001() || machine_is_wg302v2() || + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || +- machine_is_wrt300nv2() || machine_is_tw5334()) ++ machine_is_wrt300nv2() || machine_is_tw5334() || ++ machine_is_usr8200()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/usr8200-pci.c +@@ -0,0 +1,77 @@ ++/* ++ * arch/arch/mach-ixp4xx/usr8200-pci.c ++ * ++ * PCI setup routines for USRobotics USR8200 ++ * ++ * Copyright (C) 2008 Peter Denison ++ * ++ * based on pronghorn-pci.c ++ * Copyright (C) 2008 Imre Kaloz ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Peter Denison ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init usr8200_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init usr8200_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 14) ++ return IRQ_IXP4XX_GPIO7; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO8; ++ else if (slot == 16) { ++ if (pin == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (pin == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else if (pin == 3) ++ return IRQ_IXP4XX_GPIO9; ++ else ++ return -1; ++ } else ++ return -1; ++} ++ ++struct hw_pci usr8200_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = usr8200_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = usr8200_map_irq, ++}; ++ ++int __init usr8200_pci_init(void) ++{ ++ if (machine_is_usr8200()) ++ pci_common_init(&usr8200_pci); ++ return 0; ++} ++ ++subsys_initcall(usr8200_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/usr8200-setup.c +@@ -0,0 +1,217 @@ ++/* ++ * arch/arm/mach-ixp4xx/usr8200-setup.c ++ * ++ * Board setup for the USRobotics USR8200 ++ * ++ * Copyright (C) 2008 Peter Denison ++ * ++ * based on pronghorn-setup.c: ++ * Copyright (C) 2008 Imre Kaloz ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Peter Denison ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data usr8200_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource usr8200_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device usr8200_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &usr8200_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &usr8200_flash_resource, ++}; ++ ++static struct resource usr8200_uart_resources [] = { ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port usr8200_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device usr8200_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = usr8200_uart_data, ++ }, ++ .num_resources = 2, ++ .resource = usr8200_uart_resources, ++}; ++ ++static struct gpio_led usr8200_led_pin[] = { ++ { ++ .name = "usr8200:usb1", ++ .gpio = 0, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:usb2", ++ .gpio = 1, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:ieee1394", ++ .gpio = 2, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:internal", ++ .gpio = 3, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:power", ++ .gpio = 14, ++ } ++}; ++ ++static struct gpio_led_platform_data usr8200_led_data = { ++ .num_leds = ARRAY_SIZE(usr8200_led_pin), ++ .leds = usr8200_led_pin, ++}; ++ ++static struct platform_device usr8200_led = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &usr8200_led_data, ++}; ++ ++static struct eth_plat_info usr8200_plat_eth[] = { ++ { /* NPEC - LAN with Marvell 88E6060 switch */ ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x0F0000, ++ .rxq = 4, ++ .txreadyq = 21, ++ }, { /* NPEB - WAN */ ++ .phy = 9, ++ .rxq = 3, ++ .txreadyq = 20, ++ } ++}; ++ ++static struct platform_device usr8200_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = usr8200_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = usr8200_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct resource usr8200_rtc_resources = { ++ .flags = IORESOURCE_MEM ++}; ++ ++static struct platform_device usr8200_rtc = { ++ .name = "rtc7301", ++ .id = 0, ++ .num_resources = 1, ++ .resource = &usr8200_rtc_resources, ++}; ++ ++static struct platform_device *usr8200_devices[] __initdata = { ++ &usr8200_flash, ++ &usr8200_uart, ++ &usr8200_led, ++ &usr8200_eth[0], ++ &usr8200_eth[1], ++ &usr8200_rtc, ++}; ++ ++static void __init usr8200_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ usr8200_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ usr8200_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1; ++ ++ usr8200_rtc_resources.start = IXP4XX_EXP_BUS_BASE(2); ++ usr8200_rtc_resources.end = IXP4XX_EXP_BUS_BASE(2) + 0x01ff; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS2 = 0x3fff000 | IXP4XX_EXP_BUS_SIZE(0) | IXP4XX_EXP_BUS_WR_EN | ++ IXP4XX_EXP_BUS_CS_EN | IXP4XX_EXP_BUS_BYTE_EN; ++ *IXP4XX_GPIO_GPCLKR = 0x01100000; ++ ++ /* configure button as input */ ++ gpio_line_config(12, IXP4XX_GPIO_IN); ++ ++ platform_add_devices(usr8200_devices, ARRAY_SIZE(usr8200_devices)); ++} ++ ++MACHINE_START(USR8200, "USRobotics USR8200") ++ /* Maintainer: Peter Denison */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = usr8200_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch b/target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch new file mode 100644 index 000000000..39a261b8e --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch @@ -0,0 +1,316 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -176,6 +176,15 @@ config ARCH_PRPMC1100 + PrPCM1100 Processor Mezanine Module. For more information on + this platform, see . + ++config MACH_TW2662 ++ bool "Titan Wireless TW-266-2" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the Titan ++ Wireless TW266-2. For more information on this platform, ++ see http://openwrt.org ++ ++ + config MACH_TW5334 + bool "Titan Wireless TW-533-4" + select PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -25,6 +25,7 @@ obj-pci-$(CONFIG_MACH_SIDEWINDER) += sid + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o ++obj-pci-$(CONFIG_MACH_TW2662) += tw2662-pci.o + obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o + obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o + obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o +@@ -54,6 +55,7 @@ obj-$(CONFIG_MACH_SIDEWINDER) += sidewin + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o ++obj-$(CONFIG_MACH_TW2662) += tw2662-setup.o + obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o + obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o + obj-$(CONFIG_MACH_USR8200) += usr8200-setup.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -45,7 +45,7 @@ static __inline__ void __arch_decomp_set + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || + machine_is_wrt300nv2() || machine_is_tw5334() || +- machine_is_usr8200()) ++ machine_is_usr8200() || machine_is_tw2662()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw2662-pci.c +@@ -0,0 +1,67 @@ ++/* ++ * arch/arm/mach-ixp4xx/tw2662-pci.c ++ * ++ * PCI setup routines for Tiran Wireless TW-266-2 platform ++ * ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * Copyright (C) 2010 Alexandros C. Couloumbis ++ * Copyright (C) 2010 Gabor Juhos ++ * ++ * Maintainer: Deepak Saxena ++ * Maintainer: Alexandros C. Couloumbis ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define SLOT0_DEVID 1 ++#define SLOT1_DEVID 3 ++ ++/* PCI controller GPIO to IRQ pin mappings */ ++#define SLOT0_INTA 11 ++#define SLOT1_INTA 9 ++ ++void __init tw2662_pci_preinit(void) ++{ ++ irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTA), IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTA), IRQ_TYPE_LEVEL_LOW); ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init tw2662_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == SLOT0_DEVID) ++ return IXP4XX_GPIO_IRQ(SLOT0_INTA); ++ else if (slot == SLOT1_DEVID) ++ return IXP4XX_GPIO_IRQ(SLOT1_INTA); ++ else return -1; ++} ++ ++struct hw_pci tw2662_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = tw2662_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = tw2662_map_irq, ++}; ++ ++int __init tw2662_pci_init(void) ++{ ++ if (machine_is_tw2662()) ++ pci_common_init(&tw2662_pci); ++ return 0; ++} ++ ++subsys_initcall(tw2662_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw2662-setup.c +@@ -0,0 +1,196 @@ ++/* ++ * arch/arm/mach-ixp4xx/tw2662-setup.c ++ * ++ * Titan Wireless TW-266-2 ++ * ++ * Copyright (C) 2010 Gabor Juhos ++ * Copyright (C) 2010 Alexandros C. Couloumbis ++ * ++ * based on ap1000-setup.c: ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* gpio mask used by platform device */ ++#define TW2662_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) ++ ++static struct flash_platform_data tw2662_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource tw2662_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device tw2662_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &tw2662_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &tw2662_flash_resource, ++}; ++ ++static struct resource tw2662_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port tw2662_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device tw2662_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = tw2662_uart_data, ++ .num_resources = 2, ++ .resource = tw2662_uart_resources ++}; ++ ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info tw2662_plat_eth[] = { ++ { ++ .phy = 3, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device tw2662_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = tw2662_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = tw2662_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++ ++static struct platform_device *tw2662_devices[] __initdata = { ++ &tw2662_flash, ++ &tw2662_uart, ++ &tw2662_eth[0], ++ &tw2662_eth[1], ++}; ++ ++static char tw2662_mem_fixup[] __initdata = "mem=64M "; ++ ++static void __init tw2662_fixup(struct tag *tags, char **cmdline) ++{ ++ struct tag *t = tags; ++ char *p = *cmdline; ++ ++ /* Find the end of the tags table, taking note of any cmdline tag. */ ++ for (; t->hdr.size; t = tag_next(t)) { ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ } ++ } ++ ++ /* Overwrite the end of the table with a new cmdline tag. */ ++ t->hdr.tag = ATAG_CMDLINE; ++ t->hdr.size = (sizeof (struct tag_header) + ++ strlen(tw2662_mem_fixup) + strlen(p) + 1 + 4) >> 2; ++ strlcpy(t->u.cmdline.cmdline, tw2662_mem_fixup, COMMAND_LINE_SIZE); ++ strlcpy(t->u.cmdline.cmdline + strlen(tw2662_mem_fixup), p, ++ COMMAND_LINE_SIZE - strlen(tw2662_mem_fixup)); ++ ++ /* Terminate the table. */ ++ t = tag_next(t); ++ t->hdr.tag = ATAG_NONE; ++ t->hdr.size = 0; ++} ++ ++static void __init tw2662_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ tw2662_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ tw2662_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ ++ platform_add_devices(tw2662_devices, ARRAY_SIZE(tw2662_devices)); ++ ++ if (!(is_valid_ether_addr(tw2662_plat_eth[0].hwaddr))) ++ random_ether_addr(tw2662_plat_eth[0].hwaddr); ++ if (!(is_valid_ether_addr(tw2662_plat_eth[1].hwaddr))) { ++ memcpy(tw2662_plat_eth[1].hwaddr, tw2662_plat_eth[0].hwaddr, ETH_ALEN); ++ tw2662_plat_eth[1].hwaddr[5] = (tw2662_plat_eth[0].hwaddr[5] + 1); ++ } ++ ++} ++ ++#ifdef CONFIG_MACH_TW2662 ++MACHINE_START(TW2662, "Titan Wireless TW-266-2") ++ /* Maintainer: Alexandros C. Couloumbis */ ++ .fixup = tw2662_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = tw2662_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch b/target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch new file mode 100644 index 000000000..1afbe3d61 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch @@ -0,0 +1,282 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -4,6 +4,14 @@ menu "Intel IXP4xx Implementation Option + + comment "IXP4xx Platforms" + ++config MACH_AP42X ++ bool "Tonze AP-422/425" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Tonze's ++ AP-422/425 boards. For more information on this platform, ++ see http://tonze.com.tw ++ + config MACH_NSLU2 + bool + prompt "Linksys NSLU2" +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -5,6 +5,7 @@ + obj-pci-y := + obj-pci-n := + ++obj-pci-$(CONFIG_MACH_AP42X) += ap42x-pci.o + obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o + obj-pci-$(CONFIG_MACH_CAMBRIA) += cambria-pci.o +@@ -32,6 +33,7 @@ obj-pci-$(CONFIG_MACH_USR8200) += usr82 + + obj-y += common.o + ++obj-$(CONFIG_MACH_AP42X) += ap42x-setup.o + obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o + obj-$(CONFIG_MACH_AVILA) += avila-setup.o + obj-$(CONFIG_MACH_CAMBRIA) += cambria-setup.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/ap42x-pci.c +@@ -0,0 +1,63 @@ ++/* ++ * arch/arch/mach-ixp4xx/ap42x-pci.c ++ * ++ * PCI setup routines for Tonze AP-422/425 ++ * ++ * Copyright (C) 2012 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init ap42x_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init ap42x_map_irq(const struct pci_dev *dev, u8 slot, ++ u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else return -1; ++} ++ ++struct hw_pci ap42x_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = ap42x_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = ap42x_map_irq, ++}; ++ ++int __init ap42x_pci_init(void) ++{ ++ if (machine_is_ap42x()) ++ pci_common_init(&ap42x_pci); ++ return 0; ++} ++ ++subsys_initcall(ap42x_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/ap42x-setup.c +@@ -0,0 +1,166 @@ ++/* ++ * arch/arm/mach-ixp4xx/ap42x-setup.c ++ * ++ * Board setup for the Tonze AP-42x boards ++ * ++ * Copyright (C) 2012 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct mtd_partition ap42x_flash_partitions[] = { ++ { ++ .name = "RedBoot", ++ .offset = 0x00000000, ++ .size = 0x00080000, ++ }, { ++ .name = "linux", ++ .offset = 0x00080000, ++ .size = 0x00100000, ++ }, { ++ .name = "rootfs", ++ .offset = 0x00180000, ++ .size = 0x00660000, ++ }, { ++ .name = "FIS directory", ++ .offset = 0x007f8000, ++ .size = 0x00007000, ++ }, { ++ .name = "RedBoot config", ++ .offset = 0x007ff000, ++ .size = 0x00001000, ++ }, ++}; ++ ++static struct physmap_flash_data ap42x_flash_data = { ++ .width = 2, ++ .parts = ap42x_flash_partitions, ++ .nr_parts = ARRAY_SIZE(ap42x_flash_partitions), ++}; ++ ++static struct resource ap42x_flash_resource = { ++ .flags = IORESOURCE_MEM, ++ .start = IXP4XX_EXP_BUS_BASE_PHYS, ++ .end = IXP4XX_EXP_BUS_BASE_PHYS + SZ_8M - 1, ++}; ++ ++static struct platform_device ap42x_flash = { ++ .name = "physmap-flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &ap42x_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &ap42x_flash_resource, ++}; ++ ++static struct resource ap42x_uart_resource = { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port ap42x_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device ap42x_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = ap42x_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &ap42x_uart_resource, ++}; ++ ++static struct eth_plat_info ap42x_plat_eth[] = { ++ { ++ .phy = 2, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device ap42x_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = ap42x_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = ap42x_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *ap42x_devices[] __initdata = { ++ &ap42x_flash, ++ &ap42x_uart, ++ &ap42x_eth[0], ++ &ap42x_eth[1], ++}; ++ ++static void __init ap42x_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ ap42x_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ ap42x_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(ap42x_devices, ARRAY_SIZE(ap42x_devices)); ++} ++ ++#ifdef CONFIG_MACH_AP42X ++MACHINE_START(AP42X, "Tonze AP-422/425") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x100, ++ .init_machine = ap42x_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -45,7 +45,8 @@ static __inline__ void __arch_decomp_set + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || + machine_is_wrt300nv2() || machine_is_tw5334() || +- machine_is_usr8200() || machine_is_tw2662()) ++ machine_is_usr8200() || machine_is_tw2662() || ++ machine_is_ap42x()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch b/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch new file mode 100644 index 000000000..3f3621b0d --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch @@ -0,0 +1,23 @@ +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -215,6 +215,9 @@ struct sk_buff *__alloc_skb(unsigned int + + if (sk_memalloc_socks() && (flags & SKB_ALLOC_RX)) + gfp_mask |= __GFP_MEMALLOC; ++#ifdef CONFIG_ARCH_IXP4XX ++ gfp_mask |= GFP_DMA; ++#endif + + /* Get the HEAD */ + skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node); +@@ -1222,6 +1225,10 @@ int pskb_expand_head(struct sk_buff *skb + if (skb_shared(skb)) + BUG(); + ++#ifdef CONFIG_ARCH_IXP4XX ++ gfp_mask |= GFP_DMA; ++#endif ++ + size = SKB_DATA_ALIGN(size); + + if (skb_pfmemalloc(skb)) diff --git a/target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch b/target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch new file mode 100644 index 000000000..24c93dc74 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch @@ -0,0 +1,10 @@ +--- a/drivers/crypto/ixp4xx_crypto.c ++++ b/drivers/crypto/ixp4xx_crypto.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch b/target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch new file mode 100644 index 000000000..06e09f469 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch @@ -0,0 +1,22 @@ +--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c +@@ -53,7 +53,7 @@ static int __init ixdp425_map_irq(const + }; + + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) +- return pci_irq_table[(slot + pin - 2) % 4]; ++ return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; + + return -1; + } +--- a/arch/arm/mach-ixp4xx/miccpt-pci.c ++++ b/arch/arm/mach-ixp4xx/miccpt-pci.c +@@ -54,7 +54,7 @@ static int __init miccpt_map_irq(const s + }; + + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) +- return pci_irq_table[(slot + pin - 2) % 4]; ++ return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; + + return -1; + } diff --git a/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch b/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch index 64597cec8..da48ae3a1 100644 --- a/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch +++ b/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch @@ -65,7 +65,7 @@ Signed-off-by: Mark Brown +}; --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -404,6 +404,14 @@ config SPI_NUC900 +@@ -403,6 +403,14 @@ config SPI_NUC900 help SPI driver for Nuvoton NUC900 series ARM SoCs diff --git a/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch b/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch index 101902b93..7b14d9e5a 100644 --- a/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch @@ -1,6 +1,6 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2311,6 +2311,12 @@ config MIPS_VPE_LOADER +@@ -2320,6 +2320,12 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. diff --git a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch index f6a7bca7c..8ce3b56e3 100644 --- a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch @@ -24281,15 +24281,7 @@ Signed-off-by: Yangbo Lu #endif /* CAAM_ERROR_H */ --- a/drivers/crypto/caam/intern.h +++ b/drivers/crypto/caam/intern.h -@@ -41,6 +41,7 @@ struct caam_drv_private_jr { - struct device *dev; - int ridx; - struct caam_job_ring __iomem *rregs; /* JobR's register space */ -+ struct tasklet_struct irqtask; - int irq; /* One per queue */ - - /* Number of scatterlist crypt transforms active on the JobR */ -@@ -63,10 +64,9 @@ struct caam_drv_private_jr { +@@ -64,10 +64,9 @@ struct caam_drv_private_jr { * Driver-private storage for a single CAAM block instance */ struct caam_drv_private { @@ -24303,7 +24295,7 @@ Signed-off-by: Yangbo Lu /* Physical-presence section */ struct caam_ctrl __iomem *ctrl; /* controller region */ -@@ -102,11 +102,6 @@ struct caam_drv_private { +@@ -103,11 +102,6 @@ struct caam_drv_private { #ifdef CONFIG_DEBUG_FS struct dentry *dfs_root; struct dentry *ctl; /* controller dir */ @@ -24315,7 +24307,7 @@ Signed-off-by: Yangbo Lu struct debugfs_blob_wrapper ctl_kek_wrap, ctl_tkek_wrap, ctl_tdsk_wrap; struct dentry *ctl_kek, *ctl_tkek, *ctl_tdsk; #endif -@@ -114,4 +109,22 @@ struct caam_drv_private { +@@ -115,4 +109,22 @@ struct caam_drv_private { void caam_jr_algapi_init(struct device *dev); void caam_jr_algapi_remove(struct device *dev); @@ -24363,16 +24355,7 @@ Signed-off-by: Yangbo Lu static int caam_reset_hw_jr(struct device *dev) { struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); -@@ -73,6 +82,8 @@ static int caam_jr_shutdown(struct devic - - ret = caam_reset_hw_jr(dev); - -+ tasklet_kill(&jrp->irqtask); -+ - /* Release interrupt */ - free_irq(jrp->irq, dev); - -@@ -116,6 +127,8 @@ static int caam_jr_remove(struct platfor +@@ -118,6 +127,8 @@ static int caam_jr_remove(struct platfor dev_err(jrdev, "Failed to shut down job ring\n"); irq_dispose_mapping(jrpriv->irq); @@ -24381,47 +24364,7 @@ Signed-off-by: Yangbo Lu return ret; } -@@ -128,7 +141,7 @@ static irqreturn_t caam_jr_interrupt(int - - /* - * Check the output ring for ready responses, kick -- * the threaded irq if jobs done. -+ * tasklet if jobs done. - */ - irqstate = rd_reg32(&jrp->rregs->jrintstatus); - if (!irqstate) -@@ -150,13 +163,18 @@ static irqreturn_t caam_jr_interrupt(int - /* Have valid interrupt at this point, just ACK and trigger */ - wr_reg32(&jrp->rregs->jrintstatus, irqstate); - -- return IRQ_WAKE_THREAD; -+ preempt_disable(); -+ tasklet_schedule(&jrp->irqtask); -+ preempt_enable(); -+ -+ return IRQ_HANDLED; - } - --static irqreturn_t caam_jr_threadirq(int irq, void *st_dev) -+/* Deferred service handler, run as interrupt-fired tasklet */ -+static void caam_jr_dequeue(unsigned long devarg) - { - int hw_idx, sw_idx, i, head, tail; -- struct device *dev = st_dev; -+ struct device *dev = (struct device *)devarg; - struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); - void (*usercall)(struct device *dev, u32 *desc, u32 status, void *arg); - u32 *userdesc, userstatus; -@@ -230,8 +248,6 @@ static irqreturn_t caam_jr_threadirq(int - - /* reenable / unmask IRQs */ - clrsetbits_32(&jrp->rregs->rconfig_lo, JRCFG_IMSK, 0); -- -- return IRQ_HANDLED; - } - - /** -@@ -275,6 +291,36 @@ struct device *caam_jr_alloc(void) +@@ -280,6 +291,36 @@ struct device *caam_jr_alloc(void) EXPORT_SYMBOL(caam_jr_alloc); /** @@ -24458,30 +24401,7 @@ Signed-off-by: Yangbo Lu * caam_jr_free() - Free the Job Ring * @rdev - points to the dev that identifies the Job ring to * be released. -@@ -389,10 +435,11 @@ static int caam_jr_init(struct device *d - - jrp = dev_get_drvdata(dev); - -+ tasklet_init(&jrp->irqtask, caam_jr_dequeue, (unsigned long)dev); -+ - /* Connect job ring interrupt handler. */ -- error = request_threaded_irq(jrp->irq, caam_jr_interrupt, -- caam_jr_threadirq, IRQF_SHARED, -- dev_name(dev), dev); -+ error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED, -+ dev_name(dev), dev); - if (error) { - dev_err(dev, "can't connect JobR %d interrupt (%d)\n", - jrp->ridx, jrp->irq); -@@ -454,6 +501,7 @@ out_free_inpring: - out_free_irq: - free_irq(jrp->irq, dev); - out_kill_deq: -+ tasklet_kill(&jrp->irqtask); - return error; - } - -@@ -489,15 +537,28 @@ static int caam_jr_probe(struct platform +@@ -496,15 +537,28 @@ static int caam_jr_probe(struct platform return -ENOMEM; } @@ -24517,7 +24437,7 @@ Signed-off-by: Yangbo Lu /* Identify the interrupt */ jrpriv->irq = irq_of_parse_and_map(nprop, 0); -@@ -517,10 +578,12 @@ static int caam_jr_probe(struct platform +@@ -524,10 +578,12 @@ static int caam_jr_probe(struct platform atomic_set(&jrpriv->tfm_count, 0); diff --git a/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch index 6c81b0044..cd99f9492 100644 --- a/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch @@ -27,10 +27,10 @@ Signed-off-by: Yangbo Lu + disable_irq(fsl_dev->irq); + - clk_disable_unprepare(fsl_dev->pix_clk); clk_disable_unprepare(fsl_dev->clk); -@@ -263,6 +264,14 @@ static int fsl_dcu_drm_pm_resume(struct + return 0; +@@ -262,6 +263,12 @@ static int fsl_dcu_drm_pm_resume(struct return ret; } @@ -39,21 +39,11 @@ Signed-off-by: Yangbo Lu + dev_err(dev, "failed to enable dcu pix clk\n"); + return ret; + } -+ -+ enable_irq(fsl_dev->irq); + if (fsl_dev->tcon) fsl_tcon_bypass_enable(fsl_dev->tcon); fsl_dcu_drm_init_planes(fsl_dev->drm); -@@ -273,7 +282,6 @@ static int fsl_dcu_drm_pm_resume(struct - console_unlock(); - - drm_kms_helper_poll_enable(fsl_dev->drm); -- enable_irq(fsl_dev->irq); - - return 0; - } -@@ -389,6 +397,12 @@ static int fsl_dcu_drm_probe(struct plat +@@ -388,6 +395,12 @@ static int fsl_dcu_drm_probe(struct plat goto disable_clk; } diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index 657a38fec..7773e70e9 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -995,7 +995,7 @@ Signed-off-by: Yangbo Lu }; struct dmar_atsr_unit { -@@ -4250,27 +4251,40 @@ static inline void init_iommu_pm_ops(voi +@@ -4252,27 +4253,40 @@ static inline void init_iommu_pm_ops(voi int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) { struct acpi_dmar_reserved_memory *rmrr; @@ -1041,7 +1041,7 @@ Signed-off-by: Yangbo Lu } static struct dmar_atsr_unit *dmar_find_atsr(struct acpi_dmar_atsr *atsr) -@@ -4484,6 +4498,7 @@ static void intel_iommu_free_dmars(void) +@@ -4486,6 +4500,7 @@ static void intel_iommu_free_dmars(void) list_for_each_entry_safe(rmrru, rmrr_n, &dmar_rmrr_units, list) { list_del(&rmrru->list); dmar_free_dev_scope(&rmrru->devices, &rmrru->devices_cnt); @@ -1049,7 +1049,7 @@ Signed-off-by: Yangbo Lu kfree(rmrru); } -@@ -5219,6 +5234,45 @@ static void intel_iommu_remove_device(st +@@ -5221,6 +5236,45 @@ static void intel_iommu_remove_device(st iommu_device_unlink(iommu->iommu_dev, dev); } @@ -1095,7 +1095,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_INTEL_IOMMU_SVM #define MAX_NR_PASID_BITS (20) static inline unsigned long intel_iommu_get_pts(struct intel_iommu *iommu) -@@ -5349,19 +5403,21 @@ struct intel_iommu *intel_svm_device_to_ +@@ -5351,19 +5405,21 @@ struct intel_iommu *intel_svm_device_to_ #endif /* CONFIG_INTEL_IOMMU_SVM */ static const struct iommu_ops intel_iommu_ops = { diff --git a/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch b/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch index 48fda9b02..9f4b04447 100644 --- a/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch +++ b/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch @@ -2512,10 +2512,10 @@ Signed-off-by: John Crispin { - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); + int chipnr = (int)(to >> chip->chip_shift); struct mtd_oob_ops ops; int ret; - -@@ -2722,15 +2757,12 @@ static int nand_do_write_oob(struct mtd_ +@@ -2725,15 +2760,12 @@ static int nand_do_write_oob(struct mtd_ struct mtd_oob_ops *ops) { int chipnr, page, status, len; @@ -2533,7 +2533,7 @@ Signed-off-by: John Crispin /* Do not allow write past end of page */ if ((ops->ooboffs + ops->ooblen) > len) { -@@ -2847,7 +2879,7 @@ out: +@@ -2850,7 +2882,7 @@ out: */ static int single_erase(struct mtd_info *mtd, int page) { @@ -2542,7 +2542,7 @@ Signed-off-by: John Crispin /* Send commands to erase a block */ chip->cmdfunc(mtd, NAND_CMD_ERASE1, -1, page); chip->cmdfunc(mtd, NAND_CMD_ERASE2, -1, -1); -@@ -2879,7 +2911,7 @@ int nand_erase_nand(struct mtd_info *mtd +@@ -2882,7 +2914,7 @@ int nand_erase_nand(struct mtd_info *mtd int allowbbt) { int page, status, pages_per_block, ret, chipnr; @@ -2551,7 +2551,7 @@ Signed-off-by: John Crispin loff_t len; pr_debug("%s: start = 0x%012llx, len = %llu\n", -@@ -2918,7 +2950,7 @@ int nand_erase_nand(struct mtd_info *mtd +@@ -2921,7 +2953,7 @@ int nand_erase_nand(struct mtd_info *mtd while (len) { /* Check if we have a bad block, we do not erase bad blocks! */ if (nand_block_checkbad(mtd, ((loff_t) page) << @@ -2560,7 +2560,7 @@ Signed-off-by: John Crispin pr_warn("%s: attempt to erase a bad block at page 0x%08x\n", __func__, page); instr->state = MTD_ERASE_FAILED; -@@ -3005,7 +3037,20 @@ static void nand_sync(struct mtd_info *m +@@ -3008,7 +3040,20 @@ static void nand_sync(struct mtd_info *m */ static int nand_block_isbad(struct mtd_info *mtd, loff_t offs) { @@ -2582,7 +2582,7 @@ Signed-off-by: John Crispin } /** -@@ -3094,7 +3139,7 @@ static int nand_suspend(struct mtd_info +@@ -3097,7 +3142,7 @@ static int nand_suspend(struct mtd_info */ static void nand_resume(struct mtd_info *mtd) { @@ -2591,7 +2591,7 @@ Signed-off-by: John Crispin if (chip->state == FL_PM_SUSPENDED) nand_release_device(mtd); -@@ -3266,7 +3311,7 @@ ext_out: +@@ -3269,7 +3314,7 @@ ext_out: static int nand_setup_read_retry_micron(struct mtd_info *mtd, int retry_mode) { @@ -2600,7 +2600,7 @@ Signed-off-by: John Crispin uint8_t feature[ONFI_SUBFEATURE_PARAM_LEN] = {retry_mode}; return chip->onfi_set_features(mtd, chip, ONFI_FEATURE_ADDR_READ_RETRY, -@@ -3937,10 +3982,13 @@ ident_done: +@@ -3940,10 +3985,13 @@ ident_done: return type; } @@ -2617,7 +2617,7 @@ Signed-off-by: John Crispin if (of_get_nand_bus_width(dn) == 16) chip->options |= NAND_BUSWIDTH_16; -@@ -3949,6 +3997,7 @@ static int nand_dt_init(struct mtd_info +@@ -3952,6 +4000,7 @@ static int nand_dt_init(struct mtd_info chip->bbt_options |= NAND_BBT_USE_FLASH; ecc_mode = of_get_nand_ecc_mode(dn); @@ -2625,7 +2625,7 @@ Signed-off-by: John Crispin ecc_strength = of_get_nand_ecc_strength(dn); ecc_step = of_get_nand_ecc_step_size(dn); -@@ -3961,6 +4010,9 @@ static int nand_dt_init(struct mtd_info +@@ -3964,6 +4013,9 @@ static int nand_dt_init(struct mtd_info if (ecc_mode >= 0) chip->ecc.mode = ecc_mode; @@ -2635,7 +2635,7 @@ Signed-off-by: John Crispin if (ecc_strength >= 0) chip->ecc.strength = ecc_strength; -@@ -3984,15 +4036,16 @@ int nand_scan_ident(struct mtd_info *mtd +@@ -3987,15 +4039,16 @@ int nand_scan_ident(struct mtd_info *mtd struct nand_flash_dev *table) { int i, nand_maf_id, nand_dev_id; @@ -2658,7 +2658,7 @@ Signed-off-by: John Crispin if (!mtd->name && mtd->dev.parent) mtd->name = dev_name(mtd->dev.parent); -@@ -4055,7 +4108,7 @@ EXPORT_SYMBOL(nand_scan_ident); +@@ -4058,7 +4111,7 @@ EXPORT_SYMBOL(nand_scan_ident); */ static bool nand_ecc_strength_good(struct mtd_info *mtd) { @@ -2667,7 +2667,7 @@ Signed-off-by: John Crispin struct nand_ecc_ctrl *ecc = &chip->ecc; int corr, ds_corr; -@@ -4083,10 +4136,10 @@ static bool nand_ecc_strength_good(struc +@@ -4086,10 +4139,10 @@ static bool nand_ecc_strength_good(struc */ int nand_scan_tail(struct mtd_info *mtd) { @@ -2680,7 +2680,7 @@ Signed-off-by: John Crispin /* New bad blocks should be marked in OOB, flash-based BBT, or both */ BUG_ON((chip->bbt_options & NAND_BBT_NO_OOB_BBM) && -@@ -4113,19 +4166,15 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4116,19 +4169,15 @@ int nand_scan_tail(struct mtd_info *mtd) /* * If no default placement scheme is given, select an appropriate one. */ @@ -2703,7 +2703,7 @@ Signed-off-by: John Crispin break; default: pr_warn("No oob scheme defined for oobsize %d\n", -@@ -4168,7 +4217,7 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4171,7 +4220,7 @@ int nand_scan_tail(struct mtd_info *mtd) ecc->write_oob = nand_write_oob_std; if (!ecc->read_subpage) ecc->read_subpage = nand_read_subpage; @@ -2712,7 +2712,7 @@ Signed-off-by: John Crispin ecc->write_subpage = nand_write_subpage_hwecc; case NAND_ECC_HW_SYNDROME: -@@ -4246,10 +4295,8 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4249,10 +4298,8 @@ int nand_scan_tail(struct mtd_info *mtd) } /* See nand_bch_init() for details. */ @@ -2725,7 +2725,7 @@ Signed-off-by: John Crispin if (!ecc->priv) { pr_warn("BCH ECC initialization failed!\n"); BUG(); -@@ -4280,20 +4327,9 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4283,20 +4330,9 @@ int nand_scan_tail(struct mtd_info *mtd) if (!ecc->write_oob_raw) ecc->write_oob_raw = ecc->write_oob; @@ -2749,7 +2749,7 @@ Signed-off-by: John Crispin /* * Set the number of read / write steps for one page depending on ECC -@@ -4306,6 +4342,21 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4309,6 +4345,21 @@ int nand_scan_tail(struct mtd_info *mtd) } ecc->total = ecc->steps * ecc->bytes; @@ -2771,7 +2771,7 @@ Signed-off-by: John Crispin /* Allow subpage writes up to ecc.steps. Not possible for MLC flash */ if (!(chip->options & NAND_NO_SUBPAGE_WRITE) && nand_is_slc(chip)) { switch (ecc->steps) { -@@ -4362,10 +4413,6 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4365,10 +4416,6 @@ int nand_scan_tail(struct mtd_info *mtd) mtd->_block_markbad = nand_block_markbad; mtd->writebufsize = mtd->writesize; @@ -2782,7 +2782,7 @@ Signed-off-by: John Crispin /* * Initialize bitflip_threshold to its default prior scan_bbt() call. * scan_bbt() might invoke mtd_read(), thus bitflip_threshold must be -@@ -4421,7 +4468,7 @@ EXPORT_SYMBOL(nand_scan); +@@ -4424,7 +4471,7 @@ EXPORT_SYMBOL(nand_scan); */ void nand_release(struct mtd_info *mtd) { diff --git a/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch b/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch index 4b3260c41..aefcfd98a 100644 --- a/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch +++ b/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch @@ -87,7 +87,7 @@ Signed-off-by: Boris Brezillon } --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -3202,8 +3202,7 @@ static void nand_set_defaults(struct nan +@@ -3205,8 +3205,7 @@ static void nand_set_defaults(struct nan if (!chip->controller) { chip->controller = &chip->hwcontrol; diff --git a/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch b/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch index 479bfddc5..76a19267a 100644 --- a/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch +++ b/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch @@ -1,6 +1,6 @@ --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig -@@ -227,6 +227,15 @@ config PINCTRL_COH901 +@@ -228,6 +228,15 @@ config PINCTRL_COH901 COH 901 335 and COH 901 571/3. They contain 3, 5 or 7 ports of 8 GPIO pins each. diff --git a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch index 2225454d1..099a04e54 100644 --- a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch +++ b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -617,6 +617,8 @@ config RALINK +@@ -619,6 +619,8 @@ config RALINK select CLKDEV_LOOKUP select ARCH_HAS_RESET_CONTROLLER select RESET_CONTROLLER diff --git a/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch b/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch index ca3dc8464..3b84aefd0 100644 --- a/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch +++ b/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -619,6 +619,9 @@ config RALINK +@@ -621,6 +621,9 @@ config RALINK select RESET_CONTROLLER select PINCTRL select PINCTRL_RT2880 diff --git a/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch b/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch index 3150dd838..0288b9755 100644 --- a/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch +++ b/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch @@ -16,7 +16,7 @@ Acked-by: John Crispin --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -534,6 +534,12 @@ config SPI_QUP +@@ -533,6 +533,12 @@ config SPI_QUP This driver can also be built as a module. If so, the module will be called spi_qup. diff --git a/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch b/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch index 984f4ada9..339dc5a87 100644 --- a/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch +++ b/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -540,6 +540,12 @@ config SPI_RT2880 +@@ -539,6 +539,12 @@ config SPI_RT2880 help This selects a driver for the Ralink RT288x/RT305x SPI Controller. diff --git a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch index b88c19e25..ca2eb3ac8 100644 --- a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch +++ b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch @@ -2464,7 +2464,7 @@ return ret; } } -@@ -1798,33 +1793,36 @@ static int stmmac_open(struct net_device +@@ -1799,33 +1794,36 @@ static int stmmac_open(struct net_device ret = alloc_dma_desc_resources(priv); if (ret < 0) { @@ -2508,7 +2508,7 @@ goto init_error; } -@@ -1833,8 +1831,9 @@ static int stmmac_open(struct net_device +@@ -1834,8 +1832,9 @@ static int stmmac_open(struct net_device ret = request_irq(priv->wol_irq, stmmac_interrupt, IRQF_SHARED, dev->name, dev); if (unlikely(ret < 0)) { @@ -2520,7 +2520,7 @@ goto wolirq_error; } } -@@ -1844,8 +1843,9 @@ static int stmmac_open(struct net_device +@@ -1845,8 +1844,9 @@ static int stmmac_open(struct net_device ret = request_irq(priv->lpi_irq, stmmac_interrupt, IRQF_SHARED, dev->name, dev); if (unlikely(ret < 0)) { @@ -2532,7 +2532,7 @@ goto lpiirq_error; } } -@@ -1864,8 +1864,8 @@ wolirq_error: +@@ -1865,8 +1865,8 @@ wolirq_error: init_error: free_dma_desc_resources(priv); dma_desc_error: @@ -2543,7 +2543,7 @@ return ret; } -@@ -1884,10 +1884,9 @@ static int stmmac_release(struct net_dev +@@ -1885,10 +1885,9 @@ static int stmmac_release(struct net_dev del_timer_sync(&priv->eee_ctrl_timer); /* Stop and disconnect the PHY */ @@ -2557,7 +2557,7 @@ } netif_stop_queue(dev); -@@ -1947,13 +1946,13 @@ static void stmmac_tso_allocator(struct +@@ -1948,13 +1947,13 @@ static void stmmac_tso_allocator(struct priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); desc = priv->dma_tx + priv->cur_tx; @@ -2573,7 +2573,7 @@ 0, 0); tmp_len -= TSO_MAX_BUFF_SIZE; -@@ -1998,8 +1997,6 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -1999,8 +1998,6 @@ static netdev_tx_t stmmac_tso_xmit(struc u8 proto_hdr_len; int i; @@ -2582,7 +2582,7 @@ /* Compute header lengths */ proto_hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); -@@ -2009,9 +2006,10 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2010,9 +2007,10 @@ static netdev_tx_t stmmac_tso_xmit(struc if (!netif_queue_stopped(dev)) { netif_stop_queue(dev); /* This is a hard error, log it. */ @@ -2595,7 +2595,7 @@ return NETDEV_TX_BUSY; } -@@ -2049,11 +2047,11 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2050,11 +2048,11 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->tx_skbuff_dma[first_entry].len = skb_headlen(skb); priv->tx_skbuff[first_entry] = skb; @@ -2609,7 +2609,7 @@ /* If needed take extra descriptors to fill the remaining payload */ tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE; -@@ -2082,8 +2080,8 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2083,8 +2081,8 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) { @@ -2620,7 +2620,7 @@ netif_stop_queue(dev); } -@@ -2127,7 +2125,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2128,7 +2126,7 @@ static netdev_tx_t stmmac_tso_xmit(struc * descriptor and then barrier is needed to make sure that * all is coherent before granting the DMA engine. */ @@ -2629,7 +2629,7 @@ if (netif_msg_pktdata(priv)) { pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n", -@@ -2146,11 +2144,9 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2147,11 +2145,9 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, STMMAC_CHAN0); @@ -2641,7 +2641,7 @@ dev_err(priv->device, "Tx dma map failed\n"); dev_kfree_skb(skb); priv->dev->stats.tx_dropped++; -@@ -2182,14 +2178,13 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2183,14 +2179,13 @@ static netdev_tx_t stmmac_xmit(struct sk return stmmac_tso_xmit(skb, dev); } @@ -2659,7 +2659,7 @@ } return NETDEV_TX_BUSY; } -@@ -2242,13 +2237,11 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2243,13 +2238,11 @@ static netdev_tx_t stmmac_xmit(struct sk priv->tx_skbuff[entry] = NULL; @@ -2678,7 +2678,7 @@ priv->tx_skbuff_dma[entry].map_as_page = true; priv->tx_skbuff_dma[entry].len = len; -@@ -2266,9 +2259,10 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2267,9 +2260,10 @@ static netdev_tx_t stmmac_xmit(struct sk if (netif_msg_pktdata(priv)) { void *tx_head; @@ -2692,7 +2692,7 @@ if (priv->extend_desc) tx_head = (void *)priv->dma_etx; -@@ -2277,13 +2271,13 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2278,13 +2272,13 @@ static netdev_tx_t stmmac_xmit(struct sk priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false); @@ -2709,7 +2709,7 @@ netif_stop_queue(dev); } -@@ -2319,13 +2313,11 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2320,13 +2314,11 @@ static netdev_tx_t stmmac_xmit(struct sk if (dma_mapping_error(priv->device, des)) goto dma_map_err; @@ -2728,7 +2728,7 @@ priv->tx_skbuff_dma[first_entry].len = nopaged_len; priv->tx_skbuff_dma[first_entry].last_segment = last_segment; -@@ -2346,7 +2338,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2347,7 +2339,7 @@ static netdev_tx_t stmmac_xmit(struct sk * descriptor and then barrier is needed to make sure that * all is coherent before granting the DMA engine. */ @@ -2737,7 +2737,7 @@ } netdev_sent_queue(dev, skb->len); -@@ -2357,12 +2349,10 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2358,12 +2350,10 @@ static netdev_tx_t stmmac_xmit(struct sk priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, STMMAC_CHAN0); @@ -2751,7 +2751,7 @@ dev_kfree_skb(skb); priv->dev->stats.tx_dropped++; return NETDEV_TX_OK; -@@ -2433,16 +2423,16 @@ static inline void stmmac_rx_refill(stru +@@ -2434,16 +2424,16 @@ static inline void stmmac_rx_refill(stru DMA_FROM_DEVICE); if (dma_mapping_error(priv->device, priv->rx_skbuff_dma[entry])) { @@ -2771,7 +2771,7 @@ } if (priv->hw->mode->refill_desc3) priv->hw->mode->refill_desc3(priv, p); -@@ -2450,17 +2440,17 @@ static inline void stmmac_rx_refill(stru +@@ -2451,17 +2441,17 @@ static inline void stmmac_rx_refill(stru if (priv->rx_zeroc_thresh > 0) priv->rx_zeroc_thresh--; @@ -2793,7 +2793,7 @@ entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE); } -@@ -2484,7 +2474,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2485,7 +2475,7 @@ static int stmmac_rx(struct stmmac_priv if (netif_msg_rx_status(priv)) { void *rx_head; @@ -2802,7 +2802,7 @@ if (priv->extend_desc) rx_head = (void *)priv->dma_erx; else -@@ -2546,9 +2536,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2547,9 +2537,9 @@ static int stmmac_rx(struct stmmac_priv unsigned int des; if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) @@ -2814,7 +2814,7 @@ frame_len = priv->hw->desc->get_rx_frame_len(p, coe); -@@ -2557,9 +2547,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2558,9 +2548,9 @@ static int stmmac_rx(struct stmmac_priv * ignored */ if (frame_len > priv->dma_buf_sz) { @@ -2827,7 +2827,7 @@ priv->dev->stats.rx_length_errors++; break; } -@@ -2571,11 +2561,11 @@ static int stmmac_rx(struct stmmac_priv +@@ -2572,11 +2562,11 @@ static int stmmac_rx(struct stmmac_priv frame_len -= ETH_FCS_LEN; if (netif_msg_rx_status(priv)) { @@ -2843,7 +2843,7 @@ } /* The zero-copy is always used for all the sizes -@@ -2612,8 +2602,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2613,8 +2603,9 @@ static int stmmac_rx(struct stmmac_priv } else { skb = priv->rx_skbuff[entry]; if (unlikely(!skb)) { @@ -2855,7 +2855,7 @@ priv->dev->stats.rx_dropped++; break; } -@@ -2629,7 +2620,8 @@ static int stmmac_rx(struct stmmac_priv +@@ -2630,7 +2621,8 @@ static int stmmac_rx(struct stmmac_priv } if (netif_msg_pktdata(priv)) { @@ -2865,7 +2865,7 @@ print_pkt(skb->data, frame_len); } -@@ -2732,7 +2724,7 @@ static int stmmac_change_mtu(struct net_ +@@ -2733,7 +2725,7 @@ static int stmmac_change_mtu(struct net_ int max_mtu; if (netif_running(dev)) { @@ -2874,7 +2874,7 @@ return -EBUSY; } -@@ -2824,7 +2816,7 @@ static irqreturn_t stmmac_interrupt(int +@@ -2825,7 +2817,7 @@ static irqreturn_t stmmac_interrupt(int pm_wakeup_event(priv->device, 0); if (unlikely(!dev)) { @@ -2883,7 +2883,7 @@ return IRQ_NONE; } -@@ -2882,7 +2874,6 @@ static void stmmac_poll_controller(struc +@@ -2883,7 +2875,6 @@ static void stmmac_poll_controller(struc */ static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { @@ -2891,7 +2891,7 @@ int ret = -EOPNOTSUPP; if (!netif_running(dev)) -@@ -2892,9 +2883,9 @@ static int stmmac_ioctl(struct net_devic +@@ -2893,9 +2884,9 @@ static int stmmac_ioctl(struct net_devic case SIOCGMIIPHY: case SIOCGMIIREG: case SIOCSMIIREG: @@ -2903,7 +2903,7 @@ break; case SIOCSHWTSTAMP: ret = stmmac_hwtstamp_ioctl(dev, rq); -@@ -2922,14 +2913,17 @@ static void sysfs_display_ring(void *hea +@@ -2923,14 +2914,17 @@ static void sysfs_display_ring(void *hea x = *(u64 *) ep; seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", i, (unsigned int)virt_to_phys(ep), @@ -2924,7 +2924,7 @@ p++; } seq_printf(seq, "\n"); -@@ -2961,6 +2955,8 @@ static int stmmac_sysfs_ring_open(struct +@@ -2962,6 +2956,8 @@ static int stmmac_sysfs_ring_open(struct return single_open(file, stmmac_sysfs_ring_read, inode->i_private); } @@ -2933,7 +2933,7 @@ static const struct file_operations stmmac_rings_status_fops = { .owner = THIS_MODULE, .open = stmmac_sysfs_ring_open, -@@ -2983,11 +2979,11 @@ static int stmmac_sysfs_dma_cap_read(str +@@ -2984,11 +2980,11 @@ static int stmmac_sysfs_dma_cap_read(str seq_printf(seq, "\tDMA HW features\n"); seq_printf(seq, "==============================\n"); @@ -2948,7 +2948,7 @@ (priv->dma_cap.half_duplex) ? "Y" : "N"); seq_printf(seq, "\tHash Filter: %s\n", (priv->dma_cap.hash_filter) ? "Y" : "N"); -@@ -3005,9 +3001,9 @@ static int stmmac_sysfs_dma_cap_read(str +@@ -3006,9 +3002,9 @@ static int stmmac_sysfs_dma_cap_read(str (priv->dma_cap.rmon) ? "Y" : "N"); seq_printf(seq, "\tIEEE 1588-2002 Time Stamp: %s\n", (priv->dma_cap.time_stamp) ? "Y" : "N"); @@ -2960,7 +2960,7 @@ (priv->dma_cap.eee) ? "Y" : "N"); seq_printf(seq, "\tAV features: %s\n", (priv->dma_cap.av) ? "Y" : "N"); seq_printf(seq, "\tChecksum Offload in TX: %s\n", -@@ -3054,8 +3050,7 @@ static int stmmac_init_fs(struct net_dev +@@ -3055,8 +3051,7 @@ static int stmmac_init_fs(struct net_dev priv->dbgfs_dir = debugfs_create_dir(dev->name, stmmac_fs_dir); if (!priv->dbgfs_dir || IS_ERR(priv->dbgfs_dir)) { @@ -2970,7 +2970,7 @@ return -ENOMEM; } -@@ -3067,7 +3062,7 @@ static int stmmac_init_fs(struct net_dev +@@ -3068,7 +3063,7 @@ static int stmmac_init_fs(struct net_dev &stmmac_rings_status_fops); if (!priv->dbgfs_rings_status || IS_ERR(priv->dbgfs_rings_status)) { @@ -2979,7 +2979,7 @@ debugfs_remove_recursive(priv->dbgfs_dir); return -ENOMEM; -@@ -3079,7 +3074,7 @@ static int stmmac_init_fs(struct net_dev +@@ -3080,7 +3075,7 @@ static int stmmac_init_fs(struct net_dev dev, &stmmac_dma_cap_fops); if (!priv->dbgfs_dma_cap || IS_ERR(priv->dbgfs_dma_cap)) { @@ -2988,7 +2988,7 @@ debugfs_remove_recursive(priv->dbgfs_dir); return -ENOMEM; -@@ -3151,11 +3146,11 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3152,11 +3147,11 @@ static int stmmac_hw_init(struct stmmac_ } else { if (chain_mode) { priv->hw->mode = &chain_mode_ops; @@ -3002,7 +3002,7 @@ priv->mode = STMMAC_RING_MODE; } } -@@ -3163,7 +3158,7 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3164,7 +3159,7 @@ static int stmmac_hw_init(struct stmmac_ /* Get the HW capability (new GMAC newer than 3.50a) */ priv->hw_cap_support = stmmac_get_hw_features(priv); if (priv->hw_cap_support) { @@ -3011,7 +3011,7 @@ /* We can override some gmac/dma configuration fields: e.g. * enh_desc, tx_coe (e.g. that are passed through the -@@ -3188,8 +3183,9 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3189,8 +3184,9 @@ static int stmmac_hw_init(struct stmmac_ else if (priv->dma_cap.rx_coe_type1) priv->plat->rx_coe = STMMAC_RX_COE_TYPE1; @@ -3023,7 +3023,7 @@ /* To use alternate (extended), normal or GMAC4 descriptor structures */ if (priv->synopsys_id >= DWMAC_CORE_4_00) -@@ -3199,20 +3195,20 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3200,20 +3196,20 @@ static int stmmac_hw_init(struct stmmac_ if (priv->plat->rx_coe) { priv->hw->rx_csum = priv->plat->rx_coe; @@ -3049,7 +3049,7 @@ return 0; } -@@ -3271,8 +3267,8 @@ int stmmac_dvr_probe(struct device *devi +@@ -3272,8 +3268,8 @@ int stmmac_dvr_probe(struct device *devi priv->stmmac_clk = devm_clk_get(priv->device, STMMAC_RESOURCE_NAME); if (IS_ERR(priv->stmmac_clk)) { @@ -3060,7 +3060,7 @@ /* If failed to obtain stmmac_clk and specific clk_csr value * is NOT passed from the platform, probe fail. */ -@@ -3321,7 +3317,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -3322,7 +3318,7 @@ int stmmac_dvr_probe(struct device *devi if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { ndev->hw_features |= NETIF_F_TSO; priv->tso = true; @@ -3069,7 +3069,7 @@ } ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; ndev->watchdog_timeo = msecs_to_jiffies(watchdog); -@@ -3341,13 +3337,13 @@ int stmmac_dvr_probe(struct device *devi +@@ -3342,13 +3338,13 @@ int stmmac_dvr_probe(struct device *devi */ if ((priv->synopsys_id >= DWMAC_CORE_3_50) && (!priv->plat->riwt_off)) { priv->use_riwt = 1; @@ -3085,7 +3085,7 @@ /* If a specific clk_csr value is passed from the platform * this means that the CSR Clock Range selection cannot be -@@ -3368,15 +3364,17 @@ int stmmac_dvr_probe(struct device *devi +@@ -3369,15 +3365,17 @@ int stmmac_dvr_probe(struct device *devi /* MDIO bus Registration */ ret = stmmac_mdio_register(ndev); if (ret < 0) { @@ -3107,7 +3107,7 @@ goto error_netdev_register; } -@@ -3387,7 +3385,7 @@ error_netdev_register: +@@ -3388,7 +3386,7 @@ error_netdev_register: priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); @@ -3116,7 +3116,7 @@ netif_napi_del(&priv->napi); error_hw_init: clk_disable_unprepare(priv->pclk); -@@ -3411,7 +3409,7 @@ int stmmac_dvr_remove(struct device *dev +@@ -3412,7 +3410,7 @@ int stmmac_dvr_remove(struct device *dev struct net_device *ndev = dev_get_drvdata(dev); struct stmmac_priv *priv = netdev_priv(ndev); @@ -3125,7 +3125,7 @@ priv->hw->dma->stop_rx(priv->ioaddr); priv->hw->dma->stop_tx(priv->ioaddr); -@@ -3449,8 +3447,8 @@ int stmmac_suspend(struct device *dev) +@@ -3450,8 +3448,8 @@ int stmmac_suspend(struct device *dev) if (!ndev || !netif_running(ndev)) return 0; @@ -3136,7 +3136,7 @@ spin_lock_irqsave(&priv->lock, flags); -@@ -3544,8 +3542,8 @@ int stmmac_resume(struct device *dev) +@@ -3545,8 +3543,8 @@ int stmmac_resume(struct device *dev) spin_unlock_irqrestore(&priv->lock, flags); diff --git a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch index abd130448..fc626cbb9 100644 --- a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch +++ b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch @@ -1718,7 +1718,7 @@ priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS; if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) { -@@ -2519,7 +2517,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2520,7 +2518,7 @@ static int stmmac_rx(struct stmmac_priv if (unlikely(status == discard_frame)) { priv->dev->stats.rx_errors++; if (priv->hwts_rx_en && !priv->extend_desc) { @@ -1727,7 +1727,7 @@ * with timestamp value, hence reinitialize * them in stmmac_rx_refill() function so that * device can reuse it. -@@ -2542,7 +2540,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2543,7 +2541,7 @@ static int stmmac_rx(struct stmmac_priv frame_len = priv->hw->desc->get_rx_frame_len(p, coe); @@ -1736,7 +1736,7 @@ * (preallocated during init) then the packet is * ignored */ -@@ -2762,7 +2760,7 @@ static netdev_features_t stmmac_fix_feat +@@ -2763,7 +2761,7 @@ static netdev_features_t stmmac_fix_feat /* Some GMAC devices have a bugged Jumbo frame support that * needs to have the Tx COE disabled for oversized frames * (due to limited buffer sizes). In this case we disable @@ -1745,7 +1745,7 @@ */ if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN)) features &= ~NETIF_F_CSUM_MASK; -@@ -2908,9 +2906,7 @@ static void sysfs_display_ring(void *hea +@@ -2909,9 +2907,7 @@ static void sysfs_display_ring(void *hea struct dma_desc *p = (struct dma_desc *)head; for (i = 0; i < size; i++) { @@ -1755,7 +1755,7 @@ seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", i, (unsigned int)virt_to_phys(ep), le32_to_cpu(ep->basic.des0), -@@ -2919,7 +2915,6 @@ static void sysfs_display_ring(void *hea +@@ -2920,7 +2916,6 @@ static void sysfs_display_ring(void *hea le32_to_cpu(ep->basic.des3)); ep++; } else { @@ -1763,7 +1763,7 @@ seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", i, (unsigned int)virt_to_phys(ep), le32_to_cpu(p->des0), le32_to_cpu(p->des1), -@@ -2989,7 +2984,7 @@ static int stmmac_sysfs_dma_cap_read(str +@@ -2990,7 +2985,7 @@ static int stmmac_sysfs_dma_cap_read(str (priv->dma_cap.hash_filter) ? "Y" : "N"); seq_printf(seq, "\tMultiple MAC address registers: %s\n", (priv->dma_cap.multi_addr) ? "Y" : "N"); @@ -1772,7 +1772,7 @@ (priv->dma_cap.pcs) ? "Y" : "N"); seq_printf(seq, "\tSMA (MDIO) Interface: %s\n", (priv->dma_cap.sma_mdio) ? "Y" : "N"); -@@ -3265,44 +3260,8 @@ int stmmac_dvr_probe(struct device *devi +@@ -3266,44 +3261,8 @@ int stmmac_dvr_probe(struct device *devi if ((phyaddr >= 0) && (phyaddr <= 31)) priv->plat->phy_addr = phyaddr; @@ -1819,7 +1819,7 @@ /* Init MAC and get the capabilities */ ret = stmmac_hw_init(priv); -@@ -3388,10 +3347,6 @@ error_netdev_register: +@@ -3389,10 +3348,6 @@ error_netdev_register: error_mdio_register: netif_napi_del(&priv->napi); error_hw_init: @@ -1830,7 +1830,7 @@ free_netdev(ndev); return ret; -@@ -3417,10 +3372,10 @@ int stmmac_dvr_remove(struct device *dev +@@ -3418,10 +3373,10 @@ int stmmac_dvr_remove(struct device *dev stmmac_set_mac(priv->ioaddr, false); netif_carrier_off(ndev); unregister_netdev(ndev); @@ -1845,7 +1845,7 @@ if (priv->hw->pcs != STMMAC_PCS_RGMII && priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) -@@ -3469,14 +3424,14 @@ int stmmac_suspend(struct device *dev) +@@ -3470,14 +3425,14 @@ int stmmac_suspend(struct device *dev) stmmac_set_mac(priv->ioaddr, false); pinctrl_pm_select_sleep_state(priv->device); /* Disable clock in case of PWM is off */ @@ -1864,7 +1864,7 @@ return 0; } EXPORT_SYMBOL_GPL(stmmac_suspend); -@@ -3509,9 +3464,9 @@ int stmmac_resume(struct device *dev) +@@ -3510,9 +3465,9 @@ int stmmac_resume(struct device *dev) priv->irq_wake = 0; } else { pinctrl_pm_select_default_state(priv->device); diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch index 285e4d276..18f58e947 100644 --- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch +++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch @@ -4523,7 +4523,7 @@ /** * stmmac_open - open entry point of the driver * @dev : pointer to the device structure. -@@ -1821,7 +2598,7 @@ static int stmmac_open(struct net_device +@@ -1822,7 +2599,7 @@ static int stmmac_open(struct net_device netdev_err(priv->dev, "%s: ERROR: allocating the IRQ %d (error: %d)\n", __func__, dev->irq, ret); @@ -4532,7 +4532,7 @@ } /* Request the Wake IRQ in case of another line is used for WoL */ -@@ -1848,8 +2625,8 @@ static int stmmac_open(struct net_device +@@ -1849,8 +2626,8 @@ static int stmmac_open(struct net_device } } @@ -4543,7 +4543,7 @@ return 0; -@@ -1858,7 +2635,12 @@ lpiirq_error: +@@ -1859,7 +2636,12 @@ lpiirq_error: free_irq(priv->wol_irq, dev); wolirq_error: free_irq(dev->irq, dev); @@ -4556,7 +4556,7 @@ init_error: free_dma_desc_resources(priv); dma_desc_error: -@@ -1887,9 +2669,9 @@ static int stmmac_release(struct net_dev +@@ -1888,9 +2670,9 @@ static int stmmac_release(struct net_dev phy_disconnect(dev->phydev); } @@ -4568,7 +4568,7 @@ del_timer_sync(&priv->txtimer); -@@ -1901,14 +2683,13 @@ static int stmmac_release(struct net_dev +@@ -1902,14 +2684,13 @@ static int stmmac_release(struct net_dev free_irq(priv->lpi_irq, dev); /* Stop TX/RX DMA and clear the descriptors */ @@ -4585,7 +4585,7 @@ netif_carrier_off(dev); -@@ -1927,22 +2708,24 @@ static int stmmac_release(struct net_dev +@@ -1928,22 +2709,24 @@ static int stmmac_release(struct net_dev * @des: buffer start address * @total_len: total length to fill in descriptors * @last_segmant: condition for the last descriptor @@ -4614,7 +4614,7 @@ desc->des0 = cpu_to_le32(des + (total_len - tmp_len)); buff_size = tmp_len >= TSO_MAX_BUFF_SIZE ? -@@ -1950,7 +2733,7 @@ static void stmmac_tso_allocator(struct +@@ -1951,7 +2734,7 @@ static void stmmac_tso_allocator(struct priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size, 0, 1, @@ -4623,7 +4623,7 @@ 0, 0); tmp_len -= TSO_MAX_BUFF_SIZE; -@@ -1986,23 +2769,28 @@ static void stmmac_tso_allocator(struct +@@ -1987,23 +2770,28 @@ static void stmmac_tso_allocator(struct */ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) { @@ -4658,7 +4658,7 @@ /* This is a hard error, log it. */ netdev_err(priv->dev, "%s: Tx Ring full when queue awake\n", -@@ -2017,10 +2805,10 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2018,10 +2806,10 @@ static netdev_tx_t stmmac_tso_xmit(struc /* set new MSS value if needed */ if (mss != priv->mss) { @@ -4671,7 +4671,7 @@ } if (netif_msg_tx_queued(priv)) { -@@ -2030,9 +2818,9 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2031,9 +2819,9 @@ static netdev_tx_t stmmac_tso_xmit(struc skb->data_len); } @@ -4683,7 +4683,7 @@ first = desc; /* first descriptor: fill Headers on Buf1 */ -@@ -2041,9 +2829,8 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2042,9 +2830,8 @@ static netdev_tx_t stmmac_tso_xmit(struc if (dma_mapping_error(priv->device, des)) goto dma_map_err; @@ -4695,7 +4695,7 @@ first->des0 = cpu_to_le32(des); -@@ -2054,7 +2841,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2055,7 +2842,7 @@ static netdev_tx_t stmmac_tso_xmit(struc /* If needed take extra descriptors to fill the remaining payload */ tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE; @@ -4704,7 +4704,7 @@ /* Prepare fragments */ for (i = 0; i < nfrags; i++) { -@@ -2063,24 +2850,34 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2064,24 +2851,34 @@ static netdev_tx_t stmmac_tso_xmit(struc des = skb_frag_dma_map(priv->device, frag, 0, skb_frag_size(frag), DMA_TO_DEVICE); @@ -4748,7 +4748,7 @@ } dev->stats.tx_bytes += skb->len; -@@ -2112,7 +2909,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2113,7 +2910,7 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->hw->desc->prepare_tso_tx_desc(first, 1, proto_hdr_len, pay_len, @@ -4757,7 +4757,7 @@ tcp_hdrlen(skb) / 4, (skb->len - proto_hdr_len)); /* If context desc is used to change MSS */ -@@ -2127,20 +2924,20 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2128,20 +2925,20 @@ static netdev_tx_t stmmac_tso_xmit(struc if (netif_msg_pktdata(priv)) { pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n", @@ -4784,7 +4784,7 @@ return NETDEV_TX_OK; -@@ -2164,21 +2961,27 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2165,21 +2962,27 @@ static netdev_tx_t stmmac_xmit(struct sk struct stmmac_priv *priv = netdev_priv(dev); unsigned int nopaged_len = skb_headlen(skb); int i, csum_insertion = 0, is_jumbo = 0; @@ -4816,7 +4816,7 @@ /* This is a hard error, log it. */ netdev_err(priv->dev, "%s: Tx Ring full when queue awake\n", -@@ -2190,20 +2993,18 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2191,20 +2994,18 @@ static netdev_tx_t stmmac_xmit(struct sk if (priv->tx_path_in_lpi_mode) stmmac_disable_eee_mode(priv); @@ -4840,7 +4840,7 @@ enh_desc = priv->plat->enh_desc; /* To program the descriptors according to the size of the frame */ if (enh_desc) -@@ -2211,7 +3012,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2212,7 +3013,7 @@ static netdev_tx_t stmmac_xmit(struct sk if (unlikely(is_jumbo) && likely(priv->synopsys_id < DWMAC_CORE_4_00)) { @@ -4849,7 +4849,7 @@ if (unlikely(entry < 0)) goto dma_map_err; } -@@ -2224,48 +3025,56 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2225,48 +3026,56 @@ static netdev_tx_t stmmac_xmit(struct sk entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); if (likely(priv->extend_desc)) @@ -4919,7 +4919,7 @@ priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false); -@@ -2273,10 +3082,10 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2274,10 +3083,10 @@ static netdev_tx_t stmmac_xmit(struct sk print_pkt(skb->data, skb->len); } @@ -4932,7 +4932,7 @@ } dev->stats.tx_bytes += skb->len; -@@ -2311,14 +3120,14 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2312,14 +3121,14 @@ static netdev_tx_t stmmac_xmit(struct sk if (dma_mapping_error(priv->device, des)) goto dma_map_err; @@ -4950,7 +4950,7 @@ if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)) { -@@ -2330,7 +3139,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2331,7 +3140,7 @@ static netdev_tx_t stmmac_xmit(struct sk /* Prepare the first descriptor setting the OWN bit too */ priv->hw->desc->prepare_tx_desc(first, 1, nopaged_len, csum_insertion, priv->mode, 1, @@ -4959,7 +4959,7 @@ /* The own bit must be the latest setting done when prepare the * descriptor and then barrier is needed to make sure that -@@ -2339,13 +3148,13 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2340,13 +3149,13 @@ static netdev_tx_t stmmac_xmit(struct sk dma_wmb(); } @@ -4976,7 +4976,7 @@ return NETDEV_TX_OK; -@@ -2373,9 +3182,9 @@ static void stmmac_rx_vlan(struct net_de +@@ -2374,9 +3183,9 @@ static void stmmac_rx_vlan(struct net_de } @@ -4988,7 +4988,7 @@ return 0; return 1; -@@ -2384,30 +3193,33 @@ static inline int stmmac_rx_threshold_co +@@ -2385,30 +3194,33 @@ static inline int stmmac_rx_threshold_co /** * stmmac_rx_refill - refill used skb preallocated buffers * @priv: driver private structure @@ -5029,7 +5029,7 @@ if (unlikely(net_ratelimit())) dev_err(priv->device, "fail to alloc skb entry %d\n", -@@ -2415,28 +3227,28 @@ static inline void stmmac_rx_refill(stru +@@ -2416,28 +3228,28 @@ static inline void stmmac_rx_refill(stru break; } @@ -5066,7 +5066,7 @@ netif_dbg(priv, rx_status, priv->dev, "refill entry #%d\n", entry); -@@ -2452,31 +3264,33 @@ static inline void stmmac_rx_refill(stru +@@ -2453,31 +3265,33 @@ static inline void stmmac_rx_refill(stru entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE); } @@ -5107,7 +5107,7 @@ priv->hw->desc->display_ring(rx_head, DMA_RX_SIZE, true); } -@@ -2486,9 +3300,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2487,9 +3301,9 @@ static int stmmac_rx(struct stmmac_priv struct dma_desc *np; if (priv->extend_desc) @@ -5119,7 +5119,7 @@ /* read the status of the incoming frame */ status = priv->hw->desc->rx_status(&priv->dev->stats, -@@ -2499,20 +3313,20 @@ static int stmmac_rx(struct stmmac_priv +@@ -2500,20 +3314,20 @@ static int stmmac_rx(struct stmmac_priv count++; @@ -5145,7 +5145,7 @@ entry); if (unlikely(status == discard_frame)) { priv->dev->stats.rx_errors++; -@@ -2522,9 +3336,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2523,9 +3337,9 @@ static int stmmac_rx(struct stmmac_priv * them in stmmac_rx_refill() function so that * device can reuse it. */ @@ -5157,7 +5157,7 @@ priv->dma_buf_sz, DMA_FROM_DEVICE); } -@@ -2572,7 +3386,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2573,7 +3387,7 @@ static int stmmac_rx(struct stmmac_priv */ if (unlikely(!priv->plat->has_gmac4 && ((frame_len < priv->rx_copybreak) || @@ -5166,7 +5166,7 @@ skb = netdev_alloc_skb_ip_align(priv->dev, frame_len); if (unlikely(!skb)) { -@@ -2584,21 +3398,21 @@ static int stmmac_rx(struct stmmac_priv +@@ -2585,21 +3399,21 @@ static int stmmac_rx(struct stmmac_priv } dma_sync_single_for_cpu(priv->device, @@ -5192,7 +5192,7 @@ if (unlikely(!skb)) { netdev_err(priv->dev, "%s: Inconsistent Rx chain\n", -@@ -2607,12 +3421,12 @@ static int stmmac_rx(struct stmmac_priv +@@ -2608,12 +3422,12 @@ static int stmmac_rx(struct stmmac_priv break; } prefetch(skb->data - NET_IP_ALIGN); @@ -5208,7 +5208,7 @@ priv->dma_buf_sz, DMA_FROM_DEVICE); } -@@ -2634,7 +3448,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2635,7 +3449,7 @@ static int stmmac_rx(struct stmmac_priv else skb->ip_summed = CHECKSUM_UNNECESSARY; @@ -5217,7 +5217,7 @@ priv->dev->stats.rx_packets++; priv->dev->stats.rx_bytes += frame_len; -@@ -2642,7 +3456,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2643,7 +3457,7 @@ static int stmmac_rx(struct stmmac_priv entry = next_entry; } @@ -5226,7 +5226,7 @@ priv->xstats.rx_pkt_n += count; -@@ -2659,16 +3473,24 @@ static int stmmac_rx(struct stmmac_priv +@@ -2660,16 +3474,24 @@ static int stmmac_rx(struct stmmac_priv */ static int stmmac_poll(struct napi_struct *napi, int budget) { @@ -5255,7 +5255,7 @@ } return work_done; } -@@ -2684,9 +3506,12 @@ static int stmmac_poll(struct napi_struc +@@ -2685,9 +3507,12 @@ static int stmmac_poll(struct napi_struc static void stmmac_tx_timeout(struct net_device *dev) { struct stmmac_priv *priv = netdev_priv(dev); @@ -5269,7 +5269,7 @@ } /** -@@ -2809,6 +3634,12 @@ static irqreturn_t stmmac_interrupt(int +@@ -2810,6 +3635,12 @@ static irqreturn_t stmmac_interrupt(int { struct net_device *dev = (struct net_device *)dev_id; struct stmmac_priv *priv = netdev_priv(dev); @@ -5282,7 +5282,7 @@ if (priv->irq_wake) pm_wakeup_event(priv->device, 0); -@@ -2822,16 +3653,30 @@ static irqreturn_t stmmac_interrupt(int +@@ -2823,16 +3654,30 @@ static irqreturn_t stmmac_interrupt(int if ((priv->plat->has_gmac) || (priv->plat->has_gmac4)) { int status = priv->hw->mac->host_irq_status(priv->hw, &priv->xstats); @@ -5317,7 +5317,7 @@ } /* PCS link status */ -@@ -2916,7 +3761,7 @@ static void sysfs_display_ring(void *hea +@@ -2917,7 +3762,7 @@ static void sysfs_display_ring(void *hea ep++; } else { seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", @@ -5326,7 +5326,7 @@ le32_to_cpu(p->des0), le32_to_cpu(p->des1), le32_to_cpu(p->des2), le32_to_cpu(p->des3)); p++; -@@ -2929,17 +3774,40 @@ static int stmmac_sysfs_ring_read(struct +@@ -2930,17 +3775,40 @@ static int stmmac_sysfs_ring_read(struct { struct net_device *dev = seq->private; struct stmmac_priv *priv = netdev_priv(dev); @@ -5377,7 +5377,7 @@ } return 0; -@@ -3222,11 +4090,14 @@ int stmmac_dvr_probe(struct device *devi +@@ -3223,11 +4091,14 @@ int stmmac_dvr_probe(struct device *devi struct plat_stmmacenet_data *plat_dat, struct stmmac_resources *res) { @@ -5394,7 +5394,7 @@ if (!ndev) return -ENOMEM; -@@ -3268,6 +4139,10 @@ int stmmac_dvr_probe(struct device *devi +@@ -3269,6 +4140,10 @@ int stmmac_dvr_probe(struct device *devi if (ret) goto error_hw_init; @@ -5405,7 +5405,7 @@ ndev->netdev_ops = &stmmac_netdev_ops; ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | -@@ -3300,7 +4175,12 @@ int stmmac_dvr_probe(struct device *devi +@@ -3301,7 +4176,12 @@ int stmmac_dvr_probe(struct device *devi "Enable RX Mitigation via HW Watchdog Timer\n"); } @@ -5419,7 +5419,7 @@ spin_lock_init(&priv->lock); -@@ -3345,7 +4225,11 @@ error_netdev_register: +@@ -3346,7 +4226,11 @@ error_netdev_register: priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); error_mdio_register: @@ -5432,7 +5432,7 @@ error_hw_init: free_netdev(ndev); -@@ -3366,10 +4250,9 @@ int stmmac_dvr_remove(struct device *dev +@@ -3367,10 +4251,9 @@ int stmmac_dvr_remove(struct device *dev netdev_info(priv->dev, "%s: removing driver", __func__); @@ -5445,7 +5445,7 @@ netif_carrier_off(ndev); unregister_netdev(ndev); if (priv->plat->stmmac_rst) -@@ -3408,20 +4291,19 @@ int stmmac_suspend(struct device *dev) +@@ -3409,20 +4292,19 @@ int stmmac_suspend(struct device *dev) spin_lock_irqsave(&priv->lock, flags); netif_device_detach(ndev); @@ -5470,7 +5470,7 @@ pinctrl_pm_select_sleep_state(priv->device); /* Disable clock in case of PWM is off */ clk_disable(priv->plat->pclk); -@@ -3437,6 +4319,31 @@ int stmmac_suspend(struct device *dev) +@@ -3438,6 +4320,31 @@ int stmmac_suspend(struct device *dev) EXPORT_SYMBOL_GPL(stmmac_suspend); /** @@ -5502,7 +5502,7 @@ * stmmac_resume - resume callback * @dev: device pointer * Description: when resume this function is invoked to setup the DMA and CORE -@@ -3476,10 +4383,8 @@ int stmmac_resume(struct device *dev) +@@ -3477,10 +4384,8 @@ int stmmac_resume(struct device *dev) spin_lock_irqsave(&priv->lock, flags); @@ -5515,7 +5515,7 @@ /* reset private mss value to force mss context settings at * next tso xmit (only used for gmac4). */ -@@ -3491,9 +4396,9 @@ int stmmac_resume(struct device *dev) +@@ -3492,9 +4397,9 @@ int stmmac_resume(struct device *dev) stmmac_init_tx_coalesce(priv); stmmac_set_rx_mode(ndev); diff --git a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch index f829b79dc..161e9f0e6 100644 --- a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch +++ b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch @@ -1491,7 +1491,7 @@ free_dma_tx_desc_resources(priv); return ret; -@@ -2895,8 +2893,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2896,8 +2894,7 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->xstats.tx_set_ic_bit++; } @@ -1501,7 +1501,7 @@ if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)) { -@@ -2974,7 +2971,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2975,7 +2972,7 @@ static netdev_tx_t stmmac_xmit(struct sk /* Manage oversized TCP frames for GMAC4 device */ if (skb_is_gso(skb) && priv->tso) { @@ -1510,7 +1510,7 @@ return stmmac_tso_xmit(skb, dev); } -@@ -3105,8 +3102,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -3106,8 +3103,7 @@ static netdev_tx_t stmmac_xmit(struct sk priv->xstats.tx_set_ic_bit++; } @@ -1520,7 +1520,7 @@ /* Ready to fill the first descriptor and set the OWN bit w/o any * problems because all the descriptors are actually ready to be -@@ -3983,7 +3979,9 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3984,7 +3980,9 @@ static int stmmac_hw_init(struct stmmac_ struct mac_device_info *mac; /* Identify the MAC HW device */ @@ -1531,7 +1531,7 @@ priv->dev->priv_flags |= IFF_UNICAST_FLT; mac = dwmac1000_setup(priv->ioaddr, priv->plat->multicast_filter_bins, -@@ -4003,6 +4001,10 @@ static int stmmac_hw_init(struct stmmac_ +@@ -4004,6 +4002,10 @@ static int stmmac_hw_init(struct stmmac_ priv->hw = mac; @@ -1542,7 +1542,7 @@ /* To use the chained or ring mode */ if (priv->synopsys_id >= DWMAC_CORE_4_00) { priv->hw->mode = &dwmac4_ring_mode_ops; -@@ -4131,8 +4133,15 @@ int stmmac_dvr_probe(struct device *devi +@@ -4132,8 +4134,15 @@ int stmmac_dvr_probe(struct device *devi if ((phyaddr >= 0) && (phyaddr <= 31)) priv->plat->phy_addr = phyaddr; @@ -1559,7 +1559,7 @@ /* Init MAC and get the capabilities */ ret = stmmac_hw_init(priv); -@@ -4149,7 +4158,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -4150,7 +4159,7 @@ int stmmac_dvr_probe(struct device *devi NETIF_F_RXCSUM; if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { @@ -1568,7 +1568,7 @@ priv->tso = true; dev_info(priv->device, "TSO feature enabled\n"); } -@@ -4311,7 +4320,7 @@ int stmmac_suspend(struct device *dev) +@@ -4312,7 +4321,7 @@ int stmmac_suspend(struct device *dev) } spin_unlock_irqrestore(&priv->lock, flags);