From 550370858c61e6f7fe3832de73daa9cc25ba716a Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Mon, 13 Nov 2017 20:15:33 +0000 Subject: [PATCH 01/92] Update our copies of the Device Tree Source to Linux 4.14 --- Bindings/arc/hsdk.txt | 7 + Bindings/arm/amlogic.txt | 41 ++ Bindings/arm/arch_timer.txt | 1 - Bindings/arm/bcm/brcm,bcm2835.txt | 4 + Bindings/arm/bhf.txt | 6 + Bindings/arm/coresight.txt | 4 +- Bindings/arm/cpus.txt | 1 + Bindings/arm/marvell/armada-8kp.txt | 15 + .../arm/marvell/cp110-system-controller0.txt | 1 - Bindings/arm/mediatek.txt | 18 +- Bindings/arm/omap/omap.txt | 9 + Bindings/arm/pmu.txt | 2 + Bindings/arm/qcom.txt | 2 + Bindings/arm/rockchip.txt | 12 + Bindings/arm/shmobile.txt | 8 + Bindings/ata/ahci-mtk.txt | 51 ++ Bindings/ata/apm-xgene.txt | 2 - Bindings/ata/imx-pata.txt | 1 - Bindings/bus/mvebu-mbus.txt | 3 - Bindings/bus/nvidia,tegra20-gmi.txt | 2 - Bindings/bus/nvidia,tegra210-aconnect.txt | 1 - Bindings/chosen.txt | 26 +- Bindings/clock/alphascale,acc.txt | 1 - Bindings/clock/amlogic,gxbb-aoclkc.txt | 23 +- Bindings/clock/amlogic,gxbb-clkc.txt | 1 - Bindings/clock/amlogic,meson8b-clkc.txt | 10 +- Bindings/clock/at91-clock.txt | 10 + Bindings/clock/brcm,kona-ccu.txt | 1 - Bindings/clock/exynos5433-clock.txt | 1 - Bindings/clock/hi3660-clock.txt | 1 - Bindings/clock/hix5hd2-clock.txt | 1 - Bindings/clock/idt,versaclock5.txt | 30 +- Bindings/clock/imx21-clock.txt | 1 - Bindings/clock/imx23-clock.txt | 1 - Bindings/clock/imx25-clock.txt | 1 - Bindings/clock/imx27-clock.txt | 1 - Bindings/clock/imx28-clock.txt | 1 - Bindings/clock/imx31-clock.txt | 1 - Bindings/clock/imx5-clock.txt | 1 - Bindings/clock/imx6q-clock.txt | 1 - Bindings/clock/mt8173-cpu-dvfs.txt | 83 --- Bindings/clock/nvidia,tegra124-dfll.txt | 1 - Bindings/clock/pxa-clock.txt | 1 - Bindings/clock/renesas,cpg-mssr.txt | 4 +- Bindings/clock/renesas,r8a7778-cpg-clocks.txt | 1 - .../clock/renesas,rcar-usb2-clock-sel.txt | 55 ++ Bindings/clock/renesas,rz-cpg-clocks.txt | 1 - Bindings/clock/rockchip,rk3128-cru.txt | 8 +- Bindings/clock/samsung,s3c2410-clock.txt | 1 - Bindings/clock/samsung,s3c2412-clock.txt | 1 - Bindings/clock/samsung,s3c2443-clock.txt | 1 - Bindings/clock/samsung,s3c64xx-clock.txt | 1 - Bindings/clock/samsung,s5pv210-clock.txt | 1 - Bindings/clock/silabs,si5351.txt | 6 +- Bindings/clock/snps,hsdk-pll-clock.txt | 28 + Bindings/clock/snps,pll-clock.txt | 28 + Bindings/clock/st,stm32h7-rcc.txt | 71 ++ Bindings/clock/sunxi-ccu.txt | 6 + Bindings/clock/ti,sci-clk.txt | 7 +- Bindings/clock/ti/dra7-atl.txt | 2 - Bindings/clock/uniphier-clock.txt | 8 +- Bindings/clock/zx296702-clk.txt | 1 - Bindings/clock/zx296718-clk.txt | 1 - Bindings/cpufreq/cpufreq-mediatek.txt | 247 +++++++ Bindings/crypto/artpec6-crypto.txt | 16 + Bindings/crypto/atmel-crypto.txt | 13 + Bindings/crypto/fsl-dcp.txt | 1 - Bindings/crypto/inside-secure-safexcel.txt | 1 - Bindings/crypto/marvell-cesa.txt | 1 - Bindings/crypto/mv_cesa.txt | 1 - Bindings/crypto/rockchip-crypto.txt | 1 - Bindings/crypto/st,stm32-hash.txt | 30 + Bindings/devfreq/event/rockchip-dfi.txt | 1 - Bindings/devfreq/rk3399_dmc.txt | 1 - Bindings/display/atmel,lcdc.txt | 1 - Bindings/display/atmel/hlcdc-dc.txt | 1 - Bindings/display/bridge/dw_mipi_dsi.txt | 32 + .../megachips-stdpxxxx-ge-b850v3-fw.txt | 1 - Bindings/display/bridge/renesas,dw-hdmi.txt | 2 +- Bindings/display/exynos/exynos5433-decon.txt | 12 - Bindings/display/fsl,tcon.txt | 1 - Bindings/display/imx/fsl-imx-drm.txt | 2 +- Bindings/display/marvell,pxa2xx-lcdc.txt | 1 - Bindings/display/panel/innolux,p079zca.txt | 1 - Bindings/display/renesas,du.txt | 51 +- Bindings/display/repaper.txt | 52 ++ .../display/rockchip/analogix_dp-rockchip.txt | 1 - .../display/rockchip/dw_hdmi-rockchip.txt | 8 +- .../display/rockchip/dw_mipi_dsi_rockchip.txt | 2 - .../display/rockchip/inno_hdmi-rockchip.txt | 1 - Bindings/display/rockchip/rockchip-vop.txt | 4 + Bindings/display/simple-framebuffer-sunxi.txt | 1 - Bindings/display/sitronix,st7586.txt | 22 + Bindings/display/st,stm32-ltdc.txt | 105 ++- Bindings/display/sunxi/sun4i-drm.txt | 35 +- Bindings/dma/fsl-edma.txt | 1 - Bindings/dma/mv-xor.txt | 1 - Bindings/dma/qcom_adm.txt | 1 - Bindings/dma/renesas,rcar-dmac.txt | 1 + Bindings/dma/renesas,usb-dmac.txt | 1 + Bindings/dma/snps-dma.txt | 1 - Bindings/dma/st_fdma.txt | 1 - Bindings/dma/ste-dma40.txt | 1 - Bindings/dma/sun4i-dma.txt | 1 - Bindings/dma/sun6i-dma.txt | 1 + Bindings/dma/ti-dma-crossbar.txt | 1 - Bindings/dma/ti-edma.txt | 96 ++- Bindings/eeprom/eeprom.txt | 6 +- Bindings/extcon/extcon-usbc-cros-ec.txt | 24 + Bindings/fpga/altera-passive-serial.txt | 29 + Bindings/fpga/xilinx-pr-decoupler.txt | 36 + Bindings/fpga/xilinx-slave-serial.txt | 1 - Bindings/gpio/gpio-74x164.txt | 3 + Bindings/gpio/gpio-aspeed.txt | 2 +- Bindings/gpio/gpio-davinci.txt | 91 ++- Bindings/gpio/gpio-mpc8xxx.txt | 1 - Bindings/gpio/gpio-vf610.txt | 4 +- Bindings/gpio/renesas,gpio-rcar.txt | 16 +- Bindings/gpio/spear_spics.txt | 1 - Bindings/gpu/arm,mali-midgard.txt | 1 + Bindings/gpu/arm,mali-utgard.txt | 5 + Bindings/gpu/nvidia,gk20a.txt | 3 - Bindings/gpu/samsung-g2d.txt | 1 - Bindings/hsi/omap-ssi.txt | 1 - Bindings/hwmon/aspeed-pwm-tacho.txt | 9 + Bindings/hwmon/ibm,cffps1.txt | 21 + Bindings/hwmon/ltq-cputemp.txt | 10 + Bindings/i2c/i2c-altera.txt | 39 ++ Bindings/i2c/i2c-cbus-gpio.txt | 4 +- Bindings/i2c/i2c-demux-pinctrl.txt | 1 - Bindings/i2c/i2c-efm32.txt | 1 - Bindings/i2c/i2c-mtk.txt | 15 +- Bindings/i2c/i2c-rcar.txt | 5 +- Bindings/i2c/i2c-rk3x.txt | 1 + Bindings/i2c/i2c-sh_mobile.txt | 5 +- Bindings/i2c/i2c-sprd.txt | 31 + Bindings/i2c/i2c-stm32.txt | 29 +- Bindings/i2c/nvidia,tegra20-i2c.txt | 1 - Bindings/iio/adc/at91-sama5d2_adc.txt | 6 + Bindings/iio/adc/brcm,iproc-static-adc.txt | 1 - Bindings/iio/adc/lpc1850-adc.txt | 1 - Bindings/iio/adc/mt6577_auxadc.txt | 1 + Bindings/iio/adc/rockchip-saradc.txt | 1 + Bindings/iio/adc/st,stm32-adc.txt | 5 + Bindings/iio/counter/stm32-lptimer-cnt.txt | 27 + Bindings/iio/dac/lpc1850-dac.txt | 1 - Bindings/iio/dac/st,stm32-dac.txt | 4 +- Bindings/iio/humidity/hdc100x.txt | 17 + Bindings/iio/humidity/hts221.txt | 11 +- Bindings/iio/humidity/htu21.txt | 13 + Bindings/iio/imu/st_lsm6dsx.txt | 8 + Bindings/iio/pressure/ms5637.txt | 17 + Bindings/iio/proximity/as3935.txt | 5 + Bindings/iio/st-sensors.txt | 3 + Bindings/iio/temperature/tsys01.txt | 19 + Bindings/iio/timer/stm32-lptimer-trigger.txt | 23 + Bindings/iio/timer/stm32-timer-trigger.txt | 6 +- Bindings/input/atmel,maxtouch.txt | 2 + Bindings/input/brcm,bcm-keypad.txt | 1 - Bindings/input/pwm-vibrator.txt | 66 ++ Bindings/input/ti,drv260x.txt | 2 +- .../input/touchscreen/colibri-vf50-ts.txt | 1 - Bindings/input/touchscreen/imx6ul_tsc.txt | 1 - Bindings/interrupt-controller/arm,gic-v3.txt | 6 +- .../interrupt-controller/fsl,ls-scfg-msi.txt | 8 +- .../interrupt-controller/mediatek,sysirq.txt | 1 + .../socionext,uniphier-aidet.txt | 32 + Bindings/iommu/qcom,iommu.txt | 121 ++++ Bindings/iommu/rockchip,iommu.txt | 5 + Bindings/leds/ams,as3645a.txt | 79 +++ Bindings/leds/irled/gpio-ir-tx.txt | 14 + Bindings/leds/irled/pwm-ir-tx.txt | 13 + Bindings/leds/leds-gpio.txt | 3 + Bindings/leds/leds-pca955x.txt | 88 +++ Bindings/media/i2c/adv748x.txt | 95 +++ Bindings/media/i2c/dongwoon,dw9714.txt | 9 + Bindings/media/meson-ao-cec.txt | 28 + Bindings/media/mtk-cir.txt | 8 +- Bindings/media/pxa-camera.txt | 1 - Bindings/media/qcom,camss.txt | 197 ++++++ Bindings/media/renesas,drif.txt | 1 + Bindings/media/s5p-cec.txt | 1 - Bindings/media/samsung-fimc.txt | 2 - Bindings/media/stih407-c8sectpfe.txt | 1 - Bindings/media/ti,da850-vpif.txt | 1 - Bindings/media/video-interfaces.txt | 8 +- Bindings/media/zx-irdec.txt | 14 + .../memory-controllers/mediatek,smi-larb.txt | 15 + Bindings/memory-controllers/mvebu-devbus.txt | 1 - Bindings/mfd/act8945a.txt | 2 - Bindings/mfd/atmel-hlcdc.txt | 1 - Bindings/mfd/atmel-smc.txt | 1 + Bindings/mfd/axp20x.txt | 50 +- Bindings/mfd/bd9571mwv.txt | 49 ++ Bindings/mfd/da9052-i2c.txt | 9 +- Bindings/mfd/mc13xxx.txt | 1 - Bindings/mfd/mxs-lradc.txt | 2 - Bindings/mfd/retu.txt | 25 + Bindings/mfd/rk808.txt | 22 +- Bindings/mfd/samsung,exynos5433-lpass.txt | 2 - Bindings/mfd/stm32-lptimer.txt | 48 ++ Bindings/mfd/tps6105x.txt | 17 + Bindings/mfd/wm831x.txt | 1 + Bindings/mfd/zii,rave-sp.txt | 39 ++ Bindings/mips/lantiq/fpi-bus.txt | 31 + Bindings/mips/lantiq/rcu-gphy.txt | 36 + Bindings/mips/lantiq/rcu.txt | 89 +++ Bindings/mips/ni.txt | 7 + Bindings/mips/ralink.txt | 1 + Bindings/misc/atmel-ssc.txt | 1 - Bindings/mmc/arasan,sdhci.txt | 1 - Bindings/mmc/davinci_mmc.txt | 1 - Bindings/mmc/fsl-imx-mmc.txt | 1 - Bindings/mmc/marvell,xenon-sdhci.txt | 12 +- Bindings/mmc/mmc-card.txt | 1 - Bindings/mmc/mmc.txt | 1 - Bindings/mmc/orion-sdio.txt | 1 - Bindings/mmc/renesas,mmcif.txt | 4 +- Bindings/mmc/rockchip-dw-mshc.txt | 1 + Bindings/mmc/sdhci-st.txt | 3 - Bindings/mmc/sunxi-mmc.txt | 1 + Bindings/mmc/ti-omap-hsmmc.txt | 52 +- Bindings/mmc/tmio_mmc.txt | 8 +- Bindings/mmc/zx-dw-mshc.txt | 1 - Bindings/mtd/atmel-quadspi.txt | 1 - Bindings/mtd/mtk-quadspi.txt | 1 - Bindings/mtd/qcom_nandc.txt | 65 +- Bindings/mtd/st-fsm.txt | 1 - Bindings/mtd/sunxi-nand.txt | 1 - Bindings/net/anarion-gmac.txt | 25 + Bindings/net/brcm,amac.txt | 1 - Bindings/net/broadcom-bluetooth.txt | 35 + Bindings/net/btusb.txt | 1 - Bindings/net/can/c_can.txt | 13 +- Bindings/net/can/m_can.txt | 1 - Bindings/net/dsa/ksz.txt | 2 - Bindings/net/dsa/lan9303.txt | 3 - Bindings/net/ethernet.txt | 4 + Bindings/net/ftgmac100.txt | 1 - Bindings/net/marvell-armada-370-neta.txt | 1 - Bindings/net/marvell-bt-8xxx.txt | 2 - Bindings/net/marvell-neta-bm.txt | 2 - Bindings/net/marvell-pp2.txt | 42 +- Bindings/net/mediatek-net.txt | 18 +- Bindings/net/meson-dwmac.txt | 1 - Bindings/net/micrel-ksz90x1.txt | 1 - Bindings/net/microchip,enc28j60.txt | 1 - Bindings/net/nfc/nfcmrvl.txt | 2 - Bindings/net/nfc/nxp-nci.txt | 1 - Bindings/net/nfc/pn533-i2c.txt | 1 - Bindings/net/nfc/pn544.txt | 1 - Bindings/net/nfc/s3fwrn5.txt | 1 - Bindings/net/nfc/st-nci-i2c.txt | 1 - Bindings/net/nfc/st-nci-spi.txt | 1 - Bindings/net/nfc/st21nfca.txt | 1 - Bindings/net/nfc/st95hf.txt | 2 - Bindings/net/nfc/trf7970a.txt | 2 - Bindings/net/oxnas-dwmac.txt | 1 - Bindings/net/phy.txt | 15 +- Bindings/net/qca,qca7000.txt | 2 - Bindings/net/renesas,ravb.txt | 30 +- Bindings/net/rockchip-dwmac.txt | 3 +- Bindings/net/sff,sfp.txt | 76 ++ Bindings/net/smsc-lan87xx.txt | 1 - Bindings/net/socfpga-dwmac.txt | 1 - Bindings/net/sti-dwmac.txt | 1 - Bindings/net/stm32-dwmac.txt | 1 - Bindings/net/wireless/brcm,bcm43xx-fmac.txt | 1 - Bindings/net/wireless/esp,esp8089.txt | 1 - Bindings/net/wireless/marvell-8xxx.txt | 1 - Bindings/net/wireless/ti,wlcore.txt | 1 - Bindings/net/xilinx_axienet.txt | 55 ++ Bindings/nvmem/mtk-efuse.txt | 5 +- Bindings/nvmem/mxs-ocotp.txt | 1 - Bindings/opp/opp.txt | 1 - Bindings/pci/83xx-512x-pci.txt | 6 +- Bindings/pci/aardvark-pci.txt | 1 - Bindings/pci/altera-pcie.txt | 18 +- Bindings/pci/axis,artpec6-pcie.txt | 2 +- Bindings/pci/designware-pcie.txt | 24 +- Bindings/pci/fsl,imx6q-pcie.txt | 2 +- Bindings/pci/hisilicon-pcie.txt | 6 +- Bindings/pci/kirin-pcie.txt | 8 +- Bindings/pci/layerscape-pci.txt | 4 +- Bindings/pci/mediatek,mt7623-pcie.txt | 130 ---- Bindings/pci/mediatek-pcie.txt | 284 ++++++++ Bindings/pci/mvebu-pci.txt | 15 +- Bindings/pci/pci-armada8k.txt | 3 +- Bindings/pci/pci-keystone.txt | 15 +- Bindings/pci/pci-rcar-gen2.txt | 7 +- Bindings/pci/pci.txt | 4 +- Bindings/pci/qcom,pcie.txt | 27 +- Bindings/pci/ralink,rt3883-pci.txt | 2 +- Bindings/pci/rcar-pci.txt | 8 +- Bindings/pci/rockchip-pcie.txt | 28 +- Bindings/pci/samsung,exynos5440-pcie.txt | 22 +- Bindings/pci/spear13xx-pcie.txt | 6 +- Bindings/pci/ti-pci.txt | 8 +- Bindings/pci/versatile.txt | 2 +- Bindings/pci/xgene-pci-msi.txt | 6 +- Bindings/pci/xgene-pci.txt | 8 +- Bindings/pci/xilinx-nwl-pcie.txt | 7 +- Bindings/phy/apm-xgene-phy.txt | 3 - Bindings/phy/keystone-usb-phy.txt | 1 - Bindings/phy/phy-bindings.txt | 4 +- Bindings/phy/phy-lantiq-rcu-usb2.txt | 40 ++ .../{phy-mt65xx-usb.txt => phy-mtk-tphy.txt} | 21 +- Bindings/phy/phy-mvebu-comphy.txt | 43 ++ Bindings/phy/phy-mvebu.txt | 1 - Bindings/phy/phy-rockchip-inno-usb2.txt | 13 +- Bindings/phy/qcom-dwc3-usb-phy.txt | 2 - Bindings/phy/qcom-qmp-phy.txt | 11 + Bindings/phy/ralink-usb-phy.txt | 23 + Bindings/phy/rockchip-pcie-phy.txt | 7 +- Bindings/phy/samsung-phy.txt | 1 - Bindings/phy/sun4i-usb-phy.txt | 10 +- Bindings/phy/sun9i-usb-phy.txt | 1 - Bindings/pinctrl/atmel,at91-pinctrl.txt | 1 - Bindings/pinctrl/cortina,gemini-pinctrl.txt | 59 ++ Bindings/pinctrl/fsl,imx-pinctrl.txt | 1 - Bindings/pinctrl/fsl,imx7d-pinctrl.txt | 1 - Bindings/pinctrl/fsl,imx7ulp-pinctrl.txt | 61 ++ .../pinctrl/nvidia,tegra124-dpaux-padctl.txt | 1 - Bindings/pinctrl/oxnas,pinctrl.txt | 1 - Bindings/pinctrl/pinctrl-aspeed.txt | 8 +- Bindings/pinctrl/pinctrl-bindings.txt | 2 + Bindings/pinctrl/pinctrl-mt65xx.txt | 1 + Bindings/pinctrl/pinctrl-rk805.txt | 63 ++ Bindings/pinctrl/pinctrl-zx.txt | 1 - Bindings/pinctrl/qcom,apq8064-pinctrl.txt | 3 +- Bindings/pinctrl/qcom,ipq4019-pinctrl.txt | 6 +- Bindings/pinctrl/qcom,pmic-gpio.txt | 26 +- Bindings/pinctrl/renesas,pfc-pinctrl.txt | 4 +- Bindings/pinctrl/rockchip,pinctrl.txt | 2 +- Bindings/pinctrl/sprd,pinctrl.txt | 83 +++ Bindings/pinctrl/sprd,sc9860-pinctrl.txt | 70 ++ Bindings/pinctrl/st,stm32-pinctrl.txt | 1 - Bindings/power/power-controller.txt | 1 - Bindings/power/renesas,apmu.txt | 3 +- Bindings/power/renesas,rcar-sysc.txt | 1 + Bindings/power/reset/st-reset.txt | 1 - Bindings/power/rockchip-io-domain.txt | 2 + Bindings/power/supply/act8945a-charger.txt | 2 - Bindings/power/supply/bq24190.txt | 51 ++ Bindings/power/supply/ltc2941.txt | 15 +- Bindings/power/supply/max8903-charger.txt | 1 - Bindings/power/supply/maxim,max14656.txt | 1 - Bindings/power/wakeup-source.txt | 9 +- Bindings/powerpc/ibm,vas.txt | 22 + Bindings/powerpc/opal/sensor-groups.txt | 27 + Bindings/pps/pps-gpio.txt | 8 +- Bindings/ptp/brcm,ptp-dte.txt | 1 - Bindings/pwm/pwm-bcm2835.txt | 4 +- Bindings/pwm/pwm-mediatek.txt | 6 +- Bindings/pwm/pwm-meson.txt | 1 - Bindings/pwm/pwm-rockchip.txt | 11 +- Bindings/pwm/pwm-stm32-lp.txt | 24 + Bindings/pwm/pwm-sun4i.txt | 1 - Bindings/pwm/pwm-tiecap.txt | 1 + Bindings/pwm/pwm-tipwmss.txt | 2 - Bindings/pwm/pwm-zx.txt | 22 + Bindings/pwm/renesas,tpu-pwm.txt | 1 - Bindings/regulator/act8865-regulator.txt | 1 - Bindings/regulator/act8945a-regulator.txt | 1 - Bindings/regulator/mt6311-regulator.txt | 2 +- Bindings/regulator/mt6323-regulator.txt | 2 +- Bindings/regulator/mt6380-regulator.txt | 89 +++ Bindings/regulator/mt6397-regulator.txt | 2 +- Bindings/regulator/pwm-regulator.txt | 2 +- Bindings/regulator/st,stm32-vrefbuf.txt | 20 + Bindings/remoteproc/imx-rproc.txt | 33 + Bindings/remoteproc/qcom,adsp.txt | 7 +- Bindings/remoteproc/qcom,q6v5.txt | 5 + Bindings/remoteproc/ti,davinci-rproc.txt | 86 +++ Bindings/remoteproc/ti,keystone-rproc.txt | 73 +- Bindings/reset/lantiq,reset.txt | 30 + Bindings/reset/nxp,lpc1850-rgu.txt | 1 - Bindings/reset/renesas,rst.txt | 1 + Bindings/reset/snps,hsdk-reset.txt | 28 + Bindings/reset/uniphier-reset.txt | 27 +- Bindings/rng/imx-rngc.txt | 21 + Bindings/rtc/google,goldfish-rtc.txt | 17 + Bindings/rtc/isil,isl12057.txt | 1 - Bindings/rtc/realtek,rtd119x.txt | 16 + Bindings/rtc/st,stm32-rtc.txt | 1 - Bindings/rtc/sun6i-rtc.txt | 4 +- Bindings/scsi/hisilicon-sas.txt | 1 - Bindings/security/tpm/st33zp24-i2c.txt | 1 - Bindings/security/tpm/st33zp24-spi.txt | 1 - Bindings/security/tpm/tpm-i2c.txt | 7 +- Bindings/security/tpm/tpm_tis_spi.txt | 1 - Bindings/serial/8250.txt | 2 + Bindings/serial/arc-uart.txt | 1 - Bindings/serial/axis,etraxfs-uart.txt | 1 - Bindings/serial/mtk-uart.txt | 1 + Bindings/serial/nvidia,tegra20-hsuart.txt | 1 - Bindings/serial/qcom,msm-uartdm.txt | 3 - Bindings/serial/renesas,sci-serial.txt | 4 + Bindings/serial/rs485.txt | 5 +- Bindings/serial/serial.txt | 2 - Bindings/serial/st,stm32-usart.txt | 17 +- Bindings/serio/allwinner,sun4i-ps2.txt | 1 - Bindings/serio/ps2-gpio.txt | 23 + Bindings/soc/mediatek/scpsys.txt | 3 + Bindings/soc/qcom/qcom,glink.txt | 13 +- Bindings/soc/qcom/qcom,gsbi.txt | 1 - Bindings/soc/rockchip/grf.txt | 3 + Bindings/soc/rockchip/power_domain.txt | 3 + Bindings/soc/ti/sci-pm-domain.txt | 5 +- Bindings/sound/armada-370db-audio.txt | 1 - Bindings/sound/atmel-classd.txt | 9 +- Bindings/sound/axentia,tse850-pcm5142.txt | 1 - Bindings/sound/brcm,cygnus-audio.txt | 4 - Bindings/sound/cs43130.txt | 67 ++ Bindings/sound/davinci-mcbsp.txt | 1 - Bindings/sound/dmic.txt | 16 + Bindings/sound/fsl,asrc.txt | 1 - Bindings/sound/fsl,esai.txt | 1 - Bindings/sound/fsl,spdif.txt | 1 - Bindings/sound/hdmi.txt | 1 - Bindings/sound/mt2701-afe-pcm.txt | 4 +- Bindings/sound/qcom,msm8916-wcd-analog.txt | 18 +- Bindings/sound/renesas,rsnd.txt | 70 +- Bindings/sound/rockchip,pdm.txt | 8 +- Bindings/sound/rockchip,rk3399-gru-sound.txt | 2 +- Bindings/sound/rockchip-i2s.txt | 4 + Bindings/sound/rockchip-spdif.txt | 1 - Bindings/sound/rt274.txt | 33 + Bindings/sound/rt5663.txt | 8 + Bindings/sound/samsung,odroid.txt | 6 - Bindings/sound/simple-card.txt | 3 + Bindings/sound/simple-scu-card.txt | 1 + Bindings/sound/st,sti-asoc-card.txt | 5 - Bindings/sound/sun4i-i2s.txt | 2 + Bindings/sound/sunxi,sun4i-spdif.txt | 1 - Bindings/sound/tas5720.txt | 1 - Bindings/sound/tlv320aic32x4.txt | 13 +- Bindings/sound/tlv320aic3x.txt | 5 + Bindings/sound/wm8524.txt | 16 + Bindings/sound/zte,zx-i2s.txt | 1 - Bindings/sound/zte,zx-spdif.txt | 1 - Bindings/spi/efm32-spi.txt | 2 - Bindings/spi/fsl-imx-cspi.txt | 1 + Bindings/spi/nvidia,tegra114-spi.txt | 1 - Bindings/spi/nvidia,tegra20-sflash.txt | 1 - Bindings/spi/nvidia,tegra20-slink.txt | 1 - Bindings/spi/sh-hspi.txt | 1 - Bindings/spi/sh-msiof.txt | 2 +- Bindings/spi/spi-clps711x.txt | 1 - Bindings/spi/spi-fsl-dspi.txt | 1 - Bindings/spi/spi-mt65xx.txt | 1 - Bindings/spi/spi-orion.txt | 2 - Bindings/spi/spi-rockchip.txt | 1 + Bindings/spi/spi-sun4i.txt | 1 - Bindings/spi/spi-sun6i.txt | 1 - Bindings/spi/spi_atmel.txt | 1 - Bindings/sram/renesas,smp-sram.txt | 27 + Bindings/sram/sunxi-sram.txt | 10 +- Bindings/thermal/armada-thermal.txt | 1 - Bindings/thermal/exynos-thermal.txt | 1 - Bindings/thermal/mediatek-thermal.txt | 1 + Bindings/thermal/rcar-gen3-thermal.txt | 1 - Bindings/thermal/rockchip-thermal.txt | 1 + Bindings/thermal/uniphier-thermal.txt | 64 ++ Bindings/timer/nxp,tpm-timer.txt | 28 + Bindings/timer/renesas,cmt.txt | 75 +- Bindings/trivial-devices.txt | 14 + Bindings/unittest.txt | 5 - Bindings/usb/allwinner,sun4i-a10-musb.txt | 1 - Bindings/usb/am33xx-usb.txt | 4 +- Bindings/usb/brcm,bdc.txt | 29 + Bindings/usb/da8xx-usb.txt | 2 - Bindings/usb/dwc3-st.txt | 1 - Bindings/usb/dwc3-xilinx.txt | 1 - Bindings/usb/ehci-st.txt | 1 - Bindings/usb/exynos-usb.txt | 2 - Bindings/usb/fcs,fusb302.txt | 29 + Bindings/usb/isp1301.txt | 1 - Bindings/usb/keystone-usb.txt | 18 +- ...{mt8173-xhci.txt => mediatek,mtk-xhci.txt} | 14 +- .../{mt8173-mtu3.txt => mediatek,mtu3.txt} | 10 +- Bindings/usb/ohci-st.txt | 1 - Bindings/usb/qcom,dwc3.txt | 3 - Bindings/usb/renesas_usb3.txt | 16 +- Bindings/usb/rockchip,dwc3.txt | 4 - Bindings/usb/usb-device.txt | 3 +- Bindings/vendor-prefixes.txt | 13 +- Bindings/w1/fsl-imx-owire.txt | 1 - Bindings/watchdog/aspeed-wdt.txt | 40 ++ Bindings/watchdog/atmel-sama5d4-wdt.txt | 1 - Bindings/watchdog/atmel-wdt.txt | 1 - Bindings/watchdog/lantiq-wdt.txt | 24 + Bindings/watchdog/marvel.txt | 1 - Bindings/watchdog/meson-wdt.txt | 6 +- Bindings/watchdog/mtk-wdt.txt | 8 +- Bindings/watchdog/renesas-wdt.txt | 1 + Bindings/xilinx.txt | 2 + include/dt-bindings/clock/berlin2.h | 1 + include/dt-bindings/clock/berlin2q.h | 1 + .../dt-bindings/clock/cortina,gemini-clock.h | 1 + include/dt-bindings/clock/efm32-cmu.h | 1 + include/dt-bindings/clock/exynos-audss-clk.h | 1 + include/dt-bindings/clock/gxbb-aoclkc.h | 1 + include/dt-bindings/clock/gxbb-clkc.h | 64 ++ include/dt-bindings/clock/jz4740-cgu.h | 1 + include/dt-bindings/clock/jz4780-cgu.h | 1 + include/dt-bindings/clock/marvell,mmp2.h | 1 + include/dt-bindings/clock/marvell,pxa168.h | 1 + include/dt-bindings/clock/marvell,pxa1928.h | 1 + include/dt-bindings/clock/marvell,pxa910.h | 1 + include/dt-bindings/clock/meson8b-clkc.h | 71 ++ include/dt-bindings/clock/mpc512x-clock.h | 1 + include/dt-bindings/clock/qcom,gcc-msm8996.h | 2 + include/dt-bindings/clock/r8a77995-cpg-mssr.h | 57 ++ include/dt-bindings/clock/rk3228-cru.h | 1 + include/dt-bindings/clock/rockchip,rk808.h | 1 + include/dt-bindings/clock/rv1108-cru.h | 125 +++- include/dt-bindings/clock/ste-ab8500.h | 1 + include/dt-bindings/clock/stih407-clks.h | 1 + include/dt-bindings/clock/stih410-clks.h | 1 + include/dt-bindings/clock/stih416-clks.h | 1 + include/dt-bindings/clock/stih418-clks.h | 1 + include/dt-bindings/clock/stm32h7-clks.h | 165 +++++ include/dt-bindings/clock/sun4i-a10-ccu.h | 200 ++++++ include/dt-bindings/clock/sun7i-a20-ccu.h | 53 ++ include/dt-bindings/clock/sun8i-r40-ccu.h | 187 +++++ include/dt-bindings/clock/tegra114-car.h | 1 + .../dt-bindings/clock/tegra124-car-common.h | 1 + include/dt-bindings/clock/tegra124-car.h | 1 + include/dt-bindings/clock/tegra186-clock.h | 1 + include/dt-bindings/clock/tegra20-car.h | 1 + include/dt-bindings/clock/tegra210-car.h | 1 + include/dt-bindings/clock/tegra30-car.h | 1 + include/dt-bindings/display/tda998x.h | 1 + include/dt-bindings/genpd/k2g.h | 90 --- include/dt-bindings/gpio/gpio.h | 1 + include/dt-bindings/gpio/tegra-gpio.h | 1 + include/dt-bindings/gpio/tegra186-gpio.h | 1 + include/dt-bindings/iio/adc/fsl-imx25-gcq.h | 1 + include/dt-bindings/iio/adi,ad5592r.h | 1 + include/dt-bindings/input/input.h | 1 + include/dt-bindings/input/linux-event-codes.h | 1 + .../interrupt-controller/arm-gic.h | 1 + .../dt-bindings/interrupt-controller/irq.h | 1 + .../interrupt-controller/mips-gic.h | 1 + .../interrupt-controller/mvebu-icu.h | 1 + include/dt-bindings/leds/common.h | 1 + include/dt-bindings/leds/leds-ns2.h | 1 + include/dt-bindings/leds/leds-pca955x.h | 16 + include/dt-bindings/mailbox/tegra186-hsp.h | 1 + include/dt-bindings/media/c8sectpfe.h | 1 + include/dt-bindings/memory/mt8173-larb-port.h | 4 - include/dt-bindings/memory/tegra114-mc.h | 1 + include/dt-bindings/memory/tegra124-mc.h | 1 + include/dt-bindings/memory/tegra210-mc.h | 1 + include/dt-bindings/memory/tegra30-mc.h | 1 + include/dt-bindings/mfd/as3722.h | 1 + include/dt-bindings/mfd/dbx500-prcmu.h | 1 + include/dt-bindings/mfd/max77620.h | 1 + include/dt-bindings/mfd/palmas.h | 1 + include/dt-bindings/mfd/qcom-rpm.h | 1 + include/dt-bindings/mfd/st-lpc.h | 1 + include/dt-bindings/mfd/stm32f4-rcc.h | 1 + include/dt-bindings/mfd/stm32f7-rcc.h | 1 + include/dt-bindings/mfd/stm32h7-rcc.h | 136 ++++ include/dt-bindings/mips/lantiq_rcu_gphy.h | 15 + include/dt-bindings/mux/mux.h | 1 + include/dt-bindings/pinctrl/am33xx.h | 1 + include/dt-bindings/pinctrl/am43xx.h | 1 + include/dt-bindings/pinctrl/dm814x.h | 1 + include/dt-bindings/pinctrl/dra.h | 3 + include/dt-bindings/pinctrl/mt6397-pinfunc.h | 1 + include/dt-bindings/pinctrl/mt7623-pinfunc.h | 1 + include/dt-bindings/pinctrl/omap.h | 1 + .../dt-bindings/pinctrl/pinctrl-tegra-xusb.h | 1 + include/dt-bindings/pinctrl/qcom,pmic-gpio.h | 3 + include/dt-bindings/pinctrl/qcom,pmic-mpp.h | 1 + .../dt-bindings/pinctrl/r7s72100-pinctrl.h | 1 + include/dt-bindings/pinctrl/samsung.h | 3 +- .../dt-bindings/pinctrl/stm32f429-pinfunc.h | 1 + .../dt-bindings/pinctrl/stm32f746-pinfunc.h | 1 + include/dt-bindings/pinctrl/stm32h7-pinfunc.h | 1 + include/dt-bindings/power/mt7622-power.h | 22 + include/dt-bindings/power/mt8173-power.h | 1 + include/dt-bindings/power/r8a77995-sysc.h | 23 + include/dt-bindings/power/rk3288-power.h | 1 + include/dt-bindings/power/rk3328-power.h | 1 + include/dt-bindings/power/rk3366-power.h | 24 + include/dt-bindings/power/rk3368-power.h | 1 + include/dt-bindings/power/rk3399-power.h | 1 + include/dt-bindings/pwm/pwm.h | 1 + .../reset/amlogic,meson8b-clkc-reset.h | 27 + .../dt-bindings/reset/cortina,gemini-reset.h | 1 + .../dt-bindings/reset/hisi,hi6220-resets.h | 1 + include/dt-bindings/reset/pistachio-resets.h | 1 + include/dt-bindings/reset/snps,hsdk-reset.h | 17 + include/dt-bindings/reset/stih407-resets.h | 1 + include/dt-bindings/reset/stih415-resets.h | 1 + include/dt-bindings/reset/stih416-resets.h | 1 + include/dt-bindings/reset/sun4i-a10-ccu.h | 69 ++ include/dt-bindings/reset/sun8i-r40-ccu.h | 130 ++++ include/dt-bindings/reset/tegra124-car.h | 1 + include/dt-bindings/reset/tegra210-car.h | 1 + include/dt-bindings/soc/rockchip,boot-mode.h | 1 + include/dt-bindings/sound/apq8016-lpass.h | 1 + include/dt-bindings/sound/audio-jack-events.h | 1 + include/dt-bindings/sound/cs35l32.h | 1 + include/dt-bindings/sound/fsl-imx-audmux.h | 1 + include/dt-bindings/sound/samsung-i2s.h | 1 + include/dt-bindings/sound/tas2552.h | 1 + .../dt-bindings/sound/tlv320aic31xx-micbias.h | 1 + include/dt-bindings/thermal/lm90.h | 1 + .../dt-bindings/thermal/tegra124-soctherm.h | 1 + scripts/cronjob | 14 +- scripts/filter.sh | 3 +- scripts/flatten-symlinks.sh | 31 - scripts/git-filter-branch | 557 --------------- scripts/index-filter.sh | 6 +- scripts/merge-new-release.sh | 30 +- scripts/rewrite-index.pl | 72 ++ scripts/rewrite-paths.sed | 38 - src/arc/axc001.dtsi | 2 +- src/arc/axc003.dtsi | 13 +- src/arc/axc003_idu.dtsi | 13 +- src/arc/axs10x_mb.dtsi | 10 +- src/arc/hsdk.dts | 216 ++++++ src/arc/nsim_hs.dts | 2 +- src/arc/vdk_axs10x_mb.dtsi | 1 - src/arm/am335x-bone-common.dtsi | 3 - src/arm/am335x-chiliboard.dts | 3 - src/arm/am335x-evm.dts | 1 + src/arm/am335x-moxa-uc-8100-me-t.dts | 525 ++++++++++++++ src/arm/am33xx.dtsi | 2 + src/arm/am437x-gp-evm.dts | 15 + src/arm/am43x-epos-evm.dts | 7 +- src/arm/am571x-idk.dts | 35 +- src/arm/am572x-idk.dts | 34 +- src/arm/am57xx-beagle-x15-common.dtsi | 36 +- src/arm/am57xx-beagle-x15-revb1.dts | 17 +- src/arm/am57xx-beagle-x15-revc.dts | 39 ++ src/arm/am57xx-beagle-x15.dts | 11 + src/arm/am57xx-commercial-grade.dtsi | 1 + src/arm/am57xx-idk-common.dtsi | 8 + src/arm/am57xx-industrial-grade.dtsi | 1 + src/arm/armada-370.dtsi | 4 +- src/arm/armada-375.dtsi | 8 +- src/arm/armada-380.dtsi | 5 +- src/arm/armada-385-db-ap.dts | 2 +- src/arm/armada-385-turris-omnia.dts | 2 +- src/arm/armada-385.dtsi | 6 +- src/arm/armada-388-clearfog.dts | 2 +- src/arm/armada-388-clearfog.dtsi | 2 +- src/arm/armada-388-db.dts | 2 +- src/arm/armada-388-gp.dts | 2 +- src/arm/armada-388-rd.dts | 2 +- src/arm/armada-38x.dtsi | 15 +- src/arm/armada-390-db.dts | 2 +- src/arm/armada-395-gp.dts | 2 +- src/arm/armada-398-db.dts | 2 +- src/arm/armada-39x.dtsi | 10 +- src/arm/armada-xp-98dx3236.dtsi | 3 +- src/arm/armada-xp-db.dts | 2 +- src/arm/armada-xp-gp.dts | 2 +- src/arm/armada-xp-mv78230.dtsi | 7 +- src/arm/armada-xp-mv78260.dtsi | 11 +- src/arm/armada-xp-mv78460.dtsi | 14 +- src/arm/armv7-m.dtsi | 1 + src/arm/aspeed-ast2500-evb.dts | 1 + src/arm/aspeed-bmc-opp-palmetto.dts | 1 + src/arm/aspeed-bmc-opp-romulus.dts | 1 + src/arm/aspeed-g4.dtsi | 5 +- src/arm/aspeed-g5.dtsi | 1 + src/arm/at91-ariettag25.dts | 1 + src/arm/at91-sama5d27_som1.dtsi | 102 +++ src/arm/at91-sama5d27_som1_ek.dts | 540 +++++++++++++++ src/arm/at91-sama5d2_xplained.dts | 55 +- src/arm/at91sam9g45.dtsi | 21 + src/arm/at91sam9m10g45ek.dts | 4 + src/arm/bcm-cygnus.dtsi | 149 +++- src/arm/bcm-nsp.dtsi | 59 +- src/arm/bcm2835-rpi-a-plus.dts | 7 + src/arm/bcm2835-rpi-a.dts | 7 + src/arm/bcm2835-rpi-b-plus.dts | 7 + src/arm/bcm2835-rpi-b-rev2.dts | 7 + src/arm/bcm2835-rpi-b.dts | 7 + src/arm/bcm2835-rpi-zero-w.dts | 136 ++++ src/arm/bcm2835-rpi-zero.dts | 6 + src/arm/bcm2835-rpi.dtsi | 2 +- src/arm/bcm2835.dtsi | 1 + src/arm/bcm2836-rpi-2-b.dts | 7 + src/arm/bcm2836.dtsi | 2 + src/arm/bcm2837-rpi-3-b.dts | 58 +- src/{arm64/broadcom => arm}/bcm2837.dtsi | 1 + src/arm/bcm283x-rpi-smsc9512.dtsi | 1 + src/arm/bcm283x-rpi-usb-otg.dtsi | 1 + src/arm/bcm283x.dtsi | 7 +- src/arm/bcm4708-buffalo-wzr-1750dhp.dts | 4 + src/arm/bcm4708-netgear-r6250.dts | 3 + src/arm/bcm4708-smartrg-sr400ac.dts | 6 + src/arm/bcm47081-tplink-archer-c5-v2.dts | 4 + src/arm/bcm4709-tplink-archer-c9-v1.dts | 5 + src/arm/bcm47094-dlink-dir-885l.dts | 3 + src/arm/bcm47094-luxul-xwr-3100.dts | 3 + src/arm/bcm47189-tenda-ac9.dts | 2 + src/arm/bcm5301x.dtsi | 34 + src/arm/bcm53573.dtsi | 4 + src/arm/bcm63138.dtsi | 1 + src/arm/bcm7445-bcm97445svmb.dts | 1 + src/arm/bcm7445.dtsi | 1 + src/arm/bcm911360_entphn.dts | 7 +- src/arm/bcm947189acdbmr.dts | 97 +++ src/arm/bcm958522er.dts | 8 + src/arm/bcm958525er.dts | 8 + src/arm/bcm958525xmc.dts | 8 + src/arm/bcm958622hr.dts | 8 + src/arm/bcm958623hr.dts | 8 + src/arm/bcm958625hr.dts | 8 + src/arm/bcm958625k.dts | 8 + src/arm/bcm963138dvt.dts | 1 + src/arm/da850-evm.dts | 7 + src/arm/da850-lego-ev3.dts | 24 + src/arm/dove-cubox-es.dts | 1 + src/arm/dove-cubox.dts | 1 + src/arm/dove-d2plug.dts | 1 + src/arm/dove-d3plug.dts | 5 +- src/arm/dove-dove-db.dts | 1 + src/arm/dove.dtsi | 9 +- src/arm/dra7-evm-common.dtsi | 258 +++++++ src/arm/dra7-evm.dts | 277 +------- src/arm/dra7.dtsi | 36 +- src/arm/dra71-evm.dts | 32 +- src/arm/dra72-evm-common.dtsi | 7 +- src/arm/dra72-evm-revc.dts | 34 + src/arm/dra72-evm-tps65917.dtsi | 2 +- src/arm/dra72-evm.dts | 32 + src/arm/dra72x-mmc-iodelay.dtsi | 350 ++++++++++ src/arm/dra74x-mmc-iodelay.dtsi | 647 ++++++++++++++++++ src/arm/dra76-evm.dts | 423 ++++++++++++ src/arm/dra76x.dtsi | 19 + src/arm/dra7xx-clocks.dtsi | 2 + src/arm/efm32gg-dk3750.dts | 1 + src/arm/efm32gg.dtsi | 1 + src/arm/elpida_ecb240abacn.dtsi | 1 + src/arm/exynos3250-artik5-eval.dts | 1 - src/arm/exynos3250-artik5.dtsi | 1 - src/arm/exynos3250-monk.dts | 1 - src/arm/exynos3250-rinato.dts | 22 - src/arm/exynos4210-trats.dts | 21 - src/arm/exynos4412-itop-scp-core.dtsi | 1 - src/arm/exynos4412-odroid-common.dtsi | 1 - src/arm/exynos4412-origen.dts | 1 - src/arm/exynos4412-trats2.dts | 22 - src/arm/exynos5250-arndale.dts | 2 - src/arm/exynos5250-smdk5250.dts | 2 - src/arm/exynos5250-snow-common.dtsi | 3 - src/arm/exynos5250-spring.dts | 2 - src/arm/exynos5260-xyref5260.dts | 2 - src/arm/exynos5410-smdk5410.dts | 2 - src/arm/exynos5420-peach-pit.dts | 3 - src/arm/exynos5440.dtsi | 2 + src/arm/exynos5800-peach-pi.dts | 3 - src/arm/gemini-dlink-dir-685.dts | 246 +++++++ src/arm/gemini-nas4220b.dts | 25 + src/arm/gemini-rut1xx.dts | 40 ++ src/arm/gemini-sq201.dts | 37 +- src/arm/gemini-wbd111.dts | 27 + src/arm/gemini-wbd222.dts | 27 + src/arm/gemini.dtsi | 177 ++++- src/arm/imx25.dtsi | 7 + src/arm/imx28-apx4devkit.dts | 1 + src/arm/imx53-cx9020.dts | 297 ++++++++ src/arm/imx53-pinfunc.h | 4 + src/arm/imx53.dtsi | 9 + src/arm/imx6dl-gw52xx.dts | 58 ++ src/arm/imx6dl-gw53xx.dts | 58 ++ src/arm/imx6dl-gw54xx.dts | 58 ++ src/arm/imx6dl-riotboard.dts | 45 ++ src/arm/imx6q-apalis-eval.dts | 278 ++++++++ src/arm/imx6q-apalis-ixora-v1.1.dts | 291 ++++++++ src/arm/imx6q-apalis-ixora.dts | 32 +- src/arm/imx6q-b850v3.dts | 2 +- src/arm/imx6q-bx50v3.dtsi | 42 ++ src/arm/imx6q-evi.dts | 16 + src/arm/imx6q-gw52xx.dts | 58 ++ src/arm/imx6q-gw53xx.dts | 58 ++ src/arm/imx6q-gw54xx.dts | 58 ++ src/arm/imx6qdl-apalis.dtsi | 44 +- src/arm/imx6qdl-dfi-fs700-m60.dtsi | 1 + src/arm/imx6qdl-gw51xx.dtsi | 54 ++ src/arm/imx6qdl-gw52xx.dtsi | 1 - src/arm/imx6qdl-gw53xx.dtsi | 1 - src/arm/imx6qdl-gw54xx.dtsi | 1 - src/arm/imx6qdl-gw553x.dtsi | 54 ++ src/arm/imx6qdl-icore-rqs.dtsi | 1 - src/arm/imx6qdl-nitrogen6x.dtsi | 19 + src/arm/imx6qdl-sabrelite.dtsi | 19 + src/arm/imx6qdl-zii-rdu2.dtsi | 112 ++- src/arm/imx6qdl.dtsi | 1 + src/arm/imx6sl.dtsi | 1 + src/arm/imx6sx.dtsi | 1 + src/arm/imx6ul-14x14-evk.dts | 40 +- src/arm/{imx6ul-geam.dtsi => imx6ul-geam.dts} | 74 ++ src/arm/imx6ul-isiot-common.dtsi | 141 ---- src/arm/imx6ul-isiot-emmc.dts | 1 - src/arm/imx6ul-isiot-nand.dts | 1 - src/arm/imx6ul-isiot.dtsi | 183 +++++ src/arm/imx6ul-liteboard.dts | 4 + src/arm/imx6ul.dtsi | 1 + src/arm/imx7-colibri.dtsi | 9 + src/arm/imx7d-sdb.dts | 93 ++- src/arm/imx7d.dtsi | 8 +- src/arm/imx7s.dtsi | 32 + src/arm/imx7ulp-pinfunc.h | 468 +++++++++++++ src/arm/integrator.dtsi | 1 + src/arm/integratorap.dts | 1 + src/arm/integratorcp.dts | 1 + src/arm/keystone-k2e-evm.dts | 18 + src/arm/keystone-k2e.dtsi | 20 + src/arm/keystone-k2g-evm.dts | 71 ++ src/arm/keystone-k2g-ice.dts | 18 + src/arm/keystone-k2g.dtsi | 204 ++++++ src/arm/keystone-k2hk-evm.dts | 53 ++ src/arm/keystone-k2hk.dtsi | 139 ++++ src/arm/keystone-k2l-evm.dts | 33 + src/arm/keystone-k2l.dtsi | 71 ++ src/arm/kirkwood-6192.dtsi | 4 +- src/arm/kirkwood-6281.dtsi | 4 +- src/arm/kirkwood-6282.dtsi | 5 +- src/arm/kirkwood-98dx4122.dtsi | 4 +- src/arm/kirkwood-cloudbox.dts | 1 + src/arm/kirkwood-dns320.dts | 1 + src/arm/kirkwood-dns325.dts | 1 + src/arm/kirkwood-dnskw.dtsi | 1 + src/arm/kirkwood-dockstar.dts | 1 + src/arm/kirkwood-dreamplug.dts | 1 + src/arm/kirkwood-goflexnet.dts | 1 + src/arm/kirkwood-guruplug-server-plus.dts | 1 + src/arm/kirkwood-ib62x0.dts | 1 + src/arm/kirkwood-iconnect.dts | 1 + src/arm/kirkwood-iomega_ix2_200.dts | 1 + src/arm/kirkwood-is2.dts | 1 + src/arm/kirkwood-km_common.dtsi | 1 + src/arm/kirkwood-km_fixedeth.dts | 1 + src/arm/kirkwood-km_kirkwood.dts | 1 + src/arm/kirkwood-lschlv2.dts | 1 + src/arm/kirkwood-lsxhl.dts | 1 + src/arm/kirkwood-lsxl.dtsi | 1 + src/arm/kirkwood-mplcec4.dts | 1 + src/arm/kirkwood-ns2-common.dtsi | 1 + src/arm/kirkwood-ns2.dts | 1 + src/arm/kirkwood-ns2lite.dts | 1 + src/arm/kirkwood-ns2max.dts | 1 + src/arm/kirkwood-ns2mini.dts | 1 + src/arm/kirkwood-nsa310.dts | 1 + src/arm/kirkwood-nsa310a.dts | 1 + src/arm/kirkwood-nsa3x0-common.dtsi | 1 + src/arm/kirkwood-openblocks_a6.dts | 1 + src/arm/kirkwood-pogoplug-series-4.dts | 1 + src/arm/kirkwood-topkick.dts | 1 + src/arm/kirkwood-ts219-6281.dts | 1 + src/arm/kirkwood-ts219-6282.dts | 1 + src/arm/kirkwood-ts219.dtsi | 1 + src/arm/kirkwood.dtsi | 1 + src/arm/logicpd-torpedo-37xx-devkit.dts | 2 +- src/arm/ls1021a.dtsi | 8 +- src/arm/meson.dtsi | 30 +- src/arm/meson6.dtsi | 28 + src/arm/meson8.dtsi | 16 + src/arm/meson8b.dtsi | 33 +- src/arm/motorola-cpcap-mapphone.dtsi | 1 + src/arm/moxart.dtsi | 3 +- src/arm/mt2701.dtsi | 106 +++ src/arm/mt6323.dtsi | 241 +++++++ src/arm/mt7623-evb.dts | 33 - src/arm/mt7623.dtsi | 211 ++++-- src/arm/mt7623n-bananapi-bpi-r2.dts | 487 +++++++++++++ src/arm/mt7623n-rfb-nand.dts | 111 +++ src/arm/mt7623n-rfb.dtsi | 92 +++ src/arm/omap-gpmc-smsc911x.dtsi | 1 + src/arm/omap-gpmc-smsc9221.dtsi | 1 + src/arm/omap-zoom-common.dtsi | 1 + src/arm/omap2420-n800.dts | 1 + src/arm/omap2420-n810-wimax.dts | 1 + src/arm/omap2420-n810.dts | 1 + src/arm/omap2420-n8x0-common.dtsi | 5 +- src/arm/omap3-beagle-xm.dts | 2 +- src/arm/omap3-beagle.dts | 2 +- src/arm/omap3-cm-t3517.dts | 3 +- src/arm/omap3-cm-t3530.dts | 1 + src/arm/omap3-cm-t3730.dts | 3 +- src/arm/omap3-cm-t3x.dtsi | 1 + src/arm/omap3-cm-t3x30.dtsi | 1 + src/arm/omap3-devkit8000-common.dtsi | 2 +- src/arm/omap3-evm-common.dtsi | 3 +- src/arm/omap3-n900.dts | 78 ++- src/arm/omap3-n950-n9.dtsi | 18 + src/arm/omap3-overo-base.dtsi | 2 +- src/arm/omap3-panel-sharp-ls037v7dw01.dtsi | 1 + src/arm/omap3-sb-t35.dtsi | 1 + src/arm/omap3-sbc-t3517.dts | 1 + src/arm/omap3-sbc-t3530.dts | 1 + src/arm/omap3-sbc-t3730.dts | 1 + src/arm/omap3-tao3530.dtsi | 2 +- src/arm/omap3-zoom3.dts | 2 +- src/arm/omap3.dtsi | 4 - src/arm/omap3430-sdp.dts | 2 +- src/arm/omap4-droid4-xt894.dts | 42 +- src/arm/omap4-duovero-parlor.dts | 2 +- src/arm/omap4-panda-common.dtsi | 2 +- src/arm/omap4-sdp-es23plus.dts | 2 +- src/arm/omap4-sdp.dts | 2 +- src/arm/omap4-var-om44customboard.dtsi | 2 +- src/arm/omap5-board-common.dtsi | 2 +- src/arm/omap5-cm-t54.dts | 3 +- src/arm/omap5-sbc-t54.dts | 1 + src/arm/pxa27x.dtsi | 1 + src/arm/pxa3xx.dtsi | 1 + .../qcom-apq8064-arrow-sd-600eval-pins.dtsi | 1 + src/arm/qcom-apq8064-arrow-sd-600eval.dts | 1 + src/arm/qcom-apq8064-asus-nexus7-flo.dts | 1 + src/arm/qcom-apq8064-cm-qs600.dts | 1 + src/arm/qcom-apq8064-ifc6410.dts | 1 + src/arm/qcom-apq8064-pins.dtsi | 1 + src/arm/qcom-apq8064-sony-xperia-yuga.dts | 1 + src/arm/qcom-apq8064-v2.0.dtsi | 1 + src/arm/qcom-apq8064.dtsi | 1 + src/arm/qcom-apq8074-dragonboard.dts | 1 + src/arm/qcom-apq8084-ifc6540.dts | 1 + src/arm/qcom-apq8084-mtp.dts | 1 + src/arm/qcom-apq8084.dtsi | 1 + src/arm/qcom-ipq4019-ap.dk01.1.dtsi | 29 +- src/arm/qcom-ipq4019.dtsi | 109 ++- src/arm/qcom-ipq8064-ap148.dts | 1 + src/arm/qcom-ipq8064-v1.0.dtsi | 1 + src/arm/qcom-ipq8064.dtsi | 1 + src/arm/qcom-msm8660-surf.dts | 1 + src/arm/qcom-msm8660.dtsi | 1 + src/arm/qcom-msm8960-cdp.dts | 1 + src/arm/qcom-msm8960.dtsi | 1 + .../qcom-msm8974-lge-nexus5-hammerhead.dts | 1 + src/arm/qcom-msm8974-sony-xperia-honami.dts | 1 + src/arm/qcom-msm8974.dtsi | 3 +- src/arm/qcom-pm8841.dtsi | 1 + src/arm/qcom-pm8941.dtsi | 1 + src/arm/qcom-pma8084.dtsi | 1 + src/arm/r7s72100-genmai.dts | 71 +- src/arm/r7s72100-rskrza1.dts | 61 ++ src/arm/r7s72100.dtsi | 78 +++ src/arm/r8a7743-iwg20d-q7.dts | 31 + src/arm/r8a7743-iwg20m.dtsi | 26 + src/arm/r8a7743-sk-rzg1m.dts | 25 +- src/arm/r8a7743.dtsi | 301 +++++++- src/arm/r8a7745-sk-rzg1e.dts | 25 +- src/arm/r8a7745.dtsi | 30 +- src/arm/r8a7790.dtsi | 30 +- src/arm/r8a7791-koelsch.dts | 10 +- src/arm/r8a7791.dtsi | 28 +- src/arm/r8a7792.dtsi | 18 + src/arm/r8a7793.dtsi | 18 + src/arm/r8a7794.dtsi | 22 +- src/arm/rk3036-kylin.dts | 2 - src/arm/rk3036.dtsi | 3 +- src/arm/rk3066a-bqcurie2.dts | 2 - src/arm/rk3066a-mk808.dts | 2 - src/arm/rk3066a-rayeager.dts | 3 - src/arm/rk3188-px3-evb.dts | 2 - src/arm/rk3188-radxarock.dts | 1 - src/arm/rk3228-evb.dts | 34 + src/arm/rk3229-evb.dts | 129 +++- src/arm/rk3229.dtsi | 89 +++ src/arm/rk322x.dtsi | 199 +++++- src/arm/rk3288-evb.dtsi | 51 +- src/arm/rk3288-fennec.dts | 8 +- src/arm/rk3288-firefly-reload-core.dtsi | 3 +- src/arm/rk3288-firefly-reload.dts | 2 - src/arm/rk3288-firefly.dtsi | 5 +- src/arm/rk3288-miqi.dts | 4 +- src/arm/rk3288-phycore-rdk.dts | 1 - src/arm/rk3288-phycore-som.dtsi | 3 +- src/arm/rk3288-popmetal.dts | 4 +- src/arm/rk3288-r89.dts | 3 +- src/arm/rk3288-rock2-som.dtsi | 3 +- src/arm/rk3288-rock2-square.dts | 2 - src/arm/rk3288-tinker.dts | 8 +- src/arm/rk3288-veyron-sdmmc.dtsi | 1 - src/arm/rk3288-veyron.dtsi | 4 +- src/arm/rk3288.dtsi | 215 +++--- src/arm/rv1108-evb.dts | 190 +++++ src/arm/rv1108.dtsi | 369 +++++++++- src/arm/sama5d2-pinfunc.h | 1 + src/arm/sama5d2.dtsi | 78 ++- src/arm/samsung_k3pe0e000b.dtsi | 1 + src/arm/skeleton.dtsi | 1 + src/arm/skeleton64.dtsi | 1 + src/arm/spear1310.dtsi | 3 + src/arm/spear1340.dtsi | 1 + src/arm/st-pincfg.h | 1 + src/arm/ste-dbx5x0.dtsi | 15 +- src/arm/ste-hrefprev60.dtsi | 2 +- src/arm/ste-nomadik-nhk15.dts | 1 + src/arm/ste-nomadik-s8815.dts | 1 + src/arm/ste-nomadik-stn8815.dtsi | 1 + src/arm/ste-u300.dts | 1 + src/arm/stm32429i-eval.dts | 7 +- src/arm/stm32f4-pinctrl.dtsi | 343 ++++++++++ src/arm/stm32f429-disco.dts | 3 +- ...ul-geam-kit.dts => stm32f429-pinctrl.dtsi} | 98 ++- src/arm/stm32f429.dtsi | 322 +-------- src/arm/stm32f469-disco.dts | 3 +- src/arm/stm32f469-pinctrl.dtsi | 96 +++ src/arm/stm32f746.dtsi | 51 ++ src/arm/stm32f769-disco.dts | 6 + src/arm/stm32h743.dtsi | 131 +++- src/arm/stm32h743i-eval.dts | 18 + src/arm/sun6i-a31.dtsi | 22 +- src/arm/sun7i-a20-cubietruck.dts | 4 + src/arm/sun8i-a23-a33.dtsi | 6 +- src/arm/sun8i-a83t-allwinner-h8homlet-v2.dts | 85 +++ src/arm/sun8i-a83t-bananapi-m3.dts | 148 ++++ src/arm/sun8i-a83t-cubietruck-plus.dts | 101 +++ src/arm/sun8i-a83t.dtsi | 176 +++++ src/arm/sun8i-h3-beelink-x2.dts | 24 +- src/arm/sun8i-r16-bananapi-m2m.dts | 321 +++++++++ src/arm/tango4-common.dtsi | 1 + src/arm/tango4-smp8758.dtsi | 2 +- src/arm/tango4-vantage-1172.dts | 1 + src/arm/tegra114-dalmore.dts | 11 + src/arm/tegra114-roth.dts | 1 + src/arm/tegra114-tn7.dts | 1 + src/arm/tegra114.dtsi | 1 + src/arm/tegra124-jetson-tk1-emc.dtsi | 1 + src/arm/tegra124-jetson-tk1.dts | 13 +- src/arm/tegra124-nyan-big-emc.dtsi | 1 + src/arm/tegra124-nyan-big.dts | 1 + src/arm/tegra124-nyan-blaze-emc.dtsi | 1 + src/arm/tegra124-nyan-blaze.dts | 1 + src/arm/tegra124-nyan.dtsi | 1 + src/arm/tegra124-venice2.dts | 1 + src/arm/tegra124.dtsi | 2 + src/arm/tegra20-colibri-512.dtsi | 1 + src/arm/tegra20-harmony.dts | 1 + src/arm/tegra20-iris-512.dts | 1 + src/arm/tegra20-medcom-wide.dts | 1 + src/arm/tegra20-paz00.dts | 3 + src/arm/tegra20-plutux.dts | 1 + src/arm/tegra20-seaboard.dts | 1 + src/arm/tegra20-tamonten.dtsi | 1 + src/arm/tegra20-tec.dts | 1 + src/arm/tegra20-trimslice.dts | 1 + src/arm/tegra20-ventana.dts | 1 + src/arm/tegra20.dtsi | 1 + src/arm/tegra30-apalis-eval.dts | 1 + src/arm/tegra30-apalis.dtsi | 1 + src/arm/tegra30-beaver.dts | 11 + src/arm/tegra30-cardhu-a02.dts | 1 + src/arm/tegra30-cardhu-a04.dts | 1 + src/arm/tegra30-cardhu.dtsi | 1 + src/arm/tegra30-colibri-eval-v3.dts | 1 + src/arm/tegra30-colibri.dtsi | 1 + src/arm/tegra30.dtsi | 1 + src/arm/tps65217.dtsi | 3 + src/arm/uniphier-ld4-ref.dts | 10 +- src/arm/uniphier-ld4.dtsi | 29 +- src/arm/uniphier-ld6b-ref.dts | 10 +- src/arm/uniphier-ld6b.dtsi | 2 +- src/arm/uniphier-pinctrl.dtsi | 58 +- src/arm/uniphier-pro4-ace.dts | 2 +- src/arm/uniphier-pro4-ref.dts | 10 +- src/arm/uniphier-pro4-sanji.dts | 2 +- src/arm/uniphier-pro4.dtsi | 26 +- src/arm/uniphier-pro5.dtsi | 60 +- src/arm/uniphier-pxs2-gentil.dts | 2 +- src/arm/uniphier-pxs2-vodka.dts | 2 +- src/arm/uniphier-pxs2.dtsi | 22 +- src/arm/uniphier-sld3-ref.dts | 75 -- src/arm/uniphier-sld3.dtsi | 260 ------- src/arm/uniphier-sld8-ref.dts | 10 +- src/arm/uniphier-sld8.dtsi | 29 +- src/arm/versatile-ab.dts | 1 + src/arm/versatile-pb.dts | 3 +- src/arm/vexpress-v2m.dtsi | 1 + src/arm/vexpress-v2p-ca15-tc1.dts | 1 + src/arm/vexpress-v2p-ca15_a7.dts | 1 + src/arm/vexpress-v2p-ca5s.dts | 1 + src/arm/vexpress-v2p-ca9.dts | 1 + src/arm/xenvm-4.2.dts | 1 + src/arm/zx296702-ad1.dts | 3 +- src/arm/zx296702.dtsi | 1 + src/arm/zynq-7000.dtsi | 8 + src/arm/zynq-parallella.dts | 3 +- src/arm/zynq-zc702.dts | 20 +- src/arm/zynq-zc706.dts | 20 +- src/arm/zynq-zed.dts | 5 +- src/arm/zynq-zybo.dts | 5 +- src/arm64/allwinner/axp803.dtsi | 150 ++++ .../allwinner/sun50i-a64-bananapi-m64.dts | 143 +++- src/arm64/allwinner/sun50i-a64-nanopi-a64.dts | 207 ++++++ src/arm64/allwinner/sun50i-a64-olinuxino.dts | 199 ++++++ src/arm64/allwinner/sun50i-a64-pine64.dts | 121 +++- .../allwinner/sun50i-a64-sopine-baseboard.dts | 22 + src/arm64/allwinner/sun50i-a64-sopine.dtsi | 86 +++ src/arm64/allwinner/sun50i-a64.dtsi | 9 + src/arm64/amd/amd-overdrive-rev-b0.dts | 1 + src/arm64/amd/amd-overdrive-rev-b1.dts | 1 + src/arm64/amd/amd-overdrive.dts | 1 + src/arm64/amd/amd-seattle-clks.dtsi | 1 + src/arm64/amd/amd-seattle-soc.dtsi | 1 + src/arm64/amd/amd-seattle-xgbe-b.dtsi | 1 + src/arm64/amd/husky.dts | 1 + src/arm64/amlogic/meson-gx-p23x-q20x.dtsi | 17 +- src/arm64/amlogic/meson-gx.dtsi | 46 +- src/arm64/amlogic/meson-gxbb-nanopi-k2.dts | 77 ++- src/arm64/amlogic/meson-gxbb-nexbox-a95x.dts | 19 +- src/arm64/amlogic/meson-gxbb-odroidc2.dts | 9 +- src/arm64/amlogic/meson-gxbb-p20x.dtsi | 23 +- src/arm64/amlogic/meson-gxbb-vega-s95.dtsi | 10 +- src/arm64/amlogic/meson-gxbb-wetek-play2.dts | 6 + src/arm64/amlogic/meson-gxbb.dtsi | 73 +- src/arm64/amlogic/meson-gxl-s905d-p230.dts | 8 +- .../meson-gxl-s905x-hwacom-amazetv.dts | 7 +- .../amlogic/meson-gxl-s905x-khadas-vim.dts | 63 ++ .../amlogic/meson-gxl-s905x-libretech-cc.dts | 77 ++- .../amlogic/meson-gxl-s905x-nexbox-a95x.dts | 17 +- src/arm64/amlogic/meson-gxl-s905x-p212.dts | 7 + src/arm64/amlogic/meson-gxl-s905x-p212.dtsi | 10 +- src/arm64/amlogic/meson-gxl.dtsi | 74 +- src/arm64/amlogic/meson-gxm-nexbox-a1.dts | 14 +- src/arm64/amlogic/meson-gxm-rbox-pro.dts | 1 - src/arm64/amlogic/meson-gxm.dtsi | 4 + src/arm64/apm/apm-shadowcat.dtsi | 2 + src/arm64/apm/apm-storm.dtsi | 5 + src/arm64/arm/foundation-v8-gicv3.dts | 1 + src/arm64/arm/foundation-v8.dts | 1 + src/arm64/arm/foundation-v8.dtsi | 3 +- src/arm64/arm/juno-base.dtsi | 15 +- src/arm64/arm/juno-cs-r1r2.dtsi | 1 + src/arm64/arm/rtsm_ve-aemv8a.dts | 1 + src/arm64/arm/rtsm_ve-motherboard.dtsi | 3 +- src/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts | 1 + src/arm64/broadcom/bcm2835-rpi.dtsi | 108 --- src/arm64/broadcom/bcm2837-rpi-3-b.dts | 43 +- src/arm64/broadcom/bcm283x-rpi-smsc9514.dtsi | 19 - src/arm64/broadcom/bcm283x-rpi-usb-host.dtsi | 3 - src/arm64/broadcom/bcm283x.dtsi | 638 ----------------- .../broadcom/{ => northstar2}/ns2-clock.dtsi | 0 .../broadcom/{ => northstar2}/ns2-svk.dts | 0 .../broadcom/{ => northstar2}/ns2-xmc.dts | 0 src/arm64/broadcom/{ => northstar2}/ns2.dtsi | 0 .../broadcom/stingray/bcm958742-base.dtsi | 78 +++ src/arm64/broadcom/stingray/bcm958742k.dts | 4 + src/arm64/broadcom/stingray/bcm958742t.dts | 4 + src/arm64/broadcom/stingray/stingray-fs4.dtsi | 118 ++++ .../broadcom/stingray/stingray-sata.dtsi | 278 ++++++++ src/arm64/broadcom/stingray/stingray.dtsi | 136 ++++ src/arm64/exynos/exynos5433-tm2-common.dtsi | 25 +- src/arm64/exynos/exynos5433.dtsi | 4 +- src/arm64/exynos/exynos7-espresso.dts | 2 - src/arm64/freescale/fsl-ls1012a.dtsi | 17 + src/arm64/freescale/fsl-ls1043a.dtsi | 12 +- src/arm64/freescale/fsl-ls1046a.dtsi | 31 + src/arm64/freescale/fsl-ls1088a-rdb.dts | 2 +- src/arm64/freescale/fsl-ls1088a.dtsi | 65 ++ src/arm64/freescale/fsl-ls2080a-qds.dts | 5 - src/arm64/freescale/fsl-ls2080a-rdb.dts | 5 - src/arm64/freescale/fsl-ls2080a-simu.dts | 5 - src/arm64/freescale/fsl-ls2080a.dtsi | 17 + src/arm64/freescale/fsl-ls2088a-qds.dts | 5 - src/arm64/freescale/fsl-ls2088a-rdb.dts | 5 - src/arm64/freescale/fsl-ls2088a.dtsi | 17 + src/arm64/freescale/fsl-ls208xa.dtsi | 51 ++ src/arm64/hisilicon/hi3660-hikey960.dts | 38 +- src/arm64/hisilicon/hi3660.dtsi | 131 ++++ src/arm64/hisilicon/hi6220-hikey.dts | 1 + src/arm64/hisilicon/hi6220.dtsi | 10 +- src/arm64/hisilicon/hikey-pinctrl.dtsi | 1 + src/arm64/hisilicon/hikey960-pinctrl.dtsi | 1 + src/arm64/hisilicon/hip07-d05.dts | 4 + src/arm64/hisilicon/hip07.dtsi | 22 + src/arm64/lg/lg1312-ref.dts | 1 + src/arm64/lg/lg1312.dtsi | 1 + src/arm64/lg/lg1313-ref.dts | 1 + src/arm64/lg/lg1313.dtsi | 1 + src/arm64/marvell/armada-3720-espressobin.dts | 30 + src/arm64/marvell/armada-37xx.dtsi | 11 +- src/arm64/marvell/armada-7040-db.dts | 39 ++ src/arm64/marvell/armada-8040-db.dts | 65 ++ src/arm64/marvell/armada-8040-mcbin.dts | 124 +++- src/arm64/marvell/armada-8080-db.dts | 67 ++ src/arm64/marvell/armada-8080.dtsi | 53 ++ src/arm64/marvell/armada-ap806.dtsi | 4 +- .../marvell/armada-ap810-ap0-octa-core.dtsi | 104 +++ src/arm64/marvell/armada-ap810-ap0.dtsi | 163 +++++ src/arm64/marvell/armada-cp110-master.dtsi | 89 ++- src/arm64/marvell/armada-cp110-slave.dtsi | 89 ++- src/arm64/mediatek/mt2712-evb.dts | 32 + src/arm64/mediatek/mt2712e.dtsi | 171 +++++ src/arm64/mediatek/mt6797.dtsi | 12 +- src/arm64/mediatek/mt7622-rfb1.dts | 27 + src/arm64/mediatek/mt7622.dtsi | 110 +++ src/arm64/nvidia/tegra132-norrin.dts | 1 + src/arm64/nvidia/tegra132.dtsi | 1 + src/arm64/nvidia/tegra186-p2771-0000.dts | 1 + src/arm64/nvidia/tegra186-p3310.dtsi | 1 + src/arm64/nvidia/tegra186.dtsi | 1 + src/arm64/nvidia/tegra210-p2180.dtsi | 1 + src/arm64/nvidia/tegra210-p2371-0000.dts | 1 + src/arm64/nvidia/tegra210-p2371-2180.dts | 1 + src/arm64/nvidia/tegra210-p2530.dtsi | 1 + src/arm64/nvidia/tegra210-p2571.dts | 1 + src/arm64/nvidia/tegra210-p2595.dtsi | 1 + src/arm64/nvidia/tegra210-p2597.dtsi | 1 + src/arm64/nvidia/tegra210-smaug.dts | 1 + src/arm64/nvidia/tegra210.dtsi | 1 + src/arm64/qcom/apq8016-sbc-pmic-pins.dtsi | 2 + src/arm64/qcom/apq8016-sbc-soc-pins.dtsi | 1 + src/arm64/qcom/apq8016-sbc.dtsi | 17 +- src/arm64/qcom/apq8096-db820c-pmic-pins.dtsi | 25 + src/arm64/qcom/apq8096-db820c.dtsi | 198 ++++++ src/arm64/qcom/ipq8074-hk01.dts | 52 ++ src/arm64/qcom/ipq8074.dtsi | 194 ++++++ src/arm64/qcom/msm8916.dtsi | 120 +++- src/arm64/qcom/msm8996.dtsi | 314 +++++++++ src/arm64/qcom/pm8004.dtsi | 1 + src/arm64/qcom/pm8916.dtsi | 1 + src/arm64/qcom/pm8994.dtsi | 1 + src/arm64/qcom/pmi8994.dtsi | 18 + src/arm64/renesas/r8a7795-es1-h3ulcb.dts | 2 - src/arm64/renesas/r8a7795-es1-salvator-x.dts | 2 - src/arm64/renesas/r8a7795-es1.dtsi | 9 +- src/arm64/renesas/r8a7795-h3ulcb.dts | 16 +- src/arm64/renesas/r8a7795-salvator-x.dts | 2 - src/arm64/renesas/r8a7795-salvator-xs.dts | 8 +- src/arm64/renesas/r8a7795.dtsi | 314 ++++++++- src/arm64/renesas/r8a7796-m3ulcb.dts | 14 +- src/arm64/renesas/r8a7796-salvator-x.dts | 31 +- src/arm64/renesas/r8a7796.dtsi | 414 ++++++++++- src/arm64/renesas/r8a77995-draak.dts | 46 ++ src/arm64/renesas/r8a77995.dtsi | 155 +++++ src/arm64/renesas/salvator-common.dtsi | 14 +- src/arm64/renesas/salvator-xs.dtsi | 10 + src/arm64/renesas/ulcb.dtsi | 51 ++ src/arm64/rockchip/rk3328-evb.dts | 181 +++++ src/arm64/rockchip/rk3328-rock64.dts | 333 +++++++++ src/arm64/rockchip/rk3328.dtsi | 437 ++++++++++++ src/arm64/rockchip/rk3368-evb.dtsi | 1 - src/arm64/rockchip/rk3368-geekbox.dts | 1 - src/arm64/rockchip/rk3368-orion-r68-meta.dts | 2 - src/arm64/rockchip/rk3368-px5-evb.dts | 3 - src/arm64/rockchip/rk3368-r88.dts | 2 - src/arm64/rockchip/rk3368.dtsi | 68 ++ src/arm64/rockchip/rk3399-evb.dts | 2 +- src/arm64/rockchip/rk3399-firefly.dts | 20 +- src/arm64/rockchip/rk3399-gru-kevin.dts | 44 ++ src/arm64/rockchip/rk3399-gru.dtsi | 132 ++-- src/arm64/rockchip/rk3399-op1-opp.dtsi | 33 + src/arm64/rockchip/rk3399-opp.dtsi | 33 + src/arm64/rockchip/rk3399-puma-haikou.dts | 228 ++++++ src/arm64/rockchip/rk3399-puma.dtsi | 547 +++++++++++++++ .../rockchip/rk3399-sapphire-excavator.dts | 240 +++++++ src/arm64/rockchip/rk3399-sapphire.dtsi | 644 +++++++++++++++++ src/arm64/rockchip/rk3399.dtsi | 292 +++++++- src/arm64/socionext/uniphier-ld11-global.dts | 6 +- src/arm64/socionext/uniphier-ld11-ref.dts | 6 +- src/arm64/socionext/uniphier-ld11.dtsi | 44 +- src/arm64/socionext/uniphier-ld20-global.dts | 6 +- src/arm64/socionext/uniphier-ld20-ref.dts | 6 +- src/arm64/socionext/uniphier-ld20.dtsi | 37 +- src/arm64/socionext/uniphier-pinctrl.dtsi | 142 +--- src/arm64/socionext/uniphier-pxs3-ref.dts | 62 ++ src/arm64/socionext/uniphier-pxs3.dtsi | 367 ++++++++++ .../socionext/uniphier-ref-daughter.dtsi | 17 +- .../socionext/uniphier-support-card.dtsi | 35 +- src/arm64/xilinx/zynqmp-ep108-clk.dtsi | 50 +- src/arm64/xilinx/zynqmp-ep108.dts | 18 +- src/arm64/xilinx/zynqmp.dtsi | 277 +++++++- src/arm64/zte/zx296718-evb.dts | 68 +- src/arm64/zte/zx296718-pcbox.dts | 143 ++++ src/arm64/zte/zx296718.dtsi | 171 ++++- src/c6x/tms320c6455.dtsi | 1 + src/c6x/tms320c6457.dtsi | 1 + src/c6x/tms320c6472.dtsi | 1 + src/c6x/tms320c6474.dtsi | 1 + src/c6x/tms320c6678.dtsi | 1 + src/cris/artpec3.dtsi | 1 + src/cris/dev88.dts | 1 + src/cris/etraxfs.dtsi | 1 + src/cris/p1343.dts | 1 + src/h8300/edosk2674.dts | 1 + src/h8300/h8300h_sim.dts | 1 + src/h8300/h8s_sim.dts | 1 + src/metag/skeleton.dtsi | 1 + src/mips/brcm/bcm3368-netgear-cvg834g.dts | 1 + src/mips/brcm/bcm3368.dtsi | 1 + src/mips/brcm/bcm3384_viper.dtsi | 1 + src/mips/brcm/bcm3384_zephyr.dtsi | 1 + src/mips/brcm/bcm63268-comtrend-vr-3032u.dts | 1 + src/mips/brcm/bcm63268.dtsi | 1 + src/mips/brcm/bcm6328.dtsi | 1 + src/mips/brcm/bcm6358-neufbox4-sercomm.dts | 1 + src/mips/brcm/bcm6358.dtsi | 1 + src/mips/brcm/bcm6362-neufbox6-sercomm.dts | 1 + src/mips/brcm/bcm6362.dtsi | 1 + src/mips/brcm/bcm6368.dtsi | 1 + src/mips/brcm/bcm7125.dtsi | 1 + src/mips/brcm/bcm7346.dtsi | 1 + src/mips/brcm/bcm7358.dtsi | 1 + src/mips/brcm/bcm7360.dtsi | 1 + src/mips/brcm/bcm7362.dtsi | 1 + src/mips/brcm/bcm7420.dtsi | 1 + src/mips/brcm/bcm7425.dtsi | 1 + src/mips/brcm/bcm7435.dtsi | 1 + src/mips/brcm/bcm93384wvg.dts | 1 + src/mips/brcm/bcm93384wvg_viper.dts | 1 + src/mips/brcm/bcm96368mvwg.dts | 1 + src/mips/brcm/bcm97125cbmb.dts | 1 + src/mips/brcm/bcm97346dbsmb.dts | 1 + src/mips/brcm/bcm97358svmb.dts | 1 + src/mips/brcm/bcm97360svmb.dts | 1 + src/mips/brcm/bcm97362svmb.dts | 1 + src/mips/brcm/bcm97420c.dts | 1 + src/mips/brcm/bcm97425svmb.dts | 1 + src/mips/brcm/bcm97435svmb.dts | 1 + src/mips/brcm/bcm97xxx-nand-cs1-bch24.dtsi | 1 + src/mips/brcm/bcm97xxx-nand-cs1-bch4.dtsi | 1 + src/mips/brcm/bcm9ejtagprb.dts | 1 + src/mips/cavium-octeon/octeon_3xxx.dts | 1 + src/mips/cavium-octeon/octeon_3xxx.dtsi | 1 + src/mips/cavium-octeon/octeon_68xx.dts | 1 + src/mips/img/boston.dts | 1 + src/mips/ingenic/ci20.dts | 38 + src/mips/ingenic/jz4740.dtsi | 1 + src/mips/ingenic/jz4780.dtsi | 12 + src/mips/ingenic/qi_lb60.dts | 1 + src/mips/lantiq/danube.dtsi | 1 + src/mips/lantiq/easy50712.dts | 1 + src/mips/mti/malta.dts | 1 + src/mips/mti/sead3.dts | 1 + src/mips/netlogic/xlp_evp.dts | 1 + src/mips/netlogic/xlp_fvp.dts | 1 + src/mips/netlogic/xlp_gvp.dts | 1 + src/mips/netlogic/xlp_rvp.dts | 1 + src/mips/netlogic/xlp_svp.dts | 1 + src/mips/ni/169445.dts | 100 +++ src/mips/qca/ar9132.dtsi | 1 + src/mips/qca/ar9132_tl_wr1043nd_v1.dts | 1 + src/mips/qca/ar9331.dtsi | 1 + src/mips/qca/ar9331_dpt_module.dts | 1 + src/mips/qca/ar9331_dragino_ms14.dts | 1 + src/mips/qca/ar9331_omega.dts | 1 + src/mips/qca/ar9331_tl_mr3020.dts | 1 + src/mips/ralink/mt7620a.dtsi | 1 + src/mips/ralink/mt7620a_eval.dts | 1 + src/mips/ralink/mt7628a.dtsi | 126 ++++ src/mips/ralink/omega2p.dts | 18 + src/mips/ralink/rt2880.dtsi | 1 + src/mips/ralink/rt2880_eval.dts | 1 + src/mips/ralink/rt3050.dtsi | 1 + src/mips/ralink/rt3052_eval.dts | 1 + src/mips/ralink/rt3883.dtsi | 1 + src/mips/ralink/rt3883_eval.dts | 1 + src/mips/ralink/vocore2.dts | 18 + src/mips/xilfpga/microAptiv.dtsi | 1 + src/mips/xilfpga/nexys4ddr.dts | 1 + src/nios2/3c120_devboard.dts | 3 +- src/openrisc/or1ksim.dts | 1 + src/powerpc/fsp2.dts | 33 +- src/powerpc/virtex440-ml510.dts | 1 + src/sh/j2_mimas_v2.dts | 1 + src/xtensa/csp.dts | 1 + src/xtensa/kc705.dts | 1 + src/xtensa/kc705_nommu.dts | 1 + src/xtensa/lx200mx.dts | 1 + src/xtensa/lx60.dts | 1 + src/xtensa/ml605.dts | 1 + src/xtensa/xtfpga-flash-128m.dtsi | 1 + src/xtensa/xtfpga-flash-16m.dtsi | 1 + src/xtensa/xtfpga-flash-4m.dtsi | 1 + src/xtensa/xtfpga.dtsi | 1 + 1378 files changed, 31131 insertions(+), 5081 deletions(-) create mode 100644 Bindings/arc/hsdk.txt create mode 100644 Bindings/arm/bhf.txt create mode 100644 Bindings/arm/marvell/armada-8kp.txt create mode 100644 Bindings/ata/ahci-mtk.txt delete mode 100644 Bindings/clock/mt8173-cpu-dvfs.txt create mode 100644 Bindings/clock/renesas,rcar-usb2-clock-sel.txt create mode 100644 Bindings/clock/snps,hsdk-pll-clock.txt create mode 100644 Bindings/clock/snps,pll-clock.txt create mode 100644 Bindings/clock/st,stm32h7-rcc.txt create mode 100644 Bindings/cpufreq/cpufreq-mediatek.txt create mode 100644 Bindings/crypto/artpec6-crypto.txt create mode 100644 Bindings/crypto/st,stm32-hash.txt create mode 100644 Bindings/display/bridge/dw_mipi_dsi.txt create mode 100644 Bindings/display/repaper.txt create mode 100644 Bindings/display/sitronix,st7586.txt create mode 100644 Bindings/extcon/extcon-usbc-cros-ec.txt create mode 100644 Bindings/fpga/altera-passive-serial.txt create mode 100644 Bindings/fpga/xilinx-pr-decoupler.txt create mode 100644 Bindings/hwmon/ibm,cffps1.txt create mode 100644 Bindings/hwmon/ltq-cputemp.txt create mode 100644 Bindings/i2c/i2c-altera.txt create mode 100644 Bindings/i2c/i2c-sprd.txt create mode 100644 Bindings/iio/counter/stm32-lptimer-cnt.txt create mode 100644 Bindings/iio/humidity/hdc100x.txt create mode 100644 Bindings/iio/humidity/htu21.txt create mode 100644 Bindings/iio/pressure/ms5637.txt create mode 100644 Bindings/iio/temperature/tsys01.txt create mode 100644 Bindings/iio/timer/stm32-lptimer-trigger.txt create mode 100644 Bindings/input/pwm-vibrator.txt create mode 100644 Bindings/interrupt-controller/socionext,uniphier-aidet.txt create mode 100644 Bindings/iommu/qcom,iommu.txt create mode 100644 Bindings/leds/ams,as3645a.txt create mode 100644 Bindings/leds/irled/gpio-ir-tx.txt create mode 100644 Bindings/leds/irled/pwm-ir-tx.txt create mode 100644 Bindings/leds/leds-pca955x.txt create mode 100644 Bindings/media/i2c/adv748x.txt create mode 100644 Bindings/media/i2c/dongwoon,dw9714.txt create mode 100644 Bindings/media/meson-ao-cec.txt create mode 100644 Bindings/media/qcom,camss.txt create mode 100644 Bindings/media/zx-irdec.txt create mode 100644 Bindings/mfd/bd9571mwv.txt create mode 100644 Bindings/mfd/retu.txt create mode 100644 Bindings/mfd/stm32-lptimer.txt create mode 100644 Bindings/mfd/tps6105x.txt create mode 100644 Bindings/mfd/zii,rave-sp.txt create mode 100644 Bindings/mips/lantiq/fpi-bus.txt create mode 100644 Bindings/mips/lantiq/rcu-gphy.txt create mode 100644 Bindings/mips/lantiq/rcu.txt create mode 100644 Bindings/mips/ni.txt create mode 100644 Bindings/net/anarion-gmac.txt create mode 100644 Bindings/net/broadcom-bluetooth.txt create mode 100644 Bindings/net/sff,sfp.txt create mode 100644 Bindings/net/xilinx_axienet.txt delete mode 100644 Bindings/pci/mediatek,mt7623-pcie.txt create mode 100644 Bindings/pci/mediatek-pcie.txt create mode 100644 Bindings/phy/phy-lantiq-rcu-usb2.txt rename Bindings/phy/{phy-mt65xx-usb.txt => phy-mtk-tphy.txt} (88%) create mode 100644 Bindings/phy/phy-mvebu-comphy.txt create mode 100644 Bindings/phy/ralink-usb-phy.txt create mode 100644 Bindings/pinctrl/cortina,gemini-pinctrl.txt create mode 100644 Bindings/pinctrl/fsl,imx7ulp-pinctrl.txt create mode 100644 Bindings/pinctrl/pinctrl-rk805.txt create mode 100644 Bindings/pinctrl/sprd,pinctrl.txt create mode 100644 Bindings/pinctrl/sprd,sc9860-pinctrl.txt create mode 100644 Bindings/power/supply/bq24190.txt create mode 100644 Bindings/powerpc/ibm,vas.txt create mode 100644 Bindings/powerpc/opal/sensor-groups.txt create mode 100644 Bindings/pwm/pwm-stm32-lp.txt create mode 100644 Bindings/pwm/pwm-zx.txt create mode 100644 Bindings/regulator/mt6380-regulator.txt create mode 100644 Bindings/regulator/st,stm32-vrefbuf.txt create mode 100644 Bindings/remoteproc/imx-rproc.txt create mode 100644 Bindings/remoteproc/ti,davinci-rproc.txt create mode 100644 Bindings/reset/lantiq,reset.txt create mode 100644 Bindings/reset/snps,hsdk-reset.txt create mode 100644 Bindings/rng/imx-rngc.txt create mode 100644 Bindings/rtc/google,goldfish-rtc.txt create mode 100644 Bindings/rtc/realtek,rtd119x.txt create mode 100644 Bindings/serio/ps2-gpio.txt create mode 100644 Bindings/sound/cs43130.txt create mode 100644 Bindings/sound/dmic.txt create mode 100644 Bindings/sound/rt274.txt create mode 100644 Bindings/sound/wm8524.txt create mode 100644 Bindings/sram/renesas,smp-sram.txt create mode 100644 Bindings/thermal/uniphier-thermal.txt create mode 100644 Bindings/timer/nxp,tpm-timer.txt create mode 100644 Bindings/usb/brcm,bdc.txt create mode 100644 Bindings/usb/fcs,fusb302.txt rename Bindings/usb/{mt8173-xhci.txt => mediatek,mtk-xhci.txt} (85%) rename Bindings/usb/{mt8173-mtu3.txt => mediatek,mtu3.txt} (91%) create mode 100644 Bindings/watchdog/lantiq-wdt.txt create mode 100644 include/dt-bindings/clock/r8a77995-cpg-mssr.h create mode 100644 include/dt-bindings/clock/stm32h7-clks.h create mode 100644 include/dt-bindings/clock/sun4i-a10-ccu.h create mode 100644 include/dt-bindings/clock/sun7i-a20-ccu.h create mode 100644 include/dt-bindings/clock/sun8i-r40-ccu.h delete mode 100644 include/dt-bindings/genpd/k2g.h create mode 100644 include/dt-bindings/leds/leds-pca955x.h create mode 100644 include/dt-bindings/mfd/stm32h7-rcc.h create mode 100644 include/dt-bindings/mips/lantiq_rcu_gphy.h create mode 100644 include/dt-bindings/power/mt7622-power.h create mode 100644 include/dt-bindings/power/r8a77995-sysc.h create mode 100644 include/dt-bindings/power/rk3366-power.h create mode 100644 include/dt-bindings/reset/amlogic,meson8b-clkc-reset.h create mode 100644 include/dt-bindings/reset/snps,hsdk-reset.h create mode 100644 include/dt-bindings/reset/sun4i-a10-ccu.h create mode 100644 include/dt-bindings/reset/sun8i-r40-ccu.h delete mode 100755 scripts/flatten-symlinks.sh delete mode 100755 scripts/git-filter-branch create mode 100755 scripts/rewrite-index.pl delete mode 100644 scripts/rewrite-paths.sed create mode 100644 src/arc/hsdk.dts create mode 100644 src/arm/am335x-moxa-uc-8100-me-t.dts create mode 100644 src/arm/am57xx-beagle-x15-revc.dts create mode 100644 src/arm/at91-sama5d27_som1.dtsi create mode 100644 src/arm/at91-sama5d27_som1_ek.dts create mode 100644 src/arm/bcm2835-rpi-zero-w.dts rename src/{arm64/broadcom => arm}/bcm2837.dtsi (96%) create mode 100644 src/arm/bcm947189acdbmr.dts create mode 100644 src/arm/dra7-evm-common.dtsi create mode 100644 src/arm/dra72x-mmc-iodelay.dtsi create mode 100644 src/arm/dra74x-mmc-iodelay.dtsi create mode 100644 src/arm/dra76-evm.dts create mode 100644 src/arm/dra76x.dtsi create mode 100644 src/arm/gemini-dlink-dir-685.dts create mode 100644 src/arm/imx53-cx9020.dts create mode 100644 src/arm/imx6q-apalis-eval.dts create mode 100644 src/arm/imx6q-apalis-ixora-v1.1.dts rename src/arm/{imx6ul-geam.dtsi => imx6ul-geam.dts} (87%) delete mode 100644 src/arm/imx6ul-isiot-common.dtsi create mode 100644 src/arm/imx7ulp-pinfunc.h create mode 100644 src/arm/mt6323.dtsi delete mode 100644 src/arm/mt7623-evb.dts create mode 100644 src/arm/mt7623n-bananapi-bpi-r2.dts create mode 100644 src/arm/mt7623n-rfb-nand.dts create mode 100644 src/arm/mt7623n-rfb.dtsi create mode 100644 src/arm/rk3229.dtsi create mode 100644 src/arm/stm32f4-pinctrl.dtsi rename src/arm/{imx6ul-geam-kit.dts => stm32f429-pinctrl.dtsi} (63%) create mode 100644 src/arm/stm32f469-pinctrl.dtsi create mode 100644 src/arm/sun8i-a83t-bananapi-m3.dts create mode 100644 src/arm/sun8i-r16-bananapi-m2m.dts delete mode 100644 src/arm/uniphier-sld3-ref.dts delete mode 100644 src/arm/uniphier-sld3.dtsi create mode 100644 src/arm64/allwinner/axp803.dtsi create mode 100644 src/arm64/allwinner/sun50i-a64-nanopi-a64.dts create mode 100644 src/arm64/allwinner/sun50i-a64-olinuxino.dts delete mode 100644 src/arm64/broadcom/bcm2835-rpi.dtsi delete mode 100644 src/arm64/broadcom/bcm283x-rpi-smsc9514.dtsi delete mode 100644 src/arm64/broadcom/bcm283x-rpi-usb-host.dtsi delete mode 100644 src/arm64/broadcom/bcm283x.dtsi rename src/arm64/broadcom/{ => northstar2}/ns2-clock.dtsi (100%) rename src/arm64/broadcom/{ => northstar2}/ns2-svk.dts (100%) rename src/arm64/broadcom/{ => northstar2}/ns2-xmc.dts (100%) rename src/arm64/broadcom/{ => northstar2}/ns2.dtsi (100%) create mode 100644 src/arm64/broadcom/stingray/stingray-fs4.dtsi create mode 100644 src/arm64/broadcom/stingray/stingray-sata.dtsi create mode 100644 src/arm64/marvell/armada-8080-db.dts create mode 100644 src/arm64/marvell/armada-8080.dtsi create mode 100644 src/arm64/marvell/armada-ap810-ap0-octa-core.dtsi create mode 100644 src/arm64/marvell/armada-ap810-ap0.dtsi create mode 100644 src/arm64/mediatek/mt2712-evb.dts create mode 100644 src/arm64/mediatek/mt2712e.dtsi create mode 100644 src/arm64/mediatek/mt7622-rfb1.dts create mode 100644 src/arm64/mediatek/mt7622.dtsi create mode 100644 src/arm64/qcom/ipq8074-hk01.dts create mode 100644 src/arm64/qcom/ipq8074.dtsi create mode 100644 src/arm64/renesas/r8a77995-draak.dts create mode 100644 src/arm64/renesas/r8a77995.dtsi create mode 100644 src/arm64/rockchip/rk3328-rock64.dts create mode 100644 src/arm64/rockchip/rk3399-puma-haikou.dts create mode 100644 src/arm64/rockchip/rk3399-puma.dtsi create mode 100644 src/arm64/rockchip/rk3399-sapphire-excavator.dts create mode 100644 src/arm64/rockchip/rk3399-sapphire.dtsi create mode 100644 src/arm64/socionext/uniphier-pxs3-ref.dts create mode 100644 src/arm64/socionext/uniphier-pxs3.dtsi create mode 100644 src/arm64/zte/zx296718-pcbox.dts create mode 100644 src/mips/ni/169445.dts create mode 100644 src/mips/ralink/mt7628a.dtsi create mode 100644 src/mips/ralink/omega2p.dts create mode 100644 src/mips/ralink/vocore2.dts diff --git a/Bindings/arc/hsdk.txt b/Bindings/arc/hsdk.txt new file mode 100644 index 000000000000..be50654bbf61 --- /dev/null +++ b/Bindings/arc/hsdk.txt @@ -0,0 +1,7 @@ +Synopsys DesignWare ARC HS Development Kit Device Tree Bindings +--------------------------------------------------------------------------- + +ARC HSDK Board with quad-core ARC HS38x4 in silicon. + +Required root node properties: + - compatible = "snps,hsdk"; diff --git a/Bindings/arm/amlogic.txt b/Bindings/arm/amlogic.txt index 0fff40a6330d..4e4bc0bae597 100644 --- a/Bindings/arm/amlogic.txt +++ b/Bindings/arm/amlogic.txt @@ -1,6 +1,18 @@ Amlogic MesonX device tree bindings ------------------------------------------- +Work in progress statement: + +Device tree files and bindings applying to Amlogic SoCs and boards are +considered "unstable". Any Amlogic device tree binding may change at +any time. Be sure to use a device tree binary and a kernel image +generated from the same source tree. + +Please refer to Documentation/devicetree/bindings/ABI.txt for a definition of a +stable binding/ABI. + +--------------------------------------------------------------- + Boards with the Amlogic Meson6 SoC shall have the following properties: Required root node property: compatible: "amlogic,meson6" @@ -61,3 +73,32 @@ Board compatible values (alphabetically, grouped by SoC): - "amlogic,q201" (Meson gxm s912) - "kingnovel,r-box-pro" (Meson gxm S912) - "nexbox,a1" (Meson gxm s912) + +Amlogic Meson Firmware registers Interface +------------------------------------------ + +The Meson SoCs have a register bank with status and data shared with the +secure firmware. + +Required properties: + - compatible: For Meson GX SoCs, must be "amlogic,meson-gx-ao-secure", "syscon" + +Properties should indentify components of this register interface : + +Meson GX SoC Information +------------------------ +A firmware register encodes the SoC type, package and revision information on +the Meson GX SoCs. +If present, the following property should be added : + +Optional properties: + - amlogic,has-chip-id: If present, the interface gives the current SoC version. + +Example +------- + +ao-secure@140 { + compatible = "amlogic,meson-gx-ao-secure", "syscon"; + reg = <0x0 0x140 0x0 0x140>; + amlogic,has-chip-id; +}; diff --git a/Bindings/arm/arch_timer.txt b/Bindings/arm/arch_timer.txt index e926aea1147d..68301b77e854 100644 --- a/Bindings/arm/arch_timer.txt +++ b/Bindings/arm/arch_timer.txt @@ -108,6 +108,5 @@ Example: frame-number = <1> interrupts = <0 15 0x8>; reg = <0xf0003000 0x1000>; - status = "disabled"; }; }; diff --git a/Bindings/arm/bcm/brcm,bcm2835.txt b/Bindings/arm/bcm/brcm,bcm2835.txt index 9c97de23919a..3e3efa046ac5 100644 --- a/Bindings/arm/bcm/brcm,bcm2835.txt +++ b/Bindings/arm/bcm/brcm,bcm2835.txt @@ -42,6 +42,10 @@ Raspberry Pi Zero Required root node properties: compatible = "raspberrypi,model-zero", "brcm,bcm2835"; +Raspberry Pi Zero W +Required root node properties: +compatible = "raspberrypi,model-zero-w", "brcm,bcm2835"; + Generic BCM2835 board Required root node properties: compatible = "brcm,bcm2835"; diff --git a/Bindings/arm/bhf.txt b/Bindings/arm/bhf.txt new file mode 100644 index 000000000000..886b503caf9c --- /dev/null +++ b/Bindings/arm/bhf.txt @@ -0,0 +1,6 @@ +Beckhoff Automation Platforms Device Tree Bindings +-------------------------------------------------- + +CX9020 Embedded PC +Required root node properties: + - compatible = "bhf,cx9020", "fsl,imx53"; diff --git a/Bindings/arm/coresight.txt b/Bindings/arm/coresight.txt index fcbae6a5e6c1..15ac8e8dcfdf 100644 --- a/Bindings/arm/coresight.txt +++ b/Bindings/arm/coresight.txt @@ -34,8 +34,8 @@ its hardware characteristcs. - Embedded Trace Macrocell (version 4.x): "arm,coresight-etm4x", "arm,primecell"; - - Qualcomm Configurable Replicator (version 1.x): - "qcom,coresight-replicator1x", "arm,primecell"; + - Coresight programmable Replicator : + "arm,coresight-dynamic-replicator", "arm,primecell"; - System Trace Macrocell: "arm,coresight-stm", "arm,primecell"; [1] diff --git a/Bindings/arm/cpus.txt b/Bindings/arm/cpus.txt index a44253cad269..b92f12bd5244 100644 --- a/Bindings/arm/cpus.txt +++ b/Bindings/arm/cpus.txt @@ -200,6 +200,7 @@ described below. "arm,realview-smp" "brcm,bcm11351-cpu-method" "brcm,bcm23550" + "brcm,bcm2836-smp" "brcm,bcm-nsp-smp" "brcm,brahma-b15" "marvell,armada-375-smp" diff --git a/Bindings/arm/marvell/armada-8kp.txt b/Bindings/arm/marvell/armada-8kp.txt new file mode 100644 index 000000000000..f3e9624534c6 --- /dev/null +++ b/Bindings/arm/marvell/armada-8kp.txt @@ -0,0 +1,15 @@ +Marvell Armada 8KPlus Platforms Device Tree Bindings +---------------------------------------------------- + +Boards using a SoC of the Marvell Armada 8KP families must carry +the following root node property: + + - compatible, with one of the following values: + + - "marvell,armada-8080", "marvell,armada-ap810-octa", "marvell,armada-ap810" + when the SoC being used is the Armada 8080 + +Example: + +compatible = "marvell,armada-8080-db", "marvell,armada-8080", + "marvell,armada-ap810-octa", "marvell,armada-ap810" diff --git a/Bindings/arm/marvell/cp110-system-controller0.txt b/Bindings/arm/marvell/cp110-system-controller0.txt index 171d02cadea4..29cdbae6c5ac 100644 --- a/Bindings/arm/marvell/cp110-system-controller0.txt +++ b/Bindings/arm/marvell/cp110-system-controller0.txt @@ -183,7 +183,6 @@ cpm_syscon0: system-controller@440000 { gpio-controller; #gpio-cells = <2>; gpio-ranges = <&cpm_pinctrl 0 0 32>; - status = "disabled"; }; }; diff --git a/Bindings/arm/mediatek.txt b/Bindings/arm/mediatek.txt index da7bd138e6f2..91d517849483 100644 --- a/Bindings/arm/mediatek.txt +++ b/Bindings/arm/mediatek.txt @@ -1,12 +1,12 @@ -MediaTek mt65xx, mt67xx & mt81xx Platforms Device Tree Bindings +MediaTek SoC based Platforms Device Tree Bindings -Boards with a MediaTek mt65xx/mt67xx/mt81xx SoC shall have the -following property: +Boards with a MediaTek SoC shall have the following property: Required root node property: compatible: Must contain one of "mediatek,mt2701" + "mediatek,mt2712" "mediatek,mt6580" "mediatek,mt6589" "mediatek,mt6592" @@ -14,7 +14,8 @@ compatible: Must contain one of "mediatek,mt6795" "mediatek,mt6797" "mediatek,mt7622" - "mediatek,mt7623" + "mediatek,mt7623" which is referred to MT7623N SoC + "mediatek,mt7623a" "mediatek,mt8127" "mediatek,mt8135" "mediatek,mt8173" @@ -25,6 +26,9 @@ Supported boards: - Evaluation board for MT2701: Required root node properties: - compatible = "mediatek,mt2701-evb", "mediatek,mt2701"; +- Evaluation board for MT2712: + Required root node properties: + - compatible = "mediatek,mt2712-evb", "mediatek,mt2712"; - Evaluation board for MT6580: Required root node properties: - compatible = "mediatek,mt6580-evbp1", "mediatek,mt6580"; @@ -46,9 +50,11 @@ Supported boards: - Reference board variant 1 for MT7622: Required root node properties: - compatible = "mediatek,mt7622-rfb1", "mediatek,mt7622"; -- Evaluation board for MT7623: +- Reference board for MT7623n with NAND: Required root node properties: - - compatible = "mediatek,mt7623-evb", "mediatek,mt7623"; + - compatible = "mediatek,mt7623n-rfb-nand", "mediatek,mt7623"; +- Bananapi BPI-R2 board: + - compatible = "bananapi,bpi-r2", "mediatek,mt7623"; - MTK mt8127 tablet moose EVB: Required root node properties: - compatible = "mediatek,mt8127-moose", "mediatek,mt8127"; diff --git a/Bindings/arm/omap/omap.txt b/Bindings/arm/omap/omap.txt index 8219b2c6bb29..2ecc712bf707 100644 --- a/Bindings/arm/omap/omap.txt +++ b/Bindings/arm/omap/omap.txt @@ -80,6 +80,9 @@ SoCs: - OMAP5432 compatible = "ti,omap5432", "ti,omap5" +- DRA762 + compatible = "ti,dra762", "ti,dra7" + - DRA742 compatible = "ti,dra742", "ti,dra74", "ti,dra7" @@ -154,6 +157,9 @@ Boards: - AM335X phyCORE-AM335x: Development kit compatible = "phytec,am335x-pcm-953", "phytec,am335x-phycore-som", "ti,am33xx" +- AM335X UC-8100-ME-T: Communication-centric industrial computing platform + compatible = "moxa,uc-8100-me-t", "ti,am33xx"; + - OMAP5 EVM : Evaluation Module compatible = "ti,omap5-evm", "ti,omap5" @@ -184,6 +190,9 @@ Boards: - AM5718 IDK compatible = "ti,am5718-idk", "ti,am5718", "ti,dra7" +- DRA762 EVM: Software Development Board for DRA762 + compatible = "ti,dra76-evm", "ti,dra762", "ti,dra7" + - DRA742 EVM: Software Development Board for DRA742 compatible = "ti,dra7-evm", "ti,dra742", "ti,dra74", "ti,dra7" diff --git a/Bindings/arm/pmu.txt b/Bindings/arm/pmu.txt index 61c8b4620415..13611a8199bb 100644 --- a/Bindings/arm/pmu.txt +++ b/Bindings/arm/pmu.txt @@ -9,9 +9,11 @@ Required properties: - compatible : should be one of "apm,potenza-pmu" "arm,armv8-pmuv3" + "arm,cortex-a73-pmu" "arm,cortex-a72-pmu" "arm,cortex-a57-pmu" "arm,cortex-a53-pmu" + "arm,cortex-a35-pmu" "arm,cortex-a17-pmu" "arm,cortex-a15-pmu" "arm,cortex-a12-pmu" diff --git a/Bindings/arm/qcom.txt b/Bindings/arm/qcom.txt index 028d16e72186..0ed4d39d7fe1 100644 --- a/Bindings/arm/qcom.txt +++ b/Bindings/arm/qcom.txt @@ -25,6 +25,7 @@ The 'SoC' element must be one of the following strings: msm8994 msm8996 mdm9615 + ipq8074 The 'board' element must be one of the following strings: @@ -33,6 +34,7 @@ The 'board' element must be one of the following strings: dragonboard mtp sbc + hk01 The 'soc_version' and 'board_version' elements take the form of v. where the minor number may be omitted when it's zero, i.e. v1.0 is the same diff --git a/Bindings/arm/rockchip.txt b/Bindings/arm/rockchip.txt index 11c0ac4a2d56..b003148e2945 100644 --- a/Bindings/arm/rockchip.txt +++ b/Bindings/arm/rockchip.txt @@ -134,6 +134,10 @@ Rockchip platforms device tree bindings Required root node properties: - compatible = "phytec,rk3288-pcm-947", "phytec,rk3288-phycore-som", "rockchip,rk3288"; +- Pine64 Rock64 board: + Required root node properties: + - compatible = "pine64,rock64", "rockchip,rk3328"; + - Rockchip PX3 Evaluation board: Required root node properties: - compatible = "rockchip,px3-evb", "rockchip,px3", "rockchip,rk3188"; @@ -173,6 +177,14 @@ Rockchip platforms device tree bindings Required root node properties: - compatible = "rockchip,rk3399-evb", "rockchip,rk3399"; +- Rockchip RK3399 Sapphire Excavator board: + Required root node properties: + - compatible = "rockchip,rk3399-sapphire-excavator", "rockchip,rk3399"; + +- Theobroma Systems RK3399-Q7 Haikou Baseboard: + Required root node properties: + - compatible = "tsd,rk3399-q7-haikou", "rockchip,rk3399"; + - Tronsmart Orion R68 Meta Required root node properties: - compatible = "tronsmart,orion-r68-meta", "rockchip,rk3368"; diff --git a/Bindings/arm/shmobile.txt b/Bindings/arm/shmobile.txt index 1a671e329864..ae75cb3b1331 100644 --- a/Bindings/arm/shmobile.txt +++ b/Bindings/arm/shmobile.txt @@ -39,6 +39,8 @@ SoCs: compatible = "renesas,r8a7795" - R-Car M3-W (R8A77960) compatible = "renesas,r8a7796" + - R-Car D3 (R8A77995) + compatible = "renesas,r8a77995" Boards: @@ -53,6 +55,8 @@ Boards: compatible = "renesas,blanche", "renesas,r8a7792" - BOCK-W compatible = "renesas,bockw", "renesas,r8a7778" + - Draak (RTP0RC77995SEB0010S) + compatible = "renesas,draak", "renesas,r8a77995" - Genmai (RTK772100BC00000BR) compatible = "renesas,genmai", "renesas,r7s72100" - GR-Peach (X28A-M01-E/F) @@ -64,6 +68,10 @@ Boards: compatible = "renesas,h3ulcb", "renesas,r8a7795"; - Henninger compatible = "renesas,henninger", "renesas,r8a7791" + - iWave Systems RZ/G1E SODIMM SOM Development Platform (iW-RainboW-G22D) + compatible = "iwave,g22d", "iwave,g22m", "renesas,r8a7745" + - iWave Systems RZ/G1E SODIMM System On Module (iW-RainboW-G22M-SM) + compatible = "iwave,g22m", "renesas,r8a7745" - iWave Systems RZ/G1M Qseven Development Platform (iW-RainboW-G20D-Qseven) compatible = "iwave,g20d", "iwave,g20m", "renesas,r8a7743" - iWave Systems RZ/G1M Qseven System On Module (iW-RainboW-G20M-Qseven) diff --git a/Bindings/ata/ahci-mtk.txt b/Bindings/ata/ahci-mtk.txt new file mode 100644 index 000000000000..d2aa696b161b --- /dev/null +++ b/Bindings/ata/ahci-mtk.txt @@ -0,0 +1,51 @@ +MediaTek Serial ATA controller + +Required properties: + - compatible : Must be "mediatek,-ahci", "mediatek,mtk-ahci". + When using "mediatek,mtk-ahci" compatible strings, you + need SoC specific ones in addition, one of: + - "mediatek,mt7622-ahci" + - reg : Physical base addresses and length of register sets. + - interrupts : Interrupt associated with the SATA device. + - interrupt-names : Associated name must be: "hostc". + - clocks : A list of phandle and clock specifier pairs, one for each + entry in clock-names. + - clock-names : Associated names must be: "ahb", "axi", "asic", "rbc", "pm". + - phys : A phandle and PHY specifier pair for the PHY port. + - phy-names : Associated name must be: "sata-phy". + - ports-implemented : See ./ahci-platform.txt for details. + +Optional properties: + - power-domains : A phandle and power domain specifier pair to the power + domain which is responsible for collapsing and restoring + power to the peripheral. + - resets : Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. + - reset-names : Associated names must be: "axi", "sw", "reg". + - mediatek,phy-mode : A phandle to the system controller, used to enable + SATA function. + +Example: + + sata: sata@1a200000 { + compatible = "mediatek,mt7622-ahci", + "mediatek,mtk-ahci"; + reg = <0 0x1a200000 0 0x1100>; + interrupts = ; + interrupt-names = "hostc"; + clocks = <&pciesys CLK_SATA_AHB_EN>, + <&pciesys CLK_SATA_AXI_EN>, + <&pciesys CLK_SATA_ASIC_EN>, + <&pciesys CLK_SATA_RBC_EN>, + <&pciesys CLK_SATA_PM_EN>; + clock-names = "ahb", "axi", "asic", "rbc", "pm"; + phys = <&u3port1 PHY_TYPE_SATA>; + phy-names = "sata-phy"; + ports-implemented = <0x1>; + power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; + resets = <&pciesys MT7622_SATA_AXI_BUS_RST>, + <&pciesys MT7622_SATA_PHY_SW_RST>, + <&pciesys MT7622_SATA_PHY_REG_RST>; + reset-names = "axi", "sw", "reg"; + mediatek,phy-mode = <&pciesys>; + }; diff --git a/Bindings/ata/apm-xgene.txt b/Bindings/ata/apm-xgene.txt index a668f0e7d001..02e690a675db 100644 --- a/Bindings/ata/apm-xgene.txt +++ b/Bindings/ata/apm-xgene.txt @@ -57,7 +57,6 @@ Example: <0x0 0x1f227000 0x0 0x1000>; interrupts = <0x0 0x87 0x4>; dma-coherent; - status = "ok"; clocks = <&sataclk 0>; phys = <&phy2 0>; phy-names = "sata-phy"; @@ -72,7 +71,6 @@ Example: <0x0 0x1f237000 0x0 0x1000>; interrupts = <0x0 0x88 0x4>; dma-coherent; - status = "ok"; clocks = <&sataclk 0>; phys = <&phy3 0>; phy-names = "sata-phy"; diff --git a/Bindings/ata/imx-pata.txt b/Bindings/ata/imx-pata.txt index e38d73414b0d..f1172f00188a 100644 --- a/Bindings/ata/imx-pata.txt +++ b/Bindings/ata/imx-pata.txt @@ -13,5 +13,4 @@ Example: reg = <0x83fe0000 0x4000>; interrupts = <70>; clocks = <&clks 161>; - status = "disabled"; }; diff --git a/Bindings/bus/mvebu-mbus.txt b/Bindings/bus/mvebu-mbus.txt index fa6cde41b460..f2ab7fd013bd 100644 --- a/Bindings/bus/mvebu-mbus.txt +++ b/Bindings/bus/mvebu-mbus.txt @@ -227,7 +227,6 @@ See the example below, where a more complete device tree is shown: }; devbus-bootcs { - status = "okay"; ranges = <0 MBUS_ID(0x01, 0x2f) 0 0x8000000>; /* NOR */ @@ -240,7 +239,6 @@ See the example below, where a more complete device tree is shown: pcie-controller { compatible = "marvell,armada-xp-pcie"; - status = "okay"; device_type = "pci"; #address-cells = <3>; @@ -258,7 +256,6 @@ See the example below, where a more complete device tree is shown: pcie@1,0 { /* Port 0, Lane 0 */ - status = "okay"; }; }; diff --git a/Bindings/bus/nvidia,tegra20-gmi.txt b/Bindings/bus/nvidia,tegra20-gmi.txt index 83b0e54f727c..3e21eb822811 100644 --- a/Bindings/bus/nvidia,tegra20-gmi.txt +++ b/Bindings/bus/nvidia,tegra20-gmi.txt @@ -84,7 +84,6 @@ gmi@70090000 { reset-names = "gmi"; ranges = <4 0 0xd0000000 0xfffffff>; - status = "okay"; bus@4,0 { compatible = "simple-bus"; @@ -121,7 +120,6 @@ gmi@70090000 { reset-names = "gmi"; ranges = <4 0 0xd0000000 0xfffffff>; - status = "okay"; can@4,0 { reg = <4 0 0x100>; diff --git a/Bindings/bus/nvidia,tegra210-aconnect.txt b/Bindings/bus/nvidia,tegra210-aconnect.txt index 7ff13be1750b..3108d03802ee 100644 --- a/Bindings/bus/nvidia,tegra210-aconnect.txt +++ b/Bindings/bus/nvidia,tegra210-aconnect.txt @@ -33,7 +33,6 @@ Example: #size-cells = <1>; ranges = <0x702c0000 0x0 0x702c0000 0x00040000>; - status = "disabled"; child1 { ... diff --git a/Bindings/chosen.txt b/Bindings/chosen.txt index dee3f5d9df26..e3b13ea7d2ae 100644 --- a/Bindings/chosen.txt +++ b/Bindings/chosen.txt @@ -5,9 +5,31 @@ The chosen node does not represent a real device, but serves as a place for passing data between firmware and the operating system, like boot arguments. Data in the chosen node does not represent the hardware. +The following properties are recognized: -stdout-path property --------------------- + +kaslr-seed +----------- + +This property is used when booting with CONFIG_RANDOMIZE_BASE as the +entropy used to randomize the kernel image base address location. Since +it is used directly, this value is intended only for KASLR, and should +not be used for other purposes (as it may leak information about KASLR +offsets). It is parsed as a u64 value, e.g. + +/ { + chosen { + kaslr-seed = <0xfeedbeef 0xc0def00d>; + }; +}; + +Note that if this property is set from UEFI (or a bootloader in EFI +mode) when EFI_RNG_PROTOCOL is supported, it will be overwritten by +the Linux EFI stub (which will populate the property itself, using +EFI_RNG_PROTOCOL). + +stdout-path +----------- Device trees may specify the device to be used for boot console output with a stdout-path property under /chosen, as described in the Devicetree diff --git a/Bindings/clock/alphascale,acc.txt b/Bindings/clock/alphascale,acc.txt index 62e67e883e76..b3205b21c9d0 100644 --- a/Bindings/clock/alphascale,acc.txt +++ b/Bindings/clock/alphascale,acc.txt @@ -102,7 +102,6 @@ uart4: serial@80010000 { reg = <0x80010000 0x4000>; clocks = <&acc CLKID_SYS_UART4>, <&acc CLKID_AHB_UART4>; interrupts = <19>; - status = "disabled"; }; Clock consumer with only one, _AHB_ sink. diff --git a/Bindings/clock/amlogic,gxbb-aoclkc.txt b/Bindings/clock/amlogic,gxbb-aoclkc.txt index a55d31b48d6e..786dc39ca904 100644 --- a/Bindings/clock/amlogic,gxbb-aoclkc.txt +++ b/Bindings/clock/amlogic,gxbb-aoclkc.txt @@ -5,9 +5,11 @@ controllers within the Always-On part of the SoC. Required Properties: -- compatible: should be "amlogic,gxbb-aoclkc" -- reg: physical base address of the clock controller and length of memory - mapped region. +- compatible: value should be different for each SoC family as : + - GXBB (S905) : "amlogic,meson-gxbb-aoclkc" + - GXL (S905X, S905D) : "amlogic,meson-gxl-aoclkc" + - GXM (S912) : "amlogic,meson-gxm-aoclkc" + followed by the common "amlogic,meson-gx-aoclkc" - #clock-cells: should be 1. @@ -23,14 +25,22 @@ to specify the reset which they consume. All available resets are defined as preprocessor macros in the dt-bindings/reset/gxbb-aoclkc.h header and can be used in device tree sources. +Parent node should have the following properties : +- compatible: "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd" +- reg: base address and size of the AO system control register space. + Example: AO Clock controller node: - clkc_AO: clock-controller@040 { - compatible = "amlogic,gxbb-aoclkc"; - reg = <0x0 0x040 0x0 0x4>; +ao_sysctrl: sys-ctrl@0 { + compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd"; + reg = <0x0 0x0 0x0 0x100>; + + clkc_AO: clock-controller { + compatible = "amlogic,meson-gxbb-aoclkc", "amlogic,meson-gx-aoclkc"; #clock-cells = <1>; #reset-cells = <1>; }; +}; Example: UART controller node that consumes the clock and reset generated by the clock controller: @@ -41,5 +51,4 @@ Example: UART controller node that consumes the clock and reset generated interrupts = <0 90 1>; clocks = <&clkc_AO CLKID_AO_UART1>; resets = <&clkc_AO RESET_AO_UART1>; - status = "disabled"; }; diff --git a/Bindings/clock/amlogic,gxbb-clkc.txt b/Bindings/clock/amlogic,gxbb-clkc.txt index a09d627b5508..924040769186 100644 --- a/Bindings/clock/amlogic,gxbb-clkc.txt +++ b/Bindings/clock/amlogic,gxbb-clkc.txt @@ -33,5 +33,4 @@ Example: UART controller node that consumes the clock generated by the clock reg = <0xc81004c0 0x14>; interrupts = <0 90 1>; clocks = <&clkc CLKID_CLK81>; - status = "disabled"; }; diff --git a/Bindings/clock/amlogic,meson8b-clkc.txt b/Bindings/clock/amlogic,meson8b-clkc.txt index 606da38c0959..b455c5aa9139 100644 --- a/Bindings/clock/amlogic,meson8b-clkc.txt +++ b/Bindings/clock/amlogic,meson8b-clkc.txt @@ -16,18 +16,25 @@ Required Properties: mapped region. - #clock-cells: should be 1. +- #reset-cells: should be 1. Each clock is assigned an identifier and client nodes can use this identifier to specify the clock which they consume. All available clocks are defined as preprocessor macros in the dt-bindings/clock/meson8b-clkc.h header and can be used in device tree sources. +Similarly a preprocessor macro for each reset line is defined in +dt-bindings/reset/amlogic,meson8b-clkc-reset.h (which can be used from the +device tree sources). + + Example: Clock controller node: clkc: clock-controller@c1104000 { - #clock-cells = <1>; compatible = "amlogic,meson8b-clkc"; reg = <0xc1108000 0x4>, <0xc1104000 0x460>; + #clock-cells = <1>; + #reset-cells = <1>; }; @@ -39,5 +46,4 @@ Example: UART controller node that consumes the clock generated by the clock reg = <0xc81004c0 0x14>; interrupts = <0 90 1>; clocks = <&clkc CLKID_CLK81>; - status = "disabled"; }; diff --git a/Bindings/clock/at91-clock.txt b/Bindings/clock/at91-clock.txt index 5f3ad65daf69..51c259a92d02 100644 --- a/Bindings/clock/at91-clock.txt +++ b/Bindings/clock/at91-clock.txt @@ -81,6 +81,16 @@ Required properties: "atmel,sama5d2-clk-generated": at91 generated clock + "atmel,sama5d2-clk-audio-pll-frac": + at91 audio fractional pll + + "atmel,sama5d2-clk-audio-pll-pad": + at91 audio pll CLK_AUDIO output pin + + "atmel,sama5d2-clk-audio-pll-pmc" + at91 audio pll output on AUDIOPLLCLK that feeds the PMC + and can be used by peripheral clock or generic clock + Required properties for SCKC node: - reg : defines the IO memory reserved for the SCKC. - #size-cells : shall be 0 (reg is used to encode clk id). diff --git a/Bindings/clock/brcm,kona-ccu.txt b/Bindings/clock/brcm,kona-ccu.txt index 5286e260fcae..8e5a7d868557 100644 --- a/Bindings/clock/brcm,kona-ccu.txt +++ b/Bindings/clock/brcm,kona-ccu.txt @@ -46,7 +46,6 @@ Device tree example: uart@3e002000 { compatible = "brcm,bcm11351-dw-apb-uart", "snps,dw-apb-uart"; - status = "disabled"; reg = <0x3e002000 0x1000>; clocks = <&slave_ccu BCM281XX_SLAVE_CCU_UARTB3>; interrupts = ; diff --git a/Bindings/clock/exynos5433-clock.txt b/Bindings/clock/exynos5433-clock.txt index 1dc80f8811fe..fe885abc9cb4 100644 --- a/Bindings/clock/exynos5433-clock.txt +++ b/Bindings/clock/exynos5433-clock.txt @@ -465,5 +465,4 @@ Example 3: UART controller node that consumes the clock generated by the clock clock-names = "uart", "clk_uart_baud0"; pinctrl-names = "default"; pinctrl-0 = <&uart0_bus>; - status = "disabled"; }; diff --git a/Bindings/clock/hi3660-clock.txt b/Bindings/clock/hi3660-clock.txt index cc9b86c35758..0035a7ecaf20 100644 --- a/Bindings/clock/hi3660-clock.txt +++ b/Bindings/clock/hi3660-clock.txt @@ -38,5 +38,4 @@ Examples: clocks = <&crg_ctrl HI3660_CLK_MUX_UART0>, <&crg_ctrl HI3660_PCLK>; clock-names = "uartclk", "apb_pclk"; - status = "disabled"; }; diff --git a/Bindings/clock/hix5hd2-clock.txt b/Bindings/clock/hix5hd2-clock.txt index 7894a64887cb..4733e58e491b 100644 --- a/Bindings/clock/hix5hd2-clock.txt +++ b/Bindings/clock/hix5hd2-clock.txt @@ -27,5 +27,4 @@ Examples: interrupts = <0 49 4>; clocks = <&clock HIX5HD2_FIXED_83M>; clock-names = "apb_pclk"; - status = "disabled"; }; diff --git a/Bindings/clock/idt,versaclock5.txt b/Bindings/clock/idt,versaclock5.txt index 53d7e50ed875..05a245c9df08 100644 --- a/Bindings/clock/idt,versaclock5.txt +++ b/Bindings/clock/idt,versaclock5.txt @@ -1,24 +1,32 @@ -Binding for IDT VersaClock5 programmable i2c clock generator. +Binding for IDT VersaClock 5,6 programmable i2c clock generators. -The IDT VersaClock5 are programmable i2c clock generators providing -from 3 to 12 output clocks. +The IDT VersaClock 5 and VersaClock 6 are programmable i2c clock +generators providing from 3 to 12 output clocks. ==I2C device node== Required properties: -- compatible: shall be one of "idt,5p49v5923" , "idt,5p49v5933" , - "idt,5p49v5935". +- compatible: shall be one of + "idt,5p49v5923" + "idt,5p49v5925" + "idt,5p49v5933" + "idt,5p49v5935" + "idt,5p49v6901" - reg: i2c device address, shall be 0x68 or 0x6a. - #clock-cells: from common clock binding; shall be set to 1. - clocks: from common clock binding; list of parent clock handles, - - 5p49v5923: (required) either or both of XTAL or CLKIN + - 5p49v5923 and + 5p49v5925 and + 5p49v6901: (required) either or both of XTAL or CLKIN reference clock. - 5p49v5933 and - 5p49v5935: (optional) property not present (internal Xtal used) or CLKIN reference clock. - clock-names: from common clock binding; clock input names, can be - - 5p49v5923: (required) either or both of "xin", "clkin". + - 5p49v5923 and + 5p49v5925 and + 5p49v6901: (required) either or both of "xin", "clkin". - 5p49v5933 and - 5p49v5935: (optional) property not present or "clkin". @@ -37,6 +45,7 @@ clock specifier, the following mapping applies: 1 -- OUT1 2 -- OUT4 +5P49V5925 and 5P49V5935: 0 -- OUT0_SEL_I2CB 1 -- OUT1 @@ -44,6 +53,13 @@ clock specifier, the following mapping applies: 3 -- OUT3 4 -- OUT4 +5P49V6901: + 0 -- OUT0_SEL_I2CB + 1 -- OUT1 + 2 -- OUT2 + 3 -- OUT3 + 4 -- OUT4 + ==Example== /* 25MHz reference crystal */ diff --git a/Bindings/clock/imx21-clock.txt b/Bindings/clock/imx21-clock.txt index c3b0db437c48..806f63d628bd 100644 --- a/Bindings/clock/imx21-clock.txt +++ b/Bindings/clock/imx21-clock.txt @@ -24,5 +24,4 @@ Examples: clocks = <&clks IMX21_CLK_UART1_IPG_GATE>, <&clks IMX21_CLK_PER1>; clock-names = "ipg", "per"; - status = "disabled"; }; diff --git a/Bindings/clock/imx23-clock.txt b/Bindings/clock/imx23-clock.txt index 5083c0b834b2..8385348d3bd9 100644 --- a/Bindings/clock/imx23-clock.txt +++ b/Bindings/clock/imx23-clock.txt @@ -67,5 +67,4 @@ auart0: serial@8006c000 { reg = <0x8006c000 0x2000>; interrupts = <24 25 23>; clocks = <&clks 32>; - status = "disabled"; }; diff --git a/Bindings/clock/imx25-clock.txt b/Bindings/clock/imx25-clock.txt index ba6b312ff8a5..f8135ea9ca4e 100644 --- a/Bindings/clock/imx25-clock.txt +++ b/Bindings/clock/imx25-clock.txt @@ -157,5 +157,4 @@ uart1: serial@43f90000 { interrupts = <45>; clocks = <&clks 79>, <&clks 50>; clock-names = "ipg", "per"; - status = "disabled"; }; diff --git a/Bindings/clock/imx27-clock.txt b/Bindings/clock/imx27-clock.txt index cc05de9ec393..4c95c048d3b2 100644 --- a/Bindings/clock/imx27-clock.txt +++ b/Bindings/clock/imx27-clock.txt @@ -24,5 +24,4 @@ Examples: clocks = <&clks IMX27_CLK_UART1_IPG_GATE>, <&clks IMX27_CLK_PER1_GATE>; clock-names = "ipg", "per"; - status = "disabled"; }; diff --git a/Bindings/clock/imx28-clock.txt b/Bindings/clock/imx28-clock.txt index e6587af62ff0..d84a37d2885f 100644 --- a/Bindings/clock/imx28-clock.txt +++ b/Bindings/clock/imx28-clock.txt @@ -90,5 +90,4 @@ auart0: serial@8006a000 { reg = <0x8006a000 0x2000>; interrupts = <112 70 71>; clocks = <&clks 45>; - status = "disabled"; }; diff --git a/Bindings/clock/imx31-clock.txt b/Bindings/clock/imx31-clock.txt index 8163d565f697..0a291090e562 100644 --- a/Bindings/clock/imx31-clock.txt +++ b/Bindings/clock/imx31-clock.txt @@ -87,5 +87,4 @@ uart1: serial@43f90000 { interrupts = <45>; clocks = <&clks 10>, <&clks 30>; clock-names = "ipg", "per"; - status = "disabled"; }; diff --git a/Bindings/clock/imx5-clock.txt b/Bindings/clock/imx5-clock.txt index cadc4d29ada6..a24ca9e582d2 100644 --- a/Bindings/clock/imx5-clock.txt +++ b/Bindings/clock/imx5-clock.txt @@ -25,5 +25,4 @@ can1: can@53fc8000 { interrupts = <82>; clocks = <&clks IMX5_CLK_CAN1_IPG_GATE>, <&clks IMX5_CLK_CAN1_SERIAL_GATE>; clock-names = "ipg", "per"; - status = "disabled"; }; diff --git a/Bindings/clock/imx6q-clock.txt b/Bindings/clock/imx6q-clock.txt index 9252912a5b0e..aa0a4d423ef5 100644 --- a/Bindings/clock/imx6q-clock.txt +++ b/Bindings/clock/imx6q-clock.txt @@ -27,5 +27,4 @@ uart1: serial@02020000 { interrupts = <0 26 0x04>; clocks = <&clks IMX6QDL_CLK_UART_IPG>, <&clks IMX6QDL_CLK_UART_SERIAL>; clock-names = "ipg", "per"; - status = "disabled"; }; diff --git a/Bindings/clock/mt8173-cpu-dvfs.txt b/Bindings/clock/mt8173-cpu-dvfs.txt deleted file mode 100644 index 52b457c23eed..000000000000 --- a/Bindings/clock/mt8173-cpu-dvfs.txt +++ /dev/null @@ -1,83 +0,0 @@ -Device Tree Clock bindins for CPU DVFS of Mediatek MT8173 SoC - -Required properties: -- clocks: A list of phandle + clock-specifier pairs for the clocks listed in clock names. -- clock-names: Should contain the following: - "cpu" - The multiplexer for clock input of CPU cluster. - "intermediate" - A parent of "cpu" clock which is used as "intermediate" clock - source (usually MAINPLL) when the original CPU PLL is under - transition and not stable yet. - Please refer to Documentation/devicetree/bindings/clk/clock-bindings.txt for - generic clock consumer properties. -- proc-supply: Regulator for Vproc of CPU cluster. - -Optional properties: -- sram-supply: Regulator for Vsram of CPU cluster. When present, the cpufreq driver - needs to do "voltage tracking" to step by step scale up/down Vproc and - Vsram to fit SoC specific needs. When absent, the voltage scaling - flow is handled by hardware, hence no software "voltage tracking" is - needed. - -Example: --------- - cpu0: cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a53"; - reg = <0x000>; - enable-method = "psci"; - cpu-idle-states = <&CPU_SLEEP_0>; - clocks = <&infracfg CLK_INFRA_CA53SEL>, - <&apmixedsys CLK_APMIXED_MAINPLL>; - clock-names = "cpu", "intermediate"; - }; - - cpu1: cpu@1 { - device_type = "cpu"; - compatible = "arm,cortex-a53"; - reg = <0x001>; - enable-method = "psci"; - cpu-idle-states = <&CPU_SLEEP_0>; - clocks = <&infracfg CLK_INFRA_CA53SEL>, - <&apmixedsys CLK_APMIXED_MAINPLL>; - clock-names = "cpu", "intermediate"; - }; - - cpu2: cpu@100 { - device_type = "cpu"; - compatible = "arm,cortex-a57"; - reg = <0x100>; - enable-method = "psci"; - cpu-idle-states = <&CPU_SLEEP_0>; - clocks = <&infracfg CLK_INFRA_CA57SEL>, - <&apmixedsys CLK_APMIXED_MAINPLL>; - clock-names = "cpu", "intermediate"; - }; - - cpu3: cpu@101 { - device_type = "cpu"; - compatible = "arm,cortex-a57"; - reg = <0x101>; - enable-method = "psci"; - cpu-idle-states = <&CPU_SLEEP_0>; - clocks = <&infracfg CLK_INFRA_CA57SEL>, - <&apmixedsys CLK_APMIXED_MAINPLL>; - clock-names = "cpu", "intermediate"; - }; - - &cpu0 { - proc-supply = <&mt6397_vpca15_reg>; - }; - - &cpu1 { - proc-supply = <&mt6397_vpca15_reg>; - }; - - &cpu2 { - proc-supply = <&da9211_vcpu_reg>; - sram-supply = <&mt6397_vsramca7_reg>; - }; - - &cpu3 { - proc-supply = <&da9211_vcpu_reg>; - sram-supply = <&mt6397_vsramca7_reg>; - }; diff --git a/Bindings/clock/nvidia,tegra124-dfll.txt b/Bindings/clock/nvidia,tegra124-dfll.txt index 63f9d8277d48..dff236f524a7 100644 --- a/Bindings/clock/nvidia,tegra124-dfll.txt +++ b/Bindings/clock/nvidia,tegra124-dfll.txt @@ -66,7 +66,6 @@ clock@70110000 { #clock-cells = <0>; clock-output-names = "dfllCPU_out"; vdd-cpu-supply = <&vdd_cpu>; - status = "okay"; nvidia,sample-rate = <12500>; nvidia,droop-ctrl = <0x00000f00>; diff --git a/Bindings/clock/pxa-clock.txt b/Bindings/clock/pxa-clock.txt index 4b4a9024bd99..8f67239411fe 100644 --- a/Bindings/clock/pxa-clock.txt +++ b/Bindings/clock/pxa-clock.txt @@ -12,5 +12,4 @@ Examples: pxa2xx_clks: pxa2xx_clks@41300004 { compatible = "marvell,pxa-clocks"; #clock-cells = <1>; - status = "okay"; }; diff --git a/Bindings/clock/renesas,cpg-mssr.txt b/Bindings/clock/renesas,cpg-mssr.txt index 0cd894f987a3..316e13686568 100644 --- a/Bindings/clock/renesas,cpg-mssr.txt +++ b/Bindings/clock/renesas,cpg-mssr.txt @@ -22,6 +22,7 @@ Required Properties: - "renesas,r8a7794-cpg-mssr" for the r8a7794 SoC (R-Car E2) - "renesas,r8a7795-cpg-mssr" for the r8a7795 SoC (R-Car H3) - "renesas,r8a7796-cpg-mssr" for the r8a7796 SoC (R-Car M3-W) + - "renesas,r8a77995-cpg-mssr" for the r8a77995 SoC (R-Car D3) - reg: Base address and length of the memory resource used by the CPG/MSSR block @@ -30,7 +31,7 @@ Required Properties: clock-names - clock-names: List of external parent clock names. Valid names are: - "extal" (r8a7743, r8a7745, r8a7790, r8a7791, r8a7792, r8a7793, r8a7794, - r8a7795, r8a7796) + r8a7795, r8a7796, r8a77995) - "extalr" (r8a7795, r8a7796) - "usb_extal" (r8a7743, r8a7745, r8a7790, r8a7791, r8a7793, r8a7794) @@ -81,5 +82,4 @@ Examples dma-names = "tx", "rx"; power-domains = <&cpg>; resets = <&cpg 310>; - status = "disabled"; }; diff --git a/Bindings/clock/renesas,r8a7778-cpg-clocks.txt b/Bindings/clock/renesas,r8a7778-cpg-clocks.txt index e4cdaf1cb333..7cc4c0330b53 100644 --- a/Bindings/clock/renesas,r8a7778-cpg-clocks.txt +++ b/Bindings/clock/renesas,r8a7778-cpg-clocks.txt @@ -44,5 +44,4 @@ Examples interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7778_CLK_SDHI0>; power-domains = <&cpg_clocks>; - status = "disabled"; }; diff --git a/Bindings/clock/renesas,rcar-usb2-clock-sel.txt b/Bindings/clock/renesas,rcar-usb2-clock-sel.txt new file mode 100644 index 000000000000..e96e085271c1 --- /dev/null +++ b/Bindings/clock/renesas,rcar-usb2-clock-sel.txt @@ -0,0 +1,55 @@ +* Renesas R-Car USB 2.0 clock selector + +This file provides information on what the device node for the R-Car USB 2.0 +clock selector. + +If you connect an external clock to the USB_EXTAL pin only, you should set +the clock rate to "usb_extal" node only. +If you connect an oscillator to both the USB_XTAL and USB_EXTAL, this module +is not needed because this is default setting. (Of course, you can set the +clock rates to both "usb_extal" and "usb_xtal" nodes. + +Case 1: An external clock connects to R-Car SoC + +----------+ +--- R-Car ---------------------+ + |External |---|USB_EXTAL ---> all usb channels| + |clock | |USB_XTAL | + +----------+ +-------------------------------+ +In this case, we need this driver with "usb_extal" clock. + +Case 2: An oscillator connects to R-Car SoC + +----------+ +--- R-Car ---------------------+ + |Oscillator|---|USB_EXTAL -+-> all usb channels| + | |---|USB_XTAL --+ | + +----------+ +-------------------------------+ +In this case, we don't need this selector. + +Required properties: +- compatible: "renesas,r8a7795-rcar-usb2-clock-sel" if the device is a part of + an R8A7795 SoC. + "renesas,r8a7796-rcar-usb2-clock-sel" if the device if a part of + an R8A7796 SoC. + "renesas,rcar-gen3-usb2-clock-sel" for a generic R-Car Gen3 + compatible device. + + When compatible with the generic version, nodes must list the + SoC-specific version corresponding to the platform first + followed by the generic version. + +- reg: offset and length of the USB 2.0 clock selector register block. +- clocks: A list of phandles and specifier pairs. +- clock-names: Name of the clocks. + - The functional clock must be "ehci_ohci" + - The USB_EXTAL clock pin must be "usb_extal" + - The USB_XTAL clock pin must be "usb_xtal" +- #clock-cells: Must be 0 + +Example (R-Car H3): + + usb2_clksel: clock-controller@e6590630 { + compatible = "renesas,r8a77950-rcar-usb2-clock-sel", + "renesas,rcar-gen3-usb2-clock-sel"; + reg = <0 0xe6590630 0 0x02>; + clocks = <&cpg CPG_MOD 703>, <&usb_extal>, <&usb_xtal>; + clock-names = "ehci_ohci", "usb_extal", "usb_xtal"; + #clock-cells = <0>; + }; diff --git a/Bindings/clock/renesas,rz-cpg-clocks.txt b/Bindings/clock/renesas,rz-cpg-clocks.txt index bb51a33a1fbf..bb5d942075fb 100644 --- a/Bindings/clock/renesas,rz-cpg-clocks.txt +++ b/Bindings/clock/renesas,rz-cpg-clocks.txt @@ -50,5 +50,4 @@ Examples clocks = <&mstp3_clks R7S72100_CLK_MTU2>; clock-names = "fck"; power-domains = <&cpg_clocks>; - status = "disabled"; }; diff --git a/Bindings/clock/rockchip,rk3128-cru.txt b/Bindings/clock/rockchip,rk3128-cru.txt index 455a9a00a623..6f8744fd301b 100644 --- a/Bindings/clock/rockchip,rk3128-cru.txt +++ b/Bindings/clock/rockchip,rk3128-cru.txt @@ -1,12 +1,14 @@ -* Rockchip RK3128 Clock and Reset Unit +* Rockchip RK3126/RK3128 Clock and Reset Unit -The RK3128 clock controller generates and supplies clock to various +The RK3126/RK3128 clock controller generates and supplies clock to various controllers within the SoC and also implements a reset controller for SoC peripherals. Required Properties: -- compatible: should be "rockchip,rk3128-cru" +- compatible: should be "rockchip,rk3126-cru" or "rockchip,rk3128-cru" + "rockchip,rk3126-cru" - controller compatible with RK3126 SoC. + "rockchip,rk3128-cru" - controller compatible with RK3128 SoC. - reg: physical base address of the controller and length of memory mapped region. - #clock-cells: should be 1. diff --git a/Bindings/clock/samsung,s3c2410-clock.txt b/Bindings/clock/samsung,s3c2410-clock.txt index 822505e715ae..2632d3f13004 100644 --- a/Bindings/clock/samsung,s3c2410-clock.txt +++ b/Bindings/clock/samsung,s3c2410-clock.txt @@ -46,5 +46,4 @@ Example: UART controller node that consumes the clock generated by the clock interrupts = <1 23 3 4>, <1 23 4 4>; clock-names = "uart", "clk_uart_baud2"; clocks = <&clocks PCLK_UART0>, <&clocks PCLK_UART0>; - status = "disabled"; }; diff --git a/Bindings/clock/samsung,s3c2412-clock.txt b/Bindings/clock/samsung,s3c2412-clock.txt index 2b430960ba47..21a8c23e658f 100644 --- a/Bindings/clock/samsung,s3c2412-clock.txt +++ b/Bindings/clock/samsung,s3c2412-clock.txt @@ -46,5 +46,4 @@ Example: UART controller node that consumes the clock generated by the clock clock-names = "uart", "clk_uart_baud2", "clk_uart_baud3"; clocks = <&clocks PCLK_UART0>, <&clocks PCLK_UART0>, <&clocks SCLK_UART>; - status = "disabled"; }; diff --git a/Bindings/clock/samsung,s3c2443-clock.txt b/Bindings/clock/samsung,s3c2443-clock.txt index e67bb05478af..985c0f574e9a 100644 --- a/Bindings/clock/samsung,s3c2443-clock.txt +++ b/Bindings/clock/samsung,s3c2443-clock.txt @@ -52,5 +52,4 @@ Example: UART controller node that consumes the clock generated by the clock "clk_uart_baud3"; clocks = <&clocks PCLK_UART0>, <&clocks PCLK_UART0>, <&clocks SCLK_UART>; - status = "disabled"; }; diff --git a/Bindings/clock/samsung,s3c64xx-clock.txt b/Bindings/clock/samsung,s3c64xx-clock.txt index fa171dc4bd3c..872ee8e0f041 100644 --- a/Bindings/clock/samsung,s3c64xx-clock.txt +++ b/Bindings/clock/samsung,s3c64xx-clock.txt @@ -73,5 +73,4 @@ Example: UART controller node that consumes the clock generated by the clock "clk_uart_baud3"; clocks = <&clock PCLK_UART0>, <&clocks PCLK_UART0>, <&clock SCLK_UART>; - status = "disabled"; }; diff --git a/Bindings/clock/samsung,s5pv210-clock.txt b/Bindings/clock/samsung,s5pv210-clock.txt index effd9401c133..15b48e20a061 100644 --- a/Bindings/clock/samsung,s5pv210-clock.txt +++ b/Bindings/clock/samsung,s5pv210-clock.txt @@ -74,5 +74,4 @@ Example: UART controller node that consumes the clock generated by the clock "clk_uart_baud1"; clocks = <&clocks UART0>, <&clocks UART0>, <&clocks SCLK_UART0>; - status = "disabled"; }; diff --git a/Bindings/clock/silabs,si5351.txt b/Bindings/clock/silabs,si5351.txt index 28b28309f535..a6c4ef343b44 100644 --- a/Bindings/clock/silabs,si5351.txt +++ b/Bindings/clock/silabs,si5351.txt @@ -12,7 +12,11 @@ generators can be found in [1]. ==I2C device node== Required properties: -- compatible: shall be one of "silabs,si5351{a,a-msop,b,c}". +- compatible: shall be one of the following: + "silabs,si5351a" - Si5351a, QFN20 package + "silabs,si5351a-msop" - Si5351a, MSOP10 package + "silabs,si5351b" - Si5351b, QFN20 package + "silabs,si5351c" - Si5351c, QFN20 package - reg: i2c device address, shall be 0x60 or 0x61. - #clock-cells: from common clock binding; shall be set to 1. - clocks: from common clock binding; list of parent clock diff --git a/Bindings/clock/snps,hsdk-pll-clock.txt b/Bindings/clock/snps,hsdk-pll-clock.txt new file mode 100644 index 000000000000..c56c7553c730 --- /dev/null +++ b/Bindings/clock/snps,hsdk-pll-clock.txt @@ -0,0 +1,28 @@ +Binding for the HSDK Generic PLL clock + +This binding uses the common clock binding[1]. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible: should be "snps,hsdk--pll-clock" + "snps,hsdk-core-pll-clock" + "snps,hsdk-gp-pll-clock" + "snps,hsdk-hdmi-pll-clock" +- reg : should contain base register location and length. +- clocks: shall be the input parent clock phandle for the PLL. +- #clock-cells: from common clock binding; Should always be set to 0. + +Example: + input_clk: input-clk { + clock-frequency = <33333333>; + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + + cpu_clk: cpu-clk@0 { + compatible = "snps,hsdk-core-pll-clock"; + reg = <0x00 0x10>; + #clock-cells = <0>; + clocks = <&input_clk>; + }; diff --git a/Bindings/clock/snps,pll-clock.txt b/Bindings/clock/snps,pll-clock.txt new file mode 100644 index 000000000000..11fe4876612c --- /dev/null +++ b/Bindings/clock/snps,pll-clock.txt @@ -0,0 +1,28 @@ +Binding for the AXS10X Generic PLL clock + +This binding uses the common clock binding[1]. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible: should be "snps,axs10x--pll-clock" + "snps,axs10x-arc-pll-clock" + "snps,axs10x-pgu-pll-clock" +- reg: should always contain 2 pairs address - length: first for PLL config +registers and second for corresponding LOCK CGU register. +- clocks: shall be the input parent clock phandle for the PLL. +- #clock-cells: from common clock binding; Should always be set to 0. + +Example: + input-clk: input-clk { + clock-frequency = <33333333>; + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + + core-clk: core-clk@80 { + compatible = "snps,axs10x-arc-pll-clock"; + reg = <0x80 0x10>, <0x100 0x10>; + #clock-cells = <0>; + clocks = <&input-clk>; + }; diff --git a/Bindings/clock/st,stm32h7-rcc.txt b/Bindings/clock/st,stm32h7-rcc.txt new file mode 100644 index 000000000000..cac24ee10b72 --- /dev/null +++ b/Bindings/clock/st,stm32h7-rcc.txt @@ -0,0 +1,71 @@ +STMicroelectronics STM32H7 Reset and Clock Controller +===================================================== + +The RCC IP is both a reset and a clock controller. + +Please refer to clock-bindings.txt for common clock controller binding usage. +Please also refer to reset.txt for common reset controller binding usage. + +Required properties: +- compatible: Should be: + "st,stm32h743-rcc" + +- reg: should be register base and length as documented in the + datasheet + +- #reset-cells: 1, see below + +- #clock-cells : from common clock binding; shall be set to 1 + +- clocks: External oscillator clock phandle + - high speed external clock signal (HSE) + - low speed external clock signal (LSE) + - external I2S clock (I2S_CKIN) + +Optional properties: +- st,syscfg: phandle for pwrcfg, mandatory to disable/enable backup domain + write protection (RTC clock). + +Example: + + rcc: reset-clock-controller@58024400 { + compatible = "st,stm32h743-rcc", "st,stm32-rcc"; + reg = <0x58024400 0x400>; + #reset-cells = <1>; + #clock-cells = <1>; + clocks = <&clk_hse>, <&clk_lse>, <&clk_i2s_ckin>; + + st,syscfg = <&pwrcfg>; +}; + +The peripheral clock consumer should specify the desired clock by +having the clock ID in its "clocks" phandle cell. + +Example: + + timer5: timer@40000c00 { + compatible = "st,stm32-timer"; + reg = <0x40000c00 0x400>; + interrupts = <50>; + clocks = <&rcc TIM5_CK>; + }; + +Specifying softreset control of devices +======================================= + +Device nodes should specify the reset channel required in their "resets" +property, containing a phandle to the reset device node and an index specifying +which channel to use. +The index is the bit number within the RCC registers bank, starting from RCC +base address. +It is calculated as: index = register_offset / 4 * 32 + bit_offset. +Where bit_offset is the bit offset within the register. + +For example, for CRC reset: + crc = AHB4RSTR_offset / 4 * 32 + CRCRST_bit_offset = 0x88 / 4 * 32 + 19 = 1107 + +Example: + + timer2 { + resets = <&rcc STM32H7_APB1L_RESET(TIM2)>; + }; diff --git a/Bindings/clock/sunxi-ccu.txt b/Bindings/clock/sunxi-ccu.txt index df9fad58facd..7eda08eb8a1e 100644 --- a/Bindings/clock/sunxi-ccu.txt +++ b/Bindings/clock/sunxi-ccu.txt @@ -3,18 +3,24 @@ Allwinner Clock Control Unit Binding Required properties : - compatible: must contain one of the following compatibles: + - "allwinner,sun4i-a10-ccu" + - "allwinner,sun5i-a10s-ccu" + - "allwinner,sun5i-a13-ccu" - "allwinner,sun6i-a31-ccu" + - "allwinner,sun7i-a20-ccu" - "allwinner,sun8i-a23-ccu" - "allwinner,sun8i-a33-ccu" - "allwinner,sun8i-a83t-ccu" - "allwinner,sun8i-a83t-r-ccu" - "allwinner,sun8i-h3-ccu" - "allwinner,sun8i-h3-r-ccu" ++ - "allwinner,sun8i-r40-ccu" - "allwinner,sun8i-v3s-ccu" - "allwinner,sun9i-a80-ccu" - "allwinner,sun50i-a64-ccu" - "allwinner,sun50i-a64-r-ccu" - "allwinner,sun50i-h5-ccu" + - "nextthing,gr8-ccu" - reg: Must contain the registers base address and length - clocks: phandle to the oscillators feeding the CCU. Two are needed: diff --git a/Bindings/clock/ti,sci-clk.txt b/Bindings/clock/ti,sci-clk.txt index 1e884c40ab50..4e59dc6b1778 100644 --- a/Bindings/clock/ti,sci-clk.txt +++ b/Bindings/clock/ti,sci-clk.txt @@ -14,10 +14,9 @@ Required properties: - compatible: Must be "ti,k2g-sci-clk" - #clock-cells: Shall be 2. In clock consumers, this cell represents the device ID and clock ID - exposed by the PM firmware. The assignments can be found in the header - files .h> (which covers the device IDs) and - .h> (which covers the clock IDs), where - is the SoC involved, for example 'k2g'. + exposed by the PM firmware. The list of valid values for the device IDs + and clocks IDs for 66AK2G SoC are documented at + http://processors.wiki.ti.com/index.php/TISCI#66AK2G02_Data Examples: -------- diff --git a/Bindings/clock/ti/dra7-atl.txt b/Bindings/clock/ti/dra7-atl.txt index 585e8c191f50..10f7047755f3 100644 --- a/Bindings/clock/ti/dra7-atl.txt +++ b/Bindings/clock/ti/dra7-atl.txt @@ -81,13 +81,11 @@ atl: atl@4843c000 { <&atl_clkin2_ck>, <&atl_clkin3_ck>; clocks = <&atl_gfclk_mux>; clock-names = "fck"; - status = "disabled"; }; #include &atl { - status = "okay"; atl2 { bws = ; diff --git a/Bindings/clock/uniphier-clock.txt b/Bindings/clock/uniphier-clock.txt index 812163060fa3..7b5f602765fe 100644 --- a/Bindings/clock/uniphier-clock.txt +++ b/Bindings/clock/uniphier-clock.txt @@ -6,7 +6,6 @@ System clock Required properties: - compatible: should be one of the following: - "socionext,uniphier-sld3-clock" - for sLD3 SoC. "socionext,uniphier-ld4-clock" - for LD4 SoC. "socionext,uniphier-pro4-clock" - for Pro4 SoC. "socionext,uniphier-sld8-clock" - for sLD8 SoC. @@ -14,6 +13,7 @@ Required properties: "socionext,uniphier-pxs2-clock" - for PXs2/LD6b SoC. "socionext,uniphier-ld11-clock" - for LD11 SoC. "socionext,uniphier-ld20-clock" - for LD20 SoC. + "socionext,uniphier-pxs3-clock" - for PXs3 SoC - #clock-cells: should be 1. Example: @@ -48,7 +48,6 @@ Media I/O (MIO) clock, SD clock Required properties: - compatible: should be one of the following: - "socionext,uniphier-sld3-mio-clock" - for sLD3 SoC. "socionext,uniphier-ld4-mio-clock" - for LD4 SoC. "socionext,uniphier-pro4-mio-clock" - for Pro4 SoC. "socionext,uniphier-sld8-mio-clock" - for sLD8 SoC. @@ -56,6 +55,7 @@ Required properties: "socionext,uniphier-pxs2-sd-clock" - for PXs2/LD6b SoC. "socionext,uniphier-ld11-mio-clock" - for LD11 SoC. "socionext,uniphier-ld20-sd-clock" - for LD20 SoC. + "socionext,uniphier-pxs3-sd-clock" - for PXs3 SoC - #clock-cells: should be 1. Example: @@ -82,11 +82,9 @@ Provided clocks: 8: USB2 ch0 host 9: USB2 ch1 host 10: USB2 ch2 host -11: USB2 ch3 host 12: USB2 ch0 PHY 13: USB2 ch1 PHY 14: USB2 ch2 PHY -15: USB2 ch3 PHY Peripheral clock @@ -94,7 +92,6 @@ Peripheral clock Required properties: - compatible: should be one of the following: - "socionext,uniphier-sld3-peri-clock" - for sLD3 SoC. "socionext,uniphier-ld4-peri-clock" - for LD4 SoC. "socionext,uniphier-pro4-peri-clock" - for Pro4 SoC. "socionext,uniphier-sld8-peri-clock" - for sLD8 SoC. @@ -102,6 +99,7 @@ Required properties: "socionext,uniphier-pxs2-peri-clock" - for PXs2/LD6b SoC. "socionext,uniphier-ld11-peri-clock" - for LD11 SoC. "socionext,uniphier-ld20-peri-clock" - for LD20 SoC. + "socionext,uniphier-pxs3-peri-clock" - for PXs3 SoC - #clock-cells: should be 1. Example: diff --git a/Bindings/clock/zx296702-clk.txt b/Bindings/clock/zx296702-clk.txt index 750442b65505..e85ecb510d56 100644 --- a/Bindings/clock/zx296702-clk.txt +++ b/Bindings/clock/zx296702-clk.txt @@ -31,5 +31,4 @@ uart0: serial@0x09405000 { reg = <0x09405000 0x1000>; interrupts = ; clocks = <&lsp1clk ZX296702_UART0_PCLK>; - status = "disabled"; }; diff --git a/Bindings/clock/zx296718-clk.txt b/Bindings/clock/zx296718-clk.txt index 4ad703808407..3a46bf0b2540 100644 --- a/Bindings/clock/zx296718-clk.txt +++ b/Bindings/clock/zx296718-clk.txt @@ -34,5 +34,4 @@ usbphy0:usb-phy0 { #phy-cells = <0>; clocks = <&topclk USB20_PHY_CLK>; clock-names = "phyclk"; - status = "okay"; }; diff --git a/Bindings/cpufreq/cpufreq-mediatek.txt b/Bindings/cpufreq/cpufreq-mediatek.txt new file mode 100644 index 000000000000..f6403089edcf --- /dev/null +++ b/Bindings/cpufreq/cpufreq-mediatek.txt @@ -0,0 +1,247 @@ +Binding for MediaTek's CPUFreq driver +===================================== + +Required properties: +- clocks: A list of phandle + clock-specifier pairs for the clocks listed in clock names. +- clock-names: Should contain the following: + "cpu" - The multiplexer for clock input of CPU cluster. + "intermediate" - A parent of "cpu" clock which is used as "intermediate" clock + source (usually MAINPLL) when the original CPU PLL is under + transition and not stable yet. + Please refer to Documentation/devicetree/bindings/clk/clock-bindings.txt for + generic clock consumer properties. +- operating-points-v2: Please refer to Documentation/devicetree/bindings/opp/opp.txt + for detail. +- proc-supply: Regulator for Vproc of CPU cluster. + +Optional properties: +- sram-supply: Regulator for Vsram of CPU cluster. When present, the cpufreq driver + needs to do "voltage tracking" to step by step scale up/down Vproc and + Vsram to fit SoC specific needs. When absent, the voltage scaling + flow is handled by hardware, hence no software "voltage tracking" is + needed. +- #cooling-cells: +- cooling-min-level: +- cooling-max-level: + Please refer to Documentation/devicetree/bindings/thermal/thermal.txt + for detail. + +Example 1 (MT7623 SoC): + + cpu_opp_table: opp_table { + compatible = "operating-points-v2"; + opp-shared; + + opp-598000000 { + opp-hz = /bits/ 64 <598000000>; + opp-microvolt = <1050000>; + }; + + opp-747500000 { + opp-hz = /bits/ 64 <747500000>; + opp-microvolt = <1050000>; + }; + + opp-1040000000 { + opp-hz = /bits/ 64 <1040000000>; + opp-microvolt = <1150000>; + }; + + opp-1196000000 { + opp-hz = /bits/ 64 <1196000000>; + opp-microvolt = <1200000>; + }; + + opp-1300000000 { + opp-hz = /bits/ 64 <1300000000>; + opp-microvolt = <1300000>; + }; + }; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x0>; + clocks = <&infracfg CLK_INFRA_CPUSEL>, + <&apmixedsys CLK_APMIXED_MAINPLL>; + clock-names = "cpu", "intermediate"; + operating-points-v2 = <&cpu_opp_table>; + #cooling-cells = <2>; + cooling-min-level = <0>; + cooling-max-level = <7>; + }; + cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x1>; + operating-points-v2 = <&cpu_opp_table>; + }; + cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x2>; + operating-points-v2 = <&cpu_opp_table>; + }; + cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0x3>; + operating-points-v2 = <&cpu_opp_table>; + }; + +Example 2 (MT8173 SoC): + cpu_opp_table_a: opp_table_a { + compatible = "operating-points-v2"; + opp-shared; + + opp-507000000 { + opp-hz = /bits/ 64 <507000000>; + opp-microvolt = <859000>; + }; + + opp-702000000 { + opp-hz = /bits/ 64 <702000000>; + opp-microvolt = <908000>; + }; + + opp-1001000000 { + opp-hz = /bits/ 64 <1001000000>; + opp-microvolt = <983000>; + }; + + opp-1105000000 { + opp-hz = /bits/ 64 <1105000000>; + opp-microvolt = <1009000>; + }; + + opp-1183000000 { + opp-hz = /bits/ 64 <1183000000>; + opp-microvolt = <1028000>; + }; + + opp-1404000000 { + opp-hz = /bits/ 64 <1404000000>; + opp-microvolt = <1083000>; + }; + + opp-1508000000 { + opp-hz = /bits/ 64 <1508000000>; + opp-microvolt = <1109000>; + }; + + opp-1573000000 { + opp-hz = /bits/ 64 <1573000000>; + opp-microvolt = <1125000>; + }; + }; + + cpu_opp_table_b: opp_table_b { + compatible = "operating-points-v2"; + opp-shared; + + opp-507000000 { + opp-hz = /bits/ 64 <507000000>; + opp-microvolt = <828000>; + }; + + opp-702000000 { + opp-hz = /bits/ 64 <702000000>; + opp-microvolt = <867000>; + }; + + opp-1001000000 { + opp-hz = /bits/ 64 <1001000000>; + opp-microvolt = <927000>; + }; + + opp-1209000000 { + opp-hz = /bits/ 64 <1209000000>; + opp-microvolt = <968000>; + }; + + opp-1404000000 { + opp-hz = /bits/ 64 <1007000000>; + opp-microvolt = <1028000>; + }; + + opp-1612000000 { + opp-hz = /bits/ 64 <1612000000>; + opp-microvolt = <1049000>; + }; + + opp-1807000000 { + opp-hz = /bits/ 64 <1807000000>; + opp-microvolt = <1089000>; + }; + + opp-1989000000 { + opp-hz = /bits/ 64 <1989000000>; + opp-microvolt = <1125000>; + }; + }; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53"; + reg = <0x000>; + enable-method = "psci"; + cpu-idle-states = <&CPU_SLEEP_0>; + clocks = <&infracfg CLK_INFRA_CA53SEL>, + <&apmixedsys CLK_APMIXED_MAINPLL>; + clock-names = "cpu", "intermediate"; + operating-points-v2 = <&cpu_opp_table_a>; + }; + + cpu1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a53"; + reg = <0x001>; + enable-method = "psci"; + cpu-idle-states = <&CPU_SLEEP_0>; + clocks = <&infracfg CLK_INFRA_CA53SEL>, + <&apmixedsys CLK_APMIXED_MAINPLL>; + clock-names = "cpu", "intermediate"; + operating-points-v2 = <&cpu_opp_table_a>; + }; + + cpu2: cpu@100 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x100>; + enable-method = "psci"; + cpu-idle-states = <&CPU_SLEEP_0>; + clocks = <&infracfg CLK_INFRA_CA57SEL>, + <&apmixedsys CLK_APMIXED_MAINPLL>; + clock-names = "cpu", "intermediate"; + operating-points-v2 = <&cpu_opp_table_b>; + }; + + cpu3: cpu@101 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x101>; + enable-method = "psci"; + cpu-idle-states = <&CPU_SLEEP_0>; + clocks = <&infracfg CLK_INFRA_CA57SEL>, + <&apmixedsys CLK_APMIXED_MAINPLL>; + clock-names = "cpu", "intermediate"; + operating-points-v2 = <&cpu_opp_table_b>; + }; + + &cpu0 { + proc-supply = <&mt6397_vpca15_reg>; + }; + + &cpu1 { + proc-supply = <&mt6397_vpca15_reg>; + }; + + &cpu2 { + proc-supply = <&da9211_vcpu_reg>; + sram-supply = <&mt6397_vsramca7_reg>; + }; + + &cpu3 { + proc-supply = <&da9211_vcpu_reg>; + sram-supply = <&mt6397_vsramca7_reg>; + }; diff --git a/Bindings/crypto/artpec6-crypto.txt b/Bindings/crypto/artpec6-crypto.txt new file mode 100644 index 000000000000..d9cca4875bd6 --- /dev/null +++ b/Bindings/crypto/artpec6-crypto.txt @@ -0,0 +1,16 @@ +Axis crypto engine with PDMA interface. + +Required properties: +- compatible : Should be one of the following strings: + "axis,artpec6-crypto" for the version in the Axis ARTPEC-6 SoC + "axis,artpec7-crypto" for the version in the Axis ARTPEC-7 SoC. +- reg: Base address and size for the PDMA register area. +- interrupts: Interrupt handle for the PDMA interrupt line. + +Example: + +crypto@f4264000 { + compatible = "axis,artpec6-crypto"; + reg = <0xf4264000 0x1000>; + interrupts = ; +}; diff --git a/Bindings/crypto/atmel-crypto.txt b/Bindings/crypto/atmel-crypto.txt index f2aab3dc2b52..7de1a9674c70 100644 --- a/Bindings/crypto/atmel-crypto.txt +++ b/Bindings/crypto/atmel-crypto.txt @@ -66,3 +66,16 @@ sha@f8034000 { dmas = <&dma1 2 17>; dma-names = "tx"; }; + +* Eliptic Curve Cryptography (I2C) + +Required properties: +- compatible : must be "atmel,atecc508a". +- reg: I2C bus address of the device. +- clock-frequency: must be present in the i2c controller node. + +Example: +atecc508a@C0 { + compatible = "atmel,atecc508a"; + reg = <0xC0>; +}; diff --git a/Bindings/crypto/fsl-dcp.txt b/Bindings/crypto/fsl-dcp.txt index 6949e50f1f16..76a0b4e80e83 100644 --- a/Bindings/crypto/fsl-dcp.txt +++ b/Bindings/crypto/fsl-dcp.txt @@ -13,5 +13,4 @@ dcp@80028000 { compatible = "fsl,imx28-dcp", "fsl,imx23-dcp"; reg = <0x80028000 0x2000>; interrupts = <52 53>; - status = "okay"; }; diff --git a/Bindings/crypto/inside-secure-safexcel.txt b/Bindings/crypto/inside-secure-safexcel.txt index 941bb6a6fb13..fbc07d12322f 100644 --- a/Bindings/crypto/inside-secure-safexcel.txt +++ b/Bindings/crypto/inside-secure-safexcel.txt @@ -23,5 +23,4 @@ Example: interrupt-names = "mem", "ring0", "ring1", "ring2", "ring3", "eip"; clocks = <&cpm_syscon0 1 26>; - status = "disabled"; }; diff --git a/Bindings/crypto/marvell-cesa.txt b/Bindings/crypto/marvell-cesa.txt index c6c6a4a045bd..28d3f2496b89 100644 --- a/Bindings/crypto/marvell-cesa.txt +++ b/Bindings/crypto/marvell-cesa.txt @@ -41,5 +41,4 @@ Examples: clock-names = "cesa0", "cesa1"; marvell,crypto-srams = <&crypto_sram0>, <&crypto_sram1>; marvell,crypto-sram-size = <0x600>; - status = "okay"; }; diff --git a/Bindings/crypto/mv_cesa.txt b/Bindings/crypto/mv_cesa.txt index c0c35f00335b..d9b92e2f3138 100644 --- a/Bindings/crypto/mv_cesa.txt +++ b/Bindings/crypto/mv_cesa.txt @@ -29,5 +29,4 @@ Examples: interrupts = <22>; marvell,crypto-srams = <&crypto_sram>; marvell,crypto-sram-size = <0x600>; - status = "okay"; }; diff --git a/Bindings/crypto/rockchip-crypto.txt b/Bindings/crypto/rockchip-crypto.txt index 096df34b11c1..5e2ba385b8c9 100644 --- a/Bindings/crypto/rockchip-crypto.txt +++ b/Bindings/crypto/rockchip-crypto.txt @@ -25,5 +25,4 @@ Examples: clock-names = "aclk", "hclk", "sclk", "apb_pclk"; resets = <&cru SRST_CRYPTO>; reset-names = "crypto-rst"; - status = "okay"; }; diff --git a/Bindings/crypto/st,stm32-hash.txt b/Bindings/crypto/st,stm32-hash.txt new file mode 100644 index 000000000000..04fc246f02f7 --- /dev/null +++ b/Bindings/crypto/st,stm32-hash.txt @@ -0,0 +1,30 @@ +* STMicroelectronics STM32 HASH + +Required properties: +- compatible: Should contain entries for this and backward compatible + HASH versions: + - "st,stm32f456-hash" for stm32 F456. + - "st,stm32f756-hash" for stm32 F756. +- reg: The address and length of the peripheral registers space +- interrupts: the interrupt specifier for the HASH +- clocks: The input clock of the HASH instance + +Optional properties: +- resets: The input reset of the HASH instance +- dmas: DMA specifiers for the HASH. See the DMA client binding, + Documentation/devicetree/bindings/dma/dma.txt +- dma-names: DMA request name. Should be "in" if a dma is present. +- dma-maxburst: Set number of maximum dma burst supported + +Example: + +hash1: hash@50060400 { + compatible = "st,stm32f756-hash"; + reg = <0x50060400 0x400>; + interrupts = <80>; + clocks = <&rcc 0 STM32F7_AHB2_CLOCK(HASH)>; + resets = <&rcc STM32F7_AHB2_RESET(HASH)>; + dmas = <&dma2 7 2 0x400 0x0>; + dma-names = "in"; + dma-maxburst = <0>; +}; diff --git a/Bindings/devfreq/event/rockchip-dfi.txt b/Bindings/devfreq/event/rockchip-dfi.txt index f2233138eba9..001dd63979a9 100644 --- a/Bindings/devfreq/event/rockchip-dfi.txt +++ b/Bindings/devfreq/event/rockchip-dfi.txt @@ -15,5 +15,4 @@ Example: rockchip,pmu = <&pmugrf>; clocks = <&cru PCLK_DDR_MON>; clock-names = "pclk_ddr_mon"; - status = "disabled"; }; diff --git a/Bindings/devfreq/rk3399_dmc.txt b/Bindings/devfreq/rk3399_dmc.txt index 7a9e8603c150..d6d2833482c9 100644 --- a/Bindings/devfreq/rk3399_dmc.txt +++ b/Bindings/devfreq/rk3399_dmc.txt @@ -205,5 +205,4 @@ Example: rockchip,phy_lpddr4_ck_cs_drv = ; rockchip,phy_lpddr4_dq_drv = ; rockchip,phy_lpddr4_odt = ; - status = "disabled"; }; diff --git a/Bindings/display/atmel,lcdc.txt b/Bindings/display/atmel,lcdc.txt index ecb8da063d07..1a21202778ee 100644 --- a/Bindings/display/atmel,lcdc.txt +++ b/Bindings/display/atmel,lcdc.txt @@ -34,7 +34,6 @@ Example: pinctrl-names = "default"; pinctrl-0 = <&pinctrl_fb>; display = <&display0>; - status = "okay"; #address-cells = <1>; #size-cells = <1>; diff --git a/Bindings/display/atmel/hlcdc-dc.txt b/Bindings/display/atmel/hlcdc-dc.txt index ec94468b35be..82f2acb3d374 100644 --- a/Bindings/display/atmel/hlcdc-dc.txt +++ b/Bindings/display/atmel/hlcdc-dc.txt @@ -23,7 +23,6 @@ Example: interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>; clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>; clock-names = "periph_clk","sys_clk", "slow_clk"; - status = "disabled"; hlcdc-display-controller { compatible = "atmel,hlcdc-display-controller"; diff --git a/Bindings/display/bridge/dw_mipi_dsi.txt b/Bindings/display/bridge/dw_mipi_dsi.txt new file mode 100644 index 000000000000..b13adf30b8d3 --- /dev/null +++ b/Bindings/display/bridge/dw_mipi_dsi.txt @@ -0,0 +1,32 @@ +Synopsys DesignWare MIPI DSI host controller +============================================ + +This document defines device tree properties for the Synopsys DesignWare MIPI +DSI host controller. It doesn't constitue a device tree binding specification +by itself but is meant to be referenced by platform-specific device tree +bindings. + +When referenced from platform device tree bindings the properties defined in +this document are defined as follows. The platform device tree bindings are +responsible for defining whether each optional property is used or not. + +- reg: Memory mapped base address and length of the DesignWare MIPI DSI + host controller registers. (mandatory) + +- clocks: References to all the clocks specified in the clock-names property + as specified in [1]. (mandatory) + +- clock-names: + - "pclk" is the peripheral clock for either AHB and APB. (mandatory) + - "px_clk" is the pixel clock for the DPI/RGB input. (optional) + +- resets: References to all the resets specified in the reset-names property + as specified in [2]. (optional) + +- reset-names: string reset name, must be "apb" if used. (optional) + +- panel or bridge node: see [3]. (mandatory) + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/reset/reset.txt +[3] Documentation/devicetree/bindings/display/mipi-dsi-bus.txt diff --git a/Bindings/display/bridge/megachips-stdpxxxx-ge-b850v3-fw.txt b/Bindings/display/bridge/megachips-stdpxxxx-ge-b850v3-fw.txt index 7baa6582517e..aacc8b92968c 100644 --- a/Bindings/display/bridge/megachips-stdpxxxx-ge-b850v3-fw.txt +++ b/Bindings/display/bridge/megachips-stdpxxxx-ge-b850v3-fw.txt @@ -33,7 +33,6 @@ stdp2690-ge-b850v3-fw required properties: Example: &mux2_i2c2 { - status = "okay"; clock-frequency = <100000>; stdp4028@73 { diff --git a/Bindings/display/bridge/renesas,dw-hdmi.txt b/Bindings/display/bridge/renesas,dw-hdmi.txt index 81b68580e199..b1a8929c2536 100644 --- a/Bindings/display/bridge/renesas,dw-hdmi.txt +++ b/Bindings/display/bridge/renesas,dw-hdmi.txt @@ -13,6 +13,7 @@ Required properties: - compatible : Shall contain one or more of - "renesas,r8a7795-hdmi" for R8A7795 (R-Car H3) compatible HDMI TX + - "renesas,r8a7796-hdmi" for R8A7796 (R-Car M3-W) compatible HDMI TX - "renesas,rcar-gen3-hdmi" for the generic R-Car Gen3 compatible HDMI TX When compatible with generic versions, nodes must list the SoC-specific @@ -43,7 +44,6 @@ Example: clocks = <&cpg CPG_CORE R8A7795_CLK_S0D4>, <&cpg CPG_MOD 729>; clock-names = "iahb", "isfr"; power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; - status = "disabled"; ports { #address-cells = <1>; diff --git a/Bindings/display/exynos/exynos5433-decon.txt b/Bindings/display/exynos/exynos5433-decon.txt index 549c538b38a5..fc2588292a68 100644 --- a/Bindings/display/exynos/exynos5433-decon.txt +++ b/Bindings/display/exynos/exynos5433-decon.txt @@ -25,12 +25,6 @@ Required properties: size-cells must 1 and 0, respectively. - port: contains an endpoint node which is connected to the endpoint in the mic node. The reg value muset be 0. -- i80-if-timings: specify whether the panel which is connected to decon uses - i80 lcd interface or mipi video interface. This node contains - no timing information as that of fimd does. Because there is - no register in decon to specify i80 interface timing value, - it is not needed, but make it remain to use same kind of node - in fimd and exynos7 decon. Example: SoC specific DT entry: @@ -59,9 +53,3 @@ decon: decon@13800000 { }; }; }; - -Board specific DT entry: -&decon { - i80-if-timings { - }; -}; diff --git a/Bindings/display/fsl,tcon.txt b/Bindings/display/fsl,tcon.txt index 6fa4ab668db5..475008747801 100644 --- a/Bindings/display/fsl,tcon.txt +++ b/Bindings/display/fsl,tcon.txt @@ -14,5 +14,4 @@ timing-controller@4003d000 { reg = <0x4003d000 0x1000>; clocks = <&clks VF610_CLK_TCON0>; clock-names = "ipg"; - status = "okay"; }; diff --git a/Bindings/display/imx/fsl-imx-drm.txt b/Bindings/display/imx/fsl-imx-drm.txt index fa01db7eb66c..f79854783c2c 100644 --- a/Bindings/display/imx/fsl-imx-drm.txt +++ b/Bindings/display/imx/fsl-imx-drm.txt @@ -116,7 +116,7 @@ Parallel display support Required properties: - compatible: Should be "fsl,imx-parallel-display" Optional properties: -- interface_pix_fmt: How this display is connected to the +- interface-pix-fmt: How this display is connected to the display interface. Currently supported types: "rgb24", "rgb565", "bgr666" and "lvds666". - edid: verbatim EDID data block describing attached display. diff --git a/Bindings/display/marvell,pxa2xx-lcdc.txt b/Bindings/display/marvell,pxa2xx-lcdc.txt index 309c47f25b87..f79641bd5f18 100644 --- a/Bindings/display/marvell,pxa2xx-lcdc.txt +++ b/Bindings/display/marvell,pxa2xx-lcdc.txt @@ -23,7 +23,6 @@ Example: reg = <0x44000000 0x10000>; interrupts = <17>; clocks = <&clks CLK_LCD>; - status = "okay"; port { lcdc_out: endpoint { diff --git a/Bindings/display/panel/innolux,p079zca.txt b/Bindings/display/panel/innolux,p079zca.txt index 5c70a8380e58..d0f55161579a 100644 --- a/Bindings/display/panel/innolux,p079zca.txt +++ b/Bindings/display/panel/innolux,p079zca.txt @@ -18,6 +18,5 @@ Example: power-supply = <...>; backlight = <&backlight>; enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - status = "okay"; }; }; diff --git a/Bindings/display/renesas,du.txt b/Bindings/display/renesas,du.txt index c6cb96a4fa93..4bbd1e9bf3be 100644 --- a/Bindings/display/renesas,du.txt +++ b/Bindings/display/renesas,du.txt @@ -36,8 +36,10 @@ Required Properties: When supplied they must be named "dclkin.x" with "x" being the input clock numerical index. - - vsps: A list of phandles to the VSP nodes that handle the memory - interfaces for the DU channels. + - vsps: A list of phandle and channel index tuples to the VSPs that handle + the memory interfaces for the DU channels. The phandle identifies the VSP + instance that serves the DU channel, and the channel index identifies the + LIF instance in that VSP. Required nodes: @@ -59,24 +61,24 @@ corresponding to each DU output. R8A7796 (M3-W) DPAD HDMI LVDS - -Example: R8A7790 (R-Car H2) DU +Example: R8A7795 (R-Car H3) ES2.0 DU - du: du@feb00000 { - compatible = "renesas,du-r8a7790"; - reg = <0 0xfeb00000 0 0x70000>, - <0 0xfeb90000 0 0x1c>, - <0 0xfeb94000 0 0x1c>; - reg-names = "du", "lvds.0", "lvds.1"; - interrupt-parent = <&gic>; - interrupts = <0 256 IRQ_TYPE_LEVEL_HIGH>, - <0 268 IRQ_TYPE_LEVEL_HIGH>, - <0 269 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&mstp7_clks R8A7790_CLK_DU0>, - <&mstp7_clks R8A7790_CLK_DU1>, - <&mstp7_clks R8A7790_CLK_DU2>, - <&mstp7_clks R8A7790_CLK_LVDS0>, - <&mstp7_clks R8A7790_CLK_LVDS1>; - clock-names = "du.0", "du.1", "du.2", "lvds.0", "lvds.1"; + du: display@feb00000 { + compatible = "renesas,du-r8a7795"; + reg = <0 0xfeb00000 0 0x80000>, + <0 0xfeb90000 0 0x14>; + reg-names = "du", "lvds.0"; + interrupts = , + , + , + ; + clocks = <&cpg CPG_MOD 724>, + <&cpg CPG_MOD 723>, + <&cpg CPG_MOD 722>, + <&cpg CPG_MOD 721>, + <&cpg CPG_MOD 727>; + clock-names = "du.0", "du.1", "du.2", "du.3", "lvds.0"; + vsps = <&vspd0 0>, <&vspd1 0>, <&vspd2 0>, <&vspd0 1>; ports { #address-cells = <1>; @@ -89,12 +91,19 @@ Example: R8A7790 (R-Car H2) DU }; port@1 { reg = <1>; - du_out_lvds0: endpoint { + du_out_hdmi0: endpoint { + remote-endpoint = <&dw_hdmi0_in>; }; }; port@2 { reg = <2>; - du_out_lvds1: endpoint { + du_out_hdmi1: endpoint { + remote-endpoint = <&dw_hdmi1_in>; + }; + }; + port@3 { + reg = <3>; + du_out_lvds0: endpoint { }; }; }; diff --git a/Bindings/display/repaper.txt b/Bindings/display/repaper.txt new file mode 100644 index 000000000000..f5f9f9cf6a25 --- /dev/null +++ b/Bindings/display/repaper.txt @@ -0,0 +1,52 @@ +Pervasive Displays RePaper branded e-ink displays + +Required properties: +- compatible: "pervasive,e1144cs021" for 1.44" display + "pervasive,e1190cs021" for 1.9" display + "pervasive,e2200cs021" for 2.0" display + "pervasive,e2271cs021" for 2.7" display + +- panel-on-gpios: Timing controller power control +- discharge-gpios: Discharge control +- reset-gpios: RESET pin +- busy-gpios: BUSY pin + +Required property for e2271cs021: +- border-gpios: Border control + +The node for this driver must be a child node of a SPI controller, hence +all mandatory properties described in ../spi/spi-bus.txt must be specified. + +Optional property: +- pervasive,thermal-zone: name of thermometer's thermal zone + +Example: + + display_temp: lm75@48 { + compatible = "lm75b"; + reg = <0x48>; + #thermal-sensor-cells = <0>; + }; + + thermal-zones { + display { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&display_temp>; + }; + }; + + papirus27@0{ + compatible = "pervasive,e2271cs021"; + reg = <0>; + + spi-max-frequency = <8000000>; + + panel-on-gpios = <&gpio 23 0>; + border-gpios = <&gpio 14 0>; + discharge-gpios = <&gpio 15 0>; + reset-gpios = <&gpio 24 0>; + busy-gpios = <&gpio 25 0>; + + pervasive,thermal-zone = "display"; + }; diff --git a/Bindings/display/rockchip/analogix_dp-rockchip.txt b/Bindings/display/rockchip/analogix_dp-rockchip.txt index 47665a12786f..43561584c13a 100644 --- a/Bindings/display/rockchip/analogix_dp-rockchip.txt +++ b/Bindings/display/rockchip/analogix_dp-rockchip.txt @@ -59,7 +59,6 @@ Example: pinctrl-names = "default"; pinctrl-0 = <&edp_hpd>; - status = "disabled"; ports { #address-cells = <1>; diff --git a/Bindings/display/rockchip/dw_hdmi-rockchip.txt b/Bindings/display/rockchip/dw_hdmi-rockchip.txt index 046076c6b277..adc94fc3c9f8 100644 --- a/Bindings/display/rockchip/dw_hdmi-rockchip.txt +++ b/Bindings/display/rockchip/dw_hdmi-rockchip.txt @@ -11,7 +11,9 @@ following device-specific properties. Required properties: -- compatible: Shall contain "rockchip,rk3288-dw-hdmi". +- compatible: should be one of the following: + "rockchip,rk3288-dw-hdmi" + "rockchip,rk3399-dw-hdmi" - reg: See dw_hdmi.txt. - reg-io-width: See dw_hdmi.txt. Shall be 4. - interrupts: HDMI interrupt number @@ -30,7 +32,8 @@ Optional properties I2C master controller. - clock-names: See dw_hdmi.txt. The "cec" clock is optional. - clock-names: May contain "cec" as defined in dw_hdmi.txt. - +- clock-names: May contain "grf", power for grf io. +- clock-names: May contain "vpll", external clock for some hdmi phy. Example: @@ -43,7 +46,6 @@ hdmi: hdmi@ff980000 { interrupts = ; clocks = <&cru PCLK_HDMI_CTRL>, <&cru SCLK_HDMI_HDCP>; clock-names = "iahb", "isfr"; - status = "disabled"; ports { hdmi_in: port { #address-cells = <1>; diff --git a/Bindings/display/rockchip/dw_mipi_dsi_rockchip.txt b/Bindings/display/rockchip/dw_mipi_dsi_rockchip.txt index 543b07435f4f..6bb59ab39f2f 100644 --- a/Bindings/display/rockchip/dw_mipi_dsi_rockchip.txt +++ b/Bindings/display/rockchip/dw_mipi_dsi_rockchip.txt @@ -36,7 +36,6 @@ Example: resets = <&cru SRST_MIPIDSI0>; reset-names = "apb"; rockchip,grf = <&grf>; - status = "okay"; ports { #address-cells = <1>; @@ -65,6 +64,5 @@ Example: pinctrl-names = "default"; pinctrl-0 = <&lcd_en>; backlight = <&backlight>; - status = "okay"; }; }; diff --git a/Bindings/display/rockchip/inno_hdmi-rockchip.txt b/Bindings/display/rockchip/inno_hdmi-rockchip.txt index 8096a29f9776..cec21714f0e0 100644 --- a/Bindings/display/rockchip/inno_hdmi-rockchip.txt +++ b/Bindings/display/rockchip/inno_hdmi-rockchip.txt @@ -25,7 +25,6 @@ hdmi: hdmi@20034000 { clock-names = "pclk"; pinctrl-names = "default"; pinctrl-0 = <&hdmi_ctl>; - status = "disabled"; hdmi_in: port { #address-cells = <1>; diff --git a/Bindings/display/rockchip/rockchip-vop.txt b/Bindings/display/rockchip/rockchip-vop.txt index 9eb3f0a2a078..5d835d9c1ba8 100644 --- a/Bindings/display/rockchip/rockchip-vop.txt +++ b/Bindings/display/rockchip/rockchip-vop.txt @@ -8,8 +8,12 @@ Required properties: - compatible: value should be one of the following "rockchip,rk3036-vop"; "rockchip,rk3288-vop"; + "rockchip,rk3368-vop"; + "rockchip,rk3366-vop"; "rockchip,rk3399-vop-big"; "rockchip,rk3399-vop-lit"; + "rockchip,rk3228-vop"; + "rockchip,rk3328-vop"; - interrupts: should contain a list of all VOP IP block interrupts in the order: VSYNC, LCD_SYSTEM. The interrupt specifier diff --git a/Bindings/display/simple-framebuffer-sunxi.txt b/Bindings/display/simple-framebuffer-sunxi.txt index c46ba641a1df..a9168ae6946c 100644 --- a/Bindings/display/simple-framebuffer-sunxi.txt +++ b/Bindings/display/simple-framebuffer-sunxi.txt @@ -28,6 +28,5 @@ chosen { allwinner,pipeline = "de_be0-lcd0-hdmi"; clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; - status = "disabled"; }; }; diff --git a/Bindings/display/sitronix,st7586.txt b/Bindings/display/sitronix,st7586.txt new file mode 100644 index 000000000000..1d0dad1210d3 --- /dev/null +++ b/Bindings/display/sitronix,st7586.txt @@ -0,0 +1,22 @@ +Sitronix ST7586 display panel + +Required properties: +- compatible: "lego,ev3-lcd". +- a0-gpios: The A0 signal (since this binding is for serial mode, this is + the pin labeled D1 on the controller, not the pin labeled A0) +- reset-gpios: Reset pin + +The node for this driver must be a child node of a SPI controller, hence +all mandatory properties described in ../spi/spi-bus.txt must be specified. + +Optional properties: +- rotation: panel rotation in degrees counter clockwise (0,90,180,270) + +Example: + display@0{ + compatible = "lego,ev3-lcd"; + reg = <0>; + spi-max-frequency = <10000000>; + a0-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>; + }; diff --git a/Bindings/display/st,stm32-ltdc.txt b/Bindings/display/st,stm32-ltdc.txt index 8e1476941c0f..74b5ac7b26d6 100644 --- a/Bindings/display/st,stm32-ltdc.txt +++ b/Bindings/display/st,stm32-ltdc.txt @@ -1,7 +1,6 @@ * STMicroelectronics STM32 lcd-tft display controller - ltdc: lcd-tft display controller host - must be a sub-node of st-display-subsystem Required properties: - compatible: "st,stm32-ltdc" - reg: Physical base address of the IP registers and length of memory mapped region. @@ -13,8 +12,40 @@ Required nodes: - Video port for RGB output. -Example: +* STMicroelectronics STM32 DSI controller specific extensions to Synopsys + DesignWare MIPI DSI host controller +The STMicroelectronics STM32 DSI controller uses the Synopsys DesignWare MIPI +DSI host controller. For all mandatory properties & nodes, please refer +to the related documentation in [5]. + +Mandatory properties specific to STM32 DSI: +- #address-cells: Should be <1>. +- #size-cells: Should be <0>. +- compatible: "st,stm32-dsi". +- clock-names: + - phy pll reference clock string name, must be "ref". +- resets: see [5]. +- reset-names: see [5]. + +Mandatory nodes specific to STM32 DSI: +- ports: A node containing DSI input & output port nodes with endpoint + definitions as documented in [3] & [4]. + - port@0: DSI input port node, connected to the ltdc rgb output port. + - port@1: DSI output port node, connected to a panel or a bridge input port. +- panel or bridge node: A node containing the panel or bridge description as + documented in [6]. + - port: panel or bridge port node, connected to the DSI output port (port@1). + +Note: You can find more documentation in the following references +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/reset/reset.txt +[3] Documentation/devicetree/bindings/media/video-interfaces.txt +[4] Documentation/devicetree/bindings/graph.txt +[5] Documentation/devicetree/bindings/display/bridge/dw_mipi_dsi.txt +[6] Documentation/devicetree/bindings/display/mipi-dsi-bus.txt + +Example 1: RGB panel / { ... soc { @@ -34,3 +65,73 @@ Example: }; }; }; + +Example 2: DSI panel + +/ { + ... + soc { + ... + ltdc: display-controller@40016800 { + compatible = "st,stm32-ltdc"; + reg = <0x40016800 0x200>; + interrupts = <88>, <89>; + resets = <&rcc STM32F4_APB2_RESET(LTDC)>; + clocks = <&rcc 1 CLK_LCD>; + clock-names = "lcd"; + + port { + ltdc_out_dsi: endpoint { + remote-endpoint = <&dsi_in>; + }; + }; + }; + + + dsi: dsi@40016c00 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "st,stm32-dsi"; + reg = <0x40016c00 0x800>; + clocks = <&rcc 1 CLK_F469_DSI>, <&clk_hse>; + clock-names = "ref", "pclk"; + resets = <&rcc STM32F4_APB2_RESET(DSI)>; + reset-names = "apb"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dsi_in: endpoint { + remote-endpoint = <<dc_out_dsi>; + }; + }; + + port@1 { + reg = <1>; + dsi_out: endpoint { + remote-endpoint = <&dsi_in_panel>; + }; + }; + + }; + + panel-dsi@0 { + reg = <0>; /* dsi virtual channel (0..3) */ + compatible = ...; + enable-gpios = ...; + + port { + dsi_in_panel: endpoint { + remote-endpoint = <&dsi_out>; + }; + }; + + }; + + }; + + }; +}; diff --git a/Bindings/display/sunxi/sun4i-drm.txt b/Bindings/display/sunxi/sun4i-drm.txt index b83e6018041d..92441086caba 100644 --- a/Bindings/display/sunxi/sun4i-drm.txt +++ b/Bindings/display/sunxi/sun4i-drm.txt @@ -4,15 +4,33 @@ Allwinner A10 Display Pipeline The Allwinner A10 Display pipeline is composed of several components that are going to be documented below: -For the input port of all components up to the TCON in the display -pipeline, if there are multiple components, the local endpoint IDs -must correspond to the index of the upstream block. For example, if -the remote endpoint is Frontend 1, then the local endpoint ID must -be 1. +For all connections between components up to the TCONs in the display +pipeline, when there are multiple components of the same type at the +same depth, the local endpoint ID must be the same as the remote +component's index. For example, if the remote endpoint is Frontend 1, +then the local endpoint ID must be 1. -Conversely, for the output ports of the same group, the remote endpoint -ID must be the index of the local hardware block. If the local backend -is backend 1, then the remote endpoint ID must be 1. + Frontend 0 [0] ------- [0] Backend 0 [0] ------- [0] TCON 0 + [1] -- -- [1] [1] -- -- [1] + \ / \ / + X X + / \ / \ + [0] -- -- [0] [0] -- -- [0] + Frontend 1 [1] ------- [1] Backend 1 [1] ------- [1] TCON 1 + +For a two pipeline system such as the one depicted above, the lines +represent the connections between the components, while the numbers +within the square brackets corresponds to the ID of the local endpoint. + +The same rule also applies to DE 2.0 mixer-TCON connections: + + Mixer 0 [0] ----------- [0] TCON 0 + [1] ---- ---- [1] + \ / + X + / \ + [0] ---- ---- [0] + Mixer 1 [1] ----------- [1] TCON 1 HDMI Encoder ------------ @@ -260,7 +278,6 @@ hdmi: hdmi@01c16000 { <&dma SUN4I_DMA_NORMAL 16>, <&dma SUN4I_DMA_DEDICATED 24>; dma-names = "ddc-tx", "ddc-rx", "audio-tx"; - status = "disabled"; ports { #address-cells = <1>; diff --git a/Bindings/dma/fsl-edma.txt b/Bindings/dma/fsl-edma.txt index 191d7bd8a6fe..97e213e07660 100644 --- a/Bindings/dma/fsl-edma.txt +++ b/Bindings/dma/fsl-edma.txt @@ -72,5 +72,4 @@ sai2: sai@40031000 { dma-names = "tx", "rx"; dmas = <&edma0 0 21>, <&edma0 0 20>; - status = "disabled"; }; diff --git a/Bindings/dma/mv-xor.txt b/Bindings/dma/mv-xor.txt index c075f5988135..0ffb4d8766a8 100644 --- a/Bindings/dma/mv-xor.txt +++ b/Bindings/dma/mv-xor.txt @@ -30,7 +30,6 @@ xor@d0060900 { reg = <0xd0060900 0x100 0xd0060b00 0x100>; clocks = <&coreclk 0>; - status = "okay"; xor00 { interrupts = <51>; diff --git a/Bindings/dma/qcom_adm.txt b/Bindings/dma/qcom_adm.txt index 9bcab9115982..9d3b2f917b7b 100644 --- a/Bindings/dma/qcom_adm.txt +++ b/Bindings/dma/qcom_adm.txt @@ -48,7 +48,6 @@ Each dmas request consists of 3 cells: Example: spi4: spi@1a280000 { - status = "ok"; spi-max-frequency = <50000000>; pinctrl-0 = <&spi_pins>; diff --git a/Bindings/dma/renesas,rcar-dmac.txt b/Bindings/dma/renesas,rcar-dmac.txt index 79a204d50234..891db41e9420 100644 --- a/Bindings/dma/renesas,rcar-dmac.txt +++ b/Bindings/dma/renesas,rcar-dmac.txt @@ -25,6 +25,7 @@ Required Properties: - "renesas,dmac-r8a7794" (R-Car E2) - "renesas,dmac-r8a7795" (R-Car H3) - "renesas,dmac-r8a7796" (R-Car M3-W) + - "renesas,dmac-r8a77970" (R-Car V3M) - reg: base address and length of the registers block for the DMAC diff --git a/Bindings/dma/renesas,usb-dmac.txt b/Bindings/dma/renesas,usb-dmac.txt index e7780a186a36..1be6941ac1e5 100644 --- a/Bindings/dma/renesas,usb-dmac.txt +++ b/Bindings/dma/renesas,usb-dmac.txt @@ -8,6 +8,7 @@ Required Properties: - "renesas,r8a7793-usb-dmac" (R-Car M2-N) - "renesas,r8a7794-usb-dmac" (R-Car E2) - "renesas,r8a7795-usb-dmac" (R-Car H3) + - "renesas,r8a7796-usb-dmac" (R-Car M3-W) - reg: base address and length of the registers block for the DMAC - interrupts: interrupt specifiers for the DMAC, one for each entry in interrupt-names. diff --git a/Bindings/dma/snps-dma.txt b/Bindings/dma/snps-dma.txt index 4775c66f4508..a122723907ac 100644 --- a/Bindings/dma/snps-dma.txt +++ b/Bindings/dma/snps-dma.txt @@ -63,7 +63,6 @@ Example: compatible = "arm,pl011", "arm,primecell"; reg = <0xe0000000 0x1000>; interrupts = <0 35 0x4>; - status = "disabled"; dmas = <&dmahost 12 0 1>, <&dmahost 13 0 1 0>; dma-names = "rx", "rx"; diff --git a/Bindings/dma/st_fdma.txt b/Bindings/dma/st_fdma.txt index 495d853c569b..52cfec9e77ad 100644 --- a/Bindings/dma/st_fdma.txt +++ b/Bindings/dma/st_fdma.txt @@ -69,7 +69,6 @@ Example: sti_uni_player2: sti-uni-player@2 { compatible = "st,sti-uni-player"; - status = "disabled"; #sound-dai-cells = <0>; st,syscfg = <&syscfg_core>; clocks = <&clk_s_d0_flexgen CLK_PCM_2>; diff --git a/Bindings/dma/ste-dma40.txt b/Bindings/dma/ste-dma40.txt index 95800ab37bb0..aa7dbd565ad0 100644 --- a/Bindings/dma/ste-dma40.txt +++ b/Bindings/dma/ste-dma40.txt @@ -135,5 +135,4 @@ Example: <&dma 13 0 0x0>; /* Logical - MemToDev */ dma-names = "rx", "rx"; - status = "disabled"; }; diff --git a/Bindings/dma/sun4i-dma.txt b/Bindings/dma/sun4i-dma.txt index f1634a27a830..3b484380c56a 100644 --- a/Bindings/dma/sun4i-dma.txt +++ b/Bindings/dma/sun4i-dma.txt @@ -40,7 +40,6 @@ Example: clock-names = "ahb", "mod"; dmas = <&dma 1 29>, <&dma 1 28>; dma-names = "rx", "tx"; - status = "disabled"; #address-cells = <1>; #size-cells = <0>; }; diff --git a/Bindings/dma/sun6i-dma.txt b/Bindings/dma/sun6i-dma.txt index 6b267045f522..98fbe1a5c6dd 100644 --- a/Bindings/dma/sun6i-dma.txt +++ b/Bindings/dma/sun6i-dma.txt @@ -9,6 +9,7 @@ Required properties: "allwinner,sun8i-a23-dma" "allwinner,sun8i-a83t-dma" "allwinner,sun8i-h3-dma" + "allwinner,sun8i-v3s-dma" - reg: Should contain the registers base address and length - interrupts: Should contain a reference to the interrupt used by this device - clocks: Should contain a reference to the parent AHB clock diff --git a/Bindings/dma/ti-dma-crossbar.txt b/Bindings/dma/ti-dma-crossbar.txt index aead5869a28d..b849a1ed389d 100644 --- a/Bindings/dma/ti-dma-crossbar.txt +++ b/Bindings/dma/ti-dma-crossbar.txt @@ -62,7 +62,6 @@ uart1: serial@4806a000 { interrupts-extended = <&gic GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>; ti,hwmods = "uart1"; clock-frequency = <48000000>; - status = "disabled"; /* Requesting crossbar input 49 and 50 */ dmas = <&sdma_xbar 49>, <&sdma_xbar 50>; dma-names = "tx", "rx"; diff --git a/Bindings/dma/ti-edma.txt b/Bindings/dma/ti-edma.txt index 18090e7226b4..41f0c1a07c56 100644 --- a/Bindings/dma/ti-edma.txt +++ b/Bindings/dma/ti-edma.txt @@ -9,7 +9,12 @@ execute the actual DMA tansfer. eDMA3 Channel Controller Required properties: -- compatible: "ti,edma3-tpcc" for the channel controller(s) +-------------------- +- compatible: Should be: + - "ti,edma3-tpcc" for the channel controller(s) on OMAP, + AM33xx and AM43xx SoCs. + - "ti,k2g-edma3-tpcc", "ti,edma3-tpcc" for the + channel controller(s) on 66AK2G. - #dma-cells: Should be set to <2>. The first number is the DMA request number and the second is the TC the channel is serviced on. - reg: Memory map of eDMA CC @@ -19,8 +24,19 @@ Required properties: - ti,tptcs: List of TPTCs associated with the eDMA in the following form: <&tptc_phandle TC_priority_number>. The highest priority is 0. +SoC-specific Required properties: +-------------------------------- +The following are mandatory properties for OMAP, AM33xx and AM43xx SoCs only: +- ti,hwmods: Name of the hwmods associated to the eDMA CC. + +The following are mandatory properties for 66AK2G SoCs only: +- power-domains:Should contain a phandle to a PM domain provider node + and an args specifier containing the device id + value. This property is as per the binding, + Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt + Optional properties: -- ti,hwmods: Name of the hwmods associated to the eDMA CC +------------------- - ti,edma-memcpy-channels: List of channels allocated to be used for memcpy, iow these channels will be SW triggered channels. See example. - ti,edma-reserved-slot-ranges: PaRAM slot ranges which should not be used by @@ -31,17 +47,34 @@ Optional properties: eDMA3 Transfer Controller Required properties: -- compatible: "ti,edma3-tptc" for the transfer controller(s) +-------------------- +- compatible: Should be: + - "ti,edma3-tptc" for the transfer controller(s) on OMAP, + AM33xx and AM43xx SoCs. + - "ti,k2g-edma3-tptc", "ti,edma3-tptc" for the + transfer controller(s) on 66AK2G. - reg: Memory map of eDMA TC - interrupts: Interrupt number for TCerrint. +SoC-specific Required properties: +-------------------------------- +The following are mandatory properties for OMAP, AM33xx and AM43xx SoCs only: +- ti,hwmods: Name of the hwmods associated to the eDMA TC. + +The following are mandatory properties for 66AK2G SoCs only: +- power-domains:Should contain a phandle to a PM domain provider node + and an args specifier containing the device id + value. This property is as per the binding, + Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt + Optional properties: -- ti,hwmods: Name of the hwmods associated to the given eDMA TC +------------------- - interrupt-names: "edma3_tcerrint" ------------------------------------------------------------------------------ -Example: +Examples: +1. edma: edma@49000000 { compatible = "ti,edma3-tpcc"; ti,hwmods = "tpcc"; @@ -102,13 +135,64 @@ mcasp0: mcasp@48038000 { reg-names = "mpu", "dat"; interrupts = <80>, <81>; interrupt-names = "tx", "rx"; - status = "disabled"; /* DMA channels 8 and 9 executed on eDMA TC2 - high priority queue */ dmas = <&edma 8 2>, <&edma 9 2>; dma-names = "tx", "rx"; }; +2. +edma1: edma@02728000 { + compatible = "ti,k2g-edma3-tpcc", "ti,edma3-tpcc"; + reg = <0x02728000 0x8000>; + reg-names = "edma3_cc"; + interrupts = , + , + ; + interrupt-names = "edma3_ccint", "emda3_mperr", + "edma3_ccerrint"; + dma-requests = <64>; + #dma-cells = <2>; + + ti,tptcs = <&edma1_tptc0 7>, <&edma1_tptc1 0>; + + /* + * memcpy is disabled, can be enabled with: + * ti,edma-memcpy-channels = <12 13 14 15>; + * for example. + */ + + power-domains = <&k2g_pds 0x4f>; +}; + +edma1_tptc0: tptc@027b0000 { + compatible = "ti,k2g-edma3-tptc", "ti,edma3-tptc"; + reg = <0x027b0000 0x400>; + power-domains = <&k2g_pds 0x4f>; +}; + +edma1_tptc1: tptc@027b8000 { + compatible = "ti, k2g-edma3-tptc", "ti,edma3-tptc"; + reg = <0x027b8000 0x400>; + power-domains = <&k2g_pds 0x4f>; +}; + +mmc0: mmc@23000000 { + compatible = "ti,k2g-hsmmc", "ti,omap4-hsmmc"; + reg = <0x23000000 0x400>; + interrupts = ; + dmas = <&edma1 24 0>, <&edma1 25 0>; + dma-names = "tx", "rx"; + bus-width = <4>; + ti,needs-special-reset; + no-1-8-v; + max-frequency = <96000000>; + power-domains = <&k2g_pds 0xb>; + clocks = <&k2g_clks 0xb 1>, <&k2g_clks 0xb 2>; + clock-names = "fck", "mmchsdb_fck"; + status = "disabled"; +}; + ------------------------------------------------------------------------------ DEPRECATED binding, new DTS files must use the ti,edma3-tpcc/ti,edma3-tptc binding. diff --git a/Bindings/eeprom/eeprom.txt b/Bindings/eeprom/eeprom.txt index 5696eb508e95..afc04589eadf 100644 --- a/Bindings/eeprom/eeprom.txt +++ b/Bindings/eeprom/eeprom.txt @@ -16,8 +16,12 @@ Required properties: "renesas,r1ex24002" + The following manufacturers values have been deprecated: + "at", "at24" + If there is no specific driver for , a generic - driver based on is selected. Possible types are: + device with and manufacturer "atmel" should be used. + Possible types are: "24c00", "24c01", "24c02", "24c04", "24c08", "24c16", "24c32", "24c64", "24c128", "24c256", "24c512", "24c1024", "spd" diff --git a/Bindings/extcon/extcon-usbc-cros-ec.txt b/Bindings/extcon/extcon-usbc-cros-ec.txt new file mode 100644 index 000000000000..8e8625c00dfa --- /dev/null +++ b/Bindings/extcon/extcon-usbc-cros-ec.txt @@ -0,0 +1,24 @@ +ChromeOS EC USB Type-C cable and accessories detection + +On ChromeOS systems with USB Type C ports, the ChromeOS Embedded Controller is +able to detect the state of external accessories such as display adapters +or USB devices when said accessories are attached or detached. + +The node for this device must be under a cros-ec node like google,cros-ec-spi +or google,cros-ec-i2c. + +Required properties: +- compatible: Should be "google,extcon-usbc-cros-ec". +- google,usb-port-id: Specifies the USB port ID to use. + +Example: + cros-ec@0 { + compatible = "google,cros-ec-i2c"; + + ... + + extcon { + compatible = "google,extcon-usbc-cros-ec"; + google,usb-port-id = <0>; + }; + } diff --git a/Bindings/fpga/altera-passive-serial.txt b/Bindings/fpga/altera-passive-serial.txt new file mode 100644 index 000000000000..48478bc07e29 --- /dev/null +++ b/Bindings/fpga/altera-passive-serial.txt @@ -0,0 +1,29 @@ +Altera Passive Serial SPI FPGA Manager + +Altera FPGAs support a method of loading the bitstream over what is +referred to as "passive serial". +The passive serial link is not technically SPI, and might require extra +circuits in order to play nicely with other SPI slaves on the same bus. + +See https://www.altera.com/literature/hb/cyc/cyc_c51013.pdf + +Required properties: +- compatible: Must be one of the following: + "altr,fpga-passive-serial", + "altr,fpga-arria10-passive-serial" +- reg: SPI chip select of the FPGA +- nconfig-gpios: config pin (referred to as nCONFIG in the manual) +- nstat-gpios: status pin (referred to as nSTATUS in the manual) + +Optional properties: +- confd-gpios: confd pin (referred to as CONF_DONE in the manual) + +Example: + fpga: fpga@0 { + compatible = "altr,fpga-passive-serial"; + spi-max-frequency = <20000000>; + reg = <0>; + nconfig-gpios = <&gpio4 9 GPIO_ACTIVE_LOW>; + nstat-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>; + confd-gpios = <&gpio4 12 GPIO_ACTIVE_LOW>; + }; diff --git a/Bindings/fpga/xilinx-pr-decoupler.txt b/Bindings/fpga/xilinx-pr-decoupler.txt new file mode 100644 index 000000000000..8dcfba926bc7 --- /dev/null +++ b/Bindings/fpga/xilinx-pr-decoupler.txt @@ -0,0 +1,36 @@ +Xilinx LogiCORE Partial Reconfig Decoupler Softcore + +The Xilinx LogiCORE Partial Reconfig Decoupler manages one or more +decouplers / fpga bridges. +The controller can decouple/disable the bridges which prevents signal +changes from passing through the bridge. The controller can also +couple / enable the bridges which allows traffic to pass through the +bridge normally. + +The Driver supports only MMIO handling. A PR region can have multiple +PR Decouplers which can be handled independently or chained via decouple/ +decouple_status signals. + +Required properties: +- compatible : Should contain "xlnx,pr-decoupler-1.00" followed by + "xlnx,pr-decoupler" +- regs : base address and size for decoupler module +- clocks : input clock to IP +- clock-names : should contain "aclk" + +Optional properties: +- bridge-enable : 0 if driver should disable bridge at startup + 1 if driver should enable bridge at startup + Default is to leave bridge in current state. + +See Documentation/devicetree/bindings/fpga/fpga-region.txt for generic bindings. + +Example: + fpga-bridge@100000450 { + compatible = "xlnx,pr-decoupler-1.00", + "xlnx-pr-decoupler"; + regs = <0x10000045 0x10>; + clocks = <&clkc 15>; + clock-names = "aclk"; + bridge-enable = <0>; + }; diff --git a/Bindings/fpga/xilinx-slave-serial.txt b/Bindings/fpga/xilinx-slave-serial.txt index 9766f7472f51..cfa4ed42b62f 100644 --- a/Bindings/fpga/xilinx-slave-serial.txt +++ b/Bindings/fpga/xilinx-slave-serial.txt @@ -31,7 +31,6 @@ Example for full FPGA configuration: cell-index = <1>; interrupts = <92>; clocks = <&coreclk 0>; - status = "okay"; fpga_mgr_spi: fpga-mgr@0 { compatible = "xlnx,fpga-slave-serial"; diff --git a/Bindings/gpio/gpio-74x164.txt b/Bindings/gpio/gpio-74x164.txt index ce1b2231bf5d..2a97553d8d76 100644 --- a/Bindings/gpio/gpio-74x164.txt +++ b/Bindings/gpio/gpio-74x164.txt @@ -12,6 +12,9 @@ Required properties: 1 = active low - registers-number: Number of daisy-chained shift registers +Optional properties: +- enable-gpios: GPIO connected to the OE (Output Enable) pin. + Example: gpio5: gpio5@0 { diff --git a/Bindings/gpio/gpio-aspeed.txt b/Bindings/gpio/gpio-aspeed.txt index c756afa88cc6..fc6378c778c5 100644 --- a/Bindings/gpio/gpio-aspeed.txt +++ b/Bindings/gpio/gpio-aspeed.txt @@ -18,7 +18,7 @@ Required properties: Optional properties: - interrupt-parent : The parent interrupt controller, optional if inherited -- clocks : A phandle to the HPLL clock node for debounce timings +- clocks : A phandle to the clock to use for debounce timings The gpio and interrupt properties are further described in their respective bindings documentation: diff --git a/Bindings/gpio/gpio-davinci.txt b/Bindings/gpio/gpio-davinci.txt index 5079ba7d6568..8beb0539b6d8 100644 --- a/Bindings/gpio/gpio-davinci.txt +++ b/Bindings/gpio/gpio-davinci.txt @@ -1,7 +1,10 @@ Davinci/Keystone GPIO controller bindings Required Properties: -- compatible: should be "ti,dm6441-gpio", "ti,keystone-gpio" +- compatible: should be "ti,dm6441-gpio": for Davinci da850 SoCs + "ti,keystone-gpio": for Keystone 2 66AK2H/K, 66AK2L, + 66AK2E SoCs + "ti,k2g-gpio", "ti,keystone-gpio": for 66AK2G - reg: Physical base address of the controller and the size of memory mapped registers. @@ -20,7 +23,21 @@ Required Properties: - ti,ngpio: The number of GPIO pins supported. - ti,davinci-gpio-unbanked: The number of GPIOs that have an individual interrupt - line to processor. + line to processor. + +- clocks: Should contain the device's input clock, and should be defined as per + the appropriate clock bindings consumer usage in, + + Documentation/devicetree/bindings/clock/keystone-gate.txt + for 66AK2HK/66AK2L/66AK2E SoCs or, + + Documentation/devicetree/bindings/clock/ti,sci-clk.txt + for 66AK2G SoCs + +- clock-names: Name should be "gpio"; + +Currently clock-names and clocks are needed for all keystone 2 platforms +Davinci platforms do not have DT clocks as of now. The GPIO controller also acts as an interrupt controller. It uses the default two cells specifier as described in Documentation/devicetree/bindings/ @@ -60,3 +77,73 @@ leds { ... }; }; + +Example for 66AK2G: + +gpio0: gpio@2603000 { + compatible = "ti,k2g-gpio", "ti,keystone-gpio"; + reg = <0x02603000 0x100>; + gpio-controller; + #gpio-cells = <2>; + interrupts = , + , + , + , + , + , + , + , + ; + interrupt-controller; + #interrupt-cells = <2>; + ti,ngpio = <144>; + ti,davinci-gpio-unbanked = <0>; + clocks = <&k2g_clks 0x001b 0x0>; + clock-names = "gpio"; +}; + +Example for 66AK2HK/66AK2L/66AK2E: + +gpio0: gpio@260bf00 { + compatible = "ti,keystone-gpio"; + reg = <0x0260bf00 0x100>; + gpio-controller; + #gpio-cells = <2>; + /* HW Interrupts mapped to GPIO pins */ + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + clocks = <&clkgpio>; + clock-names = "gpio"; + ti,ngpio = <32>; + ti,davinci-gpio-unbanked = <32>; +}; diff --git a/Bindings/gpio/gpio-mpc8xxx.txt b/Bindings/gpio/gpio-mpc8xxx.txt index 4b6cc632ca5c..69d46162d0f5 100644 --- a/Bindings/gpio/gpio-mpc8xxx.txt +++ b/Bindings/gpio/gpio-mpc8xxx.txt @@ -23,7 +23,6 @@ gpio0: gpio@1100 { #gpio-cells = <2>; reg = <0x1100 0x080>; interrupts = <78 0x8>; - status = "okay"; }; Example of gpio-controller node for a ls2080a SoC: diff --git a/Bindings/gpio/gpio-vf610.txt b/Bindings/gpio/gpio-vf610.txt index 436cc99c6598..0ccbae44019c 100644 --- a/Bindings/gpio/gpio-vf610.txt +++ b/Bindings/gpio/gpio-vf610.txt @@ -5,7 +5,9 @@ functionality. Each pair serves 32 GPIOs. The VF610 has 5 instances of each, and each PORT module has its own interrupt. Required properties for GPIO node: -- compatible : Should be "fsl,-gpio", currently "fsl,vf610-gpio" +- compatible : Should be "fsl,-gpio", below is supported list: + "fsl,vf610-gpio" + "fsl,imx7ulp-gpio" - reg : The first reg tuple represents the PORT module, the second tuple the GPIO module. - interrupts : Should be the port interrupt shared by all 32 pins. diff --git a/Bindings/gpio/renesas,gpio-rcar.txt b/Bindings/gpio/renesas,gpio-rcar.txt index 6826a371fb69..51c86f69995e 100644 --- a/Bindings/gpio/renesas,gpio-rcar.txt +++ b/Bindings/gpio/renesas,gpio-rcar.txt @@ -2,8 +2,9 @@ Required Properties: - - compatible: should contain one of the following. + - compatible: should contain one or more of the following: - "renesas,gpio-r8a7743": for R8A7743 (RZ/G1M) compatible GPIO controller. + - "renesas,gpio-r8a7745": for R8A7745 (RZ/G1E) compatible GPIO controller. - "renesas,gpio-r8a7778": for R8A7778 (R-Mobile M1) compatible GPIO controller. - "renesas,gpio-r8a7779": for R8A7779 (R-Car H1) compatible GPIO controller. - "renesas,gpio-r8a7790": for R8A7790 (R-Car H2) compatible GPIO controller. @@ -13,7 +14,14 @@ Required Properties: - "renesas,gpio-r8a7794": for R8A7794 (R-Car E2) compatible GPIO controller. - "renesas,gpio-r8a7795": for R8A7795 (R-Car H3) compatible GPIO controller. - "renesas,gpio-r8a7796": for R8A7796 (R-Car M3-W) compatible GPIO controller. - - "renesas,gpio-rcar": for generic R-Car GPIO controller. + - "renesas,rcar-gen1-gpio": for a generic R-Car Gen1 GPIO controller. + - "renesas,rcar-gen2-gpio": for a generic R-Car Gen2 or RZ/G1 GPIO controller. + - "renesas,rcar-gen3-gpio": for a generic R-Car Gen3 GPIO controller. + - "renesas,gpio-rcar": deprecated. + + When compatible with the generic version nodes must list the + SoC-specific version corresponding to the platform first followed by + the generic version. - reg: Base address and length of each memory resource used by the GPIO controller hardware module. @@ -43,7 +51,7 @@ interrupt-controller/interrupts.txt. Example: R8A7779 (R-Car H1) GPIO controller nodes gpio0: gpio@ffc40000 { - compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar"; + compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio"; reg = <0xffc40000 0x2c>; interrupt-parent = <&gic>; interrupts = <0 141 0x4>; @@ -55,7 +63,7 @@ Example: R8A7779 (R-Car H1) GPIO controller nodes }; ... gpio6: gpio@ffc46000 { - compatible = "renesas,gpio-r8a7779", "renesas,gpio-rcar"; + compatible = "renesas,gpio-r8a7779", "renesas,rcar-gen1-gpio"; reg = <0xffc46000 0x2c>; interrupt-parent = <&gic>; interrupts = <0 147 0x4>; diff --git a/Bindings/gpio/spear_spics.txt b/Bindings/gpio/spear_spics.txt index 96c37eb15075..dd04d96e6ff1 100644 --- a/Bindings/gpio/spear_spics.txt +++ b/Bindings/gpio/spear_spics.txt @@ -42,7 +42,6 @@ spics: spics@e0700000{ spi0: spi@e0100000 { - status = "okay"; num-cs = <3>; cs-gpios = <&gpio1 7 0>, <&spics 0>, <&spics 1>; diff --git a/Bindings/gpu/arm,mali-midgard.txt b/Bindings/gpu/arm,mali-midgard.txt index 5aa5926029ee..039219df05c5 100644 --- a/Bindings/gpu/arm,mali-midgard.txt +++ b/Bindings/gpu/arm,mali-midgard.txt @@ -17,6 +17,7 @@ Required properties: * which must be preceded by one of the following vendor specifics: + "amlogic,meson-gxm-mali" + "rockchip,rk3288-mali" + + "rockchip,rk3399-mali" - reg : Physical base address of the device and length of the register area. diff --git a/Bindings/gpu/arm,mali-utgard.txt b/Bindings/gpu/arm,mali-utgard.txt index 2b6243e730f6..b4ebd56d03f3 100644 --- a/Bindings/gpu/arm,mali-utgard.txt +++ b/Bindings/gpu/arm,mali-utgard.txt @@ -10,6 +10,7 @@ Required properties: * And, optionally, one of the vendor specific compatible: + allwinner,sun4i-a10-mali + allwinner,sun7i-a20-mali + + allwinner,sun50i-h5-mali + amlogic,meson-gxbb-mali + amlogic,meson-gxl-mali + stericsson,db8500-mali @@ -58,6 +59,10 @@ to specify one more vendor-specific compatible, among: Required properties: * resets: phandle to the reset line for the GPU + - allwinner,sun50i-h5-mali + Required properties: + * resets: phandle to the reset line for the GPU + - stericsson,db8500-mali Required properties: * interrupt-names and interrupts: diff --git a/Bindings/gpu/nvidia,gk20a.txt b/Bindings/gpu/nvidia,gk20a.txt index b7e4c7444510..f32bbba4d3bc 100644 --- a/Bindings/gpu/nvidia,gk20a.txt +++ b/Bindings/gpu/nvidia,gk20a.txt @@ -51,7 +51,6 @@ Example for GK20A: resets = <&tegra_car 184>; reset-names = "gpu"; iommus = <&mc TEGRA_SWGROUP_GPU>; - status = "disabled"; }; Example for GM20B: @@ -70,7 +69,6 @@ Example for GM20B: resets = <&tegra_car 184>; reset-names = "gpu"; iommus = <&mc TEGRA_SWGROUP_GPU>; - status = "disabled"; }; Example for GP10B: @@ -89,5 +87,4 @@ Example for GP10B: reset-names = "gpu"; power-domains = <&bpmp TEGRA186_POWER_DOMAIN_GPU>; iommus = <&smmu TEGRA186_SID_GPU>; - status = "disabled"; }; diff --git a/Bindings/gpu/samsung-g2d.txt b/Bindings/gpu/samsung-g2d.txt index c4f358dafdaa..1e7959332dbc 100644 --- a/Bindings/gpu/samsung-g2d.txt +++ b/Bindings/gpu/samsung-g2d.txt @@ -24,5 +24,4 @@ Example: interrupts = <0 89 0>; clocks = <&clock 177>, <&clock 277>; clock-names = "sclk_fimg2d", "fimg2d"; - status = "disabled"; }; diff --git a/Bindings/hsi/omap-ssi.txt b/Bindings/hsi/omap-ssi.txt index f26625e42693..b8eca3c7810d 100644 --- a/Bindings/hsi/omap-ssi.txt +++ b/Bindings/hsi/omap-ssi.txt @@ -92,6 +92,5 @@ ssi-controller@48058000 { interrupts = <69>, <70>; - status = "disabled"; /* second port is not used on N900 */ } } diff --git a/Bindings/hwmon/aspeed-pwm-tacho.txt b/Bindings/hwmon/aspeed-pwm-tacho.txt index cf4460564adb..367c8203213b 100644 --- a/Bindings/hwmon/aspeed-pwm-tacho.txt +++ b/Bindings/hwmon/aspeed-pwm-tacho.txt @@ -11,6 +11,8 @@ Required properties for pwm-tacho node: - #size-cells : should be 1. +- #cooling-cells: should be 2. + - reg : address and length of the register set for the device. - pinctrl-names : a pinctrl state named "default" must be defined. @@ -28,12 +30,17 @@ fan subnode format: Under fan subnode there can upto 8 child nodes, with each child node representing a fan. If there are 8 fans each fan can have one PWM port and one/two Fan tach inputs. +For PWM port can be configured cooling-levels to create cooling device. +Cooling device could be bound to a thermal zone for the thermal control. Required properties for each child node: - reg : should specify PWM source port. integer value in the range 0 to 7 with 0 indicating PWM port A and 7 indicating PWM port H. +- cooling-levels: PWM duty cycle values in a range from 0 to 255 + which correspond to thermal cooling states. + - aspeed,fan-tach-ch : should specify the Fan tach input channel. integer value in the range 0 through 15, with 0 indicating Fan tach channel 0 and 15 indicating Fan tach channel 15. @@ -50,6 +57,7 @@ pwm_tacho_fixed_clk: fixedclk { pwm_tacho: pwmtachocontroller@1e786000 { #address-cells = <1>; #size-cells = <1>; + #cooling-cells = <2>; reg = <0x1E786000 0x1000>; compatible = "aspeed,ast2500-pwm-tacho"; clocks = <&pwm_tacho_fixed_clk>; @@ -58,6 +66,7 @@ pwm_tacho: pwmtachocontroller@1e786000 { fan@0 { reg = <0x00>; + cooling-levels = /bits/ 8 <125 151 177 203 229 255>; aspeed,fan-tach-ch = /bits/ 8 <0x00>; }; diff --git a/Bindings/hwmon/ibm,cffps1.txt b/Bindings/hwmon/ibm,cffps1.txt new file mode 100644 index 000000000000..f68a0a68fc52 --- /dev/null +++ b/Bindings/hwmon/ibm,cffps1.txt @@ -0,0 +1,21 @@ +Device-tree bindings for IBM Common Form Factor Power Supply Version 1 +---------------------------------------------------------------------- + +Required properties: + - compatible = "ibm,cffps1"; + - reg = < I2C bus address >; : Address of the power supply on the + I2C bus. + +Example: + + i2c-bus@100 { + #address-cells = <1>; + #size-cells = <0>; + #interrupt-cells = <1>; + < more properties > + + power-supply@68 { + compatible = "ibm,cffps1"; + reg = <0x68>; + }; + }; diff --git a/Bindings/hwmon/ltq-cputemp.txt b/Bindings/hwmon/ltq-cputemp.txt new file mode 100644 index 000000000000..33fd00a987c7 --- /dev/null +++ b/Bindings/hwmon/ltq-cputemp.txt @@ -0,0 +1,10 @@ +Lantiq cpu temperatur sensor + +Requires node properties: +- compatible value : + "lantiq,cputemp" + +Example: + cputemp@0 { + compatible = "lantiq,cputemp"; + }; diff --git a/Bindings/i2c/i2c-altera.txt b/Bindings/i2c/i2c-altera.txt new file mode 100644 index 000000000000..767664f448ec --- /dev/null +++ b/Bindings/i2c/i2c-altera.txt @@ -0,0 +1,39 @@ +* Altera I2C Controller +* This is Altera's synthesizable logic block I2C Controller for use +* in Altera's FPGAs. + +Required properties : + - compatible : should be "altr,softip-i2c-v1.0" + - reg : Offset and length of the register set for the device + - interrupts : where IRQ is the interrupt number. + - clocks : phandle to input clock. + - #address-cells = <1>; + - #size-cells = <0>; + +Recommended properties : + - clock-frequency : desired I2C bus clock frequency in Hz. + +Optional properties : + - fifo-size : Size of the RX and TX FIFOs in bytes. + - Child nodes conforming to i2c bus binding + +Example : + + i2c@100080000 { + compatible = "altr,softip-i2c-v1.0"; + reg = <0x00000001 0x00080000 0x00000040>; + interrupt-parent = <&intc>; + interrupts = <0 43 4>; + clocks = <&clk_0>; + clock-frequency = <100000>; + #address-cells = <1>; + #size-cells = <0>; + fifo-size = <4>; + + eeprom@51 { + compatible = "atmel,24c32"; + reg = <0x51>; + pagesize = <32>; + }; + }; + diff --git a/Bindings/i2c/i2c-cbus-gpio.txt b/Bindings/i2c/i2c-cbus-gpio.txt index 8ce9cd2855b5..c143948b2a37 100644 --- a/Bindings/i2c/i2c-cbus-gpio.txt +++ b/Bindings/i2c/i2c-cbus-gpio.txt @@ -20,8 +20,8 @@ i2c@0 { #address-cells = <1>; #size-cells = <0>; - retu-mfd: retu@1 { - compatible = "retu-mfd"; + retu: retu@1 { + compatible = "nokia,retu"; reg = <0x1>; }; }; diff --git a/Bindings/i2c/i2c-demux-pinctrl.txt b/Bindings/i2c/i2c-demux-pinctrl.txt index 7ce23ac61308..81b5d55086fa 100644 --- a/Bindings/i2c/i2c-demux-pinctrl.txt +++ b/Bindings/i2c/i2c-demux-pinctrl.txt @@ -102,7 +102,6 @@ And for clarification, here are the snipplets for the i2c-parents: #address-cells = <1>; #size-cells = <0>; compatible = "i2c-gpio"; - status = "disabled"; gpios = <&gpio5 6 GPIO_ACTIVE_HIGH /* sda */ &gpio5 5 GPIO_ACTIVE_HIGH /* scl */ >; diff --git a/Bindings/i2c/i2c-efm32.txt b/Bindings/i2c/i2c-efm32.txt index 50b25c3da186..3b30e54ae3c7 100644 --- a/Bindings/i2c/i2c-efm32.txt +++ b/Bindings/i2c/i2c-efm32.txt @@ -22,7 +22,6 @@ Example: interrupts = <9>; clocks = <&cmu clk_HFPERCLKI2C0>; clock-frequency = <100000>; - status = "ok"; energymicro,location = <3>; eeprom@50 { diff --git a/Bindings/i2c/i2c-mtk.txt b/Bindings/i2c/i2c-mtk.txt index bd5a7befd951..ff7bf37deb43 100644 --- a/Bindings/i2c/i2c-mtk.txt +++ b/Bindings/i2c/i2c-mtk.txt @@ -1,14 +1,15 @@ -* Mediatek's I2C controller +* MediaTek's I2C controller -The Mediatek's I2C controller is used to interface with I2C devices. +The MediaTek's I2C controller is used to interface with I2C devices. Required properties: - compatible: value should be either of the following. - "mediatek,mt2701-i2c", "mediatek,mt6577-i2c": for Mediatek mt2701 - "mediatek,mt6577-i2c": for i2c compatible with mt6577. - "mediatek,mt6589-i2c": for i2c compatible with mt6589. - "mediatek,mt7623-i2c", "mediatek,mt6577-i2c": for i2c compatible with mt7623. - "mediatek,mt8173-i2c": for i2c compatible with mt8173. + "mediatek,mt2701-i2c", "mediatek,mt6577-i2c": for MediaTek MT2701 + "mediatek,mt6577-i2c": for MediaTek MT6577 + "mediatek,mt6589-i2c": for MediaTek MT6589 + "mediatek,mt7622-i2c": for MediaTek MT7622 + "mediatek,mt7623-i2c", "mediatek,mt6577-i2c": for MediaTek MT7623 + "mediatek,mt8173-i2c": for MediaTek MT8173 - reg: physical base address of the controller and dma base, length of memory mapped region. - interrupts: interrupt number to the cpu. diff --git a/Bindings/i2c/i2c-rcar.txt b/Bindings/i2c/i2c-rcar.txt index 2b8bd33dbf8d..cad39aee9f73 100644 --- a/Bindings/i2c/i2c-rcar.txt +++ b/Bindings/i2c/i2c-rcar.txt @@ -2,6 +2,8 @@ I2C for R-Car platforms Required properties: - compatible: + "renesas,i2c-r8a7743" if the device is a part of a R8A7743 SoC. + "renesas,i2c-r8a7745" if the device is a part of a R8A7745 SoC. "renesas,i2c-r8a7778" if the device is a part of a R8A7778 SoC. "renesas,i2c-r8a7779" if the device is a part of a R8A7779 SoC. "renesas,i2c-r8a7790" if the device is a part of a R8A7790 SoC. @@ -12,7 +14,8 @@ Required properties: "renesas,i2c-r8a7795" if the device is a part of a R8A7795 SoC. "renesas,i2c-r8a7796" if the device is a part of a R8A7796 SoC. "renesas,rcar-gen1-i2c" for a generic R-Car Gen1 compatible device. - "renesas,rcar-gen2-i2c" for a generic R-Car Gen2 compatible device. + "renesas,rcar-gen2-i2c" for a generic R-Car Gen2 or RZ/G1 compatible + device. "renesas,rcar-gen3-i2c" for a generic R-Car Gen3 compatible device. "renesas,i2c-rcar" (deprecated) diff --git a/Bindings/i2c/i2c-rk3x.txt b/Bindings/i2c/i2c-rk3x.txt index e18445d0980c..22f2eeb2c4c9 100644 --- a/Bindings/i2c/i2c-rk3x.txt +++ b/Bindings/i2c/i2c-rk3x.txt @@ -7,6 +7,7 @@ Required properties : - reg : Offset and length of the register set for the device - compatible: should be one of the following: + - "rockchip,rv1108-i2c": for rv1108 - "rockchip,rk3066-i2c": for rk3066 - "rockchip,rk3188-i2c": for rk3188 - "rockchip,rk3228-i2c": for rk3228 diff --git a/Bindings/i2c/i2c-sh_mobile.txt b/Bindings/i2c/i2c-sh_mobile.txt index ae9c2a735f39..224390999e81 100644 --- a/Bindings/i2c/i2c-sh_mobile.txt +++ b/Bindings/i2c/i2c-sh_mobile.txt @@ -4,6 +4,8 @@ Required properties: - compatible : - "renesas,iic-r8a73a4" (R-Mobile APE6) - "renesas,iic-r8a7740" (R-Mobile A1) + - "renesas,iic-r8a7743" (RZ/G1M) + - "renesas,iic-r8a7745" (RZ/G1E) - "renesas,iic-r8a7790" (R-Car H2) - "renesas,iic-r8a7791" (R-Car M2-W) - "renesas,iic-r8a7792" (R-Car V2H) @@ -12,7 +14,8 @@ Required properties: - "renesas,iic-r8a7795" (R-Car H3) - "renesas,iic-r8a7796" (R-Car M3-W) - "renesas,iic-sh73a0" (SH-Mobile AG5) - - "renesas,rcar-gen2-iic" (generic R-Car Gen2 compatible device) + - "renesas,rcar-gen2-iic" (generic R-Car Gen2 or RZ/G1 + compatible device) - "renesas,rcar-gen3-iic" (generic R-Car Gen3 compatible device) - "renesas,rmobile-iic" (generic device) diff --git a/Bindings/i2c/i2c-sprd.txt b/Bindings/i2c/i2c-sprd.txt new file mode 100644 index 000000000000..60b7cda15dd2 --- /dev/null +++ b/Bindings/i2c/i2c-sprd.txt @@ -0,0 +1,31 @@ +I2C for Spreadtrum platforms + +Required properties: +- compatible: Should be "sprd,sc9860-i2c". +- reg: Specify the physical base address of the controller and length + of memory mapped region. +- interrupts: Should contain I2C interrupt. +- clock-names: Should contain following entries: + "i2c" for I2C clock, + "source" for I2C source (parent) clock, + "enable" for I2C module enable clock. +- clocks: Should contain a clock specifier for each entry in clock-names. +- clock-frequency: Constains desired I2C bus clock frequency in Hz. +- #address-cells: Should be 1 to describe address cells for I2C device address. +- #size-cells: Should be 0 means no size cell for I2C device address. + +Optional properties: +- Child nodes conforming to I2C bus binding + +Examples: +i2c0: i2c@70500000 { + compatible = "sprd,sc9860-i2c"; + reg = <0 0x70500000 0 0x1000>; + interrupts = ; + clock-names = "i2c", "source", "enable"; + clocks = <&clk_i2c3>, <&ext_26m>, <&clk_ap_apb_gates 11>; + clock-frequency = <400000>; + #address-cells = <1>; + #size-cells = <0>; +}; + diff --git a/Bindings/i2c/i2c-stm32.txt b/Bindings/i2c/i2c-stm32.txt index 78eaf7b718ed..3b5489966634 100644 --- a/Bindings/i2c/i2c-stm32.txt +++ b/Bindings/i2c/i2c-stm32.txt @@ -1,7 +1,9 @@ * I2C controller embedded in STMicroelectronics STM32 I2C platform Required properties : -- compatible : Must be "st,stm32f4-i2c" +- compatible : Must be one of the following + - "st,stm32f4-i2c" + - "st,stm32f7-i2c" - reg : Offset and length of the register set for the device - interrupts : Must contain the interrupt id for I2C event and then the interrupt id for I2C error. @@ -14,8 +16,16 @@ Required properties : Optional properties : - clock-frequency : Desired I2C bus clock frequency in Hz. If not specified, - the default 100 kHz frequency will be used. As only Normal and Fast modes - are supported, possible values are 100000 and 400000. + the default 100 kHz frequency will be used. + For STM32F4 SoC Standard-mode and Fast-mode are supported, possible values are + 100000 and 400000. + For STM32F7 SoC, Standard-mode, Fast-mode and Fast-mode Plus are supported, + possible values are 100000, 400000 and 1000000. +- i2c-scl-rising-time-ns : Only for STM32F7, I2C SCL Rising time for the board + (default: 25) +- i2c-scl-falling-time-ns : Only for STM32F7, I2C SCL Falling time for the board + (default: 10) + I2C Timings are derived from these 2 values Example : @@ -31,3 +41,16 @@ Example : pinctrl-0 = <&i2c1_sda_pin>, <&i2c1_scl_pin>; pinctrl-names = "default"; }; + + i2c@40005400 { + compatible = "st,stm32f7-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x40005400 0x400>; + interrupts = <31>, + <32>; + resets = <&rcc STM32F7_APB1_RESET(I2C1)>; + clocks = <&rcc 1 CLK_I2C1>; + pinctrl-0 = <&i2c1_sda_pin>, <&i2c1_scl_pin>; + pinctrl-names = "default"; + }; diff --git a/Bindings/i2c/nvidia,tegra20-i2c.txt b/Bindings/i2c/nvidia,tegra20-i2c.txt index 656716b72cc4..f64064f8bdc2 100644 --- a/Bindings/i2c/nvidia,tegra20-i2c.txt +++ b/Bindings/i2c/nvidia,tegra20-i2c.txt @@ -71,5 +71,4 @@ Example: reset-names = "i2c"; dmas = <&apbdma 16>, <&apbdma 16>; dma-names = "rx", "tx"; - status = "disabled"; }; diff --git a/Bindings/iio/adc/at91-sama5d2_adc.txt b/Bindings/iio/adc/at91-sama5d2_adc.txt index 3223684a643b..552e7a83951d 100644 --- a/Bindings/iio/adc/at91-sama5d2_adc.txt +++ b/Bindings/iio/adc/at91-sama5d2_adc.txt @@ -11,6 +11,11 @@ Required properties: - atmel,min-sample-rate-hz: Minimum sampling rate, it depends on SoC. - atmel,max-sample-rate-hz: Maximum sampling rate, it depends on SoC. - atmel,startup-time-ms: Startup time expressed in ms, it depends on SoC. + - atmel,trigger-edge-type: One of possible edge types for the ADTRG hardware + trigger pin. When the specific edge type is detected, the conversion will + start. Possible values are rising, falling, or both. + This property uses the IRQ edge types values: IRQ_TYPE_EDGE_RISING , + IRQ_TYPE_EDGE_FALLING or IRQ_TYPE_EDGE_BOTH Example: @@ -25,4 +30,5 @@ adc: adc@fc030000 { atmel,startup-time-ms = <4>; vddana-supply = <&vdd_3v3_lp_reg>; vref-supply = <&vdd_3v3_lp_reg>; + atmel,trigger-edge-type = ; } diff --git a/Bindings/iio/adc/brcm,iproc-static-adc.txt b/Bindings/iio/adc/brcm,iproc-static-adc.txt index caaaed765ce4..7b1b1e4086d4 100644 --- a/Bindings/iio/adc/brcm,iproc-static-adc.txt +++ b/Bindings/iio/adc/brcm,iproc-static-adc.txt @@ -37,5 +37,4 @@ For example: clocks = <&asiu_clks BCM_CYGNUS_ASIU_ADC_CLK>; clock-names = "tsc_clk"; interrupts = ; - status = "disabled"; }; diff --git a/Bindings/iio/adc/lpc1850-adc.txt b/Bindings/iio/adc/lpc1850-adc.txt index 0bcae5140bc5..9ada5abd45fa 100644 --- a/Bindings/iio/adc/lpc1850-adc.txt +++ b/Bindings/iio/adc/lpc1850-adc.txt @@ -17,5 +17,4 @@ adc0: adc@400e3000 { clocks = <&ccu1 CLK_APB3_ADC0>; vref-supply = <®_vdda>; resets = <&rgu 40>; - status = "disabled"; }; diff --git a/Bindings/iio/adc/mt6577_auxadc.txt b/Bindings/iio/adc/mt6577_auxadc.txt index 68c45cbbe3d9..64dc4843c180 100644 --- a/Bindings/iio/adc/mt6577_auxadc.txt +++ b/Bindings/iio/adc/mt6577_auxadc.txt @@ -12,6 +12,7 @@ for the Thermal Controller which holds a phandle to the AUXADC. Required properties: - compatible: Should be one of: - "mediatek,mt2701-auxadc": For MT2701 family of SoCs + - "mediatek,mt7622-auxadc": For MT7622 family of SoCs - "mediatek,mt8173-auxadc": For MT8173 family of SoCs - reg: Address range of the AUXADC unit. - clocks: Should contain a clock specifier for each entry in clock-names diff --git a/Bindings/iio/adc/rockchip-saradc.txt b/Bindings/iio/adc/rockchip-saradc.txt index e0a9b9d6d6fd..c2c50b59873d 100644 --- a/Bindings/iio/adc/rockchip-saradc.txt +++ b/Bindings/iio/adc/rockchip-saradc.txt @@ -6,6 +6,7 @@ Required properties: - "rockchip,rk3066-tsadc": for rk3036 - "rockchip,rk3328-saradc", "rockchip,rk3399-saradc": for rk3328 - "rockchip,rk3399-saradc": for rk3399 + - "rockchip,rv1108-saradc", "rockchip,rk3399-saradc": for rv1108 - reg: physical base address of the controller and length of memory mapped region. diff --git a/Bindings/iio/adc/st,stm32-adc.txt b/Bindings/iio/adc/st,stm32-adc.txt index 8310073f14e1..48bfcaa3ffcd 100644 --- a/Bindings/iio/adc/st,stm32-adc.txt +++ b/Bindings/iio/adc/st,stm32-adc.txt @@ -74,6 +74,11 @@ Optional properties: * can be 6, 8, 10 or 12 on stm32f4 * can be 8, 10, 12, 14 or 16 on stm32h7 Default is maximum resolution if unset. +- st,min-sample-time-nsecs: Minimum sampling time in nanoseconds. + Depending on hardware (board) e.g. high/low analog input source impedance, + fine tune of ADC sampling time may be recommended. + This can be either one value or an array that matches 'st,adc-channels' list, + to set sample time resp. for all channels, or independently for each channel. Example: adc: adc@40012000 { diff --git a/Bindings/iio/counter/stm32-lptimer-cnt.txt b/Bindings/iio/counter/stm32-lptimer-cnt.txt new file mode 100644 index 000000000000..a04aa5c04103 --- /dev/null +++ b/Bindings/iio/counter/stm32-lptimer-cnt.txt @@ -0,0 +1,27 @@ +STMicroelectronics STM32 Low-Power Timer quadrature encoder and counter + +STM32 Low-Power Timer provides several counter modes. It can be used as: +- quadrature encoder to detect angular position and direction of rotary + elements, from IN1 and IN2 input signals. +- simple counter from IN1 input signal. + +Must be a sub-node of an STM32 Low-Power Timer device tree node. +See ../mfd/stm32-lptimer.txt for details about the parent node. + +Required properties: +- compatible: Must be "st,stm32-lptimer-counter". +- pinctrl-names: Set to "default". +- pinctrl-0: List of phandles pointing to pin configuration nodes, + to set IN1/IN2 pins in mode of operation for Low-Power + Timer input on external pin. + +Example: + timer@40002400 { + compatible = "st,stm32-lptimer"; + ... + counter { + compatible = "st,stm32-lptimer-counter"; + pinctrl-names = "default"; + pinctrl-0 = <&lptim1_in_pins>; + }; + }; diff --git a/Bindings/iio/dac/lpc1850-dac.txt b/Bindings/iio/dac/lpc1850-dac.txt index 7d6647d4af5e..42db783c4e75 100644 --- a/Bindings/iio/dac/lpc1850-dac.txt +++ b/Bindings/iio/dac/lpc1850-dac.txt @@ -16,5 +16,4 @@ dac: dac@400e1000 { clocks = <&ccu1 CLK_APB3_DAC>; vref-supply = <®_vdda>; resets = <&rgu 42>; - status = "disabled"; }; diff --git a/Bindings/iio/dac/st,stm32-dac.txt b/Bindings/iio/dac/st,stm32-dac.txt index bcee71f808d0..bf2925c671c6 100644 --- a/Bindings/iio/dac/st,stm32-dac.txt +++ b/Bindings/iio/dac/st,stm32-dac.txt @@ -10,7 +10,9 @@ current. Contents of a stm32 dac root node: ----------------------------------- Required properties: -- compatible: Must be "st,stm32h7-dac-core". +- compatible: Should be one of: + "st,stm32f4-dac-core" + "st,stm32h7-dac-core" - reg: Offset and length of the device's register set. - clocks: Must contain an entry for pclk (which feeds the peripheral bus interface) diff --git a/Bindings/iio/humidity/hdc100x.txt b/Bindings/iio/humidity/hdc100x.txt new file mode 100644 index 000000000000..c52333bdfd19 --- /dev/null +++ b/Bindings/iio/humidity/hdc100x.txt @@ -0,0 +1,17 @@ +* HDC100x temperature + humidity sensors + +Required properties: + - compatible: Should contain one of the following: + ti,hdc1000 + ti,hdc1008 + ti,hdc1010 + ti,hdc1050 + ti,hdc1080 + - reg: i2c address of the sensor + +Example: + +hdc100x@40 { + compatible = "ti,hdc1000"; + reg = <0x40>; +}; diff --git a/Bindings/iio/humidity/hts221.txt b/Bindings/iio/humidity/hts221.txt index b20ab9c12080..10adeb0d703d 100644 --- a/Bindings/iio/humidity/hts221.txt +++ b/Bindings/iio/humidity/hts221.txt @@ -5,9 +5,18 @@ Required properties: - reg: i2c address of the sensor / spi cs line Optional properties: +- drive-open-drain: the interrupt/data ready line will be configured + as open drain, which is useful if several sensors share the same + interrupt line. This is a boolean property. + If the requested interrupt is configured as IRQ_TYPE_LEVEL_HIGH or + IRQ_TYPE_EDGE_RISING a pull-down resistor is needed to drive the line + when it is not active, whereas a pull-up one is needed when interrupt + line is configured as IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_EDGE_FALLING. + Refer to pinctrl/pinctrl-bindings.txt for the property description. - interrupt-parent: should be the phandle for the interrupt controller - interrupts: interrupt mapping for IRQ. It should be configured with - flags IRQ_TYPE_LEVEL_HIGH or IRQ_TYPE_EDGE_RISING. + flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or + IRQ_TYPE_EDGE_FALLING. Refer to interrupt-controller/interrupts.txt for generic interrupt client node bindings. diff --git a/Bindings/iio/humidity/htu21.txt b/Bindings/iio/humidity/htu21.txt new file mode 100644 index 000000000000..97d79636f7ae --- /dev/null +++ b/Bindings/iio/humidity/htu21.txt @@ -0,0 +1,13 @@ +*HTU21 - Measurement-Specialties htu21 temperature & humidity sensor and humidity part of MS8607 sensor + +Required properties: + + - compatible: should be "meas,htu21" or "meas,ms8607-humidity" + - reg: I2C address of the sensor + +Example: + +htu21@40 { + compatible = "meas,htu21"; + reg = <0x40>; +}; diff --git a/Bindings/iio/imu/st_lsm6dsx.txt b/Bindings/iio/imu/st_lsm6dsx.txt index 6f28ff55f3ec..1ff1af799c76 100644 --- a/Bindings/iio/imu/st_lsm6dsx.txt +++ b/Bindings/iio/imu/st_lsm6dsx.txt @@ -11,6 +11,14 @@ Required properties: Optional properties: - st,drdy-int-pin: the pin on the package that will be used to signal "data ready" (valid values: 1 or 2). +- drive-open-drain: the interrupt/data ready line will be configured + as open drain, which is useful if several sensors share the same + interrupt line. This is a boolean property. + (This binding is taken from pinctrl/pinctrl-bindings.txt) + If the requested interrupt is configured as IRQ_TYPE_LEVEL_HIGH or + IRQ_TYPE_EDGE_RISING a pull-down resistor is needed to drive the line + when it is not active, whereas a pull-up one is needed when interrupt + line is configured as IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_EDGE_FALLING. - interrupt-parent: should be the phandle for the interrupt controller - interrupts: interrupt mapping for IRQ. It should be configured with flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or diff --git a/Bindings/iio/pressure/ms5637.txt b/Bindings/iio/pressure/ms5637.txt new file mode 100644 index 000000000000..1f43ffa068ac --- /dev/null +++ b/Bindings/iio/pressure/ms5637.txt @@ -0,0 +1,17 @@ +* MS5637 - Measurement-Specialties MS5637, MS5805, MS5837 and MS8607 pressure & temperature sensor + +Required properties: + + -compatible: should be one of the following + meas,ms5637 + meas,ms5805 + meas,ms5837 + meas,ms8607-temppressure + -reg: I2C address of the sensor + +Example: + +ms5637@76 { + compatible = "meas,ms5637"; + reg = <0x76>; +}; diff --git a/Bindings/iio/proximity/as3935.txt b/Bindings/iio/proximity/as3935.txt index 38d74314b7ab..b6c1afa6f02d 100644 --- a/Bindings/iio/proximity/as3935.txt +++ b/Bindings/iio/proximity/as3935.txt @@ -16,6 +16,10 @@ Optional properties: - ams,tuning-capacitor-pf: Calibration tuning capacitor stepping value 0 - 120pF. This will require using the calibration data from the manufacturer. + - ams,nflwdth: Set the noise and watchdog threshold register on + startup. This will need to set according to the noise from the + MCU board, and possibly the local environment. Refer to the + datasheet for the threshold settings. Example: @@ -27,4 +31,5 @@ as3935@0 { interrupt-parent = <&gpio1>; interrupts = <16 1>; ams,tuning-capacitor-pf = <80>; + ams,nflwdth = <0x44>; }; diff --git a/Bindings/iio/st-sensors.txt b/Bindings/iio/st-sensors.txt index eaa8fbba34e2..9ec6f5ce54fc 100644 --- a/Bindings/iio/st-sensors.txt +++ b/Bindings/iio/st-sensors.txt @@ -45,6 +45,7 @@ Accelerometers: - st,lis2dh12-accel - st,h3lis331dl-accel - st,lng2dm-accel +- st,lis3l02dq Gyroscopes: - st,l3g4200d-gyro @@ -52,6 +53,7 @@ Gyroscopes: - st,lsm330dl-gyro - st,lsm330dlc-gyro - st,l3gd20-gyro +- st,l3gd20h-gyro - st,l3g4is-gyro - st,lsm330-gyro - st,lsm9ds0-gyro @@ -62,6 +64,7 @@ Magnetometers: - st,lsm303dlhc-magn - st,lsm303dlm-magn - st,lis3mdl-magn +- st,lis2mdl Pressure sensors: - st,lps001wp-press diff --git a/Bindings/iio/temperature/tsys01.txt b/Bindings/iio/temperature/tsys01.txt new file mode 100644 index 000000000000..0d5cc5595d0c --- /dev/null +++ b/Bindings/iio/temperature/tsys01.txt @@ -0,0 +1,19 @@ +* TSYS01 - Measurement Specialties temperature sensor + +Required properties: + + - compatible: should be "meas,tsys01" + - reg: I2C address of the sensor (changeable via CSB pin) + + ------------------------ + | CSB | Device Address | + ------------------------ + 1 0x76 + 0 0x77 + +Example: + +tsys01@76 { + compatible = "meas,tsys01"; + reg = <0x76>; +}; diff --git a/Bindings/iio/timer/stm32-lptimer-trigger.txt b/Bindings/iio/timer/stm32-lptimer-trigger.txt new file mode 100644 index 000000000000..85e6806b17d7 --- /dev/null +++ b/Bindings/iio/timer/stm32-lptimer-trigger.txt @@ -0,0 +1,23 @@ +STMicroelectronics STM32 Low-Power Timer Trigger + +STM32 Low-Power Timer provides trigger source (LPTIM output) that can be used +by STM32 internal ADC and/or DAC. + +Must be a sub-node of an STM32 Low-Power Timer device tree node. +See ../mfd/stm32-lptimer.txt for details about the parent node. + +Required properties: +- compatible: Must be "st,stm32-lptimer-trigger". +- reg: Identify trigger hardware block. Must be 0, 1 or 2 + respectively for lptimer1, lptimer2 or lptimer3 + trigger output. + +Example: + timer@40002400 { + compatible = "st,stm32-lptimer"; + ... + trigger@0 { + compatible = "st,stm32-lptimer-trigger"; + reg = <0>; + }; + }; diff --git a/Bindings/iio/timer/stm32-timer-trigger.txt b/Bindings/iio/timer/stm32-timer-trigger.txt index 55a653d15303..b8e8c769d434 100644 --- a/Bindings/iio/timer/stm32-timer-trigger.txt +++ b/Bindings/iio/timer/stm32-timer-trigger.txt @@ -4,7 +4,9 @@ Must be a sub-node of an STM32 Timers device tree node. See ../mfd/stm32-timers.txt for details about the parent node. Required parameters: -- compatible: Must be "st,stm32-timer-trigger". +- compatible: Must be one of: + "st,stm32-timer-trigger" + "st,stm32h7-timer-trigger" - reg: Identify trigger hardware block. Example: @@ -14,7 +16,7 @@ Example: compatible = "st,stm32-timers"; reg = <0x40010000 0x400>; clocks = <&rcc 0 160>; - clock-names = "clk_int"; + clock-names = "int"; timer@0 { compatible = "st,stm32-timer-trigger"; diff --git a/Bindings/input/atmel,maxtouch.txt b/Bindings/input/atmel,maxtouch.txt index 1852906517ab..23e3abc3fdef 100644 --- a/Bindings/input/atmel,maxtouch.txt +++ b/Bindings/input/atmel,maxtouch.txt @@ -22,6 +22,8 @@ Optional properties for main touchpad device: experiment to determine which bit corresponds to which input. Use KEY_RESERVED for unused padding values. +- reset-gpios: GPIO specifier for the touchscreen's reset pin (active low) + Example: touch@4b { diff --git a/Bindings/input/brcm,bcm-keypad.txt b/Bindings/input/brcm,bcm-keypad.txt index b77f50bd6403..262deab73588 100644 --- a/Bindings/input/brcm,bcm-keypad.txt +++ b/Bindings/input/brcm,bcm-keypad.txt @@ -72,7 +72,6 @@ Example: /* Required Board specific properties */ keypad,num-rows = <5>; keypad,num-columns = <5>; - status = "okay"; linux,keymap = ; + }; + + vibrator_enable_pin: pinmux_vibrator_enable_pin { + pinctrl-single,pins = < + OMAP4_IOPAD(0X1d0, PIN_OUTPUT | MUX_MODE1) /* dmtimer9_pwm_evt (gpio_28) */ + >; + }; +}; + +/ { + pwm8: dmtimer-pwm { + pinctrl-names = "default"; + pinctrl-0 = <&vibrator_direction_pin>; + + compatible = "ti,omap-dmtimer-pwm"; + #pwm-cells = <3>; + ti,timers = <&timer8>; + ti,clock-source = <0x01>; + }; + + pwm9: dmtimer-pwm { + pinctrl-names = "default"; + pinctrl-0 = <&vibrator_enable_pin>; + + compatible = "ti,omap-dmtimer-pwm"; + #pwm-cells = <3>; + ti,timers = <&timer9>; + ti,clock-source = <0x01>; + }; + + vibrator { + compatible = "pwm-vibrator"; + pwms = <&pwm8 0 1000000000 0>, + <&pwm9 0 1000000000 0>; + pwm-names = "enable", "direction"; + direction-duty-cycle-ns = <1000000000>; + }; +}; diff --git a/Bindings/input/ti,drv260x.txt b/Bindings/input/ti,drv260x.txt index ee09c8f4474a..4c5312eaaa85 100644 --- a/Bindings/input/ti,drv260x.txt +++ b/Bindings/input/ti,drv260x.txt @@ -43,7 +43,7 @@ haptics: haptics@5a { mode = ; library-sel = ; vib-rated-mv = <3200>; - vib-overdriver-mv = <3200>; + vib-overdrive-mv = <3200>; } For more product information please see the link below: diff --git a/Bindings/input/touchscreen/colibri-vf50-ts.txt b/Bindings/input/touchscreen/colibri-vf50-ts.txt index 9d9e930f3251..df531b5b6a0d 100644 --- a/Bindings/input/touchscreen/colibri-vf50-ts.txt +++ b/Bindings/input/touchscreen/colibri-vf50-ts.txt @@ -32,5 +32,4 @@ Example: pinctrl-1 = <&pinctrl_touchctrl_default>; pinctrl-2 = <&pinctrl_touchctrl_gpios>; vf50-ts-min-pressure = <200>; - status = "disabled"; }; diff --git a/Bindings/input/touchscreen/imx6ul_tsc.txt b/Bindings/input/touchscreen/imx6ul_tsc.txt index d4927c202aef..e67e58b61706 100644 --- a/Bindings/input/touchscreen/imx6ul_tsc.txt +++ b/Bindings/input/touchscreen/imx6ul_tsc.txt @@ -35,5 +35,4 @@ Example: measure-delay-time = <0xfff>; pre-charge-time = <0xffff>; touchscreen-average-samples = <32>; - status = "okay"; }; diff --git a/Bindings/interrupt-controller/arm,gic-v3.txt b/Bindings/interrupt-controller/arm,gic-v3.txt index 4c29cdab0ea5..5eb108e180fa 100644 --- a/Bindings/interrupt-controller/arm,gic-v3.txt +++ b/Bindings/interrupt-controller/arm,gic-v3.txt @@ -99,7 +99,7 @@ Examples: compatible = "arm,gic-v3-its"; msi-controller; #msi-cells = <1>; - reg = <0x0 0x2c200000 0 0x200000>; + reg = <0x0 0x2c200000 0 0x20000>; }; }; @@ -124,14 +124,14 @@ Examples: compatible = "arm,gic-v3-its"; msi-controller; #msi-cells = <1>; - reg = <0x0 0x2c200000 0 0x200000>; + reg = <0x0 0x2c200000 0 0x20000>; }; gic-its@2c400000 { compatible = "arm,gic-v3-its"; msi-controller; #msi-cells = <1>; - reg = <0x0 0x2c400000 0 0x200000>; + reg = <0x0 0x2c400000 0 0x20000>; }; ppi-partitions { diff --git a/Bindings/interrupt-controller/fsl,ls-scfg-msi.txt b/Bindings/interrupt-controller/fsl,ls-scfg-msi.txt index 9e389493203f..49ccabbfa6f3 100644 --- a/Bindings/interrupt-controller/fsl,ls-scfg-msi.txt +++ b/Bindings/interrupt-controller/fsl,ls-scfg-msi.txt @@ -4,8 +4,10 @@ Required properties: - compatible: should be "fsl,-msi" to identify Layerscape PCIe MSI controller block such as: - "fsl,1s1021a-msi" - "fsl,1s1043a-msi" + "fsl,ls1021a-msi" + "fsl,ls1043a-msi" + "fsl,ls1046a-msi" + "fsl,ls1043a-v1.1-msi" - msi-controller: indicates that this is a PCIe MSI controller node - reg: physical base address of the controller and length of memory mapped. - interrupts: an interrupt to the parent interrupt controller. @@ -23,7 +25,7 @@ MSI controller node Examples: msi1: msi-controller@1571000 { - compatible = "fsl,1s1043a-msi"; + compatible = "fsl,ls1043a-msi"; reg = <0x0 0x1571000 0x0 0x8>, msi-controller; interrupts = <0 116 0x4>; diff --git a/Bindings/interrupt-controller/mediatek,sysirq.txt b/Bindings/interrupt-controller/mediatek,sysirq.txt index 11cc87aeb276..07bf0b9a5139 100644 --- a/Bindings/interrupt-controller/mediatek,sysirq.txt +++ b/Bindings/interrupt-controller/mediatek,sysirq.txt @@ -17,6 +17,7 @@ Required properties: "mediatek,mt6582-sysirq", "mediatek,mt6577-sysirq": for MT6582 "mediatek,mt6580-sysirq", "mediatek,mt6577-sysirq": for MT6580 "mediatek,mt6577-sysirq": for MT6577 + "mediatek,mt2712-sysirq", "mediatek,mt6577-sysirq": for MT2712 "mediatek,mt2701-sysirq", "mediatek,mt6577-sysirq": for MT2701 - interrupt-controller : Identifies the node as an interrupt controller - #interrupt-cells : Use the same format as specified by GIC in arm,gic.txt. diff --git a/Bindings/interrupt-controller/socionext,uniphier-aidet.txt b/Bindings/interrupt-controller/socionext,uniphier-aidet.txt new file mode 100644 index 000000000000..48e71d3ac2ad --- /dev/null +++ b/Bindings/interrupt-controller/socionext,uniphier-aidet.txt @@ -0,0 +1,32 @@ +UniPhier AIDET + +UniPhier AIDET (ARM Interrupt Detector) is an add-on block for ARM GIC (Generic +Interrupt Controller). GIC itself can handle only high level and rising edge +interrupts. The AIDET provides logic inverter to support low level and falling +edge interrupts. + +Required properties: +- compatible: Should be one of the following: + "socionext,uniphier-ld4-aidet" - for LD4 SoC + "socionext,uniphier-pro4-aidet" - for Pro4 SoC + "socionext,uniphier-sld8-aidet" - for sLD8 SoC + "socionext,uniphier-pro5-aidet" - for Pro5 SoC + "socionext,uniphier-pxs2-aidet" - for PXs2/LD6b SoC + "socionext,uniphier-ld11-aidet" - for LD11 SoC + "socionext,uniphier-ld20-aidet" - for LD20 SoC + "socionext,uniphier-pxs3-aidet" - for PXs3 SoC +- reg: Specifies offset and length of the register set for the device. +- interrupt-controller: Identifies the node as an interrupt controller +- #interrupt-cells : Specifies the number of cells needed to encode an interrupt + source. The value should be 2. The first cell defines the interrupt number + (corresponds to the SPI interrupt number of GIC). The second cell specifies + the trigger type as defined in interrupts.txt in this directory. + +Example: + + aidet: aidet@5fc20000 { + compatible = "socionext,uniphier-pro4-aidet"; + reg = <0x5fc20000 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; diff --git a/Bindings/iommu/qcom,iommu.txt b/Bindings/iommu/qcom,iommu.txt new file mode 100644 index 000000000000..b2641ceb2b40 --- /dev/null +++ b/Bindings/iommu/qcom,iommu.txt @@ -0,0 +1,121 @@ +* QCOM IOMMU v1 Implementation + +Qualcomm "B" family devices which are not compatible with arm-smmu have +a similar looking IOMMU but without access to the global register space, +and optionally requiring additional configuration to route context irqs +to non-secure vs secure interrupt line. + +** Required properties: + +- compatible : Should be one of: + + "qcom,msm8916-iommu" + + Followed by "qcom,msm-iommu-v1". + +- clock-names : Should be a pair of "iface" (required for IOMMUs + register group access) and "bus" (required for + the IOMMUs underlying bus access). + +- clocks : Phandles for respective clocks described by + clock-names. + +- #address-cells : must be 1. + +- #size-cells : must be 1. + +- #iommu-cells : Must be 1. Index identifies the context-bank #. + +- ranges : Base address and size of the iommu context banks. + +- qcom,iommu-secure-id : secure-id. + +- List of sub-nodes, one per translation context bank. Each sub-node + has the following required properties: + + - compatible : Should be one of: + - "qcom,msm-iommu-v1-ns" : non-secure context bank + - "qcom,msm-iommu-v1-sec" : secure context bank + - reg : Base address and size of context bank within the iommu + - interrupts : The context fault irq. + +** Optional properties: + +- reg : Base address and size of the SMMU local base, should + be only specified if the iommu requires configuration + for routing of context bank irq's to secure vs non- + secure lines. (Ie. if the iommu contains secure + context banks) + + +** Examples: + + apps_iommu: iommu@1e20000 { + #address-cells = <1>; + #size-cells = <1>; + #iommu-cells = <1>; + compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; + ranges = <0 0x1e20000 0x40000>; + reg = <0x1ef0000 0x3000>; + clocks = <&gcc GCC_SMMU_CFG_CLK>, + <&gcc GCC_APSS_TCU_CLK>; + clock-names = "iface", "bus"; + qcom,iommu-secure-id = <17>; + + // mdp_0: + iommu-ctx@4000 { + compatible = "qcom,msm-iommu-v1-ns"; + reg = <0x4000 0x1000>; + interrupts = ; + }; + + // venus_ns: + iommu-ctx@5000 { + compatible = "qcom,msm-iommu-v1-sec"; + reg = <0x5000 0x1000>; + interrupts = ; + }; + }; + + gpu_iommu: iommu@1f08000 { + #address-cells = <1>; + #size-cells = <1>; + #iommu-cells = <1>; + compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; + ranges = <0 0x1f08000 0x10000>; + clocks = <&gcc GCC_SMMU_CFG_CLK>, + <&gcc GCC_GFX_TCU_CLK>; + clock-names = "iface", "bus"; + qcom,iommu-secure-id = <18>; + + // gfx3d_user: + iommu-ctx@1000 { + compatible = "qcom,msm-iommu-v1-ns"; + reg = <0x1000 0x1000>; + interrupts = ; + }; + + // gfx3d_priv: + iommu-ctx@2000 { + compatible = "qcom,msm-iommu-v1-ns"; + reg = <0x2000 0x1000>; + interrupts = ; + }; + }; + + ... + + venus: video-codec@1d00000 { + ... + iommus = <&apps_iommu 5>; + }; + + mdp: mdp@1a01000 { + ... + iommus = <&apps_iommu 4>; + }; + + gpu@01c00000 { + ... + iommus = <&gpu_iommu 1>, <&gpu_iommu 2>; + }; diff --git a/Bindings/iommu/rockchip,iommu.txt b/Bindings/iommu/rockchip,iommu.txt index 9a55ac3735e5..2098f7732264 100644 --- a/Bindings/iommu/rockchip,iommu.txt +++ b/Bindings/iommu/rockchip,iommu.txt @@ -15,6 +15,11 @@ Required properties: to associate with its master device. See: Documentation/devicetree/bindings/iommu/iommu.txt +Optional properties: +- rockchip,disable-mmu-reset : Don't use the mmu reset operation. + Some mmu instances may produce unexpected results + when the reset operation is used. + Example: vopl_mmu: iommu@ff940300 { diff --git a/Bindings/leds/ams,as3645a.txt b/Bindings/leds/ams,as3645a.txt new file mode 100644 index 000000000000..fdc40e354a64 --- /dev/null +++ b/Bindings/leds/ams,as3645a.txt @@ -0,0 +1,79 @@ +Analog devices AS3645A device tree bindings + +The AS3645A flash LED controller can drive two LEDs, one high current +flash LED and one indicator LED. The high current flash LED can be +used in torch mode as well. + +Ranges below noted as [a, b] are closed ranges between a and b, i.e. a +and b are included in the range. + +Please also see common.txt in the same directory. + + +Required properties +=================== + +compatible : Must be "ams,as3645a". +reg : The I2C address of the device. Typically 0x30. +#address-cells : 1 +#size-cells : 0 + + +Required properties of the flash child node (0) +=============================================== + +reg: 0 +flash-timeout-us: Flash timeout in microseconds. The value must be in + the range [100000, 850000] and divisible by 50000. +flash-max-microamp: Maximum flash current in microamperes. Has to be + in the range between [200000, 500000] and + divisible by 20000. +led-max-microamp: Maximum torch (assist) current in microamperes. The + value must be in the range between [20000, 160000] and + divisible by 20000. +ams,input-max-microamp: Maximum flash controller input current. The + value must be in the range [1250000, 2000000] + and divisible by 50000. + + +Optional properties of the flash child node +=========================================== + +label : The label of the flash LED. + + +Required properties of the indicator child node (1) +=================================================== + +reg: 1 +led-max-microamp: Maximum indicator current. The allowed values are + 2500, 5000, 7500 and 10000. + +Optional properties of the indicator child node +=============================================== + +label : The label of the indicator LED. + + +Example +======= + + as3645a@30 { + #address-cells: 1 + #size-cells: 0 + reg = <0x30>; + compatible = "ams,as3645a"; + flash@0 { + reg = <0x0>; + flash-timeout-us = <150000>; + flash-max-microamp = <320000>; + led-max-microamp = <60000>; + ams,input-max-microamp = <1750000>; + label = "as3645a:flash"; + }; + indicator@1 { + reg = <0x1>; + led-max-microamp = <10000>; + label = "as3645a:indicator"; + }; + }; diff --git a/Bindings/leds/irled/gpio-ir-tx.txt b/Bindings/leds/irled/gpio-ir-tx.txt new file mode 100644 index 000000000000..cbe8dfd29715 --- /dev/null +++ b/Bindings/leds/irled/gpio-ir-tx.txt @@ -0,0 +1,14 @@ +Device tree bindings for IR LED connected through gpio pin which is used as +remote controller transmitter. + +Required properties: + - compatible: should be "gpio-ir-tx". + - gpios : Should specify the IR LED GPIO, see "gpios property" in + Documentation/devicetree/bindings/gpio/gpio.txt. Active low LEDs + should be indicated using flags in the GPIO specifier. + +Example: + irled@0 { + compatible = "gpio-ir-tx"; + gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + }; diff --git a/Bindings/leds/irled/pwm-ir-tx.txt b/Bindings/leds/irled/pwm-ir-tx.txt new file mode 100644 index 000000000000..66e5672c2e3d --- /dev/null +++ b/Bindings/leds/irled/pwm-ir-tx.txt @@ -0,0 +1,13 @@ +Device tree bindings for IR LED connected through pwm pin which is used as +remote controller transmitter. + +Required properties: + - compatible: should be "pwm-ir-tx". + - pwms : PWM property to point to the PWM device (phandle)/port (id) + and to specify the period time to be used: <&phandle id period_ns>; + +Example: + irled { + compatible = "pwm-ir-tx"; + pwms = <&pwm0 0 10000000>; + }; diff --git a/Bindings/leds/leds-gpio.txt b/Bindings/leds/leds-gpio.txt index 76535ca37120..a48dda268f81 100644 --- a/Bindings/leds/leds-gpio.txt +++ b/Bindings/leds/leds-gpio.txt @@ -18,6 +18,9 @@ LED sub-node properties: see Documentation/devicetree/bindings/leds/common.txt - retain-state-suspended: (optional) The suspend state can be retained.Such as charge-led gpio. +- retain-state-shutdown: (optional) Retain the state of the LED on shutdown. + Useful in BMC systems, for example when the BMC is rebooted while the host + remains up. - panic-indicator : (optional) see Documentation/devicetree/bindings/leds/common.txt diff --git a/Bindings/leds/leds-pca955x.txt b/Bindings/leds/leds-pca955x.txt new file mode 100644 index 000000000000..7984efb767b4 --- /dev/null +++ b/Bindings/leds/leds-pca955x.txt @@ -0,0 +1,88 @@ +* NXP - pca955x LED driver + +The PCA955x family of chips are I2C LED blinkers whose pins not used +to control LEDs can be used as general purpose I/Os. The GPIO pins can +be input or output, and output pins can also be pulse-width controlled. + +Required properties: +- compatible : should be one of : + "nxp,pca9550" + "nxp,pca9551" + "nxp,pca9552" + "nxp,pca9553" +- #address-cells: must be 1 +- #size-cells: must be 0 +- reg: I2C slave address. depends on the model. + +Optional properties: +- gpio-controller: allows pins to be used as GPIOs. +- #gpio-cells: must be 2. +- gpio-line-names: define the names of the GPIO lines + +LED sub-node properties: +- reg : number of LED line. + from 0 to 1 for the pca9550 + from 0 to 7 for the pca9551 + from 0 to 15 for the pca9552 + from 0 to 3 for the pca9553 +- type: (optional) either + PCA9532_TYPE_NONE + PCA9532_TYPE_LED + PCA9532_TYPE_GPIO + see dt-bindings/leds/leds-pca955x.h (default to LED) +- label : (optional) + see Documentation/devicetree/bindings/leds/common.txt +- linux,default-trigger : (optional) + see Documentation/devicetree/bindings/leds/common.txt + +Examples: + +pca9552: pca9552@60 { + compatible = "nxp,pca9552"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x60>; + + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = "GPIO12", "GPIO13", "GPIO14", "GPIO15"; + + gpio@12 { + reg = <12>; + type = ; + }; + gpio@13 { + reg = <13>; + type = ; + }; + gpio@14 { + reg = <14>; + type = ; + }; + gpio@15 { + reg = <15>; + type = ; + }; + + led@0 { + label = "red:power"; + linux,default-trigger = "default-on"; + reg = <0>; + type = ; + }; + led@1 { + label = "green:power"; + reg = <1>; + type = ; + }; + led@2 { + label = "pca9552:yellow"; + reg = <2>; + type = ; + }; + led@3 { + label = "pca9552:white"; + reg = <3>; + type = ; + }; +}; diff --git a/Bindings/media/i2c/adv748x.txt b/Bindings/media/i2c/adv748x.txt new file mode 100644 index 000000000000..21ffb5ed8183 --- /dev/null +++ b/Bindings/media/i2c/adv748x.txt @@ -0,0 +1,95 @@ +* Analog Devices ADV748X video decoder with HDMI receiver + +The ADV7481 and ADV7482 are multi format video decoders with an integrated +HDMI receiver. They can output CSI-2 on two independent outputs TXA and TXB +from three input sources HDMI, analog and TTL. + +Required Properties: + + - compatible: Must contain one of the following + - "adi,adv7481" for the ADV7481 + - "adi,adv7482" for the ADV7482 + + - reg: I2C slave address + +Optional Properties: + + - interrupt-names: Should specify the interrupts as "intrq1", "intrq2" and/or + "intrq3". All interrupts are optional. The "intrq3" interrupt + is only available on the adv7481 + - interrupts: Specify the interrupt lines for the ADV748x + +The device node must contain one 'port' child node per device input and output +port, in accordance with the video interface bindings defined in +Documentation/devicetree/bindings/media/video-interfaces.txt. The port nodes +are numbered as follows. + + Name Type Port + --------------------------------------- + AIN0 sink 0 + AIN1 sink 1 + AIN2 sink 2 + AIN3 sink 3 + AIN4 sink 4 + AIN5 sink 5 + AIN6 sink 6 + AIN7 sink 7 + HDMI sink 8 + TTL sink 9 + TXA source 10 + TXB source 11 + +The digital output port nodes must contain at least one endpoint. + +Ports are optional if they are not connected to anything at the hardware level. + +Example: + + video-receiver@70 { + compatible = "adi,adv7482"; + reg = <0x70>; + + #address-cells = <1>; + #size-cells = <0>; + + interrupt-parent = <&gpio6>; + interrupt-names = "intrq1", "intrq2"; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>, + <31 IRQ_TYPE_LEVEL_LOW>; + + port@7 { + reg = <7>; + + adv7482_ain7: endpoint { + remote-endpoint = <&cvbs_in>; + }; + }; + + port@8 { + reg = <8>; + + adv7482_hdmi: endpoint { + remote-endpoint = <&hdmi_in>; + }; + }; + + port@10 { + reg = <10>; + + adv7482_txa: endpoint { + clock-lanes = <0>; + data-lanes = <1 2 3 4>; + remote-endpoint = <&csi40_in>; + }; + }; + + port@11 { + reg = <11>; + + adv7482_txb: endpoint { + clock-lanes = <0>; + data-lanes = <1>; + remote-endpoint = <&csi20_in>; + }; + }; + }; diff --git a/Bindings/media/i2c/dongwoon,dw9714.txt b/Bindings/media/i2c/dongwoon,dw9714.txt new file mode 100644 index 000000000000..b88dcdd41def --- /dev/null +++ b/Bindings/media/i2c/dongwoon,dw9714.txt @@ -0,0 +1,9 @@ +Dongwoon Anatech DW9714 camera voice coil lens driver + +DW9174 is a 10-bit DAC with current sink capability. It is intended +for driving voice coil lenses in camera modules. + +Mandatory properties: + +- compatible: "dongwoon,dw9714" +- reg: I²C slave address diff --git a/Bindings/media/meson-ao-cec.txt b/Bindings/media/meson-ao-cec.txt new file mode 100644 index 000000000000..8671bdb08080 --- /dev/null +++ b/Bindings/media/meson-ao-cec.txt @@ -0,0 +1,28 @@ +* Amlogic Meson AO-CEC driver + +The Amlogic Meson AO-CEC module is present is Amlogic SoCs and its purpose is +to handle communication between HDMI connected devices over the CEC bus. + +Required properties: + - compatible : value should be following + "amlogic,meson-gx-ao-cec" + + - reg : Physical base address of the IP registers and length of memory + mapped region. + + - interrupts : AO-CEC interrupt number to the CPU. + - clocks : from common clock binding: handle to AO-CEC clock. + - clock-names : from common clock binding: must contain "core", + corresponding to entry in the clocks property. + - hdmi-phandle: phandle to the HDMI controller + +Example: + +cec_AO: cec@100 { + compatible = "amlogic,meson-gx-ao-cec"; + reg = <0x0 0x00100 0x0 0x14>; + interrupts = ; + clocks = <&clkc_AO CLKID_AO_CEC_32K>; + clock-names = "core"; + hdmi-phandle = <&hdmi_tx>; +}; diff --git a/Bindings/media/mtk-cir.txt b/Bindings/media/mtk-cir.txt index 2be2005577d6..5e18087ce11f 100644 --- a/Bindings/media/mtk-cir.txt +++ b/Bindings/media/mtk-cir.txt @@ -2,10 +2,14 @@ Device-Tree bindings for Mediatek consumer IR controller found in Mediatek SoC family Required properties: -- compatible : "mediatek,mt7623-cir" +- compatible : Should be + "mediatek,mt7623-cir": for MT7623 SoC + "mediatek,mt7622-cir": for MT7622 SoC - clocks : list of clock specifiers, corresponding to entries in clock-names property; -- clock-names : should contain "clk" entries; +- clock-names : should contain + - "clk" entries: for MT7623 SoC + - "clk", "bus" entries: for MT7622 SoC - interrupts : should contain IR IRQ number; - reg : should contain IO map address for IR. diff --git a/Bindings/media/pxa-camera.txt b/Bindings/media/pxa-camera.txt index 11f5b5d51af8..bc03ec096269 100644 --- a/Bindings/media/pxa-camera.txt +++ b/Bindings/media/pxa-camera.txt @@ -24,7 +24,6 @@ Example: clock-frequency = <50000000>; clock-output-names = "qci_mclk"; - status = "okay"; port { #address-cells = <1>; diff --git a/Bindings/media/qcom,camss.txt b/Bindings/media/qcom,camss.txt new file mode 100644 index 000000000000..cadecebc73f7 --- /dev/null +++ b/Bindings/media/qcom,camss.txt @@ -0,0 +1,197 @@ +Qualcomm Camera Subsystem + +* Properties + +- compatible: + Usage: required + Value type: + Definition: Should contain: + - "qcom,msm8916-camss" +- reg: + Usage: required + Value type: + Definition: Register ranges as listed in the reg-names property. +- reg-names: + Usage: required + Value type: + Definition: Should contain the following entries: + - "csiphy0" + - "csiphy0_clk_mux" + - "csiphy1" + - "csiphy1_clk_mux" + - "csid0" + - "csid1" + - "ispif" + - "csi_clk_mux" + - "vfe0" +- interrupts: + Usage: required + Value type: + Definition: Interrupts as listed in the interrupt-names property. +- interrupt-names: + Usage: required + Value type: + Definition: Should contain the following entries: + - "csiphy0" + - "csiphy1" + - "csid0" + - "csid1" + - "ispif" + - "vfe0" +- power-domains: + Usage: required + Value type: + Definition: A phandle and power domain specifier pairs to the + power domain which is responsible for collapsing + and restoring power to the peripheral. +- clocks: + Usage: required + Value type: + Definition: A list of phandle and clock specifier pairs as listed + in clock-names property. +- clock-names: + Usage: required + Value type: + Definition: Should contain the following entries: + - "camss_top_ahb" + - "ispif_ahb" + - "csiphy0_timer" + - "csiphy1_timer" + - "csi0_ahb" + - "csi0" + - "csi0_phy" + - "csi0_pix" + - "csi0_rdi" + - "csi1_ahb" + - "csi1" + - "csi1_phy" + - "csi1_pix" + - "csi1_rdi" + - "camss_ahb" + - "camss_vfe_vfe" + - "camss_csi_vfe" + - "iface" + - "bus" +- vdda-supply: + Usage: required + Value type: + Definition: A phandle to voltage supply for CSI2. +- iommus: + Usage: required + Value type: + Definition: A list of phandle and IOMMU specifier pairs. + +* Nodes + +- ports: + Usage: required + Definition: As described in video-interfaces.txt in same directory. + Properties: + - reg: + Usage: required + Value type: + Definition: Selects CSI2 PHY interface - PHY0 or PHY1. + Endpoint node properties: + - clock-lanes: + Usage: required + Value type: + Definition: The physical clock lane index. The value + must always be <1> as the physical clock + lane is lane 1. + - data-lanes: + Usage: required + Value type: + Definition: An array of physical data lanes indexes. + Position of an entry determines the logical + lane number, while the value of an entry + indicates physical lane index. Lane swapping + is supported. + +* An Example + + camss: camss@1b00000 { + compatible = "qcom,msm8916-camss"; + reg = <0x1b0ac00 0x200>, + <0x1b00030 0x4>, + <0x1b0b000 0x200>, + <0x1b00038 0x4>, + <0x1b08000 0x100>, + <0x1b08400 0x100>, + <0x1b0a000 0x500>, + <0x1b00020 0x10>, + <0x1b10000 0x1000>; + reg-names = "csiphy0", + "csiphy0_clk_mux", + "csiphy1", + "csiphy1_clk_mux", + "csid0", + "csid1", + "ispif", + "csi_clk_mux", + "vfe0"; + interrupts = , + , + , + , + , + ; + interrupt-names = "csiphy0", + "csiphy1", + "csid0", + "csid1", + "ispif", + "vfe0"; + power-domains = <&gcc VFE_GDSC>; + clocks = <&gcc GCC_CAMSS_TOP_AHB_CLK>, + <&gcc GCC_CAMSS_ISPIF_AHB_CLK>, + <&gcc GCC_CAMSS_CSI0PHYTIMER_CLK>, + <&gcc GCC_CAMSS_CSI1PHYTIMER_CLK>, + <&gcc GCC_CAMSS_CSI0_AHB_CLK>, + <&gcc GCC_CAMSS_CSI0_CLK>, + <&gcc GCC_CAMSS_CSI0PHY_CLK>, + <&gcc GCC_CAMSS_CSI0PIX_CLK>, + <&gcc GCC_CAMSS_CSI0RDI_CLK>, + <&gcc GCC_CAMSS_CSI1_AHB_CLK>, + <&gcc GCC_CAMSS_CSI1_CLK>, + <&gcc GCC_CAMSS_CSI1PHY_CLK>, + <&gcc GCC_CAMSS_CSI1PIX_CLK>, + <&gcc GCC_CAMSS_CSI1RDI_CLK>, + <&gcc GCC_CAMSS_AHB_CLK>, + <&gcc GCC_CAMSS_VFE0_CLK>, + <&gcc GCC_CAMSS_CSI_VFE0_CLK>, + <&gcc GCC_CAMSS_VFE_AHB_CLK>, + <&gcc GCC_CAMSS_VFE_AXI_CLK>; + clock-names = "camss_top_ahb", + "ispif_ahb", + "csiphy0_timer", + "csiphy1_timer", + "csi0_ahb", + "csi0", + "csi0_phy", + "csi0_pix", + "csi0_rdi", + "csi1_ahb", + "csi1", + "csi1_phy", + "csi1_pix", + "csi1_rdi", + "camss_ahb", + "camss_vfe_vfe", + "camss_csi_vfe", + "iface", + "bus"; + vdda-supply = <&pm8916_l2>; + iommus = <&apps_iommu 3>; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + csiphy0_ep: endpoint { + clock-lanes = <1>; + data-lanes = <0 2>; + remote-endpoint = <&ov5645_ep>; + }; + }; + }; + }; diff --git a/Bindings/media/renesas,drif.txt b/Bindings/media/renesas,drif.txt index 39516b94c28f..0d8974aa8b38 100644 --- a/Bindings/media/renesas,drif.txt +++ b/Bindings/media/renesas,drif.txt @@ -40,6 +40,7 @@ To summarize, Required properties of an internal channel: ------------------------------------------- - compatible: "renesas,r8a7795-drif" if DRIF controller is a part of R8A7795 SoC. + "renesas,r8a7796-drif" if DRIF controller is a part of R8A7796 SoC. "renesas,rcar-gen3-drif" for a generic R-Car Gen3 compatible device. When compatible with the generic version, nodes must list the diff --git a/Bindings/media/s5p-cec.txt b/Bindings/media/s5p-cec.txt index 1b1a10ba48ce..6f3756da900f 100644 --- a/Bindings/media/s5p-cec.txt +++ b/Bindings/media/s5p-cec.txt @@ -33,5 +33,4 @@ hdmicec: cec@100B0000 { hdmi-phandle = <&hdmi>; pinctrl-names = "default"; pinctrl-0 = <&hdmi_cec>; - status = "okay"; }; diff --git a/Bindings/media/samsung-fimc.txt b/Bindings/media/samsung-fimc.txt index 922d6f8e74be..e4e15d8d7521 100644 --- a/Bindings/media/samsung-fimc.txt +++ b/Bindings/media/samsung-fimc.txt @@ -166,7 +166,6 @@ Example: clock-output-names = "cam_a_clkout", "cam_b_clkout"; pinctrl-names = "default"; pinctrl-0 = <&cam_port_a_clk_active>; - status = "okay"; #address-cells = <1>; #size-cells = <1>; @@ -189,7 +188,6 @@ Example: compatible = "samsung,exynos4210-fimc"; reg = <0x11800000 0x1000>; interrupts = <0 85 0>; - status = "okay"; }; csis_0: csis@11880000 { diff --git a/Bindings/media/stih407-c8sectpfe.txt b/Bindings/media/stih407-c8sectpfe.txt index cc51b1fd6e0c..6af3fc210ecc 100644 --- a/Bindings/media/stih407-c8sectpfe.txt +++ b/Bindings/media/stih407-c8sectpfe.txt @@ -52,7 +52,6 @@ Example: c8sectpfe@08a20000 { compatible = "st,stih407-c8sectpfe"; - status = "okay"; reg = <0x08a20000 0x10000>, <0x08a00000 0x4000>; reg-names = "stfe", "stfe-ram"; interrupts = , ; diff --git a/Bindings/media/ti,da850-vpif.txt b/Bindings/media/ti,da850-vpif.txt index df7182a63e59..e47c7ccc57f1 100644 --- a/Bindings/media/ti,da850-vpif.txt +++ b/Bindings/media/ti,da850-vpif.txt @@ -59,7 +59,6 @@ I2C-connected TVP5147 decoder: tvp5147@5d { compatible = "ti,tvp5147"; reg = <0x5d>; - status = "okay"; port { composite_in: endpoint { diff --git a/Bindings/media/video-interfaces.txt b/Bindings/media/video-interfaces.txt index 9cd2a369125d..852041a7480c 100644 --- a/Bindings/media/video-interfaces.txt +++ b/Bindings/media/video-interfaces.txt @@ -76,6 +76,11 @@ Optional endpoint properties mode horizontal and vertical synchronization signals are provided to the slave device (data source) by the master device (data sink). In the master mode the data source device is also the source of the synchronization signals. +- bus-type: data bus type. Possible values are: + 0 - autodetect based on other properties (MIPI CSI-2 D-PHY, parallel or Bt656) + 1 - MIPI CSI-2 C-PHY + 2 - MIPI CSI1 + 3 - CCP2 - bus-width: number of data lines actively used, valid for the parallel busses. - data-shift: on the parallel data busses, if bus-width is used to specify the number of data lines, data-shift can be used to specify which data lines are @@ -112,7 +117,8 @@ Optional endpoint properties should be the combined length of data-lanes and clock-lanes properties. If the lane-polarities property is omitted, the value must be interpreted as 0 (normal). This property is valid for serial busses only. - +- strobe: Whether the clock signal is used as clock (0) or strobe (1). Used + with CCP2, for instance. Example ------- diff --git a/Bindings/media/zx-irdec.txt b/Bindings/media/zx-irdec.txt new file mode 100644 index 000000000000..295b9fab593e --- /dev/null +++ b/Bindings/media/zx-irdec.txt @@ -0,0 +1,14 @@ +IR Decoder (IRDEC) on ZTE ZX family SoCs + +Required properties: + - compatible: Should be "zte,zx296718-irdec". + - reg: Physical base address and length of IRDEC registers. + - interrupts: Interrupt number of IRDEC. + +Exmaples: + + irdec: ir-decoder@111000 { + compatible = "zte,zx296718-irdec"; + reg = <0x111000 0x1000>; + interrupts = ; + }; diff --git a/Bindings/memory-controllers/mediatek,smi-larb.txt b/Bindings/memory-controllers/mediatek,smi-larb.txt index 21277a56e94c..ddf46b8856a5 100644 --- a/Bindings/memory-controllers/mediatek,smi-larb.txt +++ b/Bindings/memory-controllers/mediatek,smi-larb.txt @@ -15,6 +15,9 @@ Required properties: the register. - "smi" : It's the clock for transfer data and command. +Required property for mt2701: +- mediatek,larb-id :the hardware id of this larb. + Example: larb1: larb@16010000 { compatible = "mediatek,mt8173-smi-larb"; @@ -25,3 +28,15 @@ Example: <&vdecsys CLK_VDEC_LARB_CKEN>; clock-names = "apb", "smi"; }; + +Example for mt2701: + larb0: larb@14010000 { + compatible = "mediatek,mt2701-smi-larb"; + reg = <0 0x14010000 0 0x1000>; + mediatek,smi = <&smi_common>; + mediatek,larb-id = <0>; + clocks = <&mmsys CLK_MM_SMI_LARB0>, + <&mmsys CLK_MM_SMI_LARB0>; + clock-names = "apb", "smi"; + power-domains = <&scpsys MT2701_POWER_DOMAIN_DISP>; + }; diff --git a/Bindings/memory-controllers/mvebu-devbus.txt b/Bindings/memory-controllers/mvebu-devbus.txt index 1ee3bc09f319..8b9388cc1ccc 100644 --- a/Bindings/memory-controllers/mvebu-devbus.txt +++ b/Bindings/memory-controllers/mvebu-devbus.txt @@ -130,7 +130,6 @@ The reg property implicitly specifies the chip select as this: Example: devbus-bootcs@d0010400 { - status = "okay"; ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf0000000, size 0x1000000 */ #address-cells = <1>; #size-cells = <1>; diff --git a/Bindings/mfd/act8945a.txt b/Bindings/mfd/act8945a.txt index 462819ac3da8..e6f168db6c72 100644 --- a/Bindings/mfd/act8945a.txt +++ b/Bindings/mfd/act8945a.txt @@ -12,7 +12,6 @@ Example: pmic@5b { compatible = "active-semi,act8945a"; reg = <0x5b>; - status = "okay"; active-semi,vsel-high; @@ -79,6 +78,5 @@ Example: active-semi,input-voltage-threshold-microvolt = <6600>; active-semi,precondition-timeout = <40>; active-semi,total-timeout = <3>; - status = "okay"; }; }; diff --git a/Bindings/mfd/atmel-hlcdc.txt b/Bindings/mfd/atmel-hlcdc.txt index eec40be7f79a..3f643ef121ff 100644 --- a/Bindings/mfd/atmel-hlcdc.txt +++ b/Bindings/mfd/atmel-hlcdc.txt @@ -25,7 +25,6 @@ Example: clocks = <&lcdc_clk>, <&lcdck>, <&clk32k>; clock-names = "periph_clk","sys_clk", "slow_clk"; interrupts = <36 IRQ_TYPE_LEVEL_HIGH 0>; - status = "disabled"; hlcdc-display-controller { compatible = "atmel,hlcdc-display-controller"; diff --git a/Bindings/mfd/atmel-smc.txt b/Bindings/mfd/atmel-smc.txt index 26eeed373934..1103ce2030fb 100644 --- a/Bindings/mfd/atmel-smc.txt +++ b/Bindings/mfd/atmel-smc.txt @@ -8,6 +8,7 @@ Required properties: - compatible: Should be one of the following "atmel,at91sam9260-smc", "syscon" "atmel,sama5d3-smc", "syscon" + "atmel,sama5d2-smc", "syscon" - reg: Contains offset/length value of the SMC memory region. diff --git a/Bindings/mfd/axp20x.txt b/Bindings/mfd/axp20x.txt index aca09af66514..9455503b0299 100644 --- a/Bindings/mfd/axp20x.txt +++ b/Bindings/mfd/axp20x.txt @@ -7,7 +7,14 @@ axp209 (X-Powers) axp221 (X-Powers) axp223 (X-Powers) axp803 (X-Powers) +axp806 (X-Powers) axp809 (X-Powers) +axp813 (X-Powers) + +The AXP813 is 2 chips packaged into 1. The 2 chips do not share anything +other than the packaging. Pins are routed separately. As such they should +be treated as separate entities. The other half is an AC100 RTC/codec +combo chip. Please see ./ac100.txt for its bindings. Required properties: - compatible: should be one of: @@ -19,6 +26,7 @@ Required properties: * "x-powers,axp803" * "x-powers,axp806" * "x-powers,axp809" + * "x-powers,axp813" - reg: The I2C slave address or RSB hardware address for the AXP chip - interrupt-parent: The parent interrupt controller - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin @@ -28,12 +36,14 @@ Required properties: Optional properties: - x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz AXP152/20X: range: 750-1875, Default: 1.5 MHz - AXP22X/80X: range: 1800-4050, Default: 3 MHz + AXP22X/8XX: range: 1800-4050, Default: 3 MHz -- x-powers,drive-vbus-en: axp221 / axp223 only boolean, set this when the - N_VBUSEN pin is used as an output pin to control an external - regulator to drive the OTG VBus, rather then as an input pin - which signals whether the board is driving OTG VBus or not. +- x-powers,drive-vbus-en: boolean, set this when the N_VBUSEN pin is + used as an output pin to control an external + regulator to drive the OTG VBus, rather then + as an input pin which signals whether the + board is driving OTG VBus or not. + (axp221 / axp223 / axp813 only) - x-powers,master-mode: Boolean (axp806 only). Set this when the PMIC is wired for master mode. The default is slave mode. @@ -171,6 +181,36 @@ LDO_IO1 : LDO : ips-supply : GPIO 1 RTC_LDO : LDO : ips-supply : always on SW : On/Off Switch : swin-supply +AXP813 regulators, type, and corresponding input supply names: + +Regulator Type Supply Name Notes +--------- ---- ----------- ----- +DCDC1 : DC-DC buck : vin1-supply +DCDC2 : DC-DC buck : vin2-supply : poly-phase capable +DCDC3 : DC-DC buck : vin3-supply : poly-phase capable +DCDC4 : DC-DC buck : vin4-supply +DCDC5 : DC-DC buck : vin5-supply : poly-phase capable +DCDC6 : DC-DC buck : vin6-supply : poly-phase capable +DCDC7 : DC-DC buck : vin7-supply +ALDO1 : LDO : aldoin-supply : shared supply +ALDO2 : LDO : aldoin-supply : shared supply +ALDO3 : LDO : aldoin-supply : shared supply +DLDO1 : LDO : dldoin-supply : shared supply +DLDO2 : LDO : dldoin-supply : shared supply +DLDO3 : LDO : dldoin-supply : shared supply +DLDO4 : LDO : dldoin-supply : shared supply +ELDO1 : LDO : eldoin-supply : shared supply +ELDO2 : LDO : eldoin-supply : shared supply +ELDO3 : LDO : eldoin-supply : shared supply +FLDO1 : LDO : fldoin-supply : shared supply +FLDO2 : LDO : fldoin-supply : shared supply +FLDO3 : LDO : fldoin-supply : shared supply +LDO_IO0 : LDO : ips-supply : GPIO 0 +LDO_IO1 : LDO : ips-supply : GPIO 1 +RTC_LDO : LDO : ips-supply : always on +SW : On/Off Switch : swin-supply +DRIVEVBUS : Enable output : drivevbus-supply : external regulator + Example: axp209: pmic@34 { diff --git a/Bindings/mfd/bd9571mwv.txt b/Bindings/mfd/bd9571mwv.txt new file mode 100644 index 000000000000..9ab216a851d5 --- /dev/null +++ b/Bindings/mfd/bd9571mwv.txt @@ -0,0 +1,49 @@ +* ROHM BD9571MWV Power Management Integrated Circuit (PMIC) bindings + +Required properties: + - compatible : Should be "rohm,bd9571mwv". + - reg : I2C slave address. + - interrupt-parent : Phandle to the parent interrupt controller. + - interrupts : The interrupt line the device is connected to. + - interrupt-controller : Marks the device node as an interrupt controller. + - #interrupt-cells : The number of cells to describe an IRQ, should be 2. + The first cell is the IRQ number. + The second cell is the flags, encoded as trigger + masks from ../interrupt-controller/interrupts.txt. + - gpio-controller : Marks the device node as a GPIO Controller. + - #gpio-cells : Should be two. The first cell is the pin number and + the second cell is used to specify flags. + See ../gpio/gpio.txt for more information. + - regulators: : List of child nodes that specify the regulator + initialization data. Child nodes must be named + after their hardware counterparts: + - vd09 + - vd18 + - vd25 + - vd33 + - dvfs + Each child node is defined using the standard + binding for regulators. + +Example: + + pmic: pmic@30 { + compatible = "rohm,bd9571mwv"; + reg = <0x30>; + interrupt-parent = <&gpio2>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <2>; + gpio-controller; + #gpio-cells = <2>; + + regulators { + dvfs: dvfs { + regulator-name = "dvfs"; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <1030000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; diff --git a/Bindings/mfd/da9052-i2c.txt b/Bindings/mfd/da9052-i2c.txt index 9554292dc6cb..07c69c0c6624 100644 --- a/Bindings/mfd/da9052-i2c.txt +++ b/Bindings/mfd/da9052-i2c.txt @@ -4,6 +4,14 @@ Required properties: - compatible : Should be "dlg,da9052", "dlg,da9053-aa", "dlg,da9053-ab", or "dlg,da9053-bb" +Optional properties: +- dlg,tsi-as-adc : Boolean, if set the X+, X-, Y+, Y- touchscreen + input lines are used as general purpose analogue + input. +- tsiref-supply: Phandle to the regulator, which provides the reference + voltage for the TSIREF pin. Must be provided when the + touchscreen pins are used for ADC purposes. + Sub-nodes: - regulators : Contain the regulator nodes. The DA9052/53 regulators are bound using their names as listed below: @@ -29,7 +37,6 @@ Sub-nodes: Examples: i2c@63fc8000 { /* I2C1 */ - status = "okay"; pmic: dialog@48 { compatible = "dlg,da9053-aa"; diff --git a/Bindings/mfd/mc13xxx.txt b/Bindings/mfd/mc13xxx.txt index 8aba48821a85..39ba4146769d 100644 --- a/Bindings/mfd/mc13xxx.txt +++ b/Bindings/mfd/mc13xxx.txt @@ -116,7 +116,6 @@ ecspi@70010000 { /* ECSPI1 */ fsl,spi-num-chipselects = <2>; cs-gpios = <&gpio4 24 0>, /* GPIO4_24 */ <&gpio4 25 0>; /* GPIO4_25 */ - status = "okay"; pmic: mc13892@0 { #address-cells = <1>; diff --git a/Bindings/mfd/mxs-lradc.txt b/Bindings/mfd/mxs-lradc.txt index 555fb117d4fa..755cbef0647d 100644 --- a/Bindings/mfd/mxs-lradc.txt +++ b/Bindings/mfd/mxs-lradc.txt @@ -26,7 +26,6 @@ Example for i.MX23 SoC: compatible = "fsl,imx23-lradc"; reg = <0x80050000 0x2000>; interrupts = <36 37 38 39 40 41 42 43 44>; - status = "okay"; fsl,lradc-touchscreen-wires = <4>; fsl,ave-ctrl = <4>; fsl,ave-delay = <2>; @@ -39,7 +38,6 @@ Example for i.MX28 SoC: compatible = "fsl,imx28-lradc"; reg = <0x80050000 0x2000>; interrupts = <10 14 15 16 17 18 19 20 21 22 23 24 25>; - status = "okay"; fsl,lradc-touchscreen-wires = <5>; fsl,ave-ctrl = <4>; fsl,ave-delay = <2>; diff --git a/Bindings/mfd/retu.txt b/Bindings/mfd/retu.txt new file mode 100644 index 000000000000..876242394a16 --- /dev/null +++ b/Bindings/mfd/retu.txt @@ -0,0 +1,25 @@ +* Device tree bindings for Nokia Retu and Tahvo multi-function device + +Retu and Tahvo are a multi-function devices found on Nokia Internet +Tablets (770, N800 and N810). The Retu chip provides watchdog timer +and power button control functionalities while Tahvo chip provides +USB transceiver functionality. + +Required properties: +- compatible: "nokia,retu" or "nokia,tahvo" +- reg: Specifies the CBUS slave address of the ASIC chip +- interrupts: The interrupt line the device is connected to +- interrupt-parent: The parent interrupt controller + +Example: + +cbus0 { + compatible = "i2c-cbus-gpio"; + ... + retu: retu@1 { + compatible = "nokia,retu"; + interrupt-parent = <&gpio4>; + interrupts = <12 IRQ_TYPE_EDGE_RISING>; + reg = <0x1>; + }; +}; diff --git a/Bindings/mfd/rk808.txt b/Bindings/mfd/rk808.txt index 9636ae8d8d41..91b65227afeb 100644 --- a/Bindings/mfd/rk808.txt +++ b/Bindings/mfd/rk808.txt @@ -1,11 +1,14 @@ RK8XX Power Management Integrated Circuit The rk8xx family current members: +rk805 rk808 rk818 Required properties: -- compatible: "rockchip,rk808", "rockchip,rk818" +- compatible: "rockchip,rk805" +- compatible: "rockchip,rk808" +- compatible: "rockchip,rk818" - reg: I2C slave address - interrupt-parent: The parent interrupt controller. - interrupts: the interrupt outputs of the controller. @@ -18,6 +21,14 @@ Optional properties: - rockchip,system-power-controller: Telling whether or not this pmic is controlling the system power. +Optional RK805 properties: +- vcc1-supply: The input supply for DCDC_REG1 +- vcc2-supply: The input supply for DCDC_REG2 +- vcc3-supply: The input supply for DCDC_REG3 +- vcc4-supply: The input supply for DCDC_REG4 +- vcc5-supply: The input supply for LDO_REG1 and LDO_REG2 +- vcc6-supply: The input supply for LDO_REG3 + Optional RK808 properties: - vcc1-supply: The input supply for DCDC_REG1 - vcc2-supply: The input supply for DCDC_REG2 @@ -56,6 +67,15 @@ by a child node of the 'regulators' node. /* standard regulator bindings here */ }; +Following regulators of the RK805 PMIC regulators are supported. Note that +the 'n' in regulator name, as in DCDC_REGn or LDOn, represents the DCDC or LDO +number as described in RK805 datasheet. + + - DCDC_REGn + - valid values for n are 1 to 4. + - LDO_REGn + - valid values for n are 1 to 3 + Following regulators of the RK808 PMIC block are supported. Note that the 'n' in regulator name, as in DCDC_REGn or LDOn, represents the DCDC or LDO number as described in RK808 datasheet. diff --git a/Bindings/mfd/samsung,exynos5433-lpass.txt b/Bindings/mfd/samsung,exynos5433-lpass.txt index df664018c148..d759da606f75 100644 --- a/Bindings/mfd/samsung,exynos5433-lpass.txt +++ b/Bindings/mfd/samsung,exynos5433-lpass.txt @@ -57,7 +57,6 @@ audio-subsystem { clock-names = "iis", "i2s_opclk0", "i2s_opclk1"; pinctrl-names = "default"; pinctrl-0 = <&i2s0_bus>; - status = "disabled"; }; serial_3: serial@11460000 { @@ -69,6 +68,5 @@ audio-subsystem { clock-names = "uart", "clk_uart_baud0"; pinctrl-names = "default"; pinctrl-0 = <&uart_aud_bus>; - status = "disabled"; }; }; diff --git a/Bindings/mfd/stm32-lptimer.txt b/Bindings/mfd/stm32-lptimer.txt new file mode 100644 index 000000000000..2a9ff29db9c9 --- /dev/null +++ b/Bindings/mfd/stm32-lptimer.txt @@ -0,0 +1,48 @@ +STMicroelectronics STM32 Low-Power Timer + +The STM32 Low-Power Timer (LPTIM) is a 16-bit timer that provides several +functions: +- PWM output (with programmable prescaler, configurable polarity) +- Quadrature encoder, counter +- Trigger source for STM32 ADC/DAC (LPTIM_OUT) + +Required properties: +- compatible: Must be "st,stm32-lptimer". +- reg: Offset and length of the device's register set. +- clocks: Phandle to the clock used by the LP Timer module. +- clock-names: Must be "mux". +- #address-cells: Should be '<1>'. +- #size-cells: Should be '<0>'. + +Optional subnodes: +- pwm: See ../pwm/pwm-stm32-lp.txt +- counter: See ../iio/timer/stm32-lptimer-cnt.txt +- trigger: See ../iio/timer/stm32-lptimer-trigger.txt + +Example: + + timer@40002400 { + compatible = "st,stm32-lptimer"; + reg = <0x40002400 0x400>; + clocks = <&timer_clk>; + clock-names = "mux"; + #address-cells = <1>; + #size-cells = <0>; + + pwm { + compatible = "st,stm32-pwm-lp"; + pinctrl-names = "default"; + pinctrl-0 = <&lppwm1_pins>; + }; + + trigger@0 { + compatible = "st,stm32-lptimer-trigger"; + reg = <0>; + }; + + counter { + compatible = "st,stm32-lptimer-counter"; + pinctrl-names = "default"; + pinctrl-0 = <&lptim1_in_pins>; + }; + }; diff --git a/Bindings/mfd/tps6105x.txt b/Bindings/mfd/tps6105x.txt new file mode 100644 index 000000000000..93602c7a19c8 --- /dev/null +++ b/Bindings/mfd/tps6105x.txt @@ -0,0 +1,17 @@ +* Device tree bindings for TI TPS61050/61052 Boost Converters + +The TP61050/TPS61052 is a high-power "white LED driver". The +device provides LED, GPIO and regulator functionalities. + +Required properties: +- compatible: "ti,tps61050" or "ti,tps61052" +- reg: Specifies the I2C slave address + +Example: + +i2c0 { + tps61052@33 { + compatible = "ti,tps61052"; + reg = <0x33>; + }; +}; diff --git a/Bindings/mfd/wm831x.txt b/Bindings/mfd/wm831x.txt index 9f8b7430673c..505709403d3f 100644 --- a/Bindings/mfd/wm831x.txt +++ b/Bindings/mfd/wm831x.txt @@ -31,6 +31,7 @@ Required properties: ../interrupt-controller/interrupts.txt Optional sub-nodes: + - phys : Contains a phandle to the USB PHY. - regulators : Contains sub-nodes for each of the regulators supplied by the device. The regulators are bound using their names listed below: diff --git a/Bindings/mfd/zii,rave-sp.txt b/Bindings/mfd/zii,rave-sp.txt new file mode 100644 index 000000000000..088eff9ddb78 --- /dev/null +++ b/Bindings/mfd/zii,rave-sp.txt @@ -0,0 +1,39 @@ +Zodiac Inflight Innovations RAVE Supervisory Processor + +RAVE Supervisory Processor communicates with SoC over UART. It is +expected that its Device Tree node is specified as a child of a node +corresponding to UART controller used for communication. + +Required parent device properties: + + - compatible: Should be one of: + - "zii,rave-sp-niu" + - "zii,rave-sp-mezz" + - "zii,rave-sp-esb" + - "zii,rave-sp-rdu1" + - "zii,rave-sp-rdu2" + + - current-speed: Should be set to baud rate SP device is using + +RAVE SP consists of the following sub-devices: + +Device Description +------ ----------- +rave-sp-wdt : Watchdog +rave-sp-nvmem : Interface to onborad EEPROM +rave-sp-backlight : Display backlight +rave-sp-hwmon : Interface to onboard hardware sensors +rave-sp-leds : Interface to onboard LEDs +rave-sp-input : Interface to onboard power button + +Example of usage: + + rdu { + compatible = "zii,rave-sp-rdu2"; + current-speed = <1000000>; + + watchdog { + compatible = "zii,rave-sp-watchdog"; + }; + }; + diff --git a/Bindings/mips/lantiq/fpi-bus.txt b/Bindings/mips/lantiq/fpi-bus.txt new file mode 100644 index 000000000000..0a2df4338332 --- /dev/null +++ b/Bindings/mips/lantiq/fpi-bus.txt @@ -0,0 +1,31 @@ +Lantiq XWAY SoC FPI BUS binding +============================ + + +------------------------------------------------------------------------------- +Required properties: +- compatible : Should be one of + "lantiq,xrx200-fpi" +- reg : The address and length of the XBAR + configuration register. + Address and length of the FPI bus itself. +- lantiq,rcu : A phandle to the RCU syscon +- lantiq,offset-endianness : Offset of the endianness configuration + register + +------------------------------------------------------------------------------- +Example for the FPI on the xrx200 SoCs: + fpi@10000000 { + compatible = "lantiq,xrx200-fpi"; + ranges = <0x0 0x10000000 0xf000000>; + reg = <0x1f400000 0x1000>, + <0x10000000 0xf000000>; + lantiq,rcu = <&rcu0>; + lantiq,offset-endianness = <0x4c>; + #address-cells = <1>; + #size-cells = <1>; + + gptu@e100a00 { + ...... + }; + }; diff --git a/Bindings/mips/lantiq/rcu-gphy.txt b/Bindings/mips/lantiq/rcu-gphy.txt new file mode 100644 index 000000000000..a0c19bd1ce66 --- /dev/null +++ b/Bindings/mips/lantiq/rcu-gphy.txt @@ -0,0 +1,36 @@ +Lantiq XWAY SoC GPHY binding +============================ + +This binding describes a software-defined ethernet PHY, provided by the RCU +module on newer Lantiq XWAY SoCs (xRX200 and newer). + +------------------------------------------------------------------------------- +Required properties: +- compatible : Should be one of + "lantiq,xrx200a1x-gphy" + "lantiq,xrx200a2x-gphy" + "lantiq,xrx300-gphy" + "lantiq,xrx330-gphy" +- reg : Addrress of the GPHY FW load address register +- resets : Must reference the RCU GPHY reset bit +- reset-names : One entry, value must be "gphy" or optional "gphy2" +- clocks : A reference to the (PMU) GPHY clock gate + +Optional properties: +- lantiq,gphy-mode : GPHY_MODE_GE (default) or GPHY_MODE_FE as defined in + + + +------------------------------------------------------------------------------- +Example for the GPHys on the xRX200 SoCs: + +#include + gphy0: gphy@20 { + compatible = "lantiq,xrx200a2x-gphy"; + reg = <0x20 0x4>; + + resets = <&reset0 31 30>, <&reset1 7 7>; + reset-names = "gphy", "gphy2"; + clocks = <&pmu0 XRX200_PMU_GATE_GPHY>; + lantiq,gphy-mode = ; + }; diff --git a/Bindings/mips/lantiq/rcu.txt b/Bindings/mips/lantiq/rcu.txt new file mode 100644 index 000000000000..a086f1e1cdd7 --- /dev/null +++ b/Bindings/mips/lantiq/rcu.txt @@ -0,0 +1,89 @@ +Lantiq XWAY SoC RCU binding +=========================== + +This binding describes the RCU (reset controller unit) multifunction device, +where each sub-device has it's own set of registers. + +The RCU register range is used for multiple purposes. Mostly one device +uses one or multiple register exclusively, but for some registers some +bits are for one driver and some other bits are for a different driver. +With this patch all accesses to the RCU registers will go through +syscon. + + +------------------------------------------------------------------------------- +Required properties: +- compatible : The first and second values must be: + "lantiq,xrx200-rcu", "simple-mfd", "syscon" +- reg : The address and length of the system control registers + + +------------------------------------------------------------------------------- +Example of the RCU bindings on a xRX200 SoC: + rcu0: rcu@203000 { + compatible = "lantiq,xrx200-rcu", "simple-mfd", "syscon"; + reg = <0x203000 0x100>; + ranges = <0x0 0x203000 0x100>; + big-endian; + + gphy0: gphy@20 { + compatible = "lantiq,xrx200a2x-gphy"; + reg = <0x20 0x4>; + + resets = <&reset0 31 30>, <&reset1 7 7>; + reset-names = "gphy", "gphy2"; + lantiq,gphy-mode = ; + }; + + gphy1: gphy@68 { + compatible = "lantiq,xrx200a2x-gphy"; + reg = <0x68 0x4>; + + resets = <&reset0 29 28>, <&reset1 6 6>; + reset-names = "gphy", "gphy2"; + lantiq,gphy-mode = ; + }; + + reset0: reset-controller@10 { + compatible = "lantiq,xrx200-reset"; + reg = <0x10 4>, <0x14 4>; + + #reset-cells = <2>; + }; + + reset1: reset-controller@48 { + compatible = "lantiq,xrx200-reset"; + reg = <0x48 4>, <0x24 4>; + + #reset-cells = <2>; + }; + + usb_phy0: usb2-phy@18 { + compatible = "lantiq,xrx200-usb2-phy"; + reg = <0x18 4>, <0x38 4>; + status = "disabled"; + + resets = <&reset1 4 4>, <&reset0 4 4>; + reset-names = "phy", "ctrl"; + #phy-cells = <0>; + }; + + usb_phy1: usb2-phy@34 { + compatible = "lantiq,xrx200-usb2-phy"; + reg = <0x34 4>, <0x3C 4>; + status = "disabled"; + + resets = <&reset1 5 4>, <&reset0 4 4>; + reset-names = "phy", "ctrl"; + #phy-cells = <0>; + }; + + reboot@10 { + compatible = "syscon-reboot"; + reg = <0x10 4>; + + regmap = <&rcu0>; + offset = <0x10>; + mask = <0x40000000>; + }; + }; diff --git a/Bindings/mips/ni.txt b/Bindings/mips/ni.txt new file mode 100644 index 000000000000..722bf2d62da9 --- /dev/null +++ b/Bindings/mips/ni.txt @@ -0,0 +1,7 @@ +National Instruments MIPS platforms + +required root node properties: + - compatible: must be "ni,169445" + +CPU Nodes + - compatible: must be "mti,mips14KEc" diff --git a/Bindings/mips/ralink.txt b/Bindings/mips/ralink.txt index b35a8d04f8b6..a16e8d7fe56c 100644 --- a/Bindings/mips/ralink.txt +++ b/Bindings/mips/ralink.txt @@ -15,3 +15,4 @@ value must be one of the following values: ralink,rt5350-soc ralink,mt7620a-soc ralink,mt7620n-soc + ralink,mt7628a-soc diff --git a/Bindings/misc/atmel-ssc.txt b/Bindings/misc/atmel-ssc.txt index f8629bb73945..f9fb412642fe 100644 --- a/Bindings/misc/atmel-ssc.txt +++ b/Bindings/misc/atmel-ssc.txt @@ -47,5 +47,4 @@ ssc0: ssc@f0010000 { dma-names = "tx", "rx"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; - status = "disabled"; }; diff --git a/Bindings/mmc/arasan,sdhci.txt b/Bindings/mmc/arasan,sdhci.txt index 49df630bd44f..60481bfc3d31 100644 --- a/Bindings/mmc/arasan,sdhci.txt +++ b/Bindings/mmc/arasan,sdhci.txt @@ -74,5 +74,4 @@ Example: phys = <&emmc_phy>; phy-names = "phy_arasan"; #clock-cells = <0>; - status = "disabled"; }; diff --git a/Bindings/mmc/davinci_mmc.txt b/Bindings/mmc/davinci_mmc.txt index e5a0140b2381..516fb0143d4c 100644 --- a/Bindings/mmc/davinci_mmc.txt +++ b/Bindings/mmc/davinci_mmc.txt @@ -24,7 +24,6 @@ mmc0: mmc@1c40000 { compatible = "ti,da830-mmc", reg = <0x40000 0x1000>; interrupts = <16>; - status = "okay"; bus-width = <4>; max-frequency = <50000000>; dmas = <&edma 16 diff --git a/Bindings/mmc/fsl-imx-mmc.txt b/Bindings/mmc/fsl-imx-mmc.txt index db442355cd24..184ccffe2739 100644 --- a/Bindings/mmc/fsl-imx-mmc.txt +++ b/Bindings/mmc/fsl-imx-mmc.txt @@ -20,5 +20,4 @@ sdhci1: sdhci@10014000 { dma-names = "rx-tx"; bus-width = <4>; cd-gpios = <&gpio3 29>; - status = "okay"; }; diff --git a/Bindings/mmc/marvell,xenon-sdhci.txt b/Bindings/mmc/marvell,xenon-sdhci.txt index b878a1e305af..ed1456f5c94d 100644 --- a/Bindings/mmc/marvell,xenon-sdhci.txt +++ b/Bindings/mmc/marvell,xenon-sdhci.txt @@ -16,11 +16,13 @@ Required Properties: - clocks: Array of clocks required for SDHC. - Require at least input clock for Xenon IP core. + Require at least input clock for Xenon IP core. For Armada AP806 and + CP110, the AXI clock is also mandatory. - clock-names: Array of names corresponding to clocks property. The input clock for Xenon IP core should be named as "core". + The input clock for the AXI bus must be named as "axi". - reg: * For "marvell,armada-3700-sdhci", two register areas. @@ -106,8 +108,8 @@ Example: compatible = "marvell,armada-ap806-sdhci"; reg = <0xaa0000 0x1000>; interrupts = - clocks = <&emmc_clk>; - clock-names = "core"; + clocks = <&emmc_clk>,<&axi_clk>; + clock-names = "core", "axi"; bus-width = <4>; marvell,xenon-phy-slow-mode; marvell,xenon-tun-count = <11>; @@ -126,8 +128,8 @@ Example: interrupts = vqmmc-supply = <&sd_vqmmc_regulator>; vmmc-supply = <&sd_vmmc_regulator>; - clocks = <&sdclk>; - clock-names = "core"; + clocks = <&sdclk>, <&axi_clk>; + clock-names = "core", "axi"; bus-width = <4>; marvell,xenon-tun-count = <9>; }; diff --git a/Bindings/mmc/mmc-card.txt b/Bindings/mmc/mmc-card.txt index a70fcd65b9ea..8d2d71758907 100644 --- a/Bindings/mmc/mmc-card.txt +++ b/Bindings/mmc/mmc-card.txt @@ -21,7 +21,6 @@ Example: vmmc-supply = <®_vcc3v3>; bus-width = <8>; non-removable; - status = "okay"; mmccard: mmccard@0 { reg = <0>; diff --git a/Bindings/mmc/mmc.txt b/Bindings/mmc/mmc.txt index c7f4a0ec48ed..b32ade645ad9 100644 --- a/Bindings/mmc/mmc.txt +++ b/Bindings/mmc/mmc.txt @@ -153,7 +153,6 @@ mmc3: mmc@01c12000 { bus-width = <4>; non-removable; mmc-pwrseq = <&sdhci0_pwrseq> - status = "okay"; brcmf: bcrmf@1 { reg = <1>; diff --git a/Bindings/mmc/orion-sdio.txt b/Bindings/mmc/orion-sdio.txt index 84f0ebd67a13..10f0818a34c5 100644 --- a/Bindings/mmc/orion-sdio.txt +++ b/Bindings/mmc/orion-sdio.txt @@ -13,5 +13,4 @@ Example: reg = <0xd00d4000 0x200>; interrupts = <54>; clocks = <&gateclk 17>; - status = "disabled"; }; diff --git a/Bindings/mmc/renesas,mmcif.txt b/Bindings/mmc/renesas,mmcif.txt index c32dc5a9dbe6..5ff1e12c655a 100644 --- a/Bindings/mmc/renesas,mmcif.txt +++ b/Bindings/mmc/renesas,mmcif.txt @@ -11,6 +11,8 @@ Required properties: - "renesas,mmcif-r7s72100" for the MMCIF found in r7s72100 SoCs - "renesas,mmcif-r8a73a4" for the MMCIF found in r8a73a4 SoCs - "renesas,mmcif-r8a7740" for the MMCIF found in r8a7740 SoCs + - "renesas,mmcif-r8a7743" for the MMCIF found in r8a7743 SoCs + - "renesas,mmcif-r8a7745" for the MMCIF found in r8a7745 SoCs - "renesas,mmcif-r8a7778" for the MMCIF found in r8a7778 SoCs - "renesas,mmcif-r8a7790" for the MMCIF found in r8a7790 SoCs - "renesas,mmcif-r8a7791" for the MMCIF found in r8a7791 SoCs @@ -21,7 +23,7 @@ Required properties: - interrupts: Some SoCs have only 1 shared interrupt, while others have either 2 or 3 individual interrupts (error, int, card detect). Below is the number of interrupts for each SoC: - 1: r8a73a4, r8a7778, r8a7790, r8a7791, r8a7793, r8a7794 + 1: r8a73a4, r8a7743, r8a7745, r8a7778, r8a7790, r8a7791, r8a7793, r8a7794 2: r8a7740, sh73a0 3: r7s72100 diff --git a/Bindings/mmc/rockchip-dw-mshc.txt b/Bindings/mmc/rockchip-dw-mshc.txt index 49ed3ad2524a..c6558785e61b 100644 --- a/Bindings/mmc/rockchip-dw-mshc.txt +++ b/Bindings/mmc/rockchip-dw-mshc.txt @@ -15,6 +15,7 @@ Required Properties: - "rockchip,rk3288-dw-mshc": for Rockchip RK3288 - "rockchip,rv1108-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RV1108 - "rockchip,rk3036-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3036 + - "rockchip,rk3228-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK322x - "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3328 - "rockchip,rk3368-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3368 - "rockchip,rk3399-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3399 diff --git a/Bindings/mmc/sdhci-st.txt b/Bindings/mmc/sdhci-st.txt index 230fd696eb92..e35645598315 100644 --- a/Bindings/mmc/sdhci-st.txt +++ b/Bindings/mmc/sdhci-st.txt @@ -63,7 +63,6 @@ Example: mmc0: sdhci@fe81e000 { compatible = "st,sdhci"; - status = "disabled"; reg = <0xfe81e000 0x1000>; interrupts = ; interrupt-names = "mmcirq"; @@ -77,7 +76,6 @@ mmc0: sdhci@fe81e000 { mmc1: sdhci@09080000 { compatible = "st,sdhci-stih407", "st,sdhci"; - status = "disabled"; reg = <0x09080000 0x7ff>; reg-names = "mmc"; interrupts = ; @@ -94,7 +92,6 @@ mmc1: sdhci@09080000 { mmc0: sdhci@09060000 { compatible = "st,sdhci-stih407", "st,sdhci"; - status = "disabled"; reg = <0x09060000 0x7ff>, <0x9061008 0x20>; reg-names = "mmc", "top-mmc-delay"; interrupts = ; diff --git a/Bindings/mmc/sunxi-mmc.txt b/Bindings/mmc/sunxi-mmc.txt index 7d53a799f140..63b57e2a10fb 100644 --- a/Bindings/mmc/sunxi-mmc.txt +++ b/Bindings/mmc/sunxi-mmc.txt @@ -12,6 +12,7 @@ Required properties: * "allwinner,sun4i-a10-mmc" * "allwinner,sun5i-a13-mmc" * "allwinner,sun7i-a20-mmc" + * "allwinner,sun8i-a83t-emmc" * "allwinner,sun9i-a80-mmc" * "allwinner,sun50i-a64-emmc" * "allwinner,sun50i-a64-mmc" diff --git a/Bindings/mmc/ti-omap-hsmmc.txt b/Bindings/mmc/ti-omap-hsmmc.txt index 0e026c151c1c..3a4ac401e6f9 100644 --- a/Bindings/mmc/ti-omap-hsmmc.txt +++ b/Bindings/mmc/ti-omap-hsmmc.txt @@ -1,33 +1,55 @@ -* TI Highspeed MMC host controller for OMAP +* TI Highspeed MMC host controller for OMAP and 66AK2G family. -The Highspeed MMC Host Controller on TI OMAP family +The Highspeed MMC Host Controller on TI OMAP and 66AK2G family provides an interface for MMC, SD, and SDIO types of memory cards. This file documents differences between the core properties described by mmc.txt and the properties used by the omap_hsmmc driver. Required properties: +-------------------- - compatible: Should be "ti,omap2-hsmmc", for OMAP2 controllers Should be "ti,omap3-hsmmc", for OMAP3 controllers Should be "ti,omap3-pre-es3-hsmmc" for OMAP3 controllers pre ES3.0 Should be "ti,omap4-hsmmc", for OMAP4 controllers Should be "ti,am33xx-hsmmc", for AM335x controllers -- ti,hwmods: Must be "mmc", n is controller instance starting 1 + Should be "ti,k2g-hsmmc", "ti,omap4-hsmmc" for 66AK2G controllers. + +SoC specific required properties: +--------------------------------- +The following are mandatory properties for OMAPs, AM33xx and AM43xx SoCs only: +- ti,hwmods: Must be "mmc", n is controller instance starting 1. + +The following are mandatory properties for 66AK2G SoCs only: +- power-domains:Should contain a phandle to a PM domain provider node + and an args specifier containing the MMC device id + value. This property is as per the binding, + Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt +- clocks: Must contain an entry for each entry in clock-names. Should + be defined as per the he appropriate clock bindings consumer + usage in Documentation/devicetree/bindings/clock/ti,sci-clk.txt +- clock-names: Shall be "fck" for the functional clock, + and "mmchsdb_fck" for the debounce clock. + Optional properties: -ti,dual-volt: boolean, supports dual voltage cards --supply: phandle to the regulator device tree node -"supply-name" examples are "vmmc", "vmmc_aux"(deprecated)/"vqmmc" etc -ti,non-removable: non-removable slot (like eMMC) -ti,needs-special-reset: Requires a special softreset sequence -ti,needs-special-hs-handling: HSMMC IP needs special setting for handling High Speed -dmas: List of DMA specifiers with the controller specific format -as described in the generic DMA client binding. A tx and rx -specifier is required. -dma-names: List of DMA request names. These strings correspond -1:1 with the DMA specifiers listed in dmas. The string naming is -to be "rx" and "tx" for RX and TX DMA requests, respectively. +-------------------- +- ti,dual-volt: boolean, supports dual voltage cards +- -supply: phandle to the regulator device tree node + "supply-name" examples are "vmmc", + "vmmc_aux"(deprecated)/"vqmmc" etc +- ti,non-removable: non-removable slot (like eMMC) +- ti,needs-special-reset: Requires a special softreset sequence +- ti,needs-special-hs-handling: HSMMC IP needs special setting + for handling High Speed +- dmas: List of DMA specifiers with the controller specific + format as described in the generic DMA client + binding. A tx and rx specifier is required. +- dma-names: List of DMA request names. These strings correspond + 1:1 with the DMA specifiers listed in dmas. + The string naming is to be "rx" and "tx" for + RX and TX DMA requests, respectively. Examples: diff --git a/Bindings/mmc/tmio_mmc.txt b/Bindings/mmc/tmio_mmc.txt index 4fd8b7acc510..54ef642f23a0 100644 --- a/Bindings/mmc/tmio_mmc.txt +++ b/Bindings/mmc/tmio_mmc.txt @@ -15,6 +15,8 @@ Required properties: "renesas,sdhi-r7s72100" - SDHI IP on R7S72100 SoC "renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC "renesas,sdhi-r8a7740" - SDHI IP on R8A7740 SoC + "renesas,sdhi-r8a7743" - SDHI IP on R8A7743 SoC + "renesas,sdhi-r8a7745" - SDHI IP on R8A7745 SoC "renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC "renesas,sdhi-r8a7779" - SDHI IP on R8A7779 SoC "renesas,sdhi-r8a7790" - SDHI IP on R8A7790 SoC @@ -33,10 +35,8 @@ Required properties: If 2 clocks are specified by the hardware, you must name them as "core" and "cd". If the controller only has 1 clock, naming is not required. - Below is the number clocks for each supported SoC: - 1: SH73A0, R8A73A4, R8A7740, R8A7778, R8A7779, R8A7790 - R8A7791, R8A7792, R8A7793, R8A7794, R8A7795, R8A7796 - 2: R7S72100 + Devices which have more than 1 clock are listed below: + 2: R7S72100 Optional properties: - toshiba,mmc-wrprotect-disable: write-protect detection is unavailable diff --git a/Bindings/mmc/zx-dw-mshc.txt b/Bindings/mmc/zx-dw-mshc.txt index 906819a90c2b..0f59bd5361f5 100644 --- a/Bindings/mmc/zx-dw-mshc.txt +++ b/Bindings/mmc/zx-dw-mshc.txt @@ -28,5 +28,4 @@ Example: max-frequency = <50000000>; cap-sdio-irq; cap-sd-highspeed; - status = "disabled"; }; diff --git a/Bindings/mtd/atmel-quadspi.txt b/Bindings/mtd/atmel-quadspi.txt index 489807005eda..b93c1e2f25dd 100644 --- a/Bindings/mtd/atmel-quadspi.txt +++ b/Bindings/mtd/atmel-quadspi.txt @@ -24,7 +24,6 @@ spi@f0020000 { #size-cells = <0>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0_default>; - status = "okay"; m25p80@0 { ... diff --git a/Bindings/mtd/mtk-quadspi.txt b/Bindings/mtd/mtk-quadspi.txt index 5ded66ad7aef..840f9405dcf0 100644 --- a/Bindings/mtd/mtk-quadspi.txt +++ b/Bindings/mtd/mtk-quadspi.txt @@ -37,7 +37,6 @@ nor_flash: spi@1100d000 { clock-names = "spi", "sf"; #address-cells = <1>; #size-cells = <0>; - status = "disabled"; flash@0 { compatible = "jedec,spi-nor"; diff --git a/Bindings/mtd/qcom_nandc.txt b/Bindings/mtd/qcom_nandc.txt index 70dd5118a324..73d336befa08 100644 --- a/Bindings/mtd/qcom_nandc.txt +++ b/Bindings/mtd/qcom_nandc.txt @@ -1,11 +1,20 @@ * Qualcomm NAND controller Required properties: -- compatible: should be "qcom,ipq806x-nand" +- compatible: must be one of the following: + * "qcom,ipq806x-nand" - for EBI2 NAND controller being used in IPQ806x + SoC and it uses ADM DMA + * "qcom,ipq4019-nand" - for QPIC NAND controller v1.4.0 being used in + IPQ4019 SoC and it uses BAM DMA + * "qcom,ipq8074-nand" - for QPIC NAND controller v1.5.0 being used in + IPQ8074 SoC and it uses BAM DMA + - reg: MMIO address range - clocks: must contain core clock and always on clock - clock-names: must contain "core" for the core clock and "aon" for the always on clock + +EBI2 specific properties: - dmas: DMA specifier, consisting of a phandle to the ADM DMA controller node and the channel number to be used for NAND. Refer to dma.txt and qcom_adm.txt for more details @@ -16,6 +25,12 @@ Required properties: - qcom,data-crci: must contain the ADM data type CRCI block instance number specified for the NAND controller on the given platform + +QPIC specific properties: +- dmas: DMA specifier, consisting of a phandle to the BAM DMA + and the channel number to be used for NAND. Refer to + dma.txt, qcom_bam_dma.txt for more details +- dma-names: must contain all 3 channel names : "tx", "rx", "cmd" - #address-cells: <1> - subnodes give the chip-select number - #size-cells: <0> @@ -26,7 +41,6 @@ chip-selects which (may) contain NAND flash chips. Their properties are as follows. Required properties: -- compatible: should contain "qcom,nandcs" - reg: a single integer representing the chip-select number (e.g., 0, 1, 2, etc.) - #address-cells: see partition.txt @@ -43,8 +57,8 @@ partition.txt for more detail. Example: -nand@1ac00000 { - compatible = "qcom,ebi2-nandc"; +nand-controller@1ac00000 { + compatible = "qcom,ipq806x-nand"; reg = <0x1ac00000 0x800>; clocks = <&gcc EBI2_CLK>, @@ -59,8 +73,7 @@ nand@1ac00000 { #address-cells = <1>; #size-cells = <0>; - nandcs@0 { - compatible = "qcom,nandcs"; + nand@0 { reg = <0>; nand-ecc-strength = <4>; @@ -84,3 +97,43 @@ nand@1ac00000 { }; }; }; + +nand-controller@79b0000 { + compatible = "qcom,ipq4019-nand"; + reg = <0x79b0000 0x1000>; + + clocks = <&gcc GCC_QPIC_CLK>, + <&gcc GCC_QPIC_AHB_CLK>; + clock-names = "core", "aon"; + + dmas = <&qpicbam 0>, + <&qpicbam 1>, + <&qpicbam 2>; + dma-names = "tx", "rx", "cmd"; + + #address-cells = <1>; + #size-cells = <0>; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot-nand"; + reg = <0 0x58a0000>; + }; + + partition@58a0000 { + label = "fs-nand"; + reg = <0x58a0000 0x4000000>; + }; + }; + }; +}; diff --git a/Bindings/mtd/st-fsm.txt b/Bindings/mtd/st-fsm.txt index c2489391c437..54cef9ef3083 100644 --- a/Bindings/mtd/st-fsm.txt +++ b/Bindings/mtd/st-fsm.txt @@ -21,6 +21,5 @@ Example: st,syscfg = <&syscfg_rear>; st,boot-device-reg = <0x958>; st,boot-device-spi = <0x1a>; - status = "okay"; }; diff --git a/Bindings/mtd/sunxi-nand.txt b/Bindings/mtd/sunxi-nand.txt index f322f56aef74..a37c67bcb43b 100644 --- a/Bindings/mtd/sunxi-nand.txt +++ b/Bindings/mtd/sunxi-nand.txt @@ -41,7 +41,6 @@ nfc: nand@01c03000 { #size-cells = <0>; pinctrl-names = "default"; pinctrl-0 = <&nand_pins_a &nand_cs0_pins_a &nand_rb0_pins_a>; - status = "okay"; nand@0 { reg = <0>; diff --git a/Bindings/net/anarion-gmac.txt b/Bindings/net/anarion-gmac.txt new file mode 100644 index 000000000000..fe678965ae69 --- /dev/null +++ b/Bindings/net/anarion-gmac.txt @@ -0,0 +1,25 @@ +* Adaptrum Anarion ethernet controller + +This device is a platform glue layer for stmmac. +Please see stmmac.txt for the other unchanged properties. + +Required properties: + - compatible: Should be "adaptrum,anarion-gmac", "snps,dwmac" + - phy-mode: Should be "rgmii". Other modes are not currently supported. + + +Examples: + + gmac1: ethernet@f2014000 { + compatible = "adaptrum,anarion-gmac", "snps,dwmac"; + reg = <0xf2014000 0x4000>, <0xf2018100 8>; + + interrupt-parent = <&core_intc>; + interrupts = <21>; + interrupt-names = "macirq"; + + clocks = <&core_clk>; + clock-names = "stmmaceth"; + + phy-mode = "rgmii"; + }; diff --git a/Bindings/net/brcm,amac.txt b/Bindings/net/brcm,amac.txt index ad16c1f481f7..0bfad656a9ff 100644 --- a/Bindings/net/brcm,amac.txt +++ b/Bindings/net/brcm,amac.txt @@ -27,5 +27,4 @@ amac0: ethernet@18022000 { <0x18110000 0x1000>; reg-names = "amac_base", "idm_base"; interrupts = ; - status = "disabled"; }; diff --git a/Bindings/net/broadcom-bluetooth.txt b/Bindings/net/broadcom-bluetooth.txt new file mode 100644 index 000000000000..4194ff7e6ee6 --- /dev/null +++ b/Bindings/net/broadcom-bluetooth.txt @@ -0,0 +1,35 @@ +Broadcom Bluetooth Chips +--------------------- + +This documents the binding structure and common properties for serial +attached Broadcom devices. + +Serial attached Broadcom devices shall be a child node of the host UART +device the slave device is attached to. + +Required properties: + + - compatible: should contain one of the following: + * "brcm,bcm43438-bt" + +Optional properties: + + - max-speed: see Documentation/devicetree/bindings/serial/slave-device.txt + - shutdown-gpios: GPIO specifier, used to enable the BT module + - device-wakeup-gpios: GPIO specifier, used to wakeup the controller + - host-wakeup-gpios: GPIO specifier, used to wakeup the host processor + - clocks: clock specifier if external clock provided to the controller + - clock-names: should be "extclk" + + +Example: + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + + bluetooth { + compatible = "brcm,bcm43438-bt"; + max-speed = <921600>; + }; +}; diff --git a/Bindings/net/btusb.txt b/Bindings/net/btusb.txt index 01fa2d4188d4..9c5e663fa1af 100644 --- a/Bindings/net/btusb.txt +++ b/Bindings/net/btusb.txt @@ -29,7 +29,6 @@ Example: Following example uses irq pin number 3 of gpio0 for out of band wake-on-bt: &usb_host1_ehci { - status = "okay"; #address-cells = <1>; #size-cells = <0>; diff --git a/Bindings/net/can/c_can.txt b/Bindings/net/can/c_can.txt index 5a1d8b0c39e9..2d504256b0d8 100644 --- a/Bindings/net/can/c_can.txt +++ b/Bindings/net/can/c_can.txt @@ -11,9 +11,20 @@ Required properties: - interrupts : property with a value describing the interrupt number -Optional properties: +The following are mandatory properties for DRA7x, AM33xx and AM43xx SoCs only: - ti,hwmods : Must be "d_can" or "c_can", n being the instance number + +The following are mandatory properties for Keystone 2 66AK2G SoCs only: +- power-domains : Should contain a phandle to a PM domain provider node + and an args specifier containing the DCAN device id + value. This property is as per the binding, + Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt +- clocks : CAN functional clock phandle. This property is as per the + binding, + Documentation/devicetree/bindings/clock/ti,sci-clk.txt + +Optional properties: - syscon-raminit : Handle to system control region that contains the RAMINIT register, register offset to the RAMINIT register and the CAN instance number (0 offset). diff --git a/Bindings/net/can/m_can.txt b/Bindings/net/can/m_can.txt index 9e331777c203..78138333ff7a 100644 --- a/Bindings/net/can/m_can.txt +++ b/Bindings/net/can/m_can.txt @@ -56,7 +56,6 @@ m_can1: can@020e8000 { <&clks IMX6SX_CLK_CANFD>; clock-names = "hclk", "cclk"; bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>; - status = "disabled"; }; Board dts: diff --git a/Bindings/net/dsa/ksz.txt b/Bindings/net/dsa/ksz.txt index 0ab8b39d0b30..fd23904ac68e 100644 --- a/Bindings/net/dsa/ksz.txt +++ b/Bindings/net/dsa/ksz.txt @@ -24,7 +24,6 @@ Ethernet switch connected via SPI to the host, CPU port wired to eth0: pinctrl-0 = <&pinctrl_spi_ksz>; cs-gpios = <&pioC 25 0>; id = <1>; - status = "okay"; ksz9477: ksz9477@0 { compatible = "microchip,ksz9477"; @@ -34,7 +33,6 @@ Ethernet switch connected via SPI to the host, CPU port wired to eth0: spi-cpha; spi-cpol; - status = "okay"; ports { #address-cells = <1>; #size-cells = <0>; diff --git a/Bindings/net/dsa/lan9303.txt b/Bindings/net/dsa/lan9303.txt index 04f2965a4467..4448d063ddf6 100644 --- a/Bindings/net/dsa/lan9303.txt +++ b/Bindings/net/dsa/lan9303.txt @@ -27,7 +27,6 @@ Example: I2C managed mode: master: masterdevice@X { - status = "okay"; fixed-link { /* RMII fixed link to LAN9303 */ speed = <100>; @@ -38,7 +37,6 @@ I2C managed mode: switch: switch@a { compatible = "smsc,lan9303-i2c"; reg = <0xa>; - status = "okay"; reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>; reset-duration = <200>; @@ -67,7 +65,6 @@ I2C managed mode: MDIO managed mode: master: masterdevice@X { - status = "okay"; phy-handle = <&switch>; mdio { diff --git a/Bindings/net/ethernet.txt b/Bindings/net/ethernet.txt index 7da86f22a13b..2974e63ba311 100644 --- a/Bindings/net/ethernet.txt +++ b/Bindings/net/ethernet.txt @@ -1,5 +1,9 @@ The following properties are common to the Ethernet controllers: +NOTE: All 'phy*' properties documented below are Ethernet specific. For the +generic PHY 'phys' property, see +Documentation/devicetree/bindings/phy/phy-bindings.txt. + - local-mac-address: array of 6 bytes, specifies the MAC address that was assigned to the network device; - mac-address: array of 6 bytes, specifies the MAC address that was last used by diff --git a/Bindings/net/ftgmac100.txt b/Bindings/net/ftgmac100.txt index c1ce1680246f..72e7aaf7242e 100644 --- a/Bindings/net/ftgmac100.txt +++ b/Bindings/net/ftgmac100.txt @@ -30,6 +30,5 @@ Example: compatible = "aspeed,ast2500-mac", "faraday,ftgmac100"; reg = <0x1e660000 0x180>; interrupts = <2>; - status = "okay"; use-ncsi; }; diff --git a/Bindings/net/marvell-armada-370-neta.txt b/Bindings/net/marvell-armada-370-neta.txt index ae4234ca4ee4..bedcfd5a52cd 100644 --- a/Bindings/net/marvell-armada-370-neta.txt +++ b/Bindings/net/marvell-armada-370-neta.txt @@ -41,7 +41,6 @@ ethernet@70000 { interrupts = <8>; clocks = <&gate_clk 4>; tx-csum-limit = <9800> - status = "okay"; phy = <&phy0>; phy-mode = "rgmii-id"; buffer-manager = <&bm>; diff --git a/Bindings/net/marvell-bt-8xxx.txt b/Bindings/net/marvell-bt-8xxx.txt index 9be1059ff03f..3d27c68613a6 100644 --- a/Bindings/net/marvell-bt-8xxx.txt +++ b/Bindings/net/marvell-bt-8xxx.txt @@ -44,7 +44,6 @@ Example for SDIO device follows (calibration data is also available in below example). &mmc3 { - status = "okay"; vmmc-supply = <&wlan_en_reg>; bus-width = <4>; cap-power-off-card; @@ -70,7 +69,6 @@ below example). Example for USB device: &usb_host1_ohci { - status = "okay"; #address-cells = <1>; #size-cells = <0>; diff --git a/Bindings/net/marvell-neta-bm.txt b/Bindings/net/marvell-neta-bm.txt index c1b1d7c3bde1..07b31050dbe5 100644 --- a/Bindings/net/marvell-neta-bm.txt +++ b/Bindings/net/marvell-neta-bm.txt @@ -31,7 +31,6 @@ bm: bm@c8000 { reg = <0xc8000 0xac>; clocks = <&gateclk 13>; internal-mem = <&bm_bppi>; - status = "okay"; pool2,capacity = <4096>; pool1,pkt-size = <512>; }; @@ -45,5 +44,4 @@ bm_bppi: bm-bppi { #address-cells = <1>; #size-cells = <1>; clocks = <&gateclk 13>; - status = "okay"; }; diff --git a/Bindings/net/marvell-pp2.txt b/Bindings/net/marvell-pp2.txt index 6b4956beff8c..1814fa13f6ab 100644 --- a/Bindings/net/marvell-pp2.txt +++ b/Bindings/net/marvell-pp2.txt @@ -21,8 +21,9 @@ Required properties: - main controller clock (for both armada-375-pp2 and armada-7k-pp2) - GOP clock (for both armada-375-pp2 and armada-7k-pp2) - MG clock (only for armada-7k-pp2) -- clock-names: names of used clocks, must be "pp_clk", "gop_clk" and - "mg_clk" (the latter only for armada-7k-pp2). + - AXI clock (only for armada-7k-pp2) +- clock-names: names of used clocks, must be "pp_clk", "gop_clk", "mg_clk" + and "axi_clk" (the 2 latter only for armada-7k-pp2). The ethernet ports are represented by subnodes. At least one port is required. @@ -41,6 +42,11 @@ Optional properties (port): - marvell,loopback: port is loopback mode - phy: a phandle to a phy node defining the PHY address (as the reg property, a single integer). +- interrupt-names: if more than a single interrupt for rx is given, must + be the name associated to the interrupts listed. Valid + names are: "tx-cpu0", "tx-cpu1", "tx-cpu2", "tx-cpu3", + "rx-shared", "link". +- marvell,system-controller: a phandle to the system controller. Example for marvell,armada-375-pp2: @@ -52,12 +58,10 @@ ethernet@f0000 { <0xc5000 0x100>; clocks = <&gateclk 3>, <&gateclk 19>; clock-names = "pp_clk", "gop_clk"; - status = "okay"; eth0: eth0@c4000 { interrupts = ; port-id = <0>; - status = "okay"; phy = <&phy0>; phy-mode = "gmii"; }; @@ -65,7 +69,6 @@ ethernet@f0000 { eth1: eth1@c5000 { interrupts = ; port-id = <1>; - status = "okay"; phy = <&phy3>; phy-mode = "gmii"; }; @@ -76,23 +79,42 @@ Example for marvell,armada-7k-pp2: cpm_ethernet: ethernet@0 { compatible = "marvell,armada-7k-pp22"; reg = <0x0 0x100000>, <0x129000 0xb000>; - clocks = <&cpm_syscon0 1 3>, <&cpm_syscon0 1 9>, <&cpm_syscon0 1 5>; - clock-names = "pp_clk", "gop_clk", "gp_clk"; + clocks = <&cpm_syscon0 1 3>, <&cpm_syscon0 1 9>, + <&cpm_syscon0 1 5>, <&cpm_syscon0 1 18>; + clock-names = "pp_clk", "gop_clk", "gp_clk", "axi_clk"; eth0: eth0 { - interrupts = ; + interrupts = , + , + , + , + ; + interrupt-names = "tx-cpu0", "tx-cpu1", "tx-cpu2", + "tx-cpu3", "rx-shared"; port-id = <0>; gop-port-id = <0>; }; eth1: eth1 { - interrupts = ; + interrupts = , + , + , + , + ; + interrupt-names = "tx-cpu0", "tx-cpu1", "tx-cpu2", + "tx-cpu3", "rx-shared"; port-id = <1>; gop-port-id = <2>; }; eth2: eth2 { - interrupts = ; + interrupts = , + , + , + , + ; + interrupt-names = "tx-cpu0", "tx-cpu1", "tx-cpu2", + "tx-cpu3", "rx-shared"; port-id = <2>; gop-port-id = <3>; }; diff --git a/Bindings/net/mediatek-net.txt b/Bindings/net/mediatek-net.txt index c7194e87d5f4..214eaa9a6683 100644 --- a/Bindings/net/mediatek-net.txt +++ b/Bindings/net/mediatek-net.txt @@ -7,24 +7,32 @@ have dual GMAC each represented by a child node.. * Ethernet controller node Required properties: -- compatible: Should be "mediatek,mt2701-eth" +- compatible: Should be + "mediatek,mt2701-eth": for MT2701 SoC + "mediatek,mt7623-eth", "mediatek,mt2701-eth": for MT7623 SoC + "mediatek,mt7622-eth": for MT7622 SoC - reg: Address and length of the register set for the device - interrupts: Should contain the three frame engines interrupts in numeric order. These are fe_int0, fe_int1 and fe_int2. - clocks: the clock used by the core - clock-names: the names of the clock listed in the clocks property. These are - "ethif", "esw", "gp2", "gp1" + "ethif", "esw", "gp2", "gp1" : For MT2701 and MT7623 SoC + "ethif", "esw", "gp0", "gp1", "gp2", "sgmii_tx250m", "sgmii_rx250m", + "sgmii_cdr_ref", "sgmii_cdr_fb", "sgmii_ck", "eth2pll" : For MT7622 SoC - power-domains: phandle to the power domain that the ethernet is part of -- resets: Should contain a phandle to the ethsys reset signal -- reset-names: Should contain the reset signal name "eth" +- resets: Should contain phandles to the ethsys reset signals +- reset-names: Should contain the names of reset signal listed in the resets + property + These are "fe", "gmac" and "ppe" - mediatek,ethsys: phandle to the syscon node that handles the port setup +- mediatek,sgmiisys: phandle to the syscon node that handles the SGMII setup + which is required for those SoCs equipped with SGMII such as MT7622 SoC. - mediatek,pctl: phandle to the syscon node that handles the ports slew rate and driver current Optional properties: - interrupt-parent: Should be the phandle for the interrupt controller that services interrupts for this device - * Ethernet MAC node Required properties: diff --git a/Bindings/net/meson-dwmac.txt b/Bindings/net/meson-dwmac.txt index 0703ad3f3c1e..354dd9896bb5 100644 --- a/Bindings/net/meson-dwmac.txt +++ b/Bindings/net/meson-dwmac.txt @@ -66,5 +66,4 @@ Example for GXBB: <&clkc CLKID_MPLL2>; clock-names = "stmmaceth", "clkin0", "clkin1"; phy-mode = "rgmii"; - status = "disabled"; }; diff --git a/Bindings/net/micrel-ksz90x1.txt b/Bindings/net/micrel-ksz90x1.txt index c35b5b428a7f..42a248301615 100644 --- a/Bindings/net/micrel-ksz90x1.txt +++ b/Bindings/net/micrel-ksz90x1.txt @@ -69,7 +69,6 @@ Examples: }; }; ethernet@70000 { - status = "okay"; phy = <&phy0>; phy-mode = "rgmii-id"; }; diff --git a/Bindings/net/microchip,enc28j60.txt b/Bindings/net/microchip,enc28j60.txt index 1dc3bc75539d..44dff53d4dda 100644 --- a/Bindings/net/microchip,enc28j60.txt +++ b/Bindings/net/microchip,enc28j60.txt @@ -33,7 +33,6 @@ Example (for NXP i.MX28 with pin control stuff for GPIO irq): compatible = "fsl,imx28-spi"; pinctrl-names = "default"; pinctrl-0 = <&spi2_pins_b &spi2_sck_cfg>; - status = "okay"; enc28j60: ethernet@0 { compatible = "microchip,enc28j60"; diff --git a/Bindings/net/nfc/nfcmrvl.txt b/Bindings/net/nfc/nfcmrvl.txt index 76df9173825a..c9b35251bb20 100644 --- a/Bindings/net/nfc/nfcmrvl.txt +++ b/Bindings/net/nfc/nfcmrvl.txt @@ -25,7 +25,6 @@ Optional I2C-based chip specific properties: Example (for ARM-based BeagleBoard Black with 88W8887 on UART5): &uart5 { - status = "okay"; nfcmrvluart: nfcmrvluart@5 { compatible = "marvell,nfc-uart"; @@ -41,7 +40,6 @@ Example (for ARM-based BeagleBoard Black with 88W8887 on UART5): Example (for ARM-based BeagleBoard Black with 88W8887 on I2C1): &i2c1 { - status = "okay"; clock-frequency = <400000>; nfcmrvli2c0: i2c@1 { diff --git a/Bindings/net/nfc/nxp-nci.txt b/Bindings/net/nfc/nxp-nci.txt index 5b6cd9b3f628..92486733df71 100644 --- a/Bindings/net/nfc/nxp-nci.txt +++ b/Bindings/net/nfc/nxp-nci.txt @@ -17,7 +17,6 @@ Example (for ARM-based BeagleBone with NPC100 NFC controller on I2C2): &i2c2 { - status = "okay"; npc100: npc100@29 { diff --git a/Bindings/net/nfc/pn533-i2c.txt b/Bindings/net/nfc/pn533-i2c.txt index 1aea822d4530..122460e42e3c 100644 --- a/Bindings/net/nfc/pn533-i2c.txt +++ b/Bindings/net/nfc/pn533-i2c.txt @@ -15,7 +15,6 @@ Example (for ARM-based BeagleBone with PN532 on I2C2): &i2c2 { - status = "okay"; pn532: pn532@24 { diff --git a/Bindings/net/nfc/pn544.txt b/Bindings/net/nfc/pn544.txt index dab69f36167c..538a86f7b2b0 100644 --- a/Bindings/net/nfc/pn544.txt +++ b/Bindings/net/nfc/pn544.txt @@ -17,7 +17,6 @@ Example (for ARM-based BeagleBone with PN544 on I2C2): &i2c2 { - status = "okay"; pn544: pn544@28 { diff --git a/Bindings/net/nfc/s3fwrn5.txt b/Bindings/net/nfc/s3fwrn5.txt index fb1e75facf1b..ed5b3eaadb39 100644 --- a/Bindings/net/nfc/s3fwrn5.txt +++ b/Bindings/net/nfc/s3fwrn5.txt @@ -12,7 +12,6 @@ Required properties: Example: &hsi2c_4 { - status = "okay"; s3fwrn5@27 { compatible = "samsung,s3fwrn5-i2c"; diff --git a/Bindings/net/nfc/st-nci-i2c.txt b/Bindings/net/nfc/st-nci-i2c.txt index 263732e8879f..b46d473be425 100644 --- a/Bindings/net/nfc/st-nci-i2c.txt +++ b/Bindings/net/nfc/st-nci-i2c.txt @@ -20,7 +20,6 @@ Example (for ARM-based BeagleBoard xM with ST21NFCB on I2C2): &i2c2 { - status = "okay"; st21nfcb: st21nfcb@8 { diff --git a/Bindings/net/nfc/st-nci-spi.txt b/Bindings/net/nfc/st-nci-spi.txt index 711ca85a363d..54ce8e7ac681 100644 --- a/Bindings/net/nfc/st-nci-spi.txt +++ b/Bindings/net/nfc/st-nci-spi.txt @@ -19,7 +19,6 @@ Example (for ARM-based BeagleBoard xM with ST21NFCB on SPI4): &mcspi4 { - status = "okay"; st21nfcb: st21nfcb@0 { diff --git a/Bindings/net/nfc/st21nfca.txt b/Bindings/net/nfc/st21nfca.txt index 7bb2e213d6f9..5ee9440fa9ad 100644 --- a/Bindings/net/nfc/st21nfca.txt +++ b/Bindings/net/nfc/st21nfca.txt @@ -20,7 +20,6 @@ Example (for ARM-based BeagleBoard xM with ST21NFCA on I2C2): &i2c2 { - status = "okay"; st21nfca: st21nfca@1 { diff --git a/Bindings/net/nfc/st95hf.txt b/Bindings/net/nfc/st95hf.txt index ea3178bc9ddd..08a202e00d47 100644 --- a/Bindings/net/nfc/st95hf.txt +++ b/Bindings/net/nfc/st95hf.txt @@ -35,12 +35,10 @@ spi@9840000 { #address-cells = <1>; #size-cells = <0>; cs-gpios = <&pio0 4>; - status = "okay"; st95hf@0{ reg = <0>; compatible = "st,st95hf"; - status = "okay"; spi-max-frequency = <1000000>; enable-gpio = <&pio4 0>; interrupt-parent = <&pio0>; diff --git a/Bindings/net/nfc/trf7970a.txt b/Bindings/net/nfc/trf7970a.txt index 60c833d62181..5ca9362ef127 100644 --- a/Bindings/net/nfc/trf7970a.txt +++ b/Bindings/net/nfc/trf7970a.txt @@ -23,7 +23,6 @@ Optional SoC Specific Properties: Example (for ARM-based BeagleBone with TRF7970A on SPI1): &spi1 { - status = "okay"; nfc@0 { compatible = "ti,trf7970a"; @@ -41,6 +40,5 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1): irq-status-read-quirk; en2-rf-quirk; clock-frequency = <27120000>; - status = "okay"; }; }; diff --git a/Bindings/net/oxnas-dwmac.txt b/Bindings/net/oxnas-dwmac.txt index df0534e2eda1..d7117a22fd87 100644 --- a/Bindings/net/oxnas-dwmac.txt +++ b/Bindings/net/oxnas-dwmac.txt @@ -35,5 +35,4 @@ etha: ethernet@40400000 { /* Regmap for sys registers */ oxsemi,sys-ctrl = <&sys>; - status = "disabled"; }; diff --git a/Bindings/net/phy.txt b/Bindings/net/phy.txt index b55857696fc3..77d0b2a61ffa 100644 --- a/Bindings/net/phy.txt +++ b/Bindings/net/phy.txt @@ -2,11 +2,7 @@ PHY nodes Required properties: - - interrupts : where a is the interrupt number and b is a - field that represents an encoding of the sense and level - information for the interrupt. This should be encoded based on - the information in section 2) depending on the type of interrupt - controller you have. + - interrupts : interrupt specifier for the sole interrupt. - interrupt-parent : the phandle for the interrupt controller that services interrupts for this device. - reg : The ID number for the phy, usually a small integer @@ -52,11 +48,16 @@ Optional Properties: Mark the corresponding energy efficient ethernet mode as broken and request the ethernet to stop advertising it. +- phy-is-integrated: If set, indicates that the PHY is integrated into the same + physical package as the Ethernet MAC. If needed, muxers should be configured + to ensure the integrated PHY is used. The absence of this property indicates + the muxers should be configured so that the external PHY is used. + Example: ethernet-phy@0 { compatible = "ethernet-phy-id0141.0e90", "ethernet-phy-ieee802.3-c22"; - interrupt-parent = <40000>; - interrupts = <35 1>; + interrupt-parent = <&PIC>; + interrupts = <35 IRQ_TYPE_EDGE_RISING>; reg = <0>; }; diff --git a/Bindings/net/qca,qca7000.txt b/Bindings/net/qca,qca7000.txt index 6d9efb2eb9a5..3987846b3fd3 100644 --- a/Bindings/net/qca,qca7000.txt +++ b/Bindings/net/qca,qca7000.txt @@ -41,7 +41,6 @@ ssp2: spi@80014000 { compatible = "fsl,imx28-spi"; pinctrl-names = "default"; pinctrl-0 = <&spi2_pins_a>; - status = "okay"; qca7000: ethernet@0 { compatible = "qca,qca7000"; @@ -78,7 +77,6 @@ auart0: serial@8006a000 { reg = <0x8006a000 0x2000>; pinctrl-names = "default"; pinctrl-0 = <&auart0_2pins_a>; - status = "okay"; qca7000: ethernet { compatible = "qca,qca7000"; diff --git a/Bindings/net/renesas,ravb.txt b/Bindings/net/renesas,ravb.txt index b519503be51a..16723535e1aa 100644 --- a/Bindings/net/renesas,ravb.txt +++ b/Bindings/net/renesas,ravb.txt @@ -4,19 +4,25 @@ This file provides information on what the device node for the Ethernet AVB interface contains. Required properties: -- compatible: "renesas,etheravb-r8a7790" if the device is a part of R8A7790 SoC. - "renesas,etheravb-r8a7791" if the device is a part of R8A7791 SoC. - "renesas,etheravb-r8a7792" if the device is a part of R8A7792 SoC. - "renesas,etheravb-r8a7793" if the device is a part of R8A7793 SoC. - "renesas,etheravb-r8a7794" if the device is a part of R8A7794 SoC. - "renesas,etheravb-r8a7795" if the device is a part of R8A7795 SoC. - "renesas,etheravb-r8a7796" if the device is a part of R8A7796 SoC. - "renesas,etheravb-rcar-gen2" for generic R-Car Gen 2 compatible interface. - "renesas,etheravb-rcar-gen3" for generic R-Car Gen 3 compatible interface. +- compatible: Must contain one or more of the following: + - "renesas,etheravb-r8a7743" for the R8A7743 SoC. + - "renesas,etheravb-r8a7745" for the R8A7745 SoC. + - "renesas,etheravb-r8a7790" for the R8A7790 SoC. + - "renesas,etheravb-r8a7791" for the R8A7791 SoC. + - "renesas,etheravb-r8a7792" for the R8A7792 SoC. + - "renesas,etheravb-r8a7793" for the R8A7793 SoC. + - "renesas,etheravb-r8a7794" for the R8A7794 SoC. + - "renesas,etheravb-rcar-gen2" as a fallback for the above + R-Car Gen2 and RZ/G1 devices. - When compatible with the generic version, nodes must list the - SoC-specific version corresponding to the platform first - followed by the generic version. + - "renesas,etheravb-r8a7795" for the R8A7795 SoC. + - "renesas,etheravb-r8a7796" for the R8A7796 SoC. + - "renesas,etheravb-rcar-gen3" as a fallback for the above + R-Car Gen3 devices. + + When compatible with the generic version, nodes must list the + SoC-specific version corresponding to the platform first followed by + the generic version. - reg: offset and length of (1) the register block and (2) the stream buffer. - interrupts: A list of interrupt-specifiers, one for each entry in diff --git a/Bindings/net/rockchip-dwmac.txt b/Bindings/net/rockchip-dwmac.txt index 8f427550720a..9c16ee2965a2 100644 --- a/Bindings/net/rockchip-dwmac.txt +++ b/Bindings/net/rockchip-dwmac.txt @@ -4,12 +4,14 @@ The device node has following properties. Required properties: - compatible: should be "rockchip,-gamc" + "rockchip,rk3128-gmac": found on RK312x SoCs "rockchip,rk3228-gmac": found on RK322x SoCs "rockchip,rk3288-gmac": found on RK3288 SoCs "rockchip,rk3328-gmac": found on RK3328 SoCs "rockchip,rk3366-gmac": found on RK3366 SoCs "rockchip,rk3368-gmac": found on RK3368 SoCs "rockchip,rk3399-gmac": found on RK3399 SoCs + "rockchip,rv1108-gmac": found on RV1108 SoCs - reg: addresses and length of the register sets for the device. - interrupts: Should contain the GMAC interrupts. - interrupt-names: Should contain the interrupt names "macirq". @@ -70,5 +72,4 @@ gmac: ethernet@ff290000 { tx_delay = <0x30>; rx_delay = <0x10>; - status = "ok"; }; diff --git a/Bindings/net/sff,sfp.txt b/Bindings/net/sff,sfp.txt new file mode 100644 index 000000000000..60e970ce10ee --- /dev/null +++ b/Bindings/net/sff,sfp.txt @@ -0,0 +1,76 @@ +Small Form Factor (SFF) Committee Small Form-factor Pluggable (SFP) +Transceiver + +Required properties: + +- compatible : must be "sff,sfp" + +Optional Properties: + +- i2c-bus : phandle of an I2C bus controller for the SFP two wire serial + interface + +- mod-def0-gpios : GPIO phandle and a specifier of the MOD-DEF0 (AKA Mod_ABS) + module presence input gpio signal, active (module absent) high + +- los-gpios : GPIO phandle and a specifier of the Receiver Loss of Signal + Indication input gpio signal, active (signal lost) high + +- tx-fault-gpios : GPIO phandle and a specifier of the Module Transmitter + Fault input gpio signal, active (fault condition) high + +- tx-disable-gpios : GPIO phandle and a specifier of the Transmitter Disable + output gpio signal, active (Tx disable) high + +- rate-select0-gpios : GPIO phandle and a specifier of the Rx Signaling Rate + Select (AKA RS0) output gpio signal, low: low Rx rate, high: high Rx rate + +- rate-select1-gpios : GPIO phandle and a specifier of the Tx Signaling Rate + Select (AKA RS1) output gpio signal (SFP+ only), low: low Tx rate, high: + high Tx rate + +Example #1: Direct serdes to SFP connection + +sfp_eth3: sfp-eth3 { + compatible = "sff,sfp"; + i2c-bus = <&sfp_1g_i2c>; + los-gpios = <&cpm_gpio2 22 GPIO_ACTIVE_HIGH>; + mod-def0-gpios = <&cpm_gpio2 21 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&cpm_sfp_1g_pins &cps_sfp_1g_pins>; + tx-disable-gpios = <&cps_gpio1 24 GPIO_ACTIVE_HIGH>; + tx-fault-gpios = <&cpm_gpio2 19 GPIO_ACTIVE_HIGH>; +}; + +&cps_emac3 { + phy-names = "comphy"; + phys = <&cps_comphy5 0>; + sfp = <&sfp_eth3>; +}; + +Example #2: Serdes to PHY to SFP connection + +sfp_eth0: sfp-eth0 { + compatible = "sff,sfp"; + i2c-bus = <&sfpp0_i2c>; + los-gpios = <&cps_gpio1 28 GPIO_ACTIVE_HIGH>; + mod-def0-gpios = <&cps_gpio1 27 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&cps_sfpp0_pins>; + tx-disable-gpios = <&cps_gpio1 29 GPIO_ACTIVE_HIGH>; + tx-fault-gpios = <&cps_gpio1 26 GPIO_ACTIVE_HIGH>; +}; + +p0_phy: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c45"; + pinctrl-names = "default"; + pinctrl-0 = <&cpm_phy0_pins &cps_phy0_pins>; + reg = <0>; + interrupt = <&cpm_gpio2 18 IRQ_TYPE_EDGE_FALLING>; + sfp = <&sfp_eth0>; +}; + +&cpm_eth0 { + phy = <&p0_phy>; + phy-mode = "10gbase-kr"; +}; diff --git a/Bindings/net/smsc-lan87xx.txt b/Bindings/net/smsc-lan87xx.txt index 974edd5c85cc..8b7c719b0bb9 100644 --- a/Bindings/net/smsc-lan87xx.txt +++ b/Bindings/net/smsc-lan87xx.txt @@ -15,7 +15,6 @@ smsc phy with disabled energy detect mode on an am335x based board. pinctrl-names = "default", "sleep"; pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; - status = "okay"; ethernetphy0: ethernet-phy@0 { reg = <0>; diff --git a/Bindings/net/socfpga-dwmac.txt b/Bindings/net/socfpga-dwmac.txt index 2e68a3cd8513..b30d04b54ee9 100644 --- a/Bindings/net/socfpga-dwmac.txt +++ b/Bindings/net/socfpga-dwmac.txt @@ -40,7 +40,6 @@ gmii_to_sgmii_converter: phy@0x100000240 { gmac0: ethernet@ff700000 { compatible = "altr,socfpga-stmmac", "snps,dwmac-3.70a", "snps,dwmac"; altr,sysmgr-syscon = <&sysmgr 0x60 0>; - status = "disabled"; reg = <0xff700000 0x2000>; interrupts = <0 115 4>; interrupt-names = "macirq"; diff --git a/Bindings/net/sti-dwmac.txt b/Bindings/net/sti-dwmac.txt index d05c1e1fd9b6..062c5174add3 100644 --- a/Bindings/net/sti-dwmac.txt +++ b/Bindings/net/sti-dwmac.txt @@ -34,7 +34,6 @@ Example: ethernet0: dwmac@9630000 { device_type = "network"; - status = "disabled"; compatible = "st,stih407-dwmac", "snps,dwmac", "snps,dwmac-3.710"; reg = <0x9630000 0x8000>; reg-names = "stmmaceth"; diff --git a/Bindings/net/stm32-dwmac.txt b/Bindings/net/stm32-dwmac.txt index c35afb7e956a..489dbcb66c5a 100644 --- a/Bindings/net/stm32-dwmac.txt +++ b/Bindings/net/stm32-dwmac.txt @@ -18,7 +18,6 @@ Example: ethernet@40028000 { compatible = "st,stm32-dwmac", "snps,dwmac-3.50a"; - status = "disabled"; reg = <0x40028000 0x8000>; reg-names = "stmmaceth"; interrupts = <0 61 0>, <0 62 0>; diff --git a/Bindings/net/wireless/brcm,bcm43xx-fmac.txt b/Bindings/net/wireless/brcm,bcm43xx-fmac.txt index 590f622188de..b2bd4704f859 100644 --- a/Bindings/net/wireless/brcm,bcm43xx-fmac.txt +++ b/Bindings/net/wireless/brcm,bcm43xx-fmac.txt @@ -29,7 +29,6 @@ mmc3: mmc@01c12000 { vmmc-supply = <®_vmmc3>; bus-width = <4>; non-removable; - status = "okay"; brcmf: wifi@1 { reg = <1>; diff --git a/Bindings/net/wireless/esp,esp8089.txt b/Bindings/net/wireless/esp,esp8089.txt index 19331bb4ff6e..6830c4786f8a 100644 --- a/Bindings/net/wireless/esp,esp8089.txt +++ b/Bindings/net/wireless/esp,esp8089.txt @@ -21,7 +21,6 @@ Example: mmc-pwrseq = <&wifi_pwrseq>; bus-width = <4>; non-removable; - status = "okay"; esp8089: sdio_wifi@1 { compatible = "esp,esp8089"; diff --git a/Bindings/net/wireless/marvell-8xxx.txt b/Bindings/net/wireless/marvell-8xxx.txt index 0854451ff91d..59de8646862d 100644 --- a/Bindings/net/wireless/marvell-8xxx.txt +++ b/Bindings/net/wireless/marvell-8xxx.txt @@ -48,7 +48,6 @@ IRQ pin 38 is used as system wakeup source interrupt. wakeup pin 3 is configured so that firmware can wakeup host using this device side pin. &mmc3 { - status = "okay"; vmmc-supply = <&wlan_en_reg>; mmc-pwrseq = <&wifi_pwrseq>; bus-width = <4>; diff --git a/Bindings/net/wireless/ti,wlcore.txt b/Bindings/net/wireless/ti,wlcore.txt index 7b2cbb14113e..f42f6b0f1bc7 100644 --- a/Bindings/net/wireless/ti,wlcore.txt +++ b/Bindings/net/wireless/ti,wlcore.txt @@ -31,7 +31,6 @@ clock, new bindings (for parsing the clock nodes) have to be added. Example: &mmc3 { - status = "okay"; vmmc-supply = <&wlan_en_reg>; bus-width = <4>; cap-power-off-card; diff --git a/Bindings/net/xilinx_axienet.txt b/Bindings/net/xilinx_axienet.txt new file mode 100644 index 000000000000..38f9ec076743 --- /dev/null +++ b/Bindings/net/xilinx_axienet.txt @@ -0,0 +1,55 @@ +XILINX AXI ETHERNET Device Tree Bindings +-------------------------------------------------------- + +Also called AXI 1G/2.5G Ethernet Subsystem, the xilinx axi ethernet IP core +provides connectivity to an external ethernet PHY supporting different +interfaces: MII, GMII, RGMII, SGMII, 1000BaseX. It also includes two +segments of memory for buffering TX and RX, as well as the capability of +offloading TX/RX checksum calculation off the processor. + +Management configuration is done through the AXI interface, while payload is +sent and received through means of an AXI DMA controller. This driver +includes the DMA driver code, so this driver is incompatible with AXI DMA +driver. + +For more details about mdio please refer phy.txt file in the same directory. + +Required properties: +- compatible : Must be one of "xlnx,axi-ethernet-1.00.a", + "xlnx,axi-ethernet-1.01.a", "xlnx,axi-ethernet-2.01.a" +- reg : Address and length of the IO space. +- interrupts : Should be a list of two interrupt, TX and RX. +- phy-handle : Should point to the external phy device. + See ethernet.txt file in the same directory. +- xlnx,rxmem : Set to allocated memory buffer for Rx/Tx in the hardware + +Optional properties: +- phy-mode : See ethernet.txt +- xlnx,phy-type : Deprecated, do not use, but still accepted in preference + to phy-mode. +- xlnx,txcsum : 0 or empty for disabling TX checksum offload, + 1 to enable partial TX checksum offload, + 2 to enable full TX checksum offload +- xlnx,rxcsum : Same values as xlnx,txcsum but for RX checksum offload + +Example: + axi_ethernet_eth: ethernet@40c00000 { + compatible = "xlnx,axi-ethernet-1.00.a"; + device_type = "network"; + interrupt-parent = <µblaze_0_axi_intc>; + interrupts = <2 0>; + phy-mode = "mii"; + reg = <0x40c00000 0x40000>; + xlnx,rxcsum = <0x2>; + xlnx,rxmem = <0x800>; + xlnx,txcsum = <0x2>; + phy-handle = <&phy0>; + axi_ethernetlite_0_mdio: mdio { + #address-cells = <1>; + #size-cells = <0>; + phy0: phy@0 { + device_type = "ethernet-phy"; + reg = <1>; + }; + }; + }; diff --git a/Bindings/nvmem/mtk-efuse.txt b/Bindings/nvmem/mtk-efuse.txt index 74cf52908a6c..0668c45a156d 100644 --- a/Bindings/nvmem/mtk-efuse.txt +++ b/Bindings/nvmem/mtk-efuse.txt @@ -3,7 +3,10 @@ This binding is intended to represent MTK-EFUSE which is found in most Mediatek SOCs. Required properties: -- compatible: should be "mediatek,mt8173-efuse" or "mediatek,efuse" +- compatible: should be + "mediatek,mt7622-efuse", "mediatek,efuse": for MT7622 + "mediatek,mt7623-efuse", "mediatek,efuse": for MT7623 + "mediatek,mt8173-efuse" or "mediatek,efuse": for MT8173 - reg: Should contain registers location and length = Data cells = diff --git a/Bindings/nvmem/mxs-ocotp.txt b/Bindings/nvmem/mxs-ocotp.txt index daebce9e6b07..372c72fd64dc 100644 --- a/Bindings/nvmem/mxs-ocotp.txt +++ b/Bindings/nvmem/mxs-ocotp.txt @@ -21,5 +21,4 @@ Example for i.MX28: #size-cells = <1>; reg = <0x8002c000 0x2000>; clocks = <&clks 25>; - status = "okay"; }; diff --git a/Bindings/opp/opp.txt b/Bindings/opp/opp.txt index e36d261b9ba6..9d733af26be7 100644 --- a/Bindings/opp/opp.txt +++ b/Bindings/opp/opp.txt @@ -464,7 +464,6 @@ Example 5: opp-supported-hw opp_table { compatible = "operating-points-v2"; - status = "okay"; opp-shared; opp-600000000 { diff --git a/Bindings/pci/83xx-512x-pci.txt b/Bindings/pci/83xx-512x-pci.txt index 35a465362408..b9165b72473c 100644 --- a/Bindings/pci/83xx-512x-pci.txt +++ b/Bindings/pci/83xx-512x-pci.txt @@ -1,11 +1,11 @@ * Freescale 83xx and 512x PCI bridges -Freescale 83xx and 512x SOCs include the same pci bridge core. +Freescale 83xx and 512x SOCs include the same PCI bridge core. 83xx/512x specific notes: - reg: should contain two address length tuples - The first is for the internal pci bridge registers - The second is for the pci config space access registers + The first is for the internal PCI bridge registers + The second is for the PCI config space access registers Example (MPC8313ERDB) pci0: pci@e0008500 { diff --git a/Bindings/pci/aardvark-pci.txt b/Bindings/pci/aardvark-pci.txt index bbcd9f4c501f..310ef7145c47 100644 --- a/Bindings/pci/aardvark-pci.txt +++ b/Bindings/pci/aardvark-pci.txt @@ -33,7 +33,6 @@ Example: pcie0: pcie@d0070000 { compatible = "marvell,armada-3700-pcie"; device_type = "pci"; - status = "disabled"; reg = <0 0xd0070000 0 0x20000>; #address-cells = <3>; #size-cells = <2>; diff --git a/Bindings/pci/altera-pcie.txt b/Bindings/pci/altera-pcie.txt index 2951a6a50704..495880193adc 100644 --- a/Bindings/pci/altera-pcie.txt +++ b/Bindings/pci/altera-pcie.txt @@ -7,21 +7,21 @@ Required properties: "Txs": TX slave port region "Cra": Control register access region - interrupt-parent: interrupt source phandle. -- interrupts: specifies the interrupt source of the parent interrupt controller. - The format of the interrupt specifier depends on the parent interrupt - controller. +- interrupts: specifies the interrupt source of the parent interrupt + controller. The format of the interrupt specifier depends + on the parent interrupt controller. - device_type: must be "pci" - #address-cells: set to <3> -- #size-cells: set to <2> +- #size-cells: set to <2> - #interrupt-cells: set to <1> -- ranges: describes the translation of addresses for root ports and standard - PCI regions. +- ranges: describes the translation of addresses for root ports and + standard PCI regions. - interrupt-map-mask and interrupt-map: standard PCI properties to define the mapping of the PCIe interface to interrupt numbers. Optional properties: -- msi-parent: Link to the hardware entity that serves as the MSI controller for this PCIe - controller. +- msi-parent: Link to the hardware entity that serves as the MSI controller + for this PCIe controller. - bus-range: PCI bus numbers covered Example @@ -45,5 +45,5 @@ Example <0 0 0 3 &pcie_0 3>, <0 0 0 4 &pcie_0 4>; ranges = <0x82000000 0x00000000 0x00000000 0xc0000000 0x00000000 0x10000000 - 0x82000000 0x00000000 0x10000000 0xd0000000 0x00000000 0x10000000>; + 0x82000000 0x00000000 0x10000000 0xd0000000 0x00000000 0x10000000>; }; diff --git a/Bindings/pci/axis,artpec6-pcie.txt b/Bindings/pci/axis,artpec6-pcie.txt index 5ecaea1e6eee..4e4aee4439ea 100644 --- a/Bindings/pci/axis,artpec6-pcie.txt +++ b/Bindings/pci/axis,artpec6-pcie.txt @@ -6,7 +6,7 @@ and thus inherits all the common properties defined in designware-pcie.txt. Required properties: - compatible: "axis,artpec6-pcie", "snps,dw-pcie" - reg: base addresses and lengths of the PCIe controller (DBI), - the phy controller, and configuration address space. + the PHY controller, and configuration address space. - reg-names: Must include the following entries: - "dbi" - "phy" diff --git a/Bindings/pci/designware-pcie.txt b/Bindings/pci/designware-pcie.txt index b2480dd38c11..1da7ade3183c 100644 --- a/Bindings/pci/designware-pcie.txt +++ b/Bindings/pci/designware-pcie.txt @@ -1,4 +1,4 @@ -* Synopsys Designware PCIe interface +* Synopsys DesignWare PCIe interface Required properties: - compatible: should contain "snps,dw-pcie" to identify the core. @@ -17,29 +17,27 @@ RC mode: properties to define the mapping of the PCIe interface to interrupt numbers. EP mode: -- num-ib-windows: number of inbound address translation - windows -- num-ob-windows: number of outbound address translation - windows +- num-ib-windows: number of inbound address translation windows +- num-ob-windows: number of outbound address translation windows Optional properties: - num-lanes: number of lanes to use (this property should be specified unless the link is brought already up in BIOS) -- reset-gpio: gpio pin number of power good signal +- reset-gpio: GPIO pin number of power good signal - clocks: Must contain an entry for each entry in clock-names. See ../clocks/clock-bindings.txt for details. - clock-names: Must include the following entries: - "pcie" - "pcie_bus" RC mode: -- num-viewport: number of view ports configured in - hardware. If a platform does not specify it, the driver assumes 2. -- bus-range: PCI bus numbers covered (it is recommended - for new devicetrees to specify this property, to keep backwards - compatibility a range of 0x00-0xff is assumed if not present) +- num-viewport: number of view ports configured in hardware. If a platform + does not specify it, the driver assumes 2. +- bus-range: PCI bus numbers covered (it is recommended for new devicetrees + to specify this property, to keep backwards compatibility a range of + 0x00-0xff is assumed if not present) + EP mode: -- max-functions: maximum number of functions that can be - configured +- max-functions: maximum number of functions that can be configured Example configuration: diff --git a/Bindings/pci/fsl,imx6q-pcie.txt b/Bindings/pci/fsl,imx6q-pcie.txt index cf92d3ba5a26..7b1e48bf172b 100644 --- a/Bindings/pci/fsl,imx6q-pcie.txt +++ b/Bindings/pci/fsl,imx6q-pcie.txt @@ -1,6 +1,6 @@ * Freescale i.MX6 PCIe interface -This PCIe host controller is based on the Synopsis Designware PCIe IP +This PCIe host controller is based on the Synopsys DesignWare PCIe IP and thus inherits all the common properties defined in designware-pcie.txt. Required properties: diff --git a/Bindings/pci/hisilicon-pcie.txt b/Bindings/pci/hisilicon-pcie.txt index a339dbb15493..bdb7ab39d2d7 100644 --- a/Bindings/pci/hisilicon-pcie.txt +++ b/Bindings/pci/hisilicon-pcie.txt @@ -1,7 +1,7 @@ HiSilicon Hip05 and Hip06 PCIe host bridge DT description -HiSilicon PCIe host controller is based on Designware PCI core. -It shares common functions with PCIe Designware core driver and inherits +HiSilicon PCIe host controller is based on the Synopsys DesignWare PCI core. +It shares common functions with the PCIe DesignWare core driver and inherits common properties defined in Documentation/devicetree/bindings/pci/designware-pci.txt. @@ -40,7 +40,6 @@ Hip05 Example (note that Hip06 is the same except compatible): 0x0 0 0 2 &mbigen_pcie 2 11 0x0 0 0 3 &mbigen_pcie 3 12 0x0 0 0 4 &mbigen_pcie 4 13>; - status = "ok"; }; HiSilicon Hip06/Hip07 PCIe host bridge DT (almost-ECAM) description. @@ -83,5 +82,4 @@ Example: 0x0 0 0 2 &mbigen_pcie0 650 4 0x0 0 0 3 &mbigen_pcie0 650 4 0x0 0 0 4 &mbigen_pcie0 650 4>; - status = "ok"; }; diff --git a/Bindings/pci/kirin-pcie.txt b/Bindings/pci/kirin-pcie.txt index 68ffa0fbcd73..6e217c63123d 100644 --- a/Bindings/pci/kirin-pcie.txt +++ b/Bindings/pci/kirin-pcie.txt @@ -1,8 +1,8 @@ HiSilicon Kirin SoCs PCIe host DT description -Kirin PCIe host controller is based on Designware PCI core. -It shares common functions with PCIe Designware core driver -and inherits common properties defined in +Kirin PCIe host controller is based on the Synopsys DesignWare PCI core. +It shares common functions with the PCIe DesignWare core driver and +inherits common properties defined in Documentation/devicetree/bindings/pci/designware-pci.txt. Additional properties are described here: @@ -16,7 +16,7 @@ Required properties "apb": apb Ctrl register defined by Kirin; "phy": apb PHY register defined by Kirin; "config": PCIe configuration space registers. -- reset-gpios: The gpio to generate PCIe perst assert and deassert signal. +- reset-gpios: The GPIO to generate PCIe PERST# assert and deassert signal. Optional properties: diff --git a/Bindings/pci/layerscape-pci.txt b/Bindings/pci/layerscape-pci.txt index ee1c72d5162e..c0484da0f20d 100644 --- a/Bindings/pci/layerscape-pci.txt +++ b/Bindings/pci/layerscape-pci.txt @@ -15,8 +15,10 @@ Required properties: - compatible: should contain the platform identifier such as: "fsl,ls1021a-pcie", "snps,dw-pcie" "fsl,ls2080a-pcie", "fsl,ls2085a-pcie", "snps,dw-pcie" + "fsl,ls2088a-pcie" + "fsl,ls1088a-pcie" "fsl,ls1046a-pcie" -- reg: base addresses and lengths of the PCIe controller +- reg: base addresses and lengths of the PCIe controller register blocks. - interrupts: A list of interrupt outputs of the controller. Must contain an entry for each entry in the interrupt-names property. - interrupt-names: Must include the following entries: diff --git a/Bindings/pci/mediatek,mt7623-pcie.txt b/Bindings/pci/mediatek,mt7623-pcie.txt deleted file mode 100644 index fe80dda9bf73..000000000000 --- a/Bindings/pci/mediatek,mt7623-pcie.txt +++ /dev/null @@ -1,130 +0,0 @@ -MediaTek Gen2 PCIe controller which is available on MT7623 series SoCs - -PCIe subsys supports single root complex (RC) with 3 Root Ports. Each root -ports supports a Gen2 1-lane Link and has PIPE interface to PHY. - -Required properties: -- compatible: Should contain "mediatek,mt7623-pcie". -- device_type: Must be "pci" -- reg: Base addresses and lengths of the PCIe controller. -- #address-cells: Address representation for root ports (must be 3) -- #size-cells: Size representation for root ports (must be 2) -- #interrupt-cells: Size representation for interrupts (must be 1) -- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties - Please refer to the standard PCI bus binding document for a more detailed - explanation. -- clocks: Must contain an entry for each entry in clock-names. - See ../clocks/clock-bindings.txt for details. -- clock-names: Must include the following entries: - - free_ck :for reference clock of PCIe subsys - - sys_ck0 :for clock of Port0 - - sys_ck1 :for clock of Port1 - - sys_ck2 :for clock of Port2 -- resets: Must contain an entry for each entry in reset-names. - See ../reset/reset.txt for details. -- reset-names: Must include the following entries: - - pcie-rst0 :port0 reset - - pcie-rst1 :port1 reset - - pcie-rst2 :port2 reset -- phys: List of PHY specifiers (used by generic PHY framework). -- phy-names : Must be "pcie-phy0", "pcie-phy1", "pcie-phyN".. based on the - number of PHYs as specified in *phys* property. -- power-domains: A phandle and power domain specifier pair to the power domain - which is responsible for collapsing and restoring power to the peripheral. -- bus-range: Range of bus numbers associated with this controller. -- ranges: Ranges for the PCI memory and I/O regions. - -In addition, the device tree node must have sub-nodes describing each -PCIe port interface, having the following mandatory properties: - -Required properties: -- device_type: Must be "pci" -- reg: Only the first four bytes are used to refer to the correct bus number - and device number. -- #address-cells: Must be 3 -- #size-cells: Must be 2 -- #interrupt-cells: Must be 1 -- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties - Please refer to the standard PCI bus binding document for a more detailed - explanation. -- ranges: Sub-ranges distributed from the PCIe controller node. An empty - property is sufficient. -- num-lanes: Number of lanes to use for this port. - -Examples: - - hifsys: syscon@1a000000 { - compatible = "mediatek,mt7623-hifsys", - "mediatek,mt2701-hifsys", - "syscon"; - reg = <0 0x1a000000 0 0x1000>; - #clock-cells = <1>; - #reset-cells = <1>; - }; - - pcie: pcie-controller@1a140000 { - compatible = "mediatek,mt7623-pcie"; - device_type = "pci"; - reg = <0 0x1a140000 0 0x1000>, /* PCIe shared registers */ - <0 0x1a142000 0 0x1000>, /* Port0 registers */ - <0 0x1a143000 0 0x1000>, /* Port1 registers */ - <0 0x1a144000 0 0x1000>; /* Port2 registers */ - #address-cells = <3>; - #size-cells = <2>; - #interrupt-cells = <1>; - interrupt-map-mask = <0xf800 0 0 0>; - interrupt-map = <0x0000 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>, - <0x0800 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>, - <0x1000 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>; - clocks = <&topckgen CLK_TOP_ETHIF_SEL>, - <&hifsys CLK_HIFSYS_PCIE0>, - <&hifsys CLK_HIFSYS_PCIE1>, - <&hifsys CLK_HIFSYS_PCIE2>; - clock-names = "free_ck", "sys_ck0", "sys_ck1", "sys_ck2"; - resets = <&hifsys MT2701_HIFSYS_PCIE0_RST>, - <&hifsys MT2701_HIFSYS_PCIE1_RST>, - <&hifsys MT2701_HIFSYS_PCIE2_RST>; - reset-names = "pcie-rst0", "pcie-rst1", "pcie-rst2"; - phys = <&pcie0_phy>, <&pcie1_phy>, <&pcie2_phy>; - phy-names = "pcie-phy0", "pcie-phy1", "pcie-phy2"; - power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>; - bus-range = <0x00 0xff>; - ranges = <0x81000000 0 0x1a160000 0 0x1a160000 0 0x00010000 /* I/O space */ - 0x83000000 0 0x60000000 0 0x60000000 0 0x10000000>; /* memory space */ - - pcie@0,0 { - device_type = "pci"; - reg = <0x0000 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>; - ranges; - num-lanes = <1>; - }; - - pcie@1,0 { - device_type = "pci"; - reg = <0x0800 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>; - ranges; - num-lanes = <1>; - }; - - pcie@2,0 { - device_type = "pci"; - reg = <0x1000 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>; - ranges; - num-lanes = <1>; - }; - }; diff --git a/Bindings/pci/mediatek-pcie.txt b/Bindings/pci/mediatek-pcie.txt new file mode 100644 index 000000000000..3a6ce55dd310 --- /dev/null +++ b/Bindings/pci/mediatek-pcie.txt @@ -0,0 +1,284 @@ +MediaTek Gen2 PCIe controller + +Required properties: +- compatible: Should contain one of the following strings: + "mediatek,mt2701-pcie" + "mediatek,mt2712-pcie" + "mediatek,mt7622-pcie" + "mediatek,mt7623-pcie" +- device_type: Must be "pci" +- reg: Base addresses and lengths of the PCIe subsys and root ports. +- reg-names: Names of the above areas to use during resource lookup. +- #address-cells: Address representation for root ports (must be 3) +- #size-cells: Size representation for root ports (must be 2) +- clocks: Must contain an entry for each entry in clock-names. + See ../clocks/clock-bindings.txt for details. +- clock-names: + Mandatory entries: + - sys_ckN :transaction layer and data link layer clock + Required entries for MT2701/MT7623: + - free_ck :for reference clock of PCIe subsys + Required entries for MT2712/MT7622: + - ahb_ckN :AHB slave interface operating clock for CSR access and RC + initiated MMIO access + Required entries for MT7622: + - axi_ckN :application layer MMIO channel operating clock + - aux_ckN :pe2_mac_bridge and pe2_mac_core operating clock when + pcie_mac_ck/pcie_pipe_ck is turned off + - obff_ckN :OBFF functional block operating clock + - pipe_ckN :LTSSM and PHY/MAC layer operating clock + where N starting from 0 to one less than the number of root ports. +- phys: List of PHY specifiers (used by generic PHY framework). +- phy-names : Must be "pcie-phy0", "pcie-phy1", "pcie-phyN".. based on the + number of PHYs as specified in *phys* property. +- power-domains: A phandle and power domain specifier pair to the power domain + which is responsible for collapsing and restoring power to the peripheral. +- bus-range: Range of bus numbers associated with this controller. +- ranges: Ranges for the PCI memory and I/O regions. + +Required properties for MT7623/MT2701: +- #interrupt-cells: Size representation for interrupts (must be 1) +- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties + Please refer to the standard PCI bus binding document for a more detailed + explanation. +- resets: Must contain an entry for each entry in reset-names. + See ../reset/reset.txt for details. +- reset-names: Must be "pcie-rst0", "pcie-rst1", "pcie-rstN".. based on the + number of root ports. + +Required properties for MT2712/MT7622: +-interrupts: A list of interrupt outputs of the controller, must have one + entry for each PCIe port + +In addition, the device tree node must have sub-nodes describing each +PCIe port interface, having the following mandatory properties: + +Required properties: +- device_type: Must be "pci" +- reg: Only the first four bytes are used to refer to the correct bus number + and device number. +- #address-cells: Must be 3 +- #size-cells: Must be 2 +- #interrupt-cells: Must be 1 +- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties + Please refer to the standard PCI bus binding document for a more detailed + explanation. +- ranges: Sub-ranges distributed from the PCIe controller node. An empty + property is sufficient. +- num-lanes: Number of lanes to use for this port. + +Examples for MT7623: + + hifsys: syscon@1a000000 { + compatible = "mediatek,mt7623-hifsys", + "mediatek,mt2701-hifsys", + "syscon"; + reg = <0 0x1a000000 0 0x1000>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + pcie: pcie-controller@1a140000 { + compatible = "mediatek,mt7623-pcie"; + device_type = "pci"; + reg = <0 0x1a140000 0 0x1000>, /* PCIe shared registers */ + <0 0x1a142000 0 0x1000>, /* Port0 registers */ + <0 0x1a143000 0 0x1000>, /* Port1 registers */ + <0 0x1a144000 0 0x1000>; /* Port2 registers */ + reg-names = "subsys", "port0", "port1", "port2"; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + interrupt-map-mask = <0xf800 0 0 0>; + interrupt-map = <0x0000 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>, + <0x0800 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>, + <0x1000 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>; + clocks = <&topckgen CLK_TOP_ETHIF_SEL>, + <&hifsys CLK_HIFSYS_PCIE0>, + <&hifsys CLK_HIFSYS_PCIE1>, + <&hifsys CLK_HIFSYS_PCIE2>; + clock-names = "free_ck", "sys_ck0", "sys_ck1", "sys_ck2"; + resets = <&hifsys MT2701_HIFSYS_PCIE0_RST>, + <&hifsys MT2701_HIFSYS_PCIE1_RST>, + <&hifsys MT2701_HIFSYS_PCIE2_RST>; + reset-names = "pcie-rst0", "pcie-rst1", "pcie-rst2"; + phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>, + <&pcie2_phy PHY_TYPE_PCIE>; + phy-names = "pcie-phy0", "pcie-phy1", "pcie-phy2"; + power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>; + bus-range = <0x00 0xff>; + ranges = <0x81000000 0 0x1a160000 0 0x1a160000 0 0x00010000 /* I/O space */ + 0x83000000 0 0x60000000 0 0x60000000 0 0x10000000>; /* memory space */ + + pcie@0,0 { + device_type = "pci"; + reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>; + ranges; + num-lanes = <1>; + }; + + pcie@1,0 { + device_type = "pci"; + reg = <0x0800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>; + ranges; + num-lanes = <1>; + }; + + pcie@2,0 { + device_type = "pci"; + reg = <0x1000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 0>; + interrupt-map = <0 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>; + ranges; + num-lanes = <1>; + }; + }; + +Examples for MT2712: + pcie: pcie@11700000 { + compatible = "mediatek,mt2712-pcie"; + device_type = "pci"; + reg = <0 0x11700000 0 0x1000>, + <0 0x112ff000 0 0x1000>; + reg-names = "port0", "port1"; + #address-cells = <3>; + #size-cells = <2>; + interrupts = , + ; + clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>, + <&topckgen CLK_TOP_PE2_MAC_P1_SEL>, + <&pericfg CLK_PERI_PCIE0>, + <&pericfg CLK_PERI_PCIE1>; + clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1"; + phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>; + phy-names = "pcie-phy0", "pcie-phy1"; + bus-range = <0x00 0xff>; + ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; + + pcie0: pcie@0,0 { + device_type = "pci"; + reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + num-lanes = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc0 0>, + <0 0 0 2 &pcie_intc0 1>, + <0 0 0 3 &pcie_intc0 2>, + <0 0 0 4 &pcie_intc0 3>; + pcie_intc0: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + + pcie1: pcie@1,0 { + device_type = "pci"; + reg = <0x0800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + num-lanes = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc1 0>, + <0 0 0 2 &pcie_intc1 1>, + <0 0 0 3 &pcie_intc1 2>, + <0 0 0 4 &pcie_intc1 3>; + pcie_intc1: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + }; + +Examples for MT7622: + pcie: pcie@1a140000 { + compatible = "mediatek,mt7622-pcie"; + device_type = "pci"; + reg = <0 0x1a140000 0 0x1000>, + <0 0x1a143000 0 0x1000>, + <0 0x1a145000 0 0x1000>; + reg-names = "subsys", "port0", "port1"; + #address-cells = <3>; + #size-cells = <2>; + interrupts = , + ; + clocks = <&pciesys CLK_PCIE_P0_MAC_EN>, + <&pciesys CLK_PCIE_P1_MAC_EN>, + <&pciesys CLK_PCIE_P0_AHB_EN>, + <&pciesys CLK_PCIE_P1_AHB_EN>, + <&pciesys CLK_PCIE_P0_AUX_EN>, + <&pciesys CLK_PCIE_P1_AUX_EN>, + <&pciesys CLK_PCIE_P0_AXI_EN>, + <&pciesys CLK_PCIE_P1_AXI_EN>, + <&pciesys CLK_PCIE_P0_OBFF_EN>, + <&pciesys CLK_PCIE_P1_OBFF_EN>, + <&pciesys CLK_PCIE_P0_PIPE_EN>, + <&pciesys CLK_PCIE_P1_PIPE_EN>; + clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1", + "aux_ck0", "aux_ck1", "axi_ck0", "axi_ck1", + "obff_ck0", "obff_ck1", "pipe_ck0", "pipe_ck1"; + phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>; + phy-names = "pcie-phy0", "pcie-phy1"; + power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; + bus-range = <0x00 0xff>; + ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; + + pcie0: pcie@0,0 { + device_type = "pci"; + reg = <0x0000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + num-lanes = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc0 0>, + <0 0 0 2 &pcie_intc0 1>, + <0 0 0 3 &pcie_intc0 2>, + <0 0 0 4 &pcie_intc0 3>; + pcie_intc0: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + + pcie1: pcie@1,0 { + device_type = "pci"; + reg = <0x0800 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + ranges; + num-lanes = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc1 0>, + <0 0 0 2 &pcie_intc1 1>, + <0 0 0 3 &pcie_intc1 2>, + <0 0 0 4 &pcie_intc1 3>; + pcie_intc1: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + }; + }; diff --git a/Bindings/pci/mvebu-pci.txt b/Bindings/pci/mvebu-pci.txt index 2de6f65ecfb1..6173af6885f8 100644 --- a/Bindings/pci/mvebu-pci.txt +++ b/Bindings/pci/mvebu-pci.txt @@ -77,7 +77,7 @@ and the following optional properties: - marvell,pcie-lane: the physical PCIe lane number, for ports having multiple lanes. If this property is not found, we assume that the value is 0. -- reset-gpios: optional gpio to PERST# +- reset-gpios: optional GPIO to PERST# - reset-delay-us: delay in us to wait after reset de-assertion, if not specified will default to 100ms, as required by the PCIe specification. @@ -85,7 +85,6 @@ Example: pcie-controller { compatible = "marvell,armada-xp-pcie"; - status = "disabled"; device_type = "pci"; #address-cells = <3>; @@ -147,7 +146,6 @@ pcie-controller { /* wait 20ms for device settle after reset deassertion */ reset-delay-us = <20000>; clocks = <&gateclk 5>; - status = "disabled"; }; pcie@2,0 { @@ -164,7 +162,6 @@ pcie-controller { marvell,pcie-port = <0>; marvell,pcie-lane = <1>; clocks = <&gateclk 6>; - status = "disabled"; }; pcie@3,0 { @@ -181,7 +178,6 @@ pcie-controller { marvell,pcie-port = <0>; marvell,pcie-lane = <2>; clocks = <&gateclk 7>; - status = "disabled"; }; pcie@4,0 { @@ -198,7 +194,6 @@ pcie-controller { marvell,pcie-port = <0>; marvell,pcie-lane = <3>; clocks = <&gateclk 8>; - status = "disabled"; }; pcie@5,0 { @@ -215,7 +210,6 @@ pcie-controller { marvell,pcie-port = <1>; marvell,pcie-lane = <0>; clocks = <&gateclk 9>; - status = "disabled"; }; pcie@6,0 { @@ -232,7 +226,6 @@ pcie-controller { marvell,pcie-port = <1>; marvell,pcie-lane = <1>; clocks = <&gateclk 10>; - status = "disabled"; }; pcie@7,0 { @@ -249,7 +242,6 @@ pcie-controller { marvell,pcie-port = <1>; marvell,pcie-lane = <2>; clocks = <&gateclk 11>; - status = "disabled"; }; pcie@8,0 { @@ -266,7 +258,6 @@ pcie-controller { marvell,pcie-port = <1>; marvell,pcie-lane = <3>; clocks = <&gateclk 12>; - status = "disabled"; }; pcie@9,0 { @@ -283,10 +274,9 @@ pcie-controller { marvell,pcie-port = <2>; marvell,pcie-lane = <0>; clocks = <&gateclk 26>; - status = "disabled"; }; - pcie@10,0 { + pcie@a,0 { device_type = "pci"; assigned-addresses = <0x82005000 0 0x82000 0 0x2000>; reg = <0x5000 0 0 0 0>; @@ -300,6 +290,5 @@ pcie-controller { marvell,pcie-port = <3>; marvell,pcie-lane = <0>; clocks = <&gateclk 27>; - status = "disabled"; }; }; diff --git a/Bindings/pci/pci-armada8k.txt b/Bindings/pci/pci-armada8k.txt index 598533a57d79..c1e4c3d10a74 100644 --- a/Bindings/pci/pci-armada8k.txt +++ b/Bindings/pci/pci-armada8k.txt @@ -1,6 +1,6 @@ * Marvell Armada 7K/8K PCIe interface -This PCIe host controller is based on the Synopsis Designware PCIe IP +This PCIe host controller is based on the Synopsys DesignWare PCIe IP and thus inherits all the common properties defined in designware-pcie.txt. Required properties: @@ -34,5 +34,4 @@ Example: interrupts = ; num-lanes = <1>; clocks = <&cpm_syscon0 1 13>; - status = "disabled"; }; diff --git a/Bindings/pci/pci-keystone.txt b/Bindings/pci/pci-keystone.txt index d08a4d51108f..7e05487544ed 100644 --- a/Bindings/pci/pci-keystone.txt +++ b/Bindings/pci/pci-keystone.txt @@ -1,12 +1,12 @@ TI Keystone PCIe interface -Keystone PCI host Controller is based on Designware PCI h/w version 3.65. -It shares common functions with PCIe Designware core driver and inherit -common properties defined in +Keystone PCI host Controller is based on the Synopsys DesignWare PCI +hardware version 3.65. It shares common functions with the PCIe DesignWare +core driver and inherits common properties defined in Documentation/devicetree/bindings/pci/designware-pci.txt Please refer to Documentation/devicetree/bindings/pci/designware-pci.txt -for the details of Designware DT bindings. Additional properties are +for the details of DesignWare DT bindings. Additional properties are described here as well as properties that are not applicable. Required Properties:- @@ -52,13 +52,12 @@ pcie_intc: Interrupt controller device node for Legacy IRQ chip }; Optional properties:- - phys: phandle to Generic Keystone SerDes phy for PCI - phy-names: name of the Generic Keystine SerDes phy for PCI + phys: phandle to generic Keystone SerDes PHY for PCI + phy-names: name of the generic Keystone SerDes PHY for PCI - If boot loader already does PCI link establishment, then phys and phy-names shouldn't be present. interrupts: platform interrupt for error interrupts. -Designware DT Properties not applicable for Keystone PCI +DesignWare DT Properties not applicable for Keystone PCI 1. pcie_bus clock-names not used. Instead, a phandle to phys is used. - diff --git a/Bindings/pci/pci-rcar-gen2.txt b/Bindings/pci/pci-rcar-gen2.txt index 07a75094c5a8..3d038638612b 100644 --- a/Bindings/pci/pci-rcar-gen2.txt +++ b/Bindings/pci/pci-rcar-gen2.txt @@ -6,11 +6,14 @@ AHB. There is one bridge instance per USB port connected to the internal OHCI and EHCI controllers. Required properties: -- compatible: "renesas,pci-r8a7790" for the R8A7790 SoC; +- compatible: "renesas,pci-r8a7743" for the R8A7743 SoC; + "renesas,pci-r8a7745" for the R8A7745 SoC; + "renesas,pci-r8a7790" for the R8A7790 SoC; "renesas,pci-r8a7791" for the R8A7791 SoC; "renesas,pci-r8a7793" for the R8A7793 SoC; "renesas,pci-r8a7794" for the R8A7794 SoC; - "renesas,pci-rcar-gen2" for a generic R-Car Gen2 compatible device + "renesas,pci-rcar-gen2" for a generic R-Car Gen2 or + RZ/G1 compatible device. When compatible with the generic version, nodes must list the diff --git a/Bindings/pci/pci.txt b/Bindings/pci/pci.txt index 50f9e2ca5b13..c77981c5dd18 100644 --- a/Bindings/pci/pci.txt +++ b/Bindings/pci/pci.txt @@ -1,12 +1,12 @@ PCI bus bridges have standardized Device Tree bindings: PCI Bus Binding to: IEEE Std 1275-1994 -http://www.firmware.org/1275/bindings/pci/pci2_1.pdf +http://www.devicetree.org/open-firmware/bindings/pci/pci2_1.pdf And for the interrupt mapping part: Open Firmware Recommended Practice: Interrupt Mapping -http://www.firmware.org/1275/practice/imap/imap0_9d.pdf +http://www.devicetree.org/open-firmware/practice/imap/imap0_9d.pdf Additionally to the properties specified in the above standards a host bridge driver implementation may support the following properties: diff --git a/Bindings/pci/qcom,pcie.txt b/Bindings/pci/qcom,pcie.txt index 9d418b71774f..3c9d321b3d3b 100644 --- a/Bindings/pci/qcom,pcie.txt +++ b/Bindings/pci/qcom,pcie.txt @@ -9,6 +9,7 @@ - "qcom,pcie-apq8084" for apq8084 - "qcom,pcie-msm8996" for msm8996 or apq8096 - "qcom,pcie-ipq4019" for ipq4019 + - "qcom,pcie-ipq8074" for ipq8074 - reg: Usage: required @@ -20,7 +21,7 @@ Value type: Definition: Must include the following entries - "parf" Qualcomm specific registers - - "dbi" Designware PCIe registers + - "dbi" DesignWare PCIe registers - "elbi" External local bus interface registers - "config" PCIe configuration space @@ -105,6 +106,16 @@ - "bus_master" Master AXI clock - "bus_slave" Slave AXI clock +- clock-names: + Usage: required for ipq8074 + Value type: + Definition: Should contain the following entries + - "iface" PCIe to SysNOC BIU clock + - "axi_m" AXI Master clock + - "axi_s" AXI Slave clock + - "ahb" AHB clock + - "aux" Auxiliary clock + - resets: Usage: required Value type: @@ -144,6 +155,18 @@ - "ahb" AHB reset - "phy_ahb" PHY AHB reset +- reset-names: + Usage: required for ipq8074 + Value type: + Definition: Should contain the following entries + - "pipe" PIPE reset + - "sleep" Sleep reset + - "sticky" Core Sticky reset + - "axi_m" AXI Master reset + - "axi_s" AXI Slave reset + - "ahb" AHB Reset + - "axi_m_sticky" AXI Master Sticky reset + - power-domains: Usage: required for apq8084 and msm8996/apq8096 Value type: @@ -180,7 +203,7 @@ - -gpios: Usage: optional Value type: - Definition: List of phandle and gpio specifier pairs. Should contain + Definition: List of phandle and GPIO specifier pairs. Should contain - "perst-gpios" PCIe endpoint reset signal line - "wake-gpios" PCIe endpoint wake signal line diff --git a/Bindings/pci/ralink,rt3883-pci.txt b/Bindings/pci/ralink,rt3883-pci.txt index 8e0a1eb0acbb..a04ab1b76211 100644 --- a/Bindings/pci/ralink,rt3883-pci.txt +++ b/Bindings/pci/ralink,rt3883-pci.txt @@ -71,7 +71,7 @@ - interrupt-map: standard PCI properties to define the mapping of the PCI interface to interrupt numbers. - The PCI host bridge node migh have additional sub-nodes representing + The PCI host bridge node might have additional sub-nodes representing the onboard PCI devices/PCI slots. Each such sub-node must have the following mandatory properties: diff --git a/Bindings/pci/rcar-pci.txt b/Bindings/pci/rcar-pci.txt index bd27428dda61..76ba3a61d1a3 100644 --- a/Bindings/pci/rcar-pci.txt +++ b/Bindings/pci/rcar-pci.txt @@ -14,7 +14,7 @@ compatible: "renesas,pcie-r8a7779" for the R8A7779 SoC; SoC-specific version corresponding to the platform first followed by the generic version. -- reg: base address and length of the pcie controller registers. +- reg: base address and length of the PCIe controller registers. - #address-cells: set to <3> - #size-cells: set to <2> - bus-range: PCI bus numbers covered @@ -25,15 +25,14 @@ compatible: "renesas,pcie-r8a7779" for the R8A7779 SoC; source for hardware related interrupts (e.g. link speed change). - #interrupt-cells: set to <1> - interrupt-map-mask and interrupt-map: standard PCI properties - to define the mapping of the PCIe interface to interrupt - numbers. + to define the mapping of the PCIe interface to interrupt numbers. - clocks: from common clock binding: clock specifiers for the PCIe controller and PCIe bus clocks. - clock-names: from common clock binding: should be "pcie" and "pcie_bus". Example: -SoC specific DT Entry: +SoC-specific DT Entry: pcie: pcie@fe000000 { compatible = "renesas,pcie-r8a7791", "renesas,pcie-rcar-gen2"; @@ -54,5 +53,4 @@ SoC specific DT Entry: interrupt-map = <0 0 0 0 &gic 0 116 4>; clocks = <&mstp3_clks R8A7791_CLK_PCIE>, <&pcie_bus_clk>; clock-names = "pcie", "pcie_bus"; - status = "disabled"; }; diff --git a/Bindings/pci/rockchip-pcie.txt b/Bindings/pci/rockchip-pcie.txt index 1453a734c2f5..af34c65773fd 100644 --- a/Bindings/pci/rockchip-pcie.txt +++ b/Bindings/pci/rockchip-pcie.txt @@ -19,8 +19,6 @@ Required properties: - "pm" - msi-map: Maps a Requester ID to an MSI controller and associated msi-specifier data. See ./pci-msi.txt -- phys: From PHY bindings: Phandle for the Generic PHY for PCIe. -- phy-names: MUST be "pcie-phy". - interrupts: Three interrupt entries must be specified. - interrupt-names: Must include the following names - "sys" @@ -42,11 +40,24 @@ Required properties: interrupt source. The value must be 1. - interrupt-map-mask and interrupt-map: standard PCI properties +Required properties for legacy PHY model (deprecated): +- phys: From PHY bindings: Phandle for the Generic PHY for PCIe. +- phy-names: MUST be "pcie-phy". + +Required properties for per-lane PHY model (preferred): +- phys: Must contain an phandle to a PHY for each entry in phy-names. +- phy-names: Must include 4 entries for all 4 lanes even if some of + them won't be used for your cases. Entries are of the form "pcie-phy-N": + where N ranges from 0 to 3. + (see example below and you MUST also refer to ../phy/rockchip-pcie-phy.txt + for changing the #phy-cells of phy node to support it) + Optional Property: - aspm-no-l0s: RC won't support ASPM L0s. This property is needed if using 24MHz OSC for RC's PHY. -- ep-gpios: contain the entry for pre-reset gpio +- ep-gpios: contain the entry for pre-reset GPIO - num-lanes: number of lanes to use +- vpcie12v-supply: The phandle to the 12v regulator to use for PCIe. - vpcie3v3-supply: The phandle to the 3.3v regulator to use for PCIe. - vpcie1v8-supply: The phandle to the 1.8v regulator to use for PCIe. - vpcie0v9-supply: The phandle to the 0.9v regulator to use for PCIe. @@ -95,6 +106,7 @@ pcie0: pcie@f8000000 { <&cru SRST_PCIE_PM>, <&cru SRST_P_PCIE>, <&cru SRST_A_PCIE>; reset-names = "core", "mgmt", "mgmt-sticky", "pipe", "pm", "pclk", "aclk"; + /* deprecated legacy PHY model */ phys = <&pcie_phy>; phy-names = "pcie-phy"; pinctrl-names = "default"; @@ -111,3 +123,13 @@ pcie0: pcie@f8000000 { #interrupt-cells = <1>; }; }; + +pcie0: pcie@f8000000 { + ... + + /* preferred per-lane PHY model */ + phys = <&pcie_phy 0>, <&pcie_phy 1>, <&pcie_phy 2>, <&pcie_phy 3>; + phy-names = "pcie-phy-0", "pcie-phy-1", "pcie-phy-2", "pcie-phy-3"; + + ... +}; diff --git a/Bindings/pci/samsung,exynos5440-pcie.txt b/Bindings/pci/samsung,exynos5440-pcie.txt index 7d3b09474657..34a11bfbfb60 100644 --- a/Bindings/pci/samsung,exynos5440-pcie.txt +++ b/Bindings/pci/samsung,exynos5440-pcie.txt @@ -1,29 +1,29 @@ * Samsung Exynos 5440 PCIe interface -This PCIe host controller is based on the Synopsis Designware PCIe IP +This PCIe host controller is based on the Synopsys DesignWare PCIe IP and thus inherits all the common properties defined in designware-pcie.txt. Required properties: - compatible: "samsung,exynos5440-pcie" -- reg: base addresses and lengths of the pcie controller, - the phy controller, additional register for the phy controller. - (Registers for the phy controller are DEPRECATED. +- reg: base addresses and lengths of the PCIe controller, + the PHY controller, additional register for the PHY controller. + (Registers for the PHY controller are DEPRECATED. Use the PHY framework.) - reg-names : First name should be set to "elbi". - And use the "config" instead of getting the confgiruation address space + And use the "config" instead of getting the configuration address space from "ranges". - NOTE: When use the "config" property, reg-names must be set. + NOTE: When using the "config" property, reg-names must be set. - interrupts: A list of interrupt outputs for level interrupt, pulse interrupt, special interrupt. -- phys: From PHY binding. Phandle for the Generic PHY. +- phys: From PHY binding. Phandle for the generic PHY. Refer to Documentation/devicetree/bindings/phy/samsung-phy.txt -Other common properties refer to - Documentation/devicetree/binding/pci/designware-pcie.txt +For other common properties, refer to + Documentation/devicetree/bindings/pci/designware-pcie.txt Example: -SoC specific DT Entry: +SoC-specific DT Entry: pcie@290000 { compatible = "samsung,exynos5440-pcie", "snps,dw-pcie"; @@ -83,7 +83,7 @@ With using PHY framework: ... }; -Board specific DT Entry: +Board-specific DT Entry: pcie@290000 { reset-gpio = <&pin_ctrl 5 0>; diff --git a/Bindings/pci/spear13xx-pcie.txt b/Bindings/pci/spear13xx-pcie.txt index 49ea76da7718..d5a14f5dad46 100644 --- a/Bindings/pci/spear13xx-pcie.txt +++ b/Bindings/pci/spear13xx-pcie.txt @@ -1,12 +1,12 @@ SPEAr13XX PCIe DT detail: ================================ -SPEAr13XX uses synopsis designware PCIe controller and ST MiPHY as phy +SPEAr13XX uses the Synopsys DesignWare PCIe controller and ST MiPHY as PHY controller. Required properties: -- compatible : should be "st,spear1340-pcie", "snps,dw-pcie". -- phys : phandle to phy node associated with pcie controller +- compatible : should be "st,spear1340-pcie", "snps,dw-pcie". +- phys : phandle to PHY node associated with PCIe controller - phy-names : must be "pcie-phy" - All other definitions as per generic PCI bindings diff --git a/Bindings/pci/ti-pci.txt b/Bindings/pci/ti-pci.txt index 6a07c96227e0..7f7af3044016 100644 --- a/Bindings/pci/ti-pci.txt +++ b/Bindings/pci/ti-pci.txt @@ -1,6 +1,6 @@ TI PCI Controllers -PCIe Designware Controller +PCIe DesignWare Controller - compatible: Should be "ti,dra7-pcie" for RC Should be "ti,dra7-pcie-ep" for EP - phys : list of PHY specifiers (used by generic PHY framework) @@ -13,7 +13,7 @@ PCIe Designware Controller HOST MODE ========= - reg : Two register ranges as listed in the reg-names property - - reg-names : The first entry must be "ti-conf" for the TI specific registers + - reg-names : The first entry must be "ti-conf" for the TI-specific registers The second entry must be "rc-dbics" for the DesignWare PCIe registers The third entry must be "config" for the PCIe configuration space @@ -30,7 +30,7 @@ HOST MODE DEVICE MODE =========== - reg : Four register ranges as listed in the reg-names property - - reg-names : "ti-conf" for the TI specific registers + - reg-names : "ti-conf" for the TI-specific registers "ep_dbics" for the standard configuration registers as they are locally accessed within the DIF CS space "ep_dbics2" for the standard configuration registers as @@ -46,7 +46,7 @@ DEVICE MODE access. Optional Property: - - gpios : Should be added if a gpio line is required to drive PERST# line + - gpios : Should be added if a GPIO line is required to drive PERST# line NOTE: Two DT nodes may be added for each PCI controller; one for host mode and another for device mode. So in order for PCI to diff --git a/Bindings/pci/versatile.txt b/Bindings/pci/versatile.txt index ebd1e7d0403e..0a702b13d2ac 100644 --- a/Bindings/pci/versatile.txt +++ b/Bindings/pci/versatile.txt @@ -5,7 +5,7 @@ PCI host controller found on the ARM Versatile PB board's FPGA. Required properties: - compatible: should contain "arm,versatile-pci" to identify the Versatile PCI controller. -- reg: base addresses and lengths of the pci controller. There must be 3 +- reg: base addresses and lengths of the PCI controller. There must be 3 entries: - Versatile-specific registers - Self Config space diff --git a/Bindings/pci/xgene-pci-msi.txt b/Bindings/pci/xgene-pci-msi.txt index 36d881c8e6d4..85d9b95234f7 100644 --- a/Bindings/pci/xgene-pci-msi.txt +++ b/Bindings/pci/xgene-pci-msi.txt @@ -4,7 +4,7 @@ Required properties: - compatible: should be "apm,xgene1-msi" to identify X-Gene v1 PCIe MSI controller block. -- msi-controller: indicates that this is X-Gene v1 PCIe MSI controller node +- msi-controller: indicates that this is an X-Gene v1 PCIe MSI controller node - reg: physical base address (0x79000000) and length (0x900000) for controller registers. These registers include the MSI termination address and data registers as well as the MSI interrupt status registers. @@ -13,7 +13,8 @@ Required properties: interrupt number 0x10 to 0x1f. - interrupt-names: not required -Each PCIe node needs to have property msi-parent that points to msi controller node +Each PCIe node needs to have property msi-parent that points to an MSI +controller node Examples: @@ -44,7 +45,6 @@ SoC DTSI: + PCIe controller node with msi-parent property pointing to MSI node: pcie0: pcie@1f2b0000 { - status = "disabled"; device_type = "pci"; compatible = "apm,xgene-storm-pcie", "apm,xgene-pcie"; #interrupt-cells = <1>; diff --git a/Bindings/pci/xgene-pci.txt b/Bindings/pci/xgene-pci.txt index 1070b068c7c6..6fd2decfa66c 100644 --- a/Bindings/pci/xgene-pci.txt +++ b/Bindings/pci/xgene-pci.txt @@ -8,7 +8,7 @@ Required properties: property. - reg-names: Must include the following entries: "csr": controller configuration registers. - "cfg": pcie configuration space registers. + "cfg": PCIe configuration space registers. - #address-cells: set to <3> - #size-cells: set to <2> - ranges: ranges for the outbound memory, I/O regions. @@ -21,11 +21,11 @@ Required properties: Optional properties: - status: Either "ok" or "disabled". -- dma-coherent: Present if dma operations are coherent +- dma-coherent: Present if DMA operations are coherent Example: -SoC specific DT Entry: +SoC-specific DT Entry: pcie0: pcie@1f2b0000 { status = "disabled"; @@ -51,7 +51,7 @@ SoC specific DT Entry: }; -Board specific DT Entry: +Board-specific DT Entry: &pcie0 { status = "ok"; }; diff --git a/Bindings/pci/xilinx-nwl-pcie.txt b/Bindings/pci/xilinx-nwl-pcie.txt index 3259798a1192..01bf7fdf4c19 100644 --- a/Bindings/pci/xilinx-nwl-pcie.txt +++ b/Bindings/pci/xilinx-nwl-pcie.txt @@ -15,9 +15,9 @@ Required properties: - device_type: must be "pci" - interrupts: Should contain NWL PCIe interrupt - interrupt-names: Must include the following entries: - "msi1, msi0": interrupt asserted when MSI is received + "msi1, msi0": interrupt asserted when an MSI is received "intx": interrupt asserted when a legacy interrupt is received - "misc": interrupt asserted when miscellaneous is received + "misc": interrupt asserted when miscellaneous interrupt is received - interrupt-map-mask and interrupt-map: standard PCI properties to define the mapping of the PCI interface to interrupt numbers. - ranges: ranges for the PCI memory regions (I/O space region is not @@ -26,7 +26,8 @@ Required properties: detailed explanation - msi-controller: indicates that this is MSI controller node - msi-parent: MSI parent of the root complex itself -- legacy-interrupt-controller: Interrupt controller device node for Legacy interrupts +- legacy-interrupt-controller: Interrupt controller device node for Legacy + interrupts - interrupt-controller: identifies the node as an interrupt controller - #interrupt-cells: should be set to 1 - #address-cells: specifies the number of cells needed to encode an diff --git a/Bindings/phy/apm-xgene-phy.txt b/Bindings/phy/apm-xgene-phy.txt index 5f3a65a9dd88..e1bb12711fbf 100644 --- a/Bindings/phy/apm-xgene-phy.txt +++ b/Bindings/phy/apm-xgene-phy.txt @@ -61,19 +61,16 @@ Example: compatible = "apm,xgene-phy"; reg = <0x0 0x1f21a000 0x0 0x100>; #phy-cells = <1>; - status = "disabled"; }; phy2: phy@1f22a000 { compatible = "apm,xgene-phy"; reg = <0x0 0x1f22a000 0x0 0x100>; #phy-cells = <1>; - status = "ok"; }; phy3: phy@1f23a000 { compatible = "apm,xgene-phy"; reg = <0x0 0x1f23a000 0x0 0x100>; #phy-cells = <1>; - status = "ok"; }; diff --git a/Bindings/phy/keystone-usb-phy.txt b/Bindings/phy/keystone-usb-phy.txt index f37b3a86341d..300830dda0bf 100644 --- a/Bindings/phy/keystone-usb-phy.txt +++ b/Bindings/phy/keystone-usb-phy.txt @@ -16,5 +16,4 @@ usb_phy: usb_phy@2620738 { #address-cells = <1>; #size-cells = <1>; reg = <0x2620738 32>; - status = "disabled"; }; diff --git a/Bindings/phy/phy-bindings.txt b/Bindings/phy/phy-bindings.txt index 1293c321754c..a403b81d0679 100644 --- a/Bindings/phy/phy-bindings.txt +++ b/Bindings/phy/phy-bindings.txt @@ -34,7 +34,9 @@ PHY user node ============= Required Properties: -phys : the phandle for the PHY device (used by the PHY subsystem) +phys : the phandle for the PHY device (used by the PHY subsystem; not to be + confused with the Ethernet specific 'phy' and 'phy-handle' properties, + see Documentation/devicetree/bindings/net/ethernet.txt for these) phy-names : the names of the PHY corresponding to the PHYs present in the *phys* phandle diff --git a/Bindings/phy/phy-lantiq-rcu-usb2.txt b/Bindings/phy/phy-lantiq-rcu-usb2.txt new file mode 100644 index 000000000000..643948b6b576 --- /dev/null +++ b/Bindings/phy/phy-lantiq-rcu-usb2.txt @@ -0,0 +1,40 @@ +Lantiq XWAY SoC RCU USB 1.1/2.0 PHY binding +=========================================== + +This binding describes the USB PHY hardware provided by the RCU module on the +Lantiq XWAY SoCs. + +This node has to be a sub node of the Lantiq RCU block. + +------------------------------------------------------------------------------- +Required properties (controller (parent) node): +- compatible : Should be one of + "lantiq,ase-usb2-phy" + "lantiq,danube-usb2-phy" + "lantiq,xrx100-usb2-phy" + "lantiq,xrx200-usb2-phy" + "lantiq,xrx300-usb2-phy" +- reg : Defines the following sets of registers in the parent + syscon device + - Offset of the USB PHY configuration register + - Offset of the USB Analog configuration + register (only for xrx200 and xrx200) +- clocks : References to the (PMU) "phy" clk gate. +- clock-names : Must be "phy" +- resets : References to the RCU USB configuration reset bits. +- reset-names : Must be one of the following: + "phy" (optional) + "ctrl" (shared) + +------------------------------------------------------------------------------- +Example for the USB PHYs on an xRX200 SoC: + usb_phy0: usb2-phy@18 { + compatible = "lantiq,xrx200-usb2-phy"; + reg = <0x18 4>, <0x38 4>; + + clocks = <&pmu PMU_GATE_USB0_PHY>; + clock-names = "phy"; + resets = <&reset1 4 4>, <&reset0 4 4>; + reset-names = "phy", "ctrl"; + #phy-cells = <0>; + }; diff --git a/Bindings/phy/phy-mt65xx-usb.txt b/Bindings/phy/phy-mtk-tphy.txt similarity index 88% rename from Bindings/phy/phy-mt65xx-usb.txt rename to Bindings/phy/phy-mtk-tphy.txt index 0acc5a99fb79..41e09ed2ca70 100644 --- a/Bindings/phy/phy-mt65xx-usb.txt +++ b/Bindings/phy/phy-mtk-tphy.txt @@ -1,13 +1,18 @@ -mt65xx USB3.0 PHY binding +MediaTek T-PHY binding -------------------------- -This binding describes a usb3.0 phy for mt65xx platforms of Medaitek SoC. +T-phy controller supports physical layer functionality for a number of +controllers on MediaTek SoCs, such as, USB2.0, USB3.0, PCIe, and SATA. Required properties (controller (parent) node): - compatible : should be one of - "mediatek,mt2701-u3phy" - "mediatek,mt2712-u3phy" - "mediatek,mt8173-u3phy" + "mediatek,generic-tphy-v1" + "mediatek,generic-tphy-v2" + "mediatek,mt2701-u3phy" (deprecated) + "mediatek,mt2712-u3phy" (deprecated) + "mediatek,mt8173-u3phy"; + make use of "mediatek,generic-tphy-v1" on mt2701 instead and + "mediatek,generic-tphy-v2" on mt2712 instead. - clocks : (deprecated, use port's clocks instead) a list of phandle + clock-specifier pairs, one for each entry in clock-names - clock-names : (deprecated, use port's one instead) must contain @@ -35,6 +40,8 @@ Required properties (port (child) node): cell after port phandle is phy type from: - PHY_TYPE_USB2 - PHY_TYPE_USB3 + - PHY_TYPE_PCIE + - PHY_TYPE_SATA Example: @@ -44,14 +51,12 @@ u3phy: usb-phy@11290000 { #address-cells = <2>; #size-cells = <2>; ranges; - status = "okay"; u2port0: usb-phy@11290800 { reg = <0 0x11290800 0 0x100>; clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>; clock-names = "ref"; #phy-cells = <1>; - status = "okay"; }; u3port0: usb-phy@11290900 { @@ -59,7 +64,6 @@ u3phy: usb-phy@11290000 { clocks = <&clk26m>; clock-names = "ref"; #phy-cells = <1>; - status = "okay"; }; u2port1: usb-phy@11291000 { @@ -67,7 +71,6 @@ u3phy: usb-phy@11290000 { clocks = <&apmixedsys CLK_APMIXED_REF2USB_TX>; clock-names = "ref"; #phy-cells = <1>; - status = "okay"; }; }; diff --git a/Bindings/phy/phy-mvebu-comphy.txt b/Bindings/phy/phy-mvebu-comphy.txt new file mode 100644 index 000000000000..bfcf80341657 --- /dev/null +++ b/Bindings/phy/phy-mvebu-comphy.txt @@ -0,0 +1,43 @@ +mvebu comphy driver +------------------- + +A comphy controller can be found on Marvell Armada 7k/8k on the CP110. It +provides a number of shared PHYs used by various interfaces (network, sata, +usb, PCIe...). + +Required properties: + +- compatible: should be "marvell,comphy-cp110" +- reg: should contain the comphy register location and length. +- marvell,system-controller: should contain a phandle to the + system controller node. +- #address-cells: should be 1. +- #size-cells: should be 0. + +A sub-node is required for each comphy lane provided by the comphy. + +Required properties (child nodes): + +- reg: comphy lane number. +- #phy-cells : from the generic phy bindings, must be 1. Defines the + input port to use for a given comphy lane. + +Example: + + cpm_comphy: phy@120000 { + compatible = "marvell,comphy-cp110"; + reg = <0x120000 0x6000>; + marvell,system-controller = <&cpm_syscon0>; + #address-cells = <1>; + #size-cells = <0>; + + cpm_comphy0: phy@0 { + reg = <0>; + #phy-cells = <1>; + }; + + cpm_comphy1: phy@1 { + reg = <1>; + #phy-cells = <1>; + }; + }; diff --git a/Bindings/phy/phy-mvebu.txt b/Bindings/phy/phy-mvebu.txt index f95b6260a3b3..64afdd13d91d 100644 --- a/Bindings/phy/phy-mvebu.txt +++ b/Bindings/phy/phy-mvebu.txt @@ -18,7 +18,6 @@ Example: clocks = <&gate_clk 15>; clock-names = "sata"; #phy-cells = <0>; - status = "ok"; }; Armada 375 USB cluster diff --git a/Bindings/phy/phy-rockchip-inno-usb2.txt b/Bindings/phy/phy-rockchip-inno-usb2.txt index 84d59b0db8df..074a7b3b0425 100644 --- a/Bindings/phy/phy-rockchip-inno-usb2.txt +++ b/Bindings/phy/phy-rockchip-inno-usb2.txt @@ -6,6 +6,7 @@ Required properties (phy (parent) node): * "rockchip,rk3328-usb2phy" * "rockchip,rk3366-usb2phy" * "rockchip,rk3399-usb2phy" + * "rockchip,rv1108-usb2phy" - reg : the address offset of grf for usb-phy configuration. - #clock-cells : should be 0. - clock-output-names : specify the 480m output clock name. @@ -18,6 +19,10 @@ Optional properties: usb-phy output 480m and xin24m. Refer to clk/clock-bindings.txt for generic clock consumer properties. + - rockchip,usbgrf : phandle to the syscon managing the "usb general + register files". When set driver will request its + phandle as one companion-grf for some special SoCs + (e.g RV1108). Required nodes : a sub-node is required for each port the phy provides. The sub-node name is used to identify host or otg port, @@ -28,10 +33,14 @@ Required nodes : a sub-node is required for each port the phy provides. Required properties (port (child) node): - #phy-cells : must be 0. See ./phy-bindings.txt for details. - interrupts : specify an interrupt for each entry in interrupt-names. - - interrupt-names : a list which shall be the following entries: + - interrupt-names : a list which should be one of the following cases: + Regular case: * "otg-id" : for the otg id interrupt. * "otg-bvalid" : for the otg vbus interrupt. * "linestate" : for the host/otg linestate interrupt. + Some SoCs use one interrupt with the above muxed together, so for these + * "otg-mux" : otg-port interrupt, which mux otg-id/otg-bvalid/linestate + to one. Optional properties: - phy-supply : phandle to a regulator that provides power to VBUS. @@ -58,14 +67,12 @@ grf: syscon@ff770000 { , ; interrupt-names = "otg-id", "otg-bvalid", "linestate"; - status = "okay"; }; u2phy_host: host-port { #phy-cells = <0>; interrupts = ; interrupt-names = "linestate"; - status = "okay"; }; }; }; diff --git a/Bindings/phy/qcom-dwc3-usb-phy.txt b/Bindings/phy/qcom-dwc3-usb-phy.txt index 86f2dbe07ed4..a1697c27aecd 100644 --- a/Bindings/phy/qcom-dwc3-usb-phy.txt +++ b/Bindings/phy/qcom-dwc3-usb-phy.txt @@ -25,7 +25,6 @@ Example: clock-names = "ref"; #phy-cells = <0>; - status = "ok"; }; phy@100f8830 { @@ -35,5 +34,4 @@ Example: clock-names = "ref"; #phy-cells = <0>; - status = "ok"; }; diff --git a/Bindings/phy/qcom-qmp-phy.txt b/Bindings/phy/qcom-qmp-phy.txt index e11c563a65ec..b6a9f2b92bab 100644 --- a/Bindings/phy/qcom-qmp-phy.txt +++ b/Bindings/phy/qcom-qmp-phy.txt @@ -6,6 +6,7 @@ controllers on Qualcomm chipsets, such as, PCIe, UFS, and USB. Required properties: - compatible: compatible list, contains: + "qcom,ipq8074-qmp-pcie-phy" for PCIe phy on IPQ8074 "qcom,msm8996-qmp-pcie-phy" for 14nm PCIe phy on msm8996, "qcom,msm8996-qmp-usb3-phy" for 14nm USB3 phy on msm8996. @@ -38,6 +39,8 @@ Required properties: "phy", "common", "cfg". For "qcom,msm8996-qmp-usb3-phy" must contain "phy", "common". + For "qcom,ipq8074-qmp-pcie-phy" must contain: + "phy", "common". - vdda-phy-supply: Phandle to a regulator supply to PHY core block. - vdda-pll-supply: Phandle to 1.8V regulator supply to PHY refclk pll block. @@ -60,6 +63,13 @@ Required properties for child node: one for each entry in clock-names. - clock-names: Must contain following for pcie and usb qmp phys: "pipe" for pipe clock specific to each lane. + - clock-output-names: Name of the PHY clock that will be the parent for + the above pipe clock. + + For "qcom,ipq8074-qmp-pcie-phy": + - "pcie20_phy0_pipe_clk" Pipe Clock parent + (or) + "pcie20_phy1_pipe_clk" - resets: a list of phandles and reset controller specifier pairs, one for each entry in reset-names. @@ -96,6 +106,7 @@ Example: clocks = <&gcc GCC_PCIE_0_PIPE_CLK>; clock-names = "pipe0"; + clock-output-names = "pcie_0_pipe_clk_src"; resets = <&gcc GCC_PCIE_0_PHY_BCR>; reset-names = "lane0"; }; diff --git a/Bindings/phy/ralink-usb-phy.txt b/Bindings/phy/ralink-usb-phy.txt new file mode 100644 index 000000000000..9d2868a437ab --- /dev/null +++ b/Bindings/phy/ralink-usb-phy.txt @@ -0,0 +1,23 @@ +Mediatek/Ralink USB PHY + +Required properties: + - compatible: "ralink,rt3352-usbphy" + "mediatek,mt7620-usbphy" + "mediatek,mt7628-usbphy" + - reg: required for "mediatek,mt7628-usbphy", unused otherwise + - #phy-cells: should be 0 + - ralink,sysctl: a phandle to a ralink syscon register region + - resets: the two reset controllers for host and device + - reset-names: the names of the 2 reset controllers + +Example: + +usbphy: phy { + compatible = "mediatek,mt7628-usbphy"; + reg = <0x10120000 0x1000>; + #phy-cells = <0>; + + ralink,sysctl = <&sysc>; + resets = <&rstctrl 22 &rstctrl 25>; + reset-names = "host", "device"; +}; diff --git a/Bindings/phy/rockchip-pcie-phy.txt b/Bindings/phy/rockchip-pcie-phy.txt index 0f6222a672ce..b496042f1f44 100644 --- a/Bindings/phy/rockchip-pcie-phy.txt +++ b/Bindings/phy/rockchip-pcie-phy.txt @@ -3,7 +3,6 @@ Rockchip PCIE PHY Required properties: - compatible: rockchip,rk3399-pcie-phy - - #phy-cells: must be 0 - clocks: Must contain an entry in clock-names. See ../clocks/clock-bindings.txt for details. - clock-names: Must be "refclk" @@ -11,6 +10,12 @@ Required properties: See ../reset/reset.txt for details. - reset-names: Must be "phy" +Required properties for legacy PHY mode (deprecated): + - #phy-cells: must be 0 + +Required properties for per-lane PHY mode (preferred): + - #phy-cells: must be 1 + Example: grf: syscon@ff770000 { diff --git a/Bindings/phy/samsung-phy.txt b/Bindings/phy/samsung-phy.txt index ab80bfe31cb3..1c40ccd40ce4 100644 --- a/Bindings/phy/samsung-phy.txt +++ b/Bindings/phy/samsung-phy.txt @@ -82,7 +82,6 @@ usbphy: phy@125b0000 { reg = <0x125b0000 0x100>; clocks = <&clock 305>, <&clock 2>; clock-names = "phy", "ref"; - status = "okay"; #phy-cells = <1>; samsung,sysreg-phandle = <&sys_reg>; samsung,pmureg-phandle = <&pmu_reg>; diff --git a/Bindings/phy/sun4i-usb-phy.txt b/Bindings/phy/sun4i-usb-phy.txt index 005bc22938ff..cbc7847dbf6c 100644 --- a/Bindings/phy/sun4i-usb-phy.txt +++ b/Bindings/phy/sun4i-usb-phy.txt @@ -9,6 +9,7 @@ Required properties: * allwinner,sun7i-a20-usb-phy * allwinner,sun8i-a23-usb-phy * allwinner,sun8i-a33-usb-phy + * allwinner,sun8i-a83t-usb-phy * allwinner,sun8i-h3-usb-phy * allwinner,sun8i-v3s-usb-phy * allwinner,sun50i-a64-usb-phy @@ -17,18 +18,22 @@ Required properties: * "phy_ctrl" * "pmu0" for H3, V3s and A64 * "pmu1" - * "pmu2" for sun4i, sun6i or sun7i + * "pmu2" for sun4i, sun6i, sun7i, sun8i-a83t or sun8i-h3 + * "pmu3" for sun8i-h3 - #phy-cells : from the generic phy bindings, must be 1 - clocks : phandle + clock specifier for the phy clocks - clock-names : * "usb_phy" for sun4i, sun5i or sun7i * "usb0_phy", "usb1_phy" and "usb2_phy" for sun6i * "usb0_phy", "usb1_phy" for sun8i + * "usb0_phy", "usb1_phy", "usb2_phy" and "usb2_hsic_12M" for sun8i-a83t + * "usb0_phy", "usb1_phy", "usb2_phy" and "usb3_phy" for sun8i-h3 - resets : a list of phandle + reset specifier pairs - reset-names : * "usb0_reset" * "usb1_reset" - * "usb2_reset" for sun4i, sun6i or sun7i + * "usb2_reset" for sun4i, sun6i, sun7i, sun8i-a83t or sun8i-h3 + * "usb3_reset" for sun8i-h3 Optional properties: - usb0_id_det-gpios : gpio phandle for reading the otg id pin value @@ -37,6 +42,7 @@ Optional properties: - usb0_vbus-supply : regulator phandle for controller usb0 vbus - usb1_vbus-supply : regulator phandle for controller usb1 vbus - usb2_vbus-supply : regulator phandle for controller usb2 vbus +- usb3_vbus-supply : regulator phandle for controller usb3 vbus Example: usbphy: phy@0x01c13400 { diff --git a/Bindings/phy/sun9i-usb-phy.txt b/Bindings/phy/sun9i-usb-phy.txt index 1cca85c709d1..f9853156e311 100644 --- a/Bindings/phy/sun9i-usb-phy.txt +++ b/Bindings/phy/sun9i-usb-phy.txt @@ -33,6 +33,5 @@ Example: clock-names = "hsic_480M", "hsic_12M", "phy"; resets = <&usb_phy_clk 18>, <&usb_phy_clk 19>; reset-names = "hsic", "phy"; - status = "disabled"; #phy-cells = <0>; }; diff --git a/Bindings/pinctrl/atmel,at91-pinctrl.txt b/Bindings/pinctrl/atmel,at91-pinctrl.txt index 590e60378be3..3e23fece99da 100644 --- a/Bindings/pinctrl/atmel,at91-pinctrl.txt +++ b/Bindings/pinctrl/atmel,at91-pinctrl.txt @@ -148,5 +148,4 @@ dbgu: serial@fffff200 { interrupts = <1 4 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; - status = "disabled"; }; diff --git a/Bindings/pinctrl/cortina,gemini-pinctrl.txt b/Bindings/pinctrl/cortina,gemini-pinctrl.txt new file mode 100644 index 000000000000..61466c58faae --- /dev/null +++ b/Bindings/pinctrl/cortina,gemini-pinctrl.txt @@ -0,0 +1,59 @@ +Cortina Systems Gemini pin controller + +This pin controller is found in the Cortina Systems Gemini SoC family, +see further arm/gemini.txt. It is a purely group-based multiplexing pin +controller. + +The pin controller node must be a subnode of the system controller node. + +Required properties: +- compatible: "cortina,gemini-pinctrl" + +Subnodes of the pin controller contain pin control multiplexing set-up. +Please refer to pinctrl-bindings.txt for generic pin multiplexing nodes. + +Example: + + +syscon { + compatible = "cortina,gemini-syscon"; + ... + pinctrl { + compatible = "cortina,gemini-pinctrl"; + pinctrl-names = "default"; + pinctrl-0 = <&dram_default_pins>, <&system_default_pins>, + <&vcontrol_default_pins>; + + dram_default_pins: pinctrl-dram { + mux { + function = "dram"; + groups = "dramgrp"; + }; + }; + rtc_default_pins: pinctrl-rtc { + mux { + function = "rtc"; + groups = "rtcgrp"; + }; + }; + power_default_pins: pinctrl-power { + mux { + function = "power"; + groups = "powergrp"; + }; + }; + system_default_pins: pinctrl-system { + mux { + function = "system"; + groups = "systemgrp"; + }; + }; + (...) + uart_default_pins: pinctrl-uart { + mux { + function = "uart"; + groups = "uartrxtxgrp"; + }; + }; + }; +}; diff --git a/Bindings/pinctrl/fsl,imx-pinctrl.txt b/Bindings/pinctrl/fsl,imx-pinctrl.txt index 9fde25f1401a..42d74f8a1bcc 100644 --- a/Bindings/pinctrl/fsl,imx-pinctrl.txt +++ b/Bindings/pinctrl/fsl,imx-pinctrl.txt @@ -61,7 +61,6 @@ Examples: usdhc@0219c000 { /* uSDHC4 */ non-removable; vmmc-supply = <®_3p3v>; - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usdhc4_1>; }; diff --git a/Bindings/pinctrl/fsl,imx7d-pinctrl.txt b/Bindings/pinctrl/fsl,imx7d-pinctrl.txt index 8c5d27c5b562..6666277c3acb 100644 --- a/Bindings/pinctrl/fsl,imx7d-pinctrl.txt +++ b/Bindings/pinctrl/fsl,imx7d-pinctrl.txt @@ -61,7 +61,6 @@ iomuxc-lpsr controller and SDA pad from iomuxc controller as: i2c1: i2c@30a20000 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1_1 &pinctrl_i2c1_2>; - status = "okay"; }; iomuxc-lpsr@302c0000 { diff --git a/Bindings/pinctrl/fsl,imx7ulp-pinctrl.txt b/Bindings/pinctrl/fsl,imx7ulp-pinctrl.txt new file mode 100644 index 000000000000..44ad670ae11e --- /dev/null +++ b/Bindings/pinctrl/fsl,imx7ulp-pinctrl.txt @@ -0,0 +1,61 @@ +* Freescale i.MX7ULP IOMUX Controller + +i.MX 7ULP has three IOMUXC instances: IOMUXC0 for M4 ports, IOMUXC1 for A7 +ports and IOMUXC DDR for DDR interface. + +Note: +This binding doc is only for the IOMUXC1 support in A7 Domain and it only +supports generic pin config. + +Please also refer pinctrl-bindings.txt in this directory for generic pinctrl +binding. + +=== Pin Controller Node === + +Required properties: +- compatible: "fsl,imx7ulp-iomuxc1" +- reg: Should contain the base physical address and size of the iomuxc + registers. + +=== Pin Configuration Node === +- pinmux: One integers array, represents a group of pins mux setting. + The format is pinmux = , PIN_FUNC_ID is a pin working on + a specific function. + + NOTE: i.MX7ULP PIN_FUNC_ID consists of 4 integers as it shares one mux + and config register as follows: + + + Refer to imx7ulp-pinfunc.h in in device tree source folder for all + available imx7ulp PIN_FUNC_ID. + +Optional Properties: +- drive-strength Integer. Controls Drive Strength + 0: Standard + 1: Hi Driver +- drive-push-pull Bool. Enable Pin Push-pull +- drive-open-drain Bool. Enable Pin Open-drian +- slew-rate: Integer. Controls Slew Rate + 0: Standard + 1: Slow +- bias-disable: Bool. Pull disabled +- bias-pull-down: Bool. Pull down on pin +- bias-pull-up: Bool. Pull up on pin + +Examples: +#include "imx7ulp-pinfunc.h" + +/* Pin Controller Node */ +iomuxc1: iomuxc@40ac0000 { + compatible = "fsl,imx7ulp-iomuxc1"; + reg = <0x40ac0000 0x1000>; + + /* Pin Configuration Node */ + pinctrl_lpuart4: lpuart4grp { + pinmux = < + IMX7ULP_PAD_PTC3__LPUART4_RX + IMX7ULP_PAD_PTC2__LPUART4_TX + >; + bias-pull-up; + }; +}; diff --git a/Bindings/pinctrl/nvidia,tegra124-dpaux-padctl.txt b/Bindings/pinctrl/nvidia,tegra124-dpaux-padctl.txt index f2abdaee9022..e0e886b73527 100644 --- a/Bindings/pinctrl/nvidia,tegra124-dpaux-padctl.txt +++ b/Bindings/pinctrl/nvidia,tegra124-dpaux-padctl.txt @@ -56,5 +56,4 @@ Example: pinctrl-0 = <&state_dpaux_i2c>; pinctrl-1 = <&state_dpaux_off>; pinctrl-names = "default", "idle"; - status = "disabled"; }; diff --git a/Bindings/pinctrl/oxnas,pinctrl.txt b/Bindings/pinctrl/oxnas,pinctrl.txt index 09e81a95bbfd..b1159434f593 100644 --- a/Bindings/pinctrl/oxnas,pinctrl.txt +++ b/Bindings/pinctrl/oxnas,pinctrl.txt @@ -50,7 +50,6 @@ uart2: serial@900000 { reg-io-width = <1>; current-speed = <115200>; no-loopback-test; - status = "disabled"; resets = <&reset 22>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart2>; diff --git a/Bindings/pinctrl/pinctrl-aspeed.txt b/Bindings/pinctrl/pinctrl-aspeed.txt index ca01710ee29a..3b7266c7c438 100644 --- a/Bindings/pinctrl/pinctrl-aspeed.txt +++ b/Bindings/pinctrl/pinctrl-aspeed.txt @@ -69,8 +69,9 @@ PWM1 PWM2 PWM3 PWM4 PWM5 PWM6 PWM7 RGMII1 RGMII2 RMII1 RMII2 ROM16 ROM8 ROMCS1 ROMCS2 ROMCS3 ROMCS4 RXD1 RXD2 RXD3 RXD4 SALT1 SALT2 SALT3 SALT4 SD1 SD2 SGPMCK SGPMI SGPMLD SGPMO SGPSCK SGPSI0 SGPSI1 SGPSLD SIOONCTRL SIOPBI SIOPBO SIOPWREQ SIOPWRGD SIOS3 SIOS5 SIOSCI SPI1 SPI1DEBUG SPI1PASSTHRU SPICS1 TIMER3 TIMER4 -TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD2 TXD3 TXD4 UART6 USBCKI VGABIOS_ROM VGAHS -VGAVS VPI18 VPI24 VPI30 VPO12 VPO24 WDTRST1 WDTRST2 +TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD2 TXD3 TXD4 UART6 USB11D1 USB11H2 USB2D1 +USB2H1 USBCKI VGABIOS_ROM VGAHS VGAVS VPI18 VPI24 VPI30 VPO12 VPO24 WDTRST1 +WDTRST2 aspeed,ast2500-pinctrl, aspeed,g5-pinctrl: @@ -86,7 +87,8 @@ SALT11 SALT12 SALT13 SALT14 SALT2 SALT3 SALT4 SALT5 SALT6 SALT7 SALT8 SALT9 SCL1 SCL2 SD1 SD2 SDA1 SDA2 SGPS1 SGPS2 SIOONCTRL SIOPBI SIOPBO SIOPWREQ SIOPWRGD SIOS3 SIOS5 SIOSCI SPI1 SPI1CS1 SPI1DEBUG SPI1PASSTHRU SPI2CK SPI2CS0 SPI2CS1 SPI2MISO SPI2MOSI TIMER3 TIMER4 TIMER5 TIMER6 TIMER7 TIMER8 TXD1 TXD2 -TXD3 TXD4 UART6 USBCKI VGABIOSROM VGAHS VGAVS VPI24 VPO WDTRST1 WDTRST2 +TXD3 TXD4 UART6 USB11BHID USB2AD USB2AH USB2BD USB2BH USBCKI VGABIOSROM VGAHS +VGAVS VPI24 VPO WDTRST1 WDTRST2 Examples ======== diff --git a/Bindings/pinctrl/pinctrl-bindings.txt b/Bindings/pinctrl/pinctrl-bindings.txt index 62d0f33fa65e..4483cc31e531 100644 --- a/Bindings/pinctrl/pinctrl-bindings.txt +++ b/Bindings/pinctrl/pinctrl-bindings.txt @@ -268,6 +268,8 @@ output-enable - enable output on a pin without actively driving it (such as enabling an output buffer) output-low - set the pin to output mode with low level output-high - set the pin to output mode with high level +sleep-hardware-state - indicate this is sleep related state which will be programmed + into the registers for the sleep state. slew-rate - set the slew rate For example: diff --git a/Bindings/pinctrl/pinctrl-mt65xx.txt b/Bindings/pinctrl/pinctrl-mt65xx.txt index 17631d0a9af7..37d744750579 100644 --- a/Bindings/pinctrl/pinctrl-mt65xx.txt +++ b/Bindings/pinctrl/pinctrl-mt65xx.txt @@ -5,6 +5,7 @@ The Mediatek's Pin controller is used to control SoC pins. Required properties: - compatible: value should be one of the following. "mediatek,mt2701-pinctrl", compatible with mt2701 pinctrl. + "mediatek,mt2712-pinctrl", compatible with mt2712 pinctrl. "mediatek,mt6397-pinctrl", compatible with mt6397 pinctrl. "mediatek,mt7623-pinctrl", compatible with mt7623 pinctrl. "mediatek,mt8127-pinctrl", compatible with mt8127 pinctrl. diff --git a/Bindings/pinctrl/pinctrl-rk805.txt b/Bindings/pinctrl/pinctrl-rk805.txt new file mode 100644 index 000000000000..eee3dc260934 --- /dev/null +++ b/Bindings/pinctrl/pinctrl-rk805.txt @@ -0,0 +1,63 @@ +Pincontrol driver for RK805 Power management IC. + +RK805 has 2 pins which can be configured as GPIO output only. + +Please refer file +for details of the common pinctrl bindings used by client devices, +including the meaning of the phrase "pin configuration node". + +Optional Pinmux properties: +-------------------------- +Following properties are required if default setting of pins are required +at boot. +- pinctrl-names: A pinctrl state named per . +- pinctrl[0...n]: Properties to contain the phandle for pinctrl states per + . + +The pin configurations are defined as child of the pinctrl states node. Each +sub-node have following properties: + +Required properties: +------------------ +- #gpio-cells: Should be two. The first cell is the pin number and the + second is the GPIO flags. + +- gpio-controller: Marks the device node as a GPIO controller. + +- pins: List of pins. Valid values of pins properties are: gpio0, gpio1. + +First 2 properties must be added in the RK805 PMIC node, documented in +Documentation/devicetree/bindings/mfd/rk808.txt + +Optional properties: +------------------- +Following are optional properties defined as pinmux DT binding document +. Absence of properties will leave the configuration +on default. + function, + output-low, + output-high. + +Valid values for function properties are: gpio. + +Theres is also not customised properties for any GPIO. + +Example: +-------- +rk805: rk805@18 { + compatible = "rockchip,rk805"; + ... + gpio-controller; + #gpio-cells = <2>; + + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>, <&rk805_default>; + + rk805_default: pinmux { + gpio01 { + pins = "gpio0", "gpio1"; + function = "gpio"; + output-high; + }; + }; +}; diff --git a/Bindings/pinctrl/pinctrl-zx.txt b/Bindings/pinctrl/pinctrl-zx.txt index e219849b21ca..39170f372599 100644 --- a/Bindings/pinctrl/pinctrl-zx.txt +++ b/Bindings/pinctrl/pinctrl-zx.txt @@ -81,5 +81,4 @@ pmm: pin-controller@1462000 { &vga { pinctrl-names = "default"; pinctrl-0 = <&vga_pins>; - status = "okay"; }; diff --git a/Bindings/pinctrl/qcom,apq8064-pinctrl.txt b/Bindings/pinctrl/qcom,apq8064-pinctrl.txt index a7bde64798c7..a752a4716486 100644 --- a/Bindings/pinctrl/qcom,apq8064-pinctrl.txt +++ b/Bindings/pinctrl/qcom,apq8064-pinctrl.txt @@ -46,7 +46,8 @@ Valid values for pins are: gpio0-gpio89 Valid values for function are: - cam_mclk, codec_mic_i2s, codec_spkr_i2s, gpio, gsbi1, gsbi2, gsbi3, gsbi4, + cam_mclk, codec_mic_i2s, codec_spkr_i2s, gp_clk_0a, gp_clk_0b, gp_clk_1a, + gp_clk_1b, gp_clk_2a, gp_clk_2b, gpio, gsbi1, gsbi2, gsbi3, gsbi4, gsbi4_cam_i2c, gsbi5, gsbi5_spi_cs1, gsbi5_spi_cs2, gsbi5_spi_cs3, gsbi6, gsbi6_spi_cs1, gsbi6_spi_cs2, gsbi6_spi_cs3, gsbi7, gsbi7_spi_cs1, gsbi7_spi_cs2, gsbi7_spi_cs3, gsbi_cam_i2c, hdmi, mi2s, riva_bt, riva_fm, diff --git a/Bindings/pinctrl/qcom,ipq4019-pinctrl.txt b/Bindings/pinctrl/qcom,ipq4019-pinctrl.txt index cfb8500dd56b..93374f478b9e 100644 --- a/Bindings/pinctrl/qcom,ipq4019-pinctrl.txt +++ b/Bindings/pinctrl/qcom,ipq4019-pinctrl.txt @@ -50,7 +50,11 @@ Valid values for qcom,pins are: Supports mux, bias and drive-strength Valid values for qcom,function are: -gpio, blsp_uart1, blsp_i2c0, blsp_i2c1, blsp_uart0, blsp_spi1, blsp_spi0 +aud_pin, audio_pwm, blsp_i2c0, blsp_i2c1, blsp_spi0, blsp_spi1, blsp_uart0, +blsp_uart1, chip_rst, gpio, i2s_rx, i2s_spdif_in, i2s_spdif_out, i2s_td, i2s_tx, +jtag, led0, led1, led2, led3, led4, led5, led6, led7, led8, led9, led10, led11, +mdc, mdio, pcie, pmu, prng_rosc, qpic, rgmii, rmii, sdio, smart0, smart1, +smart2, smart3, tm, wifi0, wifi1 Example: diff --git a/Bindings/pinctrl/qcom,pmic-gpio.txt b/Bindings/pinctrl/qcom,pmic-gpio.txt index 8d893a874634..5b12c57e7f02 100644 --- a/Bindings/pinctrl/qcom,pmic-gpio.txt +++ b/Bindings/pinctrl/qcom,pmic-gpio.txt @@ -16,6 +16,7 @@ PMIC's from Qualcomm. "qcom,pm8941-gpio" "qcom,pm8994-gpio" "qcom,pma8084-gpio" + "qcom,pmi8994-gpio" And must contain either "qcom,spmi-gpio" or "qcom,ssbi-gpio" if the device is on an spmi bus or an ssbi bus respectively @@ -85,6 +86,7 @@ to specify in a pin configuration subnode: gpio1-gpio36 for pm8941 gpio1-gpio22 for pm8994 gpio1-gpio22 for pma8084 + gpio1-gpio10 for pmi8994 - function: Usage: required @@ -98,7 +100,10 @@ to specify in a pin configuration subnode: "dtest1", "dtest2", "dtest3", - "dtest4" + "dtest4", + And following values are supported by LV/MV GPIO subtypes: + "func3", + "func4" - bias-disable: Usage: optional @@ -183,6 +188,25 @@ to specify in a pin configuration subnode: Value type: Definition: The specified pins are configured in open-source mode. +- qcom,analog-pass: + Usage: optional + Value type: + Definition: The specified pins are configured in analog-pass-through mode. + +- qcom,atest: + Usage: optional + Value type: + Definition: Selects ATEST rail to route to GPIO when it's configured + in analog-pass-through mode. + Valid values are 1-4 corresponding to ATEST1 to ATEST4. + +- qcom,dtest-buffer: + Usage: optional + Value type: + Definition: Selects DTEST rail to route to GPIO when it's configured + as digital input. + Valid values are 1-4 corresponding to DTEST1 to DTEST4. + Example: pm8921_gpio: gpio@150 { diff --git a/Bindings/pinctrl/renesas,pfc-pinctrl.txt b/Bindings/pinctrl/renesas,pfc-pinctrl.txt index 645082f03259..9b4f8041c36a 100644 --- a/Bindings/pinctrl/renesas,pfc-pinctrl.txt +++ b/Bindings/pinctrl/renesas,pfc-pinctrl.txt @@ -24,6 +24,7 @@ Required Properties: - "renesas,pfc-r8a7794": for R8A7794 (R-Car E2) compatible pin-controller. - "renesas,pfc-r8a7795": for R8A7795 (R-Car H3) compatible pin-controller. - "renesas,pfc-r8a7796": for R8A7796 (R-Car M3-W) compatible pin-controller. + - "renesas,pfc-r8a77995": for R8A77995 (R-Car D3) compatible pin-controller. - "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller. - reg: Base address and length of each memory resource used by the pin @@ -111,7 +112,7 @@ Examples Example 1: SH73A0 (SH-Mobile AG5) pin controller node - pfc: pfc@e6050000 { + pfc: pin-controller@e6050000 { compatible = "renesas,pfc-sh73a0"; reg = <0xe6050000 0x8000>, <0xe605801c 0x1c>; @@ -172,5 +173,4 @@ Example 4: KZM-A9-GT (SH-Mobile AG5) default pin state for the MMCIF device bus-width = <8>; vmmc-supply = <®_1p8v>; - status = "okay"; }; diff --git a/Bindings/pinctrl/rockchip,pinctrl.txt b/Bindings/pinctrl/rockchip,pinctrl.txt index ee01ab58224d..4864e3a74de3 100644 --- a/Bindings/pinctrl/rockchip,pinctrl.txt +++ b/Bindings/pinctrl/rockchip,pinctrl.txt @@ -24,6 +24,7 @@ Required properties for iomux controller: "rockchip,rk2928-pinctrl": for Rockchip RK2928 "rockchip,rk3066a-pinctrl": for Rockchip RK3066a "rockchip,rk3066b-pinctrl": for Rockchip RK3066b + "rockchip,rk3128-pinctrl": for Rockchip RK3128 "rockchip,rk3188-pinctrl": for Rockchip RK3188 "rockchip,rk3228-pinctrl": for Rockchip RK3228 "rockchip,rk3288-pinctrl": for Rockchip RK3288 @@ -120,7 +121,6 @@ uart2: serial@20064000 { reg-shift = <2>; reg-io-width = <1>; clocks = <&mux_uart2>; - status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&uart2_xfer>; diff --git a/Bindings/pinctrl/sprd,pinctrl.txt b/Bindings/pinctrl/sprd,pinctrl.txt new file mode 100644 index 000000000000..b1cea7a3a071 --- /dev/null +++ b/Bindings/pinctrl/sprd,pinctrl.txt @@ -0,0 +1,83 @@ +* Spreadtrum Pin Controller + +The Spreadtrum pin controller are organized in 3 blocks (types). + +The first block comprises some global control registers, and each +register contains several bit fields with one bit or several bits +to configure for some global common configuration, such as domain +pad driving level, system control select and so on ("domain pad +driving level": One pin can output 3.0v or 1.8v, depending on the +related domain pad driving selection, if the related domain pad +slect 3.0v, then the pin can output 3.0v. "system control" is used +to choose one function (like: UART0) for which system, since we +have several systems (AP/CP/CM4) on one SoC.). + +There are too much various configuration that we can not list all +of them, so we can not make every Spreadtrum-special configuration +as one generic configuration, and maybe it will add more strange +global configuration in future. Then we add one "sprd,control" to +set these various global control configuration, and we need use +magic number for this property. + +Moreover we recognise every fields comprising one bit or several +bits in one global control register as one pin, thus we should +record every pin's bit offset, bit width and register offset to +configure this field (pin). + +The second block comprises some common registers which have unified +register definition, and each register described one pin is used +to configure the pin sleep mode, function select and sleep related +configuration. + +Now we have 4 systems for sleep mode on SC9860 SoC: AP system, +PUBCP system, TGLDSP system and AGDSP system. And the pin sleep +related configuration are: +- input-enable +- input-disable +- output-high +- output-low +- bias-pull-up +- bias-pull-down + +In some situation we need set the pin sleep mode and pin sleep related +configuration, to set the pin sleep related configuration automatically +by hardware when the system specified by sleep mode goes into deep +sleep mode. For example, if we set the pin sleep mode as PUBCP_SLEEP +and set the pin sleep related configuration as "input-enable", which +means when PUBCP system goes into deep sleep mode, this pin will be set +input enable automatically. + +Moreover we can not use the "sleep" state, since some systems (like: +PUBCP system) do not run linux kernel OS (only AP system run linux +kernel on SC9860 platform), then we can not select "sleep" state +when the PUBCP system goes into deep sleep mode. Thus we introduce +"sprd,sleep-mode" property to set pin sleep mode. + +The last block comprises some misc registers which also have unified +register definition, and each register described one pin is used to +configure drive strength, pull up/down and so on. Especially for pull +up, we have two kind pull up resistor: 20K and 4.7K. + +Required properties for Spreadtrum pin controller: +- compatible: "sprd,-pinctrl" + Please refer to each sprd,-pinctrl.txt binding doc for supported SoCs. +- reg: The register address of pin controller device. +- pins : An array of pin names. + +Optional properties: +- function: Specified the function name. +- drive-strength: Drive strength in mA. +- input-schmitt-disable: Enable schmitt-trigger mode. +- input-schmitt-enable: Disable schmitt-trigger mode. +- bias-disable: Disable pin bias. +- bias-pull-down: Pull down on pin. +- bias-pull-up: Pull up on pin. +- input-enable: Enable pin input. +- input-disable: Enable pin output. +- output-high: Set the pin as an output level high. +- output-low: Set the pin as an output level low. +- sleep-hardware-state: Indicate these configs in this state are sleep related. +- sprd,control: Control values referring to databook for global control pins. +- sprd,sleep-mode: Sleep mode selection. + +Please refer to each sprd,-pinctrl.txt binding doc for supported values. diff --git a/Bindings/pinctrl/sprd,sc9860-pinctrl.txt b/Bindings/pinctrl/sprd,sc9860-pinctrl.txt new file mode 100644 index 000000000000..5a628333d52f --- /dev/null +++ b/Bindings/pinctrl/sprd,sc9860-pinctrl.txt @@ -0,0 +1,70 @@ +* Spreadtrum SC9860 Pin Controller + +Please refer to sprd,pinctrl.txt in this directory for common binding part +and usage. + +Required properties: +- compatible: Must be "sprd,sc9860-pinctrl". +- reg: The register address of pin controller device. +- pins : An array of strings, each string containing the name of a pin. + +Optional properties: +- function: A string containing the name of the function, values must be + one of: "func1", "func2", "func3" and "func4". +- drive-strength: Drive strength in mA. Supported values: 2, 4, 6, 8, 10, + 12, 14, 16, 20, 21, 24, 25, 27, 29, 31 and 33. +- input-schmitt-disable: Enable schmitt-trigger mode. +- input-schmitt-enable: Disable schmitt-trigger mode. +- bias-disable: Disable pin bias. +- bias-pull-down: Pull down on pin. +- bias-pull-up: Pull up on pin. Supported values: 20000 for pull-up resistor + is 20K and 4700 for pull-up resistor is 4.7K. +- input-enable: Enable pin input. +- input-disable: Enable pin output. +- output-high: Set the pin as an output level high. +- output-low: Set the pin as an output level low. +- sleep-hardware-state: Indicate these configs in this state are sleep related. +- sprd,control: Control values referring to databook for global control pins. +- sprd,sleep-mode: Choose the pin sleep mode, and supported values are: + AP_SLEEP, PUBCP_SLEEP, TGLDSP_SLEEP and AGDSP_SLEEP. + +Pin sleep mode definition: +enum pin_sleep_mode { + AP_SLEEP = BIT(0), + PUBCP_SLEEP = BIT(1), + TGLDSP_SLEEP = BIT(2), + AGDSP_SLEEP = BIT(3), +}; + +Example: +pin_controller: pinctrl@402a0000 { + compatible = "sprd,sc9860-pinctrl"; + reg = <0x402a0000 0x10000>; + + grp1: sd0 { + pins = "SC9860_VIO_SD2_IRTE", "SC9860_VIO_SD0_IRTE"; + sprd,control = <0x1>; + }; + + grp2: rfctl_33 { + pins = "SC9860_RFCTL33"; + function = "func2"; + sprd,sleep-mode = ; + grp2_sleep_mode: rfctl_33_sleep { + pins = "SC9860_RFCTL33"; + sleep-hardware-state; + output-low; + } + }; + + grp3: rfctl_misc_20 { + pins = "SC9860_RFCTL20_MISC"; + drive-strength = <10>; + bias-pull-up = <4700>; + grp3_sleep_mode: rfctl_misc_sleep { + pins = "SC9860_RFCTL20_MISC"; + sleep-hardware-state; + bias-pull-up; + } + }; +}; diff --git a/Bindings/pinctrl/st,stm32-pinctrl.txt b/Bindings/pinctrl/st,stm32-pinctrl.txt index d907a74f8dc0..33e3d3c47552 100644 --- a/Bindings/pinctrl/st,stm32-pinctrl.txt +++ b/Bindings/pinctrl/st,stm32-pinctrl.txt @@ -180,5 +180,4 @@ pin-controller { &usart1 { pinctrl-0 = <&usart1_pins_a>; pinctrl-names = "default"; - status = "okay"; }; diff --git a/Bindings/power/power-controller.txt b/Bindings/power/power-controller.txt index 4f7a3bc9c407..e45affea8078 100644 --- a/Bindings/power/power-controller.txt +++ b/Bindings/power/power-controller.txt @@ -13,6 +13,5 @@ Example: act8846: act8846@5 { compatible = "active-semi,act8846"; - status = "okay"; system-power-controller; } diff --git a/Bindings/power/renesas,apmu.txt b/Bindings/power/renesas,apmu.txt index 84404c9edff7..af21502e939c 100644 --- a/Bindings/power/renesas,apmu.txt +++ b/Bindings/power/renesas,apmu.txt @@ -1,12 +1,13 @@ DT bindings for the Renesas Advanced Power Management Unit -Renesas R-Car line of SoCs utilize one or more APMU hardware units +Renesas R-Car and RZ/G1 SoCs utilize one or more APMU hardware units for CPU core power domain control including SMP boot and CPU Hotplug. Required properties: - compatible: Should be "renesas,-apmu", "renesas,apmu" as fallback. Examples with soctypes are: + - "renesas,r8a7743-apmu" (RZ/G1M) - "renesas,r8a7790-apmu" (R-Car H2) - "renesas,r8a7791-apmu" (R-Car M2-W) - "renesas,r8a7792-apmu" (R-Car V2H) diff --git a/Bindings/power/renesas,rcar-sysc.txt b/Bindings/power/renesas,rcar-sysc.txt index d91715bc8d52..98cc8c09d02d 100644 --- a/Bindings/power/renesas,rcar-sysc.txt +++ b/Bindings/power/renesas,rcar-sysc.txt @@ -17,6 +17,7 @@ Required properties: - "renesas,r8a7794-sysc" (R-Car E2) - "renesas,r8a7795-sysc" (R-Car H3) - "renesas,r8a7796-sysc" (R-Car M3-W) + - "renesas,r8a77995-sysc" (R-Car D3) - reg: Address start and address range for the device. - #power-domain-cells: Must be 1. diff --git a/Bindings/power/reset/st-reset.txt b/Bindings/power/reset/st-reset.txt index 83734dc3a389..b63948737d80 100644 --- a/Bindings/power/reset/st-reset.txt +++ b/Bindings/power/reset/st-reset.txt @@ -8,5 +8,4 @@ Example node: restart { compatible = "st,stih407-restart"; st,syscfg = <&syscfg_sbc_reg>; - status = "okay"; }; diff --git a/Bindings/power/rockchip-io-domain.txt b/Bindings/power/rockchip-io-domain.txt index 43c21fb04564..4a4766e9c254 100644 --- a/Bindings/power/rockchip-io-domain.txt +++ b/Bindings/power/rockchip-io-domain.txt @@ -39,6 +39,8 @@ Required properties: - "rockchip,rk3368-pmu-io-voltage-domain" for rk3368 pmu-domains - "rockchip,rk3399-io-voltage-domain" for rk3399 - "rockchip,rk3399-pmu-io-voltage-domain" for rk3399 pmu-domains + - "rockchip,rv1108-io-voltage-domain" for rv1108 + - "rockchip,rv1108-pmu-io-voltage-domain" for rv1108 pmu-domains Deprecated properties: - rockchip,grf: phandle to the syscon managing the "general register files" diff --git a/Bindings/power/supply/act8945a-charger.txt b/Bindings/power/supply/act8945a-charger.txt index de78d761ce44..b86ecada4f84 100644 --- a/Bindings/power/supply/act8945a-charger.txt +++ b/Bindings/power/supply/act8945a-charger.txt @@ -29,7 +29,6 @@ Example: pmic@5b { compatible = "active-semi,act8945a"; reg = <0x5b>; - status = "okay"; charger { compatible = "active-semi,act8945a-charger"; @@ -43,6 +42,5 @@ Example: active-semi,input-voltage-threshold-microvolt = <6600>; active-semi,precondition-timeout = <40>; active-semi,total-timeout = <3>; - status = "okay"; }; }; diff --git a/Bindings/power/supply/bq24190.txt b/Bindings/power/supply/bq24190.txt new file mode 100644 index 000000000000..9e517d307070 --- /dev/null +++ b/Bindings/power/supply/bq24190.txt @@ -0,0 +1,51 @@ +TI BQ24190 Li-Ion Battery Charger + +Required properties: +- compatible: contains one of the following: + * "ti,bq24190" + * "ti,bq24192i" +- reg: integer, I2C address of the charger. +- interrupts[-extended]: configuration for charger INT pin. + +Optional properties: +- monitored-battery: phandle of battery characteristics devicetree node + The charger uses the following battery properties: + + precharge-current-microamp: maximum charge current during precharge + phase (typically 20% of battery capacity). + + charge-term-current-microamp: a charge cycle terminates when the + battery voltage is above recharge threshold, and the current is below + this setting (typically 10% of battery capacity). + See also Documentation/devicetree/bindings/power/supply/battery.txt +- ti,system-minimum-microvolt: when power is connected and the battery is below + minimum system voltage, the system will be regulated above this setting. + +Notes: +- Some circuit boards wire the chip's "OTG" pin high (enabling 500mA default + charge current on USB SDP ports, among other features). To simulate this on + boards that wire the pin to a GPIO, set a gpio-hog. + +Example: + + bat: battery { + compatible = "simple-battery"; + precharge-current-microamp = <256000>; + charge-term-current-microamp = <128000>; + // etc. + }; + + bq24190: charger@6a { + compatible = "ti,bq24190"; + reg = <0x6a>; + interrupts-extended = <&gpiochip 10 IRQ_TYPE_EDGE_FALLING>; + monitored-battery = <&bat>; + ti,system-minimum-microvolt = <3200000>; + }; + + &twl_gpio { + otg { + gpio-hog; + gpios = <6 0>; + output-high; + line-name = "otg-gpio"; + }; + }; diff --git a/Bindings/power/supply/ltc2941.txt b/Bindings/power/supply/ltc2941.txt index a9d7aa60558b..3b9ba147b041 100644 --- a/Bindings/power/supply/ltc2941.txt +++ b/Bindings/power/supply/ltc2941.txt @@ -1,13 +1,14 @@ -binding for LTC2941 and LTC2943 battery gauges +binding for LTC2941, LTC2942, LTC2943 and LTC2944 battery gauges -Both the LTC2941 and LTC2943 measure battery capacity. -The LTC2943 is compatible with the LTC2941, it adds voltage and -temperature monitoring, and uses a slightly different conversion -formula for the charge counter. +All chips measure battery capacity. +The LTC2942 is pin compatible with the LTC2941, it adds voltage and +temperature monitoring, and is runtime detected. LTC2943 and LTC2944 +is software compatible, uses a slightly different conversion formula +for the charge counter and adds voltage, current and temperature monitoring. Required properties: -- compatible: Should contain "lltc,ltc2941" or "lltc,ltc2943" which also - indicates the type of I2C chip attached. +- compatible: Should contain "lltc,ltc2941", "lltc,ltc2942", "lltc,ltc2943" + or "lltc,ltc2944" which also indicates the type of I2C chip attached. - reg: The 7-bit I2C address. - lltc,resistor-sense: The sense resistor value in milli-ohms. Can be a 32-bit negative value when the battery has been connected to the wrong end of the diff --git a/Bindings/power/supply/max8903-charger.txt b/Bindings/power/supply/max8903-charger.txt index f0f4e12b076e..bab947fef025 100644 --- a/Bindings/power/supply/max8903-charger.txt +++ b/Bindings/power/supply/max8903-charger.txt @@ -21,5 +21,4 @@ Example: flt-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; chg-gpios = <&gpio3 15 GPIO_ACTIVE_LOW>; cen-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; - status = "okay"; }; diff --git a/Bindings/power/supply/maxim,max14656.txt b/Bindings/power/supply/maxim,max14656.txt index e03e85ae6572..d6e8dfd0a581 100644 --- a/Bindings/power/supply/maxim,max14656.txt +++ b/Bindings/power/supply/maxim,max14656.txt @@ -12,7 +12,6 @@ Example: clock-frequency = <50000>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c2>; - status = "okay"; max14656@35 { compatible = "maxim,max14656"; diff --git a/Bindings/power/wakeup-source.txt b/Bindings/power/wakeup-source.txt index 963c6dfd484d..3c81f78b5c27 100644 --- a/Bindings/power/wakeup-source.txt +++ b/Bindings/power/wakeup-source.txt @@ -20,13 +20,12 @@ List of legacy properties and respective binding document 1. "enable-sdio-wakeup" Documentation/devicetree/bindings/mmc/mmc.txt 2. "gpio-key,wakeup" Documentation/devicetree/bindings/input/gpio-keys{,-polled}.txt 3. "has-tpo" Documentation/devicetree/bindings/rtc/rtc-opal.txt -4. "isil,irq2-can-wakeup-machine" Documentation/devicetree/bindings/rtc/isil,isl12057.txt -5. "linux,wakeup" Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt +4. "linux,wakeup" Documentation/devicetree/bindings/input/gpio-matrix-keypad.txt Documentation/devicetree/bindings/mfd/tc3589x.txt Documentation/devicetree/bindings/input/ads7846.txt -6. "linux,keypad-wakeup" Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt -7. "linux,input-wakeup" Documentation/devicetree/bindings/input/samsung-keypad.txt -8. "nvidia,wakeup-source" Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt +5. "linux,keypad-wakeup" Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt +6. "linux,input-wakeup" Documentation/devicetree/bindings/input/samsung-keypad.txt +7. "nvidia,wakeup-source" Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt Examples -------- diff --git a/Bindings/powerpc/ibm,vas.txt b/Bindings/powerpc/ibm,vas.txt new file mode 100644 index 000000000000..bf11d2faf7b8 --- /dev/null +++ b/Bindings/powerpc/ibm,vas.txt @@ -0,0 +1,22 @@ +* IBM Powerpc Virtual Accelerator Switchboard (VAS) + +VAS is a hardware mechanism that allows kernel subsystems and user processes +to directly submit compression and other requests to Nest accelerators (NX) +or other coprocessors functions. + +Required properties: +- compatible : should be "ibm,vas". +- ibm,vas-id : A unique identifier for each instance of VAS in the system +- reg : Should contain 4 pairs of 64-bit fields specifying the Hypervisor + window context start and length, OS/User window context start and length, + "Paste address" start and length, "Paste window id" start bit and number + of bits) + +Example: + + vas@6019100000000 { + compatible = "ibm,vas", "ibm,power9-vas"; + reg = <0x6019100000000 0x2000000 0x6019000000000 0x100000000 0x8000000000000 0x100000000 0x20 0x10>; + name = "vas"; + ibm,vas-id = <0x1>; + }; diff --git a/Bindings/powerpc/opal/sensor-groups.txt b/Bindings/powerpc/opal/sensor-groups.txt new file mode 100644 index 000000000000..6ad881cbffda --- /dev/null +++ b/Bindings/powerpc/opal/sensor-groups.txt @@ -0,0 +1,27 @@ +IBM OPAL Sensor Groups Binding +------------------------------- + +Node: /ibm,opal/sensor-groups + +Description: Contains sensor groups available in the Powernv P9 +servers. Each child node indicates a sensor group. + +- compatible : Should be "ibm,opal-sensor-group" + +Each child node contains below properties: + +- type : String to indicate the type of sensor-group + +- sensor-group-id: Abstract unique identifier provided by firmware of + type which is used for sensor-group + operations like clearing the min/max history of all + sensors belonging to the group. + +- ibm,chip-id : Chip ID + +- sensors : Phandle array of child nodes of /ibm,opal/sensor/ + belonging to this group + +- ops : Array of opal-call numbers indicating available operations on + sensor groups like clearing min/max, enabling/disabling sensor + group. diff --git a/Bindings/pps/pps-gpio.txt b/Bindings/pps/pps-gpio.txt index 40bf9c3564a5..0de23b793657 100644 --- a/Bindings/pps/pps-gpio.txt +++ b/Bindings/pps/pps-gpio.txt @@ -13,8 +13,12 @@ Optional properties: Example: pps { - compatible = "pps-gpio"; - gpios = <&gpio2 6 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pps>; + gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>; assert-falling-edge; + + compatible = "pps-gpio"; + status = "okay"; }; diff --git a/Bindings/ptp/brcm,ptp-dte.txt b/Bindings/ptp/brcm,ptp-dte.txt index 7c04e22a5d6a..6b1075ee8a30 100644 --- a/Bindings/ptp/brcm,ptp-dte.txt +++ b/Bindings/ptp/brcm,ptp-dte.txt @@ -16,5 +16,4 @@ Example: ptp: ptp-dte@180af650 { compatible = "brcm,iproc-ptp-dte", "brcm,ptp-dte"; reg = <0x180af650 0x10>; - status = "okay"; }; diff --git a/Bindings/pwm/pwm-bcm2835.txt b/Bindings/pwm/pwm-bcm2835.txt index cf573e85b11d..8cf87d1bfca5 100644 --- a/Bindings/pwm/pwm-bcm2835.txt +++ b/Bindings/pwm/pwm-bcm2835.txt @@ -6,7 +6,7 @@ Required properties: - clocks: This clock defines the base clock frequency of the PWM hardware system, the period and the duty_cycle of the PWM signal is a multiple of the base period. -- #pwm-cells: Should be 2. See pwm.txt in this directory for a description of +- #pwm-cells: Should be 3. See pwm.txt in this directory for a description of the cells format. Examples: @@ -15,7 +15,7 @@ pwm@2020c000 { compatible = "brcm,bcm2835-pwm"; reg = <0x2020c000 0x28>; clocks = <&clk_pwm>; - #pwm-cells = <2>; + #pwm-cells = <3>; }; clocks { diff --git a/Bindings/pwm/pwm-mediatek.txt b/Bindings/pwm/pwm-mediatek.txt index 54c59b0560ad..ef8bd3cb67ab 100644 --- a/Bindings/pwm/pwm-mediatek.txt +++ b/Bindings/pwm/pwm-mediatek.txt @@ -2,6 +2,8 @@ MediaTek PWM controller Required properties: - compatible: should be "mediatek,-pwm": + - "mediatek,mt2712-pwm": found on mt2712 SoC. + - "mediatek,mt7622-pwm": found on mt7622 SoC. - "mediatek,mt7623-pwm": found on mt7623 SoC. - reg: physical base address and length of the controller's registers. - #pwm-cells: must be 2. See pwm.txt in this directory for a description of @@ -10,7 +12,9 @@ Required properties: - clock-names: must contain the following: - "top": the top clock generator - "main": clock used by the PWM core - - "pwm1-5": the five per PWM clocks + - "pwm1-8": the eight per PWM clocks for mt2712 + - "pwm1-6": the six per PWM clocks for mt7622 + - "pwm1-5": the five per PWM clocks for mt7623 - pinctrl-names: Must contain a "default" entry. - pinctrl-0: One property must exist for each entry in pinctrl-names. See pinctrl/pinctrl-bindings.txt for details of the property values. diff --git a/Bindings/pwm/pwm-meson.txt b/Bindings/pwm/pwm-meson.txt index 5b07bebbf6f7..1ee81321c35e 100644 --- a/Bindings/pwm/pwm-meson.txt +++ b/Bindings/pwm/pwm-meson.txt @@ -19,7 +19,6 @@ Example: compatible = "amlogic,meson-gxbb-pwm"; reg = <0x0 0x08550 0x0 0x10>; #pwm-cells = <3>; - status = "disabled"; clocks = <&xtal>, <&xtal>; clock-names = "clkin0", "clkin1"; } diff --git a/Bindings/pwm/pwm-rockchip.txt b/Bindings/pwm/pwm-rockchip.txt index b8be3d09ee26..2c5e52a5bede 100644 --- a/Bindings/pwm/pwm-rockchip.txt +++ b/Bindings/pwm/pwm-rockchip.txt @@ -3,10 +3,17 @@ Rockchip PWM controller Required properties: - compatible: should be "rockchip,-pwm" "rockchip,rk2928-pwm": found on RK29XX,RK3066 and RK3188 SoCs - "rockchip,rk3288-pwm": found on RK3288 SoC + "rockchip,rk3288-pwm": found on RK3288 SOC + "rockchip,rv1108-pwm", "rockchip,rk3288-pwm": found on RV1108 SoC "rockchip,vop-pwm": found integrated in VOP on RK3288 SoC - reg: physical base address and length of the controller's registers - - clocks: phandle and clock specifier of the PWM reference clock + - clocks: See ../clock/clock-bindings.txt + - For older hardware (rk2928, rk3066, rk3188, rk3228, rk3288, rk3399): + - There is one clock that's used both to derive the functional clock + for the device and as the bus clock. + - For newer hardware (rk3328 and future socs): specified by name + - "pwm": This is used to derive the functional clock. + - "pclk": This is the APB bus clock. - #pwm-cells: must be 2 (rk2928) or 3 (rk3288). See pwm.txt in this directory for a description of the cell format. diff --git a/Bindings/pwm/pwm-stm32-lp.txt b/Bindings/pwm/pwm-stm32-lp.txt new file mode 100644 index 000000000000..f8338d11fd2b --- /dev/null +++ b/Bindings/pwm/pwm-stm32-lp.txt @@ -0,0 +1,24 @@ +STMicroelectronics STM32 Low-Power Timer PWM + +STM32 Low-Power Timer provides single channel PWM. + +Must be a sub-node of an STM32 Low-Power Timer device tree node. +See ../mfd/stm32-lptimer.txt for details about the parent node. + +Required parameters: +- compatible: Must be "st,stm32-pwm-lp". + +Optional properties: +- pinctrl-names: Set to "default". +- pinctrl-0: Phandle pointing to pin configuration node for PWM. + +Example: + timer@40002400 { + compatible = "st,stm32-lptimer"; + ... + pwm { + compatible = "st,stm32-pwm-lp"; + pinctrl-names = "default"; + pinctrl-0 = <&lppwm1_pins>; + }; + }; diff --git a/Bindings/pwm/pwm-sun4i.txt b/Bindings/pwm/pwm-sun4i.txt index f1cbeefb3087..c5171660eaf9 100644 --- a/Bindings/pwm/pwm-sun4i.txt +++ b/Bindings/pwm/pwm-sun4i.txt @@ -19,5 +19,4 @@ Example: reg = <0x01c20e00 0xc>; clocks = <&osc24M>; #pwm-cells = <3>; - status = "disabled"; }; diff --git a/Bindings/pwm/pwm-tiecap.txt b/Bindings/pwm/pwm-tiecap.txt index 8007e839a716..06a363d9ccef 100644 --- a/Bindings/pwm/pwm-tiecap.txt +++ b/Bindings/pwm/pwm-tiecap.txt @@ -6,6 +6,7 @@ Required properties: for am4372 - compatible = "ti,am4372-ecap", "ti,am3352-ecap", "ti,am33xx-ecap"; for da850 - compatible = "ti,da850-ecap", "ti,am3352-ecap", "ti,am33xx-ecap"; for dra746 - compatible = "ti,dra746-ecap", "ti,am3352-ecap"; + for 66ak2g - compatible = "ti,k2g-ecap", "ti,am3352-ecap"; - #pwm-cells: should be 3. See pwm.txt in this directory for a description of the cells format. The PWM channel index ranges from 0 to 4. The only third cell flag supported by this binding is PWM_POLARITY_INVERTED. diff --git a/Bindings/pwm/pwm-tipwmss.txt b/Bindings/pwm/pwm-tipwmss.txt index 1a5d7b71db89..4633697fbda1 100644 --- a/Bindings/pwm/pwm-tipwmss.txt +++ b/Bindings/pwm/pwm-tipwmss.txt @@ -26,7 +26,6 @@ epwmss0: epwmss@48300000 { /* PWMSS for am33xx */ ti,hwmods = "epwmss0"; #address-cells = <1>; #size-cells = <1>; - status = "disabled"; ranges = <0x48300100 0x48300100 0x80 /* ECAP */ 0x48300180 0x48300180 0x80 /* EQEP */ 0x48300200 0x48300200 0x80>; /* EHRPWM */ @@ -40,7 +39,6 @@ epwmss0: epwmss@48300000 { /* PWMSS for am4372 */ ti,hwmods = "epwmss0"; #address-cells = <1>; #size-cells = <1>; - status = "disabled"; ranges = <0x48300100 0x48300100 0x80 /* ECAP */ 0x48300180 0x48300180 0x80 /* EQEP */ 0x48300200 0x48300200 0x80>; /* EHRPWM */ diff --git a/Bindings/pwm/pwm-zx.txt b/Bindings/pwm/pwm-zx.txt new file mode 100644 index 000000000000..a6bcc75c9164 --- /dev/null +++ b/Bindings/pwm/pwm-zx.txt @@ -0,0 +1,22 @@ +ZTE ZX PWM controller + +Required properties: + - compatible: Should be "zte,zx296718-pwm". + - reg: Physical base address and length of the controller's registers. + - clocks : The phandle and specifier referencing the controller's clocks. + - clock-names: "pclk" for PCLK, "wclk" for WCLK to the PWM controller. The + PCLK is for register access, while WCLK is the reference clock for + calculating period and duty cycles. + - #pwm-cells: Should be 3. See pwm.txt in this directory for a description of + the cells format. + +Example: + + pwm: pwm@1439000 { + compatible = "zte,zx296718-pwm"; + reg = <0x1439000 0x1000>; + clocks = <&lsp1crm LSP1_PWM_PCLK>, + <&lsp1crm LSP1_PWM_WCLK>; + clock-names = "pclk", "wclk"; + #pwm-cells = <3>; + }; diff --git a/Bindings/pwm/renesas,tpu-pwm.txt b/Bindings/pwm/renesas,tpu-pwm.txt index b067e84a94b5..1aadc804dae4 100644 --- a/Bindings/pwm/renesas,tpu-pwm.txt +++ b/Bindings/pwm/renesas,tpu-pwm.txt @@ -6,7 +6,6 @@ Required Properties: - "renesas,tpu-r8a73a4": for R8A77A4 (R-Mobile APE6) compatible PWM controller. - "renesas,tpu-r8a7740": for R8A7740 (R-Mobile A1) compatible PWM controller. - "renesas,tpu-r8a7790": for R8A7790 (R-Car H2) compatible PWM controller. - - "renesas,tpu-sh7372": for SH7372 (SH-Mobile AP4) compatible PWM controller. - "renesas,tpu": for generic R-Car TPU PWM controller. - reg: Base address and length of each memory resource used by the PWM diff --git a/Bindings/regulator/act8865-regulator.txt b/Bindings/regulator/act8865-regulator.txt index 6067d9830d07..3ae9f1088845 100644 --- a/Bindings/regulator/act8865-regulator.txt +++ b/Bindings/regulator/act8865-regulator.txt @@ -52,7 +52,6 @@ Example: compatible = "active-semi,act8865"; reg = <0x5b>; active-semi,vsel-high; - status = "disabled"; regulators { vcc_1v8_reg: DCDC_REG1 { diff --git a/Bindings/regulator/act8945a-regulator.txt b/Bindings/regulator/act8945a-regulator.txt index 5c80a7779552..ac955dea00d1 100644 --- a/Bindings/regulator/act8945a-regulator.txt +++ b/Bindings/regulator/act8945a-regulator.txt @@ -23,7 +23,6 @@ Example: pmic@5b { compatible = "active-semi,act8945a"; reg = <0x5b>; - status = "okay"; active-semi,vsel-high; diff --git a/Bindings/regulator/mt6311-regulator.txt b/Bindings/regulator/mt6311-regulator.txt index 02649d8b3f5a..84d544d8c1b1 100644 --- a/Bindings/regulator/mt6311-regulator.txt +++ b/Bindings/regulator/mt6311-regulator.txt @@ -1,4 +1,4 @@ -Mediatek MT6311 Regulator Driver +Mediatek MT6311 Regulator Required properties: - compatible: "mediatek,mt6311-regulator" diff --git a/Bindings/regulator/mt6323-regulator.txt b/Bindings/regulator/mt6323-regulator.txt index c35d878b0960..a48749db4df3 100644 --- a/Bindings/regulator/mt6323-regulator.txt +++ b/Bindings/regulator/mt6323-regulator.txt @@ -1,4 +1,4 @@ -Mediatek MT6323 Regulator Driver +Mediatek MT6323 Regulator All voltage regulators are defined as subnodes of the regulators node. A list of regulators provided by this controller are defined as subnodes of the diff --git a/Bindings/regulator/mt6380-regulator.txt b/Bindings/regulator/mt6380-regulator.txt new file mode 100644 index 000000000000..0058441f16d2 --- /dev/null +++ b/Bindings/regulator/mt6380-regulator.txt @@ -0,0 +1,89 @@ +MediaTek MT6380 Regulator + +All voltage regulators provided by the MT6380 PMIC are described as the +subnodes of the MT6380 regulators node. Each regulator is named according +to its regulator type, buck- and ldo-. The definition for each +of these nodes is defined using the standard binding for regulators at +Documentation/devicetree/bindings/regulator/regulator.txt. + +The valid names for regulators are: +BUCK: + buck-core1, buck-vcore, buck-vrf +LDO: + ldo-vm ,ldo-va , ldo-vphy, ldo-vddr, ldo-vt + +Example: + + regulators { + compatible = "mediatek,mt6380-regulator"; + + mt6380_vcpu_reg: buck-vcore1 { + regulator-name = "vcore1"; + regulator-min-microvolt = < 600000>; + regulator-max-microvolt = <1393750>; + regulator-ramp-delay = <6250>; + regulator-always-on; + regulator-boot-on; + }; + + mt6380_vcore_reg: buck-vcore { + regulator-name = "vcore"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1393750>; + regulator-ramp-delay = <6250>; + }; + + mt6380_vrf_reg: buck-vrf { + regulator-name = "vrf"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1575000>; + regulator-ramp-delay = <0>; + regulator-always-on; + regulator-boot-on; + }; + + mt6380_vm_reg: ldo-vm { + regulator-name = "vm"; + regulator-min-microvolt = <1050000>; + regulator-max-microvolt = <1400000>; + regulator-ramp-delay = <0>; + regulator-always-on; + regulator-boot-on; + }; + + mt6380_va_reg: ldo-va { + regulator-name = "va"; + regulator-min-microvolt = <2200000>; + regulator-max-microvolt = <3300000>; + regulator-ramp-delay = <0>; + regulator-always-on; + regulator-boot-on; + }; + + mt6380_vphy_reg: ldo-vphy { + regulator-name = "vphy"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-ramp-delay = <0>; + regulator-always-on; + regulator-boot-on; + }; + + mt6380_vddr_reg: ldo-vddr { + regulator-name = "vddr"; + regulator-min-microvolt = <1240000>; + regulator-max-microvolt = <1840000>; + regulator-ramp-delay = <0>; + regulator-always-on; + regulator-boot-on; + }; + + mt6380_vt_reg: ldo-vt { + regulator-name = "vt"; + regulator-min-microvolt = <2200000>; + regulator-max-microvolt = <3300000>; + regulator-ramp-delay = <0>; + regulator-always-on; + regulator-boot-on; + }; + }; diff --git a/Bindings/regulator/mt6397-regulator.txt b/Bindings/regulator/mt6397-regulator.txt index a42b1d6e9863..01141fb00875 100644 --- a/Bindings/regulator/mt6397-regulator.txt +++ b/Bindings/regulator/mt6397-regulator.txt @@ -1,4 +1,4 @@ -Mediatek MT6397 Regulator Driver +Mediatek MT6397 Regulator Required properties: - compatible: "mediatek,mt6397-regulator" diff --git a/Bindings/regulator/pwm-regulator.txt b/Bindings/regulator/pwm-regulator.txt index bf85aa9ad6a7..3d78d507e29f 100644 --- a/Bindings/regulator/pwm-regulator.txt +++ b/Bindings/regulator/pwm-regulator.txt @@ -71,7 +71,7 @@ Continuous Voltage With Enable GPIO Example: * Inverted PWM logic, and the duty cycle range is limited * to 30%-70%. */ - pwm-dutycycle-range <700 300>; /* */ + pwm-dutycycle-range = <700 300>; /* */ }; Voltage Table Example: diff --git a/Bindings/regulator/st,stm32-vrefbuf.txt b/Bindings/regulator/st,stm32-vrefbuf.txt new file mode 100644 index 000000000000..3944ee3e731e --- /dev/null +++ b/Bindings/regulator/st,stm32-vrefbuf.txt @@ -0,0 +1,20 @@ +STM32 VREFBUF - Voltage reference buffer + +Some STM32 devices embed a voltage reference buffer which can be used as +voltage reference for ADCs, DACs and also as voltage reference for external +components through the dedicated VREF+ pin. + +Required properties: +- compatible: Must be "st,stm32-vrefbuf". +- reg: Offset and length of VREFBUF register set. +- clocks: Must contain an entry for peripheral clock. + +Example: + vrefbuf: regulator@58003C00 { + compatible = "st,stm32-vrefbuf"; + reg = <0x58003C00 0x8>; + clocks = <&rcc VREF_CK>; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <2500000>; + vdda-supply = <&vdda>; + }; diff --git a/Bindings/remoteproc/imx-rproc.txt b/Bindings/remoteproc/imx-rproc.txt new file mode 100644 index 000000000000..fbcefd965dc4 --- /dev/null +++ b/Bindings/remoteproc/imx-rproc.txt @@ -0,0 +1,33 @@ +NXP iMX6SX/iMX7D Co-Processor Bindings +---------------------------------------- + +This binding provides support for ARM Cortex M4 Co-processor found on some +NXP iMX SoCs. + +Required properties: +- compatible Should be one of: + "fsl,imx7d-cm4" + "fsl,imx6sx-cm4" +- clocks Clock for co-processor (See: ../clock/clock-bindings.txt) +- syscon Phandle to syscon block which provide access to + System Reset Controller + +Optional properties: +- memory-region list of phandels to the reserved memory regions. + (See: ../reserved-memory/reserved-memory.txt) + +Example: + m4_reserved_sysmem1: cm4@80000000 { + reg = <0x80000000 0x80000>; + }; + + m4_reserved_sysmem2: cm4@81000000 { + reg = <0x81000000 0x80000>; + }; + + imx7d-cm4 { + compatible = "fsl,imx7d-cm4"; + memory-region = <&m4_reserved_sysmem1>, <&m4_reserved_sysmem2>; + syscon = <&src>; + clocks = <&clks IMX7D_ARM_M4_ROOT_CLK>; + }; diff --git a/Bindings/remoteproc/qcom,adsp.txt b/Bindings/remoteproc/qcom,adsp.txt index 75ad7b8df0b1..728e4193f7a6 100644 --- a/Bindings/remoteproc/qcom,adsp.txt +++ b/Bindings/remoteproc/qcom,adsp.txt @@ -63,9 +63,10 @@ on the Qualcomm ADSP Hexagon core. = SUBNODES -The adsp node may have an subnode named "smd-edge" that describes the SMD edge, -channels and devices related to the ADSP. See ../soc/qcom/qcom,smd.txt for -details on how to describe the SMD edge. +The adsp node may have an subnode named either "smd-edge" or "glink-edge" that +describes the communication edge, channels and devices related to the ADSP. +See ../soc/qcom/qcom,smd.txt and ../soc/qcom/qcom,glink.txt for details on how +to describe these. = EXAMPLE diff --git a/Bindings/remoteproc/qcom,q6v5.txt b/Bindings/remoteproc/qcom,q6v5.txt index 92347fe6890e..7ff3f7903f26 100644 --- a/Bindings/remoteproc/qcom,q6v5.txt +++ b/Bindings/remoteproc/qcom,q6v5.txt @@ -90,6 +90,11 @@ the memory regions used by the Hexagon firmware. Each sub-node must contain: Value type: Definition: reference to the reserved-memory for the region +The Hexagon node may also have an subnode named either "smd-edge" or +"glink-edge" that describes the communication edge, channels and devices +related to the Hexagon. See ../soc/qcom/qcom,smd.txt and +../soc/qcom/qcom,glink.txt for details on how to describe these. + = EXAMPLE The following example describes the resources needed to boot control the Hexagon, as it is found on MSM8974 boards. diff --git a/Bindings/remoteproc/ti,davinci-rproc.txt b/Bindings/remoteproc/ti,davinci-rproc.txt new file mode 100644 index 000000000000..e44a97e21164 --- /dev/null +++ b/Bindings/remoteproc/ti,davinci-rproc.txt @@ -0,0 +1,86 @@ +TI Davinci DSP devices +======================= + +Binding status: Unstable - Subject to changes for DT representation of clocks + and resets + +The TI Davinci family of SoCs usually contains a TI DSP Core sub-system that +is used to offload some of the processor-intensive tasks or algorithms, for +achieving various system level goals. + +The processor cores in the sub-system usually contain additional sub-modules +like L1 and/or L2 caches/SRAMs, an Interrupt Controller, an external memory +controller, a dedicated local power/sleep controller etc. The DSP processor +core used in Davinci SoCs is usually a C674x DSP CPU. + +DSP Device Node: +================ +Each DSP Core sub-system is represented as a single DT node. + +Required properties: +-------------------- +The following are the mandatory properties: + +- compatible: Should be one of the following, + "ti,da850-dsp" for DSPs on OMAP-L138 SoCs + +- reg: Should contain an entry for each value in 'reg-names'. + Each entry should have the memory region's start address + and the size of the region, the representation matching + the parent node's '#address-cells' and '#size-cells' values. + +- reg-names: Should contain strings with the following names, each + representing a specific internal memory region or a + specific register space, + "l2sram", "l1pram", "l1dram", "host1cfg", "chipsig_base" + +- interrupts: Should contain the interrupt number used to receive the + interrupts from the DSP. The value should follow the + interrupt-specifier format as dictated by the + 'interrupt-parent' node. + +- memory-region: phandle to the reserved memory node to be associated + with the remoteproc device. The reserved memory node + can be a CMA memory node, and should be defined as + per the bindings in + Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt + +Optional properties: +-------------------- +- interrupt-parent: phandle to the interrupt controller node. This property + is needed if the device node hierarchy doesn't have an + interrupt controller. + + +Example: +-------- + + /* DSP Reserved Memory node */ + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + dsp_memory_region: dsp-memory@c3000000 { + compatible = "shared-dma-pool"; + reg = <0xc3000000 0x1000000>; + reusable; + }; + }; + + /* DSP node */ + { + dsp: dsp@11800000 { + compatible = "ti,da850-dsp"; + reg = <0x11800000 0x40000>, + <0x11e00000 0x8000>, + <0x11f00000 0x8000>, + <0x01c14044 0x4>, + <0x01c14174 0x8>; + reg-names = "l2sram", "l1pram", "l1dram", "host1cfg", + "chipsig"; + interrupt-parent = <&intc>; + interrupts = <28>; + memory-region = <&dsp_memory_region>; + }; + }; diff --git a/Bindings/remoteproc/ti,keystone-rproc.txt b/Bindings/remoteproc/ti,keystone-rproc.txt index 2aac1aa4123d..1eb72874130b 100644 --- a/Bindings/remoteproc/ti,keystone-rproc.txt +++ b/Bindings/remoteproc/ti,keystone-rproc.txt @@ -26,6 +26,7 @@ The following are the mandatory properties: "ti,k2hk-dsp" for DSPs on Keystone 2 66AK2H/K SoCs "ti,k2l-dsp" for DSPs on Keystone 2 66AK2L SoCs "ti,k2e-dsp" for DSPs on Keystone 2 66AK2E SoCs + "ti,k2g-dsp" for DSPs on Keystone 2 66AK2G SoCs - reg: Should contain an entry for each value in 'reg-names'. Each entry should have the memory region's start address @@ -37,20 +38,18 @@ The following are the mandatory properties: should be defined in this order, "l2sram", "l1pram", "l1dram" -- clocks: Should contain the device's input clock, and should be - defined as per the bindings in, - Documentation/devicetree/bindings/clock/keystone-gate.txt - - ti,syscon-dev: Should be a pair of the phandle to the Keystone Device State Control node, and the register offset of the DSP boot address register within that node's address space. - resets: Should contain the phandle to the reset controller node managing the resets for this device, and a reset - specifier. Please refer to the following reset bindings - for the reset argument specifier as per SoC, + specifier. Please refer to either of the following reset + bindings for the reset argument specifier as per SoC, Documentation/devicetree/bindings/reset/ti-syscon-reset.txt - for 66AK2HK/66AK2L/66AK2E SoCs + for 66AK2HK/66AK2L/66AK2E SoCs or, + Documentation/devicetree/bindings/reset/ti,sci-reset.txt + for 66AK2G SoCs - interrupt-parent: Should contain a phandle to the Keystone 2 IRQ controller IP node that is used by the ARM CorePac processor to @@ -75,6 +74,22 @@ The following are the mandatory properties: The gpio device to be used is as per the bindings in, Documentation/devicetree/bindings/gpio/gpio-dsp-keystone.txt +SoC-specific Required properties: +--------------------------------- +The following are mandatory properties for Keystone 2 66AK2HK, 66AK2L and 66AK2E +SoCs only: + +- clocks: Should contain the device's input clock, and should be + defined as per the bindings in, + Documentation/devicetree/bindings/clock/keystone-gate.txt + +The following are mandatory properties for Keystone 2 66AK2G SoCs only: + +- power-domains: Should contain a phandle to a PM domain provider node + and an args specifier containing the DSP device id + value. This property is as per the binding, + Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt + Optional properties: -------------------- @@ -85,8 +100,10 @@ Optional properties: Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt -Example: --------- +Examples: +--------- + +1. /* 66AK2H/K DSP aliases */ aliases { rproc0 = &dsp0; @@ -131,3 +148,41 @@ Example: }; }; + +2. + /* 66AK2G DSP alias */ + aliases { + rproc0 = &dsp0; + }; + + /* 66AK2G DSP memory node */ + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + dsp_common_memory: dsp-common-memory@81f800000 { + compatible = "shared-dma-pool"; + reg = <0x00000008 0x1f800000 0x00000000 0x800000>; + reusable; + }; + }; + + /* 66AK2G DSP node */ + soc { + dsp0: dsp@10800000 { + compatible = "ti,k2g-dsp"; + reg = <0x10800000 0x00100000>, + <0x10e00000 0x00008000>, + <0x10f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + power-domains = <&k2g_pds 0x0046>; + ti,syscon-dev = <&devctrl 0x40>; + resets = <&k2g_reset 0x0046 0x1>; + interrupt-parent = <&kirq0>; + interrupts = <0 8>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio0 27 0>; + memory-region = <&dsp_common_memory>; + }; + }; diff --git a/Bindings/reset/lantiq,reset.txt b/Bindings/reset/lantiq,reset.txt new file mode 100644 index 000000000000..c6aef36b7d15 --- /dev/null +++ b/Bindings/reset/lantiq,reset.txt @@ -0,0 +1,30 @@ +Lantiq XWAY SoC RCU reset controller binding +============================================ + +This binding describes a reset-controller found on the RCU module on Lantiq +XWAY SoCs. + +This node has to be a sub node of the Lantiq RCU block. + +------------------------------------------------------------------------------- +Required properties: +- compatible : Should be one of + "lantiq,danube-reset" + "lantiq,xrx200-reset" +- reg : Defines the following sets of registers in the parent + syscon device + - Offset of the reset set register + - Offset of the reset status register +- #reset-cells : Specifies the number of cells needed to encode the + reset line, should be 2. + The first cell takes the reset set bit and the + second cell takes the status bit. + +------------------------------------------------------------------------------- +Example for the reset-controllers on the xRX200 SoCs: + reset0: reset-controller@10 { + compatible = "lantiq,xrx200-reset"; + reg <0x10 0x04>, <0x14 0x04>; + + #reset-cells = <2>; + }; diff --git a/Bindings/reset/nxp,lpc1850-rgu.txt b/Bindings/reset/nxp,lpc1850-rgu.txt index b4e96a278445..05d5be48dae4 100644 --- a/Bindings/reset/nxp,lpc1850-rgu.txt +++ b/Bindings/reset/nxp,lpc1850-rgu.txt @@ -80,5 +80,4 @@ mac: ethernet@40010000 { clock-names = "stmmaceth"; resets = <&rgu 22>; reset-names = "stmmaceth"; - status = "disabled"; }; diff --git a/Bindings/reset/renesas,rst.txt b/Bindings/reset/renesas,rst.txt index fe5e0f37b3c9..e5a03ffe04fb 100644 --- a/Bindings/reset/renesas,rst.txt +++ b/Bindings/reset/renesas,rst.txt @@ -26,6 +26,7 @@ Required properties: - "renesas,r8a7794-rst" (R-Car E2) - "renesas,r8a7795-rst" (R-Car H3) - "renesas,r8a7796-rst" (R-Car M3-W) + - "renesas,r8a77995-rst" (R-Car D3) - reg: Address start and address range for the device. diff --git a/Bindings/reset/snps,hsdk-reset.txt b/Bindings/reset/snps,hsdk-reset.txt new file mode 100644 index 000000000000..830069b1c37c --- /dev/null +++ b/Bindings/reset/snps,hsdk-reset.txt @@ -0,0 +1,28 @@ +Binding for the Synopsys HSDK reset controller + +This binding uses the common reset binding[1]. + +[1] Documentation/devicetree/bindings/reset/reset.txt + +Required properties: +- compatible: should be "snps,hsdk-reset". +- reg: should always contain 2 pairs address - length: first for reset + configuration register and second for corresponding SW reset and status bits + register. +- #reset-cells: from common reset binding; Should always be set to 1. + +Example: + reset: reset@880 { + compatible = "snps,hsdk-reset"; + #reset-cells = <1>; + reg = <0x8A0 0x4>, <0xFF0 0x4>; + }; + +Specifying reset lines connected to IP modules: + ethernet@.... { + .... + resets = <&reset HSDK_V1_ETH_RESET>; + .... + }; + +The index could be found in diff --git a/Bindings/reset/uniphier-reset.txt b/Bindings/reset/uniphier-reset.txt index 83ab0f599c40..68a6f487c409 100644 --- a/Bindings/reset/uniphier-reset.txt +++ b/Bindings/reset/uniphier-reset.txt @@ -6,7 +6,6 @@ System reset Required properties: - compatible: should be one of the following: - "socionext,uniphier-sld3-reset" - for sLD3 SoC "socionext,uniphier-ld4-reset" - for LD4 SoC "socionext,uniphier-pro4-reset" - for Pro4 SoC "socionext,uniphier-sld8-reset" - for sLD8 SoC @@ -37,7 +36,6 @@ Media I/O (MIO) reset, SD reset Required properties: - compatible: should be one of the following: - "socionext,uniphier-sld3-mio-reset" - for sLD3 SoC "socionext,uniphier-ld4-mio-reset" - for LD4 SoC "socionext,uniphier-pro4-mio-reset" - for Pro4 SoC "socionext,uniphier-sld8-mio-reset" - for sLD8 SoC @@ -92,3 +90,28 @@ Example: other nodes ... }; + + +Analog signal amplifier reset +----------------------------- + +Required properties: +- compatible: should be one of the following: + "socionext,uniphier-ld11-adamv-reset" - for LD11 SoC + "socionext,uniphier-ld20-adamv-reset" - for LD20 SoC +- #reset-cells: should be 1. + +Example: + + adamv@57920000 { + compatible = "socionext,uniphier-ld11-adamv", + "simple-mfd", "syscon"; + reg = <0x57920000 0x1000>; + + adamv_rst: reset { + compatible = "socionext,uniphier-ld11-adamv-reset"; + #reset-cells = <1>; + }; + + other nodes ... + }; diff --git a/Bindings/rng/imx-rngc.txt b/Bindings/rng/imx-rngc.txt new file mode 100644 index 000000000000..93c7174a7bed --- /dev/null +++ b/Bindings/rng/imx-rngc.txt @@ -0,0 +1,21 @@ +Freescale RNGC (Random Number Generator Version C) + +The driver also supports version B, which is mostly compatible +to version C. + +Required properties: +- compatible : should be one of + "fsl,imx25-rngb" + "fsl,imx35-rngc" +- reg : offset and length of the register set of this block +- interrupts : the interrupt number for the RNGC block +- clocks : the RNGC clk source + +Example: + +rng@53fb0000 { + compatible = "fsl,imx25-rngb"; + reg = <0x53fb0000 0x4000>; + interrupts = <22>; + clocks = <&trng_clk>; +}; diff --git a/Bindings/rtc/google,goldfish-rtc.txt b/Bindings/rtc/google,goldfish-rtc.txt new file mode 100644 index 000000000000..634312dd95ca --- /dev/null +++ b/Bindings/rtc/google,goldfish-rtc.txt @@ -0,0 +1,17 @@ +Android Goldfish RTC + +Android Goldfish RTC device used by Android emulator. + +Required properties: + +- compatible : should contain "google,goldfish-rtc" +- reg : +- interrupts : + +Example: + + goldfish_timer@9020000 { + compatible = "google,goldfish-rtc"; + reg = <0x9020000 0x1000>; + interrupts = <0x3>; + }; diff --git a/Bindings/rtc/isil,isl12057.txt b/Bindings/rtc/isil,isl12057.txt index cf83e0940302..fbbdd92e5af9 100644 --- a/Bindings/rtc/isil,isl12057.txt +++ b/Bindings/rtc/isil,isl12057.txt @@ -24,7 +24,6 @@ Optional properties: - "wakeup-source": mark the chip as a wakeup source, independently of the availability of an IRQ line connected to the SoC. - (Legacy property supported: "isil,irq2-can-wakeup-machine") - "interrupt-parent", "interrupts": for passing the interrupt line of the SoC connected to IRQ#2 of the RTC chip. diff --git a/Bindings/rtc/realtek,rtd119x.txt b/Bindings/rtc/realtek,rtd119x.txt new file mode 100644 index 000000000000..bbf1ccb5df31 --- /dev/null +++ b/Bindings/rtc/realtek,rtd119x.txt @@ -0,0 +1,16 @@ +Realtek RTD129x Real-Time Clock +=============================== + +Required properties: +- compatible : Should be "realtek,rtd1295-rtc" +- reg : Specifies the physical base address and size +- clocks : Specifies the clock gate + + +Example: + + rtc@9801b600 { + compatible = "realtek,rtd1295-clk"; + reg = <0x9801b600 0x100>; + clocks = <&clkc RTD1295_CLK_EN_MISC_RTC>; + }; diff --git a/Bindings/rtc/st,stm32-rtc.txt b/Bindings/rtc/st,stm32-rtc.txt index 0a4c371a9b7a..a66692a08ace 100644 --- a/Bindings/rtc/st,stm32-rtc.txt +++ b/Bindings/rtc/st,stm32-rtc.txt @@ -45,5 +45,4 @@ Example: interrupts = <17 1>; interrupt-names = "alarm"; st,syscfg = <&pwrcfg>; - status = "disabled"; }; diff --git a/Bindings/rtc/sun6i-rtc.txt b/Bindings/rtc/sun6i-rtc.txt index 945934918b71..d5e26d313f62 100644 --- a/Bindings/rtc/sun6i-rtc.txt +++ b/Bindings/rtc/sun6i-rtc.txt @@ -10,7 +10,7 @@ Required properties: Required properties for new device trees - clocks : phandle to the 32kHz external oscillator -- clock-output-names : name of the LOSC clock created +- clock-output-names : names of the LOSC and its external output clocks created - #clock-cells : must be equals to 1. The RTC provides two clocks: the LOSC and its external output, with index 0 and 1 respectively. @@ -21,7 +21,7 @@ rtc: rtc@01f00000 { compatible = "allwinner,sun6i-a31-rtc"; reg = <0x01f00000 0x54>; interrupts = <0 40 4>, <0 41 4>; - clock-output-names = "osc32k"; + clock-output-names = "osc32k", "osc32k-out"; clocks = <&ext_osc32k>; #clock-cells = <1>; }; diff --git a/Bindings/scsi/hisilicon-sas.txt b/Bindings/scsi/hisilicon-sas.txt index 2a42a323fa1a..b6a869f97715 100644 --- a/Bindings/scsi/hisilicon-sas.txt +++ b/Bindings/scsi/hisilicon-sas.txt @@ -85,5 +85,4 @@ Example: <366 1>,<367 1>/* cq30-31 */ <376 4>,/* fatal ecc */ <381 4>;/* fatal axi */ - status = "disabled"; }; diff --git a/Bindings/security/tpm/st33zp24-i2c.txt b/Bindings/security/tpm/st33zp24-i2c.txt index 3ad115efed1e..6a4e0d30d8c4 100644 --- a/Bindings/security/tpm/st33zp24-i2c.txt +++ b/Bindings/security/tpm/st33zp24-i2c.txt @@ -19,7 +19,6 @@ Example (for ARM-based BeagleBoard xM with ST33ZP24 on I2C2): &i2c2 { - status = "okay"; st33zp24: st33zp24@13 { diff --git a/Bindings/security/tpm/st33zp24-spi.txt b/Bindings/security/tpm/st33zp24-spi.txt index 158b0165e01c..604dce901b60 100644 --- a/Bindings/security/tpm/st33zp24-spi.txt +++ b/Bindings/security/tpm/st33zp24-spi.txt @@ -18,7 +18,6 @@ Example (for ARM-based BeagleBoard xM with ST33ZP24 on SPI4): &mcspi4 { - status = "okay"; st33zp24@0 { diff --git a/Bindings/security/tpm/tpm-i2c.txt b/Bindings/security/tpm/tpm-i2c.txt index 8cb638b7e89c..a65d7b71e81a 100644 --- a/Bindings/security/tpm/tpm-i2c.txt +++ b/Bindings/security/tpm/tpm-i2c.txt @@ -8,6 +8,12 @@ Required properties: the firmware event log - linux,sml-size : size of the memory allocated for the firmware event log +Optional properties: + +- powered-while-suspended: present when the TPM is left powered on between + suspend and resume (makes the suspend/resume + callbacks do nothing). + Example (for OpenPower Systems with Nuvoton TPM 2.0 on I2C) ---------------------------------------------------------- @@ -17,5 +23,4 @@ tpm@57 { compatible = "nuvoton,npct650", "nuvoton,npct601"; linux,sml-base = <0x7f 0xfd450000>; linux,sml-size = <0x10000>; - status = "okay"; }; diff --git a/Bindings/security/tpm/tpm_tis_spi.txt b/Bindings/security/tpm/tpm_tis_spi.txt index 85741cd468cc..b800667da92b 100644 --- a/Bindings/security/tpm/tpm_tis_spi.txt +++ b/Bindings/security/tpm/tpm_tis_spi.txt @@ -13,7 +13,6 @@ Example (for ARM-based BeagleBoard xM with TPM_TIS on SPI4): &mcspi4 { - status = "okay"; tpm_tis@0 { diff --git a/Bindings/serial/8250.txt b/Bindings/serial/8250.txt index 419ff6c0a47f..dad3b2ec66d4 100644 --- a/Bindings/serial/8250.txt +++ b/Bindings/serial/8250.txt @@ -14,6 +14,8 @@ Required properties: tegra132, or tegra210. - "nxp,lpc3220-uart" - "ralink,rt2880-uart" + - For MediaTek BTIF, must contain '"mediatek,-btif", + "mediatek,mtk-btif"' where is mt7622, mt7623. - "altr,16550-FIFO32" - "altr,16550-FIFO64" - "altr,16550-FIFO128" diff --git a/Bindings/serial/arc-uart.txt b/Bindings/serial/arc-uart.txt index 5cae2eb686f8..256cc150ca7e 100644 --- a/Bindings/serial/arc-uart.txt +++ b/Bindings/serial/arc-uart.txt @@ -15,7 +15,6 @@ arcuart0: serial@c0fc1000 { interrupts = <5>; clock-frequency = <80000000>; current-speed = <115200>; - status = "okay"; }; Note: Each port should have an alias correctly numbered in "aliases" node. diff --git a/Bindings/serial/axis,etraxfs-uart.txt b/Bindings/serial/axis,etraxfs-uart.txt index 51b3c9e80ad9..048c3818c826 100644 --- a/Bindings/serial/axis,etraxfs-uart.txt +++ b/Bindings/serial/axis,etraxfs-uart.txt @@ -15,7 +15,6 @@ serial@b00260000 { compatible = "axis,etraxfs-uart"; reg = <0xb0026000 0x1000>; interrupts = <68>; - status = "disabled"; dtr-gpios = <&sysgpio 0 GPIO_ACTIVE_LOW>; dsr-gpios = <&sysgpio 1 GPIO_ACTIVE_LOW>; rng-gpios = <&sysgpio 2 GPIO_ACTIVE_LOW>; diff --git a/Bindings/serial/mtk-uart.txt b/Bindings/serial/mtk-uart.txt index b6cf384597e1..f73abff3de43 100644 --- a/Bindings/serial/mtk-uart.txt +++ b/Bindings/serial/mtk-uart.txt @@ -3,6 +3,7 @@ Required properties: - compatible should contain: * "mediatek,mt2701-uart" for MT2701 compatible UARTS + * "mediatek,mt2712-uart" for MT2712 compatible UARTS * "mediatek,mt6580-uart" for MT6580 compatible UARTS * "mediatek,mt6582-uart" for MT6582 compatible UARTS * "mediatek,mt6589-uart" for MT6589 compatible UARTS diff --git a/Bindings/serial/nvidia,tegra20-hsuart.txt b/Bindings/serial/nvidia,tegra20-hsuart.txt index c93a2d1c1a65..d7edf732eb7f 100644 --- a/Bindings/serial/nvidia,tegra20-hsuart.txt +++ b/Bindings/serial/nvidia,tegra20-hsuart.txt @@ -33,5 +33,4 @@ serial@70006000 { reset-names = "serial"; dmas = <&apbdma 8>, <&apbdma 8>; dma-names = "rx", "tx"; - status = "disabled"; }; diff --git a/Bindings/serial/qcom,msm-uartdm.txt b/Bindings/serial/qcom,msm-uartdm.txt index d5f73b8f614f..9d098cf73b53 100644 --- a/Bindings/serial/qcom,msm-uartdm.txt +++ b/Bindings/serial/qcom,msm-uartdm.txt @@ -72,13 +72,10 @@ Examples: }; uarta: serial@12490000 { - status = "ok"; }; uartb: serial@16340000 { - status = "ok"; }; uartc: serial@1a240000 { - status = "ok"; }; diff --git a/Bindings/serial/renesas,sci-serial.txt b/Bindings/serial/renesas,sci-serial.txt index 8d27d1a603e7..cf504d0380ae 100644 --- a/Bindings/serial/renesas,sci-serial.txt +++ b/Bindings/serial/renesas,sci-serial.txt @@ -41,6 +41,10 @@ Required properties: - "renesas,hscif-r8a7795" for R8A7795 (R-Car H3) HSCIF compatible UART. - "renesas,scif-r8a7796" for R8A7796 (R-Car M3-W) SCIF compatible UART. - "renesas,hscif-r8a7796" for R8A7796 (R-Car M3-W) HSCIF compatible UART. + - "renesas,scif-r8a77970" for R8A77970 (R-Car V3M) SCIF compatible UART. + - "renesas,hscif-r8a77970" for R8A77970 (R-Car V3M) HSCIF compatible UART. + - "renesas,scif-r8a77995" for R8A77995 (R-Car D3) SCIF compatible UART. + - "renesas,hscif-r8a77995" for R8A77995 (R-Car D3) HSCIF compatible UART. - "renesas,scifa-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFA compatible UART. - "renesas,scifb-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFB compatible UART. - "renesas,rcar-gen1-scif" for R-Car Gen1 SCIF compatible UART, diff --git a/Bindings/serial/rs485.txt b/Bindings/serial/rs485.txt index 32b1fa1f2a5b..b8415936dfdb 100644 --- a/Bindings/serial/rs485.txt +++ b/Bindings/serial/rs485.txt @@ -5,14 +5,13 @@ the built-in half-duplex mode. The properties described hereafter shall be given to a half-duplex capable UART node. -Required properties: +Optional properties: - rs485-rts-delay: prop-encoded-array where: * a is the delay between rts signal and beginning of data sent in milliseconds. it corresponds to the delay before sending data. * b is the delay between end of data sent and rts signal in milliseconds it corresponds to the delay after sending data and actual release of the line. - -Optional properties: + If this property is not specified, <0 0> is assumed. - linux,rs485-enabled-at-boot-time: empty property telling to enable the rs485 feature at boot time. It can be disabled later with proper ioctl. - rs485-rx-during-tx: empty property that enables the receiving of data even diff --git a/Bindings/serial/serial.txt b/Bindings/serial/serial.txt index b542a0ecf06e..863c2893759e 100644 --- a/Bindings/serial/serial.txt +++ b/Bindings/serial/serial.txt @@ -43,7 +43,6 @@ Examples: rng-gpios = <&gpio2 25 GPIO_ACTIVE_LOW>; cts-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; rts-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; - status = "okay"; }; scifa4: serial@e6c80000 { @@ -54,5 +53,4 @@ Examples: clock-names = "fck"; power-domains = <&pd_a3sp>; uart-has-rtscts; - status = "okay"; }; diff --git a/Bindings/serial/st,stm32-usart.txt b/Bindings/serial/st,stm32-usart.txt index 85ec5f2b1996..3657f9f9d17a 100644 --- a/Bindings/serial/st,stm32-usart.txt +++ b/Bindings/serial/st,stm32-usart.txt @@ -1,12 +1,19 @@ * STMicroelectronics STM32 USART Required properties: -- compatible: Can be either "st,stm32-usart", "st,stm32-uart", -"st,stm32f7-usart" or "st,stm32f7-uart" depending on whether -the device supports synchronous mode and is compatible with -stm32(f4) or stm32f7. +- compatible: can be either: + - "st,stm32-usart", + - "st,stm32-uart", + - "st,stm32f7-usart", + - "st,stm32f7-uart", + - "st,stm32h7-usart" + - "st,stm32h7-uart". + depending on whether the device supports synchronous mode + and is compatible with stm32(f4), stm32f7 or stm32h7. - reg: The address and length of the peripheral registers space -- interrupts: The interrupt line of the USART instance +- interrupts: + - The interrupt line for the USART instance, + - An optional wake-up interrupt. - clocks: The input clock of the USART instance Optional properties: diff --git a/Bindings/serio/allwinner,sun4i-ps2.txt b/Bindings/serio/allwinner,sun4i-ps2.txt index 362a76925bcd..f311472990a7 100644 --- a/Bindings/serio/allwinner,sun4i-ps2.txt +++ b/Bindings/serio/allwinner,sun4i-ps2.txt @@ -19,5 +19,4 @@ Example: reg = <0x01c2a000 0x400>; interrupts = <0 62 4>; clocks = <&apb1_gates 6>; - status = "disabled"; }; diff --git a/Bindings/serio/ps2-gpio.txt b/Bindings/serio/ps2-gpio.txt new file mode 100644 index 000000000000..7b7bc9cdf986 --- /dev/null +++ b/Bindings/serio/ps2-gpio.txt @@ -0,0 +1,23 @@ +Device-Tree binding for ps/2 gpio device + +Required properties: + - compatible = "ps2-gpio" + - data-gpios: the data pin + - clk-gpios: the clock pin + - interrupts: Should trigger on the falling edge of the clock line. + +Optional properties: + - write-enable: Indicates whether write function is provided + to serio device. Possibly providing the write fn will not work, because + of the tough timing requirements. + +Example nodes: + +ps2@0 { + compatible = "ps2-gpio"; + interrupt-parent = <&gpio>; + interrupts = <23 IRQ_TYPE_EDGE_FALLING>; + data-gpios = <&gpio 24 GPIO_ACTIVE_HIGH>; + clk-gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; + write-enable; +}; diff --git a/Bindings/soc/mediatek/scpsys.txt b/Bindings/soc/mediatek/scpsys.txt index b1d165b4d4b3..40056f7990f8 100644 --- a/Bindings/soc/mediatek/scpsys.txt +++ b/Bindings/soc/mediatek/scpsys.txt @@ -12,11 +12,13 @@ power/power_domain.txt. It provides the power domains defined in - include/dt-bindings/power/mt8173-power.h - include/dt-bindings/power/mt6797-power.h - include/dt-bindings/power/mt2701-power.h +- include/dt-bindings/power/mt7622-power.h Required properties: - compatible: Should be one of: - "mediatek,mt2701-scpsys" - "mediatek,mt6797-scpsys" + - "mediatek,mt7622-scpsys" - "mediatek,mt8173-scpsys" - #power-domain-cells: Must be 1 - reg: Address range of the SCPSYS unit @@ -26,6 +28,7 @@ Required properties: enabled before enabling certain power domains. Required clocks for MT2701: "mm", "mfg", "ethif" Required clocks for MT6797: "mm", "mfg", "vdec" + Required clocks for MT7622: "hif_sel" Required clocks for MT8173: "mm", "mfg", "venc", "venc_lt" Optional properties: diff --git a/Bindings/soc/qcom/qcom,glink.txt b/Bindings/soc/qcom/qcom,glink.txt index 50fc20c6ce91..b277eca861f7 100644 --- a/Bindings/soc/qcom/qcom,glink.txt +++ b/Bindings/soc/qcom/qcom,glink.txt @@ -1,11 +1,12 @@ -Qualcomm RPM GLINK binding +Qualcomm GLINK edge binding -This binding describes the Qualcomm RPM GLINK, a fifo based mechanism for -communication with the Resource Power Management system on various Qualcomm -platforms. +This binding describes a Qualcomm GLINK edge, a fifo based mechanism for +communication between subsystem-pairs on various Qualcomm platforms. Two types +of edges can be described by the binding; the GLINK RPM edge and a SMEM based +edge. - compatible: - Usage: required + Usage: required for glink-rpm Value type: Definition: must be "qcom,glink-rpm" @@ -16,7 +17,7 @@ platforms. signal this processor about communication related events - qcom,rpm-msg-ram: - Usage: required + Usage: required for glink-rpm Value type: Definition: handle to RPM message memory resource diff --git a/Bindings/soc/qcom/qcom,gsbi.txt b/Bindings/soc/qcom/qcom,gsbi.txt index 2f5ede39bea2..fe1855f09dcc 100644 --- a/Bindings/soc/qcom/qcom,gsbi.txt +++ b/Bindings/soc/qcom/qcom,gsbi.txt @@ -78,7 +78,6 @@ Example for APQ8064: interrupts = <0 152 0x0>; clocks = <&gcc GSBI4_UART_CLK>, <&gcc GSBI4_H_CLK>; clock-names = "core", "iface"; - status = "ok"; }; }; diff --git a/Bindings/soc/rockchip/grf.txt b/Bindings/soc/rockchip/grf.txt index cc9f05d3cbc1..7dc5ce858a0e 100644 --- a/Bindings/soc/rockchip/grf.txt +++ b/Bindings/soc/rockchip/grf.txt @@ -21,6 +21,7 @@ Required Properties: - "rockchip,rk3328-grf", "syscon": for rk3328 - "rockchip,rk3368-grf", "syscon": for rk3368 - "rockchip,rk3399-grf", "syscon": for rk3399 + - "rockchip,rv1108-grf", "syscon": for rv1108 - compatible: PMUGRF should be one of the following: - "rockchip,rk3368-pmugrf", "syscon": for rk3368 - "rockchip,rk3399-pmugrf", "syscon": for rk3399 @@ -28,6 +29,8 @@ Required Properties: - "rockchip,rk3288-sgrf", "syscon": for rk3288 - compatible: USB2PHYGRF should be one of the followings - "rockchip,rk3328-usb2phy-grf", "syscon": for rk3328 +- compatible: USBGRF should be one of the following + - "rockchip,rv1108-usbgrf", "syscon": for rv1108 - reg: physical base address of the controller and length of memory mapped region. diff --git a/Bindings/soc/rockchip/power_domain.txt b/Bindings/soc/rockchip/power_domain.txt index 01bfb6745fbd..301d2a9bc1b8 100644 --- a/Bindings/soc/rockchip/power_domain.txt +++ b/Bindings/soc/rockchip/power_domain.txt @@ -7,6 +7,7 @@ Required properties for power domain controller: - compatible: Should be one of the following. "rockchip,rk3288-power-controller" - for RK3288 SoCs. "rockchip,rk3328-power-controller" - for RK3328 SoCs. + "rockchip,rk3366-power-controller" - for RK3366 SoCs. "rockchip,rk3368-power-controller" - for RK3368 SoCs. "rockchip,rk3399-power-controller" - for RK3399 SoCs. - #power-domain-cells: Number of cells in a power-domain specifier. @@ -18,6 +19,7 @@ Required properties for power domain sub nodes: - reg: index of the power domain, should use macros in: "include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain. "include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain. + "include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain. "include/dt-bindings/power/rk3368-power.h" - for RK3368 type power domain. "include/dt-bindings/power/rk3399-power.h" - for RK3399 type power domain. - clocks (optional): phandles to clocks which need to be enabled while power domain @@ -93,6 +95,7 @@ power domain to use. The index should use macros in: "include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain. "include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain. + "include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain. "include/dt-bindings/power/rk3368-power.h" - for rk3368 type power domain. "include/dt-bindings/power/rk3399-power.h" - for rk3399 type power domain. diff --git a/Bindings/soc/ti/sci-pm-domain.txt b/Bindings/soc/ti/sci-pm-domain.txt index c705db07d820..66e6265fb0aa 100644 --- a/Bindings/soc/ti/sci-pm-domain.txt +++ b/Bindings/soc/ti/sci-pm-domain.txt @@ -46,12 +46,13 @@ Required Properties: - power-domains: phandle pointing to the corresponding PM domain node and an ID representing the device. -See dt-bindings/genpd/k2g.h for the list of valid identifiers for k2g. +See http://processors.wiki.ti.com/index.php/TISCI#66AK2G02_Data for the list +of valid identifiers for k2g. Example (K2G): -------------------- uart0: serial@02530c00 { compatible = "ns16550a"; ... - power-domains = <&k2g_pds K2G_DEV_UART0>; + power-domains = <&k2g_pds 0x002c>; }; diff --git a/Bindings/sound/armada-370db-audio.txt b/Bindings/sound/armada-370db-audio.txt index bf984d238620..953c092db72f 100644 --- a/Bindings/sound/armada-370db-audio.txt +++ b/Bindings/sound/armada-370db-audio.txt @@ -23,5 +23,4 @@ Example: compatible = "marvell,a370db-audio"; marvell,audio-controller = <&audio_controller>; marvell,audio-codec = <&audio_codec &spdif_out &spdif_in>; - status = "okay"; }; diff --git a/Bindings/sound/atmel-classd.txt b/Bindings/sound/atmel-classd.txt index 549e701cb7a1..898551076382 100644 --- a/Bindings/sound/atmel-classd.txt +++ b/Bindings/sound/atmel-classd.txt @@ -13,13 +13,11 @@ Required properties: Must be "tx". - clock-names Tuple listing input clock names. - Required elements: "pclk", "gclk" and "aclk". + Required elements: "pclk" and "gclk". - clocks Please refer to clock-bindings.txt. - assigned-clocks Should be <&classd_gclk>. -- assigned-clock-parents - Should be <&audio_pll_pmc>. Optional properties: - pinctrl-names, pinctrl-0 @@ -45,10 +43,9 @@ classd: classd@fc048000 { (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(47))>; dma-names = "tx"; - clocks = <&classd_clk>, <&classd_gclk>, <&audio_pll_pmc>; - clock-names = "pclk", "gclk", "aclk"; + clocks = <&classd_clk>, <&classd_gclk>; + clock-names = "pclk", "gclk"; assigned-clocks = <&classd_gclk>; - assigned-clock-parents = <&audio_pll_pmc>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_classd_default>; diff --git a/Bindings/sound/axentia,tse850-pcm5142.txt b/Bindings/sound/axentia,tse850-pcm5142.txt index fdb25b492514..9d049d4bfd58 100644 --- a/Bindings/sound/axentia,tse850-pcm5142.txt +++ b/Bindings/sound/axentia,tse850-pcm5142.txt @@ -45,7 +45,6 @@ Example: &ssc0 { #sound-dai-cells = <0>; - status = "okay"; }; &i2c { diff --git a/Bindings/sound/brcm,cygnus-audio.txt b/Bindings/sound/brcm,cygnus-audio.txt index b139e66d2a11..630bf7c0344d 100644 --- a/Bindings/sound/brcm,cygnus-audio.txt +++ b/Bindings/sound/brcm,cygnus-audio.txt @@ -47,21 +47,17 @@ Example: ssp0: ssp_port@0 { reg = <0>; - status = "okay"; }; ssp1: ssp_port@1 { reg = <1>; - status = "disabled"; }; ssp2: ssp_port@2 { reg = <2>; - status = "disabled"; }; spdif: spdif_port@3 { reg = <3>; - status = "disabled"; }; }; diff --git a/Bindings/sound/cs43130.txt b/Bindings/sound/cs43130.txt new file mode 100644 index 000000000000..8b1dd5aeb004 --- /dev/null +++ b/Bindings/sound/cs43130.txt @@ -0,0 +1,67 @@ +CS43130 DAC + +Required properties: + + - compatible : "cirrus,cs43130", "cirrus,cs4399", "cirrus,cs43131", + "cirrus,cs43198" + + - reg : the I2C address of the device for I2C + + - VA-supply, VP-supply, VL-supply, VCP-supply, VD-supply: + power supplies for the device, as covered in + Documentation/devicetree/bindings/regulator/regulator.txt. + + +Optional properties: + + - reset-gpios : Active low GPIO used to reset the device + + - cirrus,xtal-ibias: + When external MCLK is generated by external crystal + oscillator, CS43130 can be used to provide bias current + for external crystal. Amount of bias current sent is + set as: + 1 = 7.5uA + 2 = 12.5uA + 3 = 15uA + + - cirrus,dc-measure: + Boolean, define to enable headphone DC impedance measurement. + + - cirrus,ac-measure: + Boolean, define to enable headphone AC impedance measurement. + DC impedance must also be enabled for AC impedance measurement. + + - cirrus,dc-threshold: + Define 2 DC impedance thresholds in ohms for HP output control. + Default values are 50 and 120 Ohms. + + - cirrus,ac-freq: + Define the frequencies at which to measure HP AC impedance. + Only used if "cirrus,dc-measure" is defined. + Exactly 10 frequencies must be defined. + If this properties is undefined, by default, + following frequencies are used: + <24 43 93 200 431 928 2000 4309 9283 20000> + The above frequencies are logarithmically equally spaced. + Log base is 10. + +Example: + +cs43130: audio-codec@30 { + compatible = "cirrus,cs43130"; + reg = <0x30>; + reset-gpios = <&axi_gpio 54 0>; + VA-supply = <&dummy_vreg>; + VP-supply = <&dummy_vreg>; + VL-supply = <&dummy_vreg>; + VCP-supply = <&dummy_vreg>; + VD-supply = <&dummy_vreg>; + cirrus,xtal-ibias = <2>; + interrupt-parent = <&gpio0>; + interrupts = <55 8>; + cirrus,dc-measure; + cirrus,ac-measure; + cirrus,dc-threshold = /bits/ 16 <20 100>; + cirrus,ac-freq = /bits/ 16 <24 43 93 200 431 928 2000 4309 9283 20000>; +}; diff --git a/Bindings/sound/davinci-mcbsp.txt b/Bindings/sound/davinci-mcbsp.txt index e0b6165c9cfc..3ffc2562fb31 100644 --- a/Bindings/sound/davinci-mcbsp.txt +++ b/Bindings/sound/davinci-mcbsp.txt @@ -47,5 +47,4 @@ mcbsp0: mcbsp@1d10000 { dmas = <&edma0 3 1 &edma0 2 1>; dma-names = "tx", "rx"; - status = "okay"; }; diff --git a/Bindings/sound/dmic.txt b/Bindings/sound/dmic.txt new file mode 100644 index 000000000000..54c8ef6498a8 --- /dev/null +++ b/Bindings/sound/dmic.txt @@ -0,0 +1,16 @@ +Device-Tree bindings for Digital microphone (DMIC) codec + +This device support generic PDM digital microphone. + +Required properties: + - compatible: should be "dmic-codec". + +Optional properties: + - dmicen-gpios: GPIO specifier for dmic to control start and stop + +Example node: + + dmic_codec: dmic@0 { + compatible = "dmic-codec"; + dmicen-gpios = <&gpio4 3 GPIO_ACTIVE_HIGH>; + }; diff --git a/Bindings/sound/fsl,asrc.txt b/Bindings/sound/fsl,asrc.txt index 3e26a9478e57..65979b205893 100644 --- a/Bindings/sound/fsl,asrc.txt +++ b/Bindings/sound/fsl,asrc.txt @@ -61,5 +61,4 @@ asrc: asrc@02034000 { "txa", "txb", "txc"; fsl,asrc-rate = <48000>; fsl,asrc-width = <16>; - status = "okay"; }; diff --git a/Bindings/sound/fsl,esai.txt b/Bindings/sound/fsl,esai.txt index cd3ee5d84f03..21c401e2ccda 100644 --- a/Bindings/sound/fsl,esai.txt +++ b/Bindings/sound/fsl,esai.txt @@ -59,5 +59,4 @@ esai: esai@02024000 { fsl,fifo-depth = <128>; fsl,esai-synchronous; big-endian; - status = "disabled"; }; diff --git a/Bindings/sound/fsl,spdif.txt b/Bindings/sound/fsl,spdif.txt index 4ca39ddc0417..0f97e54c3d43 100644 --- a/Bindings/sound/fsl,spdif.txt +++ b/Bindings/sound/fsl,spdif.txt @@ -59,5 +59,4 @@ spdif: spdif@02004000 { "rxtx7"; big-endian; - status = "okay"; }; diff --git a/Bindings/sound/hdmi.txt b/Bindings/sound/hdmi.txt index 31af7bca3099..56407c30e954 100644 --- a/Bindings/sound/hdmi.txt +++ b/Bindings/sound/hdmi.txt @@ -13,5 +13,4 @@ Example node: hdmi_audio: hdmi_audio@0 { compatible = "linux,hdmi-audio"; - status = "okay"; }; diff --git a/Bindings/sound/mt2701-afe-pcm.txt b/Bindings/sound/mt2701-afe-pcm.txt index 9800a560e0c2..77a57f84bed4 100644 --- a/Bindings/sound/mt2701-afe-pcm.txt +++ b/Bindings/sound/mt2701-afe-pcm.txt @@ -3,7 +3,8 @@ Mediatek AFE PCM controller for mt2701 Required properties: - compatible = "mediatek,mt2701-audio"; - reg: register location and size -- interrupts: Should contain AFE interrupt +- interrupts: should contain AFE and ASYS interrupts +- interrupt-names: should be "afe" and "asys" - power-domains: should define the power domain - clock-names: should have these clock names: "infra_sys_audio_clk", @@ -59,6 +60,7 @@ Example: <0 0x112A0000 0 0x20000>; interrupts = , ; + interrupt-names = "afe", "asys"; power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>; clocks = <&infracfg CLK_INFRA_AUDIO>, <&topckgen CLK_TOP_AUD_MUX1_SEL>, diff --git a/Bindings/sound/qcom,msm8916-wcd-analog.txt b/Bindings/sound/qcom,msm8916-wcd-analog.txt index ccb401cfef9d..551ecab67efe 100644 --- a/Bindings/sound/qcom,msm8916-wcd-analog.txt +++ b/Bindings/sound/qcom,msm8916-wcd-analog.txt @@ -31,8 +31,22 @@ Required properties - vdd-cdc-io-supply: phandle to VDD_CDC_IO regulator DT node. - vdd-cdc-tx-rx-cx-supply: phandle to VDD_CDC_TX/RX/CX regulator DT node. - vdd-micbias-supply: phandle of VDD_MICBIAS supply's regulator DT node. - Optional Properties: + - qcom,mbhc-vthreshold-low: Array of 5 threshold voltages in mV for 5 buttons + detection on headset when the mbhc is powered up + by internal current source, this is a low power. + - qcom,mbhc-vthreshold-high: Array of 5 thresold voltages in mV for 5 buttons + detection on headset when mbhc is powered up + from micbias. +- qcom,micbias-lvl: Voltage (mV) for Mic Bias +- qcom,hphl-jack-type-normally-open: boolean, present if hphl pin on jack is a + NO (Normally Open). If not specified, then + its assumed that hphl pin on jack is NC + (Normally Closed). +- qcom,gnd-jack-type-normally-open: boolean, present if gnd pin on jack is + NO (Normally Open). If not specified, then + its assumed that gnd pin on jack is NC + (Normally Closed). - qcom,micbias1-ext-cap: boolean, present if micbias1 has external capacitor connected. - qcom,micbias2-ext-cap: boolean, present if micbias2 has external capacitor @@ -48,6 +62,8 @@ spmi_bus { reg-names = "pmic-codec-core"; clocks = <&gcc GCC_CODEC_DIGCODEC_CLK>; clock-names = "mclk"; + qcom,mbhc-vthreshold-low = <75 150 237 450 500>; + qcom,mbhc-vthreshold-high = <75 150 237 450 500>; interrupt-parent = <&spmi_bus>; interrupts = <0x1 0xf0 0x0 IRQ_TYPE_NONE>, <0x1 0xf0 0x1 IRQ_TYPE_NONE>, diff --git a/Bindings/sound/renesas,rsnd.txt b/Bindings/sound/renesas,rsnd.txt index 7246bb268bf9..085bec364caf 100644 --- a/Bindings/sound/renesas,rsnd.txt +++ b/Bindings/sound/renesas,rsnd.txt @@ -199,10 +199,10 @@ Ex) sound { compatible = "simple-scu-audio-card"; ... - simple-audio-card,cpu@0 { + simple-audio-card,cpu-0 { sound-dai = <&rcar_sound 0>; }; - simple-audio-card,cpu@1 { + simple-audio-card,cpu-1 { sound-dai = <&rcar_sound 1>; }; simple-audio-card,codec { @@ -441,79 +441,79 @@ rcar_sound: sound@ec500000 { "clk_a", "clk_b", "clk_c", "clk_i"; rcar_sound,dvc { - dvc0: dvc@0 { + dvc0: dvc-0 { dmas = <&audma0 0xbc>; dma-names = "tx"; }; - dvc1: dvc@1 { + dvc1: dvc-1 { dmas = <&audma0 0xbe>; dma-names = "tx"; }; }; rcar_sound,mix { - mix0: mix@0 { }; - mix1: mix@1 { }; + mix0: mix-0 { }; + mix1: mix-1 { }; }; rcar_sound,ctu { - ctu00: ctu@0 { }; - ctu01: ctu@1 { }; - ctu02: ctu@2 { }; - ctu03: ctu@3 { }; - ctu10: ctu@4 { }; - ctu11: ctu@5 { }; - ctu12: ctu@6 { }; - ctu13: ctu@7 { }; + ctu00: ctu-0 { }; + ctu01: ctu-1 { }; + ctu02: ctu-2 { }; + ctu03: ctu-3 { }; + ctu10: ctu-4 { }; + ctu11: ctu-5 { }; + ctu12: ctu-6 { }; + ctu13: ctu-7 { }; }; rcar_sound,src { - src0: src@0 { + src0: src-0 { interrupts = <0 352 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x85>, <&audma1 0x9a>; dma-names = "rx", "tx"; }; - src1: src@1 { + src1: src-1 { interrupts = <0 353 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x87>, <&audma1 0x9c>; dma-names = "rx", "tx"; }; - src2: src@2 { + src2: src-2 { interrupts = <0 354 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x89>, <&audma1 0x9e>; dma-names = "rx", "tx"; }; - src3: src@3 { + src3: src-3 { interrupts = <0 355 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x8b>, <&audma1 0xa0>; dma-names = "rx", "tx"; }; - src4: src@4 { + src4: src-4 { interrupts = <0 356 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x8d>, <&audma1 0xb0>; dma-names = "rx", "tx"; }; - src5: src@5 { + src5: src-5 { interrupts = <0 357 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x8f>, <&audma1 0xb2>; dma-names = "rx", "tx"; }; - src6: src@6 { + src6: src-6 { interrupts = <0 358 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x91>, <&audma1 0xb4>; dma-names = "rx", "tx"; }; - src7: src@7 { + src7: src-7 { interrupts = <0 359 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x93>, <&audma1 0xb6>; dma-names = "rx", "tx"; }; - src8: src@8 { + src8: src-8 { interrupts = <0 360 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x95>, <&audma1 0xb8>; dma-names = "rx", "tx"; }; - src9: src@9 { + src9: src-9 { interrupts = <0 361 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x97>, <&audma1 0xba>; dma-names = "rx", "tx"; @@ -521,52 +521,52 @@ rcar_sound: sound@ec500000 { }; rcar_sound,ssi { - ssi0: ssi@0 { + ssi0: ssi-0 { interrupts = <0 370 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>; dma-names = "rx", "tx", "rxu", "txu"; }; - ssi1: ssi@1 { + ssi1: ssi-1 { interrupts = <0 371 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>; dma-names = "rx", "tx", "rxu", "txu"; }; - ssi2: ssi@2 { + ssi2: ssi-2 { interrupts = <0 372 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>; dma-names = "rx", "tx", "rxu", "txu"; }; - ssi3: ssi@3 { + ssi3: ssi-3 { interrupts = <0 373 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>; dma-names = "rx", "tx", "rxu", "txu"; }; - ssi4: ssi@4 { + ssi4: ssi-4 { interrupts = <0 374 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>; dma-names = "rx", "tx", "rxu", "txu"; }; - ssi5: ssi@5 { + ssi5: ssi-5 { interrupts = <0 375 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>; dma-names = "rx", "tx", "rxu", "txu"; }; - ssi6: ssi@6 { + ssi6: ssi-6 { interrupts = <0 376 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>; dma-names = "rx", "tx", "rxu", "txu"; }; - ssi7: ssi@7 { + ssi7: ssi-7 { interrupts = <0 377 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>; dma-names = "rx", "tx", "rxu", "txu"; }; - ssi8: ssi@8 { + ssi8: ssi-8 { interrupts = <0 378 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>; dma-names = "rx", "tx", "rxu", "txu"; }; - ssi9: ssi@9 { + ssi9: ssi-9 { interrupts = <0 379 IRQ_TYPE_LEVEL_HIGH>; dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>; dma-names = "rx", "tx", "rxu", "txu"; @@ -621,7 +621,6 @@ Example: simple sound card /* Single DAI */ #sound-dai-cells = <0>; - status = "okay"; rcar_sound,dai { dai0 { @@ -667,7 +666,6 @@ Example: simple sound card for Multi channel /* Single DAI */ #sound-dai-cells = <0>; - status = "okay"; rcar_sound,dai { dai0 { diff --git a/Bindings/sound/rockchip,pdm.txt b/Bindings/sound/rockchip,pdm.txt index 921729de7346..47f164fbd1d7 100644 --- a/Bindings/sound/rockchip,pdm.txt +++ b/Bindings/sound/rockchip,pdm.txt @@ -29,11 +29,13 @@ pdm: pdm@ff040000 { dma-names = "rx"; pinctrl-names = "default", "sleep"; pinctrl-0 = <&pdmm0_clk - &pdmm0_fsync &pdmm0_sdi0 &pdmm0_sdi1 &pdmm0_sdi2 &pdmm0_sdi3>; - pinctrl-1 = <&pdmm0_sleep>; - status = "disabled"; + pinctrl-1 = <&pdmm0_clk_sleep + &pdmm0_sdi0_sleep + &pdmm0_sdi1_sleep + &pdmm0_sdi2_sleep + &pdmm0_sdi3_sleep>; }; diff --git a/Bindings/sound/rockchip,rk3399-gru-sound.txt b/Bindings/sound/rockchip,rk3399-gru-sound.txt index eac91db07178..72d3cf4c2606 100644 --- a/Bindings/sound/rockchip,rk3399-gru-sound.txt +++ b/Bindings/sound/rockchip,rk3399-gru-sound.txt @@ -4,7 +4,7 @@ Required properties: - compatible: "rockchip,rk3399-gru-sound" - rockchip,cpu: The phandle of the Rockchip I2S controller that's connected to the codecs -- rockchip,codec: The phandle of the MAX98357A/RT5514/DA7219 codecs +- rockchip,codec: The phandle of the audio codecs Optional properties: - dmic-wakeup-delay-ms : specify delay time (ms) for DMIC ready. diff --git a/Bindings/sound/rockchip-i2s.txt b/Bindings/sound/rockchip-i2s.txt index 206aba1b34bb..b208a752576c 100644 --- a/Bindings/sound/rockchip-i2s.txt +++ b/Bindings/sound/rockchip-i2s.txt @@ -7,8 +7,12 @@ Required properties: - compatible: should be one of the following: - "rockchip,rk3066-i2s": for rk3066 + - "rockchip,rk3036-i2s", "rockchip,rk3066-i2s": for rk3036 - "rockchip,rk3188-i2s", "rockchip,rk3066-i2s": for rk3188 + - "rockchip,rk3228-i2s", "rockchip,rk3066-i2s": for rk3228 - "rockchip,rk3288-i2s", "rockchip,rk3066-i2s": for rk3288 + - "rockchip,rk3328-i2s", "rockchip,rk3066-i2s": for rk3328 + - "rockchip,rk3366-i2s", "rockchip,rk3066-i2s": for rk3366 - "rockchip,rk3368-i2s", "rockchip,rk3066-i2s": for rk3368 - "rockchip,rk3399-i2s", "rockchip,rk3066-i2s": for rk3399 - reg: physical base address of the controller and length of memory mapped diff --git a/Bindings/sound/rockchip-spdif.txt b/Bindings/sound/rockchip-spdif.txt index 4706b96d450b..0a1dc4e1815c 100644 --- a/Bindings/sound/rockchip-spdif.txt +++ b/Bindings/sound/rockchip-spdif.txt @@ -41,6 +41,5 @@ spdif: spdif@0x1011e000 { dma-names = "tx"; clock-names = "hclk", "mclk"; clocks = <&cru HCLK_SPDIF>, <&cru SCLK_SPDIF>; - status = "disabled"; #sound-dai-cells = <0>; }; diff --git a/Bindings/sound/rt274.txt b/Bindings/sound/rt274.txt new file mode 100644 index 000000000000..e9a6178c78cf --- /dev/null +++ b/Bindings/sound/rt274.txt @@ -0,0 +1,33 @@ +RT274 audio CODEC + +This device supports I2C only. + +Required properties: + +- compatible : "realtek,rt274". + +- reg : The I2C address of the device. + +Optional properties: + +- interrupts : The CODEC's interrupt output. + + +Pins on the device (for linking into audio routes) for RT274: + + * DMIC1 Pin + * DMIC2 Pin + * MIC + * LINE1 + * LINE2 + * HPO Pin + * SPDIF + * LINE3 + +Example: + +codec: rt274@1c { + compatible = "realtek,rt274"; + reg = <0x1c>; + interrupts = <7 IRQ_TYPE_EDGE_FALLING>; +}; diff --git a/Bindings/sound/rt5663.txt b/Bindings/sound/rt5663.txt index 70eaeaed2b18..ff381718c517 100644 --- a/Bindings/sound/rt5663.txt +++ b/Bindings/sound/rt5663.txt @@ -12,6 +12,14 @@ Required properties: Optional properties: +- "realtek,dc_offset_l_manual" +- "realtek,dc_offset_r_manual" +- "realtek,dc_offset_l_manual_mic" +- "realtek,dc_offset_r_manual_mic" + Based on the different PCB layout, add the manual offset value to + compensate the DC offset for each L and R channel, and they are different + between headphone and headset. + Pins on the device (for linking into audio routes) for RT5663: * IN1P diff --git a/Bindings/sound/samsung,odroid.txt b/Bindings/sound/samsung,odroid.txt index c30934dd975b..625b1b18fd02 100644 --- a/Bindings/sound/samsung,odroid.txt +++ b/Bindings/sound/samsung,odroid.txt @@ -7,9 +7,6 @@ Required properties: - model - the user-visible name of this sound complex - clocks - should contain entries matching clock names in the clock-names property - - clock-names - should contain following entries: - - "epll" - indicating the EPLL output clock - - "i2s_rclk" - indicating the RCLK (root) clock of the I2S0 controller - samsung,audio-widgets - this property specifies off-codec audio elements like headphones or speakers, for details see widgets.txt - samsung,audio-routing - a list of the connections between audio @@ -46,9 +43,6 @@ sound { "IN1", "Mic Jack", "Mic Jack", "MICBIAS"; - clocks = <&clock CLK_FOUT_EPLL>, <&i2s0 CLK_I2S_RCLK_SRC>; - clock-names = "epll", "sclk_i2s"; - cpu { sound-dai = <&i2s0 0>; }; diff --git a/Bindings/sound/simple-card.txt b/Bindings/sound/simple-card.txt index c7a93931fad2..166f2290233b 100644 --- a/Bindings/sound/simple-card.txt +++ b/Bindings/sound/simple-card.txt @@ -86,6 +86,9 @@ Optional CPU/CODEC subnodes properties: in dai startup() and disabled with clk_disable_unprepare() in dai shutdown(). +- system-clock-direction-out : specifies clock direction as 'out' on + initialization. It is useful for some aCPUs with + fixed clocks. Example 1 - single DAI link: diff --git a/Bindings/sound/simple-scu-card.txt b/Bindings/sound/simple-scu-card.txt index 327d229a51b2..32f8dbce5241 100644 --- a/Bindings/sound/simple-scu-card.txt +++ b/Bindings/sound/simple-scu-card.txt @@ -24,6 +24,7 @@ Optional subnode properties: - simple-audio-card,convert-rate : platform specified sampling rate convert - simple-audio-card,convert-channels : platform specified converted channel size (2 - 8 ch) - simple-audio-card,prefix : see routing +- simple-audio-card,widgets : Please refer to widgets.txt. - simple-audio-card,routing : A list of the connections between audio components. Each entry is a pair of strings, the first being the connection's sink, the second being the connection's source. Valid names for sources. diff --git a/Bindings/sound/st,sti-asoc-card.txt b/Bindings/sound/st,sti-asoc-card.txt index 745dc62f76ea..40068ec0e9a5 100644 --- a/Bindings/sound/st,sti-asoc-card.txt +++ b/Bindings/sound/st,sti-asoc-card.txt @@ -53,7 +53,6 @@ Example: sti_uni_player1: sti-uni-player@0x8D81000 { compatible = "st,stih407-uni-player-hdmi"; - status = "okay"; #sound-dai-cells = <0>; st,syscfg = <&syscfg_core>; clocks = <&clk_s_d0_flexgen CLK_PCM_1>; @@ -66,7 +65,6 @@ Example: sti_uni_player2: sti-uni-player@0x8D82000 { compatible = "st,stih407-uni-player-pcm-out"; - status = "okay"; #sound-dai-cells = <0>; st,syscfg = <&syscfg_core>; clocks = <&clk_s_d0_flexgen CLK_PCM_2>; @@ -78,7 +76,6 @@ Example: sti_uni_player3: sti-uni-player@0x8D85000 { compatible = "st,stih407-uni-player-spdif"; - status = "okay"; #sound-dai-cells = <0>; st,syscfg = <&syscfg_core>; clocks = <&clk_s_d0_flexgen CLK_SPDIFF>; @@ -90,7 +87,6 @@ Example: sti_uni_reader1: sti-uni-reader@0x8D84000 { compatible = "st,stih407-uni-reader-hdmi"; - status = "disabled"; #sound-dai-cells = <0>; st,syscfg = <&syscfg_core>; reg = <0x8D84000 0x158>; @@ -125,7 +121,6 @@ Example of audio card declaration: sound { compatible = "simple-audio-card"; simple-audio-card,name = "sti audio card"; - status = "okay"; simple-audio-card,dai-link@0 { /* DAC */ diff --git a/Bindings/sound/sun4i-i2s.txt b/Bindings/sound/sun4i-i2s.txt index ee21da865771..fc5da6080759 100644 --- a/Bindings/sound/sun4i-i2s.txt +++ b/Bindings/sound/sun4i-i2s.txt @@ -8,6 +8,7 @@ Required properties: - compatible: should be one of the following: - "allwinner,sun4i-a10-i2s" - "allwinner,sun6i-a31-i2s" + - "allwinner,sun8i-h3-i2s" - reg: physical base address of the controller and length of memory mapped region. - interrupts: should contain the I2S interrupt. @@ -22,6 +23,7 @@ Required properties: Required properties for the following compatibles: - "allwinner,sun6i-a31-i2s" + - "allwinner,sun8i-h3-i2s" - resets: phandle to the reset line for this codec Example: diff --git a/Bindings/sound/sunxi,sun4i-spdif.txt b/Bindings/sound/sunxi,sun4i-spdif.txt index fe0a65e6d629..70ee177901d3 100644 --- a/Bindings/sound/sunxi,sun4i-spdif.txt +++ b/Bindings/sound/sunxi,sun4i-spdif.txt @@ -39,5 +39,4 @@ spdif: spdif@01c21000 { clock-names = "apb", "spdif"; dmas = <&dma 0 2>, <&dma 0 2>; dma-names = "rx", "tx"; - status = "okay"; }; diff --git a/Bindings/sound/tas5720.txt b/Bindings/sound/tas5720.txt index 806ea7381483..40d94f82beb3 100644 --- a/Bindings/sound/tas5720.txt +++ b/Bindings/sound/tas5720.txt @@ -17,7 +17,6 @@ Required properties: Example: tas5720: tas5720@6c { - status = "okay"; compatible = "ti,tas5720"; reg = <0x6c>; dvdd-supply = <&vdd_3v3_reg>; diff --git a/Bindings/sound/tlv320aic32x4.txt b/Bindings/sound/tlv320aic32x4.txt index 5e2741af27be..ca75890f0d07 100644 --- a/Bindings/sound/tlv320aic32x4.txt +++ b/Bindings/sound/tlv320aic32x4.txt @@ -3,7 +3,9 @@ Texas Instruments - tlv320aic32x4 Codec module The tlv320aic32x4 serial control bus communicates through I2C protocols Required properties: - - compatible: Should be "ti,tlv320aic32x4" + - compatible - "string" - One of: + "ti,tlv320aic32x4" TLV320AIC3204 + "ti,tlv320aic32x6" TLV320AIC3206, TLV320AIC3256 - reg: I2C slave address - supply-*: Required supply regulators are: "iov" - digital IO power supply @@ -18,6 +20,8 @@ Optional properties: - reset-gpios: Reset-GPIO phandle with args as described in gpio/gpio.txt - clocks/clock-names: Clock named 'mclk' for the master clock of the codec. See clock/clock-bindings.txt for information about the detailed format. + - aic32x4-gpio-func - + - Types are defined in include/sound/tlv320aic32x4.h Example: @@ -27,4 +31,11 @@ codec: tlv320aic32x4@18 { reg = <0x18>; clocks = <&clks 201>; clock-names = "mclk"; + aic32x4-gpio-func= < + 0xff /* AIC32X4_MFPX_DEFAULT_VALUE */ + 0xff /* AIC32X4_MFPX_DEFAULT_VALUE */ + 0x04 /* MFP3 AIC32X4_MFP3_GPIO_ENABLED */ + 0xff /* AIC32X4_MFPX_DEFAULT_VALUE */ + 0x08 /* MFP5 AIC32X4_MFP5_GPIO_INPUT */ + >; }; diff --git a/Bindings/sound/tlv320aic3x.txt b/Bindings/sound/tlv320aic3x.txt index 47a213c411ce..ba5b45c483f5 100644 --- a/Bindings/sound/tlv320aic3x.txt +++ b/Bindings/sound/tlv320aic3x.txt @@ -26,6 +26,11 @@ Optional properties: 3 - MICBIAS output is connected to AVDD, If this node is not mentioned or if the value is incorrect, then MicBias is powered down. +- ai3x-ocmv - Output Common-Mode Voltage selection: + 0 - 1.35V, + 1 - 1.5V, + 2 - 1.65V, + 3 - 1.8V - AVDD-supply, IOVDD-supply, DRVDD-supply, DVDD-supply : power supplies for the device as covered in Documentation/devicetree/bindings/regulator/regulator.txt diff --git a/Bindings/sound/wm8524.txt b/Bindings/sound/wm8524.txt new file mode 100644 index 000000000000..20c62002cbcd --- /dev/null +++ b/Bindings/sound/wm8524.txt @@ -0,0 +1,16 @@ +WM8524 audio CODEC + +This device does not use I2C or SPI but a simple Hardware Control Interface. + +Required properties: + + - compatible : "wlf,wm8524" + + - wlf,mute-gpios: a GPIO spec for the MUTE pin. + +Example: + +codec: wm8524@0 { + compatible = "wlf,wm8524"; + wlf,mute-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; +}; diff --git a/Bindings/sound/zte,zx-i2s.txt b/Bindings/sound/zte,zx-i2s.txt index 292ad5083704..3927251464f0 100644 --- a/Bindings/sound/zte,zx-i2s.txt +++ b/Bindings/sound/zte,zx-i2s.txt @@ -27,7 +27,6 @@ Example: interrupts = ; dmas = <&dma 5>, <&dma 6>; dma-names = "tx", "rx"; - status = "okay"; }; sound { diff --git a/Bindings/sound/zte,zx-spdif.txt b/Bindings/sound/zte,zx-spdif.txt index 989544ea6eb5..b5a5ca4502f9 100644 --- a/Bindings/sound/zte,zx-spdif.txt +++ b/Bindings/sound/zte,zx-spdif.txt @@ -24,5 +24,4 @@ Example: interrupts = ; dmas = <&dma 4>; dma-names = "tx"; - status = "okay"; }; diff --git a/Bindings/spi/efm32-spi.txt b/Bindings/spi/efm32-spi.txt index 750e29aff9bc..2c1e6a43930b 100644 --- a/Bindings/spi/efm32-spi.txt +++ b/Bindings/spi/efm32-spi.txt @@ -28,7 +28,6 @@ spi1: spi@0x4000c400 { /* USART1 */ clocks = <&cmu 20>; cs-gpios = <&gpio 51 1>; // D3 energymicro,location = <1>; - status = "ok"; ks8851@0 { compatible = "ks8851"; @@ -36,6 +35,5 @@ spi1: spi@0x4000c400 { /* USART1 */ reg = <0>; interrupt-parent = <&boardfpga>; interrupts = <4>; - status = "ok"; }; }; diff --git a/Bindings/spi/fsl-imx-cspi.txt b/Bindings/spi/fsl-imx-cspi.txt index 31b5b21598ff..5bf13960f7f4 100644 --- a/Bindings/spi/fsl-imx-cspi.txt +++ b/Bindings/spi/fsl-imx-cspi.txt @@ -9,6 +9,7 @@ Required properties: - "fsl,imx31-cspi" for SPI compatible with the one integrated on i.MX31 - "fsl,imx35-cspi" for SPI compatible with the one integrated on i.MX35 - "fsl,imx51-ecspi" for SPI compatible with the one integrated on i.MX51 + - "fsl,imx53-ecspi" for SPI compatible with the one integrated on i.MX53 and later Soc - reg : Offset and length of the register set for the device - interrupts : Should contain CSPI/eCSPI interrupt - cs-gpios : Specifies the gpio pins to be used for chipselects. diff --git a/Bindings/spi/nvidia,tegra114-spi.txt b/Bindings/spi/nvidia,tegra114-spi.txt index b785976fe98a..9ba7c5a273b4 100644 --- a/Bindings/spi/nvidia,tegra114-spi.txt +++ b/Bindings/spi/nvidia,tegra114-spi.txt @@ -38,5 +38,4 @@ spi@7000d600 { reset-names = "spi"; dmas = <&apbdma 16>, <&apbdma 16>; dma-names = "rx", "tx"; - status = "disabled"; }; diff --git a/Bindings/spi/nvidia,tegra20-sflash.txt b/Bindings/spi/nvidia,tegra20-sflash.txt index bdf08e6dec9b..c212491929b5 100644 --- a/Bindings/spi/nvidia,tegra20-sflash.txt +++ b/Bindings/spi/nvidia,tegra20-sflash.txt @@ -34,5 +34,4 @@ spi@7000c380 { reset-names = "spi"; dmas = <&apbdma 11>, <&apbdma 11>; dma-names = "rx", "tx"; - status = "disabled"; }; diff --git a/Bindings/spi/nvidia,tegra20-slink.txt b/Bindings/spi/nvidia,tegra20-slink.txt index 5db9144a33c8..40d80b93e327 100644 --- a/Bindings/spi/nvidia,tegra20-slink.txt +++ b/Bindings/spi/nvidia,tegra20-slink.txt @@ -34,5 +34,4 @@ spi@7000d600 { reset-names = "spi"; dmas = <&apbdma 16>, <&apbdma 16>; dma-names = "rx", "tx"; - status = "disabled"; }; diff --git a/Bindings/spi/sh-hspi.txt b/Bindings/spi/sh-hspi.txt index 319bad4af875..585fed90376e 100644 --- a/Bindings/spi/sh-hspi.txt +++ b/Bindings/spi/sh-hspi.txt @@ -24,6 +24,5 @@ Example: interrupts = <0 63 IRQ_TYPE_LEVEL_HIGH>; #address-cells = <1>; #size-cells = <0>; - status = "disabled"; }; diff --git a/Bindings/spi/sh-msiof.txt b/Bindings/spi/sh-msiof.txt index 64ee489571c4..e865855726a2 100644 --- a/Bindings/spi/sh-msiof.txt +++ b/Bindings/spi/sh-msiof.txt @@ -6,6 +6,7 @@ Required properties: "renesas,msiof-r8a7792" (R-Car V2H) "renesas,msiof-r8a7793" (R-Car M2-N) "renesas,msiof-r8a7794" (R-Car E2) + "renesas,msiof-r8a7795" (R-Car H3) "renesas,msiof-r8a7796" (R-Car M3-W) "renesas,msiof-sh73a0" (SH-Mobile AG5) "renesas,sh-mobile-msiof" (generic SH-Mobile compatibile device) @@ -78,5 +79,4 @@ Example: dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; - status = "disabled"; }; diff --git a/Bindings/spi/spi-clps711x.txt b/Bindings/spi/spi-clps711x.txt index 4c3ec13f423f..5122dc7860af 100644 --- a/Bindings/spi/spi-clps711x.txt +++ b/Bindings/spi/spi-clps711x.txt @@ -23,7 +23,6 @@ spi@80000500 { reg = <0x80000500 0x4>; interrupts = <15>; clocks = <&clks CLPS711X_CLK_SPI>; - status = "disabled"; }; syscon3: syscon@80002200 { diff --git a/Bindings/spi/spi-fsl-dspi.txt b/Bindings/spi/spi-fsl-dspi.txt index ff5893d275a2..13b1fcc8469e 100644 --- a/Bindings/spi/spi-fsl-dspi.txt +++ b/Bindings/spi/spi-fsl-dspi.txt @@ -39,7 +39,6 @@ dspi0@4002c000 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dspi0_1>; big-endian; - status = "okay"; sflash: at26df081a@0 { #address-cells = <1>; diff --git a/Bindings/spi/spi-mt65xx.txt b/Bindings/spi/spi-mt65xx.txt index e0318cf92d73..236dcb0faf37 100644 --- a/Bindings/spi/spi-mt65xx.txt +++ b/Bindings/spi/spi-mt65xx.txt @@ -57,5 +57,4 @@ spi: spi@1100a000 { clock-names = "parent-clk", "sel-clk", "spi-clk"; cs-gpios = <&pio 105 GPIO_ACTIVE_LOW>, <&pio 72 GPIO_ACTIVE_LOW>; mediatek,pad-select = <1>, <0>; - status = "disabled"; }; diff --git a/Bindings/spi/spi-orion.txt b/Bindings/spi/spi-orion.txt index 4f629cc7634a..df8ec31f2f07 100644 --- a/Bindings/spi/spi-orion.txt +++ b/Bindings/spi/spi-orion.txt @@ -29,7 +29,6 @@ Example: cell-index = <0>; reg = <0x10600 0x28>; interrupts = <23>; - status = "disabled"; }; Example with SPI direct mode support (optionally): @@ -48,7 +47,6 @@ Example with SPI direct mode support (optionally): , /* CS6 */ ; /* CS7 */ interrupts = <23>; - status = "disabled"; }; To enable the direct mode, the board specific 'ranges' property in the diff --git a/Bindings/spi/spi-rockchip.txt b/Bindings/spi/spi-rockchip.txt index 83da4931d832..6e3ffacbba32 100644 --- a/Bindings/spi/spi-rockchip.txt +++ b/Bindings/spi/spi-rockchip.txt @@ -6,6 +6,7 @@ and display controllers using the SPI communication interface. Required Properties: - compatible: should be one of the following. + "rockchip,rv1108-spi" for rv1108 SoCs. "rockchip,rk3036-spi" for rk3036 SoCS. "rockchip,rk3066-spi" for rk3066 SoCs. "rockchip,rk3188-spi" for rk3188 SoCs. diff --git a/Bindings/spi/spi-sun4i.txt b/Bindings/spi/spi-sun4i.txt index de827f5a301e..484bbff5337e 100644 --- a/Bindings/spi/spi-sun4i.txt +++ b/Bindings/spi/spi-sun4i.txt @@ -18,7 +18,6 @@ spi1: spi@01c06000 { interrupts = <11>; clocks = <&ahb_gates 21>, <&spi1_clk>; clock-names = "ahb", "mod"; - status = "disabled"; #address-cells = <1>; #size-cells = <0>; }; diff --git a/Bindings/spi/spi-sun6i.txt b/Bindings/spi/spi-sun6i.txt index 2ec99b86b622..ab1811354cce 100644 --- a/Bindings/spi/spi-sun6i.txt +++ b/Bindings/spi/spi-sun6i.txt @@ -39,7 +39,6 @@ spi0: spi@01c68000 { pinctrl-names = "default"; pinctrl-0 = <&spi0_pins>; resets = <&ccu RST_BUS_SPI0>; - status = "disabled"; #address-cells = <1>; #size-cells = <0>; }; diff --git a/Bindings/spi/spi_atmel.txt b/Bindings/spi/spi_atmel.txt index fb588b3e6a9a..f99c733d75c1 100644 --- a/Bindings/spi/spi_atmel.txt +++ b/Bindings/spi/spi_atmel.txt @@ -26,7 +26,6 @@ spi1: spi@fffcc000 { clock-names = "spi_clk"; cs-gpios = <&pioB 3 0>; atmel,fifo-size = <32>; - status = "okay"; mmc-slot@0 { compatible = "mmc-spi-slot"; diff --git a/Bindings/sram/renesas,smp-sram.txt b/Bindings/sram/renesas,smp-sram.txt new file mode 100644 index 000000000000..712d05e3e15e --- /dev/null +++ b/Bindings/sram/renesas,smp-sram.txt @@ -0,0 +1,27 @@ +* Renesas SMP SRAM + +Renesas R-Car Gen2 and RZ/G1 SoCs need a small piece of SRAM for the jump stub +for secondary CPU bringup and CPU hotplug. +This memory is reserved by adding a child node to a "mmio-sram" node, cfr. +Documentation/devicetree/bindings/sram/sram.txt. + +Required child node properties: + - compatible: Must be "renesas,smp-sram", + - reg: Address and length of the reserved SRAM. + The full physical (bus) address must be aligned to a 256 KiB boundary. + + +Example: + + icram1: sram@e63c0000 { + compatible = "mmio-sram"; + reg = <0 0xe63c0000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0xe63c0000 0x1000>; + + smp-sram@0 { + compatible = "renesas,smp-sram"; + reg = <0 0x10>; + }; + }; diff --git a/Bindings/sram/sunxi-sram.txt b/Bindings/sram/sunxi-sram.txt index 8d5665468fe7..6bb92a1df753 100644 --- a/Bindings/sram/sunxi-sram.txt +++ b/Bindings/sram/sunxi-sram.txt @@ -9,7 +9,9 @@ Controller Node --------------- Required properties: -- compatible : "allwinner,sun4i-a10-sram-controller" +- compatible : should be: + - "allwinner,sun4i-a10-sram-controller" + - "allwinner,sun50i-a64-sram-controller" - reg : sram controller register offset + length SRAM nodes @@ -22,10 +24,13 @@ Each SRAM will have SRAM sections that are going to be handled by the SRAM controller as subnodes. These sections are represented following once again the representation described in the mmio-sram binding. -The valid sections compatible are: +The valid sections compatible for A10 are: - allwinner,sun4i-a10-sram-a3-a4 - allwinner,sun4i-a10-sram-d +The valid sections compatible for A64 are: + - allwinner,sun50i-a64-sram-c + Devices using SRAM sections --------------------------- @@ -59,7 +64,6 @@ sram-controller@01c00000 { emac_sram: sram-section@8000 { compatible = "allwinner,sun4i-a10-sram-a3-a4"; reg = <0x8000 0x4000>; - status = "disabled"; }; }; }; diff --git a/Bindings/thermal/armada-thermal.txt b/Bindings/thermal/armada-thermal.txt index 4698e0edc205..24aacf8948c5 100644 --- a/Bindings/thermal/armada-thermal.txt +++ b/Bindings/thermal/armada-thermal.txt @@ -20,5 +20,4 @@ Example: compatible = "marvell,armada370-thermal"; reg = <0xd0018300 0x4 0xd0018304 0x4>; - status = "okay"; }; diff --git a/Bindings/thermal/exynos-thermal.txt b/Bindings/thermal/exynos-thermal.txt index 70b4c16c7ed8..9b4c7b017495 100644 --- a/Bindings/thermal/exynos-thermal.txt +++ b/Bindings/thermal/exynos-thermal.txt @@ -77,7 +77,6 @@ Example 1): interrupts = <2 4>; clocks = <&clock 383>; clock-names = "tmu_apbif"; - status = "disabled"; vtmu-supply = <&tmu_regulator_node>; #include "exynos4412-tmu-sensor-conf.dtsi" }; diff --git a/Bindings/thermal/mediatek-thermal.txt b/Bindings/thermal/mediatek-thermal.txt index e2f494d74d8a..0d73ea5e9c0c 100644 --- a/Bindings/thermal/mediatek-thermal.txt +++ b/Bindings/thermal/mediatek-thermal.txt @@ -11,6 +11,7 @@ Required properties: - compatible: - "mediatek,mt8173-thermal" : For MT8173 family of SoCs - "mediatek,mt2701-thermal" : For MT2701 family of SoCs + - "mediatek,mt2712-thermal" : For MT2712 family of SoCs - reg: Address range of the thermal controller - interrupts: IRQ for the thermal controller - clocks, clock-names: Clocks needed for the thermal controller. required diff --git a/Bindings/thermal/rcar-gen3-thermal.txt b/Bindings/thermal/rcar-gen3-thermal.txt index 07a9713ae6a7..fdf5caa6229b 100644 --- a/Bindings/thermal/rcar-gen3-thermal.txt +++ b/Bindings/thermal/rcar-gen3-thermal.txt @@ -36,7 +36,6 @@ Example: clocks = <&cpg CPG_MOD 522>; power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; #thermal-sensor-cells = <1>; - status = "okay"; }; thermal-zones { diff --git a/Bindings/thermal/rockchip-thermal.txt b/Bindings/thermal/rockchip-thermal.txt index 43003aec94bd..e3a6234fb1ac 100644 --- a/Bindings/thermal/rockchip-thermal.txt +++ b/Bindings/thermal/rockchip-thermal.txt @@ -4,6 +4,7 @@ Required properties: - compatible : should be "rockchip,-tsadc" "rockchip,rk3228-tsadc": found on RK3228 SoCs "rockchip,rk3288-tsadc": found on RK3288 SoCs + "rockchip,rk3328-tsadc": found on RK3328 SoCs "rockchip,rk3368-tsadc": found on RK3368 SoCs "rockchip,rk3399-tsadc": found on RK3399 SoCs - reg : physical base address of the controller and length of memory mapped diff --git a/Bindings/thermal/uniphier-thermal.txt b/Bindings/thermal/uniphier-thermal.txt new file mode 100644 index 000000000000..686c0b42ed3f --- /dev/null +++ b/Bindings/thermal/uniphier-thermal.txt @@ -0,0 +1,64 @@ +* UniPhier Thermal bindings + +This describes the devicetree bindings for thermal monitor supported by +PVT(Process, Voltage and Temperature) monitoring unit implemented on Socionext +UniPhier SoCs. + +Required properties: +- compatible : + - "socionext,uniphier-pxs2-thermal" : For UniPhier PXs2 SoC + - "socionext,uniphier-ld20-thermal" : For UniPhier LD20 SoC +- interrupts : IRQ for the temperature alarm +- #thermal-sensor-cells : Should be 0. See ./thermal.txt for details. + +Optional properties: +- socionext,tmod-calibration: A pair of calibrated values referred from PVT, + in case that the values aren't set on SoC, + like a reference board. + +Example: + + sysctrl@61840000 { + compatible = "socionext,uniphier-ld20-sysctrl", + "simple-mfd", "syscon"; + reg = <0x61840000 0x10000>; + ... + pvtctl: pvtctl { + compatible = "socionext,uniphier-ld20-thermal"; + interrupts = <0 3 1>; + #thermal-sensor-cells = <0>; + }; + ... + }; + + thermal-zones { + cpu_thermal { + polling-delay-passive = <250>; /* 250ms */ + polling-delay = <1000>; /* 1000ms */ + thermal-sensors = <&pvtctl>; + + trips { + cpu_crit: cpu_crit { + temperature = <110000>; /* 110C */ + hysteresis = <2000>; + type = "critical"; + }; + cpu_alert: cpu_alert { + temperature = <100000>; /* 100C */ + hysteresis = <2000>; + type = "passive"; + }; + }; + + cooling-maps { + map0 { + trip = <&cpu_alert>; + cooling-device = <&cpu0 (-1) (-1)>; + }; + map1 { + trip = <&cpu_alert>; + cooling-device = <&cpu2 (-1) (-1)>; + }; + }; + }; + }; diff --git a/Bindings/timer/nxp,tpm-timer.txt b/Bindings/timer/nxp,tpm-timer.txt new file mode 100644 index 000000000000..b4aa7ddb5b13 --- /dev/null +++ b/Bindings/timer/nxp,tpm-timer.txt @@ -0,0 +1,28 @@ +NXP Low Power Timer/Pulse Width Modulation Module (TPM) + +The Timer/PWM Module (TPM) supports input capture, output compare, +and the generation of PWM signals to control electric motor and power +management applications. The counter, compare and capture registers +are clocked by an asynchronous clock that can remain enabled in low +power modes. TPM can support global counter bus where one TPM drives +the counter bus for the others, provided bit width is the same. + +Required properties: + +- compatible : should be "fsl,imx7ulp-tpm" +- reg : Specifies base physical address and size of the register sets + for the clock event device and clock source device. +- interrupts : Should be the clock event device interrupt. +- clocks : The clocks provided by the SoC to drive the timer, must contain + an entry for each entry in clock-names. +- clock-names : Must include the following entries: "igp" and "per". + +Example: +tpm5: tpm@40260000 { + compatible = "fsl,imx7ulp-tpm"; + reg = <0x40260000 0x1000>; + interrupts = ; + clocks = <&clks IMX7ULP_CLK_NIC1_BUS_DIV>, + <&clks IMX7ULP_CLK_LPTPM5>; + clock-names = "ipg", "per"; +}; diff --git a/Bindings/timer/renesas,cmt.txt b/Bindings/timer/renesas,cmt.txt index 1a05c1b243c1..6ca6b9e582a0 100644 --- a/Bindings/timer/renesas,cmt.txt +++ b/Bindings/timer/renesas,cmt.txt @@ -12,46 +12,29 @@ datasheets. Required Properties: - compatible: must contain one or more of the following: - - "renesas,cmt-32-r8a7740" for the r8a7740 32-bit CMT - (CMT0) - - "renesas,cmt-32-sh7372" for the sh7372 32-bit CMT - (CMT0) - - "renesas,cmt-32-sh73a0" for the sh73a0 32-bit CMT - (CMT0) - - "renesas,cmt-32" for all 32-bit CMT without fast clock support - (CMT0 on sh7372, sh73a0 and r8a7740) - This is a fallback for the above renesas,cmt-32-* entries. - - - "renesas,cmt-32-fast-r8a7740" for the r8a7740 32-bit CMT with fast - clock support (CMT[234]) - - "renesas,cmt-32-fast-sh7372" for the sh7372 32-bit CMT with fast - clock support (CMT[234]) - - "renesas,cmt-32-fast-sh73a0" for the sh73A0 32-bit CMT with fast - clock support (CMT[234]) - - "renesas,cmt-32-fast" for all 32-bit CMT with fast clock support - (CMT[234] on sh7372, sh73a0 and r8a7740) - This is a fallback for the above renesas,cmt-32-fast-* entries. - - - "renesas,cmt-48-sh7372" for the sh7372 48-bit CMT - (CMT1) - "renesas,cmt-48-sh73a0" for the sh73A0 48-bit CMT (CMT1) - "renesas,cmt-48-r8a7740" for the r8a7740 48-bit CMT (CMT1) - "renesas,cmt-48" for all non-second generation 48-bit CMT - (CMT1 on sh7372, sh73a0 and r8a7740) + (CMT1 on sh73a0 and r8a7740) This is a fallback for the above renesas,cmt-48-* entries. - - "renesas,cmt-48-r8a73a4" for the r8a73a4 48-bit CMT - (CMT[01]) - - "renesas,cmt-48-r8a7790" for the r8a7790 48-bit CMT - (CMT[01]) - - "renesas,cmt-48-r8a7791" for the r8a7791 48-bit CMT - (CMT[01]) - - "renesas,cmt-48-gen2" for all second generation 48-bit CMT - (CMT[01] on r8a73a4, r8a7790 and r8a7791) - This is a fallback for the renesas,cmt-48-r8a73a4, - renesas,cmt-48-r8a7790 and renesas,cmt-48-r8a7791 entries. + - "renesas,cmt0-r8a73a4" for the 32-bit CMT0 device included in r8a73a4. + - "renesas,cmt1-r8a73a4" for the 48-bit CMT1 device included in r8a73a4. + - "renesas,cmt0-r8a7790" for the 32-bit CMT0 device included in r8a7790. + - "renesas,cmt1-r8a7790" for the 48-bit CMT1 device included in r8a7790. + - "renesas,cmt0-r8a7791" for the 32-bit CMT0 device included in r8a7791. + - "renesas,cmt1-r8a7791" for the 48-bit CMT1 device included in r8a7791. + - "renesas,cmt0-r8a7793" for the 32-bit CMT0 device included in r8a7793. + - "renesas,cmt1-r8a7793" for the 48-bit CMT1 device included in r8a7793. + - "renesas,cmt0-r8a7794" for the 32-bit CMT0 device included in r8a7794. + - "renesas,cmt1-r8a7794" for the 48-bit CMT1 device included in r8a7794. + + - "renesas,rcar-gen2-cmt0" for 32-bit CMT0 devices included in R-Car Gen2. + - "renesas,rcar-gen2-cmt1" for 48-bit CMT1 devices included in R-Car Gen2. + These are fallbacks for r8a73a4 and all the R-Car Gen2 + entries listed above. - reg: base address and length of the registers block for the timer module. - interrupts: interrupt-specifier for the timer, one per channel. @@ -59,21 +42,29 @@ Required Properties: in clock-names. - clock-names: must contain "fck" for the functional clock. - - renesas,channels-mask: bitmask of the available channels. - -Example: R8A7790 (R-Car H2) CMT0 node - - CMT0 on R8A7790 implements hardware channels 5 and 6 only and names - them channels 0 and 1 in the documentation. +Example: R8A7790 (R-Car H2) CMT0 and CMT1 nodes cmt0: timer@ffca0000 { - compatible = "renesas,cmt-48-r8a7790", "renesas,cmt-48-gen2"; + compatible = "renesas,cmt0-r8a7790", "renesas,rcar-gen2-cmt0"; reg = <0 0xffca0000 0 0x1004>; interrupts = <0 142 IRQ_TYPE_LEVEL_HIGH>, <0 142 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp1_clks R8A7790_CLK_CMT0>; clock-names = "fck"; - - renesas,channels-mask = <0x60>; + }; + + cmt1: timer@e6130000 { + compatible = "renesas,cmt1-r8a7790", "renesas,rcar-gen2-cmt1"; + reg = <0 0xe6130000 0 0x1004>; + interrupts = <0 120 IRQ_TYPE_LEVEL_HIGH>, + <0 121 IRQ_TYPE_LEVEL_HIGH>, + <0 122 IRQ_TYPE_LEVEL_HIGH>, + <0 123 IRQ_TYPE_LEVEL_HIGH>, + <0 124 IRQ_TYPE_LEVEL_HIGH>, + <0 125 IRQ_TYPE_LEVEL_HIGH>, + <0 126 IRQ_TYPE_LEVEL_HIGH>, + <0 127 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&mstp3_clks R8A7790_CLK_CMT1>; + clock-names = "fck"; }; diff --git a/Bindings/trivial-devices.txt b/Bindings/trivial-devices.txt index 35f406dd86b6..af284fbd4d23 100644 --- a/Bindings/trivial-devices.txt +++ b/Bindings/trivial-devices.txt @@ -21,6 +21,16 @@ adi,adt7490 +/-1C TDM Extended Temp Range I.C adi,adxl345 Three-Axis Digital Accelerometer adi,adxl346 Three-Axis Digital Accelerometer (backward-compatibility value "adi,adxl345" must be listed too) ams,iaq-core AMS iAQ-Core VOC Sensor +amstaos,tsl2571 AMS/TAOS ALS and proximity sensor +amstaos,tsl2671 AMS/TAOS ALS and proximity sensor +amstaos,tmd2671 AMS/TAOS ALS and proximity sensor +amstaos,tsl2771 AMS/TAOS ALS and proximity sensor +amstaos,tmd2771 AMS/TAOS ALS and proximity sensor +amstaos,tsl2572 AMS/TAOS ALS and proximity sensor +amstaos,tsl2672 AMS/TAOS ALS and proximity sensor +amstaos,tmd2672 AMS/TAOS ALS and proximity sensor +amstaos,tsl2772 AMS/TAOS ALS and proximity sensor +amstaos,tmd2772 AMS/TAOS ALS and proximity sensor at,24c08 i2c serial eeprom (24cxx) atmel,at97sc3204t i2c trusted platform module (TPM) capella,cm32181 CM32181: Ambient Light Sensor @@ -36,7 +46,9 @@ dallas,ds1775 Tiny Digital Thermometer and Thermostat dallas,ds3232 Extremely Accurate I²C RTC with Integrated Crystal and SRAM dallas,ds4510 CPU Supervisor with Nonvolatile Memory and Programmable I/O dallas,ds75 Digital Thermometer and Thermostat +devantech,srf02 Devantech SRF02 ultrasonic ranger in I2C mode devantech,srf08 Devantech SRF08 ultrasonic ranger +devantech,srf10 Devantech SRF10 ultrasonic ranger dlg,da9053 DA9053: flexible system level PMIC with multicore support dlg,da9063 DA9063: system PMIC for quad-core application processors domintech,dmard09 DMARD09: 3-axis Accelerometer @@ -54,6 +66,7 @@ fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec gmt,g751 G751: Digital Temperature Sensor and Thermal Watchdog with Two-Wire Interface infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz) infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz) +isil,isl1208 Intersil ISL1208 Low Power RTC with Battery Backed SRAM isil,isl29028 Intersil ISL29028 Ambient Light and Proximity Sensor isil,isl29030 Intersil ISL29030 Ambient Light and Proximity Sensor maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator @@ -168,6 +181,7 @@ st,m41t80 M41T80 - SERIAL ACCESS RTC WITH ALARMS taos,tsl2550 Ambient Light Sensor with SMBUS/Two Wire Serial Interface ti,ads7828 8-Channels, 12-bit ADC ti,ads7830 8-Channels, 8-bit ADC +ti,amc6821 Temperature Monitoring and Fan Control ti,tsc2003 I2C Touch-Screen Controller ti,tmp102 Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface ti,tmp103 Low Power Digital Temperature Sensor with SMBUS/Two Wire Serial Interface diff --git a/Bindings/unittest.txt b/Bindings/unittest.txt index 3bf58c20fe94..9a5b311f4434 100644 --- a/Bindings/unittest.txt +++ b/Bindings/unittest.txt @@ -10,7 +10,6 @@ All other properties are optional. Example: unittest { compatible = "unittest"; - status = "okay"; }; 2) OF unittest i2c adapter platform device @@ -25,7 +24,6 @@ Children nodes contain unittest i2c devices. Example: unittest-i2c-bus { compatible = "unittest-i2c-bus"; - status = "okay"; }; 3) OF unittest i2c device @@ -40,7 +38,6 @@ All other properties are optional Example: unittest-i2c-dev { compatible = "unittest-i2c-dev"; - status = "okay"; }; 4) OF unittest i2c mux device @@ -55,7 +52,6 @@ Children nodes contain unittest i2c bus nodes per channel. Example: unittest-i2c-mux { compatible = "unittest-i2c-mux"; - status = "okay"; #address-cells = <1>; #size-cells = <0>; channel-0 { @@ -65,7 +61,6 @@ Example: i2c-dev { reg = <8>; compatible = "unittest-i2c-dev"; - status = "okay"; }; }; }; diff --git a/Bindings/usb/allwinner,sun4i-a10-musb.txt b/Bindings/usb/allwinner,sun4i-a10-musb.txt index d9b42da016f3..cb2bd83fa89a 100644 --- a/Bindings/usb/allwinner,sun4i-a10-musb.txt +++ b/Bindings/usb/allwinner,sun4i-a10-musb.txt @@ -25,5 +25,4 @@ Example: phys = <&usbphy 0>; phy-names = "usb"; extcon = <&usbphy 0>; - status = "disabled"; }; diff --git a/Bindings/usb/am33xx-usb.txt b/Bindings/usb/am33xx-usb.txt index 20c2ff2ba07e..16920d78e1b8 100644 --- a/Bindings/usb/am33xx-usb.txt +++ b/Bindings/usb/am33xx-usb.txt @@ -4,9 +4,9 @@ - reg: offset and length of the usbss register sets - ti,hwmods : must be "usb_otg_hs" -The glue layer contains multiple child nodes. It is required the have +The glue layer contains multiple child nodes. It is required to have at least a control module node, USB node and a PHY node. The second USB -node and its PHY node is optional. The DMA node is also optional. +node and its PHY node are optional. The DMA node is also optional. Reset module ~~~~~~~~~~~~ diff --git a/Bindings/usb/brcm,bdc.txt b/Bindings/usb/brcm,bdc.txt new file mode 100644 index 000000000000..63e63af3bf59 --- /dev/null +++ b/Bindings/usb/brcm,bdc.txt @@ -0,0 +1,29 @@ +Broadcom USB Device Controller (BDC) +==================================== + +Required properties: + +- compatible: must be one of: + "brcm,bdc-v0.16" + "brcm,bdc" +- reg: the base register address and length +- interrupts: the interrupt line for this controller + +Optional properties: + +On Broadcom STB platforms, these properties are required: + +- phys: phandle to one or two USB PHY blocks + NOTE: Some SoC's have a single phy and some have + USB 2.0 and USB 3.0 phys +- clocks: phandle to the functional clock of this block + +Example: + + bdc@f0b02000 { + compatible = "brcm,bdc-v0.16"; + reg = <0xf0b02000 0xfc4>; + interrupts = <0x0 0x60 0x0>; + phys = <&usbphy_0 0x0>; + clocks = <&sw_usbd>; + }; diff --git a/Bindings/usb/da8xx-usb.txt b/Bindings/usb/da8xx-usb.txt index 717c5f656237..9ce22551b2b3 100644 --- a/Bindings/usb/da8xx-usb.txt +++ b/Bindings/usb/da8xx-usb.txt @@ -42,7 +42,6 @@ Example: usb_phy: usb-phy { compatible = "ti,da830-usb-phy"; #phy-cells = <0>; - status = "okay"; }; usb0: usb@200000 { compatible = "ti,da830-musb"; @@ -66,7 +65,6 @@ Example: "rx1", "rx2", "rx3", "rx4", "tx1", "tx2", "tx3", "tx4"; - status = "okay"; cppi41dma: dma-controller@201000 { compatible = "ti,da830-cppi41"; diff --git a/Bindings/usb/dwc3-st.txt b/Bindings/usb/dwc3-st.txt index 50dee3b44665..df0e02e1ee43 100644 --- a/Bindings/usb/dwc3-st.txt +++ b/Bindings/usb/dwc3-st.txt @@ -42,7 +42,6 @@ or "device". Example: st_dwc3: dwc3@8f94000 { - status = "disabled"; compatible = "st,stih407-dwc3"; reg = <0x08f94000 0x1000>, <0x110 0x4>; reg-names = "reg-glue", "syscfg-reg"; diff --git a/Bindings/usb/dwc3-xilinx.txt b/Bindings/usb/dwc3-xilinx.txt index 30361b32a460..4aae5b2cef56 100644 --- a/Bindings/usb/dwc3-xilinx.txt +++ b/Bindings/usb/dwc3-xilinx.txt @@ -18,7 +18,6 @@ Example device node: usb@0 { #address-cells = <0x2>; #size-cells = <0x1>; - status = "okay"; compatible = "xlnx,zynqmp-dwc3"; clock-names = "bus_clk" "ref_clk"; clocks = <&clk125>, <&clk125>; diff --git a/Bindings/usb/ehci-st.txt b/Bindings/usb/ehci-st.txt index 410d922cfdd7..9feea6c3e4d9 100644 --- a/Bindings/usb/ehci-st.txt +++ b/Bindings/usb/ehci-st.txt @@ -31,7 +31,6 @@ Example: clocks = <&clk_s_a1_ls 0>; phys = <&usb2_phy>; phy-names = "usb"; - status = "okay"; resets = <&powerdown STIH416_USB1_POWERDOWN>, <&softreset STIH416_USB1_SOFTRESET>; diff --git a/Bindings/usb/exynos-usb.txt b/Bindings/usb/exynos-usb.txt index 78ebebb66dad..c97374315049 100644 --- a/Bindings/usb/exynos-usb.txt +++ b/Bindings/usb/exynos-usb.txt @@ -40,7 +40,6 @@ Example: port@0 { reg = <0>; phys = <&usb2phy 1>; - status = "disabled"; }; }; @@ -75,7 +74,6 @@ Example: port@0 { reg = <0>; phys = <&usb2phy 1>; - status = "disabled"; }; }; diff --git a/Bindings/usb/fcs,fusb302.txt b/Bindings/usb/fcs,fusb302.txt new file mode 100644 index 000000000000..472facfa5a71 --- /dev/null +++ b/Bindings/usb/fcs,fusb302.txt @@ -0,0 +1,29 @@ +Fairchild FUSB302 Type-C Port controllers + +Required properties : +- compatible : "fcs,fusb302" +- reg : I2C slave address +- interrupts : Interrupt specifier + +Optional properties : +- fcs,max-sink-microvolt : Maximum voltage to negotiate when configured as sink +- fcs,max-sink-microamp : Maximum current to negotiate when configured as sink +- fcs,max-sink-microwatt : Maximum power to negotiate when configured as sink + If this is less then max-sink-microvolt * + max-sink-microamp then the configured current will + be clamped. +- fcs,operating-sink-microwatt : + Minimum amount of power accepted from a sink + when negotiating + +Example: + +fusb302: typec-portc@54 { + compatible = "fcs,fusb302"; + reg = <0x54>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + fcs,max-sink-microvolt = <12000000>; + fcs,max-sink-microamp = <3000000>; + fcs,max-sink-microwatt = <36000000>; +}; diff --git a/Bindings/usb/isp1301.txt b/Bindings/usb/isp1301.txt index 5405d99d9aaa..ecd607dacba5 100644 --- a/Bindings/usb/isp1301.txt +++ b/Bindings/usb/isp1301.txt @@ -21,5 +21,4 @@ Example: interrupt-parent = <&mic>; interrupts = <0x3d 0>, <0x3e 0>, <0x3c 0>, <0x3a 0>; transceiver = <&isp1301>; - status = "okay"; }; diff --git a/Bindings/usb/keystone-usb.txt b/Bindings/usb/keystone-usb.txt index 60527d335b58..f96e09f784cc 100644 --- a/Bindings/usb/keystone-usb.txt +++ b/Bindings/usb/keystone-usb.txt @@ -12,8 +12,21 @@ Required properties: MPU. - ranges: allows valid 1:1 translation between child's address space and parent's address space. - - clocks: Clock IDs array as required by the controller. - - clock-names: names of clocks correseponding to IDs in the clock property. + +SoC-specific Required Properties: +The following are mandatory properties for Keystone 2 66AK2HK, 66AK2L and 66AK2E +SoCs only: + +- clocks: Clock ID for USB functional clock. +- clock-names: Must be "usb". + + +The following are mandatory properties for Keystone 2 66AK2G SoCs only: + +- power-domains: Should contain a phandle to a PM domain provider node + and an args specifier containing the USB device id + value. This property is as per the binding, + Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt Sub-nodes: The dwc3 core should be added as subnode to Keystone DWC3 glue. @@ -31,7 +44,6 @@ Example: clock-names = "usb"; interrupts = ; ranges; - status = "disabled"; dwc3@2690000 { compatible = "synopsys,dwc3"; diff --git a/Bindings/usb/mt8173-xhci.txt b/Bindings/usb/mediatek,mtk-xhci.txt similarity index 85% rename from Bindings/usb/mt8173-xhci.txt rename to Bindings/usb/mediatek,mtk-xhci.txt index 0acfc8acbea1..5611a2e4ddf0 100644 --- a/Bindings/usb/mt8173-xhci.txt +++ b/Bindings/usb/mediatek,mtk-xhci.txt @@ -11,7 +11,11 @@ into two parts. ------------------------------------------------------------------------ Required properties: - - compatible : should contain "mediatek,mt8173-xhci" + - compatible : should be "mediatek,-xhci", "mediatek,mtk-xhci", + soc-model is the name of SoC, such as mt8173, mt2712 etc, when using + "mediatek,mtk-xhci" compatible string, you need SoC specific ones in + addition, one of: + - "mediatek,mt8173-xhci" - reg : specifies physical base address and size of the registers - reg-names: should be "mac" for xHCI MAC and "ippc" for IP port control - interrupts : interrupt used by the controller @@ -68,10 +72,14 @@ usb30: usb@11270000 { In the case, xhci is added as subnode to mtu3. An example and the DT binding details of mtu3 can be found in: -Documentation/devicetree/bindings/usb/mt8173-mtu3.txt +Documentation/devicetree/bindings/usb/mediatek,mtu3.txt Required properties: - - compatible : should contain "mediatek,mt8173-xhci" + - compatible : should be "mediatek,-xhci", "mediatek,mtk-xhci", + soc-model is the name of SoC, such as mt8173, mt2712 etc, when using + "mediatek,mtk-xhci" compatible string, you need SoC specific ones in + addition, one of: + - "mediatek,mt8173-xhci" - reg : specifies physical base address and size of the registers - reg-names: should be "mac" for xHCI MAC - interrupts : interrupt used by the host controller diff --git a/Bindings/usb/mt8173-mtu3.txt b/Bindings/usb/mediatek,mtu3.txt similarity index 91% rename from Bindings/usb/mt8173-mtu3.txt rename to Bindings/usb/mediatek,mtu3.txt index 1d7c3bc677f7..49f54767cd21 100644 --- a/Bindings/usb/mt8173-mtu3.txt +++ b/Bindings/usb/mediatek,mtu3.txt @@ -1,7 +1,11 @@ The device node for Mediatek USB3.0 DRD controller Required properties: - - compatible : should be "mediatek,mt8173-mtu3" + - compatible : should be "mediatek,-mtu3", "mediatek,mtu3", + soc-model is the name of SoC, such as mt8173, mt2712 etc, + when using "mediatek,mtu3" compatible string, you need SoC specific + ones in addition, one of: + - "mediatek,mt8173-mtu3" - reg : specifies physical base address and size of the registers - reg-names: should be "mac" for device IP and "ippc" for IP port control - interrupts : interrupt used by the device IP @@ -44,7 +48,7 @@ Optional properties: Sub-nodes: The xhci should be added as subnode to mtu3 as shown in the following example if host mode is enabled. The DT binding details of xhci can be found in: -Documentation/devicetree/bindings/usb/mt8173-xhci.txt +Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt Example: ssusb: usb@11271000 { @@ -71,7 +75,6 @@ ssusb: usb@11271000 { #address-cells = <2>; #size-cells = <2>; ranges; - status = "disabled"; usb_host: xhci@11270000 { compatible = "mediatek,mt8173-xhci"; @@ -82,6 +85,5 @@ ssusb: usb@11271000 { clocks = <&topckgen CLK_TOP_USB30_SEL>, <&clk26m>; clock-names = "sys_ck", "ref_ck"; vusb33-supply = <&mt6397_vusb_reg>; - status = "disabled"; }; }; diff --git a/Bindings/usb/ohci-st.txt b/Bindings/usb/ohci-st.txt index 6d8393748da2..d893ec9131c3 100644 --- a/Bindings/usb/ohci-st.txt +++ b/Bindings/usb/ohci-st.txt @@ -29,7 +29,6 @@ Example: clock-names = "ic", "clk48"; phys = <&usb2_phy>; phy-names = "usb"; - status = "okay"; resets = <&powerdown STIH416_USB0_POWERDOWN>, <&softreset STIH416_USB0_SOFTRESET>; diff --git a/Bindings/usb/qcom,dwc3.txt b/Bindings/usb/qcom,dwc3.txt index 73cc0963e823..bc8a2fa5d2bf 100644 --- a/Bindings/usb/qcom,dwc3.txt +++ b/Bindings/usb/qcom,dwc3.txt @@ -29,7 +29,6 @@ Example device nodes: clock-names = "ref"; #phy-cells = <0>; - status = "ok"; }; ss_phy: phy@100f8830 { @@ -39,7 +38,6 @@ Example device nodes: clock-names = "ref"; #phy-cells = <0>; - status = "ok"; }; usb3_0: usb30@0 { @@ -51,7 +49,6 @@ Example device nodes: ranges; - status = "ok"; dwc3@10000000 { compatible = "snps,dwc3"; diff --git a/Bindings/usb/renesas_usb3.txt b/Bindings/usb/renesas_usb3.txt index 8d52766f07b9..e28025883b79 100644 --- a/Bindings/usb/renesas_usb3.txt +++ b/Bindings/usb/renesas_usb3.txt @@ -3,20 +3,30 @@ Renesas Electronics USB3.0 Peripheral driver Required properties: - compatible: Must contain one of the following: - "renesas,r8a7795-usb3-peri" + - "renesas,r8a7796-usb3-peri" + - "renesas,rcar-gen3-usb3-peri" for a generic R-Car Gen3 compatible + device + + When compatible with the generic version, nodes must list the + SoC-specific version corresponding to the platform first + followed by the generic version. + - reg: Base address and length of the register for the USB3.0 Peripheral - interrupts: Interrupt specifier for the USB3.0 Peripheral - clocks: clock phandle and specifier pair -Example: +Example of R-Car H3 ES1.x: usb3_peri0: usb@ee020000 { - compatible = "renesas,r8a7795-usb3-peri"; + compatible = "renesas,r8a7795-usb3-peri", + "renesas,rcar-gen3-usb3-peri"; reg = <0 0xee020000 0 0x400>; interrupts = ; clocks = <&cpg CPG_MOD 328>; }; usb3_peri1: usb@ee060000 { - compatible = "renesas,r8a7795-usb3-peri"; + compatible = "renesas,r8a7795-usb3-peri", + "renesas,rcar-gen3-usb3-peri"; reg = <0 0xee060000 0 0x400>; interrupts = ; clocks = <&cpg CPG_MOD 327>; diff --git a/Bindings/usb/rockchip,dwc3.txt b/Bindings/usb/rockchip,dwc3.txt index 0536a938e3ab..50a31536e975 100644 --- a/Bindings/usb/rockchip,dwc3.txt +++ b/Bindings/usb/rockchip,dwc3.txt @@ -29,13 +29,11 @@ Example device nodes: #address-cells = <2>; #size-cells = <2>; ranges; - status = "disabled"; usbdrd_dwc3_0: dwc3@fe800000 { compatible = "snps,dwc3"; reg = <0x0 0xfe800000 0x0 0x100000>; interrupts = ; dr_mode = "otg"; - status = "disabled"; }; }; @@ -48,12 +46,10 @@ Example device nodes: #address-cells = <2>; #size-cells = <2>; ranges; - status = "disabled"; usbdrd_dwc3_1: dwc3@fe900000 { compatible = "snps,dwc3"; reg = <0x0 0xfe900000 0x0 0x100000>; interrupts = ; dr_mode = "otg"; - status = "disabled"; }; }; diff --git a/Bindings/usb/usb-device.txt b/Bindings/usb/usb-device.txt index 1c35e7b665e1..ce02cebac26a 100644 --- a/Bindings/usb/usb-device.txt +++ b/Bindings/usb/usb-device.txt @@ -2,7 +2,7 @@ Generic USB Device Properties Usually, we only use device tree for hard wired USB device. The reference binding doc is from: -http://www.firmware.org/1275/bindings/usb/usb-1_0.ps +http://www.devicetree.org/open-firmware/bindings/usb/usb-1_0.ps Required properties: - compatible: usbVID,PID. The textual representation of VID, PID shall @@ -16,7 +16,6 @@ Required properties: Example: &usb1 { - status = "okay"; #address-cells = <1>; #size-cells = <0>; diff --git a/Bindings/vendor-prefixes.txt b/Bindings/vendor-prefixes.txt index daf465bef758..1afd298eddd7 100644 --- a/Bindings/vendor-prefixes.txt +++ b/Bindings/vendor-prefixes.txt @@ -3,12 +3,13 @@ Device tree binding vendor prefix registry. Keep list in alphabetical order. This isn't an exhaustive list, but you should add new prefixes to it before using them to avoid name-space collisions. -abcn Abracon Corporation abilis Abilis Systems +abracon Abracon Corporation actions Actions Semiconductor Co., Ltd. active-semi Active-Semi International Inc ad Avionic Design GmbH adapteva Adapteva, Inc. +adaptrum Adaptrum, Inc. adh AD Holdings Plc. adi Analog Devices, Inc. advantech Advantech Corporation @@ -47,6 +48,7 @@ avic Shanghai AVIC Optoelectronics Co., Ltd. axentia Axentia Technologies AB axis Axis Communications AB bananapi BIPAI KEJI LIMITED +bhf Beckhoff Automation GmbH & Co. KG boe BOE Technology Group Co., Ltd. bosch Bosch Sensortec GmbH boundary Boundary Devices Inc. @@ -88,6 +90,7 @@ dlg Dialog Semiconductor dlink D-Link Corporation dmo Data Modul AG domintech Domintech Co., Ltd. +dongwoon Dongwoon Anatech dptechnics DPTechnics dragino Dragino Technology Co., Limited ea Embedded Artists AB @@ -175,6 +178,7 @@ kosagi Sutajio Ko-Usagi PTE Ltd. kyo Kyocera Corporation lacie LaCie lantiq Lantiq Semiconductor +lattice Lattice Semiconductor lego LEGO Systems A/S lenovo Lenovo Group Ltd. lg LG Corporation @@ -195,6 +199,7 @@ mediatek MediaTek Inc. megachips MegaChips melexis Melexis N.V. melfas MELFAS Inc. +mellanox Mellanox Technologies memsic MEMSIC Inc. merrii Merrii Technology Co., Ltd. micrel Micrel Inc. @@ -206,7 +211,7 @@ miramems MiraMEMS Sensing Technology Co., Ltd. mitsubishi Mitsubishi Electric Corporation mosaixtech Mosaix Technologies, Inc. motorola Motorola, Inc. -moxa Moxa +moxa Moxa Inc. mpl MPL AG mqmaker mqmaker Inc. msi Micro-Star International Co. Ltd. @@ -249,6 +254,7 @@ oxsemi Oxford Semiconductor, Ltd. panasonic Panasonic Corporation parade Parade Technologies Inc. pericom Pericom Technology Inc. +pervasive Pervasive Displays, Inc. phytec PHYTEC Messtechnik GmbH picochip Picochip Ltd pine64 Pine64 @@ -287,6 +293,7 @@ schindler Schindler seagate Seagate Technology PLC semtech Semtech Corporation sensirion Sensirion AG +sff Small Form Factor Committee sgx SGX Sensortech sharp Sharp Corporation si-en Si-En Technology Ltd. @@ -341,6 +348,7 @@ tpo TPO tronfy Tronfy tronsmart Tronsmart truly Truly Semiconductors Limited +tsd Theobroma Systems Design und Consulting GmbH tyan Tyan Computer Corporation ucrobotics uCRobotics udoo Udoo @@ -353,6 +361,7 @@ variscite Variscite Ltd. via VIA Technologies, Inc. virtio Virtual I/O Device Specification, developed by the OASIS consortium vivante Vivante Corporation +vocore VoCore Studio voipac Voipac Technologies s.r.o. wd Western Digital Corp. wetek WeTek Electronics, limited. diff --git a/Bindings/w1/fsl-imx-owire.txt b/Bindings/w1/fsl-imx-owire.txt index ecf42c07684d..cbaa6467ab2c 100644 --- a/Bindings/w1/fsl-imx-owire.txt +++ b/Bindings/w1/fsl-imx-owire.txt @@ -15,5 +15,4 @@ owire: owire@63fa4000 { compatible = "fsl,imx53-owire", "fsl,imx21-owire"; reg = <0x63fa4000 0x4000>; clocks = <&clks 159>; - status = "disabled"; }; diff --git a/Bindings/watchdog/aspeed-wdt.txt b/Bindings/watchdog/aspeed-wdt.txt index c5e74d7b4406..c5077a1f5cb3 100644 --- a/Bindings/watchdog/aspeed-wdt.txt +++ b/Bindings/watchdog/aspeed-wdt.txt @@ -8,9 +8,49 @@ Required properties: - reg: physical base address of the controller and length of memory mapped region +Optional properties: + + - aspeed,reset-type = "cpu|soc|system|none" + + Reset behavior - Whenever a timeout occurs the watchdog can be programmed + to generate one of three different, mutually exclusive, types of resets. + + Type "none" can be specified to indicate that no resets are to be done. + This is useful in situations where another watchdog engine on chip is + to perform the reset. + + If 'aspeed,reset-type=' is not specfied the default is to enable system + reset. + + Reset types: + + - cpu: Reset CPU on watchdog timeout + + - soc: Reset 'System on Chip' on watchdog timeout + + - system: Reset system on watchdog timeout + + - none: No reset is performed on timeout. Assumes another watchdog + engine is responsible for this. + + - aspeed,alt-boot: If property is present then boot from alternate block. + - aspeed,external-signal: If property is present then signal is sent to + external reset counter (only WDT1 and WDT2). If not + specified no external signal is sent. + - aspeed,ext-pulse-duration: External signal pulse duration in microseconds + +Optional properties for AST2500-compatible watchdogs: + - aspeed,ext-push-pull: If aspeed,external-signal is present, set the pin's + drive type to push-pull. The default is open-drain. + - aspeed,ext-active-high: If aspeed,external-signal is present and and the pin + is configured as push-pull, then set the pulse + polarity to active-high. The default is active-low. + Example: wdt1: watchdog@1e785000 { compatible = "aspeed,ast2400-wdt"; reg = <0x1e785000 0x1c>; + aspeed,reset-type = "system"; + aspeed,external-signal; }; diff --git a/Bindings/watchdog/atmel-sama5d4-wdt.txt b/Bindings/watchdog/atmel-sama5d4-wdt.txt index f7cc7c060910..4fec1e3725b4 100644 --- a/Bindings/watchdog/atmel-sama5d4-wdt.txt +++ b/Bindings/watchdog/atmel-sama5d4-wdt.txt @@ -31,5 +31,4 @@ Example: atmel,watchdog-type = "hardware"; atmel,dbg-halt; atmel,idle-halt; - status = "okay"; }; diff --git a/Bindings/watchdog/atmel-wdt.txt b/Bindings/watchdog/atmel-wdt.txt index 86fa6de1019b..711a880b3d3b 100644 --- a/Bindings/watchdog/atmel-wdt.txt +++ b/Bindings/watchdog/atmel-wdt.txt @@ -48,5 +48,4 @@ Example: atmel,idle-halt; atmel,max-heartbeat-sec = <16>; atmel,min-heartbeat-sec = <0>; - status = "okay"; }; diff --git a/Bindings/watchdog/lantiq-wdt.txt b/Bindings/watchdog/lantiq-wdt.txt new file mode 100644 index 000000000000..18d4d8302702 --- /dev/null +++ b/Bindings/watchdog/lantiq-wdt.txt @@ -0,0 +1,24 @@ +Lantiq WTD watchdog binding +============================ + +This describes the binding of the Lantiq watchdog driver. + +------------------------------------------------------------------------------- +Required properties: +- compatible : Should be one of + "lantiq,wdt" + "lantiq,xrx100-wdt" + "lantiq,xrx200-wdt", "lantiq,xrx100-wdt" + "lantiq,falcon-wdt" +- reg : Address of the watchdog block +- lantiq,rcu : A phandle to the RCU syscon (required for + "lantiq,falcon-wdt" and "lantiq,xrx100-wdt") + +------------------------------------------------------------------------------- +Example for the watchdog on the xRX200 SoCs: + watchdog@803f0 { + compatible = "lantiq,xrx200-wdt", "lantiq,xrx100-wdt"; + reg = <0x803f0 0x10>; + + lantiq,rcu = <&rcu0>; + }; diff --git a/Bindings/watchdog/marvel.txt b/Bindings/watchdog/marvel.txt index 858ed9221ac4..c1b67a78f00c 100644 --- a/Bindings/watchdog/marvel.txt +++ b/Bindings/watchdog/marvel.txt @@ -41,6 +41,5 @@ Example: reg = <0x20300 0x28>, <0x20108 0x4>; interrupts = <3>; timeout-sec = <10>; - status = "okay"; clocks = <&gate_clk 7>; }; diff --git a/Bindings/watchdog/meson-wdt.txt b/Bindings/watchdog/meson-wdt.txt index ae70185d96e6..8a6d84cb36c9 100644 --- a/Bindings/watchdog/meson-wdt.txt +++ b/Bindings/watchdog/meson-wdt.txt @@ -2,7 +2,11 @@ Meson SoCs Watchdog timer Required properties: -- compatible : should be "amlogic,meson6-wdt" or "amlogic,meson8b-wdt" +- compatible : depending on the SoC this should be one of: + "amlogic,meson6-wdt" on Meson6 SoCs + "amlogic,meson8-wdt" and "amlogic,meson6-wdt" on Meson8 SoCs + "amlogic,meson8b-wdt" on Meson8b SoCs + "amlogic,meson8m2-wdt" and "amlogic,meson8b-wdt" on Meson8m2 SoCs - reg : Specifies base physical address and size of the registers. Example: diff --git a/Bindings/watchdog/mtk-wdt.txt b/Bindings/watchdog/mtk-wdt.txt index 6a00939a059a..235de0683bb6 100644 --- a/Bindings/watchdog/mtk-wdt.txt +++ b/Bindings/watchdog/mtk-wdt.txt @@ -3,9 +3,11 @@ Mediatek SoCs Watchdog timer Required properties: - compatible should contain: - * "mediatek,mt2701-wdt" for MT2701 compatible watchdog timers - * "mediatek,mt6589-wdt" for all compatible watchdog timers (MT2701, - MT6589) + "mediatek,mt2701-wdt", "mediatek,mt6589-wdt": for MT2701 + "mediatek,mt6589-wdt": for MT6589 + "mediatek,mt6797-wdt", "mediatek,mt6589-wdt": for MT6797 + "mediatek,mt7622-wdt", "mediatek,mt6589-wdt": for MT7622 + "mediatek,mt7623-wdt", "mediatek,mt6589-wdt": for MT7623 - reg : Specifies base physical address and size of the registers. diff --git a/Bindings/watchdog/renesas-wdt.txt b/Bindings/watchdog/renesas-wdt.txt index 9e306afbbd49..bf6d1ca58af7 100644 --- a/Bindings/watchdog/renesas-wdt.txt +++ b/Bindings/watchdog/renesas-wdt.txt @@ -6,6 +6,7 @@ Required properties: Examples with soctypes are: - "renesas,r8a7795-wdt" (R-Car H3) - "renesas,r8a7796-wdt" (R-Car M3-W) + - "renesas,r8a77995-wdt" (R-Car D3) - "renesas,r7s72100-wdt" (RZ/A1) When compatible with the generic version, nodes must list the SoC-specific diff --git a/Bindings/xilinx.txt b/Bindings/xilinx.txt index 299d0923537b..1d11b9002ef8 100644 --- a/Bindings/xilinx.txt +++ b/Bindings/xilinx.txt @@ -281,6 +281,8 @@ capabilities of the underlying ICAP hardware differ between different families. May be 'virtex2p', 'virtex4', or 'virtex5'. + - compatible : should contain "xlnx,xps-hwicap-1.00.a" or + "xlnx,opb-hwicap-1.00.b". vi) Xilinx Uart 16550 diff --git a/include/dt-bindings/clock/berlin2.h b/include/dt-bindings/clock/berlin2.h index 0c30800175df..b07b8efab075 100644 --- a/include/dt-bindings/clock/berlin2.h +++ b/include/dt-bindings/clock/berlin2.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Berlin2 BG2/BG2CD clock tree IDs */ diff --git a/include/dt-bindings/clock/berlin2q.h b/include/dt-bindings/clock/berlin2q.h index 72eaf91c9ca6..44b4ac382850 100644 --- a/include/dt-bindings/clock/berlin2q.h +++ b/include/dt-bindings/clock/berlin2q.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Berlin2 BG2Q clock tree IDs */ diff --git a/include/dt-bindings/clock/cortina,gemini-clock.h b/include/dt-bindings/clock/cortina,gemini-clock.h index acf5cd550b0c..04c3404b2d33 100644 --- a/include/dt-bindings/clock/cortina,gemini-clock.h +++ b/include/dt-bindings/clock/cortina,gemini-clock.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef DT_BINDINGS_CORTINA_GEMINI_CLOCK_H #define DT_BINDINGS_CORTINA_GEMINI_CLOCK_H diff --git a/include/dt-bindings/clock/efm32-cmu.h b/include/dt-bindings/clock/efm32-cmu.h index b21b91e736af..4b48d15fe194 100644 --- a/include/dt-bindings/clock/efm32-cmu.h +++ b/include/dt-bindings/clock/efm32-cmu.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_BINDINGS_CLOCK_EFM32_CMU_H #define __DT_BINDINGS_CLOCK_EFM32_CMU_H diff --git a/include/dt-bindings/clock/exynos-audss-clk.h b/include/dt-bindings/clock/exynos-audss-clk.h index 0ae6f5a75d2a..eee9fcc6e6af 100644 --- a/include/dt-bindings/clock/exynos-audss-clk.h +++ b/include/dt-bindings/clock/exynos-audss-clk.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for Samsung audio subsystem * clock controller. diff --git a/include/dt-bindings/clock/gxbb-aoclkc.h b/include/dt-bindings/clock/gxbb-aoclkc.h index 31751482d13c..9d15e2221fdb 100644 --- a/include/dt-bindings/clock/gxbb-aoclkc.h +++ b/include/dt-bindings/clock/gxbb-aoclkc.h @@ -62,5 +62,6 @@ #define CLKID_AO_UART1 3 #define CLKID_AO_UART2 4 #define CLKID_AO_IR_BLASTER 5 +#define CLKID_AO_CEC_32K 6 #endif diff --git a/include/dt-bindings/clock/gxbb-clkc.h b/include/dt-bindings/clock/gxbb-clkc.h index e3e9f7919c31..8c92528aa48a 100644 --- a/include/dt-bindings/clock/gxbb-clkc.h +++ b/include/dt-bindings/clock/gxbb-clkc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * GXBB clock tree IDs */ @@ -5,37 +6,96 @@ #ifndef __GXBB_CLKC_H #define __GXBB_CLKC_H +#define CLKID_SYS_PLL 0 #define CLKID_HDMI_PLL 2 +#define CLKID_FIXED_PLL 3 #define CLKID_FCLK_DIV2 4 #define CLKID_FCLK_DIV3 5 #define CLKID_FCLK_DIV4 6 +#define CLKID_FCLK_DIV5 7 +#define CLKID_FCLK_DIV7 8 #define CLKID_GP0_PLL 9 #define CLKID_CLK81 12 +#define CLKID_MPLL0 13 +#define CLKID_MPLL1 14 #define CLKID_MPLL2 15 +#define CLKID_DDR 16 +#define CLKID_DOS 17 +#define CLKID_ISA 18 +#define CLKID_PL301 19 +#define CLKID_PERIPHS 20 #define CLKID_SPICC 21 #define CLKID_I2C 22 #define CLKID_SAR_ADC 23 +#define CLKID_SMART_CARD 24 #define CLKID_RNG0 25 #define CLKID_UART0 26 +#define CLKID_SDHC 27 +#define CLKID_STREAM 28 +#define CLKID_ASYNC_FIFO 29 +#define CLKID_SDIO 30 +#define CLKID_ABUF 31 +#define CLKID_HIU_IFACE 32 +#define CLKID_ASSIST_MISC 33 #define CLKID_SPI 34 #define CLKID_ETH 36 +#define CLKID_I2S_SPDIF 35 +#define CLKID_DEMUX 37 #define CLKID_AIU_GLUE 38 #define CLKID_IEC958 39 #define CLKID_I2S_OUT 40 +#define CLKID_AMCLK 41 +#define CLKID_AIFIFO2 42 +#define CLKID_MIXER 43 #define CLKID_MIXER_IFACE 44 +#define CLKID_ADC 45 +#define CLKID_BLKMV 46 #define CLKID_AIU 47 #define CLKID_UART1 48 +#define CLKID_G2D 49 #define CLKID_USB0 50 #define CLKID_USB1 51 +#define CLKID_RESET 52 +#define CLKID_NAND 53 +#define CLKID_DOS_PARSER 54 #define CLKID_USB 55 +#define CLKID_VDIN1 56 +#define CLKID_AHB_ARB0 57 +#define CLKID_EFUSE 58 +#define CLKID_BOOT_ROM 59 +#define CLKID_AHB_DATA_BUS 60 +#define CLKID_AHB_CTRL_BUS 61 +#define CLKID_HDMI_INTR_SYNC 62 #define CLKID_HDMI_PCLK 63 #define CLKID_USB1_DDR_BRIDGE 64 #define CLKID_USB0_DDR_BRIDGE 65 +#define CLKID_MMC_PCLK 66 +#define CLKID_DVIN 67 #define CLKID_UART2 68 #define CLKID_SANA 69 +#define CLKID_VPU_INTR 70 +#define CLKID_SEC_AHB_AHB3_BRIDGE 71 +#define CLKID_CLK81_A53 72 +#define CLKID_VCLK2_VENCI0 73 +#define CLKID_VCLK2_VENCI1 74 +#define CLKID_VCLK2_VENCP0 75 +#define CLKID_VCLK2_VENCP1 76 #define CLKID_GCLK_VENCI_INT0 77 +#define CLKID_GCLK_VENCI_INT 78 +#define CLKID_DAC_CLK 79 #define CLKID_AOCLK_GATE 80 #define CLKID_IEC958_GATE 81 +#define CLKID_ENC480P 82 +#define CLKID_RNG1 83 +#define CLKID_GCLK_VENCI_INT1 84 +#define CLKID_VCLK2_VENCLMCC 85 +#define CLKID_VCLK2_VENCL 86 +#define CLKID_VCLK_OTHER 87 +#define CLKID_EDP 88 +#define CLKID_AO_MEDIA_CPU 89 +#define CLKID_AO_AHB_SRAM 90 +#define CLKID_AO_AHB_BUS 91 +#define CLKID_AO_IFACE 92 #define CLKID_AO_I2C 93 #define CLKID_SD_EMMC_A 94 #define CLKID_SD_EMMC_B 95 @@ -50,5 +110,9 @@ #define CLKID_CTS_AMCLK 107 #define CLKID_CTS_MCLK_I958 110 #define CLKID_CTS_I958 113 +#define CLKID_32K_CLK 114 +#define CLKID_SD_EMMC_A_CLK0 119 +#define CLKID_SD_EMMC_B_CLK0 122 +#define CLKID_SD_EMMC_C_CLK0 125 #endif /* __GXBB_CLKC_H */ diff --git a/include/dt-bindings/clock/jz4740-cgu.h b/include/dt-bindings/clock/jz4740-cgu.h index 43153d3e9bd2..6ed83f926ae7 100644 --- a/include/dt-bindings/clock/jz4740-cgu.h +++ b/include/dt-bindings/clock/jz4740-cgu.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides clock numbers for the ingenic,jz4740-cgu DT binding. * diff --git a/include/dt-bindings/clock/jz4780-cgu.h b/include/dt-bindings/clock/jz4780-cgu.h index 467165e3cfee..1859ce53ee38 100644 --- a/include/dt-bindings/clock/jz4780-cgu.h +++ b/include/dt-bindings/clock/jz4780-cgu.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides clock numbers for the ingenic,jz4780-cgu DT binding. * diff --git a/include/dt-bindings/clock/marvell,mmp2.h b/include/dt-bindings/clock/marvell,mmp2.h index 7a510384a82a..228a5e234af0 100644 --- a/include/dt-bindings/clock/marvell,mmp2.h +++ b/include/dt-bindings/clock/marvell,mmp2.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DTS_MARVELL_MMP2_CLOCK_H #define __DTS_MARVELL_MMP2_CLOCK_H diff --git a/include/dt-bindings/clock/marvell,pxa168.h b/include/dt-bindings/clock/marvell,pxa168.h index 3e45bdfe1aa4..caf90436b848 100644 --- a/include/dt-bindings/clock/marvell,pxa168.h +++ b/include/dt-bindings/clock/marvell,pxa168.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DTS_MARVELL_PXA168_CLOCK_H #define __DTS_MARVELL_PXA168_CLOCK_H diff --git a/include/dt-bindings/clock/marvell,pxa1928.h b/include/dt-bindings/clock/marvell,pxa1928.h index d4f2e18919ff..5dca4820297f 100644 --- a/include/dt-bindings/clock/marvell,pxa1928.h +++ b/include/dt-bindings/clock/marvell,pxa1928.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DTS_MARVELL_PXA1928_CLOCK_H #define __DTS_MARVELL_PXA1928_CLOCK_H diff --git a/include/dt-bindings/clock/marvell,pxa910.h b/include/dt-bindings/clock/marvell,pxa910.h index 135082a0b62f..7bf46238946e 100644 --- a/include/dt-bindings/clock/marvell,pxa910.h +++ b/include/dt-bindings/clock/marvell,pxa910.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DTS_MARVELL_PXA910_CLOCK_H #define __DTS_MARVELL_PXA910_CLOCK_H diff --git a/include/dt-bindings/clock/meson8b-clkc.h b/include/dt-bindings/clock/meson8b-clkc.h index e29227fb52a1..dea9d46d4fa7 100644 --- a/include/dt-bindings/clock/meson8b-clkc.h +++ b/include/dt-bindings/clock/meson8b-clkc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Meson8b clock tree IDs */ @@ -21,15 +22,85 @@ #define CLKID_ZERO 13 #define CLKID_MPEG_SEL 14 #define CLKID_MPEG_DIV 15 +#define CLKID_DDR 16 +#define CLKID_DOS 17 +#define CLKID_ISA 18 +#define CLKID_PL301 19 +#define CLKID_PERIPHS 20 +#define CLKID_SPICC 21 +#define CLKID_I2C 22 #define CLKID_SAR_ADC 23 +#define CLKID_SMART_CARD 24 #define CLKID_RNG0 25 +#define CLKID_UART0 26 +#define CLKID_SDHC 27 +#define CLKID_STREAM 28 +#define CLKID_ASYNC_FIFO 29 #define CLKID_SDIO 30 +#define CLKID_ABUF 31 +#define CLKID_HIU_IFACE 32 +#define CLKID_ASSIST_MISC 33 +#define CLKID_SPI 34 +#define CLKID_I2S_SPDIF 35 #define CLKID_ETH 36 +#define CLKID_DEMUX 37 +#define CLKID_AIU_GLUE 38 +#define CLKID_IEC958 39 +#define CLKID_I2S_OUT 40 +#define CLKID_AMCLK 41 +#define CLKID_AIFIFO2 42 +#define CLKID_MIXER 43 +#define CLKID_MIXER_IFACE 44 +#define CLKID_ADC 45 +#define CLKID_BLKMV 46 +#define CLKID_AIU 47 +#define CLKID_UART1 48 +#define CLKID_G2D 49 #define CLKID_USB0 50 #define CLKID_USB1 51 +#define CLKID_RESET 52 +#define CLKID_NAND 53 +#define CLKID_DOS_PARSER 54 #define CLKID_USB 55 +#define CLKID_VDIN1 56 +#define CLKID_AHB_ARB0 57 +#define CLKID_EFUSE 58 +#define CLKID_BOOT_ROM 59 +#define CLKID_AHB_DATA_BUS 60 +#define CLKID_AHB_CTRL_BUS 61 +#define CLKID_HDMI_INTR_SYNC 62 +#define CLKID_HDMI_PCLK 63 #define CLKID_USB1_DDR_BRIDGE 64 #define CLKID_USB0_DDR_BRIDGE 65 +#define CLKID_MMC_PCLK 66 +#define CLKID_DVIN 67 +#define CLKID_UART2 68 #define CLKID_SANA 69 +#define CLKID_VPU_INTR 70 +#define CLKID_SEC_AHB_AHB3_BRIDGE 71 +#define CLKID_CLK81_A9 72 +#define CLKID_VCLK2_VENCI0 73 +#define CLKID_VCLK2_VENCI1 74 +#define CLKID_VCLK2_VENCP0 75 +#define CLKID_VCLK2_VENCP1 76 +#define CLKID_GCLK_VENCI_INT 77 +#define CLKID_GCLK_VENCP_INT 78 +#define CLKID_DAC_CLK 79 +#define CLKID_AOCLK_GATE 80 +#define CLKID_IEC958_GATE 81 +#define CLKID_ENC480P 82 +#define CLKID_RNG1 83 +#define CLKID_GCLK_VENCL_INT 84 +#define CLKID_VCLK2_VENCLMCC 85 +#define CLKID_VCLK2_VENCL 86 +#define CLKID_VCLK2_OTHER 87 +#define CLKID_EDP 88 +#define CLKID_AO_MEDIA_CPU 89 +#define CLKID_AO_AHB_SRAM 90 +#define CLKID_AO_AHB_BUS 91 +#define CLKID_AO_IFACE 92 +#define CLKID_MPLL0 93 +#define CLKID_MPLL1 94 +#define CLKID_MPLL2 95 #endif /* __MESON8B_CLKC_H */ diff --git a/include/dt-bindings/clock/mpc512x-clock.h b/include/dt-bindings/clock/mpc512x-clock.h index 4f94919327ce..13c316bf2796 100644 --- a/include/dt-bindings/clock/mpc512x-clock.h +++ b/include/dt-bindings/clock/mpc512x-clock.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for MPC512x clock specs in DT bindings. */ diff --git a/include/dt-bindings/clock/qcom,gcc-msm8996.h b/include/dt-bindings/clock/qcom,gcc-msm8996.h index 1f5c42254798..75b07cf5eed0 100644 --- a/include/dt-bindings/clock/qcom,gcc-msm8996.h +++ b/include/dt-bindings/clock/qcom,gcc-msm8996.h @@ -233,6 +233,8 @@ #define GCC_PCIE_CLKREF_CLK 216 #define GCC_RX2_USB2_CLKREF_CLK 217 #define GCC_RX1_USB2_CLKREF_CLK 218 +#define GCC_HLOS1_VOTE_LPASS_CORE_SMMU_CLK 219 +#define GCC_HLOS1_VOTE_LPASS_ADSP_SMMU_CLK 220 #define GCC_SYSTEM_NOC_BCR 0 #define GCC_CONFIG_NOC_BCR 1 diff --git a/include/dt-bindings/clock/r8a77995-cpg-mssr.h b/include/dt-bindings/clock/r8a77995-cpg-mssr.h new file mode 100644 index 000000000000..4e8ae3dee590 --- /dev/null +++ b/include/dt-bindings/clock/r8a77995-cpg-mssr.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2017 Glider bvba + * + * 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. + */ +#ifndef __DT_BINDINGS_CLOCK_R8A77995_CPG_MSSR_H__ +#define __DT_BINDINGS_CLOCK_R8A77995_CPG_MSSR_H__ + +#include + +/* r8a77995 CPG Core Clocks */ +#define R8A77995_CLK_Z2 0 +#define R8A77995_CLK_ZG 1 +#define R8A77995_CLK_ZTR 2 +#define R8A77995_CLK_ZT 3 +#define R8A77995_CLK_ZX 4 +#define R8A77995_CLK_S0D1 5 +#define R8A77995_CLK_S1D1 6 +#define R8A77995_CLK_S1D2 7 +#define R8A77995_CLK_S1D4 8 +#define R8A77995_CLK_S2D1 9 +#define R8A77995_CLK_S2D2 10 +#define R8A77995_CLK_S2D4 11 +#define R8A77995_CLK_S3D1 12 +#define R8A77995_CLK_S3D2 13 +#define R8A77995_CLK_S3D4 14 +#define R8A77995_CLK_S1D4C 15 +#define R8A77995_CLK_S3D1C 16 +#define R8A77995_CLK_S3D2C 17 +#define R8A77995_CLK_S3D4C 18 +#define R8A77995_CLK_LB 19 +#define R8A77995_CLK_CL 20 +#define R8A77995_CLK_ZB3 21 +#define R8A77995_CLK_ZB3D2 22 +#define R8A77995_CLK_CR 23 +#define R8A77995_CLK_CRD2 24 +#define R8A77995_CLK_SD0H 25 +#define R8A77995_CLK_SD0 26 +#define R8A77995_CLK_SSP2 27 +#define R8A77995_CLK_SSP1 28 +#define R8A77995_CLK_RPC 29 +#define R8A77995_CLK_RPCD2 30 +#define R8A77995_CLK_ZA2 31 +#define R8A77995_CLK_ZA8 32 +#define R8A77995_CLK_Z2D 33 +#define R8A77995_CLK_CANFD 34 +#define R8A77995_CLK_MSO 35 +#define R8A77995_CLK_R 36 +#define R8A77995_CLK_OSC 37 +#define R8A77995_CLK_LV0 38 +#define R8A77995_CLK_LV1 39 +#define R8A77995_CLK_CP 40 + +#endif /* __DT_BINDINGS_CLOCK_R8A77995_CPG_MSSR_H__ */ diff --git a/include/dt-bindings/clock/rk3228-cru.h b/include/dt-bindings/clock/rk3228-cru.h index 56f841c22801..55655ab0a4c4 100644 --- a/include/dt-bindings/clock/rk3228-cru.h +++ b/include/dt-bindings/clock/rk3228-cru.h @@ -49,6 +49,7 @@ #define SCLK_EMMC_DRV 117 #define SCLK_SDMMC_SAMPLE 118 #define SCLK_SDIO_SAMPLE 119 +#define SCLK_SDIO_SRC 120 #define SCLK_EMMC_SAMPLE 121 #define SCLK_VOP 122 #define SCLK_HDMI_HDCP 123 diff --git a/include/dt-bindings/clock/rockchip,rk808.h b/include/dt-bindings/clock/rockchip,rk808.h index 1a873432f965..75dabfc6adc1 100644 --- a/include/dt-bindings/clock/rockchip,rk808.h +++ b/include/dt-bindings/clock/rockchip,rk808.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants clk index RK808 pmic clkout */ diff --git a/include/dt-bindings/clock/rv1108-cru.h b/include/dt-bindings/clock/rv1108-cru.h index ae26f8105914..d8d0e0456dc2 100644 --- a/include/dt-bindings/clock/rv1108-cru.h +++ b/include/dt-bindings/clock/rv1108-cru.h @@ -43,12 +43,74 @@ #define SCLK_SDMMC_SAMPLE 84 #define SCLK_SDIO_SAMPLE 85 #define SCLK_EMMC_SAMPLE 86 +#define SCLK_VENC_CORE 87 +#define SCLK_HEVC_CORE 88 +#define SCLK_HEVC_CABAC 89 +#define SCLK_PWM0_PMU 90 +#define SCLK_I2C0_PMU 91 +#define SCLK_WIFI 92 +#define SCLK_CIFOUT 93 +#define SCLK_MIPI_CSI_OUT 94 +#define SCLK_CIF0 95 +#define SCLK_CIF1 96 +#define SCLK_CIF2 97 +#define SCLK_CIF3 98 +#define SCLK_DSP 99 +#define SCLK_DSP_IOP 100 +#define SCLK_DSP_EPP 101 +#define SCLK_DSP_EDP 102 +#define SCLK_DSP_EDAP 103 +#define SCLK_CVBS_HOST 104 +#define SCLK_HDMI_SFR 105 +#define SCLK_HDMI_CEC 106 +#define SCLK_CRYPTO 107 +#define SCLK_SPI 108 +#define SCLK_SARADC 109 +#define SCLK_TSADC 110 +#define SCLK_MAC_PRE 111 +#define SCLK_MAC 112 +#define SCLK_MAC_RX 113 +#define SCLK_MAC_REF 114 +#define SCLK_MAC_REFOUT 115 +#define SCLK_DSP_PFM 116 +#define SCLK_RGA 117 +#define SCLK_I2C1 118 +#define SCLK_I2C2 119 +#define SCLK_I2C3 120 +#define SCLK_PWM 121 +#define SCLK_ISP 122 +#define SCLK_USBPHY 123 +#define SCLK_I2S0_SRC 124 +#define SCLK_I2S1_SRC 125 +#define SCLK_I2S2_SRC 126 +#define SCLK_UART0_SRC 127 +#define SCLK_UART1_SRC 128 +#define SCLK_UART2_SRC 129 + +#define DCLK_VOP_SRC 185 +#define DCLK_HDMIPHY 186 +#define DCLK_VOP 187 /* aclk gates */ #define ACLK_DMAC 192 #define ACLK_PRE 193 #define ACLK_CORE 194 #define ACLK_ENMCORE 195 +#define ACLK_RKVENC 196 +#define ACLK_RKVDEC 197 +#define ACLK_VPU 198 +#define ACLK_CIF0 199 +#define ACLK_VIO0 200 +#define ACLK_VIO1 201 +#define ACLK_VOP 202 +#define ACLK_IEP 203 +#define ACLK_RGA 204 +#define ACLK_ISP 205 +#define ACLK_CIF1 206 +#define ACLK_CIF2 207 +#define ACLK_CIF3 208 +#define ACLK_PERI 209 +#define ACLK_GMAC 210 /* pclk gates */ #define PCLK_GPIO1 256 @@ -67,10 +129,24 @@ #define PCLK_PWM 269 #define PCLK_TIMER 270 #define PCLK_PERI 271 +#define PCLK_GPIO0_PMU 272 +#define PCLK_I2C0_PMU 273 +#define PCLK_PWM0_PMU 274 +#define PCLK_ISP 275 +#define PCLK_VIO 276 +#define PCLK_MIPI_DSI 277 +#define PCLK_HDMI_CTRL 278 +#define PCLK_SARADC 279 +#define PCLK_DSP_CFG 280 +#define PCLK_BUS 281 +#define PCLK_EFUSE0 282 +#define PCLK_EFUSE1 283 +#define PCLK_WDT 284 +#define PCLK_GMAC 285 /* hclk gates */ #define HCLK_I2S0_8CH 320 -#define HCLK_I2S1_8CH 321 +#define HCLK_I2S1_2CH 321 #define HCLK_I2S2_2CH 322 #define HCLK_NANDC 323 #define HCLK_SDMMC 324 @@ -78,20 +154,37 @@ #define HCLK_EMMC 326 #define HCLK_PERI 327 #define HCLK_SFC 328 +#define HCLK_RKVENC 329 +#define HCLK_RKVDEC 330 +#define HCLK_CIF0 331 +#define HCLK_VIO 332 +#define HCLK_VOP 333 +#define HCLK_IEP 334 +#define HCLK_RGA 335 +#define HCLK_ISP 336 +#define HCLK_CRYPTO_MST 337 +#define HCLK_CRYPTO_SLV 338 +#define HCLK_HOST0 339 +#define HCLK_OTG 340 +#define HCLK_CIF1 341 +#define HCLK_CIF2 342 +#define HCLK_CIF3 343 +#define HCLK_BUS 344 +#define HCLK_VPU 345 -#define CLK_NR_CLKS (HCLK_SFC + 1) +#define CLK_NR_CLKS (HCLK_VPU + 1) /* reset id */ -#define SRST_CORE_PO_AD 0 +#define SRST_CORE_PO_AD 0 #define SRST_CORE_AD 1 #define SRST_L2_AD 2 -#define SRST_CPU_NIU_AD 3 +#define SRST_CPU_NIU_AD 3 #define SRST_CORE_PO 4 #define SRST_CORE 5 -#define SRST_L2 6 +#define SRST_L2 6 #define SRST_CORE_DBG 8 #define PRST_DBG 9 -#define RST_DAP 10 +#define RST_DAP 10 #define PRST_DBG_NIU 11 #define ARST_STRC_SYS_AD 15 @@ -158,9 +251,9 @@ #define HRST_SYSBUS 75 #define PRST_USBGRF 76 -#define ARST_PERIPH_NIU 80 -#define HRST_PERIPH_NIU 81 -#define PRST_PERIPH_NIU 82 +#define ARST_PERIPH_NIU 80 +#define HRST_PERIPH_NIU 81 +#define PRST_PERIPH_NIU 82 #define HRST_PERIPH 83 #define HRST_SDMMC 84 #define HRST_SDIO 85 @@ -178,7 +271,7 @@ #define HRST_HOST0_AUX 96 #define HRST_HOST0_ARB 97 #define SRST_HOST0_EHCIPHY 98 -#define SRST_HOST0_UTMI 99 +#define SRST_HOST0_UTMI 99 #define SRST_USBPOR 100 #define SRST_UTMI0 101 #define SRST_UTMI1 102 @@ -225,21 +318,21 @@ #define HRST_VPU_NIU 141 #define ARST_VPU 142 #define HRST_VPU 143 -#define ARST_RKVDEC_NIU 144 -#define HRST_RKVDEC_NIU 145 +#define ARST_RKVDEC_NIU 144 +#define HRST_RKVDEC_NIU 145 #define ARST_RKVDEC 146 #define HRST_RKVDEC 147 #define SRST_RKVDEC_CABAC 148 #define SRST_RKVDEC_CORE 149 -#define ARST_RKVENC_NIU 150 -#define HRST_RKVENC_NIU 151 +#define ARST_RKVENC_NIU 150 +#define HRST_RKVENC_NIU 151 #define ARST_RKVENC 152 #define HRST_RKVENC 153 #define SRST_RKVENC_CORE 154 #define SRST_DSP_CORE 156 #define SRST_DSP_SYS 157 -#define SRST_DSP_GLOBAL 158 +#define SRST_DSP_GLOBAL 158 #define SRST_DSP_OECM 159 #define PRST_DSP_IOP_NIU 160 #define ARST_DSP_EPP_NIU 161 @@ -257,7 +350,7 @@ #define SRST_PMU_I2C0 173 #define PRST_PMU_I2C0 174 #define PRST_PMU_GPIO0 175 -#define PRST_PMU_INTMEM 176 +#define PRST_PMU_INTMEM 176 #define PRST_PMU_PWM0 177 #define SRST_PMU_PWM0 178 #define PRST_PMU_GRF 179 diff --git a/include/dt-bindings/clock/ste-ab8500.h b/include/dt-bindings/clock/ste-ab8500.h index 6731f1f00a84..fb42dd0cab5f 100644 --- a/include/dt-bindings/clock/ste-ab8500.h +++ b/include/dt-bindings/clock/ste-ab8500.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __STE_CLK_AB8500_H__ #define __STE_CLK_AB8500_H__ diff --git a/include/dt-bindings/clock/stih407-clks.h b/include/dt-bindings/clock/stih407-clks.h index 082edd9badfa..f0936c133772 100644 --- a/include/dt-bindings/clock/stih407-clks.h +++ b/include/dt-bindings/clock/stih407-clks.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants clk index STMicroelectronics * STiH407 SoC. diff --git a/include/dt-bindings/clock/stih410-clks.h b/include/dt-bindings/clock/stih410-clks.h index 2097a4bbe155..90cbe6154c39 100644 --- a/include/dt-bindings/clock/stih410-clks.h +++ b/include/dt-bindings/clock/stih410-clks.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants clk index STMicroelectronics * STiH410 SoC. diff --git a/include/dt-bindings/clock/stih416-clks.h b/include/dt-bindings/clock/stih416-clks.h index f9bdbd13568d..74302278024e 100644 --- a/include/dt-bindings/clock/stih416-clks.h +++ b/include/dt-bindings/clock/stih416-clks.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants clk index STMicroelectronics * STiH416 SoC. diff --git a/include/dt-bindings/clock/stih418-clks.h b/include/dt-bindings/clock/stih418-clks.h index b62aa0b20217..0e7fba0c52b3 100644 --- a/include/dt-bindings/clock/stih418-clks.h +++ b/include/dt-bindings/clock/stih418-clks.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants clk index STMicroelectronics * STiH418 SoC. diff --git a/include/dt-bindings/clock/stm32h7-clks.h b/include/dt-bindings/clock/stm32h7-clks.h new file mode 100644 index 000000000000..6637272b3242 --- /dev/null +++ b/include/dt-bindings/clock/stm32h7-clks.h @@ -0,0 +1,165 @@ +/* SYS, CORE AND BUS CLOCKS */ +#define SYS_D1CPRE 0 +#define HCLK 1 +#define PCLK1 2 +#define PCLK2 3 +#define PCLK3 4 +#define PCLK4 5 +#define HSI_DIV 6 +#define HSE_1M 7 +#define I2S_CKIN 8 +#define CK_DSI_PHY 9 +#define HSE_CK 10 +#define LSE_CK 11 +#define CSI_KER_DIV122 12 +#define RTC_CK 13 +#define CPU_SYSTICK 14 + +/* OSCILLATOR BANK */ +#define OSC_BANK 18 +#define HSI_CK 18 +#define HSI_KER_CK 19 +#define CSI_CK 20 +#define CSI_KER_CK 21 +#define RC48_CK 22 +#define LSI_CK 23 + +/* MCLOCK BANK */ +#define MCLK_BANK 28 +#define PER_CK 28 +#define PLLSRC 29 +#define SYS_CK 30 +#define TRACEIN_CK 31 + +/* ODF BANK */ +#define ODF_BANK 32 +#define PLL1_P 32 +#define PLL1_Q 33 +#define PLL1_R 34 +#define PLL2_P 35 +#define PLL2_Q 36 +#define PLL2_R 37 +#define PLL3_P 38 +#define PLL3_Q 39 +#define PLL3_R 40 + +/* MCO BANK */ +#define MCO_BANK 41 +#define MCO1 41 +#define MCO2 42 + +/* PERIF BANK */ +#define PERIF_BANK 50 +#define D1SRAM1_CK 50 +#define ITCM_CK 51 +#define DTCM2_CK 52 +#define DTCM1_CK 53 +#define FLITF_CK 54 +#define JPGDEC_CK 55 +#define DMA2D_CK 56 +#define MDMA_CK 57 +#define USB2ULPI_CK 58 +#define USB1ULPI_CK 59 +#define ETH1RX_CK 60 +#define ETH1TX_CK 61 +#define ETH1MAC_CK 62 +#define ART_CK 63 +#define DMA2_CK 64 +#define DMA1_CK 65 +#define D2SRAM3_CK 66 +#define D2SRAM2_CK 67 +#define D2SRAM1_CK 68 +#define HASH_CK 69 +#define CRYPT_CK 70 +#define CAMITF_CK 71 +#define BKPRAM_CK 72 +#define HSEM_CK 73 +#define BDMA_CK 74 +#define CRC_CK 75 +#define GPIOK_CK 76 +#define GPIOJ_CK 77 +#define GPIOI_CK 78 +#define GPIOH_CK 79 +#define GPIOG_CK 80 +#define GPIOF_CK 81 +#define GPIOE_CK 82 +#define GPIOD_CK 83 +#define GPIOC_CK 84 +#define GPIOB_CK 85 +#define GPIOA_CK 86 +#define WWDG1_CK 87 +#define DAC12_CK 88 +#define WWDG2_CK 89 +#define TIM14_CK 90 +#define TIM13_CK 91 +#define TIM12_CK 92 +#define TIM7_CK 93 +#define TIM6_CK 94 +#define TIM5_CK 95 +#define TIM4_CK 96 +#define TIM3_CK 97 +#define TIM2_CK 98 +#define MDIOS_CK 99 +#define OPAMP_CK 100 +#define CRS_CK 101 +#define TIM17_CK 102 +#define TIM16_CK 103 +#define TIM15_CK 104 +#define TIM8_CK 105 +#define TIM1_CK 106 +#define TMPSENS_CK 107 +#define RTCAPB_CK 108 +#define VREF_CK 109 +#define COMP12_CK 110 +#define SYSCFG_CK 111 + +/* KERNEL BANK */ +#define KERN_BANK 120 +#define SDMMC1_CK 120 +#define QUADSPI_CK 121 +#define FMC_CK 122 +#define USB2OTG_CK 123 +#define USB1OTG_CK 124 +#define ADC12_CK 125 +#define SDMMC2_CK 126 +#define RNG_CK 127 +#define ADC3_CK 128 +#define DSI_CK 129 +#define LTDC_CK 130 +#define USART8_CK 131 +#define USART7_CK 132 +#define HDMICEC_CK 133 +#define I2C3_CK 134 +#define I2C2_CK 135 +#define I2C1_CK 136 +#define UART5_CK 137 +#define UART4_CK 138 +#define USART3_CK 139 +#define USART2_CK 140 +#define SPDIFRX_CK 141 +#define SPI3_CK 142 +#define SPI2_CK 143 +#define LPTIM1_CK 144 +#define FDCAN_CK 145 +#define SWP_CK 146 +#define HRTIM_CK 147 +#define DFSDM1_CK 148 +#define SAI3_CK 149 +#define SAI2_CK 150 +#define SAI1_CK 151 +#define SPI5_CK 152 +#define SPI4_CK 153 +#define SPI1_CK 154 +#define USART6_CK 155 +#define USART1_CK 156 +#define SAI4B_CK 157 +#define SAI4A_CK 158 +#define LPTIM5_CK 159 +#define LPTIM4_CK 160 +#define LPTIM3_CK 161 +#define LPTIM2_CK 162 +#define I2C4_CK 163 +#define SPI6_CK 164 +#define LPUART1_CK 165 + +#define STM32H7_MAX_CLKS 166 diff --git a/include/dt-bindings/clock/sun4i-a10-ccu.h b/include/dt-bindings/clock/sun4i-a10-ccu.h new file mode 100644 index 000000000000..c5a53f38d654 --- /dev/null +++ b/include/dt-bindings/clock/sun4i-a10-ccu.h @@ -0,0 +1,200 @@ +/* + * Copyright (C) 2017 Priit Laes + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _DT_BINDINGS_CLK_SUN4I_A10_H_ +#define _DT_BINDINGS_CLK_SUN4I_A10_H_ + +#define CLK_HOSC 1 +#define CLK_CPU 20 + +/* AHB Gates */ +#define CLK_AHB_OTG 26 +#define CLK_AHB_EHCI0 27 +#define CLK_AHB_OHCI0 28 +#define CLK_AHB_EHCI1 29 +#define CLK_AHB_OHCI1 30 +#define CLK_AHB_SS 31 +#define CLK_AHB_DMA 32 +#define CLK_AHB_BIST 33 +#define CLK_AHB_MMC0 34 +#define CLK_AHB_MMC1 35 +#define CLK_AHB_MMC2 36 +#define CLK_AHB_MMC3 37 +#define CLK_AHB_MS 38 +#define CLK_AHB_NAND 39 +#define CLK_AHB_SDRAM 40 +#define CLK_AHB_ACE 41 +#define CLK_AHB_EMAC 42 +#define CLK_AHB_TS 43 +#define CLK_AHB_SPI0 44 +#define CLK_AHB_SPI1 45 +#define CLK_AHB_SPI2 46 +#define CLK_AHB_SPI3 47 +#define CLK_AHB_PATA 48 +#define CLK_AHB_SATA 49 +#define CLK_AHB_GPS 50 +#define CLK_AHB_HSTIMER 51 +#define CLK_AHB_VE 52 +#define CLK_AHB_TVD 53 +#define CLK_AHB_TVE0 54 +#define CLK_AHB_TVE1 55 +#define CLK_AHB_LCD0 56 +#define CLK_AHB_LCD1 57 +#define CLK_AHB_CSI0 58 +#define CLK_AHB_CSI1 59 +#define CLK_AHB_HDMI0 60 +#define CLK_AHB_HDMI1 61 +#define CLK_AHB_DE_BE0 62 +#define CLK_AHB_DE_BE1 63 +#define CLK_AHB_DE_FE0 64 +#define CLK_AHB_DE_FE1 65 +#define CLK_AHB_GMAC 66 +#define CLK_AHB_MP 67 +#define CLK_AHB_GPU 68 + +/* APB0 Gates */ +#define CLK_APB0_CODEC 69 +#define CLK_APB0_SPDIF 70 +#define CLK_APB0_I2S0 71 +#define CLK_APB0_AC97 72 +#define CLK_APB0_I2S1 73 +#define CLK_APB0_PIO 74 +#define CLK_APB0_IR0 75 +#define CLK_APB0_IR1 76 +#define CLK_APB0_I2S2 77 +#define CLK_APB0_KEYPAD 78 + +/* APB1 Gates */ +#define CLK_APB1_I2C0 79 +#define CLK_APB1_I2C1 80 +#define CLK_APB1_I2C2 81 +#define CLK_APB1_I2C3 82 +#define CLK_APB1_CAN 83 +#define CLK_APB1_SCR 84 +#define CLK_APB1_PS20 85 +#define CLK_APB1_PS21 86 +#define CLK_APB1_I2C4 87 +#define CLK_APB1_UART0 88 +#define CLK_APB1_UART1 89 +#define CLK_APB1_UART2 90 +#define CLK_APB1_UART3 91 +#define CLK_APB1_UART4 92 +#define CLK_APB1_UART5 93 +#define CLK_APB1_UART6 94 +#define CLK_APB1_UART7 95 + +/* IP clocks */ +#define CLK_NAND 96 +#define CLK_MS 97 +#define CLK_MMC0 98 +#define CLK_MMC0_OUTPUT 99 +#define CLK_MMC0_SAMPLE 100 +#define CLK_MMC1 101 +#define CLK_MMC1_OUTPUT 102 +#define CLK_MMC1_SAMPLE 103 +#define CLK_MMC2 104 +#define CLK_MMC2_OUTPUT 105 +#define CLK_MMC2_SAMPLE 106 +#define CLK_MMC3 107 +#define CLK_MMC3_OUTPUT 108 +#define CLK_MMC3_SAMPLE 109 +#define CLK_TS 110 +#define CLK_SS 111 +#define CLK_SPI0 112 +#define CLK_SPI1 113 +#define CLK_SPI2 114 +#define CLK_PATA 115 +#define CLK_IR0 116 +#define CLK_IR1 117 +#define CLK_I2S0 118 +#define CLK_AC97 119 +#define CLK_SPDIF 120 +#define CLK_KEYPAD 121 +#define CLK_SATA 122 +#define CLK_USB_OHCI0 123 +#define CLK_USB_OHCI1 124 +#define CLK_USB_PHY 125 +#define CLK_GPS 126 +#define CLK_SPI3 127 +#define CLK_I2S1 128 +#define CLK_I2S2 129 + +/* DRAM Gates */ +#define CLK_DRAM_VE 130 +#define CLK_DRAM_CSI0 131 +#define CLK_DRAM_CSI1 132 +#define CLK_DRAM_TS 133 +#define CLK_DRAM_TVD 134 +#define CLK_DRAM_TVE0 135 +#define CLK_DRAM_TVE1 136 +#define CLK_DRAM_OUT 137 +#define CLK_DRAM_DE_FE1 138 +#define CLK_DRAM_DE_FE0 139 +#define CLK_DRAM_DE_BE0 140 +#define CLK_DRAM_DE_BE1 141 +#define CLK_DRAM_MP 142 +#define CLK_DRAM_ACE 143 + +/* Display Engine Clocks */ +#define CLK_DE_BE0 144 +#define CLK_DE_BE1 145 +#define CLK_DE_FE0 146 +#define CLK_DE_FE1 147 +#define CLK_DE_MP 148 +#define CLK_TCON0_CH0 149 +#define CLK_TCON1_CH0 150 +#define CLK_CSI_SCLK 151 +#define CLK_TVD_SCLK2 152 +#define CLK_TVD 153 +#define CLK_TCON0_CH1_SCLK2 154 +#define CLK_TCON0_CH1 155 +#define CLK_TCON1_CH1_SCLK2 156 +#define CLK_TCON1_CH1 157 +#define CLK_CSI0 158 +#define CLK_CSI1 159 +#define CLK_CODEC 160 +#define CLK_VE 161 +#define CLK_AVS 162 +#define CLK_ACE 163 +#define CLK_HDMI 164 +#define CLK_GPU 165 + +#endif /* _DT_BINDINGS_CLK_SUN4I_A10_H_ */ diff --git a/include/dt-bindings/clock/sun7i-a20-ccu.h b/include/dt-bindings/clock/sun7i-a20-ccu.h new file mode 100644 index 000000000000..045a5178da0c --- /dev/null +++ b/include/dt-bindings/clock/sun7i-a20-ccu.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2017 Priit Laes + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _DT_BINDINGS_CLK_SUN7I_A20_H_ +#define _DT_BINDINGS_CLK_SUN7I_A20_H_ + +#include + +#define CLK_MBUS 166 +#define CLK_HDMI1_SLOW 167 +#define CLK_HDMI1 168 +#define CLK_OUT_A 169 +#define CLK_OUT_B 170 + +#endif /* _DT_BINDINGS_CLK_SUN7I_A20_H_ */ diff --git a/include/dt-bindings/clock/sun8i-r40-ccu.h b/include/dt-bindings/clock/sun8i-r40-ccu.h new file mode 100644 index 000000000000..4fa5f69fc297 --- /dev/null +++ b/include/dt-bindings/clock/sun8i-r40-ccu.h @@ -0,0 +1,187 @@ +/* + * Copyright (C) 2017 Icenowy Zheng + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _DT_BINDINGS_CLK_SUN8I_R40_H_ +#define _DT_BINDINGS_CLK_SUN8I_R40_H_ + +#define CLK_CPU 24 + +#define CLK_BUS_MIPI_DSI 29 +#define CLK_BUS_CE 30 +#define CLK_BUS_DMA 31 +#define CLK_BUS_MMC0 32 +#define CLK_BUS_MMC1 33 +#define CLK_BUS_MMC2 34 +#define CLK_BUS_MMC3 35 +#define CLK_BUS_NAND 36 +#define CLK_BUS_DRAM 37 +#define CLK_BUS_EMAC 38 +#define CLK_BUS_TS 39 +#define CLK_BUS_HSTIMER 40 +#define CLK_BUS_SPI0 41 +#define CLK_BUS_SPI1 42 +#define CLK_BUS_SPI2 43 +#define CLK_BUS_SPI3 44 +#define CLK_BUS_SATA 45 +#define CLK_BUS_OTG 46 +#define CLK_BUS_EHCI0 47 +#define CLK_BUS_EHCI1 48 +#define CLK_BUS_EHCI2 49 +#define CLK_BUS_OHCI0 50 +#define CLK_BUS_OHCI1 51 +#define CLK_BUS_OHCI2 52 +#define CLK_BUS_VE 53 +#define CLK_BUS_MP 54 +#define CLK_BUS_DEINTERLACE 55 +#define CLK_BUS_CSI0 56 +#define CLK_BUS_CSI1 57 +#define CLK_BUS_HDMI1 58 +#define CLK_BUS_HDMI0 59 +#define CLK_BUS_DE 60 +#define CLK_BUS_TVE0 61 +#define CLK_BUS_TVE1 62 +#define CLK_BUS_TVE_TOP 63 +#define CLK_BUS_GMAC 64 +#define CLK_BUS_GPU 65 +#define CLK_BUS_TVD0 66 +#define CLK_BUS_TVD1 67 +#define CLK_BUS_TVD2 68 +#define CLK_BUS_TVD3 69 +#define CLK_BUS_TVD_TOP 70 +#define CLK_BUS_TCON_LCD0 71 +#define CLK_BUS_TCON_LCD1 72 +#define CLK_BUS_TCON_TV0 73 +#define CLK_BUS_TCON_TV1 74 +#define CLK_BUS_TCON_TOP 75 +#define CLK_BUS_CODEC 76 +#define CLK_BUS_SPDIF 77 +#define CLK_BUS_AC97 78 +#define CLK_BUS_PIO 79 +#define CLK_BUS_IR0 80 +#define CLK_BUS_IR1 81 +#define CLK_BUS_THS 82 +#define CLK_BUS_KEYPAD 83 +#define CLK_BUS_I2S0 84 +#define CLK_BUS_I2S1 85 +#define CLK_BUS_I2S2 86 +#define CLK_BUS_I2C0 87 +#define CLK_BUS_I2C1 88 +#define CLK_BUS_I2C2 89 +#define CLK_BUS_I2C3 90 +#define CLK_BUS_CAN 91 +#define CLK_BUS_SCR 92 +#define CLK_BUS_PS20 93 +#define CLK_BUS_PS21 94 +#define CLK_BUS_I2C4 95 +#define CLK_BUS_UART0 96 +#define CLK_BUS_UART1 97 +#define CLK_BUS_UART2 98 +#define CLK_BUS_UART3 99 +#define CLK_BUS_UART4 100 +#define CLK_BUS_UART5 101 +#define CLK_BUS_UART6 102 +#define CLK_BUS_UART7 103 +#define CLK_BUS_DBG 104 + +#define CLK_THS 105 +#define CLK_NAND 106 +#define CLK_MMC0 107 +#define CLK_MMC1 108 +#define CLK_MMC2 109 +#define CLK_MMC3 110 +#define CLK_TS 111 +#define CLK_CE 112 +#define CLK_SPI0 113 +#define CLK_SPI1 114 +#define CLK_SPI2 115 +#define CLK_SPI3 116 +#define CLK_I2S0 117 +#define CLK_I2S1 118 +#define CLK_I2S2 119 +#define CLK_AC97 120 +#define CLK_SPDIF 121 +#define CLK_KEYPAD 122 +#define CLK_SATA 123 +#define CLK_USB_PHY0 124 +#define CLK_USB_PHY1 125 +#define CLK_USB_PHY2 126 +#define CLK_USB_OHCI0 127 +#define CLK_USB_OHCI1 128 +#define CLK_USB_OHCI2 129 +#define CLK_IR0 130 +#define CLK_IR1 131 + +#define CLK_DRAM_VE 133 +#define CLK_DRAM_CSI0 134 +#define CLK_DRAM_CSI1 135 +#define CLK_DRAM_TS 136 +#define CLK_DRAM_TVD 137 +#define CLK_DRAM_MP 138 +#define CLK_DRAM_DEINTERLACE 139 +#define CLK_DE 140 +#define CLK_MP 141 +#define CLK_TCON_LCD0 142 +#define CLK_TCON_LCD1 143 +#define CLK_TCON_TV0 144 +#define CLK_TCON_TV1 145 +#define CLK_DEINTERLACE 146 +#define CLK_CSI1_MCLK 147 +#define CLK_CSI_SCLK 148 +#define CLK_CSI0_MCLK 149 +#define CLK_VE 150 +#define CLK_CODEC 151 +#define CLK_AVS 152 +#define CLK_HDMI 153 +#define CLK_HDMI_SLOW 154 + +#define CLK_DSI_DPHY 156 +#define CLK_TVE0 157 +#define CLK_TVE1 158 +#define CLK_TVD0 159 +#define CLK_TVD1 160 +#define CLK_TVD2 161 +#define CLK_TVD3 162 +#define CLK_GPU 163 +#define CLK_OUTA 164 +#define CLK_OUTB 165 + +#endif /* _DT_BINDINGS_CLK_SUN8I_R40_H_ */ diff --git a/include/dt-bindings/clock/tegra114-car.h b/include/dt-bindings/clock/tegra114-car.h index ed5ca218c857..bb5c2c999c05 100644 --- a/include/dt-bindings/clock/tegra114-car.h +++ b/include/dt-bindings/clock/tegra114-car.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for binding nvidia,tegra114-car. * diff --git a/include/dt-bindings/clock/tegra124-car-common.h b/include/dt-bindings/clock/tegra124-car-common.h index 9352c7e2ce0b..4331f1df6ebe 100644 --- a/include/dt-bindings/clock/tegra124-car-common.h +++ b/include/dt-bindings/clock/tegra124-car-common.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for binding nvidia,tegra124-car or * nvidia,tegra132-car. diff --git a/include/dt-bindings/clock/tegra124-car.h b/include/dt-bindings/clock/tegra124-car.h index 2860737f0443..c520ee231950 100644 --- a/include/dt-bindings/clock/tegra124-car.h +++ b/include/dt-bindings/clock/tegra124-car.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides Tegra124-specific constants for binding * nvidia,tegra124-car. diff --git a/include/dt-bindings/clock/tegra186-clock.h b/include/dt-bindings/clock/tegra186-clock.h index f73d32098f99..d6b525f4566f 100644 --- a/include/dt-bindings/clock/tegra186-clock.h +++ b/include/dt-bindings/clock/tegra186-clock.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /** @file */ #ifndef _MACH_T186_CLK_T186_H diff --git a/include/dt-bindings/clock/tegra20-car.h b/include/dt-bindings/clock/tegra20-car.h index 04500b243a4d..b21a0eb32921 100644 --- a/include/dt-bindings/clock/tegra20-car.h +++ b/include/dt-bindings/clock/tegra20-car.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for binding nvidia,tegra20-car. * diff --git a/include/dt-bindings/clock/tegra210-car.h b/include/dt-bindings/clock/tegra210-car.h index 46689cd3750b..a9dc1457cb00 100644 --- a/include/dt-bindings/clock/tegra210-car.h +++ b/include/dt-bindings/clock/tegra210-car.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for binding nvidia,tegra210-car. * diff --git a/include/dt-bindings/clock/tegra30-car.h b/include/dt-bindings/clock/tegra30-car.h index 7213354b9652..3c90f1535551 100644 --- a/include/dt-bindings/clock/tegra30-car.h +++ b/include/dt-bindings/clock/tegra30-car.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for binding nvidia,tegra30-car. * diff --git a/include/dt-bindings/display/tda998x.h b/include/dt-bindings/display/tda998x.h index 34757a3847ef..746831ff396c 100644 --- a/include/dt-bindings/display/tda998x.h +++ b/include/dt-bindings/display/tda998x.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_TDA998X_H #define _DT_BINDINGS_TDA998X_H diff --git a/include/dt-bindings/genpd/k2g.h b/include/dt-bindings/genpd/k2g.h deleted file mode 100644 index 1f31f17e19eb..000000000000 --- a/include/dt-bindings/genpd/k2g.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * TI K2G SoC Device definitions - * - * Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License 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. - */ - -#ifndef _DT_BINDINGS_GENPD_K2G_H -#define _DT_BINDINGS_GENPD_K2G_H - -/* Documented in http://processors.wiki.ti.com/index.php/TISCI */ - -#define K2G_DEV_PMMC0 0x0000 -#define K2G_DEV_MLB0 0x0001 -#define K2G_DEV_DSS0 0x0002 -#define K2G_DEV_MCBSP0 0x0003 -#define K2G_DEV_MCASP0 0x0004 -#define K2G_DEV_MCASP1 0x0005 -#define K2G_DEV_MCASP2 0x0006 -#define K2G_DEV_DCAN0 0x0008 -#define K2G_DEV_DCAN1 0x0009 -#define K2G_DEV_EMIF0 0x000a -#define K2G_DEV_MMCHS0 0x000b -#define K2G_DEV_MMCHS1 0x000c -#define K2G_DEV_GPMC0 0x000d -#define K2G_DEV_ELM0 0x000e -#define K2G_DEV_SPI0 0x0010 -#define K2G_DEV_SPI1 0x0011 -#define K2G_DEV_SPI2 0x0012 -#define K2G_DEV_SPI3 0x0013 -#define K2G_DEV_ICSS0 0x0014 -#define K2G_DEV_ICSS1 0x0015 -#define K2G_DEV_USB0 0x0016 -#define K2G_DEV_USB1 0x0017 -#define K2G_DEV_NSS0 0x0018 -#define K2G_DEV_PCIE0 0x0019 -#define K2G_DEV_GPIO0 0x001b -#define K2G_DEV_GPIO1 0x001c -#define K2G_DEV_TIMER64_0 0x001d -#define K2G_DEV_TIMER64_1 0x001e -#define K2G_DEV_TIMER64_2 0x001f -#define K2G_DEV_TIMER64_3 0x0020 -#define K2G_DEV_TIMER64_4 0x0021 -#define K2G_DEV_TIMER64_5 0x0022 -#define K2G_DEV_TIMER64_6 0x0023 -#define K2G_DEV_MSGMGR0 0x0025 -#define K2G_DEV_BOOTCFG0 0x0026 -#define K2G_DEV_ARM_BOOTROM0 0x0027 -#define K2G_DEV_DSP_BOOTROM0 0x0029 -#define K2G_DEV_DEBUGSS0 0x002b -#define K2G_DEV_UART0 0x002c -#define K2G_DEV_UART1 0x002d -#define K2G_DEV_UART2 0x002e -#define K2G_DEV_EHRPWM0 0x002f -#define K2G_DEV_EHRPWM1 0x0030 -#define K2G_DEV_EHRPWM2 0x0031 -#define K2G_DEV_EHRPWM3 0x0032 -#define K2G_DEV_EHRPWM4 0x0033 -#define K2G_DEV_EHRPWM5 0x0034 -#define K2G_DEV_EQEP0 0x0035 -#define K2G_DEV_EQEP1 0x0036 -#define K2G_DEV_EQEP2 0x0037 -#define K2G_DEV_ECAP0 0x0038 -#define K2G_DEV_ECAP1 0x0039 -#define K2G_DEV_I2C0 0x003a -#define K2G_DEV_I2C1 0x003b -#define K2G_DEV_I2C2 0x003c -#define K2G_DEV_EDMA0 0x003f -#define K2G_DEV_SEMAPHORE0 0x0040 -#define K2G_DEV_INTC0 0x0041 -#define K2G_DEV_GIC0 0x0042 -#define K2G_DEV_QSPI0 0x0043 -#define K2G_DEV_ARM_64B_COUNTER0 0x0044 -#define K2G_DEV_TETRIS0 0x0045 -#define K2G_DEV_CGEM0 0x0046 -#define K2G_DEV_MSMC0 0x0047 -#define K2G_DEV_CBASS0 0x0049 -#define K2G_DEV_BOARD0 0x004c -#define K2G_DEV_EDMA1 0x004f - -#endif diff --git a/include/dt-bindings/gpio/gpio.h b/include/dt-bindings/gpio/gpio.h index c5074584561d..32dd58a3d13c 100644 --- a/include/dt-bindings/gpio/gpio.h +++ b/include/dt-bindings/gpio/gpio.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for most GPIO bindings. * diff --git a/include/dt-bindings/gpio/tegra-gpio.h b/include/dt-bindings/gpio/tegra-gpio.h index a1c09e88e80b..7625dbc577c2 100644 --- a/include/dt-bindings/gpio/tegra-gpio.h +++ b/include/dt-bindings/gpio/tegra-gpio.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for binding nvidia,tegra*-gpio. * diff --git a/include/dt-bindings/gpio/tegra186-gpio.h b/include/dt-bindings/gpio/tegra186-gpio.h index 38001c7023f1..463ad398fe3e 100644 --- a/include/dt-bindings/gpio/tegra186-gpio.h +++ b/include/dt-bindings/gpio/tegra186-gpio.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for binding nvidia,tegra186-gpio*. * diff --git a/include/dt-bindings/iio/adc/fsl-imx25-gcq.h b/include/dt-bindings/iio/adc/fsl-imx25-gcq.h index 87abdd4a7674..08ef4d298b94 100644 --- a/include/dt-bindings/iio/adc/fsl-imx25-gcq.h +++ b/include/dt-bindings/iio/adc/fsl-imx25-gcq.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for configuring the I.MX25 ADC */ diff --git a/include/dt-bindings/iio/adi,ad5592r.h b/include/dt-bindings/iio/adi,ad5592r.h index c48aca1dcade..9f8c7b808cd1 100644 --- a/include/dt-bindings/iio/adi,ad5592r.h +++ b/include/dt-bindings/iio/adi,ad5592r.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_ADI_AD5592R_H #define _DT_BINDINGS_ADI_AD5592R_H diff --git a/include/dt-bindings/input/input.h b/include/dt-bindings/input/input.h index a21413324a3f..bcf0ae100f21 100644 --- a/include/dt-bindings/input/input.h +++ b/include/dt-bindings/input/input.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for most input bindings. * diff --git a/include/dt-bindings/input/linux-event-codes.h b/include/dt-bindings/input/linux-event-codes.h index 179891074b3c..f4058bd4c373 100644 --- a/include/dt-bindings/input/linux-event-codes.h +++ b/include/dt-bindings/input/linux-event-codes.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * Input event codes * diff --git a/include/dt-bindings/interrupt-controller/arm-gic.h b/include/dt-bindings/interrupt-controller/arm-gic.h index d4110d5caa3e..0c85f65c81c7 100644 --- a/include/dt-bindings/interrupt-controller/arm-gic.h +++ b/include/dt-bindings/interrupt-controller/arm-gic.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the ARM GIC. */ diff --git a/include/dt-bindings/interrupt-controller/irq.h b/include/dt-bindings/interrupt-controller/irq.h index 33a1003c55aa..a8b310555f14 100644 --- a/include/dt-bindings/interrupt-controller/irq.h +++ b/include/dt-bindings/interrupt-controller/irq.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for most IRQ bindings. * diff --git a/include/dt-bindings/interrupt-controller/mips-gic.h b/include/dt-bindings/interrupt-controller/mips-gic.h index cf35a577e371..bd45cee0c3f0 100644 --- a/include/dt-bindings/interrupt-controller/mips-gic.h +++ b/include/dt-bindings/interrupt-controller/mips-gic.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_MIPS_GIC_H #define _DT_BINDINGS_INTERRUPT_CONTROLLER_MIPS_GIC_H diff --git a/include/dt-bindings/interrupt-controller/mvebu-icu.h b/include/dt-bindings/interrupt-controller/mvebu-icu.h index 8249558545c7..bb5217c64206 100644 --- a/include/dt-bindings/interrupt-controller/mvebu-icu.h +++ b/include/dt-bindings/interrupt-controller/mvebu-icu.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the MVEBU ICU driver. */ diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h index 7958bec7de8c..e171d0a6beb2 100644 --- a/include/dt-bindings/leds/common.h +++ b/include/dt-bindings/leds/common.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides macros for the common LEDs device tree bindings. * diff --git a/include/dt-bindings/leds/leds-ns2.h b/include/dt-bindings/leds/leds-ns2.h index 491c5f974a92..fd615749e703 100644 --- a/include/dt-bindings/leds/leds-ns2.h +++ b/include/dt-bindings/leds/leds-ns2.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_LEDS_NS2_H #define _DT_BINDINGS_LEDS_NS2_H diff --git a/include/dt-bindings/leds/leds-pca955x.h b/include/dt-bindings/leds/leds-pca955x.h new file mode 100644 index 000000000000..78cb7e979de7 --- /dev/null +++ b/include/dt-bindings/leds/leds-pca955x.h @@ -0,0 +1,16 @@ +/* + * This header provides constants for pca955x LED bindings. + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#ifndef _DT_BINDINGS_LEDS_PCA955X_H +#define _DT_BINDINGS_LEDS_PCA955X_H + +#define PCA955X_TYPE_NONE 0 +#define PCA955X_TYPE_LED 1 +#define PCA955X_TYPE_GPIO 2 + +#endif /* _DT_BINDINGS_LEDS_PCA955X_H */ diff --git a/include/dt-bindings/mailbox/tegra186-hsp.h b/include/dt-bindings/mailbox/tegra186-hsp.h index f5d66e5f5f10..bcab5b7ca785 100644 --- a/include/dt-bindings/mailbox/tegra186-hsp.h +++ b/include/dt-bindings/mailbox/tegra186-hsp.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for binding nvidia,tegra186-hsp. */ diff --git a/include/dt-bindings/media/c8sectpfe.h b/include/dt-bindings/media/c8sectpfe.h index a0b5c7be683c..6b1fb6f5413b 100644 --- a/include/dt-bindings/media/c8sectpfe.h +++ b/include/dt-bindings/media/c8sectpfe.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_C8SECTPFE_H #define __DT_C8SECTPFE_H diff --git a/include/dt-bindings/memory/mt8173-larb-port.h b/include/dt-bindings/memory/mt8173-larb-port.h index 5fef5d1f8f82..111b4b0ec85a 100644 --- a/include/dt-bindings/memory/mt8173-larb-port.h +++ b/include/dt-bindings/memory/mt8173-larb-port.h @@ -15,10 +15,6 @@ #define __DTS_IOMMU_PORT_MT8173_H #define MTK_M4U_ID(larb, port) (((larb) << 5) | (port)) -/* Local arbiter ID */ -#define MTK_M4U_TO_LARB(id) (((id) >> 5) & 0x7) -/* PortID within the local arbiter */ -#define MTK_M4U_TO_PORT(id) ((id) & 0x1f) #define M4U_LARB0_ID 0 #define M4U_LARB1_ID 1 diff --git a/include/dt-bindings/memory/tegra114-mc.h b/include/dt-bindings/memory/tegra114-mc.h index 8f48985a3139..27c8386987ff 100644 --- a/include/dt-bindings/memory/tegra114-mc.h +++ b/include/dt-bindings/memory/tegra114-mc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef DT_BINDINGS_MEMORY_TEGRA114_MC_H #define DT_BINDINGS_MEMORY_TEGRA114_MC_H diff --git a/include/dt-bindings/memory/tegra124-mc.h b/include/dt-bindings/memory/tegra124-mc.h index 7d8ee798f34e..f534d7c06019 100644 --- a/include/dt-bindings/memory/tegra124-mc.h +++ b/include/dt-bindings/memory/tegra124-mc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef DT_BINDINGS_MEMORY_TEGRA124_MC_H #define DT_BINDINGS_MEMORY_TEGRA124_MC_H diff --git a/include/dt-bindings/memory/tegra210-mc.h b/include/dt-bindings/memory/tegra210-mc.h index d1731bc14dbc..4490f7cf4772 100644 --- a/include/dt-bindings/memory/tegra210-mc.h +++ b/include/dt-bindings/memory/tegra210-mc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef DT_BINDINGS_MEMORY_TEGRA210_MC_H #define DT_BINDINGS_MEMORY_TEGRA210_MC_H diff --git a/include/dt-bindings/memory/tegra30-mc.h b/include/dt-bindings/memory/tegra30-mc.h index 502beb03d777..3cac81919023 100644 --- a/include/dt-bindings/memory/tegra30-mc.h +++ b/include/dt-bindings/memory/tegra30-mc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef DT_BINDINGS_MEMORY_TEGRA30_MC_H #define DT_BINDINGS_MEMORY_TEGRA30_MC_H diff --git a/include/dt-bindings/mfd/as3722.h b/include/dt-bindings/mfd/as3722.h index e66c0898c58e..9ef0cba90407 100644 --- a/include/dt-bindings/mfd/as3722.h +++ b/include/dt-bindings/mfd/as3722.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides macros for ams AS3722 device bindings. * diff --git a/include/dt-bindings/mfd/dbx500-prcmu.h b/include/dt-bindings/mfd/dbx500-prcmu.h index 552a2d174f01..0404bcc47dd4 100644 --- a/include/dt-bindings/mfd/dbx500-prcmu.h +++ b/include/dt-bindings/mfd/dbx500-prcmu.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the PRCMU bindings. * diff --git a/include/dt-bindings/mfd/max77620.h b/include/dt-bindings/mfd/max77620.h index b911a0720ccd..1e19c5f908d7 100644 --- a/include/dt-bindings/mfd/max77620.h +++ b/include/dt-bindings/mfd/max77620.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides macros for MAXIM MAX77620 device bindings. * diff --git a/include/dt-bindings/mfd/palmas.h b/include/dt-bindings/mfd/palmas.h index cdb075aae4e1..c4f1d57ff4ff 100644 --- a/include/dt-bindings/mfd/palmas.h +++ b/include/dt-bindings/mfd/palmas.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides macros for Palmas device bindings. * diff --git a/include/dt-bindings/mfd/qcom-rpm.h b/include/dt-bindings/mfd/qcom-rpm.h index 54aef5e21763..c9204c4df520 100644 --- a/include/dt-bindings/mfd/qcom-rpm.h +++ b/include/dt-bindings/mfd/qcom-rpm.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the Qualcomm RPM bindings. */ diff --git a/include/dt-bindings/mfd/st-lpc.h b/include/dt-bindings/mfd/st-lpc.h index d05894afa7e7..88a7f56843bc 100644 --- a/include/dt-bindings/mfd/st-lpc.h +++ b/include/dt-bindings/mfd/st-lpc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides shared DT/Driver defines for ST's LPC device * diff --git a/include/dt-bindings/mfd/stm32f4-rcc.h b/include/dt-bindings/mfd/stm32f4-rcc.h index 082a81c94298..309e8c79f27b 100644 --- a/include/dt-bindings/mfd/stm32f4-rcc.h +++ b/include/dt-bindings/mfd/stm32f4-rcc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the STM32F4 RCC IP */ diff --git a/include/dt-bindings/mfd/stm32f7-rcc.h b/include/dt-bindings/mfd/stm32f7-rcc.h index e36cc69959c7..8b7b7197ffd7 100644 --- a/include/dt-bindings/mfd/stm32f7-rcc.h +++ b/include/dt-bindings/mfd/stm32f7-rcc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the STM32F7 RCC IP */ diff --git a/include/dt-bindings/mfd/stm32h7-rcc.h b/include/dt-bindings/mfd/stm32h7-rcc.h new file mode 100644 index 000000000000..461a8e04453a --- /dev/null +++ b/include/dt-bindings/mfd/stm32h7-rcc.h @@ -0,0 +1,136 @@ +/* + * This header provides constants for the STM32H7 RCC IP + */ + +#ifndef _DT_BINDINGS_MFD_STM32H7_RCC_H +#define _DT_BINDINGS_MFD_STM32H7_RCC_H + +/* AHB3 */ +#define STM32H7_RCC_AHB3_MDMA 0 +#define STM32H7_RCC_AHB3_DMA2D 4 +#define STM32H7_RCC_AHB3_JPGDEC 5 +#define STM32H7_RCC_AHB3_FMC 12 +#define STM32H7_RCC_AHB3_QUADSPI 14 +#define STM32H7_RCC_AHB3_SDMMC1 16 +#define STM32H7_RCC_AHB3_CPU 31 + +#define STM32H7_AHB3_RESET(bit) (STM32H7_RCC_AHB3_##bit + (0x7C * 8)) + +/* AHB1 */ +#define STM32H7_RCC_AHB1_DMA1 0 +#define STM32H7_RCC_AHB1_DMA2 1 +#define STM32H7_RCC_AHB1_ADC12 5 +#define STM32H7_RCC_AHB1_ART 14 +#define STM32H7_RCC_AHB1_ETH1MAC 15 +#define STM32H7_RCC_AHB1_USB1OTG 25 +#define STM32H7_RCC_AHB1_USB2OTG 27 + +#define STM32H7_AHB1_RESET(bit) (STM32H7_RCC_AHB1_##bit + (0x80 * 8)) + +/* AHB2 */ +#define STM32H7_RCC_AHB2_CAMITF 0 +#define STM32H7_RCC_AHB2_CRYPT 4 +#define STM32H7_RCC_AHB2_HASH 5 +#define STM32H7_RCC_AHB2_RNG 6 +#define STM32H7_RCC_AHB2_SDMMC2 9 + +#define STM32H7_AHB2_RESET(bit) (STM32H7_RCC_AHB2_##bit + (0x84 * 8)) + +/* AHB4 */ +#define STM32H7_RCC_AHB4_GPIOA 0 +#define STM32H7_RCC_AHB4_GPIOB 1 +#define STM32H7_RCC_AHB4_GPIOC 2 +#define STM32H7_RCC_AHB4_GPIOD 3 +#define STM32H7_RCC_AHB4_GPIOE 4 +#define STM32H7_RCC_AHB4_GPIOF 5 +#define STM32H7_RCC_AHB4_GPIOG 6 +#define STM32H7_RCC_AHB4_GPIOH 7 +#define STM32H7_RCC_AHB4_GPIOI 8 +#define STM32H7_RCC_AHB4_GPIOJ 9 +#define STM32H7_RCC_AHB4_GPIOK 10 +#define STM32H7_RCC_AHB4_CRC 19 +#define STM32H7_RCC_AHB4_BDMA 21 +#define STM32H7_RCC_AHB4_ADC3 24 +#define STM32H7_RCC_AHB4_HSEM 25 + +#define STM32H7_AHB4_RESET(bit) (STM32H7_RCC_AHB4_##bit + (0x88 * 8)) + +/* APB3 */ +#define STM32H7_RCC_APB3_LTDC 3 +#define STM32H7_RCC_APB3_DSI 4 + +#define STM32H7_APB3_RESET(bit) (STM32H7_RCC_APB3_##bit + (0x8C * 8)) + +/* APB1L */ +#define STM32H7_RCC_APB1L_TIM2 0 +#define STM32H7_RCC_APB1L_TIM3 1 +#define STM32H7_RCC_APB1L_TIM4 2 +#define STM32H7_RCC_APB1L_TIM5 3 +#define STM32H7_RCC_APB1L_TIM6 4 +#define STM32H7_RCC_APB1L_TIM7 5 +#define STM32H7_RCC_APB1L_TIM12 6 +#define STM32H7_RCC_APB1L_TIM13 7 +#define STM32H7_RCC_APB1L_TIM14 8 +#define STM32H7_RCC_APB1L_LPTIM1 9 +#define STM32H7_RCC_APB1L_SPI2 14 +#define STM32H7_RCC_APB1L_SPI3 15 +#define STM32H7_RCC_APB1L_SPDIF_RX 16 +#define STM32H7_RCC_APB1L_USART2 17 +#define STM32H7_RCC_APB1L_USART3 18 +#define STM32H7_RCC_APB1L_UART4 19 +#define STM32H7_RCC_APB1L_UART5 20 +#define STM32H7_RCC_APB1L_I2C1 21 +#define STM32H7_RCC_APB1L_I2C2 22 +#define STM32H7_RCC_APB1L_I2C3 23 +#define STM32H7_RCC_APB1L_HDMICEC 27 +#define STM32H7_RCC_APB1L_DAC12 29 +#define STM32H7_RCC_APB1L_USART7 30 +#define STM32H7_RCC_APB1L_USART8 31 + +#define STM32H7_APB1L_RESET(bit) (STM32H7_RCC_APB1L_##bit + (0x90 * 8)) + +/* APB1H */ +#define STM32H7_RCC_APB1H_CRS 1 +#define STM32H7_RCC_APB1H_SWP 2 +#define STM32H7_RCC_APB1H_OPAMP 4 +#define STM32H7_RCC_APB1H_MDIOS 5 +#define STM32H7_RCC_APB1H_FDCAN 8 + +#define STM32H7_APB1H_RESET(bit) (STM32H7_RCC_APB1H_##bit + (0x94 * 8)) + +/* APB2 */ +#define STM32H7_RCC_APB2_TIM1 0 +#define STM32H7_RCC_APB2_TIM8 1 +#define STM32H7_RCC_APB2_USART1 4 +#define STM32H7_RCC_APB2_USART6 5 +#define STM32H7_RCC_APB2_SPI1 12 +#define STM32H7_RCC_APB2_SPI4 13 +#define STM32H7_RCC_APB2_TIM15 16 +#define STM32H7_RCC_APB2_TIM16 17 +#define STM32H7_RCC_APB2_TIM17 18 +#define STM32H7_RCC_APB2_SPI5 20 +#define STM32H7_RCC_APB2_SAI1 22 +#define STM32H7_RCC_APB2_SAI2 23 +#define STM32H7_RCC_APB2_SAI3 24 +#define STM32H7_RCC_APB2_DFSDM1 28 +#define STM32H7_RCC_APB2_HRTIM 29 + +#define STM32H7_APB2_RESET(bit) (STM32H7_RCC_APB2_##bit + (0x98 * 8)) + +/* APB4 */ +#define STM32H7_RCC_APB4_SYSCFG 1 +#define STM32H7_RCC_APB4_LPUART1 3 +#define STM32H7_RCC_APB4_SPI6 5 +#define STM32H7_RCC_APB4_I2C4 7 +#define STM32H7_RCC_APB4_LPTIM2 9 +#define STM32H7_RCC_APB4_LPTIM3 10 +#define STM32H7_RCC_APB4_LPTIM4 11 +#define STM32H7_RCC_APB4_LPTIM5 12 +#define STM32H7_RCC_APB4_COMP12 14 +#define STM32H7_RCC_APB4_VREF 15 +#define STM32H7_RCC_APB4_SAI4 21 +#define STM32H7_RCC_APB4_TMPSENS 26 + +#define STM32H7_APB4_RESET(bit) (STM32H7_RCC_APB4_##bit + (0x9C * 8)) + +#endif /* _DT_BINDINGS_MFD_STM32H7_RCC_H */ diff --git a/include/dt-bindings/mips/lantiq_rcu_gphy.h b/include/dt-bindings/mips/lantiq_rcu_gphy.h new file mode 100644 index 000000000000..fa1a63773342 --- /dev/null +++ b/include/dt-bindings/mips/lantiq_rcu_gphy.h @@ -0,0 +1,15 @@ +/* + * 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. + * + * Copyright (C) 2016 Martin Blumenstingl + * Copyright (C) 2017 Hauke Mehrtens + */ +#ifndef _DT_BINDINGS_MIPS_LANTIQ_RCU_GPHY_H +#define _DT_BINDINGS_MIPS_LANTIQ_RCU_GPHY_H + +#define GPHY_MODE_GE 1 +#define GPHY_MODE_FE 2 + +#endif /* _DT_BINDINGS_MIPS_LANTIQ_RCU_GPHY_H */ diff --git a/include/dt-bindings/mux/mux.h b/include/dt-bindings/mux/mux.h index c8e855c4a609..042719218dbf 100644 --- a/include/dt-bindings/mux/mux.h +++ b/include/dt-bindings/mux/mux.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for most Multiplexer bindings. * diff --git a/include/dt-bindings/pinctrl/am33xx.h b/include/dt-bindings/pinctrl/am33xx.h index 226f77246a70..7d947a597220 100644 --- a/include/dt-bindings/pinctrl/am33xx.h +++ b/include/dt-bindings/pinctrl/am33xx.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants specific to AM33XX pinctrl bindings. */ diff --git a/include/dt-bindings/pinctrl/am43xx.h b/include/dt-bindings/pinctrl/am43xx.h index 344bd1eb3386..46789157660b 100644 --- a/include/dt-bindings/pinctrl/am43xx.h +++ b/include/dt-bindings/pinctrl/am43xx.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants specific to AM43XX pinctrl bindings. */ diff --git a/include/dt-bindings/pinctrl/dm814x.h b/include/dt-bindings/pinctrl/dm814x.h index 0f484273da0d..afbabbc4ddbb 100644 --- a/include/dt-bindings/pinctrl/dm814x.h +++ b/include/dt-bindings/pinctrl/dm814x.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants specific to DM814X pinctrl bindings. */ diff --git a/include/dt-bindings/pinctrl/dra.h b/include/dt-bindings/pinctrl/dra.h index 5c75e80915fc..18ec5df5a581 100644 --- a/include/dt-bindings/pinctrl/dra.h +++ b/include/dt-bindings/pinctrl/dra.h @@ -73,5 +73,8 @@ */ #define DRA7XX_CORE_IOPAD(pa, val) (((pa) & 0xffff) - 0x3400) (val) +/* DRA7 IODELAY configuration parameters */ +#define A_DELAY_PS(val) ((val) & 0xffff) +#define G_DELAY_PS(val) ((val) & 0xffff) #endif diff --git a/include/dt-bindings/pinctrl/mt6397-pinfunc.h b/include/dt-bindings/pinctrl/mt6397-pinfunc.h index 85739b308c2f..f393fbd68905 100644 --- a/include/dt-bindings/pinctrl/mt6397-pinfunc.h +++ b/include/dt-bindings/pinctrl/mt6397-pinfunc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DTS_MT6397_PINFUNC_H #define __DTS_MT6397_PINFUNC_H diff --git a/include/dt-bindings/pinctrl/mt7623-pinfunc.h b/include/dt-bindings/pinctrl/mt7623-pinfunc.h index 436a87be864a..2d6a7b1d7be2 100644 --- a/include/dt-bindings/pinctrl/mt7623-pinfunc.h +++ b/include/dt-bindings/pinctrl/mt7623-pinfunc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DTS_MT7623_PINFUNC_H #define __DTS_MT7623_PINFUNC_H diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h index fbd6f7202476..49b5dea2b388 100644 --- a/include/dt-bindings/pinctrl/omap.h +++ b/include/dt-bindings/pinctrl/omap.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for OMAP pinctrl bindings. * diff --git a/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h b/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h index 914d56da9324..ac63c399b4b6 100644 --- a/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h +++ b/include/dt-bindings/pinctrl/pinctrl-tegra-xusb.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_PINCTRL_TEGRA_XUSB_H #define _DT_BINDINGS_PINCTRL_TEGRA_XUSB_H 1 diff --git a/include/dt-bindings/pinctrl/qcom,pmic-gpio.h b/include/dt-bindings/pinctrl/qcom,pmic-gpio.h index d33f17c8a515..e5df5ce45a0f 100644 --- a/include/dt-bindings/pinctrl/qcom,pmic-gpio.h +++ b/include/dt-bindings/pinctrl/qcom,pmic-gpio.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the Qualcomm PMIC GPIO binding. */ @@ -98,6 +99,8 @@ #define PMIC_GPIO_FUNC_PAIRED "paired" #define PMIC_GPIO_FUNC_FUNC1 "func1" #define PMIC_GPIO_FUNC_FUNC2 "func2" +#define PMIC_GPIO_FUNC_FUNC3 "func3" +#define PMIC_GPIO_FUNC_FUNC4 "func4" #define PMIC_GPIO_FUNC_DTEST1 "dtest1" #define PMIC_GPIO_FUNC_DTEST2 "dtest2" #define PMIC_GPIO_FUNC_DTEST3 "dtest3" diff --git a/include/dt-bindings/pinctrl/qcom,pmic-mpp.h b/include/dt-bindings/pinctrl/qcom,pmic-mpp.h index 2e360d8f7801..32e66ee7e830 100644 --- a/include/dt-bindings/pinctrl/qcom,pmic-mpp.h +++ b/include/dt-bindings/pinctrl/qcom,pmic-mpp.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the Qualcomm PMIC's * Multi-Purpose Pin binding. diff --git a/include/dt-bindings/pinctrl/r7s72100-pinctrl.h b/include/dt-bindings/pinctrl/r7s72100-pinctrl.h index 6b609fe10910..cdb950246880 100644 --- a/include/dt-bindings/pinctrl/r7s72100-pinctrl.h +++ b/include/dt-bindings/pinctrl/r7s72100-pinctrl.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Defines macros and constants for Renesas RZ/A1 pin controller pin * muxing functions. diff --git a/include/dt-bindings/pinctrl/samsung.h b/include/dt-bindings/pinctrl/samsung.h index b7aa3646208b..ceb672305f59 100644 --- a/include/dt-bindings/pinctrl/samsung.h +++ b/include/dt-bindings/pinctrl/samsung.h @@ -66,7 +66,8 @@ #define EXYNOS_PIN_FUNC_4 4 #define EXYNOS_PIN_FUNC_5 5 #define EXYNOS_PIN_FUNC_6 6 -#define EXYNOS_PIN_FUNC_F 0xf +#define EXYNOS_PIN_FUNC_EINT 0xf +#define EXYNOS_PIN_FUNC_F EXYNOS_PIN_FUNC_EINT /* Drive strengths for Exynos7 FSYS1 block */ #define EXYNOS7_FSYS1_PIN_DRV_LV1 0 diff --git a/include/dt-bindings/pinctrl/stm32f429-pinfunc.h b/include/dt-bindings/pinctrl/stm32f429-pinfunc.h index 26f18798d949..9a5a028f0d00 100644 --- a/include/dt-bindings/pinctrl/stm32f429-pinfunc.h +++ b/include/dt-bindings/pinctrl/stm32f429-pinfunc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_STM32F429_PINFUNC_H #define _DT_BINDINGS_STM32F429_PINFUNC_H diff --git a/include/dt-bindings/pinctrl/stm32f746-pinfunc.h b/include/dt-bindings/pinctrl/stm32f746-pinfunc.h index 6348c6a830e9..4c28f8f41621 100644 --- a/include/dt-bindings/pinctrl/stm32f746-pinfunc.h +++ b/include/dt-bindings/pinctrl/stm32f746-pinfunc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_STM32F746_PINFUNC_H #define _DT_BINDINGS_STM32F746_PINFUNC_H diff --git a/include/dt-bindings/pinctrl/stm32h7-pinfunc.h b/include/dt-bindings/pinctrl/stm32h7-pinfunc.h index cb673b5e8e1e..06d99a8ddbc6 100644 --- a/include/dt-bindings/pinctrl/stm32h7-pinfunc.h +++ b/include/dt-bindings/pinctrl/stm32h7-pinfunc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_STM32H7_PINFUNC_H #define _DT_BINDINGS_STM32H7_PINFUNC_H diff --git a/include/dt-bindings/power/mt7622-power.h b/include/dt-bindings/power/mt7622-power.h new file mode 100644 index 000000000000..1b639269790c --- /dev/null +++ b/include/dt-bindings/power/mt7622-power.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2017 MediaTek Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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 http://www.gnu.org/licenses/gpl-2.0.html for more details. + */ + +#ifndef _DT_BINDINGS_POWER_MT7622_POWER_H +#define _DT_BINDINGS_POWER_MT7622_POWER_H + +#define MT7622_POWER_DOMAIN_ETHSYS 0 +#define MT7622_POWER_DOMAIN_HIF0 1 +#define MT7622_POWER_DOMAIN_HIF1 2 +#define MT7622_POWER_DOMAIN_WB 3 + +#endif /* _DT_BINDINGS_POWER_MT7622_POWER_H */ diff --git a/include/dt-bindings/power/mt8173-power.h b/include/dt-bindings/power/mt8173-power.h index b34cee95aa89..15d531aa6e78 100644 --- a/include/dt-bindings/power/mt8173-power.h +++ b/include/dt-bindings/power/mt8173-power.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_POWER_MT8183_POWER_H #define _DT_BINDINGS_POWER_MT8183_POWER_H diff --git a/include/dt-bindings/power/r8a77995-sysc.h b/include/dt-bindings/power/r8a77995-sysc.h new file mode 100644 index 000000000000..09d0ed575b73 --- /dev/null +++ b/include/dt-bindings/power/r8a77995-sysc.h @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2017 Glider bvba + * + * 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; version 2 of the License. + */ +#ifndef __DT_BINDINGS_POWER_R8A77995_SYSC_H__ +#define __DT_BINDINGS_POWER_R8A77995_SYSC_H__ + +/* + * These power domain indices match the numbers of the interrupt bits + * representing the power areas in the various Interrupt Registers + * (e.g. SYSCISR, Interrupt Status Register) + */ + +#define R8A77995_PD_CA53_CPU0 5 +#define R8A77995_PD_CA53_SCU 21 + +/* Always-on power area */ +#define R8A77995_PD_ALWAYS_ON 32 + +#endif /* __DT_BINDINGS_POWER_R8A77995_SYSC_H__ */ diff --git a/include/dt-bindings/power/rk3288-power.h b/include/dt-bindings/power/rk3288-power.h index b8b1045f3daa..f710b56ccd81 100644 --- a/include/dt-bindings/power/rk3288-power.h +++ b/include/dt-bindings/power/rk3288-power.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_BINDINGS_POWER_RK3288_POWER_H__ #define __DT_BINDINGS_POWER_RK3288_POWER_H__ diff --git a/include/dt-bindings/power/rk3328-power.h b/include/dt-bindings/power/rk3328-power.h index 10c3c3715334..02e3d7fc1cce 100644 --- a/include/dt-bindings/power/rk3328-power.h +++ b/include/dt-bindings/power/rk3328-power.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_BINDINGS_POWER_RK3328_POWER_H__ #define __DT_BINDINGS_POWER_RK3328_POWER_H__ diff --git a/include/dt-bindings/power/rk3366-power.h b/include/dt-bindings/power/rk3366-power.h new file mode 100644 index 000000000000..223a3dce049a --- /dev/null +++ b/include/dt-bindings/power/rk3366-power.h @@ -0,0 +1,24 @@ +#ifndef __DT_BINDINGS_POWER_RK3366_POWER_H__ +#define __DT_BINDINGS_POWER_RK3366_POWER_H__ + +/* VD_CORE */ +#define RK3366_PD_A53_0 0 +#define RK3366_PD_A53_1 1 +#define RK3366_PD_A53_2 2 +#define RK3366_PD_A53_3 3 + +/* VD_LOGIC */ +#define RK3366_PD_BUS 4 +#define RK3366_PD_PERI 5 +#define RK3366_PD_VIO 6 +#define RK3366_PD_VIDEO 7 +#define RK3366_PD_RKVDEC 8 +#define RK3366_PD_WIFIBT 9 +#define RK3366_PD_VPU 10 +#define RK3366_PD_GPU 11 +#define RK3366_PD_ALIVE 12 + +/* VD_PMU */ +#define RK3366_PD_PMU 13 + +#endif diff --git a/include/dt-bindings/power/rk3368-power.h b/include/dt-bindings/power/rk3368-power.h index 93633d57ed84..5e602dbd64ec 100644 --- a/include/dt-bindings/power/rk3368-power.h +++ b/include/dt-bindings/power/rk3368-power.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_BINDINGS_POWER_RK3368_POWER_H__ #define __DT_BINDINGS_POWER_RK3368_POWER_H__ diff --git a/include/dt-bindings/power/rk3399-power.h b/include/dt-bindings/power/rk3399-power.h index 168b3bfbd6f5..aedd8b180fe4 100644 --- a/include/dt-bindings/power/rk3399-power.h +++ b/include/dt-bindings/power/rk3399-power.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_BINDINGS_POWER_RK3399_POWER_H__ #define __DT_BINDINGS_POWER_RK3399_POWER_H__ diff --git a/include/dt-bindings/pwm/pwm.h b/include/dt-bindings/pwm/pwm.h index 96f49e82253e..ab9a077e3c7d 100644 --- a/include/dt-bindings/pwm/pwm.h +++ b/include/dt-bindings/pwm/pwm.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for most PWM bindings. * diff --git a/include/dt-bindings/reset/amlogic,meson8b-clkc-reset.h b/include/dt-bindings/reset/amlogic,meson8b-clkc-reset.h new file mode 100644 index 000000000000..1f1b56e57346 --- /dev/null +++ b/include/dt-bindings/reset/amlogic,meson8b-clkc-reset.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017 Martin Blumenstingl . + * + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) + */ + +#ifndef _DT_BINDINGS_AMLOGIC_MESON8B_CLKC_RESET_H +#define _DT_BINDINGS_AMLOGIC_MESON8B_CLKC_RESET_H + +#define CLKC_RESET_L2_CACHE_SOFT_RESET 0 +#define CLKC_RESET_AXI_64_TO_128_BRIDGE_A5_SOFT_RESET 1 +#define CLKC_RESET_SCU_SOFT_RESET 2 +#define CLKC_RESET_CPU0_SOFT_RESET 3 +#define CLKC_RESET_CPU1_SOFT_RESET 4 +#define CLKC_RESET_CPU2_SOFT_RESET 5 +#define CLKC_RESET_CPU3_SOFT_RESET 6 +#define CLKC_RESET_A5_GLOBAL_RESET 7 +#define CLKC_RESET_A5_AXI_SOFT_RESET 8 +#define CLKC_RESET_A5_ABP_SOFT_RESET 9 +#define CLKC_RESET_AXI_64_TO_128_BRIDGE_MMC_SOFT_RESET 10 +#define CLKC_RESET_VID_CLK_CNTL_SOFT_RESET 11 +#define CLKC_RESET_VID_DIVIDER_CNTL_SOFT_RESET_POST 12 +#define CLKC_RESET_VID_DIVIDER_CNTL_SOFT_RESET_PRE 13 +#define CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_POST 14 +#define CLKC_RESET_VID_DIVIDER_CNTL_RESET_N_PRE 15 + +#endif /* _DT_BINDINGS_AMLOGIC_MESON8B_CLKC_RESET_H */ diff --git a/include/dt-bindings/reset/cortina,gemini-reset.h b/include/dt-bindings/reset/cortina,gemini-reset.h index 0b886aee65e3..f48aff23847a 100644 --- a/include/dt-bindings/reset/cortina,gemini-reset.h +++ b/include/dt-bindings/reset/cortina,gemini-reset.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_RESET_CORTINA_GEMINI_H #define _DT_BINDINGS_RESET_CORTINA_GEMINI_H diff --git a/include/dt-bindings/reset/hisi,hi6220-resets.h b/include/dt-bindings/reset/hisi,hi6220-resets.h index 322ec5335b65..e7c362a81a97 100644 --- a/include/dt-bindings/reset/hisi,hi6220-resets.h +++ b/include/dt-bindings/reset/hisi,hi6220-resets.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /** * This header provides index for the reset controller * based on hi6220 SoC. diff --git a/include/dt-bindings/reset/pistachio-resets.h b/include/dt-bindings/reset/pistachio-resets.h index 60a189b1faef..5bb4dd0d6377 100644 --- a/include/dt-bindings/reset/pistachio-resets.h +++ b/include/dt-bindings/reset/pistachio-resets.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the reset controller * present in the Pistachio SoC diff --git a/include/dt-bindings/reset/snps,hsdk-reset.h b/include/dt-bindings/reset/snps,hsdk-reset.h new file mode 100644 index 000000000000..e1a643e4bc91 --- /dev/null +++ b/include/dt-bindings/reset/snps,hsdk-reset.h @@ -0,0 +1,17 @@ +/** + * This header provides index for the HSDK reset controller. + */ +#ifndef _DT_BINDINGS_RESET_CONTROLLER_SNPS_HSDK +#define _DT_BINDINGS_RESET_CONTROLLER_SNPS_HSDK + +#define HSDK_APB_RESET 0 +#define HSDK_AXI_RESET 1 +#define HSDK_ETH_RESET 2 +#define HSDK_USB_RESET 3 +#define HSDK_SDIO_RESET 4 +#define HSDK_HDMI_RESET 5 +#define HSDK_GFX_RESET 6 +#define HSDK_DMAC_RESET 7 +#define HSDK_EBI_RESET 8 + +#endif /*_DT_BINDINGS_RESET_CONTROLLER_SNPS_HSDK*/ diff --git a/include/dt-bindings/reset/stih407-resets.h b/include/dt-bindings/reset/stih407-resets.h index 4ab3a1c94958..f2a2c4f7f06a 100644 --- a/include/dt-bindings/reset/stih407-resets.h +++ b/include/dt-bindings/reset/stih407-resets.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the reset controller * based peripheral powerdown requests on the STMicroelectronics diff --git a/include/dt-bindings/reset/stih415-resets.h b/include/dt-bindings/reset/stih415-resets.h index c2329fe29cf6..96f7831a1db0 100644 --- a/include/dt-bindings/reset/stih415-resets.h +++ b/include/dt-bindings/reset/stih415-resets.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the reset controller * based peripheral powerdown requests on the STMicroelectronics diff --git a/include/dt-bindings/reset/stih416-resets.h b/include/dt-bindings/reset/stih416-resets.h index fcf9af1ac0b2..f682c906ed5a 100644 --- a/include/dt-bindings/reset/stih416-resets.h +++ b/include/dt-bindings/reset/stih416-resets.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the reset controller * based peripheral powerdown requests on the STMicroelectronics diff --git a/include/dt-bindings/reset/sun4i-a10-ccu.h b/include/dt-bindings/reset/sun4i-a10-ccu.h new file mode 100644 index 000000000000..5f4480bedc8a --- /dev/null +++ b/include/dt-bindings/reset/sun4i-a10-ccu.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2017 Priit Laes + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _DT_BINDINGS_RST_SUN4I_A10_H +#define _DT_BINDINGS_RST_SUN4I_A10_H + +#define RST_USB_PHY0 1 +#define RST_USB_PHY1 2 +#define RST_USB_PHY2 3 +#define RST_GPS 4 +#define RST_DE_BE0 5 +#define RST_DE_BE1 6 +#define RST_DE_FE0 7 +#define RST_DE_FE1 8 +#define RST_DE_MP 9 +#define RST_TVE0 10 +#define RST_TCON0 11 +#define RST_TVE1 12 +#define RST_TCON1 13 +#define RST_CSI0 14 +#define RST_CSI1 15 +#define RST_VE 16 +#define RST_ACE 17 +#define RST_LVDS 18 +#define RST_GPU 19 +#define RST_HDMI_H 20 +#define RST_HDMI_SYS 21 +#define RST_HDMI_AUDIO_DMA 22 + +#endif /* DT_BINDINGS_RST_SUN4I_A10_H */ diff --git a/include/dt-bindings/reset/sun8i-r40-ccu.h b/include/dt-bindings/reset/sun8i-r40-ccu.h new file mode 100644 index 000000000000..c5ebcf6672e4 --- /dev/null +++ b/include/dt-bindings/reset/sun8i-r40-ccu.h @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2017 Icenowy Zheng + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _DT_BINDINGS_RST_SUN8I_R40_H_ +#define _DT_BINDINGS_RST_SUN8I_R40_H_ + +#define RST_USB_PHY0 0 +#define RST_USB_PHY1 1 +#define RST_USB_PHY2 2 + +#define RST_DRAM 3 +#define RST_MBUS 4 + +#define RST_BUS_MIPI_DSI 5 +#define RST_BUS_CE 6 +#define RST_BUS_DMA 7 +#define RST_BUS_MMC0 8 +#define RST_BUS_MMC1 9 +#define RST_BUS_MMC2 10 +#define RST_BUS_MMC3 11 +#define RST_BUS_NAND 12 +#define RST_BUS_DRAM 13 +#define RST_BUS_EMAC 14 +#define RST_BUS_TS 15 +#define RST_BUS_HSTIMER 16 +#define RST_BUS_SPI0 17 +#define RST_BUS_SPI1 18 +#define RST_BUS_SPI2 19 +#define RST_BUS_SPI3 20 +#define RST_BUS_SATA 21 +#define RST_BUS_OTG 22 +#define RST_BUS_EHCI0 23 +#define RST_BUS_EHCI1 24 +#define RST_BUS_EHCI2 25 +#define RST_BUS_OHCI0 26 +#define RST_BUS_OHCI1 27 +#define RST_BUS_OHCI2 28 +#define RST_BUS_VE 29 +#define RST_BUS_MP 30 +#define RST_BUS_DEINTERLACE 31 +#define RST_BUS_CSI0 32 +#define RST_BUS_CSI1 33 +#define RST_BUS_HDMI0 34 +#define RST_BUS_HDMI1 35 +#define RST_BUS_DE 36 +#define RST_BUS_TVE0 37 +#define RST_BUS_TVE1 38 +#define RST_BUS_TVE_TOP 39 +#define RST_BUS_GMAC 40 +#define RST_BUS_GPU 41 +#define RST_BUS_TVD0 42 +#define RST_BUS_TVD1 43 +#define RST_BUS_TVD2 44 +#define RST_BUS_TVD3 45 +#define RST_BUS_TVD_TOP 46 +#define RST_BUS_TCON_LCD0 47 +#define RST_BUS_TCON_LCD1 48 +#define RST_BUS_TCON_TV0 49 +#define RST_BUS_TCON_TV1 50 +#define RST_BUS_TCON_TOP 51 +#define RST_BUS_DBG 52 +#define RST_BUS_LVDS 53 +#define RST_BUS_CODEC 54 +#define RST_BUS_SPDIF 55 +#define RST_BUS_AC97 56 +#define RST_BUS_IR0 57 +#define RST_BUS_IR1 58 +#define RST_BUS_THS 59 +#define RST_BUS_KEYPAD 60 +#define RST_BUS_I2S0 61 +#define RST_BUS_I2S1 62 +#define RST_BUS_I2S2 63 +#define RST_BUS_I2C0 64 +#define RST_BUS_I2C1 65 +#define RST_BUS_I2C2 66 +#define RST_BUS_I2C3 67 +#define RST_BUS_CAN 68 +#define RST_BUS_SCR 69 +#define RST_BUS_PS20 70 +#define RST_BUS_PS21 71 +#define RST_BUS_I2C4 72 +#define RST_BUS_UART0 73 +#define RST_BUS_UART1 74 +#define RST_BUS_UART2 75 +#define RST_BUS_UART3 76 +#define RST_BUS_UART4 77 +#define RST_BUS_UART5 78 +#define RST_BUS_UART6 79 +#define RST_BUS_UART7 80 + +#endif /* _DT_BINDINGS_RST_SUN8I_R40_H_ */ diff --git a/include/dt-bindings/reset/tegra124-car.h b/include/dt-bindings/reset/tegra124-car.h index 070e4f6e7486..97d2f3db82bf 100644 --- a/include/dt-bindings/reset/tegra124-car.h +++ b/include/dt-bindings/reset/tegra124-car.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides Tegra124-specific constants for binding * nvidia,tegra124-car. diff --git a/include/dt-bindings/reset/tegra210-car.h b/include/dt-bindings/reset/tegra210-car.h index 296ec6e3f8c0..9dc84ec76301 100644 --- a/include/dt-bindings/reset/tegra210-car.h +++ b/include/dt-bindings/reset/tegra210-car.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides Tegra210-specific constants for binding * nvidia,tegra210-car. diff --git a/include/dt-bindings/soc/rockchip,boot-mode.h b/include/dt-bindings/soc/rockchip,boot-mode.h index ae7c867e736a..4b0914c0989d 100644 --- a/include/dt-bindings/soc/rockchip,boot-mode.h +++ b/include/dt-bindings/soc/rockchip,boot-mode.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __ROCKCHIP_BOOT_MODE_H #define __ROCKCHIP_BOOT_MODE_H diff --git a/include/dt-bindings/sound/apq8016-lpass.h b/include/dt-bindings/sound/apq8016-lpass.h index 499076e980a3..3c3e16c0aadb 100644 --- a/include/dt-bindings/sound/apq8016-lpass.h +++ b/include/dt-bindings/sound/apq8016-lpass.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_APQ8016_LPASS_H #define __DT_APQ8016_LPASS_H diff --git a/include/dt-bindings/sound/audio-jack-events.h b/include/dt-bindings/sound/audio-jack-events.h index 378349f28069..1b29b295126a 100644 --- a/include/dt-bindings/sound/audio-jack-events.h +++ b/include/dt-bindings/sound/audio-jack-events.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __AUDIO_JACK_EVENTS_H #define __AUDIO_JACK_EVENTS_H diff --git a/include/dt-bindings/sound/cs35l32.h b/include/dt-bindings/sound/cs35l32.h index 0c6d6a3c15a2..7549d5019e8b 100644 --- a/include/dt-bindings/sound/cs35l32.h +++ b/include/dt-bindings/sound/cs35l32.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_CS35L32_H #define __DT_CS35L32_H diff --git a/include/dt-bindings/sound/fsl-imx-audmux.h b/include/dt-bindings/sound/fsl-imx-audmux.h index 50b09e96f247..751fe1416f95 100644 --- a/include/dt-bindings/sound/fsl-imx-audmux.h +++ b/include/dt-bindings/sound/fsl-imx-audmux.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_FSL_IMX_AUDMUX_H #define __DT_FSL_IMX_AUDMUX_H diff --git a/include/dt-bindings/sound/samsung-i2s.h b/include/dt-bindings/sound/samsung-i2s.h index 0c69818d530c..77545f14c379 100644 --- a/include/dt-bindings/sound/samsung-i2s.h +++ b/include/dt-bindings/sound/samsung-i2s.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _DT_BINDINGS_SAMSUNG_I2S_H #define _DT_BINDINGS_SAMSUNG_I2S_H diff --git a/include/dt-bindings/sound/tas2552.h b/include/dt-bindings/sound/tas2552.h index a4e1a079980b..0daeb8385837 100644 --- a/include/dt-bindings/sound/tas2552.h +++ b/include/dt-bindings/sound/tas2552.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_TAS2552_H #define __DT_TAS2552_H diff --git a/include/dt-bindings/sound/tlv320aic31xx-micbias.h b/include/dt-bindings/sound/tlv320aic31xx-micbias.h index f5cb772ab9c8..c6895a18a455 100644 --- a/include/dt-bindings/sound/tlv320aic31xx-micbias.h +++ b/include/dt-bindings/sound/tlv320aic31xx-micbias.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef __DT_TLV320AIC31XX_MICBIAS_H #define __DT_TLV320AIC31XX_MICBIAS_H diff --git a/include/dt-bindings/thermal/lm90.h b/include/dt-bindings/thermal/lm90.h index 8c2e3095f704..eed91a16c32f 100644 --- a/include/dt-bindings/thermal/lm90.h +++ b/include/dt-bindings/thermal/lm90.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the LM90 thermal bindings. */ diff --git a/include/dt-bindings/thermal/tegra124-soctherm.h b/include/dt-bindings/thermal/tegra124-soctherm.h index 2a99f1d52bb5..c15e8b709a0d 100644 --- a/include/dt-bindings/thermal/tegra124-soctherm.h +++ b/include/dt-bindings/thermal/tegra124-soctherm.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for binding nvidia,tegra124-soctherm. */ diff --git a/scripts/cronjob b/scripts/cronjob index eeedca0506ab..628e91ea0d10 100755 --- a/scripts/cronjob +++ b/scripts/cronjob @@ -77,15 +77,15 @@ echo #echo DATE=$(date +%Y%m%d) -LATEST=latest-${DATE} +TESTBRANCH=test-${DATE} MERGE_OUTPUT=`( set -e -git checkout -b ${LATEST} origin/master +git checkout -b ${TESTBRANCH} origin/master git merge --no-edit upstream/dts ) 2>&1 ` -REF=$(git show-ref --verify refs/heads/${LATEST}) +REF=$(git show-ref --verify refs/heads/${TESTBRANCH}) echo "Testing: ${REF}" -if git log ${LATEST} -- MAINTAINERS | grep --quiet . ; then +if git log ${TESTBRANCH} -- MAINTAINERS | grep --quiet . ; then echo "Filter branch has upstream-only content (MAINTAINERS file)" exit 1 fi @@ -105,6 +105,12 @@ echo echo "Switching back to master branch" git checkout master +echo "Recording refs/tests/${DATE}" +git update-ref refs/tests/${DATE} ${TESTBRANCH} + +echo "Removing ${TESTBRANCH}" +git branch -D "${TESTBRANCH}" + echo "Final State:" for branch in ${BRANCHES} ; do REF=$(git show-ref --verify refs/heads/${branch}) diff --git a/scripts/filter.sh b/scripts/filter.sh index e82218a1ca9d..e1f6bac29884 100755 --- a/scripts/filter.sh +++ b/scripts/filter.sh @@ -27,10 +27,11 @@ rm -f .git/refs/original/refs/heads/${UPSTREAM_REWRITTEN} git branch -f $UPSTREAM_REWRITTEN FETCH_HEAD -sh $SCRIPTS/git-filter-branch --force \ +git filter-branch --force \ --index-filter ${SCRIPTS}/index-filter.sh \ --msg-filter 'cat && /bin/echo -e "\n[ upstream commit: $GIT_COMMIT ]"' \ --tag-name-filter 'while read t ; do /bin/echo -n $t-dts-raw ; done' \ + --parent-filter 'sed "s/-p //g" | xargs -r git show-branch --independent | sed "s/\&2 "Failed to parse symlink $GIT_COMMIT:$path $deref" - exit 1 - ;; - esac - ;; - 100*) - # Regular file, just pass through - echo -e "$mode $object $stage\t$path" - ;; - *) - echo >&2 "Unhandled ls-tree entry: $line" - exit 1 - ;; - esac -done diff --git a/scripts/git-filter-branch b/scripts/git-filter-branch deleted file mode 100755 index 0e839ae68247..000000000000 --- a/scripts/git-filter-branch +++ /dev/null @@ -1,557 +0,0 @@ -#!/bin/sh -# -# Rewrite revision history -# Copyright (c) Petr Baudis, 2006 -# Minimal changes to "port" it to core-git (c) Johannes Schindelin, 2007 -# -# Lets you rewrite the revision history of the current branch, creating -# a new branch. You can specify a number of filters to modify the commits, -# files and trees. - -# The following functions will also be available in the commit filter: - -export PATH=/usr/lib/git-core:$PATH - -functions=$(cat << \EOF -warn () { - echo "$*" >&2 -} - -map() -{ - # if it was not rewritten, take the original - if test -r "$workdir/../map/$1" - then - cat "$workdir/../map/$1" - else - echo "$1" - fi -} - -# if you run 'skip_commit "$@"' in a commit filter, it will print -# the (mapped) parents, effectively skipping the commit. - -skip_commit() -{ - shift; - while [ -n "$1" ]; - do - shift; - map "$1"; - shift; - done; -} - -# if you run 'git_commit_non_empty_tree "$@"' in a commit filter, -# it will skip commits that leave the tree untouched, commit the other. -git_commit_non_empty_tree() -{ - if test $# = 3 && test "$1" = $(git rev-parse "$3^{tree}"); then - map "$3" - else - git commit-tree "$@" - fi -} -# override die(): this version puts in an extra line break, so that -# the progress is still visible - -die() -{ - echo >&2 - echo "$*" >&2 - exit 1 -} -EOF -) - -eval "$functions" - -# When piped a commit, output a script to set the ident of either -# "author" or "committer - -set_ident () { - lid="$(echo "$1" | tr "[A-Z]" "[a-z]")" - uid="$(echo "$1" | tr "[a-z]" "[A-Z]")" - pick_id_script=' - /^'$lid' /{ - s/'\''/'\''\\'\'\''/g - h - s/^'$lid' \([^<]*\) <[^>]*> .*$/\1/ - s/'\''/'\''\'\'\''/g - s/.*/GIT_'$uid'_NAME='\''&'\''; export GIT_'$uid'_NAME/p - - g - s/^'$lid' [^<]* <\([^>]*\)> .*$/\1/ - s/'\''/'\''\'\'\''/g - s/.*/GIT_'$uid'_EMAIL='\''&'\''; export GIT_'$uid'_EMAIL/p - - g - s/^'$lid' [^<]* <[^>]*> \(.*\)$/\1/ - s/'\''/'\''\'\'\''/g - s/.*/GIT_'$uid'_DATE='\''&'\''; export GIT_'$uid'_DATE/p - - q - } - ' - - LANG=C LC_ALL=C sed -ne "$pick_id_script" - # Ensure non-empty id name. - echo "case \"\$GIT_${uid}_NAME\" in \"\") GIT_${uid}_NAME=\"\${GIT_${uid}_EMAIL%%@*}\" && export GIT_${uid}_NAME;; esac" -} - -USAGE="[--env-filter ] [--tree-filter ] - [--index-filter ] [--parent-filter ] - [--msg-filter ] [--commit-filter ] - [--tag-name-filter ] [--subdirectory-filter ] - [--original ] [-d ] [-f | --force] - [--state-branch ] - [...]" - -OPTIONS_SPEC= -. git-sh-setup - -if [ "$(is_bare_repository)" = false ]; then - require_clean_work_tree 'rewrite branches' -fi - -tempdir=.git-rewrite -filter_env= -filter_tree= -filter_index= -filter_parent= -filter_msg=cat -filter_commit= -filter_tag_name= -filter_subdir= -state_branch= -orig_namespace=refs/original/ -force= -prune_empty= -remap_to_ancestor= -while : -do - case "$1" in - --) - shift - break - ;; - --force|-f) - shift - force=t - continue - ;; - --remap-to-ancestor) - # deprecated ($remap_to_ancestor is set now automatically) - shift - remap_to_ancestor=t - continue - ;; - --prune-empty) - shift - prune_empty=t - continue - ;; - -*) - ;; - *) - break; - esac - - # all switches take one argument - ARG="$1" - case "$#" in 1) usage ;; esac - shift - OPTARG="$1" - shift - - case "$ARG" in - -d) - tempdir="$OPTARG" - ;; - --env-filter) - filter_env="$OPTARG" - ;; - --tree-filter) - filter_tree="$OPTARG" - ;; - --index-filter) - filter_index="$OPTARG" - ;; - --parent-filter) - filter_parent="$OPTARG" - ;; - --msg-filter) - filter_msg="$OPTARG" - ;; - --commit-filter) - filter_commit="$functions; $OPTARG" - ;; - --tag-name-filter) - filter_tag_name="$OPTARG" - ;; - --subdirectory-filter) - filter_subdir="$OPTARG" - remap_to_ancestor=t - ;; - --original) - orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/ - ;; - --state-branch) - state_branch="$OPTARG" - ;; - *) - usage - ;; - esac -done - -case "$prune_empty,$filter_commit" in -,) - filter_commit='git commit-tree "$@"';; -t,) - filter_commit="$functions;"' git_commit_non_empty_tree "$@"';; -,*) - ;; -*) - die "Cannot set --prune-empty and --commit-filter at the same time" -esac - -case "$force" in -t) - rm -rf "$tempdir" -;; -'') - test -d "$tempdir" && - die "$tempdir already exists, please remove it" -esac -mkdir -p "$tempdir/t" && -tempdir="$(cd "$tempdir"; pwd)" && -cd "$tempdir/t" && -workdir="$(pwd)" || -die "" - -# Remove tempdir on exit -trap 'cd ../..; rm -rf "$tempdir"' 0 - -ORIG_GIT_DIR="$GIT_DIR" -ORIG_GIT_WORK_TREE="$GIT_WORK_TREE" -ORIG_GIT_INDEX_FILE="$GIT_INDEX_FILE" -GIT_WORK_TREE=. -export GIT_DIR GIT_WORK_TREE - -# Make sure refs/original is empty -git for-each-ref > "$tempdir"/backup-refs || exit -while read sha1 type name -do - case "$force,$name" in - ,$orig_namespace*) - die "Cannot create a new backup. -A previous backup already exists in $orig_namespace -Force overwriting the backup with -f" - ;; - t,$orig_namespace*) - git update-ref -d "$name" $sha1 - ;; - esac -done < "$tempdir"/backup-refs - -# The refs should be updated if their heads were rewritten -git rev-parse --no-flags --revs-only --symbolic-full-name \ - --default HEAD "$@" > "$tempdir"/raw-heads || exit -sed -e '/^^/d' "$tempdir"/raw-heads >"$tempdir"/heads - -test -s "$tempdir"/heads || - die "Which ref do you want to rewrite?" - -GIT_INDEX_FILE="$(pwd)/../index" -export GIT_INDEX_FILE - -# map old->new commit ids for rewriting parents -mkdir ../map || die "Could not create map/ directory" - -if [ -n "$state_branch" ] ; then - state_commit=`git show-ref -s "$state_branch"` - if [ -n "$state_commit" ] ; then - echo "Populating map from $state_branch ($state_commit)" 1>&2 - git show "$state_commit":filter.map | - perl -n -e 'm/(.*):(.*)/ or die; - open F, ">../map/$1" or die; - print F "$2" or die; - close(F) or die' - else - echo "Branch $state_branch does not exist. Will create" 1>&2 - fi -fi - -# we need "--" only if there are no path arguments in $@ -nonrevs=$(git rev-parse --no-revs "$@") || exit -if test -z "$nonrevs" -then - dashdash=-- -else - dashdash= - remap_to_ancestor=t -fi - -rev_args=$(git rev-parse --revs-only "$@") - -case "$filter_subdir" in -"") - eval set -- "$(git rev-parse --sq --no-revs "$@")" - ;; -*) - eval set -- "$(git rev-parse --sq --no-revs "$@" $dashdash \ - "$filter_subdir")" - ;; -esac - -git rev-list --reverse --topo-order --default HEAD \ - --parents --simplify-merges $rev_args "$@" > ../revs || - die "Could not get the commits" -commits=$(wc -l <../revs | tr -d " ") - -test $commits -eq 0 && die "Found nothing to rewrite" - -# Rewrite the commits - -git_filter_branch__commit_count=0 -while read commit parents; do - git_filter_branch__commit_count=$(($git_filter_branch__commit_count+1)) - printf "\rRewrite $commit ($git_filter_branch__commit_count/$commits)" - - case "$filter_subdir" in - "") - git read-tree -i -m $commit - ;; - *) - # The commit may not have the subdirectory at all - err=$(git read-tree -i -m $commit:"$filter_subdir" 2>&1) || { - if ! git rev-parse -q --verify $commit:"$filter_subdir" - then - rm -f "$GIT_INDEX_FILE" - else - echo >&2 "$err" - false - fi - } - esac || die "Could not initialize the index" - - GIT_COMMIT=$commit - export GIT_COMMIT - git cat-file commit "$commit" >../commit || - die "Cannot read commit $commit" - - eval "$(set_ident AUTHOR <../commit)" || - die "setting author failed for commit $commit" - eval "$(set_ident COMMITTER <../commit)" || - die "setting committer failed for commit $commit" - eval "$filter_env" < /dev/null || - die "env filter failed: $filter_env" - - if [ "$filter_tree" ]; then - git checkout-index -f -u -a || - die "Could not checkout the index" - # files that $commit removed are now still in the working tree; - # remove them, else they would be added again - git clean -d -q -f -x - eval "$filter_tree" < /dev/null || - die "tree filter failed: $filter_tree" - - ( - git diff-index -r --name-only --ignore-submodules $commit && - git ls-files --others - ) > "$tempdir"/tree-state || exit - git update-index --add --replace --remove --stdin \ - < "$tempdir"/tree-state || exit - fi - - eval "$filter_index" < /dev/null || - die "index filter failed: $filter_index" - - parentstr= - for parent in $parents; do - for reparent in $(map "$parent"); do - parentstr="$parentstr -p $reparent" - done - done - if [ "$filter_parent" ]; then - parentstr="$(echo "$parentstr" | eval "$filter_parent")" || - die "parent filter failed: $filter_parent" - fi - - sed -e '1,/^$/d' <../commit | \ - eval "$filter_msg" > ../message || - die "msg filter failed: $filter_msg" - workdir=$workdir /bin/sh -c "$filter_commit" "git commit-tree" \ - $(git write-tree) $parentstr < ../message > ../map/$commit || - die "could not write rewritten commit" -done <../revs - -# If we are filtering for paths, as in the case of a subdirectory -# filter, it is possible that a specified head is not in the set of -# rewritten commits, because it was pruned by the revision walker. -# Ancestor remapping fixes this by mapping these heads to the unique -# nearest ancestor that survived the pruning. - -if test "$remap_to_ancestor" = t -then - while read ref - do - sha1=$(git rev-parse "$ref"^0) - test -f "$workdir"/../map/$sha1 && continue - ancestor=$(git rev-list --simplify-merges -1 "$ref" "$@") - test "$ancestor" && echo $(map $ancestor) >> "$workdir"/../map/$sha1 - done < "$tempdir"/heads -fi - -# Finally update the refs - -_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]' -_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40" -echo -while read ref -do - # avoid rewriting a ref twice - test -f "$orig_namespace$ref" && continue - - sha1=$(git rev-parse "$ref"^0) - rewritten=$(map $sha1) - - test $sha1 = "$rewritten" && - warn "WARNING: Ref '$ref' is unchanged" && - continue - - case "$rewritten" in - '') - echo "Ref '$ref' was deleted" - git update-ref -m "filter-branch: delete" -d "$ref" $sha1 || - die "Could not delete $ref" - ;; - $_x40) - echo "Ref '$ref' was rewritten" - if ! git update-ref -m "filter-branch: rewrite" \ - "$ref" $rewritten $sha1 2>/dev/null; then - if test $(git cat-file -t "$ref") = tag; then - if test -z "$filter_tag_name"; then - warn "WARNING: You said to rewrite tagged commits, but not the corresponding tag." - warn "WARNING: Perhaps use '--tag-name-filter cat' to rewrite the tag." - fi - else - die "Could not rewrite $ref" - fi - fi - ;; - *) - # NEEDSWORK: possibly add -Werror, making this an error - warn "WARNING: '$ref' was rewritten into multiple commits:" - warn "$rewritten" - warn "WARNING: Ref '$ref' points to the first one now." - rewritten=$(echo "$rewritten" | head -n 1) - git update-ref -m "filter-branch: rewrite to first" \ - "$ref" $rewritten $sha1 || - die "Could not rewrite $ref" - ;; - esac - git update-ref -m "filter-branch: backup" "$orig_namespace$ref" $sha1 || - exit -done < "$tempdir"/heads - -# TODO: This should possibly go, with the semantics that all positive given -# refs are updated, and their original heads stored in refs/original/ -# Filter tags - -if [ "$filter_tag_name" ]; then - git for-each-ref --format='%(objectname) %(objecttype) %(refname)' refs/tags | - while read sha1 type ref; do - ref="${ref#refs/tags/}" - # XXX: Rewrite tagged trees as well? - if [ "$type" != "commit" -a "$type" != "tag" ]; then - continue; - fi - - if [ "$type" = "tag" ]; then - # Dereference to a commit - sha1t="$sha1" - sha1="$(git rev-parse -q "$sha1"^{commit})" || continue - fi - - [ -f "../map/$sha1" ] || continue - new_sha1="$(cat "../map/$sha1")" - GIT_COMMIT="$sha1" - export GIT_COMMIT - new_ref="$(echo "$ref" | eval "$filter_tag_name")" || - die "tag name filter failed: $filter_tag_name" - - echo "$ref -> $new_ref ($sha1 -> $new_sha1)" - - if [ "$type" = "tag" ]; then - new_sha1=$( ( printf 'object %s\ntype commit\ntag %s\n' \ - "$new_sha1" "$new_ref" - git cat-file tag "$ref" | - awk '/^tagger/ { tagged=1 } - /^$/ { if (!tagged && !done) { print "tagger Unknown 0 +0000" } ; done=1 } - // { print }' | - sed -n \ - -e '1,/^$/{ - /^object /d - /^type /d - /^tag /d - }' \ - -e '/^-----BEGIN PGP SIGNATURE-----/q' \ - -e 'p' ) | - git mktag) || - die "Could not create new tag object for $ref" - if git cat-file tag "$ref" | \ - sane_grep '^-----BEGIN PGP SIGNATURE-----' >/dev/null 2>&1 - then - warn "gpg signature stripped from tag object $sha1t" - fi - fi - - git update-ref "refs/tags/$new_ref" "$new_sha1" || - die "Could not write tag $new_ref" - done -fi - -if [ -n "$state_branch" ] ; then - echo "Saving rewrite state to $state_branch" 1>&2 - STATE_BLOB=$(ls ../map | - perl -n -e 'chomp(); - open F, "<../map/$_" or die; - chomp($f = ); print "$_:$f\n";' | - git hash-object -w --stdin ) - STATE_TREE=$(/bin/echo -e "100644 blob $STATE_BLOB\tfilter.map" | git mktree) - STATE_PARENT=$(git show-ref -s "$state_branch") - unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE - unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE - if [ -n "$STATE_PARENT" ] ; then - STATE_COMMIT=$(/bin/echo "Sync" | git commit-tree "$STATE_TREE" -p "$STATE_PARENT") - else - STATE_COMMIT=$(/bin/echo "Sync" | git commit-tree "$STATE_TREE" ) - fi - git update-ref "$state_branch" "$STATE_COMMIT" -fi - -cd ../.. -rm -rf "$tempdir" - -trap - 0 - -unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE -test -z "$ORIG_GIT_DIR" || { - GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR -} -test -z "$ORIG_GIT_WORK_TREE" || { - GIT_WORK_TREE="$ORIG_GIT_WORK_TREE" && - export GIT_WORK_TREE -} -test -z "$ORIG_GIT_INDEX_FILE" || { - GIT_INDEX_FILE="$ORIG_GIT_INDEX_FILE" && - export GIT_INDEX_FILE -} - -if [ "$(is_bare_repository)" = false ]; then - git read-tree -u -m HEAD || exit -fi - -exit 0 diff --git a/scripts/index-filter.sh b/scripts/index-filter.sh index e672867ce389..9610855020ba 100755 --- a/scripts/index-filter.sh +++ b/scripts/index-filter.sh @@ -3,11 +3,7 @@ set -e set -o pipefail -crumbs=/tmp/device-tree-export -git ls-files -s | tee $crumbs-orig | \ - ${SCRIPTS}/flatten-symlinks.sh | tee $crumbs-flattened | \ - sed -n -f ${SCRIPTS}/rewrite-paths.sed | tee $crumbs-rewritten | \ - GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info +${SCRIPTS}/rewrite-index.pl | GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info if [ -f "$GIT_INDEX_FILE.new" ] ; then mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE" diff --git a/scripts/merge-new-release.sh b/scripts/merge-new-release.sh index a6cf3491c9b2..a2763c69bb1a 100755 --- a/scripts/merge-new-release.sh +++ b/scripts/merge-new-release.sh @@ -14,9 +14,35 @@ esac v=$1 -set -ex +set -e -git merge --no-edit "${v}-raw" +# Use the date of Linus' originally tagged commit for the merge. This might +# differ from what the commit that the rewritten tag points to, since the +# orignal commit may have been discarded. +export GIT_AUTHOR_DATE=$(git log -1 --format=%ad "${v%-dts}") +if [ ! "${GIT_AUTHOR_DATE}" ] ; then + echo >&2 "Unable to determine commit date for merge" + exit 1 +fi +if [ "${v}" = "v2.6.12-rc2-dts" ] ; then + auh="--allow-unrelated-histories" +fi +git merge $auh --no-edit "${v}-raw" git clean -fdqx +# Use the date of Linus' original tag for the tag. +case "${v%-dts}" in + v2.6.12*|v2.6.13-rc[123]) + # Commits from v2.6.12-rc2..v2.6.13-rc3 lacked the date. So use the commit's + # date. + export GIT_COMMITTER_DATE="${GIT_AUTHOR_DATE}" + ;; + *) + export GIT_COMMITTER_DATE="$(git for-each-ref --format='%(taggerdate)' "refs/tags/${v%-dts}")" + ;; +esac +if [ ! "${GIT_COMMITTER_DATE}" ] ; then + echo >&2 "Unable to determine date for tag" + exit 1 +fi git tag -s -m "Tagging ${v}" -u 695A46C6 "${v}" make -k -j12 -s diff --git a/scripts/rewrite-index.pl b/scripts/rewrite-index.pl new file mode 100755 index 000000000000..ef89839ab1e0 --- /dev/null +++ b/scripts/rewrite-index.pl @@ -0,0 +1,72 @@ +#!/usr/bin/perl +use strict; +use warnings; +use IPC::Open2; +my $pid; + +open(my $lsfiles, "-|", "git ls-files -s") or die "fork lsfiles: $!"; + +while (<$lsfiles>) { + if ($_ =~ m/^120000 ([0-9a-f]{40}) (.*)\t(.*)/) { + my ($obj, $stage, $path) = ($1,$2,$3); + if (!defined $pid) { + $pid = open2(*Rderef, *Wderef, "git cat-file --batch-check='deref-ok %(objectname)' --follow-symlinks") + or die "open git cat-file: $!"; + } + print Wderef "$ENV{GIT_COMMIT}:$path\n" or die "write Wderef: $!"; + my $deref = ; + if ($deref =~ m/^deref-ok ([0-9a-f]{40})$/) { + $_ = "100644 $1 $stage\t$path\n" + } elsif ($deref =~ /^dangling /) { + # Skip next line + my $dummy = ; + } else { + die "Failed to parse symlink $ENV{GIT_COMMIT}:$path $deref"; + } + } + + my $m = 0; + + # Keep the copyright. Also ensures we never have a completely empty commit. + $m++ if m/\tCOPYING$/; + + # A few architectures have dts files at non standard paths. Massage those into + # a standard arch/ARCH/boot/dts first. + + # symlink: arch/microblaze/boot/dts/system.dts -> ../../platform/generic/system.dts + next if m,\tarch/microblaze/boot/dts/system.dts$,; + $m++ if s,\tarch/microblaze/platform/generic/(system.dts)$,\tarch/microblaze/boot/dts/$1,; + + # arch/mips/lantiq/dts/easy50712.dts + # arch/mips/lantiq/dts/danube.dtsi + # arch/mips/netlogic/dts/xlp_evp.dts + # arch/mips/ralink/dts/rt3050.dtsi + # arch/mips/ralink/dts/rt3052_eval.dts + $m++ if s,\tarch/mips/([^/]*)/dts/(.*\.dts.?)$,\tarch/mips/boot/dts/$2,; + + # arch/mips/cavium-octeon/octeon_68xx.dts + # arch/mips/cavium-octeon/octeon_3xxx.dts + # arch/mips/mti-sead3/sead3.dts + $m++ if s,\tarch/mips/([^/]*)/([^/]*\.dts.?)$,\tarch/mips/boot/dts/$2,; + + # arch/x86/platform/ce4100/falconfalls.dts + $m++ if s,\tarch/x86/platform/ce4100/falconfalls.dts,\tarch/x86/boot/dts/falconfalls.dts,; + + # test cases + $m++ if s,\tdrivers/of/testcase-data/,\ttestcase-data/,; + + # Now rewrite generic DTS paths + $m++ if s,\tarch/([^/]*)/boot/dts/(.*\.dts.?)$,\tsrc/$1/$2,; + $m++ if s,\tarch/([^/]*)/boot/dts/(.*\.h)$,\tsrc/$1/$2,; + + # Also rewrite the DTS include paths for dtc+cpp support + $m++ if s,\tarch/([^/]*)/include/dts/,\tsrc/$1/include/,; + $m++ if s,\tinclude/dt-bindings/,\tinclude/dt-bindings/,; + + # Rewrite the bindings subdirectory + $m++ if s,\tDocumentation/devicetree/bindings/,\tBindings/,; + + print if $m > 0; +} +kill $pid if $pid; +exit 0; diff --git a/scripts/rewrite-paths.sed b/scripts/rewrite-paths.sed deleted file mode 100644 index b73fbce71b51..000000000000 --- a/scripts/rewrite-paths.sed +++ /dev/null @@ -1,38 +0,0 @@ -# Keep the copyright. Also ensures we never have a completely empty commit. -/\tCOPYING$/p - -# A few architectures have dts files at non standard paths. Massage those into -# a standard arch/ARCH/boot/dts first. - -# symlink: arch/microblaze/boot/dts/system.dts -> ../../platform/generic/system.dts -\,\tarch/microblaze/boot/dts/system.dts$,d -s,\tarch/microblaze/platform/generic/\(system.dts\)$,\tarch/microblaze/boot/dts/\1,g - -# arch/mips/lantiq/dts/easy50712.dts -# arch/mips/lantiq/dts/danube.dtsi -# arch/mips/netlogic/dts/xlp_evp.dts -# arch/mips/ralink/dts/rt3050.dtsi -# arch/mips/ralink/dts/rt3052_eval.dts -s,\tarch/mips/\([^/]*\)/dts/\(.*\.dts.\?\)$,\tarch/mips/boot/dts/\2,g - -# arch/mips/cavium-octeon/octeon_68xx.dts -# arch/mips/cavium-octeon/octeon_3xxx.dts -# arch/mips/mti-sead3/sead3.dts -s,\tarch/mips/\([^/]*\)/\([^/]*\.dts.\?\)$,\tarch/mips/boot/dts/\2,g - -# arch/x86/platform/ce4100/falconfalls.dts -s,\tarch/x86/platform/ce4100/falconfalls.dts,\tarch/x86/boot/dts/falconfalls.dts,g - -# test cases -s,\tdrivers/of/testcase-data/,\ttestcase-data/,gp - -# Now rewrite generic DTS paths -s,\tarch/\([^/]*\)/boot/dts/\(.*\.dts.\?\)$,\tsrc/\1/\2,gp -s,\tarch/\([^/]*\)/boot/dts/\(.*\.h\)$,\tsrc/\1/\2,gp - -# Also rewrite the DTS include paths for dtc+cpp support -s,\tarch/\([^/]*\)/include/dts/,\tsrc/\1/include/,gp -s,\tinclude/dt-bindings/,\tinclude/dt-bindings/,gp - -# Rewrite the bindings subdirectory -s,\tDocumentation/devicetree/bindings/,\tBindings/,gp diff --git a/src/arc/axc001.dtsi b/src/arc/axc001.dtsi index a380ffa1a458..fdc266504ada 100644 --- a/src/arc/axc001.dtsi +++ b/src/arc/axc001.dtsi @@ -99,7 +99,7 @@ memory { device_type = "memory"; - /* CONFIG_KERNEL_RAM_BASE_ADDRESS needs to match low mem start */ + /* CONFIG_LINUX_RAM_BASE needs to match low mem start */ reg = <0x0 0x80000000 0x0 0x1b000000>; /* (512 - 32) MiB */ }; diff --git a/src/arc/axc003.dtsi b/src/arc/axc003.dtsi index cc9239ef8d08..4e6e9f57e790 100644 --- a/src/arc/axc003.dtsi +++ b/src/arc/axc003.dtsi @@ -24,10 +24,17 @@ ranges = <0x00000000 0x0 0xf0000000 0x10000000>; - core_clk: core_clk { + input_clk: input-clk { #clock-cells = <0>; compatible = "fixed-clock"; - clock-frequency = <90000000>; + clock-frequency = <33333333>; + }; + + core_clk: core-clk@80 { + compatible = "snps,axs10x-arc-pll-clock"; + reg = <0x80 0x10>, <0x100 0x10>; + #clock-cells = <0>; + clocks = <&input_clk>; }; core_intc: archs-intc@cpu { @@ -102,7 +109,7 @@ memory { device_type = "memory"; - /* CONFIG_KERNEL_RAM_BASE_ADDRESS needs to match low mem start */ + /* CONFIG_LINUX_RAM_BASE needs to match low mem start */ reg = <0x0 0x80000000 0x0 0x20000000 /* 512 MiB low mem */ 0x1 0xc0000000 0x0 0x40000000>; /* 1 GiB highmem */ }; diff --git a/src/arc/axc003_idu.dtsi b/src/arc/axc003_idu.dtsi index 4ebb2170abec..63954a8b0100 100644 --- a/src/arc/axc003_idu.dtsi +++ b/src/arc/axc003_idu.dtsi @@ -24,10 +24,17 @@ ranges = <0x00000000 0x0 0xf0000000 0x10000000>; - core_clk: core_clk { + input_clk: input-clk { #clock-cells = <0>; compatible = "fixed-clock"; - clock-frequency = <100000000>; + clock-frequency = <33333333>; + }; + + core_clk: core-clk@80 { + compatible = "snps,axs10x-arc-pll-clock"; + reg = <0x80 0x10>, <0x100 0x10>; + #clock-cells = <0>; + clocks = <&input_clk>; }; core_intc: archs-intc@cpu { @@ -108,7 +115,7 @@ memory { device_type = "memory"; - /* CONFIG_KERNEL_RAM_BASE_ADDRESS needs to match low mem start */ + /* CONFIG_LINUX_RAM_BASE needs to match low mem start */ reg = <0x0 0x80000000 0x0 0x20000000 /* 512 MiB low mem */ 0x1 0xc0000000 0x0 0x40000000>; /* 1 GiB highmem */ }; diff --git a/src/arc/axs10x_mb.dtsi b/src/arc/axs10x_mb.dtsi index 0ff7e07edcd4..e114000a84f5 100644 --- a/src/arc/axs10x_mb.dtsi +++ b/src/arc/axs10x_mb.dtsi @@ -44,7 +44,14 @@ mmcclk: mmcclk { compatible = "fixed-clock"; - clock-frequency = <50000000>; + /* + * DW sdio controller has external ciu clock divider + * controlled via register in SDIO IP. It divides + * sdio_ref_clk (which comes from CGU) by 16 for + * default. So default mmcclk clock (which comes + * to sdk_in) is 25000000 Hz. + */ + clock-frequency = <25000000>; #clock-cells = <0>; }; @@ -101,7 +108,6 @@ mmc@0x15000 { compatible = "altr,socfpga-dw-mshc"; reg = < 0x15000 0x400 >; - num-slots = < 1 >; fifo-depth = < 16 >; card-detect-delay = < 200 >; clocks = <&apbclk>, <&mmcclk>; diff --git a/src/arc/hsdk.dts b/src/arc/hsdk.dts new file mode 100644 index 000000000000..8f627c200d60 --- /dev/null +++ b/src/arc/hsdk.dts @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2017 Synopsys, Inc. (www.synopsys.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/* + * Device Tree for ARC HS Development Kit + */ +/dts-v1/; + +#include +#include + +/ { + model = "snps,hsdk"; + compatible = "snps,hsdk"; + + #address-cells = <1>; + #size-cells = <1>; + + chosen { + bootargs = "earlycon=uart8250,mmio32,0xf0005000,115200n8 console=ttyS0,115200n8 debug print-fatal-signals=1"; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "snps,archs38"; + reg = <0>; + clocks = <&core_clk>; + }; + + cpu@1 { + device_type = "cpu"; + compatible = "snps,archs38"; + reg = <1>; + clocks = <&core_clk>; + }; + + cpu@2 { + device_type = "cpu"; + compatible = "snps,archs38"; + reg = <2>; + clocks = <&core_clk>; + }; + + cpu@3 { + device_type = "cpu"; + compatible = "snps,archs38"; + reg = <3>; + clocks = <&core_clk>; + }; + }; + + input_clk: input-clk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <33333333>; + }; + + cpu_intc: cpu-interrupt-controller { + compatible = "snps,archs-intc"; + interrupt-controller; + #interrupt-cells = <1>; + }; + + idu_intc: idu-interrupt-controller { + compatible = "snps,archs-idu-intc"; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&cpu_intc>; + }; + + arcpct: pct { + compatible = "snps,archs-pct"; + }; + + /* TIMER0 with interrupt for clockevent */ + timer { + compatible = "snps,arc-timer"; + interrupts = <16>; + interrupt-parent = <&cpu_intc>; + clocks = <&core_clk>; + }; + + /* 64-bit Global Free Running Counter */ + gfrc { + compatible = "snps,archs-timer-gfrc"; + clocks = <&core_clk>; + }; + + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&idu_intc>; + + ranges = <0x00000000 0xf0000000 0x10000000>; + + cgu_rst: reset-controller@8a0 { + compatible = "snps,hsdk-reset"; + #reset-cells = <1>; + reg = <0x8A0 0x4>, <0xFF0 0x4>; + }; + + core_clk: core-clk@0 { + compatible = "snps,hsdk-core-pll-clock"; + reg = <0x00 0x10>, <0x14B8 0x4>; + #clock-cells = <0>; + clocks = <&input_clk>; + }; + + serial: serial@5000 { + compatible = "snps,dw-apb-uart"; + reg = <0x5000 0x100>; + clock-frequency = <33330000>; + interrupts = <6>; + baud = <115200>; + reg-shift = <2>; + reg-io-width = <4>; + }; + + gmacclk: gmacclk { + compatible = "fixed-clock"; + clock-frequency = <400000000>; + #clock-cells = <0>; + }; + + mmcclk_ciu: mmcclk-ciu { + compatible = "fixed-clock"; + /* + * DW sdio controller has external ciu clock divider + * controlled via register in SDIO IP. Due to its + * unexpected default value (it should divide by 1 + * but it divides by 8) SDIO IP uses wrong clock and + * works unstable (see STAR 9001204800) + * We switched to the minimum possible value of the + * divisor (div-by-2) in HSDK platform code. + * So add temporary fix and change clock frequency + * to 50000000 Hz until we fix dw sdio driver itself. + */ + clock-frequency = <50000000>; + #clock-cells = <0>; + }; + + mmcclk_biu: mmcclk-biu { + compatible = "fixed-clock"; + clock-frequency = <400000000>; + #clock-cells = <0>; + }; + + ethernet@8000 { + #interrupt-cells = <1>; + compatible = "snps,dwmac"; + reg = <0x8000 0x2000>; + interrupts = <10>; + interrupt-names = "macirq"; + phy-mode = "rgmii"; + snps,pbl = <32>; + clocks = <&gmacclk>; + clock-names = "stmmaceth"; + phy-handle = <&phy0>; + resets = <&cgu_rst HSDK_ETH_RESET>; + reset-names = "stmmaceth"; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + compatible = "snps,dwmac-mdio"; + phy0: ethernet-phy@0 { + reg = <0>; + ti,rx-internal-delay = ; + ti,tx-internal-delay = ; + ti,fifo-depth = ; + }; + }; + }; + + ohci@60000 { + compatible = "snps,hsdk-v1.0-ohci", "generic-ohci"; + reg = <0x60000 0x100>; + interrupts = <15>; + }; + + ehci@40000 { + compatible = "snps,hsdk-v1.0-ehci", "generic-ehci"; + reg = <0x40000 0x100>; + interrupts = <15>; + }; + + mmc@a000 { + compatible = "altr,socfpga-dw-mshc"; + reg = <0xa000 0x400>; + num-slots = <1>; + fifo-depth = <16>; + card-detect-delay = <200>; + clocks = <&mmcclk_biu>, <&mmcclk_ciu>; + clock-names = "biu", "ciu"; + interrupts = <12>; + bus-width = <4>; + }; + }; + + memory@80000000 { + #address-cells = <1>; + #size-cells = <1>; + device_type = "memory"; + reg = <0x80000000 0x40000000>; /* 1 GiB */ + }; +}; diff --git a/src/arc/nsim_hs.dts b/src/arc/nsim_hs.dts index 3772c40c245e..8d787b251f73 100644 --- a/src/arc/nsim_hs.dts +++ b/src/arc/nsim_hs.dts @@ -18,7 +18,7 @@ memory { device_type = "memory"; - /* CONFIG_LINUX_LINK_BASE needs to match low mem start */ + /* CONFIG_LINUX_RAM_BASE needs to match low mem start */ reg = <0x0 0x80000000 0x0 0x20000000 /* 512 MB low mem */ 0x1 0x00000000 0x0 0x40000000>; /* 1 GB highmem */ }; diff --git a/src/arc/vdk_axs10x_mb.dtsi b/src/arc/vdk_axs10x_mb.dtsi index 459fc656b759..48bb4b4cd234 100644 --- a/src/arc/vdk_axs10x_mb.dtsi +++ b/src/arc/vdk_axs10x_mb.dtsi @@ -104,7 +104,6 @@ mmc@0x15000 { compatible = "snps,dw-mshc"; reg = <0x15000 0x400>; - num-slots = <1>; fifo-depth = <1024>; card-detect-delay = <200>; clocks = <&apbclk>, <&mmcclk>; diff --git a/src/arm/am335x-bone-common.dtsi b/src/arm/am335x-bone-common.dtsi index 1d154444dfef..48a15fc641f2 100644 --- a/src/arm/am335x-bone-common.dtsi +++ b/src/arm/am335x-bone-common.dtsi @@ -319,13 +319,10 @@ ti,pmic-shutdown-controller; charger { - interrupts = <0>, <1>; - interrupt-names = "USB", "AC"; status = "okay"; }; pwrbutton { - interrupts = <2>; status = "okay"; }; diff --git a/src/arm/am335x-chiliboard.dts b/src/arm/am335x-chiliboard.dts index d8769799772e..59431b235944 100644 --- a/src/arm/am335x-chiliboard.dts +++ b/src/arm/am335x-chiliboard.dts @@ -191,13 +191,10 @@ interrupts = <7>; /* NNMI */ charger { - interrupts = <0>, <1>; - interrupt-names = "USB", "AC"; status = "okay"; }; pwrbutton { - interrupts = <2>; status = "okay"; }; }; diff --git a/src/arm/am335x-evm.dts b/src/arm/am335x-evm.dts index 1c37a7c1ea17..ddd897556e03 100644 --- a/src/arm/am335x-evm.dts +++ b/src/arm/am335x-evm.dts @@ -531,6 +531,7 @@ interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ <1 IRQ_TYPE_NONE>; /* termcount */ rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */ + ti,nand-xfer-type = "prefetch-dma"; ti,nand-ecc-opt = "bch8"; ti,elm-id = <&elm>; nand-bus-width = <8>; diff --git a/src/arm/am335x-moxa-uc-8100-me-t.dts b/src/arm/am335x-moxa-uc-8100-me-t.dts new file mode 100644 index 000000000000..f82233cd18e0 --- /dev/null +++ b/src/arm/am335x-moxa-uc-8100-me-t.dts @@ -0,0 +1,525 @@ +/* + * Copyright (C) 2017 MOXA Inc. - https://www.moxa.com/ + * + * Author: SZ Lin (林上智) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/dts-v1/; + +#include "am33xx.dtsi" + +/ { + model = "Moxa UC-8100-ME-T"; + compatible = "moxa,uc-8100-me-t", "ti,am33xx"; + + cpus { + cpu@0 { + cpu0-supply = <&vdd1_reg>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x80000000 0x20000000>; /* 512 MB */ + }; + + vbat: vbat-regulator { + compatible = "regulator-fixed"; + }; + + /* Power supply provides a fixed 3.3V @3A */ + vmmcsd_fixed: vmmcsd-regulator { + compatible = "regulator-fixed"; + regulator-name = "vmmcsd_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + }; + + leds { + compatible = "gpio-leds"; + led1 { + label = "uc8100me:CEL1"; + gpios = <&gpio_xten 8 0>; + default-state = "off"; + }; + + led2 { + label = "uc8100me:CEL2"; + gpios = <&gpio_xten 9 0>; + default-state = "off"; + }; + + led3 { + label = "uc8100me:CEL3"; + gpios = <&gpio_xten 10 0>; + default-state = "off"; + }; + + led4 { + label = "uc8100me:DIA1"; + gpios = <&gpio_xten 11 0>; + default-state = "off"; + }; + led5 { + label = "uc8100me:DIA2"; + gpios = <&gpio_xten 12 0>; + default-state = "off"; + }; + led6 { + label = "uc8100me:DIA3"; + gpios = <&gpio_xten 13 0>; + default-state = "off"; + }; + led7 { + label = "uc8100me:SD"; + gpios = <&gpio_xten 14 0>; + default-state = "off"; + }; + led8 { + label = "uc8100me:USB"; + gpios = <&gpio_xten 15 0>; + default-state = "off"; + }; + led9 { + label = "uc8100me:USER"; + gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + buttons: push_button { + compatible = "gpio-keys"; + }; + +}; + +&am33xx_pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&minipcie_pins>; + + minipcie_pins: pinmux_minipcie { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8e8, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_pclk.gpio2_24 */ + AM33XX_IOPAD(0x8ec, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_ac_bias_en.gpio2_25 */ + AM33XX_IOPAD(0x8e0, PIN_INPUT_PULLDOWN | MUX_MODE7) /* lcd_vsync.gpio2_22 Power off PIN*/ + >; + }; + + push_button_pins: pinmux_push_button { + pinctrl-single,pins = < + AM33XX_IOPAD(0x9ac, PIN_INPUT_PULLDOWN | MUX_MODE7) /* mcasp0_ahcklx.gpio3_21 */ + >; + }; + + i2c0_pins: pinmux_i2c0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_sda.i2c0_sda */ + AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c0_scl.i2c0_scl */ + >; + }; + + + i2c1_pins: pinmux_i2c1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x968, PIN_INPUT_PULLUP | MUX_MODE3) /* uart0_ctsn.i2c1_sda */ + AM33XX_IOPAD(0x96c, PIN_INPUT_PULLUP | MUX_MODE3) /* uart0_rtsn.i2c1_scl */ + >; + }; + + uart0_pins: pinmux_uart0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ + >; + }; + + uart1_pins: pinmux_uart1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x978, PIN_INPUT | MUX_MODE0) /* uart1_ctsn.uart1_ctsn */ + AM33XX_IOPAD(0x97C, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart1_rtsn.uart1_rtsn */ + AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* uart1_rxd.uart1_rxd */ + AM33XX_IOPAD(0x984, PIN_OUTPUT | MUX_MODE0) /* uart1_txd.uart1_txd */ + >; + }; + + uart2_pins: pinmux_uart2_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8d8, PIN_INPUT | MUX_MODE6) /* lcd_data14.uart5_ctsn */ + AM33XX_IOPAD(0x8dc, PIN_OUTPUT_PULLDOWN | MUX_MODE6) /* lcd_data15.uart5_rtsn */ + AM33XX_IOPAD(0x8c4, PIN_INPUT_PULLUP | MUX_MODE4) /* lcd_data9.uart5_rxd */ + AM33XX_IOPAD(0x8c0, PIN_OUTPUT | MUX_MODE4) /* lcd_data8.uart5_txd */ + >; + }; + + cpsw_default: cpsw_default { + pinctrl-single,pins = < + /* Slave 1 */ + AM33XX_IOPAD(0x90c, PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_crs.rmii1_crs_dv */ + AM33XX_IOPAD(0x910, PIN_INPUT_PULLUP | MUX_MODE1) /* mii1_rxerr.rmii1_rxerr */ + AM33XX_IOPAD(0x914, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txen.rmii1_txen */ + AM33XX_IOPAD(0x924, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd1.rmii1_txd1 */ + AM33XX_IOPAD(0x928, PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd0.rmii1_txd0 */ + AM33XX_IOPAD(0x93c, PIN_INPUT_PULLUP | MUX_MODE1) /* mii1_rxd1.rmii1_rxd1 */ + AM33XX_IOPAD(0x940, PIN_INPUT_PULLUP | MUX_MODE1) /* mii1_rxd0.rmii1_rxd0 */ + AM33XX_IOPAD(0x944, PIN_INPUT_PULLDOWN | MUX_MODE0) /* mii1_refclk.rmii1_refclk */ + + /* Slave 2 */ + AM33XX_IOPAD(0x870, PIN_INPUT_PULLDOWN | MUX_MODE3) /* rmii2_crs_dv */ + AM33XX_IOPAD(0x874, PIN_INPUT_PULLDOWN | MUX_MODE3) /* rmii2_rxer */ + AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* rmii2_txen */ + AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* rmii2_td1 */ + AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* rmii2_td0 */ + AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE3) /* rmii2_rd1 */ + AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE3) /* rmii2_rd0 */ + AM33XX_IOPAD(0x908, PIN_INPUT_PULLDOWN | MUX_MODE1) /* rmii2_refclk */ + + >; + }; + + davinci_mdio_default: davinci_mdio_default { + pinctrl-single,pins = < + /* MDIO */ + AM33XX_IOPAD(0x948, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */ + AM33XX_IOPAD(0x94c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */ + >; + }; + + mmc0_pins_default: pinmux_mmc0_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat3 */ + AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat2 */ + AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat1 */ + AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_dat0 */ + AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_clk */ + AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc0_cmd */ + AM33XX_IOPAD(0x990, PIN_INPUT_PULLUP | MUX_MODE7) /* mcasp0_aclkx.gpio3_14 */ + AM33XX_IOPAD(0x9a0, PIN_INPUT_PULLUP | MUX_MODE7) /* mcasp0_aclkx.gpio3_18 */ + >; + }; + + mmc2_pins_default: pinmux_mmc2_pins { + pinctrl-single,pins = < + /* eMMC */ + AM33XX_IOPAD(0x830, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad12.mmc2_dat0 */ + AM33XX_IOPAD(0x834, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad13.mmc2_dat1 */ + AM33XX_IOPAD(0x838, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad14.mmc2_dat2 */ + AM33XX_IOPAD(0x83c, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad15.mmc2_dat3 */ + AM33XX_IOPAD(0x820, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad8.mmc2_dat4 */ + AM33XX_IOPAD(0x824, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad9.mmc2_dat5 */ + AM33XX_IOPAD(0x828, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad10.mmc2_dat6 */ + AM33XX_IOPAD(0x82c, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ad11.mmc2_dat7 */ + AM33XX_IOPAD(0x888, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_csn3.mmc2_cmd */ + AM33XX_IOPAD(0x88c, PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_clk.mmc2_clk */ + >; + }; + + spi0_pins: pinmux_spi0 { + pinctrl-single,pins = < + AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_sclk.spi0_sclk */ + AM33XX_IOPAD(0x95C, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_cs0.spi0_cs0 */ + AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_d0.spi0_d0 */ + AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0) /* spi0_d1.spi0_d1 */ + >; + }; + +}; + +&uart0 { + /* Console */ + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; +}; + +&uart1 { + /* UART 1 setting */ + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; +}; + +&uart5 { + /* UART 2 setting */ + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + + status = "okay"; + clock-frequency = <400000>; + + tpm: tpm@20 { + compatible = "infineon,slb9645tt"; + reg = <0x20>; + }; + + tps: tps@2d { + compatible = "ti,tps65910"; + reg = <0x2d>; + }; + + eeprom: eeprom@50 { + compatible = "atmel,24c16"; + pagesize = <16>; + reg = <0x50>; + }; + + rtc_wdt: rtc_wdt@68 { + compatible = "dallas,ds1374"; + reg = <0x68>; + }; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + + status = "okay"; + clock-frequency = <400000>; + gpio_xten: gpio_xten@27 { + compatible = "nxp,pca9535"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x27>; + }; +}; + +&usb { + status = "okay"; +}; + +&usb_ctrl_mod { + status = "okay"; +}; + +&usb0_phy { + status = "okay"; +}; + +&usb1_phy { + status = "okay"; +}; + +&usb0 { + status = "okay"; + dr_mode = "host"; +}; + +&usb1 { + status = "okay"; + dr_mode = "host"; +}; + +&cppi41dma { + status = "okay"; +}; + +#include "tps65910.dtsi" + +&tps { + vcc1-supply = <&vbat>; + vcc2-supply = <&vbat>; + vcc3-supply = <&vbat>; + vcc4-supply = <&vbat>; + vcc5-supply = <&vbat>; + vcc6-supply = <&vbat>; + vcc7-supply = <&vbat>; + vccio-supply = <&vbat>; + + regulators { + vrtc_reg: regulator@0 { + regulator-always-on; + }; + + vio_reg: regulator@1 { + regulator-always-on; + }; + + vdd1_reg: regulator@2 { + /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */ + regulator-name = "vdd_mpu"; + regulator-min-microvolt = <912500>; + regulator-max-microvolt = <1378000>; + regulator-boot-on; + regulator-always-on; + }; + + vdd2_reg: regulator@3 { + /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */ + regulator-name = "vdd_core"; + regulator-min-microvolt = <912500>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; + }; + + vdd3_reg: regulator@4 { + regulator-always-on; + }; + + vdig1_reg: regulator@5 { + regulator-always-on; + }; + + vdig2_reg: regulator@6 { + regulator-always-on; + }; + + vpll_reg: regulator@7 { + regulator-always-on; + }; + + vdac_reg: regulator@8 { + regulator-always-on; + }; + + vaux1_reg: regulator@9 { + regulator-always-on; + }; + + vaux2_reg: regulator@10 { + regulator-always-on; + }; + + vaux33_reg: regulator@11 { + regulator-always-on; + }; + + vmmc_reg: regulator@12 { + compatible = "regulator-fixed"; + regulator-name = "vmmc_reg"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + }; +}; + +/* Power */ +&vbat { + regulator-name = "vbat"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; +}; + +&mac { + pinctrl-names = "default"; + pinctrl-0 = <&cpsw_default>; + dual_emac = <1>; + status = "okay"; +}; + +&davinci_mdio { + pinctrl-names = "default"; + pinctrl-0 = <&davinci_mdio_default>; + status = "okay"; +}; + +&cpsw_emac0 { + status = "okay"; + phy_id = <&davinci_mdio>, <4>; + phy-mode = "rmii"; + dual_emac_res_vlan = <1>; +}; + +&cpsw_emac1 { + status = "okay"; + phy_id = <&davinci_mdio>, <5>; + phy-mode = "rmii"; + dual_emac_res_vlan = <2>; +}; + +&phy_sel { + reg= <0x44e10650 0xf5>; + rmii-clock-ext; +}; + +&sham { + status = "okay"; +}; + +&aes { + status = "okay"; +}; + +&gpio0 { + ti,no-reset-on-init; +}; + +&mmc1 { + pinctrl-names = "default"; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <4>; + pinctrl-0 = <&mmc0_pins_default>; + cd-gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>; + wp-gpios = <&gpio3 18 GPIO_ACTIVE_HIGH>; + status = "okay"; +}; + +&mmc3 { + dmas = <&edma_xbar 12 0 1 + &edma_xbar 13 0 2>; + dma-names = "tx", "rx"; + pinctrl-names = "default"; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <8>; + pinctrl-0 = <&mmc2_pins_default>; + ti,non-removable; + status = "okay"; +}; + +&buttons { + pinctrl-names = "default"; + pinctrl-0 = <&push_button_pins>; + #address-cells = <1>; + #size-cells = <0>; + + button@0 { + label = "push_button"; + linux,code = <0x100>; + gpios = <&gpio3 21 GPIO_ACTIVE_LOW>; + }; +}; + +/* SPI Busses */ +&spi0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins>; + + m25p80@0 { + compatible = "mx25l6405d"; + spi-max-frequency = <40000000>; + + reg = <0>; + spi-cpol; + spi-cpha; + #address-cells = <1>; + #size-cells = <1>; + + /* reg : The partition's offset and size within the mtd bank. */ + partitions@0 { + label = "MLO"; + reg = <0x0 0x80000>; + }; + + partitions@1 { + label = "U-Boot"; + reg = <0x80000 0x100000>; + }; + + partitions@2 { + label = "U-Boot Env"; + reg = <0x180000 0x20000>; + }; + }; +}; diff --git a/src/arm/am33xx.dtsi b/src/arm/am33xx.dtsi index 7d7ca054c557..e58fab8aec5d 100644 --- a/src/arm/am33xx.dtsi +++ b/src/arm/am33xx.dtsi @@ -36,6 +36,8 @@ phy1 = &usb1_phy; ethernet0 = &cpsw_emac0; ethernet1 = &cpsw_emac1; + spi0 = &spi0; + spi1 = &spi1; }; cpus { diff --git a/src/arm/am437x-gp-evm.dts b/src/arm/am437x-gp-evm.dts index 29a538ecd405..afb8eb0a0a16 100644 --- a/src/arm/am437x-gp-evm.dts +++ b/src/arm/am437x-gp-evm.dts @@ -149,6 +149,13 @@ system-clock-frequency = <12000000>; }; }; + + beeper: beeper { + compatible = "gpio-beeper"; + pinctrl-names = "default"; + pinctrl-0 = <&beeper_pins>; + gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>; + }; }; &am43xx_pinmux { @@ -510,6 +517,13 @@ AM4372_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ >; }; + + beeper_pins: beeper_pins { + pinctrl-single,pins = < + AM4372_IOPAD(0x9e0, PIN_OUTPUT_PULLUP | MUX_MODE7) /* cam1_field.gpio4_12 */ + >; + }; + }; &uart0 { @@ -842,6 +856,7 @@ interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ <1 IRQ_TYPE_NONE>; /* termcount */ rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */ + ti,nand-xfer-type = "prefetch-dma"; ti,nand-ecc-opt = "bch16"; ti,elm-id = <&elm>; nand-bus-width = <8>; diff --git a/src/arm/am43x-epos-evm.dts b/src/arm/am43x-epos-evm.dts index 54f40f370011..081fa68b6f98 100644 --- a/src/arm/am43x-epos-evm.dts +++ b/src/arm/am43x-epos-evm.dts @@ -388,6 +388,7 @@ pinctrl-0 = <&cpsw_default>; pinctrl-1 = <&cpsw_sleep>; status = "okay"; + slaves = <1>; }; &davinci_mdio { @@ -402,11 +403,6 @@ phy-mode = "rmii"; }; -&cpsw_emac1 { - phy_id = <&davinci_mdio>, <1>; - phy-mode = "rmii"; -}; - &phy_sel { rmii-clock-ext; }; @@ -564,6 +560,7 @@ interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ <1 IRQ_TYPE_NONE>; /* termcount */ rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */ + ti,nand-xfer-type = "prefetch-dma"; ti,nand-ecc-opt = "bch16"; ti,elm-id = <&elm>; nand-bus-width = <8>; diff --git a/src/arm/am571x-idk.dts b/src/arm/am571x-idk.dts index 7b207835b2d1..debf9464403e 100644 --- a/src/arm/am571x-idk.dts +++ b/src/arm/am571x-idk.dts @@ -11,6 +11,7 @@ #include #include #include "am57xx-idk-common.dtsi" +#include "dra72x-mmc-iodelay.dtsi" / { model = "TI AM5718 IDK"; @@ -64,13 +65,6 @@ }; }; -&mmc1 { - status = "okay"; - vmmc-supply = <&ldo1_reg>; - bus-width = <4>; - cd-gpios = <&gpio6 27 0>; /* gpio 219 */ -}; - &omap_dwc3_2 { extcon = <&extcon_usb2>; }; @@ -96,3 +90,30 @@ status = "okay"; }; }; + +&pcie1_rc { + status = "okay"; + gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; +}; + +&pcie1_ep { + gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; +}; + +&mmc1 { + pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_hs>; + pinctrl-2 = <&mmc1_pins_sdr12>; + pinctrl-3 = <&mmc1_pins_sdr25>; + pinctrl-4 = <&mmc1_pins_sdr50>; + pinctrl-5 = <&mmc1_pins_ddr50_rev20 &mmc1_iodelay_ddr50_conf>; + pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev20_conf>; +}; + +&mmc2 { + pinctrl-names = "default", "hs", "ddr_1_8v"; + pinctrl-0 = <&mmc2_pins_default>; + pinctrl-1 = <&mmc2_pins_hs>; + pinctrl-2 = <&mmc2_pins_ddr_rev20 &mmc2_iodelay_ddr_conf>; +}; diff --git a/src/arm/am572x-idk.dts b/src/arm/am572x-idk.dts index 9da6d83ca185..a578fe97ba3b 100644 --- a/src/arm/am572x-idk.dts +++ b/src/arm/am572x-idk.dts @@ -12,6 +12,7 @@ #include #include #include "am57xx-idk-common.dtsi" +#include "dra74x-mmc-iodelay.dtsi" / { model = "TI AM5728 IDK"; @@ -67,6 +68,24 @@ }; }; +&mmc1 { + pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_hs>; + pinctrl-2 = <&mmc1_pins_sdr12>; + pinctrl-3 = <&mmc1_pins_sdr25>; + pinctrl-4 = <&mmc1_pins_sdr50>; + pinctrl-5 = <&mmc1_pins_ddr50 &mmc1_iodelay_ddr_rev20_conf>; + pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev20_conf>; +}; + +&mmc2 { + pinctrl-names = "default", "hs", "ddr_1_8v"; + pinctrl-0 = <&mmc2_pins_default>; + pinctrl-1 = <&mmc2_pins_hs>; + pinctrl-2 = <&mmc2_pins_ddr_rev20>; +}; + &omap_dwc3_2 { extcon = <&extcon_usb2>; }; @@ -76,19 +95,16 @@ vbus-gpio = <&gpio3 26 GPIO_ACTIVE_HIGH>; }; -&mmc1 { - status = "okay"; - vmmc-supply = <&v3_3d>; - vmmc_aux-supply = <&ldo1_reg>; - bus-width = <4>; - cd-gpios = <&gpio6 27 0>; /* gpio 219 */ -}; - &sn65hvs882 { load-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>; }; -&pcie1 { +&pcie1_rc { + status = "okay"; + gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; +}; + +&pcie1_ep { gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; }; diff --git a/src/arm/am57xx-beagle-x15-common.dtsi b/src/arm/am57xx-beagle-x15-common.dtsi index fdfe5b16b806..49aeecd312b4 100644 --- a/src/arm/am57xx-beagle-x15-common.dtsi +++ b/src/arm/am57xx-beagle-x15-common.dtsi @@ -9,6 +9,7 @@ #include "dra74x.dtsi" #include "am57xx-commercial-grade.dtsi" +#include "dra74x-mmc-iodelay.dtsi" #include #include @@ -166,34 +167,6 @@ }; }; -&dra7_pmx_core { - mmc1_pins_default: mmc1_pins_default { - pinctrl-single,pins = < - DRA7XX_CORE_IOPAD(0x376c, PIN_INPUT | MUX_MODE14) /* mmc1sdcd.gpio219 */ - DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */ - DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ - DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ - DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ - DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ - DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ - >; - }; - - mmc2_pins_default: mmc2_pins_default { - pinctrl-single,pins = < - DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */ - DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ - DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ - DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ - DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ - DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ - DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ - DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ - DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ - DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ - >; - }; -}; &i2c1 { status = "okay"; clock-frequency = <400000>; @@ -570,7 +543,12 @@ }; }; -&pcie1 { +&pcie1_rc { + status = "ok"; + gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; +}; + +&pcie1_ep { gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; }; diff --git a/src/arm/am57xx-beagle-x15-revb1.dts b/src/arm/am57xx-beagle-x15-revb1.dts index 39a92aff0a0d..5a77b334923d 100644 --- a/src/arm/am57xx-beagle-x15-revb1.dts +++ b/src/arm/am57xx-beagle-x15-revb1.dts @@ -19,8 +19,23 @@ }; &mmc1 { + pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_hs>; + pinctrl-2 = <&mmc1_pins_sdr12>; + pinctrl-3 = <&mmc1_pins_sdr25>; + pinctrl-4 = <&mmc1_pins_sdr50>; + pinctrl-5 = <&mmc1_pins_ddr50 &mmc1_iodelay_ddr_rev11_conf>; + pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev11_conf>; vmmc-supply = <&vdd_3v3>; - vmmc-aux-supply = <&ldo1_reg>; + vqmmc-supply = <&ldo1_reg>; +}; + +&mmc2 { + pinctrl-names = "default", "hs", "ddr_1_8v"; + pinctrl-0 = <&mmc2_pins_default>; + pinctrl-1 = <&mmc2_pins_hs>; + pinctrl-2 = <&mmc2_pins_ddr_3_3v_rev11 &mmc2_iodelay_ddr_3_3v_rev11_conf>; }; /* errata i880 "Ethernet RGMII2 Limited to 10/100 Mbps" */ diff --git a/src/arm/am57xx-beagle-x15-revc.dts b/src/arm/am57xx-beagle-x15-revc.dts new file mode 100644 index 000000000000..17c41da3b55f --- /dev/null +++ b/src/arm/am57xx-beagle-x15-revc.dts @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2014-2017 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include "am57xx-beagle-x15-common.dtsi" + +/ { + model = "TI AM5728 BeagleBoard-X15 rev C"; +}; + +&tpd12s015 { + gpios = <&gpio7 10 GPIO_ACTIVE_HIGH>, /* gpio7_10, CT CP HPD */ + <&gpio2 30 GPIO_ACTIVE_HIGH>, /* gpio2_30, LS OE */ + <&gpio7 12 GPIO_ACTIVE_HIGH>; /* gpio7_12/sp1_cs2, HPD */ +}; + +&mmc1 { + pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_hs>; + pinctrl-2 = <&mmc1_pins_sdr12>; + pinctrl-3 = <&mmc1_pins_sdr25>; + pinctrl-4 = <&mmc1_pins_sdr50>; + pinctrl-5 = <&mmc1_pins_ddr50 &mmc1_iodelay_ddr_rev20_conf>; + pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev20_conf>; + vmmc-supply = <&vdd_3v3>; + vqmmc-supply = <&ldo1_reg>; +}; + +&mmc2 { + pinctrl-names = "default", "hs", "ddr_1_8v"; + pinctrl-0 = <&mmc2_pins_default>; + pinctrl-1 = <&mmc2_pins_hs>; + pinctrl-2 = <&mmc2_pins_ddr_rev20>; +}; diff --git a/src/arm/am57xx-beagle-x15.dts b/src/arm/am57xx-beagle-x15.dts index 19a60a11c198..d6689106d2a8 100644 --- a/src/arm/am57xx-beagle-x15.dts +++ b/src/arm/am57xx-beagle-x15.dts @@ -20,9 +20,20 @@ }; &mmc1 { + pinctrl-names = "default", "hs"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_hs>; + vmmc-supply = <&ldo1_reg>; }; +&mmc2 { + pinctrl-names = "default", "hs", "ddr_1_8v"; + pinctrl-0 = <&mmc2_pins_default>; + pinctrl-1 = <&mmc2_pins_hs>; + pinctrl-2 = <&mmc2_pins_ddr_3_3v_rev11 &mmc2_iodelay_ddr_3_3v_rev11_conf>; +}; + /* errata i880 "Ethernet RGMII2 Limited to 10/100 Mbps" */ &phy1 { max-speed = <100>; diff --git a/src/arm/am57xx-commercial-grade.dtsi b/src/arm/am57xx-commercial-grade.dtsi index c183654464e9..3eed6e09c884 100644 --- a/src/arm/am57xx-commercial-grade.dtsi +++ b/src/arm/am57xx-commercial-grade.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 &cpu_alert0 { temperature = <80000>; /* milliCelsius */ }; diff --git a/src/arm/am57xx-idk-common.dtsi b/src/arm/am57xx-idk-common.dtsi index c536b2f5389f..97aa8e6a56da 100644 --- a/src/arm/am57xx-idk-common.dtsi +++ b/src/arm/am57xx-idk-common.dtsi @@ -399,6 +399,14 @@ dr_mode = "peripheral"; }; +&mmc1 { + status = "okay"; + vmmc-supply = <&v3_3d>; + vqmmc-supply = <&ldo1_reg>; + bus-width = <4>; + cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */ +}; + &mmc2 { status = "okay"; vmmc-supply = <&v3_3d>; diff --git a/src/arm/am57xx-industrial-grade.dtsi b/src/arm/am57xx-industrial-grade.dtsi index 70c8c4ba1933..422f953fc8d8 100644 --- a/src/arm/am57xx-industrial-grade.dtsi +++ b/src/arm/am57xx-industrial-grade.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 &cpu_alert0 { temperature = <90000>; /* milliCelsius */ }; diff --git a/src/arm/armada-370.dtsi b/src/arm/armada-370.dtsi index f9cf1273f35e..b1cf5a26f3c2 100644 --- a/src/arm/armada-370.dtsi +++ b/src/arm/armada-370.dtsi @@ -72,7 +72,7 @@ reg = ; }; - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,armada-370-pcie"; status = "disabled"; device_type = "pci"; @@ -100,6 +100,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 58>; marvell,pcie-port = <0>; @@ -117,6 +118,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 62>; marvell,pcie-port = <1>; diff --git a/src/arm/armada-375.dtsi b/src/arm/armada-375.dtsi index 50c5e8417802..2cb1bcd30976 100644 --- a/src/arm/armada-375.dtsi +++ b/src/arm/armada-375.dtsi @@ -178,9 +178,9 @@ reg = <0x8000 0x1000>; cache-unified; cache-level = <2>; - arm,double-linefill-incr = <1>; + arm,double-linefill-incr = <0>; arm,double-linefill-wrap = <0>; - arm,double-linefill = <1>; + arm,double-linefill = <0>; prefetch-data = <1>; }; @@ -582,7 +582,7 @@ }; }; - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,armada-370-pcie"; status = "disabled"; device_type = "pci"; @@ -610,6 +610,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <0>; @@ -627,6 +628,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <0>; diff --git a/src/arm/armada-380.dtsi b/src/arm/armada-380.dtsi index e392f6036f39..132596fd0860 100644 --- a/src/arm/armada-380.dtsi +++ b/src/arm/armada-380.dtsi @@ -71,7 +71,7 @@ }; }; - pcie-controller { + pcie { compatible = "marvell,armada-370-pcie"; status = "disabled"; device_type = "pci"; @@ -104,6 +104,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <0>; @@ -122,6 +123,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <1>; @@ -140,6 +142,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 0x81000000 0 0 0x81000000 0x3 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <2>; diff --git a/src/arm/armada-385-db-ap.dts b/src/arm/armada-385-db-ap.dts index db5b9f6b615d..25d2d720dc0e 100644 --- a/src/arm/armada-385-db-ap.dts +++ b/src/arm/armada-385-db-ap.dts @@ -209,7 +209,7 @@ status = "okay"; }; - pcie-controller { + pcie { status = "okay"; /* diff --git a/src/arm/armada-385-turris-omnia.dts b/src/arm/armada-385-turris-omnia.dts index be16ce39fb3d..06831e1e3f80 100644 --- a/src/arm/armada-385-turris-omnia.dts +++ b/src/arm/armada-385-turris-omnia.dts @@ -96,7 +96,7 @@ }; }; - pcie-controller { + pcie { status = "okay"; pcie@1,0 { diff --git a/src/arm/armada-385.dtsi b/src/arm/armada-385.dtsi index 7fcc4c4885cf..74863aff01c6 100644 --- a/src/arm/armada-385.dtsi +++ b/src/arm/armada-385.dtsi @@ -70,7 +70,7 @@ }; soc { - pciec: pcie-controller { + pciec: pcie { compatible = "marvell,armada-370-pcie"; status = "disabled"; device_type = "pci"; @@ -109,6 +109,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <0>; @@ -127,6 +128,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <1>; @@ -145,6 +147,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 0x81000000 0 0 0x81000000 0x3 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <2>; @@ -166,6 +169,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 0x81000000 0 0 0x81000000 0x4 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <3>; diff --git a/src/arm/armada-388-clearfog.dts b/src/arm/armada-388-clearfog.dts index 0d5f1f062275..ee7b0089eff0 100644 --- a/src/arm/armada-388-clearfog.dts +++ b/src/arm/armada-388-clearfog.dts @@ -62,7 +62,7 @@ }; }; - pcie-controller { + pcie { pcie@3,0 { /* Port 2, Lane 0. CON2, nearest CPU. */ reset-gpios = <&expander0 2 GPIO_ACTIVE_LOW>; diff --git a/src/arm/armada-388-clearfog.dtsi b/src/arm/armada-388-clearfog.dtsi index 0f5938bede53..68acfc968706 100644 --- a/src/arm/armada-388-clearfog.dtsi +++ b/src/arm/armada-388-clearfog.dtsi @@ -104,7 +104,7 @@ }; }; - pcie-controller { + pcie { status = "okay"; /* * The two PCIe units are accessible through diff --git a/src/arm/armada-388-db.dts b/src/arm/armada-388-db.dts index 1ac923826445..a4ec1fa37529 100644 --- a/src/arm/armada-388-db.dts +++ b/src/arm/armada-388-db.dts @@ -172,7 +172,7 @@ status = "okay"; }; - pcie-controller { + pcie { status = "okay"; /* * The two PCIe units are accessible through diff --git a/src/arm/armada-388-gp.dts b/src/arm/armada-388-gp.dts index 563901e0ec07..f503955dbd3b 100644 --- a/src/arm/armada-388-gp.dts +++ b/src/arm/armada-388-gp.dts @@ -240,7 +240,7 @@ status = "okay"; }; - pcie-controller { + pcie { status = "okay"; /* * One PCIe units is accessible through diff --git a/src/arm/armada-388-rd.dts b/src/arm/armada-388-rd.dts index af82f275eac2..9cc3ca0376b9 100644 --- a/src/arm/armada-388-rd.dts +++ b/src/arm/armada-388-rd.dts @@ -117,7 +117,7 @@ }; }; - pcie-controller { + pcie { status = "okay"; /* * One PCIe units is accessible through diff --git a/src/arm/armada-38x.dtsi b/src/arm/armada-38x.dtsi index af31f5d6c0e5..00ff549d4e39 100644 --- a/src/arm/armada-38x.dtsi +++ b/src/arm/armada-38x.dtsi @@ -143,9 +143,9 @@ reg = <0x8000 0x1000>; cache-unified; cache-level = <2>; - arm,double-linefill-incr = <1>; + arm,double-linefill-incr = <0>; arm,double-linefill-wrap = <0>; - arm,double-linefill = <1>; + arm,double-linefill = <0>; prefetch-data = <1>; }; @@ -154,6 +154,13 @@ reg = <0xc000 0x58>; }; + timer@c200 { + compatible = "arm,cortex-a9-global-timer"; + reg = <0xc200 0x20>; + interrupts = ; + clocks = <&coreclk 2>; + }; + timer@c600 { compatible = "arm,cortex-a9-twd-timer"; reg = <0xc600 0x20>; @@ -171,7 +178,7 @@ }; i2c0: i2c@11000 { - compatible = "marvell,mv64xxx-i2c"; + compatible = "marvell,mv78230-a0-i2c", "marvell,mv64xxx-i2c"; reg = <0x11000 0x20>; #address-cells = <1>; #size-cells = <0>; @@ -182,7 +189,7 @@ }; i2c1: i2c@11100 { - compatible = "marvell,mv64xxx-i2c"; + compatible = "marvell,mv78230-a0-i2c", "marvell,mv64xxx-i2c"; reg = <0x11100 0x20>; #address-cells = <1>; #size-cells = <0>; diff --git a/src/arm/armada-390-db.dts b/src/arm/armada-390-db.dts index 2afed2ce4741..c718a5242595 100644 --- a/src/arm/armada-390-db.dts +++ b/src/arm/armada-390-db.dts @@ -123,7 +123,7 @@ }; }; - pcie-controller { + pcie { status = "okay"; /* CON30 */ diff --git a/src/arm/armada-395-gp.dts b/src/arm/armada-395-gp.dts index 2cdbba804c1e..ef491b524fd6 100644 --- a/src/arm/armada-395-gp.dts +++ b/src/arm/armada-395-gp.dts @@ -139,7 +139,7 @@ }; }; - pcie-controller { + pcie { status = "okay"; /* diff --git a/src/arm/armada-398-db.dts b/src/arm/armada-398-db.dts index e8604281c3c9..f0e0379f7619 100644 --- a/src/arm/armada-398-db.dts +++ b/src/arm/armada-398-db.dts @@ -118,7 +118,7 @@ }; }; - pcie-controller { + pcie { status = "okay"; pcie@1,0 { diff --git a/src/arm/armada-39x.dtsi b/src/arm/armada-39x.dtsi index 60fbfd5907c7..5218bd2a248d 100644 --- a/src/arm/armada-39x.dtsi +++ b/src/arm/armada-39x.dtsi @@ -111,9 +111,9 @@ reg = <0x8000 0x1000>; cache-unified; cache-level = <2>; - arm,double-linefill-incr = <1>; + arm,double-linefill-incr = <0>; arm,double-linefill-wrap = <0>; - arm,double-linefill = <1>; + arm,double-linefill = <0>; prefetch-data = <1>; }; @@ -442,7 +442,7 @@ }; }; - pcie-controller { + pcie { compatible = "marvell,armada-370-pcie"; status = "disabled"; device_type = "pci"; @@ -481,6 +481,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <0>; @@ -499,6 +500,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <1>; @@ -517,6 +519,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 0x81000000 0 0 0x81000000 0x3 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <2>; @@ -538,6 +541,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 0x81000000 0 0 0x81000000 0x4 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &gic GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; marvell,pcie-port = <3>; diff --git a/src/arm/armada-xp-98dx3236.dtsi b/src/arm/armada-xp-98dx3236.dtsi index be22ec5236ac..bdd4c7a45fbf 100644 --- a/src/arm/armada-xp-98dx3236.dtsi +++ b/src/arm/armada-xp-98dx3236.dtsi @@ -91,7 +91,7 @@ /* * 98DX3236 has 1 x1 PCIe unit Gen2.0 */ - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,armada-xp-pcie"; status = "disabled"; device_type = "pci"; @@ -116,6 +116,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 58>; marvell,pcie-port = <0>; diff --git a/src/arm/armada-xp-db.dts b/src/arm/armada-xp-db.dts index a33974254d8c..065282c21789 100644 --- a/src/arm/armada-xp-db.dts +++ b/src/arm/armada-xp-db.dts @@ -242,7 +242,7 @@ /* Port 2, Lane 0 */ status = "okay"; }; - pcie@10,0 { + pcie@a,0 { /* Port 3, Lane 0 */ status = "okay"; }; diff --git a/src/arm/armada-xp-gp.dts b/src/arm/armada-xp-gp.dts index d62bf7bea1df..ac9eab8ac186 100644 --- a/src/arm/armada-xp-gp.dts +++ b/src/arm/armada-xp-gp.dts @@ -227,7 +227,7 @@ /* Port 2, Lane 0 */ status = "okay"; }; - pcie@10,0 { + pcie@a,0 { /* Port 3, Lane 0 */ status = "okay"; }; diff --git a/src/arm/armada-xp-mv78230.dtsi b/src/arm/armada-xp-mv78230.dtsi index 9f25814077f2..129738f7973d 100644 --- a/src/arm/armada-xp-mv78230.dtsi +++ b/src/arm/armada-xp-mv78230.dtsi @@ -86,7 +86,7 @@ * configured as x4 or quad x1 lanes. One unit is * x1 only. */ - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,armada-xp-pcie"; status = "disabled"; device_type = "pci"; @@ -123,6 +123,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 58>; marvell,pcie-port = <0>; @@ -140,6 +141,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 59>; marvell,pcie-port = <0>; @@ -157,6 +159,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 0x81000000 0 0 0x81000000 0x3 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 60>; marvell,pcie-port = <0>; @@ -174,6 +177,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 0x81000000 0 0 0x81000000 0x4 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 61>; marvell,pcie-port = <0>; @@ -191,6 +195,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0 0x81000000 0 0 0x81000000 0x5 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 62>; marvell,pcie-port = <1>; diff --git a/src/arm/armada-xp-mv78260.dtsi b/src/arm/armada-xp-mv78260.dtsi index 2bfe07aebf1a..e58d597e37b9 100644 --- a/src/arm/armada-xp-mv78260.dtsi +++ b/src/arm/armada-xp-mv78260.dtsi @@ -87,7 +87,7 @@ * configured as x4 or quad x1 lanes. One unit is * x4 only. */ - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,armada-xp-pcie"; status = "disabled"; device_type = "pci"; @@ -138,6 +138,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 58>; marvell,pcie-port = <0>; @@ -155,6 +156,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 59>; marvell,pcie-port = <0>; @@ -172,6 +174,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 0x81000000 0 0 0x81000000 0x3 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 60>; marvell,pcie-port = <0>; @@ -189,6 +192,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 0x81000000 0 0 0x81000000 0x4 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 61>; marvell,pcie-port = <0>; @@ -206,6 +210,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0 0x81000000 0 0 0x81000000 0x5 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 62>; marvell,pcie-port = <1>; @@ -223,6 +228,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0 0x81000000 0 0 0x81000000 0x6 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 63>; marvell,pcie-port = <1>; @@ -240,6 +246,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0 0x81000000 0 0 0x81000000 0x7 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 64>; marvell,pcie-port = <1>; @@ -257,6 +264,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0 0x81000000 0 0 0x81000000 0x8 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 65>; marvell,pcie-port = <1>; @@ -274,6 +282,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 0x81000000 0 0 0x81000000 0x9 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 99>; marvell,pcie-port = <2>; diff --git a/src/arm/armada-xp-mv78460.dtsi b/src/arm/armada-xp-mv78460.dtsi index 6c33935f7074..a5c961cee7de 100644 --- a/src/arm/armada-xp-mv78460.dtsi +++ b/src/arm/armada-xp-mv78460.dtsi @@ -104,7 +104,7 @@ * configured as x4 or quad x1 lanes. Two units are * x4/x1. */ - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,armada-xp-pcie"; status = "disabled"; device_type = "pci"; @@ -159,6 +159,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 58>; marvell,pcie-port = <0>; @@ -176,6 +177,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 59>; marvell,pcie-port = <0>; @@ -193,6 +195,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0 0x81000000 0 0 0x81000000 0x3 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 60>; marvell,pcie-port = <0>; @@ -210,6 +213,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0 0x81000000 0 0 0x81000000 0x4 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 61>; marvell,pcie-port = <0>; @@ -227,6 +231,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0 0x81000000 0 0 0x81000000 0x5 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 62>; marvell,pcie-port = <1>; @@ -244,6 +249,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0 0x81000000 0 0 0x81000000 0x6 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 63>; marvell,pcie-port = <1>; @@ -261,6 +267,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0 0x81000000 0 0 0x81000000 0x7 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 64>; marvell,pcie-port = <1>; @@ -278,6 +285,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0 0x81000000 0 0 0x81000000 0x8 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 65>; marvell,pcie-port = <1>; @@ -295,6 +303,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0 0x81000000 0 0 0x81000000 0x9 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 99>; marvell,pcie-port = <2>; @@ -303,7 +312,7 @@ status = "disabled"; }; - pcie10: pcie@10,0 { + pcie10: pcie@a,0 { device_type = "pci"; assigned-addresses = <0x82005000 0 0x82000 0 0x2000>; reg = <0x5000 0 0 0 0>; @@ -312,6 +321,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0 0x81000000 0 0 0x81000000 0xa 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &mpic 103>; marvell,pcie-port = <3>; diff --git a/src/arm/armv7-m.dtsi b/src/arm/armv7-m.dtsi index ba332e399be4..26f5443d85e1 100644 --- a/src/arm/armv7-m.dtsi +++ b/src/arm/armv7-m.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { nvic: interrupt-controller@e000e100 { compatible = "arm,armv7m-nvic"; diff --git a/src/arm/aspeed-ast2500-evb.dts b/src/arm/aspeed-ast2500-evb.dts index 7c90dac99822..f53e89d63477 100644 --- a/src/arm/aspeed-ast2500-evb.dts +++ b/src/arm/aspeed-ast2500-evb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "aspeed-g5.dtsi" diff --git a/src/arm/aspeed-bmc-opp-palmetto.dts b/src/arm/aspeed-bmc-opp-palmetto.dts index 112551766275..e1b523bd5b8b 100644 --- a/src/arm/aspeed-bmc-opp-palmetto.dts +++ b/src/arm/aspeed-bmc-opp-palmetto.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "aspeed-g4.dtsi" diff --git a/src/arm/aspeed-bmc-opp-romulus.dts b/src/arm/aspeed-bmc-opp-romulus.dts index 1190fec1b5d0..6dd77cba191c 100644 --- a/src/arm/aspeed-bmc-opp-romulus.dts +++ b/src/arm/aspeed-bmc-opp-romulus.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "aspeed-g5.dtsi" diff --git a/src/arm/aspeed-g4.dtsi b/src/arm/aspeed-g4.dtsi index 8a04c7e2d818..fcc5efbd0879 100644 --- a/src/arm/aspeed-g4.dtsi +++ b/src/arm/aspeed-g4.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "skeleton.dtsi" / { @@ -26,7 +27,7 @@ fmc: flash-controller@1e620000 { reg = < 0x1e620000 0x94 - 0x20000000 0x02000000 >; + 0x20000000 0x10000000 >; #address-cells = <1>; #size-cells = <0>; compatible = "aspeed,ast2400-fmc"; @@ -41,7 +42,7 @@ spi: flash-controller@1e630000 { reg = < 0x1e630000 0x18 - 0x30000000 0x02000000 >; + 0x30000000 0x10000000 >; #address-cells = <1>; #size-cells = <0>; compatible = "aspeed,ast2400-spi"; diff --git a/src/arm/aspeed-g5.dtsi b/src/arm/aspeed-g5.dtsi index 9cffe347b828..eab8f549a6fe 100644 --- a/src/arm/aspeed-g5.dtsi +++ b/src/arm/aspeed-g5.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "skeleton.dtsi" / { diff --git a/src/arm/at91-ariettag25.dts b/src/arm/at91-ariettag25.dts index c514502081d2..21c5b56c92e0 100644 --- a/src/arm/at91-ariettag25.dts +++ b/src/arm/at91-ariettag25.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree file for Arietta G25 * This device tree is minimal, to activate more peripherals, see: diff --git a/src/arm/at91-sama5d27_som1.dtsi b/src/arm/at91-sama5d27_som1.dtsi new file mode 100644 index 000000000000..cf0087b4c9e1 --- /dev/null +++ b/src/arm/at91-sama5d27_som1.dtsi @@ -0,0 +1,102 @@ +/* + * at91-sama5d27_som1.dtsi - Device Tree file for SAMA5D27 SoM1 board + * + * Copyright (c) 2017, Microchip Technology Inc. + * 2017 Cristian Birsan + * 2017 Claudiu Beznea + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +#include "sama5d2.dtsi" +#include "sama5d2-pinfunc.h" + +/ { + model = "Atmel SAMA5D27 SoM1"; + compatible = "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5"; + + clocks { + slow_xtal { + clock-frequency = <32768>; + }; + + main_xtal { + clock-frequency = <24000000>; + }; + }; + + ahb { + apb { + macb0: ethernet@f8008000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_macb0_default>; + phy-mode = "rmii"; + + ethernet-phy@0 { + reg = <0x0>; + interrupt-parent = <&pioA>; + interrupts = ; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_macb0_phy_irq>; + }; + }; + + pinctrl@fc038000 { + + pinctrl_macb0_default: macb0_default { + pinmux = , + , + , + , + , + , + , + , + , + ; + bias-disable; + }; + + pinctrl_macb0_phy_irq: macb0_phy_irq { + pinmux = ; + bias-disable; + }; + }; + }; + }; +}; diff --git a/src/arm/at91-sama5d27_som1_ek.dts b/src/arm/at91-sama5d27_som1_ek.dts new file mode 100644 index 000000000000..60cb084a8d92 --- /dev/null +++ b/src/arm/at91-sama5d27_som1_ek.dts @@ -0,0 +1,540 @@ +/* + * at91-sama5d27_som1_ek.dts - Device Tree file for SAMA5D27-SOM1-EK board + * + * Copyright (c) 2017, Microchip Technology Inc. + * 2016 Nicolas Ferre + * 2017 Cristian Birsan + * 2017 Claudiu Beznea + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ +/dts-v1/; +#include "at91-sama5d27_som1.dtsi" +#include +#include + +/ { + model = "Atmel SAMA5D27 SOM1 EK"; + compatible = "atmel,sama5d27-som1-ek", "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + ahb { + usb0: gadget@00300000 { + atmel,vbus-gpio = <&pioA PIN_PD20 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usba_vbus>; + status = "okay"; + }; + + usb1: ohci@00400000 { + num-ports = <3>; + atmel,vbus-gpio = <0 /* &pioA PIN_PD20 GPIO_ACTIVE_HIGH */ + &pioA PIN_PA27 GPIO_ACTIVE_HIGH + 0 + >; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb_default>; + status = "okay"; + }; + + usb2: ehci@00500000 { + status = "okay"; + }; + + sdmmc0: sdio-host@a0000000 { + bus-width = <8>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sdmmc0_default>; + status = "okay"; + }; + + sdmmc1: sdio-host@b0000000 { + bus-width = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sdmmc1_default>; + status = "okay"; + }; + + apb { + isc: isc@f0008000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>; + status = "okay"; + }; + + spi0: spi@f8000000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi0_default>; + status = "okay"; + }; + + macb0: ethernet@f8008000 { + status = "okay"; + }; + + uart1: serial@f8020000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart1_default>; + atmel,use-dma-rx; + atmel,use-dma-tx; + status = "okay"; + }; + + uart2: serial@f8024000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mikrobus2_uart>; + atmel,use-dma-rx; + atmel,use-dma-tx; + status = "okay"; + }; + + pwm0: pwm@f802c000 { + status = "okay"; + }; + + flx1: flexcom@f8038000 { + atmel,flexcom-mode = ; + status = "disabled"; + + i2c2: i2c@600 { + compatible = "atmel,sama5d2-i2c"; + reg = <0x600 0x200>; + interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>; + dmas = <0>, <0>; + dma-names = "tx", "rx"; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&flx1_clk>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mikrobus_i2c>; + atmel,fifo-size = <16>; + status = "disabled"; + }; + }; + + shdwc@f8048010 { + atmel,shdwc-debouncer = <976>; + atmel,wakeup-rtc-timer; + + input@0 { + reg = <0>; + atmel,wakeup-type = "low"; + }; + }; + + watchdog@f8048040 { + status = "okay"; + }; + + can0: can@f8054000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_can0_default>; + }; + + uart3: serial@fc008000 { + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart3_default>; + status = "disabled"; + }; + + uart4: serial@fc00c000 { + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mikrobus1_uart>; + status = "okay"; + }; + + flx3: flexcom@fc014000 { + atmel,flexcom-mode = ; + status = "disabled"; + + uart7: serial@200 { + compatible = "atmel,at91sam9260-usart"; + reg = <0x200 0x200>; + interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&flx3_clk>; + clock-names = "usart"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_flx3_default>; + atmel,fifo-size = <32>; + status = "disabled"; + }; + + spi2: spi@400 { + compatible = "atmel,at91rm9200-spi"; + reg = <0x400 0x200>; + interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&flx3_clk>; + clock-names = "spi_clk"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_flx3_default>; + atmel,fifo-size = <16>; + status = "disabled"; + }; + }; + + flx4: flexcom@fc018000 { + atmel,flexcom-mode = ; + status = "okay"; + + uart6: serial@200 { + compatible = "atmel,at91sam9260-usart"; + reg = <0x200 0x200>; + interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&flx4_clk>; + clock-names = "usart"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_flx4_default>; + atmel,fifo-size = <32>; + status = "disabled"; + }; + + spi3: spi@400 { + compatible = "atmel,at91rm9200-spi"; + reg = <0x400 0x200>; + interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&flx4_clk>; + clock-names = "spi_clk"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>; + atmel,fifo-size = <16>; + status = "okay"; + }; + + i2c3: i2c@600 { + compatible = "atmel,sama5d2-i2c"; + reg = <0x600 0x200>; + interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>; + dmas = <0>, <0>; + dma-names = "tx", "rx"; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&flx4_clk>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_flx4_default>; + atmel,fifo-size = <16>; + status = "disabled"; + }; + }; + + i2c1: i2c@fc028000 { + dmas = <0>, <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1_default>; + status = "okay"; + }; + + pinctrl@fc038000 { + + pinctrl_can0_default: can0_default { + pinmux = , + ; + bias-disable; + }; + + pinctrl_can1_default: can1_default { + pinmux = , + ; + bias-disable; + }; + + pinctrl_flx3_default: flx3_default { + pinmux = , + , + , + , + ; + bias-disable; + }; + + pinctrl_i2c1_default: i2c1_default { + pinmux = , + ; + bias-disable; + }; + + pinctrl_isc_base: isc_base { + pinmux = , + , + , + ; + bias-disable; + }; + + pinctrl_isc_data_8bit: isc_data_8bit { + pinmux = , + , + , + , + , + , + , + ; + bias-disable; + }; + + pinctrl_isc_data_9_10: isc_data_9_10 { + pinmux = , + ; + bias-disable; + }; + + pinctrl_isc_data_11_12: isc_data_11_12 { + pinmux = , + ; + bias-disable; + }; + + pinctrl_key_gpio_default: key_gpio_default { + pinmux = ; + bias-pull-up; + }; + + pinctrl_led_gpio_default: led_gpio_default { + pinmux = , + , + ; + bias-pull-up; + }; + + pinctrl_sdmmc0_default: sdmmc0_default { + cmd_data { + pinmux = , + , + , + , + , + , + , + , + ; + bias-pull-up; + }; + + ck_cd_vddsel { + pinmux = , + , + ; + bias-disable; + }; + }; + + pinctrl_sdmmc1_default: sdmmc1_default { + cmd_data { + pinmux = , + , + , + , + ; + bias-pull-up; + }; + + conf-ck_cd { + pinmux = , + ; + bias-disable; + }; + }; + + pinctrl_spi0_default: spi0_default { + pinmux = , + , + , + ; + bias-disable; + }; + + pinctrl_uart1_default: uart1_default { + pinmux = , + ; + bias-disable; + }; + + pinctrl_uart3_default: uart3_default { + pinmux = , + ; + bias-disable; + }; + + pinctrl_usb_default: usb_default { + pinmux = , + ; + bias-disable; + }; + + pinctrl_usba_vbus: usba_vbus { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus1_an: mikrobus1_an { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus2_an: mikrobus2_an { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus1_rst: mikrobus1_rst { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus2_rst: mikrobus2_rst { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus1_spi_cs: mikrobus1_spi_cs { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus2_spi_cs: mikrobus2_spi_cs { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus_spi: mikrobus_spi { + pinmux = , + , + ; + bias-disable; + }; + + pinctrl_mikrobus1_pwm: mikrobus1_pwm { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus2_pwm: mikrobus2_pwm { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus1_int: mikrobus1_int { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus2_int: mikrobus2_int { + pinmux = ; + bias-disable; + }; + + pinctrl_mikrobus1_uart: mikrobus1_uart { + pinmux = , + ; + bias-disable; + }; + + pinctrl_mikrobus2_uart: mikrobus2_uart { + pinmux = , + ; + bias-disable; + }; + + pinctrl_mikrobus_i2c: mikrobus1_i2c { + pinmux = , + ; + bias-disable; + }; + + pinctrl_flx4_default: flx4_uart_default { + pinmux = , + , + , + , + ; + bias-disable; + }; + }; + + can1: can@fc050000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_can1_default>; + status = "okay"; + }; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_key_gpio_default>; + + pb4 { + label = "USER"; + gpios = <&pioA PIN_PA29 GPIO_ACTIVE_LOW>; + linux,code = <0x104>; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_led_gpio_default>; + status = "okay"; + + red { + label = "red"; + gpios = <&pioA PIN_PA10 GPIO_ACTIVE_HIGH>; + }; + + green { + label = "green"; + gpios = <&pioA PIN_PB1 GPIO_ACTIVE_HIGH>; + }; + + blue { + label = "blue"; + gpios = <&pioA PIN_PA31 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + }; + }; +}; diff --git a/src/arm/at91-sama5d2_xplained.dts b/src/arm/at91-sama5d2_xplained.dts index 2e2c3d1a1fa2..cbc26001247b 100644 --- a/src/arm/at91-sama5d2_xplained.dts +++ b/src/arm/at91-sama5d2_xplained.dts @@ -68,7 +68,7 @@ ahb { usb0: gadget@00300000 { - atmel,vbus-gpio = <&pioA 31 GPIO_ACTIVE_HIGH>; + atmel,vbus-gpio = <&pioA PIN_PA31 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usba_vbus>; status = "okay"; @@ -76,8 +76,8 @@ usb1: ohci@00400000 { num-ports = <3>; - atmel,vbus-gpio = <0 /* &pioA 41 GPIO_ACTIVE_HIGH */ - &pioA 42 GPIO_ACTIVE_HIGH + atmel,vbus-gpio = <0 /* &pioA PIN_PB9 GPIO_ACTIVE_HIGH */ + &pioA PIN_PB10 GPIO_ACTIVE_HIGH 0 >; pinctrl-names = "default"; @@ -127,7 +127,7 @@ ethernet-phy@1 { reg = <0x1>; interrupt-parent = <&pioA>; - interrupts = <73 IRQ_TYPE_LEVEL_LOW>; + interrupts = ; }; }; @@ -160,9 +160,9 @@ compatible = "active-semi,act8945a"; reg = <0x5b>; active-semi,vsel-high; - active-semi,chglev-gpios = <&pioA 12 GPIO_ACTIVE_HIGH>; - active-semi,lbo-gpios = <&pioA 72 GPIO_ACTIVE_LOW>; - active-semi,irq_gpios = <&pioA 45 GPIO_ACTIVE_LOW>; + active-semi,chglev-gpios = <&pioA PIN_PA12 GPIO_ACTIVE_HIGH>; + active-semi,lbo-gpios = <&pioA PIN_PC8 GPIO_ACTIVE_LOW>; + active-semi,irq_gpios = <&pioA PIN_PB13 GPIO_ACTIVE_LOW>; active-semi,input-voltage-threshold-microvolt = <6600>; active-semi,precondition-timeout = <40>; active-semi,total-timeout = <3>; @@ -309,7 +309,7 @@ vddana-supply = <&vdd_3v3_lp_reg>; vref-supply = <&vdd_3v3_lp_reg>; pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_adc_default>; + pinctrl-0 = <&pinctrl_adc_default &pinctrl_adtrg_default>; status = "okay"; }; @@ -340,6 +340,20 @@ bias-disable; }; + /* + * The ADTRG pin can work on any edge type. + * In here it's being pulled up, so need to + * connect it to ground to get an edge e.g. + * Trigger can be configured on falling, rise + * or any edge, and the pull-up can be changed + * to pull-down or left floating according to + * needs. + */ + pinctrl_adtrg_default: adtrg_default { + pinmux = ; + bias-pull-up; + }; + pinctrl_charger_chglev: charger_chglev { pinmux = ; bias-disable; @@ -355,6 +369,14 @@ bias-pull-up; }; + pinctrl_classd_default: classd_default { + pinmux = , + , + , + ; + bias-pull-up; + }; + pinctrl_flx0_default: flx0_default { pinmux = , ; @@ -488,6 +510,14 @@ }; + classd: classd@fc048000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_classd_default>; + atmel,pwm-type = "diff"; + atmel,non-overlap-time = <10>; + status = "okay"; + }; + can1: can@fc050000 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_can1_default>; @@ -504,7 +534,7 @@ bp1 { label = "PB_USER"; - gpios = <&pioA 41 GPIO_ACTIVE_LOW>; + gpios = <&pioA PIN_PB9 GPIO_ACTIVE_LOW>; linux,code = <0x104>; }; }; @@ -517,17 +547,18 @@ red { label = "red"; - gpios = <&pioA 38 GPIO_ACTIVE_LOW>; + gpios = <&pioA PIN_PB6 GPIO_ACTIVE_LOW>; }; + green { label = "green"; - gpios = <&pioA 37 GPIO_ACTIVE_LOW>; + gpios = <&pioA PIN_PB5 GPIO_ACTIVE_LOW>; }; blue { label = "blue"; - gpios = <&pioA 32 GPIO_ACTIVE_LOW>; + gpios = <&pioA PIN_PB0 GPIO_ACTIVE_LOW>; linux,default-trigger = "heartbeat"; }; }; diff --git a/src/arm/at91sam9g45.dtsi b/src/arm/at91sam9g45.dtsi index a4808c4fbc05..64fa3f9a39d3 100644 --- a/src/arm/at91sam9g45.dtsi +++ b/src/arm/at91sam9g45.dtsi @@ -455,6 +455,16 @@ >; /* shared pinctrl settings */ + ac97 { + pinctrl_ac97: ac97-0 { + atmel,pins = + ; /* AC97CK */ + }; + }; + adc0 { pinctrl_adc0_adtrg: adc0_adtrg { atmel,pins = ; @@ -1043,6 +1053,17 @@ status = "disabled"; }; + ac97: sound@fffac000 { + compatible = "atmel,at91sam9263-ac97c"; + reg = <0xfffac000 0x4000>; + interrupts = <24 IRQ_TYPE_LEVEL_HIGH 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ac97>; + clocks = <&ac97_clk>; + clock-names = "ac97_clk"; + status = "disabled"; + }; + adc0: adc@fffb0000 { #address-cells = <1>; #size-cells = <0>; diff --git a/src/arm/at91sam9m10g45ek.dts b/src/arm/at91sam9m10g45ek.dts index 2522c3308305..94c52c555f83 100644 --- a/src/arm/at91sam9m10g45ek.dts +++ b/src/arm/at91sam9m10g45ek.dts @@ -166,6 +166,10 @@ status = "okay"; }; + ac97: sound@fffac000 { + status = "okay"; + }; + adc0: adc@fffb0000 { pinctrl-names = "default"; pinctrl-0 = < diff --git a/src/arm/bcm-cygnus.dtsi b/src/arm/bcm-cygnus.dtsi index bf8c83815753..7c957ea06c66 100644 --- a/src/arm/bcm-cygnus.dtsi +++ b/src/arm/bcm-cygnus.dtsi @@ -55,6 +55,11 @@ /include/ "bcm-cygnus-clock.dtsi" + pmu { + compatible = "arm,cortex-a9-pmu"; + interrupts = ; + }; + core { compatible = "simple-bus"; ranges = <0x00000000 0x19000000 0x1000000>; @@ -119,6 +124,21 @@ compatible = "brcm,cygnus-pinmux"; reg = <0x0301d0c8 0x30>, <0x0301d24c 0x2c>; + + spi_0: spi_0 { + function = "spi0"; + groups = "spi0_grp"; + }; + + spi_1: spi_1 { + function = "spi1"; + groups = "spi1_grp"; + }; + + spi_2: spi_2 { + function = "spi2"; + groups = "spi2_grp"; + }; }; mailbox: mailbox@03024024 { @@ -300,6 +320,23 @@ }; }; + dma0: dma@18018000 { + compatible = "arm,pl330", "arm,primecell"; + reg = <0x18018000 0x1000>; + interrupts = , + , + , + , + , + , + , + , + ; + clocks = <&apb_clk>; + clock-names = "apb_pclk"; + #dma-cells = <1>; + }; + uart0: serial@18020000 { compatible = "snps,dw-apb-uart"; reg = <0x18020000 0x100>; @@ -324,7 +361,7 @@ uart2: serial@18022000 { compatible = "snps,dw-apb-uart"; - reg = <0x18020000 0x100>; + reg = <0x18022000 0x100>; reg-shift = <2>; reg-io-width = <4>; interrupts = ; @@ -344,6 +381,52 @@ status = "disabled"; }; + spi0: spi@18028000 { + compatible = "arm,pl022", "arm,primecell"; + reg = <0x18028000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = ; + pinctrl-0 = <&spi_0>; + clocks = <&axi81_clk>; + clock-names = "apb_pclk"; + status = "disabled"; + }; + + spi1: spi@18029000 { + compatible = "arm,pl022", "arm,primecell"; + reg = <0x18029000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = ; + pinctrl-0 = <&spi_1>; + clocks = <&axi81_clk>; + clock-names = "apb_pclk"; + status = "disabled"; + }; + + spi2: spi@1802a000 { + compatible = "arm,pl022", "arm,primecell"; + reg = <0x1802a000 0x1000>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = ; + pinctrl-0 = <&spi_2>; + clocks = <&axi81_clk>; + clock-names = "apb_pclk"; + status = "disabled"; + }; + + sdhci0: sdhci@18041000 { + compatible = "brcm,sdhci-iproc-cygnus"; + reg = <0x18041000 0x100>; + interrupts = ; + clocks = <&lcpll0 BCM_CYGNUS_LCPLL0_SDIO_CLK>; + bus-width = <4>; + sdhci,auto-cmd12; + status = "disabled"; + }; + eth0: ethernet@18042000 { compatible = "brcm,amac"; reg = <0x18042000 0x1000>, @@ -353,6 +436,16 @@ status = "disabled"; }; + sdhci1: sdhci@18043000 { + compatible = "brcm,sdhci-iproc-cygnus"; + reg = <0x18043000 0x100>; + interrupts = ; + clocks = <&lcpll0 BCM_CYGNUS_LCPLL0_SDIO_CLK>; + bus-width = <4>; + sdhci,auto-cmd12; + status = "disabled"; + }; + nand: nand@18046000 { compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1"; reg = <0x18046000 0x600>, <0xf8105408 0x600>, @@ -366,6 +459,33 @@ brcm,nand-has-wp; }; + ehci0: usb@18048000 { + compatible = "generic-ehci"; + reg = <0x18048000 0x100>; + interrupts = ; + status = "disabled"; + }; + + ohci0: usb@18048800 { + compatible = "generic-ohci"; + reg = <0x18048800 0x100>; + interrupts = ; + status = "disabled"; + }; + + v3d: v3d@180a2000 { + compatible = "brcm,cygnus-v3d"; + reg = <0x180a2000 0x1000>; + clocks = <&mipipll BCM_CYGNUS_MIPIPLL_CH2_V3D>; + clock-names = "v3d_clk"; + interrupts = ; + status = "disabled"; + }; + + vc4: gpu { + compatible = "brcm,cygnus-vc4"; + }; + gpio_asiu: gpio@180a5000 { compatible = "brcm,cygnus-asiu-gpio"; reg = <0x180a5000 0x668>; @@ -444,19 +564,6 @@ status = "disabled"; }; - v3d: v3d@180a2000 { - compatible = "brcm,cygnus-v3d"; - reg = <0x180a2000 0x1000>; - clocks = <&mipipll BCM_CYGNUS_MIPIPLL_CH2_V3D>; - clock-names = "v3d_clk"; - interrupts = ; - status = "disabled"; - }; - - vc4: gpu { - compatible = "brcm,cygnus-vc4"; - }; - adc: adc@180a6000 { compatible = "brcm,iproc-static-adc"; #io-channel-cells = <1>; @@ -467,5 +574,19 @@ interrupts = ; status = "disabled"; }; + + keypad: keypad@180ac000 { + compatible = "brcm,bcm-keypad"; + reg = <0x180ac000 0x14c>; + interrupts = ; + clocks = <&asiu_clks BCM_CYGNUS_ASIU_KEYPAD_CLK>; + clock-names = "peri_clk"; + clock-frequency = <31250>; + pull-up-enabled; + col-debounce-filter-period = <0>; + status-debounce-filter-period = <0>; + row-output-enabled; + status = "disabled"; + }; }; }; diff --git a/src/arm/bcm-nsp.dtsi b/src/arm/bcm-nsp.dtsi index 7204d1def23d..dff66974feed 100644 --- a/src/arm/bcm-nsp.dtsi +++ b/src/arm/bcm-nsp.dtsi @@ -215,6 +215,7 @@ interrupts = ; sdhci,auto-cmd12; clocks = <&lcpll0 BCM_NSP_LCPLL0_SDIO_CLK>; + dma-coherent; status = "disabled"; }; @@ -224,6 +225,7 @@ <0x110000 0x1000>; reg-names = "amac_base", "idm_base"; interrupts = ; + dma-coherent; status = "disabled"; }; @@ -233,6 +235,7 @@ <0x111000 0x1000>; reg-names = "amac_base", "idm_base"; interrupts = ; + dma-coherent; status = "disabled"; }; @@ -242,6 +245,7 @@ <0x112000 0x1000>; reg-names = "amac_base", "idm_base"; interrupts = ; + dma-coherent; status = "disabled"; }; @@ -252,6 +256,7 @@ #mbox-cells = <1>; brcm,rx-status-len = <32>; brcm,use-bcm-hdr; + dma-coherent; }; nand: nand@26000 { @@ -297,6 +302,32 @@ #size-cells = <0>; }; + xhci: usb@29000 { + compatible = "generic-xhci"; + reg = <0x29000 0x1000>; + interrupts = ; + phys = <&usb3_phy>; + phy-names = "usb3-phy"; + dma-coherent; + status = "disabled"; + }; + + ehci0: usb@2a000 { + compatible = "generic-ehci"; + reg = <0x2a000 0x100>; + interrupts = ; + dma-coherent; + status = "disabled"; + }; + + ohci0: usb@2b000 { + compatible = "generic-ohci"; + reg = <0x2b000 0x100>; + interrupts = ; + dma-coherent; + status = "disabled"; + }; + crypto@2f000 { compatible = "brcm,spum-nsp-crypto"; reg = <0x2f000 0x900>; @@ -321,20 +352,6 @@ status = "disabled"; }; - ehci0: usb@2a000 { - compatible = "generic-ehci"; - reg = <0x2a000 0x100>; - interrupts = ; - status = "disabled"; - }; - - ohci0: usb@2b000 { - compatible = "generic-ohci"; - reg = <0x2b000 0x100>; - interrupts = ; - status = "disabled"; - }; - rng: rng@33000 { compatible = "brcm,bcm-nsp-rng"; reg = <0x33000 0x14>; @@ -376,6 +393,7 @@ #size-cells = <0>; interrupts = ; clock-frequency = <100000>; + dma-coherent; status = "disabled"; }; @@ -446,6 +464,7 @@ interrupts = ; #address-cells = <1>; #size-cells = <0>; + dma-coherent; status = "disabled"; sata0: sata-port@0 { @@ -460,6 +479,15 @@ phy-names = "sata-phy"; }; }; + + usb3_phy: usb3-phy@104000 { + compatible = "brcm,ns-bx-usb3-phy"; + reg = <0x104000 0x1000>, + <0x032000 0x1000>; + reg-names = "dmp", "ccb-mii"; + #phy-cells = <0>; + status = "disabled"; + }; }; pcie0: pcie@18012000 { @@ -483,6 +511,7 @@ */ ranges = <0x82000000 0 0x08000000 0x08000000 0 0x8000000>; + dma-coherent; status = "disabled"; msi-parent = <&msi0>; @@ -519,6 +548,7 @@ */ ranges = <0x82000000 0 0x40000000 0x40000000 0 0x8000000>; + dma-coherent; status = "disabled"; msi-parent = <&msi1>; @@ -555,6 +585,7 @@ */ ranges = <0x82000000 0 0x48000000 0x48000000 0 0x8000000>; + dma-coherent; status = "disabled"; msi-parent = <&msi2>; diff --git a/src/arm/bcm2835-rpi-a-plus.dts b/src/arm/bcm2835-rpi-a-plus.dts index d0704540db6b..f81ae0a10310 100644 --- a/src/arm/bcm2835-rpi-a-plus.dts +++ b/src/arm/bcm2835-rpi-a-plus.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" @@ -99,3 +100,9 @@ &hdmi { hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; }; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; diff --git a/src/arm/bcm2835-rpi-a.dts b/src/arm/bcm2835-rpi-a.dts index 46d078e29017..7a960a048204 100644 --- a/src/arm/bcm2835-rpi-a.dts +++ b/src/arm/bcm2835-rpi-a.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" @@ -94,3 +95,9 @@ &hdmi { hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; }; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; diff --git a/src/arm/bcm2835-rpi-b-plus.dts b/src/arm/bcm2835-rpi-b-plus.dts index 432088ebb0a1..0161a8483e39 100644 --- a/src/arm/bcm2835-rpi-b-plus.dts +++ b/src/arm/bcm2835-rpi-b-plus.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" @@ -101,3 +102,9 @@ &hdmi { hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; }; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; diff --git a/src/arm/bcm2835-rpi-b-rev2.dts b/src/arm/bcm2835-rpi-b-rev2.dts index 4133bc2cd9be..4bc70efe43d6 100644 --- a/src/arm/bcm2835-rpi-b-rev2.dts +++ b/src/arm/bcm2835-rpi-b-rev2.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" @@ -94,3 +95,9 @@ &hdmi { hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; }; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; diff --git a/src/arm/bcm2835-rpi-b.dts b/src/arm/bcm2835-rpi-b.dts index 4d56fe3006b0..cca4a75a5651 100644 --- a/src/arm/bcm2835-rpi-b.dts +++ b/src/arm/bcm2835-rpi-b.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "bcm2835.dtsi" #include "bcm2835-rpi.dtsi" @@ -89,3 +90,9 @@ &hdmi { hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; }; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; diff --git a/src/arm/bcm2835-rpi-zero-w.dts b/src/arm/bcm2835-rpi-zero-w.dts new file mode 100644 index 000000000000..b8565fc33eea --- /dev/null +++ b/src/arm/bcm2835-rpi-zero-w.dts @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2017 Stefan Wahren + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +/dts-v1/; +#include "bcm2835.dtsi" +#include "bcm2835-rpi.dtsi" +#include "bcm283x-rpi-usb-host.dtsi" + +/ { + compatible = "raspberrypi,model-zero-w", "brcm,bcm2835"; + model = "Raspberry Pi Zero W"; + + chosen { + /* 8250 auxiliary UART instead of pl011 */ + stdout-path = "serial1:115200n8"; + }; + + leds { + act { + gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; + }; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + pinctrl-names = "default"; + pinctrl-0 = <&wl_on>; + reset-gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; +}; + +&gpio { + /* + * This is based on the official GPU firmware DT blob. + * + * Legend: + * "NC" = not connected (no rail from the SoC) + * "FOO" = GPIO line named "FOO" on the schematic + * "FOO_N" = GPIO line named "FOO" on schematic, active low + */ + gpio-line-names = "GPIO0", + "GPIO1", + "SDA1", + "SCL1", + "GPIO_GCLK", + "GPIO5", + "GPIO6", + "SPI_CE1_N", + "SPI_CE0_N", + "SPI_MISO", + "SPI_MOSI", + "SPI_SCLK", + "GPIO12", + "GPIO13", + /* Serial port */ + "TXD0", + "RXD0", + "GPIO16", + "GPIO17", + "GPIO18", + "GPIO19", + "GPIO20", + "GPIO21", + "GPIO22", + "GPIO23", + "GPIO24", + "GPIO25", + "GPIO26", + "GPIO27", + "SDA0", + "SCL0", + "NC", /* GPIO30 */ + "NC", /* GPIO31 */ + "NC", /* GPIO32 */ + "NC", /* GPIO33 */ + "NC", /* GPIO34 */ + "NC", /* GPIO35 */ + "NC", /* GPIO36 */ + "NC", /* GPIO37 */ + "NC", /* GPIO38 */ + "NC", /* GPIO39 */ + "CAM_GPIO1", /* GPIO40 */ + "WL_ON", /* GPIO41 */ + "NC", /* GPIO42 */ + "WIFI_CLK", /* GPIO43 */ + "CAM_GPIO0", /* GPIO44 */ + "BT_ON", /* GPIO45 */ + "HDMI_HPD_N", + "STATUS_LED_N", + /* Used by SD Card */ + "SD_CLK_R", + "SD_CMD_R", + "SD_DATA0_R", + "SD_DATA1_R", + "SD_DATA2_R", + "SD_DATA3_R"; + + pinctrl-0 = <&gpioout &alt0>; + + wl_on: wl-on { + brcm,pins = <41>; + brcm,function = ; + }; +}; + +&hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; +}; + +&sdhci { + #address-cells = <1>; + #size-cells = <0>; + pinctrl-0 = <&emmc_gpio34 &gpclk2_gpio43>; + mmc-pwrseq = <&wifi_pwrseq>; + non-removable; + status = "okay"; + + brcmf: wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; diff --git a/src/arm/bcm2835-rpi-zero.dts b/src/arm/bcm2835-rpi-zero.dts index 79a20d520931..70362405c595 100644 --- a/src/arm/bcm2835-rpi-zero.dts +++ b/src/arm/bcm2835-rpi-zero.dts @@ -103,3 +103,9 @@ &hdmi { hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; }; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; diff --git a/src/arm/bcm2835-rpi.dtsi b/src/arm/bcm2835-rpi.dtsi index e55b362b9d6e..e36c392a2b8f 100644 --- a/src/arm/bcm2835-rpi.dtsi +++ b/src/arm/bcm2835-rpi.dtsi @@ -39,7 +39,7 @@ }; alt0: alt0 { - brcm,pins = <4 5 7 8 9 10 11 14 15>; + brcm,pins = <4 5 7 8 9 10 11>; brcm,function = ; }; }; diff --git a/src/arm/bcm2835.dtsi b/src/arm/bcm2835.dtsi index 659b6e9513b1..0e3d2a5ff208 100644 --- a/src/arm/bcm2835.dtsi +++ b/src/arm/bcm2835.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "bcm283x.dtsi" / { diff --git a/src/arm/bcm2836-rpi-2-b.dts b/src/arm/bcm2836-rpi-2-b.dts index bf19e8cfb9e6..6669355fd655 100644 --- a/src/arm/bcm2836-rpi-2-b.dts +++ b/src/arm/bcm2836-rpi-2-b.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "bcm2836.dtsi" #include "bcm2835-rpi.dtsi" @@ -39,3 +40,9 @@ &hdmi { hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; }; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio14>; + status = "okay"; +}; diff --git a/src/arm/bcm2836.dtsi b/src/arm/bcm2836.dtsi index da3deeb42592..61e158003509 100644 --- a/src/arm/bcm2836.dtsi +++ b/src/arm/bcm2836.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "bcm283x.dtsi" / { @@ -36,6 +37,7 @@ cpus: cpus { #address-cells = <1>; #size-cells = <0>; + enable-method = "brcm,bcm2836-smp"; v7_cpu0: cpu@0 { device_type = "cpu"; diff --git a/src/arm/bcm2837-rpi-3-b.dts b/src/arm/bcm2837-rpi-3-b.dts index c72a27d908b6..eb1a28da57e3 100644 --- a/src/arm/bcm2837-rpi-3-b.dts +++ b/src/arm/bcm2837-rpi-3-b.dts @@ -1 +1,57 @@ -#include "arm64/broadcom/bcm2837-rpi-3-b.dts" +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; +#include "bcm2837.dtsi" +#include "bcm2835-rpi.dtsi" +#include "bcm283x-rpi-smsc9514.dtsi" +#include "bcm283x-rpi-usb-host.dtsi" + +/ { + compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; + model = "Raspberry Pi 3 Model B"; + + chosen { + /* 8250 auxiliary UART instead of pl011 */ + stdout-path = "serial1:115200n8"; + }; + + memory { + reg = <0 0x40000000>; + }; + + leds { + act { + gpios = <&gpio 47 0>; + }; + }; +}; + +/* uart0 communicates with the BT module */ +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_gpio32 &gpclk2_gpio43>; + status = "okay"; +}; + +/* uart1 is mapped to the pin header */ +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_gpio14>; + status = "okay"; +}; + +/* SDHCI is used to control the SDIO for wireless */ +&sdhci { + pinctrl-names = "default"; + pinctrl-0 = <&emmc_gpio34>; + status = "okay"; + bus-width = <4>; + non-removable; +}; + +/* SDHOST is used to drive the SD card */ +&sdhost { + pinctrl-names = "default"; + pinctrl-0 = <&sdhost_gpio48>; + status = "okay"; + bus-width = <4>; +}; diff --git a/src/arm64/broadcom/bcm2837.dtsi b/src/arm/bcm2837.dtsi similarity index 96% rename from src/arm64/broadcom/bcm2837.dtsi rename to src/arm/bcm2837.dtsi index 2d5de6f0f78d..bc1cca5cf43c 100644 --- a/src/arm64/broadcom/bcm2837.dtsi +++ b/src/arm/bcm2837.dtsi @@ -30,6 +30,7 @@ cpus: cpus { #address-cells = <1>; #size-cells = <0>; + enable-method = "brcm,bcm2836-smp"; // for ARM 32-bit cpu0: cpu@0 { device_type = "cpu"; diff --git a/src/arm/bcm283x-rpi-smsc9512.dtsi b/src/arm/bcm283x-rpi-smsc9512.dtsi index 9a0599f711ff..967e081cb9c2 100644 --- a/src/arm/bcm283x-rpi-smsc9512.dtsi +++ b/src/arm/bcm283x-rpi-smsc9512.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { aliases { ethernet0 = ðernet; diff --git a/src/arm/bcm283x-rpi-usb-otg.dtsi b/src/arm/bcm283x-rpi-usb-otg.dtsi index e7d217c967a1..e2fd9610e125 100644 --- a/src/arm/bcm283x-rpi-usb-otg.dtsi +++ b/src/arm/bcm283x-rpi-usb-otg.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 &usb { dr_mode = "otg"; g-rx-fifo-size = <256>; diff --git a/src/arm/bcm283x.dtsi b/src/arm/bcm283x.dtsi index 431dcfc900c0..013431e3d7c3 100644 --- a/src/arm/bcm283x.dtsi +++ b/src/arm/bcm283x.dtsi @@ -20,8 +20,13 @@ #address-cells = <1>; #size-cells = <1>; + aliases { + serial0 = &uart0; + serial1 = &uart1; + }; + chosen { - bootargs = "earlyprintk console=ttyAMA0"; + stdout-path = "serial0:115200n8"; }; thermal-zones { diff --git a/src/arm/bcm4708-buffalo-wzr-1750dhp.dts b/src/arm/bcm4708-buffalo-wzr-1750dhp.dts index 62e1427b3f10..8b64caabaad8 100644 --- a/src/arm/bcm4708-buffalo-wzr-1750dhp.dts +++ b/src/arm/bcm4708-buffalo-wzr-1750dhp.dts @@ -52,6 +52,10 @@ usb { label = "bcm53xx:blue:usb"; gpios = <&hc595 0 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ohci_port1>, <&ehci_port1>, + <&xhci_port1>, <&ohci_port2>, + <&ehci_port2>; + linux,default-trigger = "usbport"; }; power0 { diff --git a/src/arm/bcm4708-netgear-r6250.dts b/src/arm/bcm4708-netgear-r6250.dts index a5647efe4118..d7c34fa72b4b 100644 --- a/src/arm/bcm4708-netgear-r6250.dts +++ b/src/arm/bcm4708-netgear-r6250.dts @@ -48,6 +48,9 @@ usb { label = "bcm53xx:blue:usb"; gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>; + trigger-sources = <&ohci_port1>, <&ehci_port1>, + <&xhci_port1>; + linux,default-trigger = "usbport"; }; wireless { diff --git a/src/arm/bcm4708-smartrg-sr400ac.dts b/src/arm/bcm4708-smartrg-sr400ac.dts index 19ee924d7d53..83a4c60bb431 100644 --- a/src/arm/bcm4708-smartrg-sr400ac.dts +++ b/src/arm/bcm4708-smartrg-sr400ac.dts @@ -42,16 +42,22 @@ usb2 { label = "bcm53xx:white:usb2"; gpios = <&chipcommon 3 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ohci_port2>, <&ehci_port2>; + linux,default-trigger = "usbport"; }; usb3-white { label = "bcm53xx:white:usb3"; gpios = <&chipcommon 4 GPIO_ACTIVE_HIGH>; + trigger-sources = <&xhci_port1>; + linux,default-trigger = "usbport"; }; usb3-green { label = "bcm53xx:green:usb3"; gpios = <&chipcommon 5 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ohci_port1>, <&ehci_port1>; + linux,default-trigger = "usbport"; }; wps { diff --git a/src/arm/bcm47081-tplink-archer-c5-v2.dts b/src/arm/bcm47081-tplink-archer-c5-v2.dts index a854a5174b7f..3ed8de42cb48 100644 --- a/src/arm/bcm47081-tplink-archer-c5-v2.dts +++ b/src/arm/bcm47081-tplink-archer-c5-v2.dts @@ -36,6 +36,8 @@ usb2-port1 { label = "bcm53xx:green:usb2-port1"; gpios = <&chipcommon 2 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ohci_port1>, <&ehci_port1>; + linux,default-trigger = "usbport"; }; power { @@ -67,6 +69,8 @@ usb2-port2 { label = "bcm53xx:green:usb2-port2"; gpios = <&chipcommon 13 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ohci_port2>, <&ehci_port2>; + linux,default-trigger = "usbport"; }; }; diff --git a/src/arm/bcm4709-tplink-archer-c9-v1.dts b/src/arm/bcm4709-tplink-archer-c9-v1.dts index 97aa5d59a1d8..ec4a50e440f6 100644 --- a/src/arm/bcm4709-tplink-archer-c9-v1.dts +++ b/src/arm/bcm4709-tplink-archer-c9-v1.dts @@ -46,11 +46,16 @@ usb3 { label = "bcm53xx:blue:usb3"; gpios = <&chipcommon 6 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ohci_port1>, <&ehci_port1>, + <&xhci_port1>; + linux,default-trigger = "usbport"; }; usb2 { label = "bcm53xx:blue:usb2"; gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ohci_port2>, <&ehci_port2>; + linux,default-trigger = "usbport"; }; wan-blue { diff --git a/src/arm/bcm47094-dlink-dir-885l.dts b/src/arm/bcm47094-dlink-dir-885l.dts index 51b0641b5f79..7cc7d344fe5b 100644 --- a/src/arm/bcm47094-dlink-dir-885l.dts +++ b/src/arm/bcm47094-dlink-dir-885l.dts @@ -71,6 +71,9 @@ usb3-white { label = "bcm53xx:white:usb3"; gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>; + trigger-sources = <&ohci_port1>, <&ehci_port1>, + <&xhci_port1>; + linux,default-trigger = "usbport"; }; 2ghz { diff --git a/src/arm/bcm47094-luxul-xwr-3100.dts b/src/arm/bcm47094-luxul-xwr-3100.dts index 5f8621d00c50..bc1d1e10d4ac 100644 --- a/src/arm/bcm47094-luxul-xwr-3100.dts +++ b/src/arm/bcm47094-luxul-xwr-3100.dts @@ -59,6 +59,9 @@ usb3 { label = "bcm53xx:green:usb3"; gpios = <&chipcommon 8 GPIO_ACTIVE_LOW>; + trigger-sources = <&ohci_port1>, <&ehci_port1>, + <&xhci_port1>; + linux,default-trigger = "usbport"; }; status { diff --git a/src/arm/bcm47189-tenda-ac9.dts b/src/arm/bcm47189-tenda-ac9.dts index 34417dac1cd0..19e61b5b066c 100644 --- a/src/arm/bcm47189-tenda-ac9.dts +++ b/src/arm/bcm47189-tenda-ac9.dts @@ -26,6 +26,8 @@ usb { label = "bcm53xx:blue:usb"; gpios = <&chipcommon 1 GPIO_ACTIVE_HIGH>; + trigger-sources = <&ohci_port1>, <&ehci_port1>; + linux,default-trigger = "usbport"; }; wps { diff --git a/src/arm/bcm5301x.dtsi b/src/arm/bcm5301x.dtsi index 98647d22b291..045b9bb857f9 100644 --- a/src/arm/bcm5301x.dtsi +++ b/src/arm/bcm5301x.dtsi @@ -272,6 +272,19 @@ reg = <0x00021000 0x1000>; interrupts = ; phys = <&usb2_phy>; + + #address-cells = <1>; + #size-cells = <0>; + + ehci_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + ehci_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; }; ohci: ohci@22000 { @@ -280,6 +293,19 @@ compatible = "generic-ohci"; reg = <0x00022000 0x1000>; interrupts = ; + + #address-cells = <1>; + #size-cells = <0>; + + ohci_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; + + ohci_port2: port@2 { + reg = <2>; + #trigger-source-cells = <0>; + }; }; }; @@ -300,6 +326,14 @@ interrupts = ; phys = <&usb3_phy>; phy-names = "usb"; + + #address-cells = <1>; + #size-cells = <0>; + + xhci_port1: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; }; }; diff --git a/src/arm/bcm53573.dtsi b/src/arm/bcm53573.dtsi index eae623f76401..c698a565b8ae 100644 --- a/src/arm/bcm53573.dtsi +++ b/src/arm/bcm53573.dtsi @@ -138,10 +138,12 @@ ehci_port1: port@1 { reg = <1>; + #trigger-source-cells = <0>; }; ehci_port2: port@2 { reg = <2>; + #trigger-source-cells = <0>; }; }; @@ -158,10 +160,12 @@ ohci_port1: port@1 { reg = <1>; + #trigger-source-cells = <0>; }; ohci_port2: port@2 { reg = <2>; + #trigger-source-cells = <0>; }; }; }; diff --git a/src/arm/bcm63138.dtsi b/src/arm/bcm63138.dtsi index d0560e8cd6de..43ee992ccdcf 100644 --- a/src/arm/bcm63138.dtsi +++ b/src/arm/bcm63138.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Broadcom BCM63138 DSL SoCs Device Tree */ diff --git a/src/arm/bcm7445-bcm97445svmb.dts b/src/arm/bcm7445-bcm97445svmb.dts index 0bb8d17e4c2d..8006c69a3fdf 100644 --- a/src/arm/bcm7445-bcm97445svmb.dts +++ b/src/arm/bcm7445-bcm97445svmb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "bcm7445.dtsi" diff --git a/src/arm/bcm7445.dtsi b/src/arm/bcm7445.dtsi index 4791321969b3..c859aa6f358c 100644 --- a/src/arm/bcm7445.dtsi +++ b/src/arm/bcm7445.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include "skeleton.dtsi" diff --git a/src/arm/bcm911360_entphn.dts b/src/arm/bcm911360_entphn.dts index 000f5f19215e..53f990defd6a 100644 --- a/src/arm/bcm911360_entphn.dts +++ b/src/arm/bcm911360_entphn.dts @@ -39,9 +39,12 @@ model = "Cygnus Enterprise Phone (BCM911360_ENTPHN)"; compatible = "brcm,bcm11360", "brcm,cygnus"; + aliases { + serial0 = &uart3; + }; + chosen { - stdout-path = &uart3; - bootargs = "console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio_keys { diff --git a/src/arm/bcm947189acdbmr.dts b/src/arm/bcm947189acdbmr.dts new file mode 100644 index 000000000000..ef263412fea5 --- /dev/null +++ b/src/arm/bcm947189acdbmr.dts @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2017 Broadcom + * Author: Florian Fainelli + * + * Licensed under the ISC license. + */ + +/dts-v1/; + +#include "bcm53573.dtsi" + +/ { + compatible = "brcm,bcm947189acdbmr", "brcm,bcm47189", "brcm,bcm53573"; + model = "Broadcom BCM947189ACDBMR"; + + chosen { + bootargs = "console=ttyS0,115200 earlycon"; + }; + + memory { + reg = <0x00000000 0x08000000>; + }; + + leds { + compatible = "gpio-leds"; + + wps { + label = "bcm53xx:blue:wps"; + gpios = <&chipcommon 10 GPIO_ACTIVE_HIGH>; + }; + + 5ghz { + label = "bcm53xx:blue:5ghz"; + gpios = <&chipcommon 11 GPIO_ACTIVE_HIGH>; + }; + + 2ghz { + label = "bcm53xx:blue:2ghz"; + gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + + restart { + label = "Reset"; + linux,code = ; + gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>; + }; + + wps { + label = "WPS"; + linux,code = ; + gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>; + }; + }; + + spi { + compatible = "spi-gpio"; + num-chipselects = <1>; + gpio-sck = <&chipcommon 21 0>; + gpio-miso = <&chipcommon 22 0>; + gpio-mosi = <&chipcommon 23 0>; + cs-gpios = <&chipcommon 24 0>; + #address-cells = <1>; + #size-cells = <0>; + + /* External BCM6802 MoCA chip is connected */ + }; +}; + +&pcie0 { + ranges = <0x00000000 0 0 0 0 0x00100000>; + #address-cells = <3>; + #size-cells = <2>; + + bridge@0,0,0 { + reg = <0x0000 0 0 0 0>; + ranges = <0x00000000 0 0 0 0 0 0 0x00100000>; + #address-cells = <3>; + #size-cells = <2>; + + wifi@0,1,0 { + reg = <0x0000 0 0 0 0>; + ranges = <0x00000000 0 0 0 0x00100000>; + #address-cells = <1>; + #size-cells = <1>; + }; + }; +}; + +&usb2 { + vcc-gpio = <&chipcommon 8 GPIO_ACTIVE_HIGH>; +}; diff --git a/src/arm/bcm958522er.dts b/src/arm/bcm958522er.dts index f5c42962c201..f9dd342cc2ae 100644 --- a/src/arm/bcm958522er.dts +++ b/src/arm/bcm958522er.dts @@ -170,3 +170,11 @@ &uart0 { status = "okay"; }; + +&usb3_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; diff --git a/src/arm/bcm958525er.dts b/src/arm/bcm958525er.dts index efcb1f67bdad..374508a9cfbf 100644 --- a/src/arm/bcm958525er.dts +++ b/src/arm/bcm958525er.dts @@ -182,3 +182,11 @@ &uart0 { status = "okay"; }; + +&usb3_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; diff --git a/src/arm/bcm958525xmc.dts b/src/arm/bcm958525xmc.dts index b335ce02e32f..403250c5ad8e 100644 --- a/src/arm/bcm958525xmc.dts +++ b/src/arm/bcm958525xmc.dts @@ -202,3 +202,11 @@ &uart0 { status = "okay"; }; + +&usb3_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; diff --git a/src/arm/bcm958622hr.dts b/src/arm/bcm958622hr.dts index 16ab2d82a14b..fd8b8c689ffe 100644 --- a/src/arm/bcm958622hr.dts +++ b/src/arm/bcm958622hr.dts @@ -219,3 +219,11 @@ &uart0 { status = "okay"; }; + +&usb3_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; diff --git a/src/arm/bcm958623hr.dts b/src/arm/bcm958623hr.dts index 9b921c6aa8f8..3bc50849d013 100644 --- a/src/arm/bcm958623hr.dts +++ b/src/arm/bcm958623hr.dts @@ -227,3 +227,11 @@ &uart0 { status = "okay"; }; + +&usb3_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; diff --git a/src/arm/bcm958625hr.dts b/src/arm/bcm958625hr.dts index 006b08e41a3b..d94d14b3c745 100644 --- a/src/arm/bcm958625hr.dts +++ b/src/arm/bcm958625hr.dts @@ -229,3 +229,11 @@ &uart0 { status = "okay"; }; + +&usb3_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; diff --git a/src/arm/bcm958625k.dts b/src/arm/bcm958625k.dts index 64740f85cf4c..2cf2392483b2 100644 --- a/src/arm/bcm958625k.dts +++ b/src/arm/bcm958625k.dts @@ -264,3 +264,11 @@ &uart1 { status = "okay"; }; + +&usb3_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; diff --git a/src/arm/bcm963138dvt.dts b/src/arm/bcm963138dvt.dts index 370aa2cfddf2..c61673638fa8 100644 --- a/src/arm/bcm963138dvt.dts +++ b/src/arm/bcm963138dvt.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Broadcom BCM63138 Reference Board DTS */ diff --git a/src/arm/da850-evm.dts b/src/arm/da850-evm.dts index 67e72bc72e80..c75507922f7d 100644 --- a/src/arm/da850-evm.dts +++ b/src/arm/da850-evm.dts @@ -15,6 +15,13 @@ compatible = "ti,da850-evm", "ti,da850"; model = "DA850/AM1808/OMAP-L138 EVM"; + aliases { + serial0 = &serial0; + serial1 = &serial1; + serial2 = &serial2; + ethernet0 = ð0; + }; + soc@1c00000 { pmx_core: pinmux@14120 { status = "okay"; diff --git a/src/arm/da850-lego-ev3.dts b/src/arm/da850-lego-ev3.dts index 45983c04a8a7..413dbd5d9f64 100644 --- a/src/arm/da850-lego-ev3.dts +++ b/src/arm/da850-lego-ev3.dts @@ -249,6 +249,15 @@ 0x4c 0x00000080 0x000000f0 >; }; + + ev3_lcd_pins: pinmux_lcd { + pinctrl-single,bits = < + /* SIMO, GP2[11], GP2[12], CLK */ + 0x14 0x00188100 0x00ffff00 + /* GP5[0] */ + 0x30 0x80000000 0xf0000000 + >; + }; }; &pinconf { @@ -357,6 +366,21 @@ }; }; +&spi1 { + status = "okay"; + pinctrl-0 = <&ev3_lcd_pins>; + pinctrl-names = "default"; + cs-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + + display@0{ + compatible = "lego,ev3-lcd"; + reg = <0>; + spi-max-frequency = <10000000>; + a0-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>; + }; +}; + &ehrpwm0 { status = "okay"; }; diff --git a/src/arm/dove-cubox-es.dts b/src/arm/dove-cubox-es.dts index e28ef056dd17..ad361ec1361d 100644 --- a/src/arm/dove-cubox-es.dts +++ b/src/arm/dove-cubox-es.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "dove-cubox.dts" / { diff --git a/src/arm/dove-cubox.dts b/src/arm/dove-cubox.dts index af3cb633135f..580e3cbcfbf7 100644 --- a/src/arm/dove-cubox.dts +++ b/src/arm/dove-cubox.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "dove.dtsi" diff --git a/src/arm/dove-d2plug.dts b/src/arm/dove-d2plug.dts index c11d3636c8e5..273f12ca2512 100644 --- a/src/arm/dove-d2plug.dts +++ b/src/arm/dove-d2plug.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "dove.dtsi" diff --git a/src/arm/dove-d3plug.dts b/src/arm/dove-d3plug.dts index f5f59bb5a534..826026c28f90 100644 --- a/src/arm/dove-d3plug.dts +++ b/src/arm/dove-d3plug.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "dove.dtsi" @@ -88,7 +89,7 @@ &pcie { status = "okay"; /* Fresco Logic USB3.0 xHCI controller */ - pcie-port@0 { + pcie@1 { status = "okay"; reset-gpios = <&gpio0 26 1>; reset-delay-us = <20000>; @@ -96,7 +97,7 @@ pinctrl-names = "default"; }; /* Mini-PCIe slot */ - pcie-port@1 { + pcie@2 { status = "okay"; reset-gpios = <&gpio0 25 1>; }; diff --git a/src/arm/dove-dove-db.dts b/src/arm/dove-dove-db.dts index bb725dca3a10..1754a62e014e 100644 --- a/src/arm/dove-dove-db.dts +++ b/src/arm/dove-dove-db.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "dove.dtsi" diff --git a/src/arm/dove.dtsi b/src/arm/dove.dtsi index 698d58cea20d..f4a07bb7c3a2 100644 --- a/src/arm/dove.dtsi +++ b/src/arm/dove.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /include/ "skeleton.dtsi" #include @@ -89,7 +90,7 @@ MBUS_ID(0x03, 0x01) 0 0xc8000000 0x0100000 /* CESA SRAM 1M */ MBUS_ID(0x0d, 0x00) 0 0xf0000000 0x0100000>; /* PMU SRAM 1M */ - pcie: pcie-controller { + pcie: pcie { compatible = "marvell,dove-pcie"; status = "disabled"; device_type = "pci"; @@ -106,7 +107,7 @@ 0x82000000 0x2 0x0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 Mem */ 0x81000000 0x2 0x0 MBUS_ID(0x08, 0xe0) 0 1 0>; /* Port 1.0 I/O */ - pcie0: pcie-port@0 { + pcie0: pcie@1 { device_type = "pci"; status = "disabled"; assigned-addresses = <0x82000800 0 0x40000 0 0x2000>; @@ -118,13 +119,14 @@ #size-cells = <2>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &intc 16>; }; - pcie1: pcie-port@1 { + pcie1: pcie@2 { device_type = "pci"; status = "disabled"; assigned-addresses = <0x82002800 0 0x80000 0 0x2000>; @@ -136,6 +138,7 @@ #size-cells = <2>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0>; diff --git a/src/arm/dra7-evm-common.dtsi b/src/arm/dra7-evm-common.dtsi new file mode 100644 index 000000000000..343e95f9a001 --- /dev/null +++ b/src/arm/dra7-evm-common.dtsi @@ -0,0 +1,258 @@ +/* + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include + +/ { + chosen { + stdout-path = &uart1; + }; + + extcon_usb1: extcon_usb1 { + compatible = "linux,extcon-usb-gpio"; + id-gpio = <&pcf_gpio_21 1 GPIO_ACTIVE_HIGH>; + }; + + sound0: sound0 { + compatible = "simple-audio-card"; + simple-audio-card,name = "DRA7xx-EVM"; + simple-audio-card,widgets = + "Headphone", "Headphone Jack", + "Line", "Line Out", + "Microphone", "Mic Jack", + "Line", "Line In"; + simple-audio-card,routing = + "Headphone Jack", "HPLOUT", + "Headphone Jack", "HPROUT", + "Line Out", "LLOUT", + "Line Out", "RLOUT", + "MIC3L", "Mic Jack", + "MIC3R", "Mic Jack", + "Mic Jack", "Mic Bias", + "LINE1L", "Line In", + "LINE1R", "Line In"; + simple-audio-card,format = "dsp_b"; + simple-audio-card,bitclock-master = <&sound0_master>; + simple-audio-card,frame-master = <&sound0_master>; + simple-audio-card,bitclock-inversion; + + sound0_master: simple-audio-card,cpu { + sound-dai = <&mcasp3>; + system-clock-frequency = <5644800>; + }; + + simple-audio-card,codec { + sound-dai = <&tlv320aic3106>; + clocks = <&atl_clkin2_ck>; + }; + }; + + leds { + compatible = "gpio-leds"; + led0 { + label = "dra7:usr1"; + gpios = <&pcf_lcd 4 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led1 { + label = "dra7:usr2"; + gpios = <&pcf_lcd 5 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led2 { + label = "dra7:usr3"; + gpios = <&pcf_lcd 6 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led3 { + label = "dra7:usr4"; + gpios = <&pcf_lcd 7 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + autorepeat; + + USER1 { + label = "btnUser1"; + linux,code = ; + gpios = <&pcf_lcd 2 GPIO_ACTIVE_LOW>; + }; + + USER2 { + label = "btnUser2"; + linux,code = ; + gpios = <&pcf_lcd 3 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&i2c3 { + status = "okay"; + clock-frequency = <400000>; +}; + +&mcspi1 { + status = "okay"; +}; + +&mcspi2 { + status = "okay"; +}; + +&uart1 { + status = "okay"; + interrupts-extended = <&crossbar_mpu GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, + <&dra7_pmx_core 0x3e0>; +}; + +&uart2 { + status = "okay"; +}; + +&uart3 { + status = "okay"; +}; + +&qspi { + status = "okay"; + + spi-max-frequency = <76800000>; + m25p80@0 { + compatible = "s25fl256s1"; + spi-max-frequency = <76800000>; + reg = <0>; + spi-tx-bus-width = <1>; + spi-rx-bus-width = <4>; + #address-cells = <1>; + #size-cells = <1>; + + /* MTD partition table. + * The ROM checks the first four physical blocks + * for a valid file to boot and the flash here is + * 64KiB block size. + */ + partition@0 { + label = "QSPI.SPL"; + reg = <0x00000000 0x000010000>; + }; + partition@1 { + label = "QSPI.SPL.backup1"; + reg = <0x00010000 0x00010000>; + }; + partition@2 { + label = "QSPI.SPL.backup2"; + reg = <0x00020000 0x00010000>; + }; + partition@3 { + label = "QSPI.SPL.backup3"; + reg = <0x00030000 0x00010000>; + }; + partition@4 { + label = "QSPI.u-boot"; + reg = <0x00040000 0x00100000>; + }; + partition@5 { + label = "QSPI.u-boot-spl-os"; + reg = <0x00140000 0x00080000>; + }; + partition@6 { + label = "QSPI.u-boot-env"; + reg = <0x001c0000 0x00010000>; + }; + partition@7 { + label = "QSPI.u-boot-env.backup1"; + reg = <0x001d0000 0x0010000>; + }; + partition@8 { + label = "QSPI.kernel"; + reg = <0x001e0000 0x0800000>; + }; + partition@9 { + label = "QSPI.file-system"; + reg = <0x009e0000 0x01620000>; + }; + }; +}; + +&omap_dwc3_1 { + extcon = <&extcon_usb1>; +}; + +&usb1 { + dr_mode = "otg"; + extcon = <&extcon_usb1>; +}; + +&usb2 { + dr_mode = "host"; +}; + +&atl { + assigned-clocks = <&abe_dpll_sys_clk_mux>, + <&atl_gfclk_mux>, + <&dpll_abe_ck>, + <&dpll_abe_m2x2_ck>, + <&atl_clkin2_ck>; + assigned-clock-parents = <&sys_clkin2>, <&dpll_abe_m2_ck>; + assigned-clock-rates = <0>, <0>, <180633600>, <361267200>, <5644800>; + + status = "okay"; + + atl2 { + bws = ; + aws = ; + }; +}; + +&mcasp3 { + #sound-dai-cells = <0>; + + assigned-clocks = <&mcasp3_ahclkx_mux>; + assigned-clock-parents = <&atl_clkin2_ck>; + + status = "okay"; + + op-mode = <0>; /* MCASP_IIS_MODE */ + tdm-slots = <2>; + /* 4 serializer */ + serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ + 1 2 0 0 + >; + tx-num-evt = <32>; + rx-num-evt = <32>; +}; + +&mailbox5 { + status = "okay"; + mbox_ipu1_ipc3x: mbox_ipu1_ipc3x { + status = "okay"; + }; + mbox_dsp1_ipc3x: mbox_dsp1_ipc3x { + status = "okay"; + }; +}; + +&mailbox6 { + status = "okay"; + mbox_ipu2_ipc3x: mbox_ipu2_ipc3x { + status = "okay"; + }; + mbox_dsp2_ipc3x: mbox_dsp2_ipc3x { + status = "okay"; + }; +}; diff --git a/src/arm/dra7-evm.dts b/src/arm/dra7-evm.dts index f47fc4daf062..aa426dabb6c3 100644 --- a/src/arm/dra7-evm.dts +++ b/src/arm/dra7-evm.dts @@ -8,9 +8,8 @@ /dts-v1/; #include "dra74x.dtsi" -#include -#include -#include +#include "dra7-evm-common.dtsi" +#include "dra74x-mmc-iodelay.dtsi" / { model = "TI DRA742"; @@ -21,8 +20,12 @@ reg = <0x0 0x80000000 0x0 0x60000000>; /* 1536 MB */ }; - chosen { - stdout-path = &uart1; + evm_1v8_sw: fixedregulator-evm_1v8 { + compatible = "regulator-fixed"; + regulator-name = "evm_1v8"; + vin-supply = <&smps9_reg>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; }; evm_3v3_sd: fixedregulator-sd { @@ -51,11 +54,6 @@ regulator-max-microvolt = <1800000>; }; - extcon_usb1: extcon_usb1 { - compatible = "linux,extcon-usb-gpio"; - id-gpio = <&pcf_gpio_21 1 GPIO_ACTIVE_HIGH>; - }; - extcon_usb2: extcon_usb2 { compatible = "linux,extcon-usb-gpio"; id-gpio = <&pcf_gpio_21 2 GPIO_ACTIVE_HIGH>; @@ -73,85 +71,6 @@ gpio = <&gpio7 11 GPIO_ACTIVE_HIGH>; }; - sound0: sound0 { - compatible = "simple-audio-card"; - simple-audio-card,name = "DRA7xx-EVM"; - simple-audio-card,widgets = - "Headphone", "Headphone Jack", - "Line", "Line Out", - "Microphone", "Mic Jack", - "Line", "Line In"; - simple-audio-card,routing = - "Headphone Jack", "HPLOUT", - "Headphone Jack", "HPROUT", - "Line Out", "LLOUT", - "Line Out", "RLOUT", - "MIC3L", "Mic Jack", - "MIC3R", "Mic Jack", - "Mic Jack", "Mic Bias", - "LINE1L", "Line In", - "LINE1R", "Line In"; - simple-audio-card,format = "dsp_b"; - simple-audio-card,bitclock-master = <&sound0_master>; - simple-audio-card,frame-master = <&sound0_master>; - simple-audio-card,bitclock-inversion; - - sound0_master: simple-audio-card,cpu { - sound-dai = <&mcasp3>; - system-clock-frequency = <5644800>; - }; - - simple-audio-card,codec { - sound-dai = <&tlv320aic3106>; - clocks = <&atl_clkin2_ck>; - }; - }; - - leds { - compatible = "gpio-leds"; - led0 { - label = "dra7:usr1"; - gpios = <&pcf_lcd 4 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led1 { - label = "dra7:usr2"; - gpios = <&pcf_lcd 5 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led2 { - label = "dra7:usr3"; - gpios = <&pcf_lcd 6 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - - led3 { - label = "dra7:usr4"; - gpios = <&pcf_lcd 7 GPIO_ACTIVE_LOW>; - default-state = "off"; - }; - }; - - gpio_keys { - compatible = "gpio-keys"; - #address-cells = <1>; - #size-cells = <0>; - autorepeat; - - USER1 { - label = "btnUser1"; - linux,code = ; - gpios = <&pcf_lcd 2 GPIO_ACTIVE_LOW>; - }; - - USER2 { - label = "btnUser2"; - linux,code = ; - gpios = <&pcf_lcd 3 GPIO_ACTIVE_LOW>; - }; - }; }; &dra7_pmx_core { @@ -406,137 +325,49 @@ }; }; -&i2c3 { - status = "okay"; - clock-frequency = <400000>; -}; - -&mcspi1 { - status = "okay"; -}; - -&mcspi2 { - status = "okay"; -}; - -&uart1 { - status = "okay"; - interrupts-extended = <&crossbar_mpu GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>, - <&dra7_pmx_core 0x3e0>; -}; - -&uart2 { - status = "okay"; -}; - -&uart3 { - status = "okay"; -}; - &mmc1 { status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&mmc1_pins_default>; vmmc-supply = <&evm_3v3_sd>; - vmmc_aux-supply = <&ldo1_reg>; + vqmmc-supply = <&ldo1_reg>; bus-width = <4>; /* * SDCD signal is not being used here - using the fact that GPIO mode * is always hardwired. */ cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; + pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50-rev11", "sdr104-rev11", "ddr50", "sdr104"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_hs>; + pinctrl-2 = <&mmc1_pins_sdr12>; + pinctrl-3 = <&mmc1_pins_sdr25>; + pinctrl-4 = <&mmc1_pins_sdr50>; + pinctrl-5 = <&mmc1_pins_ddr50 &mmc1_iodelay_ddr_rev11_conf>; + pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev11_conf>; + pinctrl-7 = <&mmc1_pins_ddr50 &mmc1_iodelay_ddr_rev20_conf>; + pinctrl-8 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev20_conf>; }; &mmc2 { status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&mmc2_pins_default>; - vmmc-supply = <&evm_3v3_sw>; + vmmc-supply = <&evm_1v8_sw>; bus-width = <8>; + pinctrl-names = "default", "hs", "ddr_1_8v-rev11", "ddr_1_8v", "hs200_1_8v-rev11", "hs200_1_8v"; + pinctrl-0 = <&mmc2_pins_default>; + pinctrl-1 = <&mmc2_pins_hs>; + pinctrl-2 = <&mmc2_pins_ddr_1_8v_rev11 &mmc2_iodelay_ddr_1_8v_rev11_conf>; + pinctrl-3 = <&mmc2_pins_ddr_rev20>; + pinctrl-4 = <&mmc2_pins_hs200 &mmc2_iodelay_hs200_rev11_conf>; + pinctrl-5 = <&mmc2_pins_hs200 &mmc2_iodelay_hs200_rev20_conf>; }; &cpu0 { cpu0-supply = <&smps123_reg>; }; -&qspi { - status = "okay"; - - spi-max-frequency = <76800000>; - m25p80@0 { - compatible = "s25fl256s1"; - spi-max-frequency = <76800000>; - reg = <0>; - spi-tx-bus-width = <1>; - spi-rx-bus-width = <4>; - #address-cells = <1>; - #size-cells = <1>; - - /* MTD partition table. - * The ROM checks the first four physical blocks - * for a valid file to boot and the flash here is - * 64KiB block size. - */ - partition@0 { - label = "QSPI.SPL"; - reg = <0x00000000 0x000010000>; - }; - partition@1 { - label = "QSPI.SPL.backup1"; - reg = <0x00010000 0x00010000>; - }; - partition@2 { - label = "QSPI.SPL.backup2"; - reg = <0x00020000 0x00010000>; - }; - partition@3 { - label = "QSPI.SPL.backup3"; - reg = <0x00030000 0x00010000>; - }; - partition@4 { - label = "QSPI.u-boot"; - reg = <0x00040000 0x00100000>; - }; - partition@5 { - label = "QSPI.u-boot-spl-os"; - reg = <0x00140000 0x00080000>; - }; - partition@6 { - label = "QSPI.u-boot-env"; - reg = <0x001c0000 0x00010000>; - }; - partition@7 { - label = "QSPI.u-boot-env.backup1"; - reg = <0x001d0000 0x0010000>; - }; - partition@8 { - label = "QSPI.kernel"; - reg = <0x001e0000 0x0800000>; - }; - partition@9 { - label = "QSPI.file-system"; - reg = <0x009e0000 0x01620000>; - }; - }; -}; - -&omap_dwc3_1 { - extcon = <&extcon_usb1>; -}; - &omap_dwc3_2 { extcon = <&extcon_usb2>; }; -&usb1 { - dr_mode = "otg"; - extcon = <&extcon_usb1>; -}; - -&usb2 { - dr_mode = "host"; -}; - &elm { status = "okay"; }; @@ -556,6 +387,7 @@ interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ <1 IRQ_TYPE_NONE>; /* termcount */ rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 pin */ + ti,nand-xfer-type = "prefetch-dma"; ti,nand-ecc-opt = "bch8"; ti,elm-id = <&elm>; nand-bus-width = <16>; @@ -666,57 +498,6 @@ pinctrl-2 = <&dcan1_pins_default>; }; -&atl { - assigned-clocks = <&abe_dpll_sys_clk_mux>, - <&atl_gfclk_mux>, - <&dpll_abe_ck>, - <&dpll_abe_m2x2_ck>, - <&atl_clkin2_ck>; - assigned-clock-parents = <&sys_clkin2>, <&dpll_abe_m2_ck>; - assigned-clock-rates = <0>, <0>, <180633600>, <361267200>, <5644800>; - +&pcie1_rc { status = "okay"; - - atl2 { - bws = ; - aws = ; - }; -}; - -&mcasp3 { - #sound-dai-cells = <0>; - - assigned-clocks = <&mcasp3_ahclkx_mux>; - assigned-clock-parents = <&atl_clkin2_ck>; - - status = "okay"; - - op-mode = <0>; /* MCASP_IIS_MODE */ - tdm-slots = <2>; - /* 4 serializer */ - serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ - 1 2 0 0 - >; - tx-num-evt = <32>; - rx-num-evt = <32>; -}; - -&mailbox5 { - status = "okay"; - mbox_ipu1_ipc3x: mbox_ipu1_ipc3x { - status = "okay"; - }; - mbox_dsp1_ipc3x: mbox_dsp1_ipc3x { - status = "okay"; - }; -}; - -&mailbox6 { - status = "okay"; - mbox_ipu2_ipc3x: mbox_ipu2_ipc3x { - status = "okay"; - }; - mbox_dsp2_ipc3x: mbox_dsp2_ipc3x { - status = "okay"; - }; }; diff --git a/src/arm/dra7.dtsi b/src/arm/dra7.dtsi index 0f0f6f58bd18..02a136a4661a 100644 --- a/src/arm/dra7.dtsi +++ b/src/arm/dra7.dtsi @@ -196,6 +196,7 @@ scm_conf1: scm_conf@1c04 { compatible = "syscon"; reg = <0x1c04 0x0020>; + #syscon-cells = <2>; }; scm_conf_pcie: scm_conf@1c24 { @@ -287,7 +288,11 @@ #address-cells = <1>; ranges = <0x51000000 0x51000000 0x3000 0x0 0x20000000 0x10000000>; - pcie1: pcie@51000000 { + /** + * To enable PCI endpoint mode, disable the pcie1_rc + * node and enable pcie1_ep mode. + */ + pcie1_rc: pcie@51000000 { compatible = "ti,dra7-pcie"; reg = <0x51000000 0x2000>, <0x51002000 0x14c>, <0x1000 0x2000>; reg-names = "rc_dbics", "ti_conf", "config"; @@ -309,12 +314,28 @@ <0 0 0 2 &pcie1_intc 2>, <0 0 0 3 &pcie1_intc 3>, <0 0 0 4 &pcie1_intc 4>; + status = "disabled"; pcie1_intc: interrupt-controller { interrupt-controller; #address-cells = <0>; #interrupt-cells = <1>; }; }; + + pcie1_ep: pcie_ep@51000000 { + compatible = "ti,dra7-pcie-ep"; + reg = <0x51000000 0x28>, <0x51002000 0x14c>, <0x51001000 0x28>, <0x1000 0x10000000>; + reg-names = "ep_dbics", "ti_conf", "ep_dbics2", "addr_space"; + interrupts = <0 232 0x4>; + num-lanes = <1>; + num-ib-windows = <4>; + num-ob-windows = <16>; + ti,hwmods = "pcie1"; + phys = <&pcie1_phy>; + phy-names = "pcie-phy0"; + ti,syscon-unaligned-access = <&scm_conf1 0x14 2>; + status = "disabled"; + }; }; axi@1 { @@ -418,6 +439,14 @@ reg = <0x40d00000 0x100>; }; + dra7_iodelay_core: padconf@4844a000 { + compatible = "ti,dra7-iodelay"; + reg = <0x4844a000 0x0d1c>; + #address-cells = <1>; + #size-cells = <0>; + #pinctrl-cells = <2>; + }; + sdma: dma-controller@4a056000 { compatible = "ti,omap4430-sdma"; reg = <0x4a056000 0x1000>; @@ -1037,6 +1066,7 @@ dma-names = "tx", "rx"; status = "disabled"; pbias-supply = <&pbias_mmc_reg>; + max-frequency = <192000000>; }; mmc2: mmc@480b4000 { @@ -1048,6 +1078,7 @@ dmas = <&sdma_xbar 47>, <&sdma_xbar 48>; dma-names = "tx", "rx"; status = "disabled"; + max-frequency = <192000000>; }; mmc3: mmc@480ad000 { @@ -1059,6 +1090,8 @@ dmas = <&sdma_xbar 77>, <&sdma_xbar 78>; dma-names = "tx", "rx"; status = "disabled"; + /* Errata i887 limits max-frequency of MMC3 to 64 MHz */ + max-frequency = <64000000>; }; mmc4: mmc@480d1000 { @@ -1070,6 +1103,7 @@ dmas = <&sdma_xbar 57>, <&sdma_xbar 58>; dma-names = "tx", "rx"; status = "disabled"; + max-frequency = <192000000>; }; mmu0_dsp1: mmu@40d01000 { diff --git a/src/arm/dra71-evm.dts b/src/arm/dra71-evm.dts index a6298eb56978..41c9132eb550 100644 --- a/src/arm/dra71-evm.dts +++ b/src/arm/dra71-evm.dts @@ -7,6 +7,7 @@ */ #include "dra72-evm-common.dtsi" +#include "dra72x-mmc-iodelay.dtsi" #include / { @@ -32,6 +33,16 @@ 3000000 0x1>; }; + evm_1v8_sw: fixedregulator-evm_1v8 { + compatible = "regulator-fixed"; + regulator-name = "evm_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&lp8732_buck0_reg>; + regulator-always-on; + regulator-boot-on; + }; + poweroff: gpio-poweroff { compatible = "gpio-poweroff"; gpios = <&gpio7 30 GPIO_ACTIVE_HIGH>; @@ -162,7 +173,24 @@ }; &mmc1 { - vmmc_aux-supply = <&vpo_sd_1v8_3v3>; + pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_hs>; + pinctrl-2 = <&mmc1_pins_sdr12>; + pinctrl-3 = <&mmc1_pins_sdr25>; + pinctrl-4 = <&mmc1_pins_sdr50>; + pinctrl-5 = <&mmc1_pins_ddr50_rev20 &mmc1_iodelay_ddr50_conf>; + pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev20_conf>; + vqmmc-supply = <&vpo_sd_1v8_3v3>; +}; + +&mmc2 { + pinctrl-names = "default", "hs", "ddr_1_8v", "hs200_1_8v"; + pinctrl-0 = <&mmc2_pins_default>; + pinctrl-1 = <&mmc2_pins_hs>; + pinctrl-2 = <&mmc2_pins_ddr_rev20 &mmc2_iodelay_ddr_conf>; + pinctrl-3 = <&mmc2_pins_hs200 &mmc2_iodelay_hs200_rev20_conf>; + vmmc-supply = <&evm_1v8_sw>; }; &mac { @@ -191,6 +219,7 @@ ti,tx-internal-delay = ; ti,fifo-depth = ; ti,min-output-impedance; + ti,dp83867-rxctrl-strap-quirk; }; dp83867_1: ethernet-phy@3 { @@ -199,6 +228,7 @@ ti,tx-internal-delay = ; ti,fifo-depth = ; ti,min-output-impedance; + ti,dp83867-rxctrl-strap-quirk; }; }; diff --git a/src/arm/dra72-evm-common.dtsi b/src/arm/dra72-evm-common.dtsi index 85780549bc26..2e485a13dfd7 100644 --- a/src/arm/dra72-evm-common.dtsi +++ b/src/arm/dra72-evm-common.dtsi @@ -311,6 +311,7 @@ interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ <1 IRQ_TYPE_NONE>; /* termcount */ rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 pin */ + ti,nand-xfer-type = "prefetch-dma"; ti,nand-ecc-opt = "bch8"; ti,elm-id = <&elm>; nand-bus-width = <16>; @@ -419,8 +420,6 @@ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins_default>; - - vmmc-supply = <&evm_3v3_sw>; bus-width = <8>; ti,non-removable; max-frequency = <192000000>; @@ -564,3 +563,7 @@ status = "okay"; }; }; + +&pcie1_rc { + status = "okay"; +}; diff --git a/src/arm/dra72-evm-revc.dts b/src/arm/dra72-evm-revc.dts index 3ecac56bf504..bf588d00728d 100644 --- a/src/arm/dra72-evm-revc.dts +++ b/src/arm/dra72-evm-revc.dts @@ -6,6 +6,7 @@ * published by the Free Software Foundation. */ #include "dra72-evm-common.dtsi" +#include "dra72x-mmc-iodelay.dtsi" #include / { @@ -15,6 +16,16 @@ device_type = "memory"; reg = <0x0 0x80000000 0x0 0x80000000>; /* 2GB */ }; + + evm_1v8_sw: fixedregulator-evm_1v8 { + compatible = "regulator-fixed"; + regulator-name = "evm_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&smps4_reg>; + regulator-always-on; + regulator-boot-on; + }; }; &i2c1 { @@ -70,6 +81,7 @@ ti,min-output-impedance; interrupt-parent = <&gpio6>; interrupts = <16 IRQ_TYPE_EDGE_FALLING>; + ti,dp83867-rxctrl-strap-quirk; }; dp83867_1: ethernet-phy@3 { @@ -80,5 +92,27 @@ ti,min-output-impedance; interrupt-parent = <&gpio6>; interrupts = <16 IRQ_TYPE_EDGE_FALLING>; + ti,dp83867-rxctrl-strap-quirk; }; }; + +&mmc1 { + pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_hs>; + pinctrl-2 = <&mmc1_pins_sdr12>; + pinctrl-3 = <&mmc1_pins_sdr25>; + pinctrl-4 = <&mmc1_pins_sdr50>; + pinctrl-5 = <&mmc1_pins_ddr50_rev20 &mmc1_iodelay_ddr50_conf>; + pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev20_conf>; + vqmmc-supply = <&ldo1_reg>; +}; + +&mmc2 { + pinctrl-names = "default", "hs", "ddr_1_8v", "hs200_1_8v"; + pinctrl-0 = <&mmc2_pins_default>; + pinctrl-1 = <&mmc2_pins_hs>; + pinctrl-2 = <&mmc2_pins_ddr_rev20 &mmc2_iodelay_ddr_conf>; + pinctrl-3 = <&mmc2_pins_hs200 &mmc2_iodelay_hs200_rev20_conf>; + vmmc-supply = <&evm_1v8_sw>; +}; diff --git a/src/arm/dra72-evm-tps65917.dtsi b/src/arm/dra72-evm-tps65917.dtsi index e6df676886c0..57bfe5caf5e4 100644 --- a/src/arm/dra72-evm-tps65917.dtsi +++ b/src/arm/dra72-evm-tps65917.dtsi @@ -146,5 +146,5 @@ }; &mmc1 { - vmmc_aux-supply = <&ldo1_reg>; + vqmmc-supply = <&ldo1_reg>; }; diff --git a/src/arm/dra72-evm.dts b/src/arm/dra72-evm.dts index cd9c4ff12654..c572693b1665 100644 --- a/src/arm/dra72-evm.dts +++ b/src/arm/dra72-evm.dts @@ -6,6 +6,7 @@ * published by the Free Software Foundation. */ #include "dra72-evm-common.dtsi" +#include "dra72x-mmc-iodelay.dtsi" / { model = "TI DRA722"; @@ -13,6 +14,16 @@ device_type = "memory"; reg = <0x0 0x80000000 0x0 0x40000000>; /* 1024 MB */ }; + + evm_1v8_sw: fixedregulator-evm_1v8 { + compatible = "regulator-fixed"; + regulator-name = "evm_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&smps4_reg>; + regulator-always-on; + regulator-boot-on; + }; }; &i2c1 { @@ -43,3 +54,24 @@ phy_id = <&davinci_mdio>, <3>; phy-mode = "rgmii"; }; + +&mmc1 { + pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50", "ddr50", "sdr104"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_hs>; + pinctrl-2 = <&mmc1_pins_sdr12>; + pinctrl-3 = <&mmc1_pins_sdr25>; + pinctrl-4 = <&mmc1_pins_sdr50>; + pinctrl-5 = <&mmc1_pins_ddr50_rev10>; + pinctrl-6 = <&mmc1_pins_sdr104 &mmc1_iodelay_sdr104_rev10_conf>; + vqmmc-supply = <&ldo1_reg>; +}; + +&mmc2 { + pinctrl-names = "default", "hs", "ddr_1_8v", "hs200_1_8v"; + pinctrl-0 = <&mmc2_pins_default>; + pinctrl-1 = <&mmc2_pins_hs>; + pinctrl-2 = <&mmc2_pins_ddr_rev10>; + pinctrl-3 = <&mmc2_pins_hs200 &mmc2_iodelay_hs200_rev10_conf>; + vmmc-supply = <&evm_1v8_sw>; +}; diff --git a/src/arm/dra72x-mmc-iodelay.dtsi b/src/arm/dra72x-mmc-iodelay.dtsi new file mode 100644 index 000000000000..088013c6dc6e --- /dev/null +++ b/src/arm/dra72x-mmc-iodelay.dtsi @@ -0,0 +1,350 @@ +/* + * MMC IOdelay values for TI's DRA72x, DRA71x and AM571x SoCs. + * + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +/* + * Rules for modifying this file: + * a) Update of this file should typically correspond to a datamanual revision. + * Datamanual revision that was used should be updated in comment below. + * If there is no update to datamanual, do not update the values. If you + * need to use values different from that recommended by the datamanual + * for your design, then you should consider adding values to the device- + * -tree file for your board directly. + * b) We keep the mode names as close to the datamanual as possible. So + * if the manual calls a mode, DDR50, or DDR or DDR 1.8v or DDR 3.3v, + * we follow that in code too. + * c) If the values change between multiple revisions of silicon, we add + * a revision tag to both the new and old entry. Use 'rev10' for PG 1.0, + * 'rev20' for PG 2.0 and so on. + * d) The node name and node label should be the exact same string. This is + * to curb naming creativity and achieve consistency. + * e) If in future, DRA71x and DRA72x values differ, then add 'dra71_' and + * 'dra72_' tag to entries. Both the new and old entries should gain a tag. + * + * Datamanual Revisions: + * + * AM571x Silicon Revision 2.0: SPRS957D, Revised January 2017 + * AM571x Silicon Revision 1.0: SPRS919M, Revised November 2017 + * DRA71x : SPRS960B, Revised February 2017 + */ + +&dra7_pmx_core { + mmc1_pins_default: mmc1_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_sdr12: mmc1_pins_sdr12 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_hs: mmc1_pins_hs { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_sdr25: mmc1_pins_sdr25 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_sdr50: mmc1_pins_sdr50 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE15 | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE15 | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE15 | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE15 | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE15 | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE15 | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_ddr50_rev10: mmc1_pins_ddr50_rev10 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE14 | MUX_MODE0) /* mmc1_clk.mmc1_clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE14 | MUX_MODE0) /* mmc1_cmd.mmc1_cmd */ + DRA7XX_CORE_IOPAD(0x375C, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE14 | MUX_MODE0) /* mmc1_dat0.mmc1_dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE14 | MUX_MODE0) /* mmc1_dat1.mmc1_dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE14 | MUX_MODE0) /* mmc1_dat2.mmc1_dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE14 | MUX_MODE0) /* mmc1_dat3.mmc1_dat3 */ + >; + }; + + mmc1_pins_ddr50_rev20: mmc1_pins_ddr50_rev20 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_sdr104: mmc1_pins_sdr104 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc2_pins_default: mmc2_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; + + mmc2_pins_hs: mmc2_pins_hs { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; + + mmc2_pins_ddr_rev10: mmc2_pins_ddr_rev10 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + >; + }; + + mmc2_pins_ddr_rev20: mmc2_pins_ddr_rev20 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; + + mmc2_pins_hs200: mmc2_pins_hs200 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; +}; + +&dra7_iodelay_core { + + /* Corresponds to MMC1_MANUAL1 in datamanual */ + mmc1_iodelay_ddr50_conf: mmc1_iodelay_ddr50_conf { + pinctrl-pin-array = < + 0x618 A_DELAY_PS(588) G_DELAY_PS(0) /* CFG_MMC1_CLK_IN */ + 0x624 A_DELAY_PS(1000) G_DELAY_PS(0) /* CFG_MMC1_CMD_IN */ + 0x630 A_DELAY_PS(1375) G_DELAY_PS(0) /* CFG_MMC1_DAT0_IN */ + 0x63C A_DELAY_PS(1000) G_DELAY_PS(0) /* CFG_MMC1_DAT1_IN */ + 0x648 A_DELAY_PS(1000) G_DELAY_PS(0) /* CFG_MMC1_DAT2_IN */ + 0x654 A_DELAY_PS(1000) G_DELAY_PS(0) /* CFG_MMC1_DAT3_IN */ + 0x620 A_DELAY_PS(1230) G_DELAY_PS(0) /* CFG_MMC1_CLK_OUT */ + 0x62C A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OUT */ + 0x638 A_DELAY_PS(56) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OUT */ + 0x644 A_DELAY_PS(76) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OUT */ + 0x650 A_DELAY_PS(91) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OUT */ + 0x65C A_DELAY_PS(99) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OUT */ + 0x628 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OEN */ + 0x634 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OEN */ + 0x640 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OEN */ + 0x64C A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OEN */ + 0x658 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OEN */ + >; + }; + + /* Corresponds to MMC1_MANUAL2 in datamanual */ + mmc1_iodelay_sdr104_rev10_conf: mmc1_iodelay_sdr104_rev10_conf { + pinctrl-pin-array = < + 0x620 A_DELAY_PS(560) G_DELAY_PS(365) /* CFG_MMC1_CLK_OUT */ + 0x62c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OUT */ + 0x638 A_DELAY_PS(29) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OUT */ + 0x644 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OUT */ + 0x650 A_DELAY_PS(47) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OUT */ + 0x65c A_DELAY_PS(30) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OUT */ + 0x628 A_DELAY_PS(125) G_DELAY_PS(0) /* CFG_MMC1_CMD_OEN */ + 0x634 A_DELAY_PS(43) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OEN */ + 0x640 A_DELAY_PS(433) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OEN */ + 0x64c A_DELAY_PS(287) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OEN */ + 0x658 A_DELAY_PS(351) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OEN */ + >; + }; + + /* Corresponds to MMC1_MANUAL2 in datamanual */ + mmc1_iodelay_sdr104_rev20_conf: mmc1_iodelay_sdr104_rev20_conf { + pinctrl-pin-array = < + 0x620 A_DELAY_PS(520) G_DELAY_PS(320) /* CFG_MMC1_CLK_OUT */ + 0x62c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OUT */ + 0x638 A_DELAY_PS(40) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OUT */ + 0x644 A_DELAY_PS(83) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OUT */ + 0x650 A_DELAY_PS(98) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OUT */ + 0x65c A_DELAY_PS(106) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OUT */ + 0x628 A_DELAY_PS(51) G_DELAY_PS(0) /* CFG_MMC1_CMD_OEN */ + 0x634 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OEN */ + 0x640 A_DELAY_PS(363) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OEN */ + 0x64c A_DELAY_PS(199) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OEN */ + 0x658 A_DELAY_PS(273) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OEN */ + >; + }; + + /* Corresponds to MMC2_MANUAL1 in datamanual */ + mmc2_iodelay_ddr_conf: mmc2_iodelay_ddr_conf { + pinctrl-pin-array = < + 0x18c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A19_IN */ + 0x1a4 A_DELAY_PS(119) G_DELAY_PS(0) /* CFG_GPMC_A20_IN */ + 0x1b0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A21_IN */ + 0x1bc A_DELAY_PS(18) G_DELAY_PS(0) /* CFG_GPMC_A22_IN */ + 0x1c8 A_DELAY_PS(894) G_DELAY_PS(0) /* CFG_GPMC_A23_IN */ + 0x1d4 A_DELAY_PS(30) G_DELAY_PS(0) /* CFG_GPMC_A24_IN */ + 0x1e0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_IN */ + 0x1ec A_DELAY_PS(23) G_DELAY_PS(0) /* CFG_GPMC_A26_IN */ + 0x1f8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_IN */ + 0x360 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_CS1_IN */ + 0x194 A_DELAY_PS(152) G_DELAY_PS(0) /* CFG_GPMC_A19_OUT */ + 0x1ac A_DELAY_PS(206) G_DELAY_PS(0) /* CFG_GPMC_A20_OUT */ + 0x1b8 A_DELAY_PS(78) G_DELAY_PS(0) /* CFG_GPMC_A21_OUT */ + 0x1c4 A_DELAY_PS(2) G_DELAY_PS(0) /* CFG_GPMC_A22_OUT */ + 0x1d0 A_DELAY_PS(266) G_DELAY_PS(0) /* CFG_GPMC_A23_OUT */ + 0x1dc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OUT */ + 0x1e8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_OUT */ + 0x1f4 A_DELAY_PS(43) G_DELAY_PS(0) /* CFG_GPMC_A26_OUT */ + 0x200 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_OUT */ + 0x368 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_CS1_OUT */ + 0x190 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A19_OEN */ + 0x1a8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A20_OEN */ + 0x1b4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A21_OEN */ + 0x1c0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A22_OEN */ + 0x1d8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OEN */ + 0x1e4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_OEN */ + 0x1f0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A26_OEN */ + 0x1fc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_OEN */ + 0x364 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_CS1_OEN */ + >; + }; + + /* Corresponds to MMC2_MANUAL3 in datamanual */ + mmc2_iodelay_hs200_rev10_conf: mmc2_iodelay_hs200_rev10_conf { + pinctrl-pin-array = < + 0x194 A_DELAY_PS(150) G_DELAY_PS(95) /* CFG_GPMC_A19_OUT */ + 0x1ac A_DELAY_PS(250) G_DELAY_PS(0) /* CFG_GPMC_A20_OUT */ + 0x1b8 A_DELAY_PS(125) G_DELAY_PS(0) /* CFG_GPMC_A21_OUT */ + 0x1c4 A_DELAY_PS(100) G_DELAY_PS(0) /* CFG_GPMC_A22_OUT */ + 0x1d0 A_DELAY_PS(870) G_DELAY_PS(415) /* CFG_GPMC_A23_OUT */ + 0x1dc A_DELAY_PS(30) G_DELAY_PS(0) /* CFG_GPMC_A24_OUT */ + 0x1e8 A_DELAY_PS(200) G_DELAY_PS(0) /* CFG_GPMC_A25_OUT */ + 0x1f4 A_DELAY_PS(200) G_DELAY_PS(0) /* CFG_GPMC_A26_OUT */ + 0x200 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_OUT */ + 0x368 A_DELAY_PS(240) G_DELAY_PS(0) /* CFG_GPMC_CS1_OUT */ + 0x190 A_DELAY_PS(695) G_DELAY_PS(0) /* CFG_GPMC_A19_OEN */ + 0x1a8 A_DELAY_PS(924) G_DELAY_PS(0) /* CFG_GPMC_A20_OEN */ + 0x1b4 A_DELAY_PS(719) G_DELAY_PS(0) /* CFG_GPMC_A21_OEN */ + 0x1c0 A_DELAY_PS(824) G_DELAY_PS(0) /* CFG_GPMC_A22_OEN */ + 0x1d8 A_DELAY_PS(877) G_DELAY_PS(0) /* CFG_GPMC_A24_OEN */ + 0x1e4 A_DELAY_PS(446) G_DELAY_PS(0) /* CFG_GPMC_A25_OEN */ + 0x1f0 A_DELAY_PS(847) G_DELAY_PS(0) /* CFG_GPMC_A26_OEN */ + 0x1fc A_DELAY_PS(586) G_DELAY_PS(0) /* CFG_GPMC_A27_OEN */ + 0x364 A_DELAY_PS(1039) G_DELAY_PS(0) /* CFG_GPMC_CS1_OEN */ + >; + }; + + /* Corresponds to MMC2_MANUAL3 in datamanual */ + mmc2_iodelay_hs200_rev20_conf: mmc2_iodelay_hs200_rev20_conf { + pinctrl-pin-array = < + 0x194 A_DELAY_PS(285) G_DELAY_PS(0) /* CFG_GPMC_A19_OUT */ + 0x1ac A_DELAY_PS(189) G_DELAY_PS(0) /* CFG_GPMC_A20_OUT */ + 0x1b8 A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A21_OUT */ + 0x1c4 A_DELAY_PS(0) G_DELAY_PS(70) /* CFG_GPMC_A22_OUT */ + 0x1d0 A_DELAY_PS(730) G_DELAY_PS(360) /* CFG_GPMC_A23_OUT */ + 0x1dc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OUT */ + 0x1e8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_OUT */ + 0x1f4 A_DELAY_PS(70) G_DELAY_PS(0) /* CFG_GPMC_A26_OUT */ + 0x200 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_OUT */ + 0x368 A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_CS1_OUT */ + 0x190 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A19_OEN */ + 0x1a8 A_DELAY_PS(231) G_DELAY_PS(0) /* CFG_GPMC_A20_OEN */ + 0x1b4 A_DELAY_PS(39) G_DELAY_PS(0) /* CFG_GPMC_A21_OEN */ + 0x1c0 A_DELAY_PS(91) G_DELAY_PS(0) /* CFG_GPMC_A22_OEN */ + 0x1d8 A_DELAY_PS(176) G_DELAY_PS(0) /* CFG_GPMC_A24_OEN */ + 0x1e4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_OEN */ + 0x1f0 A_DELAY_PS(101) G_DELAY_PS(0) /* CFG_GPMC_A26_OEN */ + 0x1fc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_OEN */ + 0x364 A_DELAY_PS(360) G_DELAY_PS(0) /* CFG_GPMC_CS1_OEN */ + >; + }; +}; diff --git a/src/arm/dra74x-mmc-iodelay.dtsi b/src/arm/dra74x-mmc-iodelay.dtsi new file mode 100644 index 000000000000..28ebb4eb884a --- /dev/null +++ b/src/arm/dra74x-mmc-iodelay.dtsi @@ -0,0 +1,647 @@ +/* + * MMC IOdelay values for TI's DRA74x, DRA75x and AM572x SoCs. + * + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +/* + * Rules for modifying this file: + * a) Update of this file should typically correspond to a datamanual revision. + * Datamanual revision that was used should be updated in comment below. + * If there is no update to datamanual, do not update the values. If you + * need to use values different from that recommended by the datamanual + * for your design, then you should consider adding values to the device- + * -tree file for your board directly. + * b) We keep the mode names as close to the datamanual as possible. So + * if the manual calls a mode, DDR50, or DDR or DDR 1.8v or DDR 3.3v, + * we follow that in code too. + * c) If the values change between multiple revisions of silicon, we add + * a revision tag to both the new and old entry. Use 'rev11' for PG 1.1, + * 'rev20' for PG 2.0 and so on. + * d) The node name and node label should be the exact same string. This is + * to curb naming creativity and achieve consistency. + * + * Datamanual Revisions: + * + * AM572x Silicon Revision 2.0: SPRS953B, Revised November 2016 + * AM572x Silicon Revision 1.1: SPRS915R, Revised November 2016 + * + */ + +&dra7_pmx_core { + mmc1_pins_default: mmc1_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_sdr12: mmc1_pins_sdr12 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_hs: mmc1_pins_hs { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_sdr25: mmc1_pins_sdr25 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE11 | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_sdr50: mmc1_pins_sdr50 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_VIRTUAL_MODE10 | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_ddr50: mmc1_pins_ddr50 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_sdr104: mmc1_pins_sdr104 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc2_pins_default: mmc2_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; + + mmc2_pins_hs: mmc2_pins_hs { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; + + mmc2_pins_ddr_3_3v_rev11: mmc2_pins_ddr_3_3v_rev11 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; + + mmc2_pins_ddr_1_8v_rev11: mmc2_pins_ddr_1_8v_rev11 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; + + mmc2_pins_ddr_rev20: mmc2_pins_ddr_rev20 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; + + mmc2_pins_hs200: mmc2_pins_hs200 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; + + mmc4_pins_default: mmc4_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x37e8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_ctsn.mmc4_clk */ + DRA7XX_CORE_IOPAD(0x37ec, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_rtsn.mmc4_cmd */ + DRA7XX_CORE_IOPAD(0x37f0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rxd.mmc4_dat0 */ + DRA7XX_CORE_IOPAD(0x37f4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_txd.mmc4_dat1 */ + DRA7XX_CORE_IOPAD(0x37f8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_ctsn.mmc4_dat2 */ + DRA7XX_CORE_IOPAD(0x37fc, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rtsn.mmc4_dat3 */ + >; + }; + + mmc4_pins_hs: mmc4_pins_hs { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x37e8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_ctsn.mmc4_clk */ + DRA7XX_CORE_IOPAD(0x37ec, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_rtsn.mmc4_cmd */ + DRA7XX_CORE_IOPAD(0x37f0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rxd.mmc4_dat0 */ + DRA7XX_CORE_IOPAD(0x37f4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_txd.mmc4_dat1 */ + DRA7XX_CORE_IOPAD(0x37f8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_ctsn.mmc4_dat2 */ + DRA7XX_CORE_IOPAD(0x37fc, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rtsn.mmc4_dat3 */ + >; + }; + + mmc3_pins_default: mmc3_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x377c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_clk.mmc3_clk */ + DRA7XX_CORE_IOPAD(0x3780, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_cmd.mmc3_cmd */ + DRA7XX_CORE_IOPAD(0x3784, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat0.mmc3_dat0 */ + DRA7XX_CORE_IOPAD(0x3788, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat1.mmc3_dat1 */ + DRA7XX_CORE_IOPAD(0x378c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat2.mmc3_dat2 */ + DRA7XX_CORE_IOPAD(0x3790, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat3.mmc3_dat3 */ + >; + }; + + mmc3_pins_hs: mmc3_pins_hs { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x377c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_clk.mmc3_clk */ + DRA7XX_CORE_IOPAD(0x3780, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_cmd.mmc3_cmd */ + DRA7XX_CORE_IOPAD(0x3784, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat0.mmc3_dat0 */ + DRA7XX_CORE_IOPAD(0x3788, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat1.mmc3_dat1 */ + DRA7XX_CORE_IOPAD(0x378c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat2.mmc3_dat2 */ + DRA7XX_CORE_IOPAD(0x3790, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat3.mmc3_dat3 */ + >; + }; + + mmc3_pins_sdr12: mmc3_pins_sdr12 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x377c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_clk.mmc3_clk */ + DRA7XX_CORE_IOPAD(0x3780, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_cmd.mmc3_cmd */ + DRA7XX_CORE_IOPAD(0x3784, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat0.mmc3_dat0 */ + DRA7XX_CORE_IOPAD(0x3788, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat1.mmc3_dat1 */ + DRA7XX_CORE_IOPAD(0x378c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat2.mmc3_dat2 */ + DRA7XX_CORE_IOPAD(0x3790, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat3.mmc3_dat3 */ + >; + }; + + mmc3_pins_sdr25: mmc3_pins_sdr25 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x377c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_clk.mmc3_clk */ + DRA7XX_CORE_IOPAD(0x3780, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_cmd.mmc3_cmd */ + DRA7XX_CORE_IOPAD(0x3784, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat0.mmc3_dat0 */ + DRA7XX_CORE_IOPAD(0x3788, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat1.mmc3_dat1 */ + DRA7XX_CORE_IOPAD(0x378c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat2.mmc3_dat2 */ + DRA7XX_CORE_IOPAD(0x3790, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat3.mmc3_dat3 */ + >; + }; + + mmc3_pins_sdr50: mmc3_pins_sdr50 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x377c, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_clk.mmc3_clk */ + DRA7XX_CORE_IOPAD(0x3780, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_cmd.mmc3_cmd */ + DRA7XX_CORE_IOPAD(0x3784, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_dat0.mmc3_dat0 */ + DRA7XX_CORE_IOPAD(0x3788, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_dat1.mmc3_dat1 */ + DRA7XX_CORE_IOPAD(0x378c, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_dat2.mmc3_dat2 */ + DRA7XX_CORE_IOPAD(0x3790, (PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE0)) /* mmc3_dat3.mmc3_dat3 */ + >; + }; + + mmc4_pins_sdr12: mmc4_pins_sdr12 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x37e8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_ctsn.mmc4_clk */ + DRA7XX_CORE_IOPAD(0x37ec, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_rtsn.mmc4_cmd */ + DRA7XX_CORE_IOPAD(0x37f0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rxd.mmc4_dat0 */ + DRA7XX_CORE_IOPAD(0x37f4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_txd.mmc4_dat1 */ + DRA7XX_CORE_IOPAD(0x37f8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_ctsn.mmc4_dat2 */ + DRA7XX_CORE_IOPAD(0x37fc, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rtsn.mmc4_dat3 */ + >; + }; + + mmc4_pins_sdr25: mmc4_pins_sdr25 { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x37e8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_ctsn.mmc4_clk */ + DRA7XX_CORE_IOPAD(0x37ec, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart1_rtsn.mmc4_cmd */ + DRA7XX_CORE_IOPAD(0x37f0, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rxd.mmc4_dat0 */ + DRA7XX_CORE_IOPAD(0x37f4, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_txd.mmc4_dat1 */ + DRA7XX_CORE_IOPAD(0x37f8, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_ctsn.mmc4_dat2 */ + DRA7XX_CORE_IOPAD(0x37fc, PIN_INPUT_PULLUP | MODE_SELECT | MUX_MODE3) /* uart2_rtsn.mmc4_dat3 */ + >; + }; +}; + +&dra7_iodelay_core { + + /* Corresponds to MMC1_DDR_MANUAL1 in datamanual */ + mmc1_iodelay_ddr_rev11_conf: mmc1_iodelay_ddr_rev11_conf { + pinctrl-pin-array = < + 0x618 A_DELAY_PS(572) G_DELAY_PS(540) /* CFG_MMC1_CLK_IN */ + 0x620 A_DELAY_PS(1525) G_DELAY_PS(0) /* CFG_MMC1_CLK_OUT */ + 0x624 A_DELAY_PS(0) G_DELAY_PS(600) /* CFG_MMC1_CMD_IN */ + 0x628 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OEN */ + 0x62c A_DELAY_PS(55) G_DELAY_PS(0) /* CFG_MMC1_CMD_OUT */ + 0x630 A_DELAY_PS(403) G_DELAY_PS(120) /* CFG_MMC1_DAT0_IN */ + 0x634 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OEN */ + 0x638 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OUT */ + 0x63c A_DELAY_PS(23) G_DELAY_PS(60) /* CFG_MMC1_DAT1_IN */ + 0x640 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OEN */ + 0x644 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OUT */ + 0x648 A_DELAY_PS(25) G_DELAY_PS(60) /* CFG_MMC1_DAT2_IN */ + 0x64c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OEN */ + 0x650 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OUT */ + 0x654 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_IN */ + 0x658 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OEN */ + 0x65c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OUT */ + >; + }; + + /* Corresponds to MMC1_DDR_MANUAL1 in datamanual */ + mmc1_iodelay_ddr_rev20_conf: mmc1_iodelay_ddr50_rev20_conf { + pinctrl-pin-array = < + 0x618 A_DELAY_PS(1076) G_DELAY_PS(330) /* CFG_MMC1_CLK_IN */ + 0x620 A_DELAY_PS(1271) G_DELAY_PS(0) /* CFG_MMC1_CLK_OUT */ + 0x624 A_DELAY_PS(722) G_DELAY_PS(0) /* CFG_MMC1_CMD_IN */ + 0x628 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OEN */ + 0x62C A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OUT */ + 0x630 A_DELAY_PS(751) G_DELAY_PS(0) /* CFG_MMC1_DAT0_IN */ + 0x634 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OEN */ + 0x638 A_DELAY_PS(20) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OUT */ + 0x63C A_DELAY_PS(256) G_DELAY_PS(0) /* CFG_MMC1_DAT1_IN */ + 0x640 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OEN */ + 0x644 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OUT */ + 0x648 A_DELAY_PS(263) G_DELAY_PS(0) /* CFG_MMC1_DAT2_IN */ + 0x64C A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OEN */ + 0x650 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OUT */ + 0x654 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_IN */ + 0x658 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OEN */ + 0x65C A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OUT */ + >; + }; + + /* Corresponds to MMC1_SDR104_MANUAL1 in datamanual */ + mmc1_iodelay_sdr104_rev11_conf: mmc1_iodelay_sdr104_rev11_conf { + pinctrl-pin-array = < + 0x620 A_DELAY_PS(1063) G_DELAY_PS(17) /* CFG_MMC1_CLK_OUT */ + 0x628 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OEN */ + 0x62c A_DELAY_PS(23) G_DELAY_PS(0) /* CFG_MMC1_CMD_OUT */ + 0x634 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OEN */ + 0x638 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OUT */ + 0x640 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OEN */ + 0x644 A_DELAY_PS(2) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OUT */ + 0x64c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OEN */ + 0x650 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OUT */ + 0x658 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OEN */ + 0x65c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OUT */ + >; + }; + + /* Corresponds to MMC1_SDR104_MANUAL1 in datamanual */ + mmc1_iodelay_sdr104_rev20_conf: mmc1_iodelay_sdr104_rev20_conf { + pinctrl-pin-array = < + 0x620 A_DELAY_PS(600) G_DELAY_PS(400) /* CFG_MMC1_CLK_OUT */ + 0x628 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OEN */ + 0x62c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_CMD_OUT */ + 0x634 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OEN */ + 0x638 A_DELAY_PS(30) G_DELAY_PS(0) /* CFG_MMC1_DAT0_OUT */ + 0x640 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OEN */ + 0x644 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT1_OUT */ + 0x64c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OEN */ + 0x650 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT2_OUT */ + 0x658 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OEN */ + 0x65c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC1_DAT3_OUT */ + >; + }; + + /* Corresponds to MMC2_HS200_MANUAL1 in datamanual */ + mmc2_iodelay_hs200_rev11_conf: mmc2_iodelay_hs200_rev11_conf { + pinctrl-pin-array = < + 0x190 A_DELAY_PS(621) G_DELAY_PS(600) /* CFG_GPMC_A19_OEN */ + 0x194 A_DELAY_PS(300) G_DELAY_PS(0) /* CFG_GPMC_A19_OUT */ + 0x1a8 A_DELAY_PS(739) G_DELAY_PS(600) /* CFG_GPMC_A20_OEN */ + 0x1ac A_DELAY_PS(240) G_DELAY_PS(0) /* CFG_GPMC_A20_OUT */ + 0x1b4 A_DELAY_PS(812) G_DELAY_PS(600) /* CFG_GPMC_A21_OEN */ + 0x1b8 A_DELAY_PS(240) G_DELAY_PS(0) /* CFG_GPMC_A21_OUT */ + 0x1c0 A_DELAY_PS(954) G_DELAY_PS(600) /* CFG_GPMC_A22_OEN */ + 0x1c4 A_DELAY_PS(60) G_DELAY_PS(0) /* CFG_GPMC_A22_OUT */ + 0x1d0 A_DELAY_PS(1340) G_DELAY_PS(420) /* CFG_GPMC_A23_OUT */ + 0x1d8 A_DELAY_PS(935) G_DELAY_PS(600) /* CFG_GPMC_A24_OEN */ + 0x1dc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OUT */ + 0x1e4 A_DELAY_PS(525) G_DELAY_PS(600) /* CFG_GPMC_A25_OEN */ + 0x1e8 A_DELAY_PS(120) G_DELAY_PS(0) /* CFG_GPMC_A25_OUT */ + 0x1f0 A_DELAY_PS(767) G_DELAY_PS(600) /* CFG_GPMC_A26_OEN */ + 0x1f4 A_DELAY_PS(225) G_DELAY_PS(0) /* CFG_GPMC_A26_OUT */ + 0x1fc A_DELAY_PS(565) G_DELAY_PS(600) /* CFG_GPMC_A27_OEN */ + 0x200 A_DELAY_PS(60) G_DELAY_PS(0) /* CFG_GPMC_A27_OUT */ + 0x364 A_DELAY_PS(969) G_DELAY_PS(600) /* CFG_GPMC_CS1_OEN */ + 0x368 A_DELAY_PS(180) G_DELAY_PS(0) /* CFG_GPMC_CS1_OUT */ + >; + }; + + /* Corresponds to MMC2_HS200_MANUAL1 in datamanual */ + mmc2_iodelay_hs200_rev20_conf: mmc2_iodelay_hs200_rev20_conf { + pinctrl-pin-array = < + 0x190 A_DELAY_PS(274) G_DELAY_PS(0) /* CFG_GPMC_A19_OEN */ + 0x194 A_DELAY_PS(162) G_DELAY_PS(0) /* CFG_GPMC_A19_OUT */ + 0x1a8 A_DELAY_PS(401) G_DELAY_PS(0) /* CFG_GPMC_A20_OEN */ + 0x1ac A_DELAY_PS(73) G_DELAY_PS(0) /* CFG_GPMC_A20_OUT */ + 0x1b4 A_DELAY_PS(465) G_DELAY_PS(0) /* CFG_GPMC_A21_OEN */ + 0x1b8 A_DELAY_PS(115) G_DELAY_PS(0) /* CFG_GPMC_A21_OUT */ + 0x1c0 A_DELAY_PS(633) G_DELAY_PS(0) /* CFG_GPMC_A22_OEN */ + 0x1c4 A_DELAY_PS(47) G_DELAY_PS(0) /* CFG_GPMC_A22_OUT */ + 0x1d0 A_DELAY_PS(935) G_DELAY_PS(280) /* CFG_GPMC_A23_OUT */ + 0x1d8 A_DELAY_PS(621) G_DELAY_PS(0) /* CFG_GPMC_A24_OEN */ + 0x1dc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OUT */ + 0x1e4 A_DELAY_PS(183) G_DELAY_PS(0) /* CFG_GPMC_A25_OEN */ + 0x1e8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_OUT */ + 0x1f0 A_DELAY_PS(467) G_DELAY_PS(0) /* CFG_GPMC_A26_OEN */ + 0x1f4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A26_OUT */ + 0x1fc A_DELAY_PS(262) G_DELAY_PS(0) /* CFG_GPMC_A27_OEN */ + 0x200 A_DELAY_PS(46) G_DELAY_PS(0) /* CFG_GPMC_A27_OUT */ + 0x364 A_DELAY_PS(684) G_DELAY_PS(0) /* CFG_GPMC_CS1_OEN */ + 0x368 A_DELAY_PS(76) G_DELAY_PS(0) /* CFG_GPMC_CS1_OUT */ + >; + }; + + /* Correspnds to MMC2_DDR_3V3_MANUAL1 in datamanual */ + mmc2_iodelay_ddr_3_3v_rev11_conf: mmc2_iodelay_ddr_3_3v_rev11_conf { + pinctrl-pin-array = < + 0x18c A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A19_IN */ + 0x190 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A19_OEN */ + 0x194 A_DELAY_PS(174) G_DELAY_PS(0) /* CFG_GPMC_A19_OUT */ + 0x1a4 A_DELAY_PS(265) G_DELAY_PS(360) /* CFG_GPMC_A20_IN */ + 0x1a8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A20_OEN */ + 0x1ac A_DELAY_PS(168) G_DELAY_PS(0) /* CFG_GPMC_A20_OUT */ + 0x1b0 A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A21_IN */ + 0x1b4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A21_OEN */ + 0x1b8 A_DELAY_PS(136) G_DELAY_PS(0) /* CFG_GPMC_A21_OUT */ + 0x1bc A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A22_IN */ + 0x1c0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A22_OEN */ + 0x1c4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A22_OUT */ + 0x1c8 A_DELAY_PS(287) G_DELAY_PS(420) /* CFG_GPMC_A23_IN */ + 0x1d0 A_DELAY_PS(879) G_DELAY_PS(0) /* CFG_GPMC_A23_OUT */ + 0x1d4 A_DELAY_PS(144) G_DELAY_PS(240) /* CFG_GPMC_A24_IN */ + 0x1d8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OEN */ + 0x1dc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OUT */ + 0x1e0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_IN */ + 0x1e4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_OEN */ + 0x1e8 A_DELAY_PS(34) G_DELAY_PS(0) /* CFG_GPMC_A25_OUT */ + 0x1ec A_DELAY_PS(0) G_DELAY_PS(120) /* CFG_GPMC_A26_IN */ + 0x1f0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A26_OEN */ + 0x1f4 A_DELAY_PS(120) G_DELAY_PS(0) /* CFG_GPMC_A26_OUT */ + 0x1f8 A_DELAY_PS(120) G_DELAY_PS(180) /* CFG_GPMC_A27_IN */ + 0x1fc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_OEN */ + 0x200 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_OUT */ + 0x360 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_CS1_IN */ + 0x364 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_CS1_OEN */ + 0x368 A_DELAY_PS(11) G_DELAY_PS(0) /* CFG_GPMC_CS1_OUT */ + >; + }; + + /* Corresponds to MMC2_DDR_1V8_MANUAL1 in datamanual */ + mmc2_iodelay_ddr_1_8v_rev11_conf: mmc2_iodelay_ddr_1_8v_rev11_conf { + pinctrl-pin-array = < + 0x18c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A19_IN */ + 0x190 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A19_OEN */ + 0x194 A_DELAY_PS(174) G_DELAY_PS(0) /* CFG_GPMC_A19_OUT */ + 0x1a4 A_DELAY_PS(274) G_DELAY_PS(240) /* CFG_GPMC_A20_IN */ + 0x1a8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A20_OEN */ + 0x1ac A_DELAY_PS(168) G_DELAY_PS(0) /* CFG_GPMC_A20_OUT */ + 0x1b0 A_DELAY_PS(0) G_DELAY_PS(60) /* CFG_GPMC_A21_IN */ + 0x1b4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A21_OEN */ + 0x1b8 A_DELAY_PS(136) G_DELAY_PS(0) /* CFG_GPMC_A21_OUT */ + 0x1bc A_DELAY_PS(0) G_DELAY_PS(60) /* CFG_GPMC_A22_IN */ + 0x1c0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A22_OEN */ + 0x1c4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A22_OUT */ + 0x1c8 A_DELAY_PS(514) G_DELAY_PS(360) /* CFG_GPMC_A23_IN */ + 0x1d0 A_DELAY_PS(879) G_DELAY_PS(0) /* CFG_GPMC_A23_OUT */ + 0x1d4 A_DELAY_PS(187) G_DELAY_PS(120) /* CFG_GPMC_A24_IN */ + 0x1d8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OEN */ + 0x1dc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A24_OUT */ + 0x1e0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_IN */ + 0x1e4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A25_OEN */ + 0x1e8 A_DELAY_PS(34) G_DELAY_PS(0) /* CFG_GPMC_A25_OUT */ + 0x1ec A_DELAY_PS(0) G_DELAY_PS(60) /* CFG_GPMC_A26_IN */ + 0x1f0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A26_OEN */ + 0x1f4 A_DELAY_PS(120) G_DELAY_PS(0) /* CFG_GPMC_A26_OUT */ + 0x1f8 A_DELAY_PS(121) G_DELAY_PS(60) /* CFG_GPMC_A27_IN */ + 0x1fc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_OEN */ + 0x200 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_A27_OUT */ + 0x360 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_CS1_IN */ + 0x364 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_GPMC_CS1_OEN */ + 0x368 A_DELAY_PS(11) G_DELAY_PS(0) /* CFG_GPMC_CS1_OUT */ + >; + }; + + /* Corresponds to MMC3_MANUAL1 in datamanual */ + mmc3_iodelay_manual1_rev20_conf: mmc3_iodelay_manual1_conf { + pinctrl-pin-array = < + 0x678 A_DELAY_PS(0) G_DELAY_PS(386) /* CFG_MMC3_CLK_IN */ + 0x680 A_DELAY_PS(605) G_DELAY_PS(0) /* CFG_MMC3_CLK_OUT */ + 0x684 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_IN */ + 0x688 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_OEN */ + 0x68c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_OUT */ + 0x690 A_DELAY_PS(171) G_DELAY_PS(0) /* CFG_MMC3_DAT0_IN */ + 0x694 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT0_OEN */ + 0x698 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT0_OUT */ + 0x69c A_DELAY_PS(221) G_DELAY_PS(0) /* CFG_MMC3_DAT1_IN */ + 0x6a0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT1_OEN */ + 0x6a4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT1_OUT */ + 0x6a8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_IN */ + 0x6ac A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_OEN */ + 0x6b0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_OUT */ + 0x6b4 A_DELAY_PS(474) G_DELAY_PS(0) /* CFG_MMC3_DAT3_IN */ + 0x6b8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT3_OEN */ + 0x6bc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT3_OUT */ + >; + }; + + /* Corresponds to MMC3_MANUAL1 in datamanual */ + mmc3_iodelay_manual1_rev11_conf: mmc3_iodelay_manual1_conf { + pinctrl-pin-array = < + 0x678 A_DELAY_PS(406) G_DELAY_PS(0) /* CFG_MMC3_CLK_IN */ + 0x680 A_DELAY_PS(659) G_DELAY_PS(0) /* CFG_MMC3_CLK_OUT */ + 0x684 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_IN */ + 0x688 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_OEN */ + 0x68c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_CMD_OUT */ + 0x690 A_DELAY_PS(130) G_DELAY_PS(0) /* CFG_MMC3_DAT0_IN */ + 0x694 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT0_OEN */ + 0x698 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT0_OUT */ + 0x69c A_DELAY_PS(169) G_DELAY_PS(0) /* CFG_MMC3_DAT1_IN */ + 0x6a0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT1_OEN */ + 0x6a4 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT1_OUT */ + 0x6a8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_IN */ + 0x6ac A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_OEN */ + 0x6b0 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT2_OUT */ + 0x6b4 A_DELAY_PS(457) G_DELAY_PS(0) /* CFG_MMC3_DAT3_IN */ + 0x6b8 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT3_OEN */ + 0x6bc A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_MMC3_DAT3_OUT */ + >; + }; + + /* Corresponds to MMC4_DS_MANUAL1 in datamanual */ + mmc4_iodelay_ds_rev11_conf: mmc4_iodelay_ds_rev11_conf { + pinctrl-pin-array = < + 0x840 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_CTSN_IN */ + 0x848 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_CTSN_OUT */ + 0x84c A_DELAY_PS(96) G_DELAY_PS(0) /* CFG_UART1_RTSN_IN */ + 0x850 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OEN */ + 0x854 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OUT */ + 0x870 A_DELAY_PS(582) G_DELAY_PS(0) /* CFG_UART2_CTSN_IN */ + 0x874 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OEN */ + 0x878 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OUT */ + 0x87c A_DELAY_PS(391) G_DELAY_PS(0) /* CFG_UART2_RTSN_IN */ + 0x880 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OEN */ + 0x884 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OUT */ + 0x888 A_DELAY_PS(561) G_DELAY_PS(0) /* CFG_UART2_RXD_IN */ + 0x88c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OEN */ + 0x890 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OUT */ + 0x894 A_DELAY_PS(588) G_DELAY_PS(0) /* CFG_UART2_TXD_IN */ + 0x898 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OEN */ + 0x89c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OUT */ + >; + }; + + /* Corresponds to MMC4_DS_MANUAL1 in datamanual */ + mmc4_iodelay_ds_rev20_conf: mmc4_iodelay_ds_rev20_conf { + pinctrl-pin-array = < + 0x840 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_CTSN_IN */ + 0x848 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_CTSN_OUT */ + 0x84c A_DELAY_PS(307) G_DELAY_PS(0) /* CFG_UART1_RTSN_IN */ + 0x850 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OEN */ + 0x854 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OUT */ + 0x870 A_DELAY_PS(785) G_DELAY_PS(0) /* CFG_UART2_CTSN_IN */ + 0x874 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OEN */ + 0x878 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OUT */ + 0x87c A_DELAY_PS(613) G_DELAY_PS(0) /* CFG_UART2_RTSN_IN */ + 0x880 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OEN */ + 0x884 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OUT */ + 0x888 A_DELAY_PS(683) G_DELAY_PS(0) /* CFG_UART2_RXD_IN */ + 0x88c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OEN */ + 0x890 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OUT */ + 0x894 A_DELAY_PS(835) G_DELAY_PS(0) /* CFG_UART2_TXD_IN */ + 0x898 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OEN */ + 0x89c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OUT */ + >; + }; + + /* Corresponds to MMC4_MANUAL1 in datamanual */ + mmc4_iodelay_sdr12_hs_sdr25_rev11_conf: mmc4_iodelay_sdr12_hs_sdr25_rev11_conf { + pinctrl-pin-array = < + 0x840 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_CTSN_IN */ + 0x848 A_DELAY_PS(2651) G_DELAY_PS(0) /* CFG_UART1_CTSN_OUT */ + 0x84c A_DELAY_PS(1572) G_DELAY_PS(0) /* CFG_UART1_RTSN_IN */ + 0x850 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OEN */ + 0x854 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OUT */ + 0x870 A_DELAY_PS(1913) G_DELAY_PS(0) /* CFG_UART2_CTSN_IN */ + 0x874 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OEN */ + 0x878 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OUT */ + 0x87c A_DELAY_PS(1721) G_DELAY_PS(0) /* CFG_UART2_RTSN_IN */ + 0x880 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OEN */ + 0x884 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OUT */ + 0x888 A_DELAY_PS(1891) G_DELAY_PS(0) /* CFG_UART2_RXD_IN */ + 0x88c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OEN */ + 0x890 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OUT */ + 0x894 A_DELAY_PS(1919) G_DELAY_PS(0) /* CFG_UART2_TXD_IN */ + 0x898 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OEN */ + 0x89c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OUT */ + >; + }; + + /* Corresponds to MMC4_MANUAL1 in datamanual */ + mmc4_iodelay_sdr12_hs_sdr25_rev20_conf: mmc4_iodelay_sdr12_hs_sdr25_rev20_conf { + pinctrl-pin-array = < + 0x840 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_CTSN_IN */ + 0x848 A_DELAY_PS(1147) G_DELAY_PS(0) /* CFG_UART1_CTSN_OUT */ + 0x84c A_DELAY_PS(1834) G_DELAY_PS(0) /* CFG_UART1_RTSN_IN */ + 0x850 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OEN */ + 0x854 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART1_RTSN_OUT */ + 0x870 A_DELAY_PS(2165) G_DELAY_PS(0) /* CFG_UART2_CTSN_IN */ + 0x874 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OEN */ + 0x878 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_CTSN_OUT */ + 0x87c A_DELAY_PS(1929) G_DELAY_PS(64) /* CFG_UART2_RTSN_IN */ + 0x880 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OEN */ + 0x884 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RTSN_OUT */ + 0x888 A_DELAY_PS(1935) G_DELAY_PS(128) /* CFG_UART2_RXD_IN */ + 0x88c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OEN */ + 0x890 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_RXD_OUT */ + 0x894 A_DELAY_PS(2172) G_DELAY_PS(44) /* CFG_UART2_TXD_IN */ + 0x898 A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OEN */ + 0x89c A_DELAY_PS(0) G_DELAY_PS(0) /* CFG_UART2_TXD_OUT */ + >; + }; +}; diff --git a/src/arm/dra76-evm.dts b/src/arm/dra76-evm.dts new file mode 100644 index 000000000000..b024a65c6e27 --- /dev/null +++ b/src/arm/dra76-evm.dts @@ -0,0 +1,423 @@ +/* + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +/dts-v1/; + +#include "dra76x.dtsi" +#include "dra7-evm-common.dtsi" +#include + +/ { + model = "TI DRA762 EVM"; + compatible = "ti,dra76-evm", "ti,dra762", "ti,dra7"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x80000000 0x0 0x80000000>; + }; + + vsys_12v0: fixedregulator-vsys12v0 { + /* main supply */ + compatible = "regulator-fixed"; + regulator-name = "vsys_12v0"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + regulator-always-on; + regulator-boot-on; + }; + + vsys_5v0: fixedregulator-vsys5v0 { + /* Output of Cntlr B of TPS43351-Q1 on dra76-evm */ + compatible = "regulator-fixed"; + regulator-name = "vsys_5v0"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vsys_12v0>; + regulator-always-on; + regulator-boot-on; + }; + + vsys_3v3: fixedregulator-vsys3v3 { + /* Output of Cntlr A of TPS43351-Q1 on dra76-evm */ + compatible = "regulator-fixed"; + regulator-name = "vsys_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vsys_12v0>; + regulator-always-on; + regulator-boot-on; + }; + + vio_3v3: fixedregulator-vio_3v3 { + compatible = "regulator-fixed"; + regulator-name = "vio_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vsys_3v3>; + regulator-always-on; + regulator-boot-on; + }; + + vio_3v3_sd: fixedregulator-sd { + compatible = "regulator-fixed"; + regulator-name = "vio_3v3_sd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vio_3v3>; + enable-active-high; + gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>; + }; + + vio_1v8: fixedregulator-vio_1v8 { + compatible = "regulator-fixed"; + regulator-name = "vio_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&smps5_reg>; + }; + + vtt_fixed: fixedregulator-vtt { + compatible = "regulator-fixed"; + regulator-name = "vtt_fixed"; + regulator-min-microvolt = <1350000>; + regulator-max-microvolt = <1350000>; + vin-supply = <&vsys_3v3>; + regulator-always-on; + regulator-boot-on; + }; + + aic_dvdd: fixedregulator-aic_dvdd { + /* TPS77018DBVT */ + compatible = "regulator-fixed"; + regulator-name = "aic_dvdd"; + vin-supply = <&vio_3v3>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; +}; + +&dra7_pmx_core { + mmc1_pins_default: mmc1_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x376c, PIN_INPUT | MUX_MODE14) /* mmc1sdcd.gpio219 */ + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc1_pins_sdr12: pinmux_mmc1_sdr12_pins { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x3754, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_clk.clk */ + DRA7XX_CORE_IOPAD(0x3758, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_cmd.cmd */ + DRA7XX_CORE_IOPAD(0x375c, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat0.dat0 */ + DRA7XX_CORE_IOPAD(0x3760, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat1.dat1 */ + DRA7XX_CORE_IOPAD(0x3764, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat2.dat2 */ + DRA7XX_CORE_IOPAD(0x3768, PIN_INPUT_PULLUP | MUX_MODE0) /* mmc1_dat3.dat3 */ + >; + }; + + mmc2_pins_default: mmc2_pins_default { + pinctrl-single,pins = < + DRA7XX_CORE_IOPAD(0x349c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a23.mmc2_clk */ + DRA7XX_CORE_IOPAD(0x34b0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_cs1.mmc2_cmd */ + DRA7XX_CORE_IOPAD(0x34a0, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a24.mmc2_dat0 */ + DRA7XX_CORE_IOPAD(0x34a4, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a25.mmc2_dat1 */ + DRA7XX_CORE_IOPAD(0x34a8, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a26.mmc2_dat2 */ + DRA7XX_CORE_IOPAD(0x34ac, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a27.mmc2_dat3 */ + DRA7XX_CORE_IOPAD(0x348c, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a19.mmc2_dat4 */ + DRA7XX_CORE_IOPAD(0x3490, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a20.mmc2_dat5 */ + DRA7XX_CORE_IOPAD(0x3494, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a21.mmc2_dat6 */ + DRA7XX_CORE_IOPAD(0x3498, PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_a22.mmc2_dat7 */ + >; + }; +}; + +&i2c1 { + status = "okay"; + clock-frequency = <400000>; + + tps65917: tps65917@58 { + compatible = "ti,tps65917"; + reg = <0x58>; + ti,system-power-controller; + interrupt-controller; + #interrupt-cells = <2>; + + tps65917_pmic { + compatible = "ti,tps65917-pmic"; + + smps12-in-supply = <&vsys_3v3>; + smps3-in-supply = <&vsys_3v3>; + smps4-in-supply = <&vsys_3v3>; + smps5-in-supply = <&vsys_3v3>; + ldo1-in-supply = <&vsys_3v3>; + ldo2-in-supply = <&vsys_3v3>; + ldo3-in-supply = <&vsys_5v0>; + ldo4-in-supply = <&vsys_5v0>; + ldo5-in-supply = <&vsys_3v3>; + + tps65917_regulators: regulators { + smps12_reg: smps12 { + /* VDD_DSPEVE */ + regulator-name = "smps12"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + smps3_reg: smps3 { + /* VDD_CORE */ + regulator-name = "smps3"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1250000>; + regulator-boot-on; + regulator-always-on; + }; + + smps4_reg: smps4 { + /* VDD_IVA */ + regulator-name = "smps4"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + smps5_reg: smps5 { + /* VDDS1V8 */ + regulator-name = "smps5"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo1_reg: ldo1 { + /* LDO1_OUT --> VDA_PHY1_1V8 */ + regulator-name = "ldo1"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-allow-bypass; + }; + + ldo2_reg: ldo2 { + /* LDO2_OUT --> VDA_PHY2_1V8 */ + regulator-name = "ldo2"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-allow-bypass; + regulator-always-on; + }; + + ldo3_reg: ldo3 { + /* VDA_USB_3V3 */ + regulator-name = "ldo3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo5_reg: ldo5 { + /* VDDA_1V8_PLL */ + regulator-name = "ldo5"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + ldo4_reg: ldo4 { + /* VDD_SDIO_DV */ + regulator-name = "ldo4"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; + + tps65917_power_button { + compatible = "ti,palmas-pwrbutton"; + interrupt-parent = <&tps65917>; + interrupts = <1 IRQ_TYPE_NONE>; + wakeup-source; + ti,palmas-long-press-seconds = <6>; + }; + }; + + lp87565: lp87565@60 { + compatible = "ti,lp87565-q1"; + reg = <0x60>; + + buck10-in-supply =<&vsys_3v3>; + buck23-in-supply =<&vsys_3v3>; + + regulators: regulators { + buck10_reg: buck10 { + /*VDD_MPU*/ + regulator-name = "buck10"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + buck23_reg: buck23 { + /* VDD_GPU*/ + regulator-name = "buck23"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1250000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; + + pcf_lcd: pcf8757@20 { + compatible = "ti,pcf8575", "nxp,pcf8575"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = <3 IRQ_TYPE_EDGE_FALLING>; + }; + + pcf_gpio_21: pcf8757@21 { + compatible = "ti,pcf8575", "nxp,pcf8575"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = <3 IRQ_TYPE_EDGE_FALLING>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + pcf_hdmi: pcf8575@26 { + compatible = "ti,pcf8575", "nxp,pcf8575"; + reg = <0x26>; + gpio-controller; + #gpio-cells = <2>; + p1 { + /* vin6_sel_s0: high: VIN6, low: audio */ + gpio-hog; + gpios = <1 GPIO_ACTIVE_HIGH>; + output-low; + line-name = "vin6_sel_s0"; + }; + }; + + tlv320aic3106: tlv320aic3106@19 { + #sound-dai-cells = <0>; + compatible = "ti,tlv320aic3106"; + reg = <0x19>; + adc-settle-ms = <40>; + ai3x-micbias-vg = <1>; /* 2.0V */ + status = "okay"; + + /* Regulators */ + AVDD-supply = <&vio_3v3>; + IOVDD-supply = <&vio_3v3>; + DRVDD-supply = <&vio_3v3>; + DVDD-supply = <&aic_dvdd>; + }; +}; + +&cpu0 { + vdd-supply = <&buck10_reg>; +}; + +&mmc1 { + status = "okay"; + vmmc-supply = <&vio_3v3_sd>; + vmmc_aux-supply = <&ldo4_reg>; + bus-width = <4>; + /* + * SDCD signal is not being used here - using the fact that GPIO mode + * is always hardwired. + */ + cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins_default>; +}; + +&mmc2 { + status = "okay"; + vmmc-supply = <&vio_1v8>; + bus-width = <8>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_pins_default>; +}; + +/* No RTC on this device */ +&rtc { + status = "disabled"; +}; + +&mac { + status = "okay"; + + dual_emac; +}; + +&cpsw_emac0 { + phy_id = <&davinci_mdio>, <2>; + phy-mode = "rgmii-id"; + dual_emac_res_vlan = <1>; +}; + +&cpsw_emac1 { + phy_id = <&davinci_mdio>, <3>; + phy-mode = "rgmii-id"; + dual_emac_res_vlan = <2>; +}; + +&davinci_mdio { + dp83867_0: ethernet-phy@2 { + reg = <2>; + ti,rx-internal-delay = ; + ti,tx-internal-delay = ; + ti,fifo-depth = ; + ti,min-output-impedance; + ti,dp83867-rxctrl-strap-quirk; + }; + + dp83867_1: ethernet-phy@3 { + reg = <3>; + ti,rx-internal-delay = ; + ti,tx-internal-delay = ; + ti,fifo-depth = ; + ti,min-output-impedance; + ti,dp83867-rxctrl-strap-quirk; + }; +}; + +&usb2_phy1 { + phy-supply = <&ldo3_reg>; +}; + +&usb2_phy2 { + phy-supply = <&ldo3_reg>; +}; + +&qspi { + spi-max-frequency = <96000000>; + m25p80@0 { + spi-max-frequency = <96000000>; + }; +}; diff --git a/src/arm/dra76x.dtsi b/src/arm/dra76x.dtsi new file mode 100644 index 000000000000..1c88c581ff18 --- /dev/null +++ b/src/arm/dra76x.dtsi @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include "dra74x.dtsi" + +/ { + compatible = "ti,dra762", "ti,dra7"; + +}; + +/* MCAN interrupts are hard-wired to irqs 67, 68 */ +&crossbar_mpu { + ti,irqs-skip = <10 67 68 133 139 140>; +}; diff --git a/src/arm/dra7xx-clocks.dtsi b/src/arm/dra7xx-clocks.dtsi index cf229dfabf61..e62b62875cba 100644 --- a/src/arm/dra7xx-clocks.dtsi +++ b/src/arm/dra7xx-clocks.dtsi @@ -1817,6 +1817,8 @@ clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atl_clkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; ti,bit-shift = <24>; reg = <0x1868>; + assigned-clocks = <&mcasp3_ahclkx_mux>; + assigned-clock-parents = <&abe_24m_fclk>; }; mcasp3_aux_gfclk_mux: mcasp3_aux_gfclk_mux@1868 { diff --git a/src/arm/efm32gg-dk3750.dts b/src/arm/efm32gg-dk3750.dts index 98fc667d22c7..c9f3ea29cf9e 100644 --- a/src/arm/efm32gg-dk3750.dts +++ b/src/arm/efm32gg-dk3750.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device tree for EFM32GG-DK3750 development board. * diff --git a/src/arm/efm32gg.dtsi b/src/arm/efm32gg.dtsi index b78c57e51ed5..8a58e49144cc 100644 --- a/src/arm/efm32gg.dtsi +++ b/src/arm/efm32gg.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device tree for Energy Micro EFM32 Giant Gecko SoC. * diff --git a/src/arm/elpida_ecb240abacn.dtsi b/src/arm/elpida_ecb240abacn.dtsi index f97f70f83374..d87ee4794f83 100644 --- a/src/arm/elpida_ecb240abacn.dtsi +++ b/src/arm/elpida_ecb240abacn.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common devices used in different OMAP boards */ diff --git a/src/arm/exynos3250-artik5-eval.dts b/src/arm/exynos3250-artik5-eval.dts index 4bd2ee87124e..4cbfa09c6c4e 100644 --- a/src/arm/exynos3250-artik5-eval.dts +++ b/src/arm/exynos3250-artik5-eval.dts @@ -22,7 +22,6 @@ }; &mshc_2 { - num-slots = <1>; cap-sd-highspeed; disable-wp; vqmmc-supply = <&ldo3_reg>; diff --git a/src/arm/exynos3250-artik5.dtsi b/src/arm/exynos3250-artik5.dtsi index 59c89d7662a8..639c2e605f3c 100644 --- a/src/arm/exynos3250-artik5.dtsi +++ b/src/arm/exynos3250-artik5.dtsi @@ -304,7 +304,6 @@ }; &mshc_0 { - num-slots = <1>; non-removable; cap-mmc-highspeed; card-detect-delay = <200>; diff --git a/src/arm/exynos3250-monk.dts b/src/arm/exynos3250-monk.dts index accee81da266..bbdfcbc6e7d2 100644 --- a/src/arm/exynos3250-monk.dts +++ b/src/arm/exynos3250-monk.dts @@ -426,7 +426,6 @@ &mshc_0 { #address-cells = <1>; #size-cells = <0>; - num-slots = <1>; broken-cd; non-removable; cap-mmc-highspeed; diff --git a/src/arm/exynos3250-rinato.dts b/src/arm/exynos3250-rinato.dts index 443e0c98dc73..0b45467d77a8 100644 --- a/src/arm/exynos3250-rinato.dts +++ b/src/arm/exynos3250-rinato.dts @@ -220,21 +220,6 @@ samsung,pll-clock-frequency = <24000000>; status = "okay"; - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@1 { - reg = <1>; - - dsi_out: endpoint { - remote-endpoint = <&dsi_in>; - samsung,burst-clock-frequency = <250000000>; - samsung,esc-clock-frequency = <20000000>; - }; - }; - }; - panel@0 { compatible = "samsung,s6e63j0x03"; reg = <0>; @@ -264,12 +249,6 @@ vsync-len = <2>; }; }; - - port { - dsi_in: endpoint { - remote-endpoint = <&dsi_out>; - }; - }; }; }; @@ -642,7 +621,6 @@ &mshc_0 { #address-cells = <1>; #size-cells = <0>; - num-slots = <1>; broken-cd; non-removable; cap-mmc-highspeed; diff --git a/src/arm/exynos4210-trats.dts b/src/arm/exynos4210-trats.dts index 645feffb9239..7b6ab7265110 100644 --- a/src/arm/exynos4210-trats.dts +++ b/src/arm/exynos4210-trats.dts @@ -202,21 +202,6 @@ samsung,pll-clock-frequency = <24000000>; status = "okay"; - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@1 { - reg = <1>; - - dsi_out: endpoint { - remote-endpoint = <&dsi_in>; - samsung,burst-clock-frequency = <500000000>; - samsung,esc-clock-frequency = <20000000>; - }; - }; - }; - panel@0 { reg = <0>; compatible = "samsung,s6e8aa0"; @@ -244,12 +229,6 @@ vsync-len = <2>; }; }; - - port { - dsi_in: endpoint { - remote-endpoint = <&dsi_out>; - }; - }; }; }; diff --git a/src/arm/exynos4412-itop-scp-core.dtsi b/src/arm/exynos4412-itop-scp-core.dtsi index 4cd62487bb16..14ce2c69bc0b 100644 --- a/src/arm/exynos4412-itop-scp-core.dtsi +++ b/src/arm/exynos4412-itop-scp-core.dtsi @@ -466,7 +466,6 @@ pinctrl-names = "default"; status = "okay"; vmmc-supply = <&buck9_reg>; - num-slots = <1>; broken-cd; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; diff --git a/src/arm/exynos4412-odroid-common.dtsi b/src/arm/exynos4412-odroid-common.dtsi index 219d587c5a85..102acd78be15 100644 --- a/src/arm/exynos4412-odroid-common.dtsi +++ b/src/arm/exynos4412-odroid-common.dtsi @@ -516,7 +516,6 @@ mmc-pwrseq = <&emmc_pwrseq>; status = "okay"; - num-slots = <1>; broken-cd; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; diff --git a/src/arm/exynos4412-origen.dts b/src/arm/exynos4412-origen.dts index 7a83e2df18a6..8a89eb893d64 100644 --- a/src/arm/exynos4412-origen.dts +++ b/src/arm/exynos4412-origen.dts @@ -488,7 +488,6 @@ pinctrl-names = "default"; status = "okay"; - num-slots = <1>; broken-cd; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; diff --git a/src/arm/exynos4412-trats2.dts b/src/arm/exynos4412-trats2.dts index 35e9b94b86b8..bceb919ac637 100644 --- a/src/arm/exynos4412-trats2.dts +++ b/src/arm/exynos4412-trats2.dts @@ -390,21 +390,6 @@ samsung,pll-clock-frequency = <24000000>; status = "okay"; - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@1 { - reg = <1>; - - dsi_out: endpoint { - remote-endpoint = <&dsi_in>; - samsung,burst-clock-frequency = <500000000>; - samsung,esc-clock-frequency = <20000000>; - }; - }; - }; - panel@0 { compatible = "samsung,s6e8aa0"; reg = <0>; @@ -432,12 +417,6 @@ vsync-len = <2>; }; }; - - port { - dsi_in: endpoint { - remote-endpoint = <&dsi_out>; - }; - }; }; }; @@ -901,7 +880,6 @@ }; &mshc_0 { - num-slots = <1>; broken-cd; non-removable; card-detect-delay = <200>; diff --git a/src/arm/exynos5250-arndale.dts b/src/arm/exynos5250-arndale.dts index 6a432460eb77..18a7f396ac5f 100644 --- a/src/arm/exynos5250-arndale.dts +++ b/src/arm/exynos5250-arndale.dts @@ -518,7 +518,6 @@ &mmc_0 { status = "okay"; - num-slots = <1>; broken-cd; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; @@ -533,7 +532,6 @@ &mmc_2 { status = "okay"; - num-slots = <1>; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <2 3>; diff --git a/src/arm/exynos5250-smdk5250.dts b/src/arm/exynos5250-smdk5250.dts index 6632f657394e..062cba4c2c31 100644 --- a/src/arm/exynos5250-smdk5250.dts +++ b/src/arm/exynos5250-smdk5250.dts @@ -346,7 +346,6 @@ &mmc_0 { status = "okay"; - num-slots = <1>; broken-cd; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; @@ -360,7 +359,6 @@ &mmc_2 { status = "okay"; - num-slots = <1>; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <2 3>; diff --git a/src/arm/exynos5250-snow-common.dtsi b/src/arm/exynos5250-snow-common.dtsi index e1d293dbbe5d..8788880e459d 100644 --- a/src/arm/exynos5250-snow-common.dtsi +++ b/src/arm/exynos5250-snow-common.dtsi @@ -530,7 +530,6 @@ /* eMMC flash */ &mmc_0 { status = "okay"; - num-slots = <1>; non-removable; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <2 3>; @@ -544,7 +543,6 @@ /* uSD card */ &mmc_2 { status = "okay"; - num-slots = <1>; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; samsung,dw-mshc-sdr-timing = <2 3>; @@ -564,7 +562,6 @@ */ &mmc_3 { status = "okay"; - num-slots = <1>; non-removable; cap-sdio-irq; keep-power-in-suspend; diff --git a/src/arm/exynos5250-spring.dts b/src/arm/exynos5250-spring.dts index 95c3bcace9dc..d53bfcbeb39c 100644 --- a/src/arm/exynos5250-spring.dts +++ b/src/arm/exynos5250-spring.dts @@ -427,7 +427,6 @@ &mmc_0 { status = "okay"; - num-slots = <1>; broken-cd; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; @@ -445,7 +444,6 @@ */ &mmc_1 { status = "okay"; - num-slots = <1>; broken-cd; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; diff --git a/src/arm/exynos5260-xyref5260.dts b/src/arm/exynos5260-xyref5260.dts index d0cc300cfb4b..73b7cdd5f522 100644 --- a/src/arm/exynos5260-xyref5260.dts +++ b/src/arm/exynos5260-xyref5260.dts @@ -67,7 +67,6 @@ &mmc_0 { status = "okay"; - num-slots = <1>; broken-cd; bypass-smu; cap-mmc-highspeed; @@ -83,7 +82,6 @@ &mmc_2 { status = "okay"; - num-slots = <1>; cap-sd-highspeed; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; diff --git a/src/arm/exynos5410-smdk5410.dts b/src/arm/exynos5410-smdk5410.dts index 6cc74d97daae..9cb7726ef8d0 100644 --- a/src/arm/exynos5410-smdk5410.dts +++ b/src/arm/exynos5410-smdk5410.dts @@ -41,7 +41,6 @@ &mmc_0 { status = "okay"; - num-slots = <1>; cap-mmc-highspeed; broken-cd; card-detect-delay = <200>; @@ -53,7 +52,6 @@ &mmc_2 { status = "okay"; - num-slots = <1>; cap-sd-highspeed; card-detect-delay = <200>; samsung,dw-mshc-ciu-div = <3>; diff --git a/src/arm/exynos5420-peach-pit.dts b/src/arm/exynos5420-peach-pit.dts index f9a75bfd3f2b..683a4cfb4a23 100644 --- a/src/arm/exynos5420-peach-pit.dts +++ b/src/arm/exynos5420-peach-pit.dts @@ -699,7 +699,6 @@ /* eMMC flash */ &mmc_0 { status = "okay"; - num-slots = <1>; mmc-hs200-1_8v; cap-mmc-highspeed; non-removable; @@ -717,7 +716,6 @@ /* WiFi SDIO module */ &mmc_1 { status = "okay"; - num-slots = <1>; non-removable; cap-sdio-irq; keep-power-in-suspend; @@ -737,7 +735,6 @@ /* uSD card */ &mmc_2 { status = "okay"; - num-slots = <1>; cap-sd-highspeed; card-detect-delay = <200>; clock-frequency = <400000000>; diff --git a/src/arm/exynos5440.dtsi b/src/arm/exynos5440.dtsi index bc4954e69f7b..7a00be7ea6d7 100644 --- a/src/arm/exynos5440.dtsi +++ b/src/arm/exynos5440.dtsi @@ -317,6 +317,7 @@ phys = <&pcie_phy0>; ranges = <0x81000000 0 0 0x40001000 0 0x00010000 /* downstream I/O */ 0x82000000 0 0x40011000 0x40011000 0 0x1ffef000>; /* non-prefetchable memory */ + bus-range = <0x00 0xff>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0x0 0 &gic 53>; @@ -339,6 +340,7 @@ phys = <&pcie_phy1>; ranges = <0x81000000 0 0 0x60001000 0 0x00010000 /* downstream I/O */ 0x82000000 0 0x60011000 0x60011000 0 0x1ffef000>; /* non-prefetchable memory */ + bus-range = <0x00 0xff>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0x0 0 &gic 56>; diff --git a/src/arm/exynos5800-peach-pi.dts b/src/arm/exynos5800-peach-pi.dts index 953dc8677dc8..b2b95ff205e8 100644 --- a/src/arm/exynos5800-peach-pi.dts +++ b/src/arm/exynos5800-peach-pi.dts @@ -667,7 +667,6 @@ /* eMMC flash */ &mmc_0 { status = "okay"; - num-slots = <1>; mmc-hs200-1_8v; mmc-hs400-1_8v; cap-mmc-highspeed; @@ -686,7 +685,6 @@ /* WiFi SDIO module */ &mmc_1 { status = "okay"; - num-slots = <1>; non-removable; cap-sdio-irq; keep-power-in-suspend; @@ -706,7 +704,6 @@ /* uSD card */ &mmc_2 { status = "okay"; - num-slots = <1>; cap-sd-highspeed; card-detect-delay = <200>; clock-frequency = <400000000>; diff --git a/src/arm/gemini-dlink-dir-685.dts b/src/arm/gemini-dlink-dir-685.dts new file mode 100644 index 000000000000..e75e2d44371c --- /dev/null +++ b/src/arm/gemini-dlink-dir-685.dts @@ -0,0 +1,246 @@ +/* + * Device Tree file for D-Link DIR-685 Xtreme N Storage Router + */ + +/dts-v1/; + +#include "gemini.dtsi" +#include + +/ { + model = "D-Link DIR-685 Xtreme N Storage Router"; + compatible = "dlink,dir-685", "cortina,gemini"; + #address-cells = <1>; + #size-cells = <1>; + + memory { + /* 128 MB SDRAM in 2 x Hynix HY5DU121622DTP-D43 */ + device_type = "memory"; + reg = <0x00000000 0x8000000>; + }; + + chosen { + stdout-path = "uart0:115200n8"; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + button-esc { + debounce_interval = <50>; + wakeup-source; + linux,code = ; + label = "reset"; + /* Collides with LPC_LAD[0], UART DCD, SSP 97RST */ + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; + }; + button-eject { + debounce_interval = <50>; + wakeup-source; + linux,code = ; + label = "unmount"; + /* Collides with LPC LFRAME, UART RTS, SSP TXD */ + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + led-wps { + label = "dir685:blue:WPS"; + /* Collides with ICE */ + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + linux,default-trigger = "heartbeat"; + }; + /* + * These two LEDs are on the side of the device. + * For electrical reasons, both LEDs cannot be active + * at the same time so only blue or orange can on at + * one time. Enabling both makes the LED go dark. + * The LEDs both sit inside the unmount button and the + * label on the case says "unmount". + */ + led-blue-hd { + label = "dir685:blue:HD"; + /* Collides with LPC_SERIRQ, UART DTR, SSP FSC pins */ + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + led-orange-hd { + label = "dir685:orange:HD"; + /* Collides with LPC_LAD[2], UART DSR, SSP ECLK pins */ + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + /* + * This is a Sunon Maglev GM0502PFV2-8 cooling fan @10000 RPM. + * Since the platform has no temperature sensor, this is controlled + * from userspace by using the hard disks S.M.A.R.T. temperature + * sensor. It is turned on when the temperature exceeds 46 degrees + * and turned off when the temperatures goes below 41 degrees + * (celsius). + */ + gpio-fan { + compatible = "gpio-fan"; + /* Collides with IDE */ + gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = <0 0>, <10000 1>; + #cooling-cells = <2>; + }; + + /* + * The touchpad input is connected to a GPIO bit-banged + * I2C bus. + */ + gpio-i2c { + compatible = "i2c-gpio"; + /* Collides with ICE */ + gpios = <&gpio0 5 0>, /* SDA */ + <&gpio0 6 0>; /* SCL */ + #address-cells = <1>; + #size-cells = <0>; + + touchkeys@26 { + compatible = "dlink,dir685-touchkeys"; + reg = <0x26>; + interrupt-parent = <&gpio0>; + /* Collides with NAND flash */ + interrupts = <17 IRQ_TYPE_EDGE_FALLING>; + }; + }; + + soc { + flash@30000000 { + status = "okay"; + /* 32MB of flash */ + reg = <0x30000000 0x02000000>; + + /* + * This "RedBoot" is the Storlink derivative. + */ + partition@0 { + label = "RedBoot"; + reg = <0x00000000 0x00040000>; + read-only; + }; + /* + * Between the boot loader and the rootfs is the kernel + * in a custom Storlink format flashed from the boot + * menu. The rootfs is in squashfs format. + */ + partition@1800c0 { + label = "rootfs"; + reg = <0x001800c0 0x01dbff40>; + read-only; + }; + partition@1f40000 { + label = "upgrade"; + reg = <0x01f40000 0x00040000>; + read-only; + }; + partition@1f80000 { + label = "rgdb"; + reg = <0x01f80000 0x00040000>; + read-only; + }; + /* + * This partition contains MAC addresses for WAN, + * WLAN and LAN, and the country code (for wireless + * I guess). + */ + partition@1fc0000 { + label = "nvram"; + reg = <0x01fc0000 0x00020000>; + read-only; + }; + partition@1fe0000 { + label = "LangPack"; + reg = <0x01fe0000 0x00020000>; + read-only; + }; + }; + + syscon: syscon@40000000 { + pinctrl { + /* + * gpio0bgrp cover line 5, 6 used by TK I2C + * gpio0bgrp cover line 7 used by WPS LED + * gpio0cgrp cover line 8, 13 used by keys + * and 11, 12 used by the HD LEDs + * gpio0egrp cover line 16 used by VDISP + * gpio0fgrp cover line 17 used by TK IRQ + * gpio0ggrp cover line 20 used by panel CS + * gpio0hgrp cover line 21,22 used by RTL8366RB + */ + gpio0_default_pins: pinctrl-gpio0 { + mux { + function = "gpio0"; + groups = "gpio0bgrp", + "gpio0cgrp", + "gpio0egrp", + "gpio0fgrp", + "gpio0ggrp", + "gpio0hgrp"; + }; + }; + /* + * gpio1bgrp cover line 5,8,7 used by panel SPI + * also line 6 used by the fan + * + */ + gpio1_default_pins: pinctrl-gpio1 { + mux { + function = "gpio1"; + groups = "gpio1bgrp"; + }; + }; + }; + }; + + sata: sata@46000000 { + cortina,gemini-ata-muxmode = <0>; + cortina,gemini-enable-sata-bridge; + status = "okay"; + }; + + gpio0: gpio@4d000000 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio0_default_pins>; + }; + + gpio1: gpio@4e000000 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio1_default_pins>; + }; + + pci@50000000 { + status = "okay"; + interrupt-map-mask = <0xf800 0 0 7>; + interrupt-map = + <0x4800 0 0 1 &pci_intc 0>, /* Slot 9 */ + <0x4800 0 0 2 &pci_intc 1>, + <0x4800 0 0 3 &pci_intc 2>, + <0x4800 0 0 4 &pci_intc 3>, + <0x5000 0 0 1 &pci_intc 1>, /* Slot 10 */ + <0x5000 0 0 2 &pci_intc 2>, + <0x5000 0 0 3 &pci_intc 3>, + <0x5000 0 0 4 &pci_intc 0>, + <0x5800 0 0 1 &pci_intc 2>, /* Slot 11 */ + <0x5800 0 0 2 &pci_intc 3>, + <0x5800 0 0 3 &pci_intc 0>, + <0x5800 0 0 4 &pci_intc 1>, + <0x6000 0 0 1 &pci_intc 3>, /* Slot 12 */ + <0x6000 0 0 2 &pci_intc 0>, + <0x6000 0 0 3 &pci_intc 1>, + <0x6000 0 0 4 &pci_intc 2>; + }; + + ata@63000000 { + status = "okay"; + }; + }; +}; diff --git a/src/arm/gemini-nas4220b.dts b/src/arm/gemini-nas4220b.dts index 55f6a4f1f801..d6a22e677c7a 100644 --- a/src/arm/gemini-nas4220b.dts +++ b/src/arm/gemini-nas4220b.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree file for the Gemini-based Raidsonic NAS IB-4220-B */ @@ -33,6 +34,7 @@ wakeup-source; linux,code = ; label = "Backup button"; + /* Conflict with TVC */ gpios = <&gpio1 29 GPIO_ACTIVE_LOW>; }; button@31 { @@ -40,6 +42,7 @@ wakeup-source; linux,code = ; label = "Softreset button"; + /* Conflict with TVC */ gpios = <&gpio1 31 GPIO_ACTIVE_LOW>; }; }; @@ -48,11 +51,13 @@ compatible = "gpio-leds"; led@28 { label = "nas4220b:orange:hdd"; + /* Conflict with TVC */ gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>; default-state = "on"; }; led@30 { label = "nas4220b:green:os"; + /* Conflict with TVC */ gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; default-state = "on"; linux,default-trigger = "heartbeat"; @@ -99,12 +104,32 @@ }; }; + syscon: syscon@40000000 { + pinctrl { + /* + * gpio1dgrp cover line 28-31 otherwise used + * by TVC. + */ + gpio1_default_pins: pinctrl-gpio1 { + mux { + function = "gpio1"; + groups = "gpio1dgrp"; + }; + }; + }; + }; + sata: sata@46000000 { cortina,gemini-ata-muxmode = <0>; cortina,gemini-enable-sata-bridge; status = "okay"; }; + gpio1: gpio@4e000000 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio1_default_pins>; + }; + ata@63000000 { status = "okay"; }; diff --git a/src/arm/gemini-rut1xx.dts b/src/arm/gemini-rut1xx.dts index 7b920bfbda32..500057b6570e 100644 --- a/src/arm/gemini-rut1xx.dts +++ b/src/arm/gemini-rut1xx.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree file for Teltonika RUT1xx */ @@ -33,6 +34,7 @@ wakeup-source; linux,code = ; label = "Reset to defaults"; + /* Conflict with TVC */ gpios = <&gpio1 28 GPIO_ACTIVE_LOW>; }; }; @@ -42,12 +44,14 @@ led@7 { /* FIXME: add the LED color */ label = "rut1xx::gsm"; + /* Conflict with ICE */ gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; default-state = "on"; }; led@31 { /* FIXME: add the LED color */ label = "rut1xx::power"; + /* Conflict with NAND CE0 */ gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>; default-state = "off"; linux,default-trigger = "heartbeat"; @@ -61,5 +65,41 @@ reg = <0x30000000 0x00800000>; /* TODO: add flash partitions here */ }; + + syscon: syscon@40000000 { + pinctrl { + /* + * gpio0bgrp cover line 7 used by GSM LED + * gpio0fgrp cover line 17 used by power LED + */ + gpio0_default_pins: pinctrl-gpio0 { + mux { + function = "gpio0"; + groups = "gpio0bgrp", + "gpio0fgrp"; + }; + }; + /* + * gpio1dgrp cover line 28-31 otherwise used + * by TVC. + */ + gpio1_default_pins: pinctrl-gpio1 { + mux { + function = "gpio1"; + groups = "gpio1dgrp"; + }; + }; + }; + }; + + gpio0: gpio@4d000000 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio0_default_pins>; + }; + + gpio1: gpio@4e000000 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio1_default_pins>; + }; }; }; diff --git a/src/arm/gemini-sq201.dts b/src/arm/gemini-sq201.dts index 4d200f0bcd45..63c02ca9513c 100644 --- a/src/arm/gemini-sq201.dts +++ b/src/arm/gemini-sq201.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree file for ITian Square One SQ201 NAS */ @@ -33,6 +34,7 @@ wakeup-source; linux,code = ; label = "factory reset"; + /* Conflict with NAND flash */ gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; }; }; @@ -41,12 +43,14 @@ compatible = "gpio-leds"; led@20 { label = "sq201:green:info"; + /* Conflict with parallel flash */ gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; default-state = "on"; linux,default-trigger = "heartbeat"; }; led@31 { label = "sq201:green:usb"; + /* Conflict with parallel and NAND flash */ gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>; default-state = "off"; linux,default-trigger = "usb-host"; @@ -55,7 +59,15 @@ soc { flash@30000000 { - status = "okay"; + /* + * Flash access can be enabled, with the side effect + * of disabling access to GPIO LED on GPIO0[20] which + * reuse one of the parallel flash chip select lines. + * Also the default firmware on the machine has the + * problem that since it uses the flash, the two LEDS + * on the right become numb. + */ + /* status = "okay"; */ /* 16MB of flash */ reg = <0x30000000 0x01000000>; @@ -93,12 +105,35 @@ }; }; + syscon: syscon@40000000 { + pinctrl { + /* + * gpio0fgrp cover line 18 used by reset button + * gpio0ggrp cover line 20 used by info LED + * gpio0kgrp cover line 31 used by USB LED + */ + gpio0_default_pins: pinctrl-gpio0 { + mux { + function = "gpio0"; + groups = "gpio0fgrp", + "gpio0ggrp", + "gpio0kgrp"; + }; + }; + }; + }; + sata: sata@46000000 { cortina,gemini-ata-muxmode = <0>; cortina,gemini-enable-sata-bridge; status = "okay"; }; + gpio0: gpio@4d000000 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio0_default_pins>; + }; + pci@50000000 { status = "okay"; interrupt-map-mask = <0xf800 0 0 7>; diff --git a/src/arm/gemini-wbd111.dts b/src/arm/gemini-wbd111.dts index 63b756e3bf5a..b413fd12c5ba 100644 --- a/src/arm/gemini-wbd111.dts +++ b/src/arm/gemini-wbd111.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree file for Wiliboard WBD-111 */ @@ -33,6 +34,7 @@ wakeup-source; linux,code = ; label = "reset"; + /* Conflict with ICE */ gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; }; }; @@ -42,21 +44,25 @@ led@1 { label = "wbd111:red:L3"; + /* Conflict with TVC and extended parallel flash */ gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; default-state = "off"; }; led@2 { label = "wbd111:green:L4"; + /* Conflict with TVC and extended parallel flash */ gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; default-state = "off"; }; led@3 { label = "wbd111:red:L4"; + /* Conflict with TVC and extended parallel flash */ gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; default-state = "off"; }; led@5 { label = "wbd111:green:L3"; + /* Conflict with TVC and extended parallel flash */ gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; default-state = "on"; linux,default-trigger = "heartbeat"; @@ -98,5 +104,26 @@ read-only; }; }; + + syscon: syscon@40000000 { + pinctrl { + /* + * gpio0agrp cover line 0-4 + * gpio0bgrp cover line 5 + */ + gpio0_default_pins: pinctrl-gpio0 { + mux { + function = "gpio0"; + groups = "gpio0agrp", + "gpio0bgrp"; + }; + }; + }; + }; + + gpio0: gpio@4d000000 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio0_default_pins>; + }; }; }; diff --git a/src/arm/gemini-wbd222.dts b/src/arm/gemini-wbd222.dts index 9747f5a47807..3ba710538662 100644 --- a/src/arm/gemini-wbd222.dts +++ b/src/arm/gemini-wbd222.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree file for Wiliboard WBD-222 */ @@ -33,6 +34,7 @@ wakeup-source; linux,code = ; label = "reset"; + /* Conflict with ICE */ gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; }; }; @@ -42,21 +44,25 @@ led@1 { label = "wbd111:red:L3"; + /* Conflict with TVC and extended parallel flash */ gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; default-state = "off"; }; led@2 { label = "wbd111:green:L4"; + /* Conflict with TVC and extended parallel flash */ gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; default-state = "off"; }; led@3 { label = "wbd111:red:L4"; + /* Conflict with TVC and extended parallel flash */ gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; default-state = "off"; }; led@5 { label = "wbd111:green:L3"; + /* Conflict with TVC and extended parallel flash */ gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; default-state = "on"; linux,default-trigger = "heartbeat"; @@ -98,5 +104,26 @@ read-only; }; }; + + syscon: syscon@40000000 { + pinctrl { + /* + * gpio0agrp cover line 0-4 + * gpio0bgrp cover line 5 + */ + gpio0_default_pins: pinctrl-gpio0 { + mux { + function = "gpio0"; + groups = "gpio0agrp", + "gpio0bgrp"; + }; + }; + }; + }; + + gpio0: gpio@4d000000 { + pinctrl-names = "default"; + pinctrl-0 = <&gpio0_default_pins>; + }; }; }; diff --git a/src/arm/gemini.dtsi b/src/arm/gemini.dtsi index 141d8d3a1d07..b9b07d0895cf 100644 --- a/src/arm/gemini.dtsi +++ b/src/arm/gemini.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree file for Cortina systems Gemini SoC */ @@ -5,6 +6,8 @@ /include/ "skeleton.dtsi" #include +#include +#include #include / { @@ -18,6 +21,8 @@ flash@30000000 { compatible = "cortina,gemini-flash", "cfi-flash"; syscon = <&syscon>; + pinctrl-names = "default"; + pinctrl-0 = <&pflash_default_pins>; bank-width = <2>; #address-cells = <1>; #size-cells = <1>; @@ -39,22 +44,124 @@ /* RESET_GLOBAL | RESET_CPU1 */ mask = <0xC0000000>; }; + + pinctrl { + compatible = "cortina,gemini-pinctrl"; + regmap = <&syscon>; + /* Hog the DRAM pins */ + pinctrl-names = "default"; + pinctrl-0 = <&dram_default_pins>, <&system_default_pins>, + <&vcontrol_default_pins>; + + dram_default_pins: pinctrl-dram { + mux { + function = "dram"; + groups = "dramgrp"; + }; + }; + rtc_default_pins: pinctrl-rtc { + mux { + function = "rtc"; + groups = "rtcgrp"; + }; + }; + power_default_pins: pinctrl-power { + mux { + function = "power"; + groups = "powergrp"; + }; + }; + cir_default_pins: pinctrl-cir { + mux { + function = "cir"; + groups = "cirgrp"; + }; + }; + system_default_pins: pinctrl-system { + mux { + function = "system"; + groups = "systemgrp"; + }; + }; + vcontrol_default_pins: pinctrl-vcontrol { + mux { + function = "vcontrol"; + groups = "vcontrolgrp"; + }; + }; + ice_default_pins: pinctrl-ice { + mux { + function = "ice"; + groups = "icegrp"; + }; + }; + uart_default_pins: pinctrl-uart { + mux { + function = "uart"; + groups = "uartrxtxgrp"; + }; + }; + pflash_default_pins: pinctrl-pflash { + mux { + function = "pflash"; + groups = "pflashgrp"; + }; + }; + usb_default_pins: pinctrl-usb { + mux { + function = "usb"; + groups = "usbgrp"; + }; + }; + gmii_default_pins: pinctrl-gmii { + mux { + function = "gmii"; + groups = "gmiigrp"; + }; + }; + pci_default_pins: pinctrl-pci { + mux { + function = "pci"; + groups = "pcigrp"; + }; + }; + sata_default_pins: pinctrl-sata { + mux { + function = "sata"; + groups = "satagrp"; + }; + }; + /* Activate both groups of pins for this state */ + sata_and_ide_pins: pinctrl-sata-ide { + mux0 { + function = "sata"; + groups = "satagrp"; + }; + mux1 { + function = "ide"; + groups = "idegrp"; + }; + }; + }; }; watchdog@41000000 { - compatible = "cortina,gemini-watchdog"; + compatible = "cortina,gemini-watchdog", "faraday,ftwdt010"; reg = <0x41000000 0x1000>; interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; - resets = <&syscon 23>; - clocks = <&syscon 2>; + resets = <&syscon GEMINI_RESET_WDOG>; + clocks = <&syscon GEMINI_CLK_APB>; + clock-names = "PCLK"; }; uart0: serial@42000000 { compatible = "ns16550a"; reg = <0x42000000 0x100>; - resets = <&syscon 18>; - clocks = <&syscon 6>; + resets = <&syscon GEMINI_RESET_UART>; + clocks = <&syscon GEMINI_CLK_UART>; interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&uart_default_pins>; reg-shift = <2>; }; @@ -65,9 +172,9 @@ interrupts = <14 IRQ_TYPE_EDGE_FALLING>, /* Timer 1 */ <15 IRQ_TYPE_EDGE_FALLING>, /* Timer 2 */ <16 IRQ_TYPE_EDGE_FALLING>; /* Timer 3 */ - resets = <&syscon 17>; + resets = <&syscon GEMINI_RESET_TIMER>; /* APB clock or RTC clock */ - clocks = <&syscon 2>, <&syscon 0>; + clocks = <&syscon GEMINI_CLK_APB>, <&syscon GEMINI_CLK_RTC>; clock-names = "PCLK", "EXTCLK"; syscon = <&syscon>; }; @@ -76,20 +183,30 @@ compatible = "cortina,gemini-rtc"; reg = <0x45000000 0x100>; interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; - resets = <&syscon 16>; - clocks = <&syscon 2>, <&syscon 0>; + resets = <&syscon GEMINI_RESET_RTC>; + clocks = <&syscon GEMINI_CLK_APB>, <&syscon GEMINI_CLK_RTC>; clock-names = "PCLK", "EXTCLK"; + pinctrl-names = "default"; + pinctrl-0 = <&rtc_default_pins>; }; sata: sata@46000000 { compatible = "cortina,gemini-sata-bridge"; reg = <0x46000000 0x100>; - resets = <&syscon 26>, - <&syscon 27>; + resets = <&syscon GEMINI_RESET_SATA0>, + <&syscon GEMINI_RESET_SATA1>; reset-names = "sata0", "sata1"; - clocks = <&syscon 10>, - <&syscon 11>; + clocks = <&syscon GEMINI_CLK_GATE_SATA0>, + <&syscon GEMINI_CLK_GATE_SATA1>; clock-names = "SATA0_PCLK", "SATA1_PCLK"; + /* + * This defines the special "ide" state that needs + * to be explicitly enabled to enable the IDE pins, + * as these pins are normally used for other things. + */ + pinctrl-names = "default", "ide"; + pinctrl-0 = <&sata_default_pins>; + pinctrl-1 = <&sata_and_ide_pins>; syscon = <&syscon>; status = "disabled"; }; @@ -97,7 +214,7 @@ intcon: interrupt-controller@48000000 { compatible = "faraday,ftintc010"; reg = <0x48000000 0x1000>; - resets = <&syscon 14>; + resets = <&syscon GEMINI_RESET_INTCON0>; interrupt-controller; #interrupt-cells = <2>; }; @@ -106,14 +223,16 @@ compatible = "cortina,gemini-power-controller"; reg = <0x4b000000 0x100>; interrupts = <26 IRQ_TYPE_EDGE_RISING>; + pinctrl-names = "default"; + pinctrl-0 = <&power_default_pins>; }; gpio0: gpio@4d000000 { compatible = "cortina,gemini-gpio", "faraday,ftgpio010"; reg = <0x4d000000 0x100>; interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; - resets = <&syscon 20>; - clocks = <&syscon 2>; + resets = <&syscon GEMINI_RESET_GPIO0>; + clocks = <&syscon GEMINI_CLK_APB>; gpio-controller; #gpio-cells = <2>; interrupt-controller; @@ -124,8 +243,8 @@ compatible = "cortina,gemini-gpio", "faraday,ftgpio010"; reg = <0x4e000000 0x100>; interrupts = <23 IRQ_TYPE_LEVEL_HIGH>; - resets = <&syscon 21>; - clocks = <&syscon 2>; + resets = <&syscon GEMINI_RESET_GPIO1>; + clocks = <&syscon GEMINI_CLK_APB>; gpio-controller; #gpio-cells = <2>; interrupt-controller; @@ -136,8 +255,8 @@ compatible = "cortina,gemini-gpio", "faraday,ftgpio010"; reg = <0x4f000000 0x100>; interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; - resets = <&syscon 22>; - clocks = <&syscon 2>; + resets = <&syscon GEMINI_RESET_GPIO2>; + clocks = <&syscon GEMINI_CLK_APB>; gpio-controller; #gpio-cells = <2>; interrupt-controller; @@ -151,9 +270,11 @@ * to configure the host bridge. */ reg = <0x50000000 0x100>; - resets = <&syscon 7>; - clocks = <&syscon 15>, <&syscon 4>; + resets = <&syscon GEMINI_RESET_PCI>; + clocks = <&syscon GEMINI_CLK_GATE_PCI>, <&syscon GEMINI_CLK_PCI>; clock-names = "PCLK", "PCICLK"; + pinctrl-names = "default"; + pinctrl-0 = <&pci_default_pins>; #address-cells = <3>; #size-cells = <2>; #interrupt-cells = <1>; @@ -193,8 +314,8 @@ compatible = "cortina,gemini-pata", "faraday,ftide010"; reg = <0x63000000 0x1000>; interrupts = <4 IRQ_TYPE_EDGE_RISING>; - resets = <&syscon 2>; - clocks = <&syscon 14>; + resets = <&syscon GEMINI_RESET_IDE>; + clocks = <&syscon GEMINI_CLK_GATE_IDE>; clock-names = "PCLK"; sata = <&sata>; status = "disabled"; @@ -204,8 +325,8 @@ compatible = "cortina,gemini-pata", "faraday,ftide010"; reg = <0x63400000 0x1000>; interrupts = <5 IRQ_TYPE_EDGE_RISING>; - resets = <&syscon 2>; - clocks = <&syscon 14>; + resets = <&syscon GEMINI_RESET_IDE>; + clocks = <&syscon GEMINI_CLK_GATE_IDE>; clock-names = "PCLK"; sata = <&sata>; status = "disabled"; @@ -217,8 +338,8 @@ arm,primecell-periphid = <0x0003b080>; reg = <0x67000000 0x1000>; interrupts = <9 IRQ_TYPE_EDGE_RISING>; - resets = <&syscon 10>; - clocks = <&syscon 1>; + resets = <&syscon GEMINI_RESET_DMAC>; + clocks = <&syscon GEMINI_CLK_AHB>; clock-names = "apb_pclk"; /* Bus interface AHB1 (AHB0) is totally tilted */ lli-bus-interface-ahb2; diff --git a/src/arm/imx25.dtsi b/src/arm/imx25.dtsi index 0ade3619f3c3..09ce8b81fafa 100644 --- a/src/arm/imx25.dtsi +++ b/src/arm/imx25.dtsi @@ -452,6 +452,13 @@ interrupt-names = "scm", "smn"; }; + rngb: rngb@53fb0000 { + compatible = "fsl,imx25-rngb"; + reg = <0x53fb0000 0x4000>; + clocks = <&clks 109>; + interrupts = <22>; + }; + esdhc1: esdhc@53fb4000 { compatible = "fsl,imx25-esdhc"; reg = <0x53fb4000 0x4000>; diff --git a/src/arm/imx28-apx4devkit.dts b/src/arm/imx28-apx4devkit.dts index 1092b761d7ac..d2a91976e67f 100644 --- a/src/arm/imx28-apx4devkit.dts +++ b/src/arm/imx28-apx4devkit.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "imx28.dtsi" diff --git a/src/arm/imx53-cx9020.dts b/src/arm/imx53-cx9020.dts new file mode 100644 index 000000000000..4f54fd4418a3 --- /dev/null +++ b/src/arm/imx53-cx9020.dts @@ -0,0 +1,297 @@ +/* + * Copyright 2017 Beckhoff Automation GmbH & Co. KG + * based on imx53-qsb.dts + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +/dts-v1/; +#include "imx53.dtsi" + +/ { + model = "Beckhoff CX9020 Embedded PC"; + compatible = "bhf,cx9020", "fsl,imx53"; + + chosen { + stdout-path = &uart2; + }; + + memory { + reg = <0x70000000 0x20000000>, + <0xb0000000 0x20000000>; + }; + + display-0 { + #address-cells =<1>; + #size-cells = <0>; + compatible = "fsl,imx-parallel-display"; + interface-pix-fmt = "rgb24"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu_disp0>; + + port@0 { + reg = <0>; + + display0_in: endpoint { + remote-endpoint = <&ipu_di0_disp0>; + }; + }; + + port@1 { + reg = <1>; + + display0_out: endpoint { + remote-endpoint = <&tfp410_in>; + }; + }; + }; + + dvi-connector { + compatible = "dvi-connector"; + ddc-i2c-bus = <&i2c2>; + digital; + + port { + dvi_connector_in: endpoint { + remote-endpoint = <&tfp410_out>; + }; + }; + }; + + dvi-converter { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,tfp410"; + + port@0 { + reg = <0>; + + tfp410_in: endpoint { + remote-endpoint = <&display0_out>; + }; + }; + + port@1 { + reg = <1>; + + tfp410_out: endpoint { + remote-endpoint = <&dvi_connector_in>; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + + pwr-r { + gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + pwr-g { + gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + pwr-b { + gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + sd1-b { + linux,default-trigger = "mmc0"; + gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>; + }; + + sd2-b { + linux,default-trigger = "mmc1"; + gpios = <&gpio3 17 GPIO_ACTIVE_HIGH>; + }; + }; + + regulator-3p2v { + compatible = "regulator-fixed"; + regulator-name = "3P2V"; + regulator-min-microvolt = <3200000>; + regulator-max-microvolt = <3200000>; + regulator-always-on; + }; + + reg_usb_vbus: regulator-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio7 8 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&esdhc1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_esdhc1>; + cd-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>; + bus-width = <4>; + status = "okay"; +}; + +&esdhc2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_esdhc2>; + cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + bus-width = <4>; + status = "okay"; +}; + +&fec { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fec>; + phy-mode = "rmii"; + phy-reset-gpios = <&gpio7 6 GPIO_ACTIVE_HIGH>; + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c2>; + status = "okay"; +}; + +&ipu_di0_disp0 { + remote-endpoint = <&display0_in>; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart2>; + fsl,dte-mode; + status = "okay"; +}; + +&usbh1 { + vbus-supply = <®_usb_vbus>; + phy_type = "utmi"; + status = "okay"; +}; + +&usbotg { + dr_mode = "peripheral"; + status = "okay"; +}; + +&vpu { + status = "okay"; +}; + +&iomuxc { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hog>; + + pinctrl_hog: hoggrp { + fsl,pins = < + MX53_PAD_GPIO_0__CCM_CLKO 0x1c4 + MX53_PAD_GPIO_16__I2C3_SDA 0x1c4 + MX53_PAD_EIM_D22__GPIO3_22 0x1c4 + MX53_PAD_EIM_D23__GPIO3_23 0x1e4 + MX53_PAD_EIM_D24__GPIO3_24 0x1e4 + >; + }; + + pinctrl_esdhc1: esdhc1grp { + fsl,pins = < + MX53_PAD_SD1_DATA0__ESDHC1_DAT0 0x1d5 + MX53_PAD_SD1_DATA1__ESDHC1_DAT1 0x1d5 + MX53_PAD_SD1_DATA2__ESDHC1_DAT2 0x1d5 + MX53_PAD_SD1_DATA3__ESDHC1_DAT3 0x1d5 + MX53_PAD_SD1_CMD__ESDHC1_CMD 0x1d5 + MX53_PAD_SD1_CLK__ESDHC1_CLK 0x1d5 + MX53_PAD_GPIO_1__ESDHC1_CD 0x1c4 + MX53_PAD_EIM_D17__GPIO3_17 0x1e4 + MX53_PAD_GPIO_3__GPIO1_3 0x1c4 + >; + }; + + pinctrl_esdhc2: esdhc2grp { + fsl,pins = < + MX53_PAD_SD2_DATA0__ESDHC2_DAT0 0x1d5 + MX53_PAD_SD2_DATA1__ESDHC2_DAT1 0x1d5 + MX53_PAD_SD2_DATA2__ESDHC2_DAT2 0x1d5 + MX53_PAD_SD2_DATA3__ESDHC2_DAT3 0x1d5 + MX53_PAD_SD2_CMD__ESDHC2_CMD 0x1d5 + MX53_PAD_SD2_CLK__ESDHC2_CLK 0x1d5 + MX53_PAD_GPIO_4__ESDHC2_CD 0x1e4 + MX53_PAD_EIM_D20__GPIO3_20 0x1e4 + MX53_PAD_GPIO_8__GPIO1_8 0x1c4 + >; + }; + + pinctrl_fec: fecgrp { + fsl,pins = < + MX53_PAD_FEC_MDC__FEC_MDC 0x4 + MX53_PAD_FEC_MDIO__FEC_MDIO 0x1fc + MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x180 + MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x180 + MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x180 + MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x180 + MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x180 + MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x4 + MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x4 + MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x4 + >; + }; + + pinctrl_i2c2: i2c2grp { + fsl,pins = < + MX53_PAD_KEY_ROW3__I2C2_SDA 0xc0000000 + MX53_PAD_KEY_COL3__I2C2_SCL 0xc0000000 + >; + }; + + pinctrl_ipu_disp0: ipudisp0grp { + fsl,pins = < + MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK 0x5 + MX53_PAD_DI0_PIN15__IPU_DI0_PIN15 0x5 + MX53_PAD_DI0_PIN2__IPU_DI0_PIN2 0x5 + MX53_PAD_DI0_PIN3__IPU_DI0_PIN3 0x5 + MX53_PAD_DI0_PIN4__IPU_DI0_PIN4 0x5 + MX53_PAD_DISP0_DAT0__IPU_DISP0_DAT_0 0x5 + MX53_PAD_DISP0_DAT1__IPU_DISP0_DAT_1 0x5 + MX53_PAD_DISP0_DAT2__IPU_DISP0_DAT_2 0x5 + MX53_PAD_DISP0_DAT3__IPU_DISP0_DAT_3 0x5 + MX53_PAD_DISP0_DAT4__IPU_DISP0_DAT_4 0x5 + MX53_PAD_DISP0_DAT5__IPU_DISP0_DAT_5 0x5 + MX53_PAD_DISP0_DAT6__IPU_DISP0_DAT_6 0x5 + MX53_PAD_DISP0_DAT7__IPU_DISP0_DAT_7 0x5 + MX53_PAD_DISP0_DAT8__IPU_DISP0_DAT_8 0x5 + MX53_PAD_DISP0_DAT9__IPU_DISP0_DAT_9 0x5 + MX53_PAD_DISP0_DAT10__IPU_DISP0_DAT_10 0x5 + MX53_PAD_DISP0_DAT11__IPU_DISP0_DAT_11 0x5 + MX53_PAD_DISP0_DAT12__IPU_DISP0_DAT_12 0x5 + MX53_PAD_DISP0_DAT13__IPU_DISP0_DAT_13 0x5 + MX53_PAD_DISP0_DAT14__IPU_DISP0_DAT_14 0x5 + MX53_PAD_DISP0_DAT15__IPU_DISP0_DAT_15 0x5 + MX53_PAD_DISP0_DAT16__IPU_DISP0_DAT_16 0x5 + MX53_PAD_DISP0_DAT17__IPU_DISP0_DAT_17 0x5 + MX53_PAD_DISP0_DAT18__IPU_DISP0_DAT_18 0x5 + MX53_PAD_DISP0_DAT19__IPU_DISP0_DAT_19 0x5 + MX53_PAD_DISP0_DAT20__IPU_DISP0_DAT_20 0x5 + MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21 0x5 + MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22 0x5 + MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23 0x5 + >; + }; + + pinctrl_uart2: uart2grp { + fsl,pins = < + MX53_PAD_EIM_D26__UART2_RXD_MUX 0x1e4 + MX53_PAD_EIM_D27__UART2_TXD_MUX 0x1e4 + MX53_PAD_EIM_D28__UART2_RTS 0x1e4 + MX53_PAD_EIM_D29__UART2_CTS 0x1e4 + >; + }; +}; diff --git a/src/arm/imx53-pinfunc.h b/src/arm/imx53-pinfunc.h index aec406bc65eb..59f9c29e3fe2 100644 --- a/src/arm/imx53-pinfunc.h +++ b/src/arm/imx53-pinfunc.h @@ -524,6 +524,7 @@ #define MX53_PAD_EIM_D25__UART1_DSR 0x140 0x488 0x000 0x7 0x0 #define MX53_PAD_EIM_D26__EMI_WEIM_D_26 0x144 0x48c 0x000 0x0 0x0 #define MX53_PAD_EIM_D26__GPIO3_26 0x144 0x48c 0x000 0x1 0x0 +#define MX53_PAD_EIM_D26__UART2_RXD_MUX 0x144 0x48c 0x880 0x2 0x0 #define MX53_PAD_EIM_D26__UART2_TXD_MUX 0x144 0x48c 0x000 0x2 0x0 #define MX53_PAD_EIM_D26__FIRI_RXD 0x144 0x48c 0x80c 0x3 0x0 #define MX53_PAD_EIM_D26__IPU_CSI0_D_1 0x144 0x48c 0x000 0x4 0x0 @@ -533,6 +534,7 @@ #define MX53_PAD_EIM_D27__EMI_WEIM_D_27 0x148 0x490 0x000 0x0 0x0 #define MX53_PAD_EIM_D27__GPIO3_27 0x148 0x490 0x000 0x1 0x0 #define MX53_PAD_EIM_D27__UART2_RXD_MUX 0x148 0x490 0x880 0x2 0x1 +#define MX53_PAD_EIM_D27__UART2_TXD_MUX 0x148 0x490 0x000 0x2 0x0 #define MX53_PAD_EIM_D27__FIRI_TXD 0x148 0x490 0x000 0x3 0x0 #define MX53_PAD_EIM_D27__IPU_CSI0_D_0 0x148 0x490 0x000 0x4 0x0 #define MX53_PAD_EIM_D27__IPU_DI1_PIN13 0x148 0x490 0x000 0x5 0x0 @@ -541,6 +543,7 @@ #define MX53_PAD_EIM_D28__EMI_WEIM_D_28 0x14c 0x494 0x000 0x0 0x0 #define MX53_PAD_EIM_D28__GPIO3_28 0x14c 0x494 0x000 0x1 0x0 #define MX53_PAD_EIM_D28__UART2_CTS 0x14c 0x494 0x000 0x2 0x0 +#define MX53_PAD_EIM_D28__UART2_RTS 0x14c 0x494 0x87c 0x2 0x0 #define MX53_PAD_EIM_D28__IPU_DISPB0_SER_DIO 0x14c 0x494 0x82c 0x3 0x1 #define MX53_PAD_EIM_D28__CSPI_MOSI 0x14c 0x494 0x788 0x4 0x1 #define MX53_PAD_EIM_D28__I2C1_SDA 0x14c 0x494 0x818 0x5 0x1 @@ -548,6 +551,7 @@ #define MX53_PAD_EIM_D28__IPU_DI0_PIN13 0x14c 0x494 0x000 0x7 0x0 #define MX53_PAD_EIM_D29__EMI_WEIM_D_29 0x150 0x498 0x000 0x0 0x0 #define MX53_PAD_EIM_D29__GPIO3_29 0x150 0x498 0x000 0x1 0x0 +#define MX53_PAD_EIM_D29__UART2_CTS 0x150 0x498 0x000 0x2 0x0 #define MX53_PAD_EIM_D29__UART2_RTS 0x150 0x498 0x87c 0x2 0x1 #define MX53_PAD_EIM_D29__IPU_DISPB0_SER_RS 0x150 0x498 0x000 0x3 0x0 #define MX53_PAD_EIM_D29__CSPI_SS0 0x150 0x498 0x78c 0x4 0x2 diff --git a/src/arm/imx53.dtsi b/src/arm/imx53.dtsi index 2e516f4985e4..8bf0d89cdd35 100644 --- a/src/arm/imx53.dtsi +++ b/src/arm/imx53.dtsi @@ -433,6 +433,15 @@ clock-names = "ipg", "per"; }; + srtc: srtc@53fa4000 { + compatible = "fsl,imx53-rtc", "fsl,imx25-rtc"; + reg = <0x53fa4000 0x4000>; + interrupts = <24>; + interrupt-parent = <&tzic>; + clocks = <&clks IMX5_CLK_SRTC_GATE>; + clock-names = "ipg"; + }; + iomuxc: iomuxc@53fa8000 { compatible = "fsl,imx53-iomuxc"; reg = <0x53fa8000 0x4000>; diff --git a/src/arm/imx6dl-gw52xx.dts b/src/arm/imx6dl-gw52xx.dts index a2e0b73fdd4a..5f9f8948100d 100644 --- a/src/arm/imx6dl-gw52xx.dts +++ b/src/arm/imx6dl-gw52xx.dts @@ -17,3 +17,61 @@ model = "Gateworks Ventana i.MX6 DualLite/Solo GW52XX"; compatible = "gw,imx6dl-gw52xx", "gw,ventana", "fsl,imx6dl"; }; + +&i2c3 { + adv7180: camera@20 { + compatible = "adi,adv7180"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adv7180>; + reg = <0x20>; + powerdown-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio3>; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>; + + port { + adv7180_to_ipu1_csi1_mux: endpoint { + remote-endpoint = <&ipu1_csi1_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; +}; + +&ipu1_csi1_from_ipu1_csi1_mux { + bus-width = <8>; +}; + +&ipu1_csi1_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu1_csi1_mux>; + bus-width = <8>; +}; + +&ipu1_csi1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi1>; +}; + +&iomuxc { + pinctrl_adv7180: adv7180grp { + fsl,pins = < + MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x0001b0b0 + MX6QDL_PAD_EIM_D31__GPIO3_IO31 0x4001b0b0 + >; + }; + + pinctrl_ipu1_csi1: ipu1_csi1grp { + fsl,pins = < + MX6QDL_PAD_EIM_EB2__IPU1_CSI1_DATA19 0x1b0b0 + MX6QDL_PAD_EIM_D16__IPU1_CSI1_DATA18 0x1b0b0 + MX6QDL_PAD_EIM_D18__IPU1_CSI1_DATA17 0x1b0b0 + MX6QDL_PAD_EIM_D19__IPU1_CSI1_DATA16 0x1b0b0 + MX6QDL_PAD_EIM_D20__IPU1_CSI1_DATA15 0x1b0b0 + MX6QDL_PAD_EIM_D26__IPU1_CSI1_DATA14 0x1b0b0 + MX6QDL_PAD_EIM_D27__IPU1_CSI1_DATA13 0x1b0b0 + MX6QDL_PAD_EIM_A17__IPU1_CSI1_DATA12 0x1b0b0 + MX6QDL_PAD_EIM_D29__IPU1_CSI1_VSYNC 0x1b0b0 + MX6QDL_PAD_EIM_EB3__IPU1_CSI1_HSYNC 0x1b0b0 + MX6QDL_PAD_EIM_A16__IPU1_CSI1_PIXCLK 0x1b0b0 + >; + }; +}; diff --git a/src/arm/imx6dl-gw53xx.dts b/src/arm/imx6dl-gw53xx.dts index 6844b708d2f8..9bfc620d37bd 100644 --- a/src/arm/imx6dl-gw53xx.dts +++ b/src/arm/imx6dl-gw53xx.dts @@ -17,3 +17,61 @@ model = "Gateworks Ventana i.MX6 DualLite/Solo GW53XX"; compatible = "gw,imx6dl-gw53xx", "gw,ventana", "fsl,imx6dl"; }; + +&i2c3 { + adv7180: camera@20 { + compatible = "adi,adv7180"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adv7180>; + reg = <0x20>; + powerdown-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio3>; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>; + + port { + adv7180_to_ipu1_csi1_mux: endpoint { + remote-endpoint = <&ipu1_csi1_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; +}; + +&ipu1_csi1_from_ipu1_csi1_mux { + bus-width = <8>; +}; + +&ipu1_csi1_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu1_csi1_mux>; + bus-width = <8>; +}; + +&ipu1_csi1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi1>; +}; + +&iomuxc { + pinctrl_adv7180: adv7180grp { + fsl,pins = < + MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x0001b0b0 + MX6QDL_PAD_EIM_D31__GPIO3_IO31 0x4001b0b0 + >; + }; + + pinctrl_ipu1_csi1: ipu1_csi1grp { + fsl,pins = < + MX6QDL_PAD_EIM_EB2__IPU1_CSI1_DATA19 0x1b0b0 + MX6QDL_PAD_EIM_D16__IPU1_CSI1_DATA18 0x1b0b0 + MX6QDL_PAD_EIM_D18__IPU1_CSI1_DATA17 0x1b0b0 + MX6QDL_PAD_EIM_D19__IPU1_CSI1_DATA16 0x1b0b0 + MX6QDL_PAD_EIM_D20__IPU1_CSI1_DATA15 0x1b0b0 + MX6QDL_PAD_EIM_D26__IPU1_CSI1_DATA14 0x1b0b0 + MX6QDL_PAD_EIM_D27__IPU1_CSI1_DATA13 0x1b0b0 + MX6QDL_PAD_EIM_A17__IPU1_CSI1_DATA12 0x1b0b0 + MX6QDL_PAD_EIM_D29__IPU1_CSI1_VSYNC 0x1b0b0 + MX6QDL_PAD_EIM_EB3__IPU1_CSI1_HSYNC 0x1b0b0 + MX6QDL_PAD_EIM_A16__IPU1_CSI1_PIXCLK 0x1b0b0 + >; + }; +}; diff --git a/src/arm/imx6dl-gw54xx.dts b/src/arm/imx6dl-gw54xx.dts index be915412f852..b909bdf9a2ef 100644 --- a/src/arm/imx6dl-gw54xx.dts +++ b/src/arm/imx6dl-gw54xx.dts @@ -17,3 +17,61 @@ model = "Gateworks Ventana i.MX6 DualLite/Solo GW54XX"; compatible = "gw,imx6dl-gw54xx", "gw,ventana", "fsl,imx6dl"; }; + +&i2c3 { + adv7180: camera@20 { + compatible = "adi,adv7180"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adv7180>; + reg = <0x20>; + powerdown-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio3>; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>; + + port { + adv7180_to_ipu1_csi1_mux: endpoint { + remote-endpoint = <&ipu1_csi1_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; +}; + +&ipu1_csi1_from_ipu1_csi1_mux { + bus-width = <8>; +}; + +&ipu1_csi1_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu1_csi1_mux>; + bus-width = <8>; +}; + +&ipu1_csi1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi1>; +}; + +&iomuxc { + pinctrl_adv7180: adv7180grp { + fsl,pins = < + MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x0001b0b0 + MX6QDL_PAD_EIM_D31__GPIO3_IO31 0x4001b0b0 + >; + }; + + pinctrl_ipu1_csi1: ipu1_csi1grp { + fsl,pins = < + MX6QDL_PAD_EIM_EB2__IPU1_CSI1_DATA19 0x1b0b0 + MX6QDL_PAD_EIM_D16__IPU1_CSI1_DATA18 0x1b0b0 + MX6QDL_PAD_EIM_D18__IPU1_CSI1_DATA17 0x1b0b0 + MX6QDL_PAD_EIM_D19__IPU1_CSI1_DATA16 0x1b0b0 + MX6QDL_PAD_EIM_D20__IPU1_CSI1_DATA15 0x1b0b0 + MX6QDL_PAD_EIM_D26__IPU1_CSI1_DATA14 0x1b0b0 + MX6QDL_PAD_EIM_D27__IPU1_CSI1_DATA13 0x1b0b0 + MX6QDL_PAD_EIM_A17__IPU1_CSI1_DATA12 0x1b0b0 + MX6QDL_PAD_EIM_D29__IPU1_CSI1_VSYNC 0x1b0b0 + MX6QDL_PAD_EIM_EB3__IPU1_CSI1_HSYNC 0x1b0b0 + MX6QDL_PAD_EIM_A16__IPU1_CSI1_PIXCLK 0x1b0b0 + >; + }; +}; diff --git a/src/arm/imx6dl-riotboard.dts b/src/arm/imx6dl-riotboard.dts index 29b45f2e64e0..275c6c05219d 100644 --- a/src/arm/imx6dl-riotboard.dts +++ b/src/arm/imx6dl-riotboard.dts @@ -101,6 +101,51 @@ status = "okay"; }; +&gpio1 { + gpio-line-names = + "", "", "SD2_WP", "", "SD2_CD", "I2C3_SCL", + "I2C3_SDA", "I2C4_SCL", + "I2C4_SDA", "", "", "", "", "", "", "", + "", "PWM3", "", "", "", "", "", "", + "", "", "", "", "", "", "", ""; +}; + +&gpio3 { + gpio-line-names = + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "USB_OTG_VBUS", "", + "UART3_TXD", "UART3_RXD", "", "", "EIM_D28", "", "", ""; +}; + +&gpio4 { + gpio-line-names = + "", "", "", "", "", "", "UART4_TXD", "UART4_RXD", + "UART5_TXD", "UART5_RXD", "", "", "", "", "", "", + "GPIO4_16", "GPIO4_17", "GPIO4_18", "GPIO4_19", "", + "CSPI3_CLK", "CSPI3_MOSI", "CSPI3_MISO", + "CSPI3_CS0", "CSPI3_CS1", "GPIO4_26", "GPIO4_27", + "CSPI3_RDY", "PWM1", "PWM2", "GPIO4_31"; +}; + +&gpio5 { + gpio-line-names = + "", "", "EIM_A25", "", "", "GPIO5_05", "GPIO5_06", + "GPIO5_07", + "GPIO5_08", "CSPI2_CS1", "CSPI2_MOSI", "CSPI2_MISO", + "CSPI2_CS0", "CSPI2_CLK", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", ""; +}; + +&gpio7 { + gpio-line-names = + "SD3_CD", "SD3_WP", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", ""; +}; + &hdmi { ddc-i2c-bus = <&i2c2>; status = "okay"; diff --git a/src/arm/imx6q-apalis-eval.dts b/src/arm/imx6q-apalis-eval.dts new file mode 100644 index 000000000000..4bbfe3d61027 --- /dev/null +++ b/src/arm/imx6q-apalis-eval.dts @@ -0,0 +1,278 @@ +/* + * Copyright 2014-2017 Toradex AG + * Copyright 2012 Freescale Semiconductor, Inc. + * Copyright 2011 Linaro Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; + +#include +#include +#include +#include "imx6q.dtsi" +#include "imx6qdl-apalis.dtsi" + +/ { + model = "Toradex Apalis iMX6Q/D Module on Apalis Evaluation Board"; + compatible = "toradex,apalis_imx6q-eval", "toradex,apalis_imx6q", + "fsl,imx6q"; + + aliases { + i2c0 = &i2c1; + i2c1 = &i2c3; + i2c2 = &i2c2; + rtc0 = &rtc_i2c; + rtc1 = &snvs_rtc; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_keys>; + + wakeup { + label = "Wake-Up"; + gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <10>; + wakeup-source; + }; + }; + + lcd_display: display@di0 { + compatible = "fsl,imx-parallel-display"; + #address-cells = <1>; + #size-cells = <0>; + interface-pix-fmt = "rgb24"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_lcdif>; + status = "okay"; + + port@0 { + reg = <0>; + + lcd_display_in: endpoint { + remote-endpoint = <&ipu1_di1_disp1>; + }; + }; + + port@1 { + reg = <1>; + + lcd_display_out: endpoint { + remote-endpoint = <&lcd_panel_in>; + }; + }; + }; + + panel: panel { + /* + * edt,et057090dhu: EDT 5.7" LCD TFT + * edt,et070080dh6: EDT 7.0" LCD TFT + */ + compatible = "edt,et057090dhu"; + backlight = <&backlight>; + + port { + lcd_panel_in: endpoint { + remote-endpoint = <&lcd_display_out>; + }; + }; + }; + + reg_pcie_switch: regulator-pcie-switch { + compatible = "regulator-fixed"; + regulator-name = "pcie_switch"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>; + startup-delay-us = <100000>; + enable-active-high; + status = "okay"; + }; +}; + +&backlight { + brightness-levels = <0 127 191 223 239 247 251 255>; + default-brightness-level = <1>; + status = "okay"; +}; + +&can1 { + status = "okay"; +}; + +&can2 { + status = "okay"; +}; + +&hdmi { + status = "okay"; +}; + +/* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */ +&i2c1 { + status = "okay"; + + pcie-switch@58 { + compatible = "plx,pex8605"; + reg = <0x58>; + }; + + /* M41T0M6 real time clock on carrier board */ + rtc_i2c: rtc@68 { + compatible = "st,m41t00"; + reg = <0x68>; + }; +}; + +/* + * I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor on carrier + * board) + */ +&i2c3 { + status = "okay"; +}; + +&ipu1_di1_disp1 { + remote-endpoint = <&lcd_display_in>; +}; + +&ldb { + status = "okay"; +}; + +&pcie { + /* active-high meaning opposite of regular PERST# active-low polarity */ + reset-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>; + reset-gpio-active-high; + vpcie-supply = <®_pcie_switch>; + status = "okay"; +}; + +&pwm1 { + status = "okay"; +}; + +&pwm2 { + status = "okay"; +}; + +&pwm3 { + status = "okay"; +}; + +&pwm4 { + status = "okay"; +}; + +®_usb_otg_vbus { + status = "okay"; +}; + +®_usb_host_vbus { + status = "okay"; +}; + +&sata { + status = "okay"; +}; + +&sound_spdif { + status = "okay"; +}; + +&spdif { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&uart4 { + status = "okay"; +}; + +&uart5 { + status = "okay"; +}; + +&usbh1 { + vbus-supply = <®_usb_host_vbus>; + status = "okay"; +}; + +&usbotg { + vbus-supply = <®_usb_otg_vbus>; + status = "okay"; +}; + +/* MMC1 */ +&usdhc1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_usdhc1_8bit &pinctrl_mmc_cd>; + cd-gpios = <&gpio4 20 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +/* SD1 */ +&usdhc2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc2 &pinctrl_sd_cd>; + cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +&iomuxc { + /* + * Mux the Apalis GPIOs + */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_gpio2 + &pinctrl_apalis_gpio3 &pinctrl_apalis_gpio4 + &pinctrl_apalis_gpio5 &pinctrl_apalis_gpio6 + &pinctrl_apalis_gpio7 &pinctrl_apalis_gpio8 + >; +}; diff --git a/src/arm/imx6q-apalis-ixora-v1.1.dts b/src/arm/imx6q-apalis-ixora-v1.1.dts new file mode 100644 index 000000000000..a35c7a54ad3b --- /dev/null +++ b/src/arm/imx6q-apalis-ixora-v1.1.dts @@ -0,0 +1,291 @@ +/* + * Copyright 2014-2017 Toradex AG + * Copyright 2012 Freescale Semiconductor, Inc. + * Copyright 2011 Linaro Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; + +#include +#include +#include +#include "imx6q.dtsi" +#include "imx6qdl-apalis.dtsi" + +/ { + model = "Toradex Apalis iMX6Q/D Module on Ixora Carrier Board V1.1"; + compatible = "toradex,apalis_imx6q-ixora-v1.1", + "toradex,apalis_imx6q-ixora", "toradex,apalis_imx6q", + "fsl,imx6q"; + + aliases { + i2c0 = &i2c1; + i2c1 = &i2c3; + i2c2 = &i2c2; + rtc0 = &rtc_i2c; + rtc1 = &snvs_rtc; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_keys>; + + wakeup { + label = "Wake-Up"; + gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <10>; + wakeup-source; + }; + }; + + lcd_display: display@di0 { + compatible = "fsl,imx-parallel-display"; + #address-cells = <1>; + #size-cells = <0>; + interface-pix-fmt = "rgb24"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_lcdif>; + status = "okay"; + + port@0 { + reg = <0>; + + lcd_display_in: endpoint { + remote-endpoint = <&ipu1_di1_disp1>; + }; + }; + + port@1 { + reg = <1>; + + lcd_display_out: endpoint { + remote-endpoint = <&lcd_panel_in>; + }; + }; + }; + + panel: panel { + /* + * edt,et057090dhu: EDT 5.7" LCD TFT + * edt,et070080dh6: EDT 7.0" LCD TFT + */ + compatible = "edt,et057090dhu"; + backlight = <&backlight>; + + port { + lcd_panel_in: endpoint { + remote-endpoint = <&lcd_display_out>; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds_ixora>; + + led4-green { + label = "LED_4_GREEN"; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + }; + + led4-red { + label = "LED_4_RED"; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; + }; + + led5-green { + label = "LED_5_GREEN"; + gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; + }; + + led5-red { + label = "LED_5_RED"; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&backlight { + brightness-levels = <0 127 191 223 239 247 251 255>; + default-brightness-level = <1>; + status = "okay"; +}; + +&can1 { + status = "okay"; +}; + +&can2 { + status = "okay"; +}; + +&hdmi { + status = "okay"; +}; + +/* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */ +&i2c1 { + status = "okay"; + + /* M41T0M6 real time clock on carrier board */ + rtc_i2c: rtc@68 { + compatible = "st,m41t00"; + reg = <0x68>; + }; +}; + +/* + * I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor on carrier + * board) + */ +&i2c3 { + status = "okay"; +}; + +&ipu1_di1_disp1 { + remote-endpoint = <&lcd_display_in>; +}; + +&ldb { + status = "okay"; +}; + +&pcie { + /* active-high meaning opposite of regular PERST# active-low polarity */ + reset-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>; + reset-gpio-active-high; + status = "okay"; +}; + +&pwm1 { + status = "okay"; +}; + +&pwm2 { + status = "okay"; +}; + +&pwm3 { + status = "okay"; +}; + +&pwm4 { + status = "okay"; +}; + +®_usb_otg_vbus { + status = "okay"; +}; + +®_usb_host_vbus { + status = "okay"; +}; + +&sata { + status = "okay"; +}; + +&sound_spdif { + status = "okay"; +}; + +&spdif { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&uart4 { + status = "okay"; +}; + +&uart5 { + status = "okay"; +}; + +&usbh1 { + vbus-supply = <®_usb_host_vbus>; + status = "okay"; +}; + +&usbotg { + vbus-supply = <®_usb_otg_vbus>; + status = "okay"; +}; + +/* MMC1 */ +&usdhc1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_mmc_cd>; + cd-gpios = <&gpio4 20 GPIO_ACTIVE_LOW>; + bus-width = <4>; + status = "okay"; +}; + +&iomuxc { + /* + * Mux the Apalis GPIOs + */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_gpio2 + &pinctrl_apalis_gpio3 &pinctrl_apalis_gpio4 + &pinctrl_apalis_gpio5 &pinctrl_apalis_gpio6 + &pinctrl_apalis_gpio7 &pinctrl_apalis_gpio8 + >; + + pinctrl_leds_ixora: ledsixoragrp { + fsl,pins = < + MX6QDL_PAD_SD2_DAT1__GPIO1_IO14 0x1b0b0 + MX6QDL_PAD_SD2_DAT3__GPIO1_IO12 0x1b0b0 + MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0 + MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x1b0b0 + >; + }; +}; diff --git a/src/arm/imx6q-apalis-ixora.dts b/src/arm/imx6q-apalis-ixora.dts index 88cc7f51a4e9..60d33e99de76 100644 --- a/src/arm/imx6q-apalis-ixora.dts +++ b/src/arm/imx6q-apalis-ixora.dts @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 Toradex AG + * Copyright 2014-2017 Toradex AG * Copyright 2012 Freescale Semiconductor, Inc. * Copyright 2011 Linaro Ltd. * @@ -55,13 +55,9 @@ "fsl,imx6q"; aliases { - i2c0 = &i2cddc; - i2c1 = &i2c1; + i2c0 = &i2c1; + i2c1 = &i2c3; i2c2 = &i2c2; - i2c3 = &i2c3; - }; - - aliases { rtc0 = &rtc_i2c; rtc1 = &snvs_rtc; }; @@ -164,15 +160,10 @@ }; &hdmi { - ddc-i2c-bus = <&i2cddc>; status = "okay"; }; -&i2cddc { - status = "okay"; -}; - -/* GEN1_I2C: I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */ +/* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */ &i2c1 { status = "okay"; @@ -188,6 +179,14 @@ }; }; +/* + * I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor on carrier + * board) + */ +&i2c3 { + status = "okay"; +}; + &ipu1_di1_disp1 { remote-endpoint = <&lcd_display_in>; }; @@ -268,16 +267,13 @@ /* SD1 */ &usdhc2 { pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_sd_cd>; + pinctrl-0 = <&pinctrl_usdhc2 &pinctrl_sd_cd>; cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>; status = "okay"; }; &iomuxc { - /* - * Mux the Apalis GPIOs - * GPIO5, 6 used by optional fusion_F0710A kernel module - */ + /* Mux the Apalis GPIOs */ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_gpio2 &pinctrl_apalis_gpio3 &pinctrl_apalis_gpio4 diff --git a/src/arm/imx6q-b850v3.dts b/src/arm/imx6q-b850v3.dts index 2c1e98e0cf7b..46bdc6722715 100644 --- a/src/arm/imx6q-b850v3.dts +++ b/src/arm/imx6q-b850v3.dts @@ -57,7 +57,7 @@ assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>, <&clks IMX6QDL_CLK_LDB_DI1_SEL>, <&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>, - <&clks IMX6QDL_CLK_IPU1_DI1_PRE_SEL>; + <&clks IMX6QDL_CLK_IPU2_DI0_PRE_SEL>; assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>, <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>, <&clks IMX6QDL_CLK_PLL2_PFD2_396M>, diff --git a/src/arm/imx6q-bx50v3.dtsi b/src/arm/imx6q-bx50v3.dtsi index c90b26f00e24..1015e55ca8f7 100644 --- a/src/arm/imx6q-bx50v3.dtsi +++ b/src/arm/imx6q-bx50v3.dtsi @@ -111,6 +111,11 @@ }; &i2c1 { + pinctrl-names = "default", "gpio"; + pinctrl-1 = <&pinctrl_i2c1_gpio>; + sda-gpios = <&gpio5 26 GPIO_ACTIVE_HIGH>; + scl-gpios = <&gpio5 27 GPIO_ACTIVE_HIGH>; + pca9547: mux@70 { compatible = "nxp,pca9547"; reg = <0x70>; @@ -261,6 +266,43 @@ }; }; +&i2c2 { + pinctrl-names = "default", "gpio"; + pinctrl-1 = <&pinctrl_i2c2_gpio>; + sda-gpios = <&gpio4 13 GPIO_ACTIVE_HIGH>; + scl-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>; +}; + +&i2c3 { + pinctrl-names = "default", "gpio"; + pinctrl-1 = <&pinctrl_i2c3_gpio>; + sda-gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>; + scl-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; +}; + +&iomuxc { + pinctrl_i2c1_gpio: i2c1gpiogrp { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT8__GPIO5_IO26 0x1b0b0 + MX6QDL_PAD_CSI0_DAT9__GPIO5_IO27 0x1b0b0 + >; + }; + + pinctrl_i2c2_gpio: i2c2gpiogrp { + fsl,pins = < + MX6QDL_PAD_KEY_COL3__GPIO4_IO12 0x1b0b0 + MX6QDL_PAD_KEY_ROW3__GPIO4_IO13 0x1b0b0 + >; + }; + + pinctrl_i2c3_gpio: i2c3gpiogrp { + fsl,pins = < + MX6QDL_PAD_GPIO_3__GPIO1_IO03 0x1b0b0 + MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x1b0b0 + >; + }; +}; + &usdhc4 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usdhc4>; diff --git a/src/arm/imx6q-evi.dts b/src/arm/imx6q-evi.dts index 1f0f950dc11e..e0aea782c666 100644 --- a/src/arm/imx6q-evi.dts +++ b/src/arm/imx6q-evi.dts @@ -94,6 +94,15 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_ecspi1cs>; status = "okay"; + + fpga: fpga@0 { + compatible = "altr,fpga-passive-serial"; + spi-max-frequency = <20000000>; + reg = <0>; + pinctrl-0 = <&pinctrl_fpgaspi>; + nconfig-gpios = <&gpio4 9 GPIO_ACTIVE_LOW>; + nstat-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>; + }; }; &ecspi3 { @@ -319,6 +328,13 @@ >; }; + pinctrl_fpgaspi: fpgaspigrp { + fsl,pins = < + MX6QDL_PAD_KEY_ROW1__GPIO4_IO09 0x1b0b0 + MX6QDL_PAD_KEY_ROW2__GPIO4_IO11 0x1b0b0 + >; + }; + pinctrl_gpminand: gpminandgrp { fsl,pins = < MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1 diff --git a/src/arm/imx6q-gw52xx.dts b/src/arm/imx6q-gw52xx.dts index a12c47e5ee05..0b8ae007ad73 100644 --- a/src/arm/imx6q-gw52xx.dts +++ b/src/arm/imx6q-gw52xx.dts @@ -18,6 +18,64 @@ compatible = "gw,imx6q-gw52xx", "gw,ventana", "fsl,imx6q"; }; +&i2c3 { + adv7180: camera@20 { + compatible = "adi,adv7180"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adv7180>; + reg = <0x20>; + powerdown-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio3>; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>; + + port { + adv7180_to_ipu2_csi1_mux: endpoint { + remote-endpoint = <&ipu2_csi1_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; +}; + +&ipu2_csi1_from_ipu2_csi1_mux { + bus-width = <8>; +}; + +&ipu2_csi1_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu2_csi1_mux>; + bus-width = <8>; +}; + +&ipu2_csi1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu2_csi1>; +}; + +&iomuxc { + pinctrl_adv7180: adv7180grp { + fsl,pins = < + MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x0001b0b0 + MX6QDL_PAD_EIM_D31__GPIO3_IO31 0x4001b0b0 + >; + }; + + pinctrl_ipu2_csi1: ipu2_csi1grp { + fsl,pins = < + MX6QDL_PAD_EIM_EB2__IPU2_CSI1_DATA19 0x1b0b0 + MX6QDL_PAD_EIM_D16__IPU2_CSI1_DATA18 0x1b0b0 + MX6QDL_PAD_EIM_D18__IPU2_CSI1_DATA17 0x1b0b0 + MX6QDL_PAD_EIM_D19__IPU2_CSI1_DATA16 0x1b0b0 + MX6QDL_PAD_EIM_D20__IPU2_CSI1_DATA15 0x1b0b0 + MX6QDL_PAD_EIM_D26__IPU2_CSI1_DATA14 0x1b0b0 + MX6QDL_PAD_EIM_D27__IPU2_CSI1_DATA13 0x1b0b0 + MX6QDL_PAD_EIM_A17__IPU2_CSI1_DATA12 0x1b0b0 + MX6QDL_PAD_EIM_D29__IPU2_CSI1_VSYNC 0x1b0b0 + MX6QDL_PAD_EIM_EB3__IPU2_CSI1_HSYNC 0x1b0b0 + MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK 0x1b0b0 + >; + }; +}; + &sata { status = "okay"; }; diff --git a/src/arm/imx6q-gw53xx.dts b/src/arm/imx6q-gw53xx.dts index d76aaa83dad0..a56ef77eff3f 100644 --- a/src/arm/imx6q-gw53xx.dts +++ b/src/arm/imx6q-gw53xx.dts @@ -18,6 +18,64 @@ compatible = "gw,imx6q-gw53xx", "gw,ventana", "fsl,imx6q"; }; +&i2c3 { + adv7180: camera@20 { + compatible = "adi,adv7180"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adv7180>; + reg = <0x20>; + powerdown-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio3>; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>; + + port { + adv7180_to_ipu2_csi1_mux: endpoint { + remote-endpoint = <&ipu2_csi1_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; +}; + +&ipu2_csi1_from_ipu2_csi1_mux { + bus-width = <8>; +}; + +&ipu2_csi1_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu2_csi1_mux>; + bus-width = <8>; +}; + +&ipu2_csi1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu2_csi1>; +}; + &sata { status = "okay"; }; + +&iomuxc { + pinctrl_adv7180: adv7180grp { + fsl,pins = < + MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x0001b0b0 + MX6QDL_PAD_EIM_D31__GPIO3_IO31 0x4001b0b0 + >; + }; + + pinctrl_ipu2_csi1: ipu2_csi1grp { + fsl,pins = < + MX6QDL_PAD_EIM_EB2__IPU2_CSI1_DATA19 0x1b0b0 + MX6QDL_PAD_EIM_D16__IPU2_CSI1_DATA18 0x1b0b0 + MX6QDL_PAD_EIM_D18__IPU2_CSI1_DATA17 0x1b0b0 + MX6QDL_PAD_EIM_D19__IPU2_CSI1_DATA16 0x1b0b0 + MX6QDL_PAD_EIM_D20__IPU2_CSI1_DATA15 0x1b0b0 + MX6QDL_PAD_EIM_D26__IPU2_CSI1_DATA14 0x1b0b0 + MX6QDL_PAD_EIM_D27__IPU2_CSI1_DATA13 0x1b0b0 + MX6QDL_PAD_EIM_A17__IPU2_CSI1_DATA12 0x1b0b0 + MX6QDL_PAD_EIM_D29__IPU2_CSI1_VSYNC 0x1b0b0 + MX6QDL_PAD_EIM_EB3__IPU2_CSI1_HSYNC 0x1b0b0 + MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK 0x1b0b0 + >; + }; +}; diff --git a/src/arm/imx6q-gw54xx.dts b/src/arm/imx6q-gw54xx.dts index 6e8f53e92a2d..56e5b5050fcf 100644 --- a/src/arm/imx6q-gw54xx.dts +++ b/src/arm/imx6q-gw54xx.dts @@ -18,6 +18,64 @@ compatible = "gw,imx6q-gw54xx", "gw,ventana", "fsl,imx6q"; }; +&i2c3 { + adv7180: camera@20 { + compatible = "adi,adv7180"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adv7180>; + reg = <0x20>; + powerdown-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio3>; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>; + + port { + adv7180_to_ipu2_csi1_mux: endpoint { + remote-endpoint = <&ipu2_csi1_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; +}; + +&ipu2_csi1_from_ipu2_csi1_mux { + bus-width = <8>; +}; + +&ipu2_csi1_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu2_csi1_mux>; + bus-width = <8>; +}; + +&ipu2_csi1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu2_csi1>; +}; + &sata { status = "okay"; }; + +&iomuxc { + pinctrl_adv7180: adv7180grp { + fsl,pins = < + MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x0001b0b0 + MX6QDL_PAD_EIM_D31__GPIO3_IO31 0x4001b0b0 + >; + }; + + pinctrl_ipu2_csi1: ipu2_csi1grp { + fsl,pins = < + MX6QDL_PAD_EIM_EB2__IPU2_CSI1_DATA19 0x1b0b0 + MX6QDL_PAD_EIM_D16__IPU2_CSI1_DATA18 0x1b0b0 + MX6QDL_PAD_EIM_D18__IPU2_CSI1_DATA17 0x1b0b0 + MX6QDL_PAD_EIM_D19__IPU2_CSI1_DATA16 0x1b0b0 + MX6QDL_PAD_EIM_D20__IPU2_CSI1_DATA15 0x1b0b0 + MX6QDL_PAD_EIM_D26__IPU2_CSI1_DATA14 0x1b0b0 + MX6QDL_PAD_EIM_D27__IPU2_CSI1_DATA13 0x1b0b0 + MX6QDL_PAD_EIM_A17__IPU2_CSI1_DATA12 0x1b0b0 + MX6QDL_PAD_EIM_D29__IPU2_CSI1_VSYNC 0x1b0b0 + MX6QDL_PAD_EIM_EB3__IPU2_CSI1_HSYNC 0x1b0b0 + MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK 0x1b0b0 + >; + }; +}; diff --git a/src/arm/imx6qdl-apalis.dtsi b/src/arm/imx6qdl-apalis.dtsi index ba01dd76d887..ea339fa58f4a 100644 --- a/src/arm/imx6qdl-apalis.dtsi +++ b/src/arm/imx6qdl-apalis.dtsi @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 Toradex AG + * Copyright 2014-2017 Toradex AG * Copyright 2012 Freescale Semiconductor, Inc. * Copyright 2011 Linaro Ltd. * @@ -56,18 +56,6 @@ status = "disabled"; }; - /* DDC_I2C: I2C2_SDA/SCL on MXM3 205/207 */ - i2cddc: i2c@0 { - compatible = "i2c-gpio"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_i2c_ddc>; - gpios = <&gpio3 16 GPIO_ACTIVE_HIGH /* sda */ - &gpio2 30 GPIO_ACTIVE_HIGH /* scl */ - >; - i2c-gpio,delay-us = <2>; /* ~100 kHz */ - status = "disabled"; - }; - reg_1p8v: regulator-1p8v { compatible = "regulator-fixed"; regulator-name = "1P8V"; @@ -210,10 +198,13 @@ }; }; -/* - * GEN1_I2C: I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier - * board) - */ +&hdmi { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_hdmi_ddc>; + status = "disabled"; +}; + +/* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */ &i2c1 { clock-frequency = <100000>; pinctrl-names = "default"; @@ -374,7 +365,8 @@ }; /* - * GEN2_I2C, CAM: I2C3_SDA/SCL on MXM3 201/203 (unused) + * I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor on carrier + * board) */ &i2c3 { clock-frequency = <100000>; @@ -460,7 +452,7 @@ /* MMC1 */ &usdhc1 { pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_usdhc1>; + pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_usdhc1_8bit>; vqmmc-supply = <®_3p3v>; bus-width = <8>; voltage-ranges = <3300 3300>; @@ -640,11 +632,10 @@ >; }; - pinctrl_i2c_ddc: gpioi2cddcgrp { + pinctrl_hdmi_ddc: hdmiddcgrp { fsl,pins = < - /* DDC bitbang */ - MX6QDL_PAD_EIM_EB2__GPIO2_IO30 0x1b0b0 - MX6QDL_PAD_EIM_D16__GPIO3_IO16 0x1b0b0 + MX6QDL_PAD_EIM_EB2__HDMI_TX_DDC_SCL 0x4001b8b1 + MX6QDL_PAD_EIM_D16__HDMI_TX_DDC_SDA 0x4001b8b1 >; }; @@ -912,7 +903,7 @@ >; }; - pinctrl_usdhc1: usdhc1grp { + pinctrl_usdhc1_4bit: usdhc1grp_4bit { fsl,pins = < MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17071 MX6QDL_PAD_SD1_CLK__SD1_CLK 0x10071 @@ -920,6 +911,11 @@ MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17071 MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17071 MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17071 + >; + }; + + pinctrl_usdhc1_8bit: usdhc1grp_8bit { + fsl,pins = < MX6QDL_PAD_NANDF_D0__SD1_DATA4 0x17071 MX6QDL_PAD_NANDF_D1__SD1_DATA5 0x17071 MX6QDL_PAD_NANDF_D2__SD1_DATA6 0x17071 diff --git a/src/arm/imx6qdl-dfi-fs700-m60.dtsi b/src/arm/imx6qdl-dfi-fs700-m60.dtsi index d78312c63672..ebe7a8bddf04 100644 --- a/src/arm/imx6qdl-dfi-fs700-m60.dtsi +++ b/src/arm/imx6qdl-dfi-fs700-m60.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include / { diff --git a/src/arm/imx6qdl-gw51xx.dtsi b/src/arm/imx6qdl-gw51xx.dtsi index e8c1edc82e6e..885556260bd0 100644 --- a/src/arm/imx6qdl-gw51xx.dtsi +++ b/src/arm/imx6qdl-gw51xx.dtsi @@ -231,6 +231,37 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; + + adv7180: camera@20 { + compatible = "adi,adv7180"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adv7180>; + reg = <0x20>; + powerdown-gpios = <&gpio5 20 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio5>; + interrupts = <23 IRQ_TYPE_LEVEL_LOW>; + + port { + adv7180_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; +}; + +&ipu1_csi0_from_ipu1_csi0_mux { + bus-width = <8>; +}; + +&ipu1_csi0_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu1_csi0_mux>; + bus-width = <8>; +}; + +&ipu1_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi0>; }; &pcie { @@ -302,6 +333,13 @@ &iomuxc { imx6qdl-gw51xx { + pinctrl_adv7180: adv7180grp { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT5__GPIO5_IO23 0x0001b0b0 + MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 0x4001b0b0 + >; + }; + pinctrl_enet: enetgrp { fsl,pins = < MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b030 @@ -372,6 +410,22 @@ >; }; + pinctrl_ipu1_csi0: ipu1csi0grp { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x1b0b0 + MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x1b0b0 + MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x1b0b0 + MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x1b0b0 + MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x1b0b0 + MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x1b0b0 + MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18 0x1b0b0 + MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 0x1b0b0 + MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC 0x1b0b0 + MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC 0x1b0b0 + MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x1b0b0 + >; + }; + pinctrl_pcie: pciegrp { fsl,pins = < MX6QDL_PAD_GPIO_0__GPIO1_IO00 0x1b0b0 diff --git a/src/arm/imx6qdl-gw52xx.dtsi b/src/arm/imx6qdl-gw52xx.dtsi index 91991d63a69c..115d706228ef 100644 --- a/src/arm/imx6qdl-gw52xx.dtsi +++ b/src/arm/imx6qdl-gw52xx.dtsi @@ -377,7 +377,6 @@ &uart1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; - uart-has-rtscts; rts-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; status = "okay"; }; diff --git a/src/arm/imx6qdl-gw53xx.dtsi b/src/arm/imx6qdl-gw53xx.dtsi index 5bc6ed1a5b35..24be7965056c 100644 --- a/src/arm/imx6qdl-gw53xx.dtsi +++ b/src/arm/imx6qdl-gw53xx.dtsi @@ -368,7 +368,6 @@ &uart1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; - uart-has-rtscts; rts-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; status = "okay"; }; diff --git a/src/arm/imx6qdl-gw54xx.dtsi b/src/arm/imx6qdl-gw54xx.dtsi index 66fcf838e964..4594b2279169 100644 --- a/src/arm/imx6qdl-gw54xx.dtsi +++ b/src/arm/imx6qdl-gw54xx.dtsi @@ -416,7 +416,6 @@ &uart1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; - uart-has-rtscts; rts-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; status = "okay"; }; diff --git a/src/arm/imx6qdl-gw553x.dtsi b/src/arm/imx6qdl-gw553x.dtsi index 57374dddf98d..1a0faa1a14c8 100644 --- a/src/arm/imx6qdl-gw553x.dtsi +++ b/src/arm/imx6qdl-gw553x.dtsi @@ -261,6 +261,37 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; + + adv7180: camera@20 { + compatible = "adi,adv7180"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adv7180>; + reg = <0x20>; + powerdown-gpios = <&gpio5 20 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio5>; + interrupts = <23 IRQ_TYPE_LEVEL_LOW>; + + port { + adv7180_to_ipu1_csi0_mux: endpoint { + remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>; + bus-width = <8>; + }; + }; + }; +}; + +&ipu1_csi0_from_ipu1_csi0_mux { + bus-width = <8>; +}; + +&ipu1_csi0_mux_from_parallel_sensor { + remote-endpoint = <&adv7180_to_ipu1_csi0_mux>; + bus-width = <8>; +}; + +&ipu1_csi0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ipu1_csi0>; }; &pcie { @@ -340,6 +371,13 @@ }; &iomuxc { + pinctrl_adv7180: adv7180grp { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT5__GPIO5_IO23 0x0001b0b0 + MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 0x4001b0b0 + >; + }; + pinctrl_gpmi_nand: gpminandgrp { fsl,pins = < MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1 @@ -387,6 +425,22 @@ >; }; + pinctrl_ipu1_csi0: ipu1csi0grp { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT12__IPU1_CSI0_DATA12 0x1b0b0 + MX6QDL_PAD_CSI0_DAT13__IPU1_CSI0_DATA13 0x1b0b0 + MX6QDL_PAD_CSI0_DAT14__IPU1_CSI0_DATA14 0x1b0b0 + MX6QDL_PAD_CSI0_DAT15__IPU1_CSI0_DATA15 0x1b0b0 + MX6QDL_PAD_CSI0_DAT16__IPU1_CSI0_DATA16 0x1b0b0 + MX6QDL_PAD_CSI0_DAT17__IPU1_CSI0_DATA17 0x1b0b0 + MX6QDL_PAD_CSI0_DAT18__IPU1_CSI0_DATA18 0x1b0b0 + MX6QDL_PAD_CSI0_DAT19__IPU1_CSI0_DATA19 0x1b0b0 + MX6QDL_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC 0x1b0b0 + MX6QDL_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC 0x1b0b0 + MX6QDL_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK 0x1b0b0 + >; + }; + pinctrl_gpio_leds: gpioledsgrp { fsl,pins = < MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x1b0b0 diff --git a/src/arm/imx6qdl-icore-rqs.dtsi b/src/arm/imx6qdl-icore-rqs.dtsi index 5fab5be414fe..7ca291e9dbdb 100644 --- a/src/arm/imx6qdl-icore-rqs.dtsi +++ b/src/arm/imx6qdl-icore-rqs.dtsi @@ -184,7 +184,6 @@ }; &ssi1 { - fsl,mode = "i2s-slave"; status = "okay"; }; diff --git a/src/arm/imx6qdl-nitrogen6x.dtsi b/src/arm/imx6qdl-nitrogen6x.dtsi index f22e5879340b..d309a4d0eb08 100644 --- a/src/arm/imx6qdl-nitrogen6x.dtsi +++ b/src/arm/imx6qdl-nitrogen6x.dtsi @@ -108,6 +108,18 @@ startup-delay-us = <70000>; enable-active-high; }; + + reg_usb_h1_vbus: regulator@5 { + compatible = "regulator-fixed"; + reg = <5>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbh1>; + regulator-name = "usb_h1_vbus"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; gpio-keys { @@ -515,6 +527,12 @@ >; }; + pinctrl_usbh1: usbh1grp { + fsl,pins = < + MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x030b0 + >; + }; + pinctrl_usbotg: usbotggrp { fsl,pins = < MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059 @@ -629,6 +647,7 @@ }; &usbh1 { + vbus-supply = <®_usb_h1_vbus>; status = "okay"; }; diff --git a/src/arm/imx6qdl-sabrelite.dtsi b/src/arm/imx6qdl-sabrelite.dtsi index afe7449c47da..756c5054f047 100644 --- a/src/arm/imx6qdl-sabrelite.dtsi +++ b/src/arm/imx6qdl-sabrelite.dtsi @@ -123,6 +123,18 @@ regulator-max-microvolt = <2800000>; regulator-always-on; }; + + reg_usb_h1_vbus: regulator@7 { + compatible = "regulator-fixed"; + reg = <7>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbh1>; + regulator-name = "usb_h1_vbus"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio7 12 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; }; mipi_xclk: mipi_xclk { @@ -610,6 +622,12 @@ >; }; + pinctrl_usbh1: usbh1grp { + fsl,pins = < + MX6QDL_PAD_GPIO_17__GPIO7_IO12 0x030b0 + >; + }; + pinctrl_usbotg: usbotggrp { fsl,pins = < MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059 @@ -705,6 +723,7 @@ }; &usbh1 { + vbus-supply = <®_usb_h1_vbus>; status = "okay"; }; diff --git a/src/arm/imx6qdl-zii-rdu2.dtsi b/src/arm/imx6qdl-zii-rdu2.dtsi index 5d94b5ee6aa0..eeb7679fd348 100644 --- a/src/arm/imx6qdl-zii-rdu2.dtsi +++ b/src/arm/imx6qdl-zii-rdu2.dtsi @@ -59,6 +59,14 @@ pinctrl-0 = <&pinctrl_mdio1>; gpios = <&gpio6 5 GPIO_ACTIVE_HIGH &gpio6 4 GPIO_ACTIVE_HIGH>; + + phy: ethernet-phy@0 { + pinctrl-0 = <&pinctrl_rmii_phy_irq>; + pinctrl-names = "default"; + reg = <0>; + interrupt-parent = <&gpio3>; + interrupts = <30 IRQ_TYPE_LEVEL_LOW>; + }; }; reg_28p0v: regulator-28p0v { @@ -615,14 +623,106 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_enet>; phy-mode = "rmii"; + phy-handle = <&phy>; phy-reset-gpios = <&gpio1 23 GPIO_ACTIVE_LOW>; phy-reset-duration = <100>; phy-supply = <®_3p3v>; status = "okay"; - fixed-link { - speed = <100>; - full-duplex; + mdio { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + switch: switch@0 { + compatible = "marvell,mv88e6085"; + pinctrl-0 = <&pinctrl_switch_irq>; + pinctrl-names = "default"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + dsa,member = <0 0>; + eeprom-length = <512>; + interrupt-parent = <&gpio6>; + interrupts = <3 IRQ_TYPE_EDGE_FALLING>; + interrupt-controller; + #interrupt-cells = <2>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "gigabit_proc"; + phy-handle = <&switchphy0>; + }; + + port@1 { + reg = <1>; + label = "netaux"; + phy-handle = <&switchphy1>; + }; + + port@2 { + reg = <2>; + label = "cpu"; + ethernet = <&fec>; + + fixed-link { + speed = <100>; + full-duplex; + }; + }; + + port@3 { + reg = <3>; + label = "netright"; + phy-handle = <&switchphy3>; + }; + + port@4 { + reg = <4>; + label = "netleft"; + phy-handle = <&switchphy4>; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + switchphy0: switchphy@0 { + reg = <0>; + interrupt-parent = <&switch>; + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; + }; + + switchphy1: switchphy@1 { + reg = <1>; + interrupt-parent = <&switch>; + interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; + }; + + switchphy2: switchphy@2 { + reg = <2>; + interrupt-parent = <&switch>; + interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; + }; + + switchphy3: switchphy@3 { + reg = <3>; + interrupt-parent = <&switch>; + interrupts = <3 IRQ_TYPE_LEVEL_HIGH>; + }; + + switchphy4: switchphy@4 { + reg = <4>; + interrupt-parent = <&switch>; + interrupts = <4 IRQ_TYPE_LEVEL_HIGH>; + }; + }; + }; }; }; @@ -840,6 +940,12 @@ >; }; + pinctrl_switch_irq: switchgrp { + fsl,pins = < + MX6QDL_PAD_CSI0_DAT17__GPIO6_IO03 0x4001b000 + >; + }; + pinctrl_tc358767: tc358767grp { fsl,pins = < MX6QDL_PAD_GPIO_9__GPIO1_IO09 0x10 diff --git a/src/arm/imx6qdl.dtsi b/src/arm/imx6qdl.dtsi index a9723b94bafa..8884b4a3cafb 100644 --- a/src/arm/imx6qdl.dtsi +++ b/src/arm/imx6qdl.dtsi @@ -769,6 +769,7 @@ compatible = "syscon-poweroff"; regmap = <&snvs>; offset = <0x38>; + value = <0x60>; mask = <0x60>; status = "disabled"; }; diff --git a/src/arm/imx6sl.dtsi b/src/arm/imx6sl.dtsi index 3243af4a9984..3f76f980947e 100644 --- a/src/arm/imx6sl.dtsi +++ b/src/arm/imx6sl.dtsi @@ -655,6 +655,7 @@ compatible = "syscon-poweroff"; regmap = <&snvs>; offset = <0x38>; + value = <0x60>; mask = <0x60>; status = "disabled"; }; diff --git a/src/arm/imx6sx.dtsi b/src/arm/imx6sx.dtsi index f16b9df9d0c6..6c7eb54be9e2 100644 --- a/src/arm/imx6sx.dtsi +++ b/src/arm/imx6sx.dtsi @@ -710,6 +710,7 @@ compatible = "syscon-poweroff"; regmap = <&snvs>; offset = <0x38>; + value = <0x60>; mask = <0x60>; status = "disabled"; }; diff --git a/src/arm/imx6ul-14x14-evk.dts b/src/arm/imx6ul-14x14-evk.dts index d2be8aa3370b..9c23e017d86a 100644 --- a/src/arm/imx6ul-14x14-evk.dts +++ b/src/arm/imx6ul-14x14-evk.dts @@ -22,7 +22,7 @@ reg = <0x80000000 0x20000000>; }; - backlight { + backlight_display: backlight-display { compatible = "pwm-backlight"; pwms = <&pwm1 0 5000000>; brightness-levels = <0 4 8 16 32 64 128 255>; @@ -78,6 +78,17 @@ clocks = <&clks IMX6UL_CLK_SAI2>; }; }; + + panel { + compatible = "innolux,at043tn24"; + backlight = <&backlight_display>; + + port { + panel_in: endpoint { + remote-endpoint = <&display_out>; + }; + }; + }; }; &clks { @@ -139,31 +150,11 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_lcdif_dat &pinctrl_lcdif_ctrl>; - display = <&display0>; status = "okay"; - display0: display { - bits-per-pixel = <16>; - bus-width = <24>; - - display-timings { - native-mode = <&timing0>; - - timing0: timing0 { - clock-frequency = <9200000>; - hactive = <480>; - vactive = <272>; - hfront-porch = <8>; - hback-porch = <4>; - hsync-len = <41>; - vback-porch = <2>; - vfront-porch = <4>; - vsync-len = <10>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <0>; - }; + port { + display_out: endpoint { + remote-endpoint = <&panel_in>; }; }; }; @@ -316,7 +307,6 @@ MX6UL_PAD_ENET2_TX_DATA0__ENET2_TDATA00 0x1b0b0 MX6UL_PAD_ENET2_TX_DATA1__ENET2_TDATA01 0x1b0b0 MX6UL_PAD_ENET2_TX_CLK__ENET2_REF_CLK2 0x4001b031 - MX6UL_PAD_SNVS_TAMPER0__GPIO5_IO00 0x17059 >; }; diff --git a/src/arm/imx6ul-geam.dtsi b/src/arm/imx6ul-geam.dts similarity index 87% rename from src/arm/imx6ul-geam.dtsi rename to src/arm/imx6ul-geam.dts index eb94d956808b..571eea7f1c6b 100644 --- a/src/arm/imx6ul-geam.dtsi +++ b/src/arm/imx6ul-geam.dts @@ -40,11 +40,16 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +/dts-v1/; + #include #include #include "imx6ul.dtsi" / { + model = "Engicam GEAM6UL Starter Kit"; + compatible = "engicam,imx6ul-geam", "fsl,imx6ul"; + memory { reg = <0x80000000 0x08000000>; }; @@ -87,18 +92,46 @@ regulator-always-on; regulator-boot-on; }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "imx6ul-geam-sgtl5000"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&dailink_master>; + simple-audio-card,frame-master = <&dailink_master>; + simple-audio-card,widgets = + "Microphone", "Mic Jack", + "Line", "Line In", + "Line", "Line Out", + "Headphone", "Headphone Jack"; + simple-audio-card,routing = + "MIC_IN", "Mic Jack", + "Mic Jack", "Mic Bias", + "Headphone Jack", "HP_OUT"; + + simple-audio-card,cpu { + sound-dai = <&sai2>; + }; + + dailink_master: simple-audio-card,codec { + sound-dai = <&sgtl5000>; + clocks = <&clks IMX6UL_CLK_SAI2>; + }; + }; }; &can1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flexcan1>; xceiver-supply = <®_3p3v>; + status = "okay"; }; &can2 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flexcan2>; xceiver-supply = <®_3p3v>; + status = "okay"; }; &fec1 { @@ -144,6 +177,16 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; + + sgtl5000: codec@a { + compatible = "fsl,sgtl5000"; + reg = <0x0a>; + clocks = <&clks IMX6UL_CLK_OSC>; + clock-names = "mclk"; + VDDA-supply = <®_3p3v>; + VDDIO-supply = <®_3p3v>; + VDDD-supply = <®_1p8v>; + }; }; &i2c2 { @@ -158,6 +201,31 @@ pinctrl-0 = <&pinctrl_lcdif_dat &pinctrl_lcdif_ctrl>; display = <&display0>; + status = "okay"; + + display0: display { + bits-per-pixel = <16>; + bus-width = <18>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <28000000>; + hactive = <800>; + vactive = <480>; + hfront-porch = <30>; + hback-porch = <30>; + hsync-len = <64>; + vback-porch = <5>; + vfront-porch = <5>; + vsync-len = <20>; + hsync-active = <0>; + vsync-active = <0>; + de-active = <1>; + pixelclk-active = <0>; + }; + }; + }; }; &pwm8 { @@ -178,6 +246,12 @@ status = "okay"; }; +&tsc { + measure-delay-time = <0x1ffff>; + pre-charge-time = <0x1fff>; + status = "okay"; +}; + &uart1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; diff --git a/src/arm/imx6ul-isiot-common.dtsi b/src/arm/imx6ul-isiot-common.dtsi deleted file mode 100644 index 2beaab6e272e..000000000000 --- a/src/arm/imx6ul-isiot-common.dtsi +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (C) 2016 Amarula Solutions B.V. - * Copyright (C) 2016 Engicam S.r.l. - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -&i2c1 { - stmpe811: gpio-expander@44 { - compatible = "st,stmpe811"; - reg = <0x44>; - #address-cells = <1>; - #size-cells = <0>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_stmpe>; - interrupt-parent = <&gpio1>; - interrupts = <18 IRQ_TYPE_EDGE_FALLING>; - interrupt-controller; - #interrupt-cells = <2>; - - stmpe: touchscreen { - compatible = "st,stmpe-ts"; - st,sample-time = <4>; - st,mod-12b = <1>; - st,ref-sel = <0>; - st,adc-freq = <1>; - st,ave-ctrl = <1>; - st,touch-det-delay = <2>; - st,settling = <2>; - st,fraction-z = <7>; - st,i-drive = <1>; - }; - }; -}; - -&lcdif { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_lcdif_dat - &pinctrl_lcdif_ctrl>; - display = <&display0>; - status = "okay"; - - display0: display { - bits-per-pixel = <16>; - bus-width = <18>; - - display-timings { - native-mode = <&timing0>; - timing0: timing0 { - clock-frequency = <28000000>; - hactive = <800>; - vactive = <480>; - hfront-porch = <30>; - hback-porch = <30>; - hsync-len = <64>; - vback-porch = <5>; - vfront-porch = <5>; - vsync-len = <20>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <0>; - }; - }; - }; -}; - -&iomuxc { - pinctrl_lcdif_ctrl: lcdifctrlgrp { - fsl,pins = < - MX6UL_PAD_LCD_CLK__LCDIF_CLK 0x79 - MX6UL_PAD_LCD_ENABLE__LCDIF_ENABLE 0x79 - MX6UL_PAD_LCD_HSYNC__LCDIF_HSYNC 0x79 - MX6UL_PAD_LCD_VSYNC__LCDIF_VSYNC 0x79 - >; - }; - - pinctrl_lcdif_dat: lcdifdatgrp { - fsl,pins = < - MX6UL_PAD_LCD_DATA00__LCDIF_DATA00 0x79 - MX6UL_PAD_LCD_DATA01__LCDIF_DATA01 0x79 - MX6UL_PAD_LCD_DATA02__LCDIF_DATA02 0x79 - MX6UL_PAD_LCD_DATA03__LCDIF_DATA03 0x79 - MX6UL_PAD_LCD_DATA04__LCDIF_DATA04 0x79 - MX6UL_PAD_LCD_DATA05__LCDIF_DATA05 0x79 - MX6UL_PAD_LCD_DATA06__LCDIF_DATA06 0x79 - MX6UL_PAD_LCD_DATA07__LCDIF_DATA07 0x79 - MX6UL_PAD_LCD_DATA08__LCDIF_DATA08 0x79 - MX6UL_PAD_LCD_DATA09__LCDIF_DATA09 0x79 - MX6UL_PAD_LCD_DATA10__LCDIF_DATA10 0x79 - MX6UL_PAD_LCD_DATA11__LCDIF_DATA11 0x79 - MX6UL_PAD_LCD_DATA12__LCDIF_DATA12 0x79 - MX6UL_PAD_LCD_DATA13__LCDIF_DATA13 0x79 - MX6UL_PAD_LCD_DATA14__LCDIF_DATA14 0x79 - MX6UL_PAD_LCD_DATA15__LCDIF_DATA15 0x79 - MX6UL_PAD_LCD_DATA16__LCDIF_DATA16 0x79 - MX6UL_PAD_LCD_DATA17__LCDIF_DATA17 0x79 - >; - }; - - pinctrl_stmpe: stmpegrp { - fsl,pins = < - MX6UL_PAD_UART1_CTS_B__GPIO1_IO18 0x1b0b0 - >; - }; -}; diff --git a/src/arm/imx6ul-isiot-emmc.dts b/src/arm/imx6ul-isiot-emmc.dts index 73a1d0f0b9d5..f5b422898e61 100644 --- a/src/arm/imx6ul-isiot-emmc.dts +++ b/src/arm/imx6ul-isiot-emmc.dts @@ -43,7 +43,6 @@ /dts-v1/; #include "imx6ul-isiot.dtsi" -#include "imx6ul-isiot-common.dtsi" / { model = "Engicam Is.IoT MX6UL eMMC Starter kit"; diff --git a/src/arm/imx6ul-isiot-nand.dts b/src/arm/imx6ul-isiot-nand.dts index da29a86eb6a8..de15e1c75dd1 100644 --- a/src/arm/imx6ul-isiot-nand.dts +++ b/src/arm/imx6ul-isiot-nand.dts @@ -43,7 +43,6 @@ /dts-v1/; #include "imx6ul-isiot.dtsi" -#include "imx6ul-isiot-common.dtsi" / { model = "Engicam Is.IoT MX6UL NAND Starter kit"; diff --git a/src/arm/imx6ul-isiot.dtsi b/src/arm/imx6ul-isiot.dtsi index ea30380ad7a4..950fb28b630a 100644 --- a/src/arm/imx6ul-isiot.dtsi +++ b/src/arm/imx6ul-isiot.dtsi @@ -69,6 +69,68 @@ 100>; default-brightness-level = <100>; }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "1P8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "3P3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "imx6ul-isiot-sgtl5000"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&dailink_master>; + simple-audio-card,frame-master = <&dailink_master>; + simple-audio-card,widgets = + "Microphone", "Mic Jack", + "Line", "Line In", + "Line", "Line Out", + "Headphone", "Headphone Jack"; + simple-audio-card,routing = + "MIC_IN", "Mic Jack", + "Mic Jack", "Mic Bias", + "Headphone Jack", "HP_OUT"; + + simple-audio-card,cpu { + sound-dai = <&sai2>; + }; + + dailink_master: simple-audio-card,codec { + sound-dai = <&sgtl5000>; + clocks = <&clks IMX6UL_CLK_SAI2>; + }; + }; +}; + +&fec1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_enet1>; + phy-mode = "rmii"; + phy-handle = <ðphy0>; + status = "okay"; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethphy0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; + }; }; &i2c1 { @@ -76,6 +138,42 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; + + sgtl5000: codec@a { + compatible = "fsl,sgtl5000"; + reg = <0x0a>; + clocks = <&clks IMX6UL_CLK_OSC>; + clock-names = "mclk"; + VDDA-supply = <®_3p3v>; + VDDIO-supply = <®_3p3v>; + VDDD-supply = <®_1p8v>; + }; + + stmpe811: gpio-expander@44 { + compatible = "st,stmpe811"; + reg = <0x44>; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_stmpe>; + interrupt-parent = <&gpio1>; + interrupts = <18 IRQ_TYPE_EDGE_FALLING>; + interrupt-controller; + #interrupt-cells = <2>; + + stmpe: touchscreen { + compatible = "st,stmpe-ts"; + st,sample-time = <4>; + st,mod-12b = <1>; + st,ref-sel = <0>; + st,adc-freq = <1>; + st,ave-ctrl = <1>; + st,touch-det-delay = <2>; + st,settling = <2>; + st,fraction-z = <7>; + st,i-drive = <1>; + }; + }; }; &i2c2 { @@ -85,6 +183,38 @@ status = "okay"; }; +&lcdif { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_lcdif_dat + &pinctrl_lcdif_ctrl>; + display = <&display0>; + status = "okay"; + + display0: display { + bits-per-pixel = <16>; + bus-width = <18>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <28000000>; + hactive = <800>; + vactive = <480>; + hfront-porch = <30>; + hback-porch = <30>; + hsync-len = <64>; + vback-porch = <5>; + vfront-porch = <5>; + vsync-len = <20>; + hsync-active = <0>; + vsync-active = <0>; + de-active = <1>; + pixelclk-active = <0>; + }; + }; + }; +}; + &pwm8 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pwm8>; @@ -115,6 +245,21 @@ }; &iomuxc { + pinctrl_enet1: enet1grp { + fsl,pins = < + MX6UL_PAD_ENET2_RX_DATA0__ENET1_MDIO 0x1b0b0 + MX6UL_PAD_ENET2_RX_DATA1__ENET1_MDC 0x1b0b0 + MX6UL_PAD_ENET1_RX_EN__ENET1_RX_EN 0x1b0b0 + MX6UL_PAD_ENET1_RX_DATA0__ENET1_RDATA00 0x1b0b0 + MX6UL_PAD_ENET1_RX_DATA1__ENET1_RDATA01 0x1b0b0 + MX6UL_PAD_ENET1_TX_EN__ENET1_TX_EN 0x1b0b0 + MX6UL_PAD_ENET1_TX_DATA0__ENET1_TDATA00 0x1b0b0 + MX6UL_PAD_ENET1_TX_DATA1__ENET1_TDATA01 0x1b0b0 + MX6UL_PAD_ENET1_TX_CLK__ENET1_REF_CLK1 0x4001b031 + MX6UL_PAD_ENET2_RX_EN__GPIO2_IO10 0x1b0b0 + >; + }; + pinctrl_i2c1: i2c1grp { fsl,pins = < MX6UL_PAD_UART4_TX_DATA__I2C1_SCL 0x4001b8b0 @@ -129,6 +274,38 @@ >; }; + pinctrl_lcdif_ctrl: lcdifctrlgrp { + fsl,pins = < + MX6UL_PAD_LCD_CLK__LCDIF_CLK 0x79 + MX6UL_PAD_LCD_ENABLE__LCDIF_ENABLE 0x79 + MX6UL_PAD_LCD_HSYNC__LCDIF_HSYNC 0x79 + MX6UL_PAD_LCD_VSYNC__LCDIF_VSYNC 0x79 + >; + }; + + pinctrl_lcdif_dat: lcdifdatgrp { + fsl,pins = < + MX6UL_PAD_LCD_DATA00__LCDIF_DATA00 0x79 + MX6UL_PAD_LCD_DATA01__LCDIF_DATA01 0x79 + MX6UL_PAD_LCD_DATA02__LCDIF_DATA02 0x79 + MX6UL_PAD_LCD_DATA03__LCDIF_DATA03 0x79 + MX6UL_PAD_LCD_DATA04__LCDIF_DATA04 0x79 + MX6UL_PAD_LCD_DATA05__LCDIF_DATA05 0x79 + MX6UL_PAD_LCD_DATA06__LCDIF_DATA06 0x79 + MX6UL_PAD_LCD_DATA07__LCDIF_DATA07 0x79 + MX6UL_PAD_LCD_DATA08__LCDIF_DATA08 0x79 + MX6UL_PAD_LCD_DATA09__LCDIF_DATA09 0x79 + MX6UL_PAD_LCD_DATA10__LCDIF_DATA10 0x79 + MX6UL_PAD_LCD_DATA11__LCDIF_DATA11 0x79 + MX6UL_PAD_LCD_DATA12__LCDIF_DATA12 0x79 + MX6UL_PAD_LCD_DATA13__LCDIF_DATA13 0x79 + MX6UL_PAD_LCD_DATA14__LCDIF_DATA14 0x79 + MX6UL_PAD_LCD_DATA15__LCDIF_DATA15 0x79 + MX6UL_PAD_LCD_DATA16__LCDIF_DATA16 0x79 + MX6UL_PAD_LCD_DATA17__LCDIF_DATA17 0x79 + >; + }; + pinctrl_pwm8: pwm8grp { fsl,pins = < MX6UL_PAD_ENET1_RX_ER__PWM8_OUT 0x110b0 @@ -145,6 +322,12 @@ >; }; + pinctrl_stmpe: stmpegrp { + fsl,pins = < + MX6UL_PAD_UART1_CTS_B__GPIO1_IO18 0x1b0b0 + >; + }; + pinctrl_uart1: uart1grp { fsl,pins = < MX6UL_PAD_UART1_TX_DATA__UART1_DCE_TX 0x1b0b1 diff --git a/src/arm/imx6ul-liteboard.dts b/src/arm/imx6ul-liteboard.dts index ed1d891d6a89..1d863a16bcf0 100644 --- a/src/arm/imx6ul-liteboard.dts +++ b/src/arm/imx6ul-liteboard.dts @@ -124,6 +124,10 @@ }; }; +&snvs_poweroff { + status = "okay"; +}; + &uart1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; diff --git a/src/arm/imx6ul.dtsi b/src/arm/imx6ul.dtsi index 6da2b77edd46..f11a241a340d 100644 --- a/src/arm/imx6ul.dtsi +++ b/src/arm/imx6ul.dtsi @@ -614,6 +614,7 @@ compatible = "syscon-poweroff"; regmap = <&snvs>; offset = <0x38>; + value = <0x60>; mask = <0x60>; status = "disabled"; }; diff --git a/src/arm/imx7-colibri.dtsi b/src/arm/imx7-colibri.dtsi index d7753f79937a..0a3915868aa3 100644 --- a/src/arm/imx7-colibri.dtsi +++ b/src/arm/imx7-colibri.dtsi @@ -106,6 +106,15 @@ fsl,magic-packet; }; +&gpmi { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpmi_nand>; + fsl,use-minimum-ecc; + nand-on-flash-bbt; + nand-ecc-mode = "hw"; + status = "okay"; +}; + &i2c1 { clock-frequency = <100000>; pinctrl-names = "default"; diff --git a/src/arm/imx7d-sdb.dts b/src/arm/imx7d-sdb.dts index 0a24d1bf3c39..44637cabcc56 100644 --- a/src/arm/imx7d-sdb.dts +++ b/src/arm/imx7d-sdb.dts @@ -117,6 +117,37 @@ regulator-max-microvolt = <3300000>; startup-delay-us = <200000>; }; + + reg_lcd_3v3: regulator-lcd-3v3 { + compatible = "regulator-fixed"; + regulator-name = "lcd-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&extended_io 7 GPIO_ACTIVE_LOW>; + }; + + reg_can2_3v3: regulator-can2-3v3 { + compatible = "regulator-fixed"; + regulator-name = "can2-3v3"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_flexcan2_reg>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio2 14 GPIO_ACTIVE_LOW>; + }; + + panel { + compatible = "innolux,at043tn24"; + pinctrl-0 = <&pinctrl_backlight>; + enable-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + power-supply = <®_lcd_3v3>; + + port { + panel_in: endpoint { + remote-endpoint = <&display_out>; + }; + }; + }; }; &adc1 { @@ -168,6 +199,7 @@ phy-mode = "rgmii"; phy-handle = <ðphy0>; fsl,magic-packet; + phy-reset-gpios = <&extended_io 5 GPIO_ACTIVE_LOW>; status = "okay"; mdio { @@ -197,6 +229,13 @@ status = "okay"; }; +&flexcan2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_flexcan2>; + xceiver-supply = <®_can2_3v3>; + status = "okay"; +}; + &i2c1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>; @@ -285,8 +324,8 @@ }; vgen6_reg: vldo4 { - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; regulator-always-on; }; }; @@ -322,31 +361,11 @@ &lcdif { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_lcdif>; - display = <&display0>; status = "okay"; - display0: display { - bits-per-pixel = <16>; - bus-width = <24>; - - display-timings { - native-mode = <&timing0>; - - timing0: timing0 { - clock-frequency = <9200000>; - hactive = <480>; - vactive = <272>; - hfront-porch = <8>; - hback-porch = <4>; - hsync-len = <41>; - vback-porch = <2>; - vfront-porch = <4>; - vsync-len = <10>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <0>; - }; + port { + display_out: endpoint { + remote-endpoint = <&panel_in>; }; }; }; @@ -356,12 +375,6 @@ status = "okay"; }; -&pwm1 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_pwm1>; - status = "okay"; -}; - &uart1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_uart1>; @@ -488,6 +501,20 @@ >; }; + pinctrl_flexcan2: flexcan2grp { + fsl,pins = < + MX7D_PAD_GPIO1_IO14__FLEXCAN2_RX 0x59 + MX7D_PAD_GPIO1_IO15__FLEXCAN2_TX 0x59 + >; + }; + + pinctrl_flexcan2_reg: flexcan2reggrp { + fsl,pins = < + MX7D_PAD_EPDC_DATA14__GPIO2_IO14 0x59 /* CAN_STBY */ + >; + }; + + pinctrl_hog: hoggrp { fsl,pins = < MX7D_PAD_UART3_CTS_B__GPIO4_IO7 0x14 @@ -701,9 +728,9 @@ >; }; - pinctrl_pwm1: pwm1grp { + pinctrl_backlight: backlightgrp { fsl,pins = < - MX7D_PAD_LPSR_GPIO1_IO01__PWM1_OUT 0x110b0 + MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1 0x110b0 >; }; }; diff --git a/src/arm/imx7d.dtsi b/src/arm/imx7d.dtsi index f46814a7ea44..4d308d17f040 100644 --- a/src/arm/imx7d.dtsi +++ b/src/arm/imx7d.dtsi @@ -144,10 +144,10 @@ interrupt-names = "msi"; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0x7>; - interrupt-map = <0 0 0 1 &intc GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 2 &intc GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 3 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, - <0 0 0 4 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 1 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 2 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 3 &intc GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>, + <0 0 0 4 &intc GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX7D_PCIE_CTRL_ROOT_CLK>, <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>, <&clks IMX7D_PCIE_PHY_ROOT_CLK>; diff --git a/src/arm/imx7s.dtsi b/src/arm/imx7s.dtsi index 4cf6c458b583..82ad26e766eb 100644 --- a/src/arm/imx7s.dtsi +++ b/src/arm/imx7s.dtsi @@ -540,6 +540,7 @@ compatible = "syscon-poweroff"; regmap = <&snvs>; offset = <0x38>; + value = <0x60>; mask = <0x60>; }; @@ -1021,5 +1022,36 @@ status = "disabled"; }; }; + + dma_apbh: dma-apbh@33000000 { + compatible = "fsl,imx7d-dma-apbh", "fsl,imx28-dma-apbh"; + reg = <0x33000000 0x2000>; + interrupts = , + , + , + ; + interrupt-names = "gpmi0", "gpmi1", "gpmi2", "gpmi3"; + #dma-cells = <1>; + dma-channels = <4>; + clocks = <&clks IMX7D_NAND_USDHC_BUS_RAWNAND_CLK>; + }; + + gpmi: gpmi-nand@33002000{ + compatible = "fsl,imx7d-gpmi-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0x33002000 0x2000>, <0x33004000 0x4000>; + reg-names = "gpmi-nand", "bch"; + interrupts = ; + interrupt-names = "bch"; + clocks = <&clks IMX7D_NAND_RAWNAND_CLK>, + <&clks IMX7D_NAND_USDHC_BUS_RAWNAND_CLK>; + clock-names = "gpmi_io", "gpmi_bch_apb"; + dmas = <&dma_apbh 0>; + dma-names = "rx-tx"; + status = "disabled"; + assigned-clocks = <&clks IMX7D_NAND_ROOT_SRC>; + assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_500M_CLK>; + }; }; }; diff --git a/src/arm/imx7ulp-pinfunc.h b/src/arm/imx7ulp-pinfunc.h new file mode 100644 index 000000000000..fe511775b518 --- /dev/null +++ b/src/arm/imx7ulp-pinfunc.h @@ -0,0 +1,468 @@ +/* + * Copyright 2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP + * + * 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 __DTS_IMX7ULP_PINFUNC_H +#define __DTS_IMX7ULP_PINFUNC_H + +/* + * The pin function ID is a tuple of + * + */ + +#define IMX7ULP_PAD_PTC0__PTC0 0x0000 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC0__TRACE_D15 0x0000 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC0__LPUART4_CTS_B 0x0000 0x0244 0x4 0x1 +#define IMX7ULP_PAD_PTC0__LPI2C4_SCL 0x0000 0x0278 0x5 0x1 +#define IMX7ULP_PAD_PTC0__TPM4_CLKIN 0x0000 0x0298 0x6 0x1 +#define IMX7ULP_PAD_PTC0__FB_AD0 0x0000 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC1__PTC1 0x0004 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC1__TRACE_D14 0x0004 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC1__LPUART4_RTS_B 0x0004 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTC1__LPI2C4_SDA 0x0004 0x027c 0x5 0x1 +#define IMX7ULP_PAD_PTC1__TPM4_CH0 0x0004 0x0280 0x6 0x1 +#define IMX7ULP_PAD_PTC1__FB_AD1 0x0004 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC2__PTC2 0x0008 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC2__TRACE_D13 0x0008 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC2__LPUART4_TX 0x0008 0x024c 0x4 0x1 +#define IMX7ULP_PAD_PTC2__LPI2C4_HREQ 0x0008 0x0274 0x5 0x1 +#define IMX7ULP_PAD_PTC2__TPM4_CH1 0x0008 0x0284 0x6 0x1 +#define IMX7ULP_PAD_PTC2__FB_AD2 0x0008 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC3__PTC3 0x000c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC3__TRACE_D12 0x000c 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC3__LPUART4_RX 0x000c 0x0248 0x4 0x1 +#define IMX7ULP_PAD_PTC3__TPM4_CH2 0x000c 0x0288 0x6 0x1 +#define IMX7ULP_PAD_PTC3__FB_AD3 0x000c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC4__PTC4 0x0010 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC4__TRACE_D11 0x0010 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC4__FXIO1_D0 0x0010 0x0204 0x2 0x1 +#define IMX7ULP_PAD_PTC4__LPSPI2_PCS1 0x0010 0x02a0 0x3 0x1 +#define IMX7ULP_PAD_PTC4__LPUART5_CTS_B 0x0010 0x0250 0x4 0x1 +#define IMX7ULP_PAD_PTC4__LPI2C5_SCL 0x0010 0x02bc 0x5 0x1 +#define IMX7ULP_PAD_PTC4__TPM4_CH3 0x0010 0x028c 0x6 0x1 +#define IMX7ULP_PAD_PTC4__FB_AD4 0x0010 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC5__PTC5 0x0014 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC5__TRACE_D10 0x0014 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC5__FXIO1_D1 0x0014 0x0208 0x2 0x1 +#define IMX7ULP_PAD_PTC5__LPSPI2_PCS2 0x0014 0x02a4 0x3 0x1 +#define IMX7ULP_PAD_PTC5__LPUART5_RTS_B 0x0014 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTC5__LPI2C5_SDA 0x0014 0x02c0 0x5 0x1 +#define IMX7ULP_PAD_PTC5__TPM4_CH4 0x0014 0x0290 0x6 0x1 +#define IMX7ULP_PAD_PTC5__FB_AD5 0x0014 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC6__PTC6 0x0018 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC6__TRACE_D9 0x0018 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC6__FXIO1_D2 0x0018 0x020c 0x2 0x1 +#define IMX7ULP_PAD_PTC6__LPSPI2_PCS3 0x0018 0x02a8 0x3 0x1 +#define IMX7ULP_PAD_PTC6__LPUART5_TX 0x0018 0x0258 0x4 0x1 +#define IMX7ULP_PAD_PTC6__LPI2C5_HREQ 0x0018 0x02b8 0x5 0x1 +#define IMX7ULP_PAD_PTC6__TPM4_CH5 0x0018 0x0294 0x6 0x1 +#define IMX7ULP_PAD_PTC6__FB_AD6 0x0018 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC7__PTC7 0x001c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC7__TRACE_D8 0x001c 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC7__FXIO1_D3 0x001c 0x0210 0x2 0x1 +#define IMX7ULP_PAD_PTC7__LPUART5_RX 0x001c 0x0254 0x4 0x1 +#define IMX7ULP_PAD_PTC7__TPM5_CH1 0x001c 0x02c8 0x6 0x1 +#define IMX7ULP_PAD_PTC7__FB_AD7 0x001c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC8__PTC8 0x0020 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC8__TRACE_D7 0x0020 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC8__FXIO1_D4 0x0020 0x0214 0x2 0x1 +#define IMX7ULP_PAD_PTC8__LPSPI2_SIN 0x0020 0x02b0 0x3 0x1 +#define IMX7ULP_PAD_PTC8__LPUART6_CTS_B 0x0020 0x025c 0x4 0x1 +#define IMX7ULP_PAD_PTC8__LPI2C6_SCL 0x0020 0x02fc 0x5 0x1 +#define IMX7ULP_PAD_PTC8__TPM5_CLKIN 0x0020 0x02cc 0x6 0x1 +#define IMX7ULP_PAD_PTC8__FB_AD8 0x0020 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC9__PTC9 0x0024 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC9__TRACE_D6 0x0024 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC9__FXIO1_D5 0x0024 0x0218 0x2 0x1 +#define IMX7ULP_PAD_PTC9__LPSPI2_SOUT 0x0024 0x02b4 0x3 0x1 +#define IMX7ULP_PAD_PTC9__LPUART6_RTS_B 0x0024 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTC9__LPI2C6_SDA 0x0024 0x0300 0x5 0x1 +#define IMX7ULP_PAD_PTC9__TPM5_CH0 0x0024 0x02c4 0x6 0x1 +#define IMX7ULP_PAD_PTC9__FB_AD9 0x0024 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC10__PTC10 0x0028 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC10__TRACE_D5 0x0028 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC10__FXIO1_D6 0x0028 0x021c 0x2 0x1 +#define IMX7ULP_PAD_PTC10__LPSPI2_SCK 0x0028 0x02ac 0x3 0x1 +#define IMX7ULP_PAD_PTC10__LPUART6_TX 0x0028 0x0264 0x4 0x1 +#define IMX7ULP_PAD_PTC10__LPI2C6_HREQ 0x0028 0x02f8 0x5 0x1 +#define IMX7ULP_PAD_PTC10__TPM7_CH3 0x0028 0x02e8 0x6 0x1 +#define IMX7ULP_PAD_PTC10__FB_AD10 0x0028 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC11__PTC11 0x002c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC11__TRACE_D4 0x002c 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC11__FXIO1_D7 0x002c 0x0220 0x2 0x1 +#define IMX7ULP_PAD_PTC11__LPSPI2_PCS0 0x002c 0x029c 0x3 0x1 +#define IMX7ULP_PAD_PTC11__LPUART6_RX 0x002c 0x0260 0x4 0x1 +#define IMX7ULP_PAD_PTC11__TPM7_CH4 0x002c 0x02ec 0x6 0x1 +#define IMX7ULP_PAD_PTC11__FB_AD11 0x002c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC12__PTC12 0x0030 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC12__TRACE_D3 0x0030 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC12__FXIO1_D8 0x0030 0x0224 0x2 0x1 +#define IMX7ULP_PAD_PTC12__LPSPI3_PCS1 0x0030 0x0314 0x3 0x1 +#define IMX7ULP_PAD_PTC12__LPUART7_CTS_B 0x0030 0x0268 0x4 0x1 +#define IMX7ULP_PAD_PTC12__LPI2C7_SCL 0x0030 0x0308 0x5 0x1 +#define IMX7ULP_PAD_PTC12__TPM7_CH5 0x0030 0x02f0 0x6 0x1 +#define IMX7ULP_PAD_PTC12__FB_AD12 0x0030 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC13__PTC13 0x0034 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC13__TRACE_D2 0x0034 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC13__FXIO1_D9 0x0034 0x0228 0x2 0x1 +#define IMX7ULP_PAD_PTC13__LPSPI3_PCS2 0x0034 0x0318 0x3 0x1 +#define IMX7ULP_PAD_PTC13__LPUART7_RTS_B 0x0034 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTC13__LPI2C7_SDA 0x0034 0x030c 0x5 0x1 +#define IMX7ULP_PAD_PTC13__TPM7_CLKIN 0x0034 0x02f4 0x6 0x1 +#define IMX7ULP_PAD_PTC13__FB_AD13 0x0034 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC14__PTC14 0x0038 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC14__TRACE_D1 0x0038 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC14__FXIO1_D10 0x0038 0x022c 0x2 0x1 +#define IMX7ULP_PAD_PTC14__LPSPI3_PCS3 0x0038 0x031c 0x3 0x1 +#define IMX7ULP_PAD_PTC14__LPUART7_TX 0x0038 0x0270 0x4 0x1 +#define IMX7ULP_PAD_PTC14__LPI2C7_HREQ 0x0038 0x0304 0x5 0x1 +#define IMX7ULP_PAD_PTC14__TPM7_CH0 0x0038 0x02dc 0x6 0x1 +#define IMX7ULP_PAD_PTC14__FB_AD14 0x0038 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC15__PTC15 0x003c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC15__TRACE_D0 0x003c 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC15__FXIO1_D11 0x003c 0x0230 0x2 0x1 +#define IMX7ULP_PAD_PTC15__LPUART7_RX 0x003c 0x026c 0x4 0x1 +#define IMX7ULP_PAD_PTC15__TPM7_CH1 0x003c 0x02e0 0x6 0x1 +#define IMX7ULP_PAD_PTC15__FB_AD15 0x003c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC16__PTC16 0x0040 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC16__TRACE_CLKOUT 0x0040 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTC16__FXIO1_D12 0x0040 0x0234 0x2 0x1 +#define IMX7ULP_PAD_PTC16__LPSPI3_SIN 0x0040 0x0324 0x3 0x1 +#define IMX7ULP_PAD_PTC16__TPM7_CH2 0x0040 0x02e4 0x6 0x1 +#define IMX7ULP_PAD_PTC16__FB_ALE_FB_CS1_B_FB_TS_B 0x0040 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC17__PTC17 0x0044 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC17__FXIO1_D13 0x0044 0x0238 0x2 0x1 +#define IMX7ULP_PAD_PTC17__LPSPI3_SOUT 0x0044 0x0328 0x3 0x1 +#define IMX7ULP_PAD_PTC17__TPM6_CLKIN 0x0044 0x02d8 0x6 0x1 +#define IMX7ULP_PAD_PTC17__FB_CS0_B 0x0044 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC18__PTC18 0x0048 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC18__FXIO1_D14 0x0048 0x023c 0x2 0x1 +#define IMX7ULP_PAD_PTC18__LPSPI3_SCK 0x0048 0x0320 0x3 0x1 +#define IMX7ULP_PAD_PTC18__TPM6_CH0 0x0048 0x02d0 0x6 0x1 +#define IMX7ULP_PAD_PTC18__FB_OE_B 0x0048 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTC19__PTC19 0x004c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTC19__FXIO1_D15 0x004c 0x0240 0x2 0x1 +#define IMX7ULP_PAD_PTC19__LPSPI3_PCS0 0x004c 0x0310 0x3 0x1 +#define IMX7ULP_PAD_PTC19__TPM6_CH1 0x004c 0x02d4 0x6 0x1 +#define IMX7ULP_PAD_PTC19__FB_A16 0x004c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTD0__PTD0 0x0080 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD0__SDHC0_RESET_B 0x0080 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD1__PTD1 0x0084 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD1__SDHC0_CMD 0x0084 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD2__PTD2 0x0088 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD2__SDHC0_CLK 0x0088 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD3__PTD3 0x008c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD3__SDHC0_D7 0x008c 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD4__PTD4 0x0090 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD4__SDHC0_D6 0x0090 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD5__PTD5 0x0094 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD5__SDHC0_D5 0x0094 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD6__PTD6 0x0098 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD6__SDHC0_D4 0x0098 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD7__PTD7 0x009c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD7__SDHC0_D3 0x009c 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD8__PTD8 0x00a0 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD8__TPM4_CLKIN 0x00a0 0x0298 0x6 0x2 +#define IMX7ULP_PAD_PTD8__SDHC0_D2 0x00a0 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD9__PTD9 0x00a4 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD9__TPM4_CH0 0x00a4 0x0280 0x6 0x2 +#define IMX7ULP_PAD_PTD9__SDHC0_D1 0x00a4 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD10__PTD10 0x00a8 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD10__TPM4_CH1 0x00a8 0x0284 0x6 0x2 +#define IMX7ULP_PAD_PTD10__SDHC0_D0 0x00a8 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTD11__PTD11 0x00ac 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTD11__TPM4_CH2 0x00ac 0x0288 0x6 0x2 +#define IMX7ULP_PAD_PTD11__SDHC0_DQS 0x00ac 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE0__PTE0 0x0100 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE0__FXIO1_D31 0x0100 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE0__LPSPI2_PCS1 0x0100 0x02a0 0x3 0x2 +#define IMX7ULP_PAD_PTE0__LPUART4_CTS_B 0x0100 0x0244 0x4 0x2 +#define IMX7ULP_PAD_PTE0__LPI2C4_SCL 0x0100 0x0278 0x5 0x2 +#define IMX7ULP_PAD_PTE0__SDHC1_D1 0x0100 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE0__FB_A25 0x0100 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE1__PTE1 0x0104 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE1__FXIO1_D30 0x0104 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE1__LPSPI2_PCS2 0x0104 0x02a4 0x3 0x2 +#define IMX7ULP_PAD_PTE1__LPUART4_RTS_B 0x0104 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTE1__LPI2C4_SDA 0x0104 0x027c 0x5 0x2 +#define IMX7ULP_PAD_PTE1__SDHC1_D0 0x0104 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE1__FB_A26 0x0104 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE2__PTE2 0x0108 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE2__FXIO1_D29 0x0108 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE2__LPSPI2_PCS3 0x0108 0x02a8 0x3 0x2 +#define IMX7ULP_PAD_PTE2__LPUART4_TX 0x0108 0x024c 0x4 0x2 +#define IMX7ULP_PAD_PTE2__LPI2C4_HREQ 0x0108 0x0274 0x5 0x2 +#define IMX7ULP_PAD_PTE2__SDHC1_CLK 0x0108 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE3__PTE3 0x010c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE3__FXIO1_D28 0x010c 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE3__LPUART4_RX 0x010c 0x0248 0x4 0x2 +#define IMX7ULP_PAD_PTE3__TPM5_CH1 0x010c 0x02c8 0x6 0x2 +#define IMX7ULP_PAD_PTE3__SDHC1_CMD 0x010c 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE4__PTE4 0x0110 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE4__FXIO1_D27 0x0110 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE4__LPSPI2_SIN 0x0110 0x02b0 0x3 0x2 +#define IMX7ULP_PAD_PTE4__LPUART5_CTS_B 0x0110 0x0250 0x4 0x2 +#define IMX7ULP_PAD_PTE4__LPI2C5_SCL 0x0110 0x02bc 0x5 0x2 +#define IMX7ULP_PAD_PTE4__TPM5_CLKIN 0x0110 0x02cc 0x6 0x2 +#define IMX7ULP_PAD_PTE4__SDHC1_D3 0x0110 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE5__PTE5 0x0114 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE5__FXIO1_D26 0x0114 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE5__LPSPI2_SOUT 0x0114 0x02b4 0x3 0x2 +#define IMX7ULP_PAD_PTE5__LPUART5_RTS_B 0x0114 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTE5__LPI2C5_SDA 0x0114 0x02c0 0x5 0x2 +#define IMX7ULP_PAD_PTE5__TPM5_CH0 0x0114 0x02c4 0x6 0x2 +#define IMX7ULP_PAD_PTE5__SDHC1_D2 0x0114 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE6__PTE6 0x0118 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE6__FXIO1_D25 0x0118 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE6__LPSPI2_SCK 0x0118 0x02ac 0x3 0x2 +#define IMX7ULP_PAD_PTE6__LPUART5_TX 0x0118 0x0258 0x4 0x2 +#define IMX7ULP_PAD_PTE6__LPI2C5_HREQ 0x0118 0x02b8 0x5 0x2 +#define IMX7ULP_PAD_PTE6__TPM7_CH3 0x0118 0x02e8 0x6 0x2 +#define IMX7ULP_PAD_PTE6__SDHC1_D4 0x0118 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE6__FB_A17 0x0118 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE7__PTE7 0x011c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE7__TRACE_D7 0x011c 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTE7__VIU_FID 0x011c 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTE7__FXIO1_D24 0x011c 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE7__LPSPI2_PCS0 0x011c 0x029c 0x3 0x2 +#define IMX7ULP_PAD_PTE7__LPUART5_RX 0x011c 0x0254 0x4 0x2 +#define IMX7ULP_PAD_PTE7__TPM7_CH4 0x011c 0x02ec 0x6 0x2 +#define IMX7ULP_PAD_PTE7__SDHC1_D5 0x011c 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE7__FB_A18 0x011c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE8__PTE8 0x0120 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE8__TRACE_D6 0x0120 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTE8__VIU_D16 0x0120 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTE8__FXIO1_D23 0x0120 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE8__LPSPI3_PCS1 0x0120 0x0314 0x3 0x2 +#define IMX7ULP_PAD_PTE8__LPUART6_CTS_B 0x0120 0x025c 0x4 0x2 +#define IMX7ULP_PAD_PTE8__LPI2C6_SCL 0x0120 0x02fc 0x5 0x2 +#define IMX7ULP_PAD_PTE8__TPM7_CH5 0x0120 0x02f0 0x6 0x2 +#define IMX7ULP_PAD_PTE8__SDHC1_WP 0x0120 0x0200 0x7 0x1 +#define IMX7ULP_PAD_PTE8__SDHC1_D6 0x0120 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE8__FB_CS3_B_FB_BE7_0_BLS31_24_B 0x0120 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE9__PTE9 0x0124 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE9__TRACE_D5 0x0124 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTE9__VIU_D17 0x0124 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTE9__FXIO1_D22 0x0124 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE9__LPSPI3_PCS2 0x0124 0x0318 0x3 0x2 +#define IMX7ULP_PAD_PTE9__LPUART6_RTS_B 0x0124 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTE9__LPI2C6_SDA 0x0124 0x0300 0x5 0x2 +#define IMX7ULP_PAD_PTE9__TPM7_CLKIN 0x0124 0x02f4 0x6 0x2 +#define IMX7ULP_PAD_PTE9__SDHC1_CD 0x0124 0x032c 0x7 0x1 +#define IMX7ULP_PAD_PTE9__SDHC1_D7 0x0124 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE9__FB_TBST_B_FB_CS2_B_FB_BE15_8_BLS23_16_B 0x0124 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE10__PTE10 0x0128 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE10__TRACE_D4 0x0128 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTE10__VIU_D18 0x0128 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTE10__FXIO1_D21 0x0128 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE10__LPSPI3_PCS3 0x0128 0x031c 0x3 0x2 +#define IMX7ULP_PAD_PTE10__LPUART6_TX 0x0128 0x0264 0x4 0x2 +#define IMX7ULP_PAD_PTE10__LPI2C6_HREQ 0x0128 0x02f8 0x5 0x2 +#define IMX7ULP_PAD_PTE10__TPM7_CH0 0x0128 0x02dc 0x6 0x2 +#define IMX7ULP_PAD_PTE10__SDHC1_VS 0x0128 0x0000 0x7 0x0 +#define IMX7ULP_PAD_PTE10__SDHC1_DQS 0x0128 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE10__FB_A19 0x0128 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE11__PTE11 0x012c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE11__TRACE_D3 0x012c 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTE11__VIU_D19 0x012c 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTE11__FXIO1_D20 0x012c 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE11__LPUART6_RX 0x012c 0x0260 0x4 0x2 +#define IMX7ULP_PAD_PTE11__TPM7_CH1 0x012c 0x02e0 0x6 0x2 +#define IMX7ULP_PAD_PTE11__SDHC1_RESET_B 0x012c 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE11__FB_A20 0x012c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE12__PTE12 0x0130 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE12__TRACE_D2 0x0130 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTE12__VIU_D20 0x0130 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTE12__FXIO1_D19 0x0130 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE12__LPSPI3_SIN 0x0130 0x0324 0x3 0x2 +#define IMX7ULP_PAD_PTE12__LPUART7_CTS_B 0x0130 0x0268 0x4 0x2 +#define IMX7ULP_PAD_PTE12__LPI2C7_SCL 0x0130 0x0308 0x5 0x2 +#define IMX7ULP_PAD_PTE12__TPM7_CH2 0x0130 0x02e4 0x6 0x2 +#define IMX7ULP_PAD_PTE12__SDHC1_WP 0x0130 0x0200 0x8 0x2 +#define IMX7ULP_PAD_PTE12__FB_A21 0x0130 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE13__PTE13 0x0134 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE13__TRACE_D1 0x0134 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTE13__VIU_D21 0x0134 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTE13__FXIO1_D18 0x0134 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE13__LPSPI3_SOUT 0x0134 0x0328 0x3 0x2 +#define IMX7ULP_PAD_PTE13__LPUART7_RTS_B 0x0134 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTE13__LPI2C7_SDA 0x0134 0x030c 0x5 0x2 +#define IMX7ULP_PAD_PTE13__TPM6_CLKIN 0x0134 0x02d8 0x6 0x2 +#define IMX7ULP_PAD_PTE13__SDHC1_CD 0x0134 0x032c 0x8 0x2 +#define IMX7ULP_PAD_PTE13__FB_A22 0x0134 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE14__PTE14 0x0138 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE14__TRACE_D0 0x0138 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTE14__VIU_D22 0x0138 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTE14__FXIO1_D17 0x0138 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE14__LPSPI3_SCK 0x0138 0x0320 0x3 0x2 +#define IMX7ULP_PAD_PTE14__LPUART7_TX 0x0138 0x0270 0x4 0x2 +#define IMX7ULP_PAD_PTE14__LPI2C7_HREQ 0x0138 0x0304 0x5 0x2 +#define IMX7ULP_PAD_PTE14__TPM6_CH0 0x0138 0x02d0 0x6 0x2 +#define IMX7ULP_PAD_PTE14__SDHC1_VS 0x0138 0x0000 0x8 0x0 +#define IMX7ULP_PAD_PTE14__FB_A23 0x0138 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTE15__PTE15 0x013c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTE15__TRACE_CLKOUT 0x013c 0x0000 0xa 0x0 +#define IMX7ULP_PAD_PTE15__VIU_D23 0x013c 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTE15__FXIO1_D16 0x013c 0x0000 0x2 0x0 +#define IMX7ULP_PAD_PTE15__LPSPI3_PCS0 0x013c 0x0310 0x3 0x2 +#define IMX7ULP_PAD_PTE15__LPUART7_RX 0x013c 0x026c 0x4 0x2 +#define IMX7ULP_PAD_PTE15__TPM6_CH1 0x013c 0x02d4 0x6 0x2 +#define IMX7ULP_PAD_PTE15__FB_A24 0x013c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF0__PTF0 0x0180 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF0__VIU_DE 0x0180 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF0__LPUART4_CTS_B 0x0180 0x0244 0x4 0x3 +#define IMX7ULP_PAD_PTF0__LPI2C4_SCL 0x0180 0x0278 0x5 0x3 +#define IMX7ULP_PAD_PTF0__TPM4_CLKIN 0x0180 0x0298 0x6 0x3 +#define IMX7ULP_PAD_PTF0__FB_RW_B 0x0180 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF1__PTF1 0x0184 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF1__VIU_HSYNC 0x0184 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF1__LPUART4_RTS_B 0x0184 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTF1__LPI2C4_SDA 0x0184 0x027c 0x5 0x3 +#define IMX7ULP_PAD_PTF1__TPM4_CH0 0x0184 0x0280 0x6 0x3 +#define IMX7ULP_PAD_PTF1__CLKOUT 0x0184 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF2__PTF2 0x0188 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF2__VIU_VSYNC 0x0188 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF2__LPUART4_TX 0x0188 0x024c 0x4 0x3 +#define IMX7ULP_PAD_PTF2__LPI2C4_HREQ 0x0188 0x0274 0x5 0x3 +#define IMX7ULP_PAD_PTF2__TPM4_CH1 0x0188 0x0284 0x6 0x3 +#define IMX7ULP_PAD_PTF2__FB_TSIZ1_FB_CS5_B_FB_BE23_16_BLS15_8_B 0x0188 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF3__PTF3 0x018c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF3__VIU_PCLK 0x018c 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF3__LPUART4_RX 0x018c 0x0248 0x4 0x3 +#define IMX7ULP_PAD_PTF3__TPM4_CH2 0x018c 0x0288 0x6 0x3 +#define IMX7ULP_PAD_PTF3__FB_AD16 0x018c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF4__PTF4 0x0190 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF4__VIU_D0 0x0190 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF4__FXIO1_D0 0x0190 0x0204 0x2 0x2 +#define IMX7ULP_PAD_PTF4__LPSPI2_PCS1 0x0190 0x02a0 0x3 0x3 +#define IMX7ULP_PAD_PTF4__LPUART5_CTS_B 0x0190 0x0250 0x4 0x3 +#define IMX7ULP_PAD_PTF4__LPI2C5_SCL 0x0190 0x02bc 0x5 0x3 +#define IMX7ULP_PAD_PTF4__TPM4_CH3 0x0190 0x028c 0x6 0x2 +#define IMX7ULP_PAD_PTF4__FB_AD17 0x0190 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF5__PTF5 0x0194 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF5__VIU_D1 0x0194 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF5__FXIO1_D1 0x0194 0x0208 0x2 0x2 +#define IMX7ULP_PAD_PTF5__LPSPI2_PCS2 0x0194 0x02a4 0x3 0x3 +#define IMX7ULP_PAD_PTF5__LPUART5_RTS_B 0x0194 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTF5__LPI2C5_SDA 0x0194 0x02c0 0x5 0x3 +#define IMX7ULP_PAD_PTF5__TPM4_CH4 0x0194 0x0290 0x6 0x2 +#define IMX7ULP_PAD_PTF5__FB_AD18 0x0194 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF6__PTF6 0x0198 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF6__VIU_D2 0x0198 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF6__FXIO1_D2 0x0198 0x020c 0x2 0x2 +#define IMX7ULP_PAD_PTF6__LPSPI2_PCS3 0x0198 0x02a8 0x3 0x3 +#define IMX7ULP_PAD_PTF6__LPUART5_TX 0x0198 0x0258 0x4 0x3 +#define IMX7ULP_PAD_PTF6__LPI2C5_HREQ 0x0198 0x02b8 0x5 0x3 +#define IMX7ULP_PAD_PTF6__TPM4_CH5 0x0198 0x0294 0x6 0x2 +#define IMX7ULP_PAD_PTF6__FB_AD19 0x0198 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF7__PTF7 0x019c 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF7__VIU_D3 0x019c 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF7__FXIO1_D3 0x019c 0x0210 0x2 0x2 +#define IMX7ULP_PAD_PTF7__LPUART5_RX 0x019c 0x0254 0x4 0x3 +#define IMX7ULP_PAD_PTF7__TPM5_CH1 0x019c 0x02c8 0x6 0x3 +#define IMX7ULP_PAD_PTF7__FB_AD20 0x019c 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF8__PTF8 0x01a0 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF8__USB1_ULPI_CLK 0x01a0 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF8__VIU_D4 0x01a0 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF8__FXIO1_D4 0x01a0 0x0214 0x2 0x2 +#define IMX7ULP_PAD_PTF8__LPSPI2_SIN 0x01a0 0x02b0 0x3 0x3 +#define IMX7ULP_PAD_PTF8__LPUART6_CTS_B 0x01a0 0x025c 0x4 0x3 +#define IMX7ULP_PAD_PTF8__LPI2C6_SCL 0x01a0 0x02fc 0x5 0x3 +#define IMX7ULP_PAD_PTF8__TPM5_CLKIN 0x01a0 0x02cc 0x6 0x3 +#define IMX7ULP_PAD_PTF8__FB_AD21 0x01a0 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF9__PTF9 0x01a4 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF9__USB1_ULPI_NXT 0x01a4 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF9__VIU_D5 0x01a4 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF9__FXIO1_D5 0x01a4 0x0218 0x2 0x2 +#define IMX7ULP_PAD_PTF9__LPSPI2_SOUT 0x01a4 0x02b4 0x3 0x3 +#define IMX7ULP_PAD_PTF9__LPUART6_RTS_B 0x01a4 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTF9__LPI2C6_SDA 0x01a4 0x0300 0x5 0x3 +#define IMX7ULP_PAD_PTF9__TPM5_CH0 0x01a4 0x02c4 0x6 0x3 +#define IMX7ULP_PAD_PTF9__FB_AD22 0x01a4 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF10__PTF10 0x01a8 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF10__USB1_ULPI_STP 0x01a8 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF10__VIU_D6 0x01a8 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF10__FXIO1_D6 0x01a8 0x021c 0x2 0x2 +#define IMX7ULP_PAD_PTF10__LPSPI2_SCK 0x01a8 0x02ac 0x3 0x3 +#define IMX7ULP_PAD_PTF10__LPUART6_TX 0x01a8 0x0264 0x4 0x3 +#define IMX7ULP_PAD_PTF10__LPI2C6_HREQ 0x01a8 0x02f8 0x5 0x3 +#define IMX7ULP_PAD_PTF10__TPM7_CH3 0x01a8 0x02e8 0x6 0x3 +#define IMX7ULP_PAD_PTF10__FB_AD23 0x01a8 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF11__PTF11 0x01ac 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF11__USB1_ULPI_DIR 0x01ac 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF11__VIU_D7 0x01ac 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF11__FXIO1_D7 0x01ac 0x0220 0x2 0x2 +#define IMX7ULP_PAD_PTF11__LPSPI2_PCS0 0x01ac 0x029c 0x3 0x3 +#define IMX7ULP_PAD_PTF11__LPUART6_RX 0x01ac 0x0260 0x4 0x3 +#define IMX7ULP_PAD_PTF11__TPM7_CH4 0x01ac 0x02ec 0x6 0x3 +#define IMX7ULP_PAD_PTF11__FB_CS4_B_FB_TSIZ0_FB_BE31_24_BLS7_0_B 0x01ac 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF12__PTF12 0x01b0 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF12__USB1_ULPI_DATA0 0x01b0 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF12__VIU_D8 0x01b0 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF12__FXIO1_D8 0x01b0 0x0224 0x2 0x2 +#define IMX7ULP_PAD_PTF12__LPSPI3_PCS1 0x01b0 0x0314 0x3 0x3 +#define IMX7ULP_PAD_PTF12__LPUART7_CTS_B 0x01b0 0x0268 0x4 0x3 +#define IMX7ULP_PAD_PTF12__LPI2C7_SCL 0x01b0 0x0308 0x5 0x3 +#define IMX7ULP_PAD_PTF12__TPM7_CH5 0x01b0 0x02f0 0x6 0x3 +#define IMX7ULP_PAD_PTF12__FB_AD24 0x01b0 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF13__PTF13 0x01b4 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF13__USB1_ULPI_DATA1 0x01b4 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF13__VIU_D9 0x01b4 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF13__FXIO1_D9 0x01b4 0x0228 0x2 0x2 +#define IMX7ULP_PAD_PTF13__LPSPI3_PCS2 0x01b4 0x0318 0x3 0x3 +#define IMX7ULP_PAD_PTF13__LPUART7_RTS_B 0x01b4 0x0000 0x4 0x0 +#define IMX7ULP_PAD_PTF13__LPI2C7_SDA 0x01b4 0x030c 0x5 0x3 +#define IMX7ULP_PAD_PTF13__TPM7_CLKIN 0x01b4 0x02f4 0x6 0x3 +#define IMX7ULP_PAD_PTF13__FB_AD25 0x01b4 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF14__PTF14 0x01b8 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF14__USB1_ULPI_DATA2 0x01b8 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF14__VIU_D10 0x01b8 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF14__FXIO1_D10 0x01b8 0x022c 0x2 0x2 +#define IMX7ULP_PAD_PTF14__LPSPI3_PCS3 0x01b8 0x031c 0x3 0x3 +#define IMX7ULP_PAD_PTF14__LPUART7_TX 0x01b8 0x0270 0x4 0x3 +#define IMX7ULP_PAD_PTF14__LPI2C7_HREQ 0x01b8 0x0304 0x5 0x3 +#define IMX7ULP_PAD_PTF14__TPM7_CH0 0x01b8 0x02dc 0x6 0x3 +#define IMX7ULP_PAD_PTF14__FB_AD26 0x01b8 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF15__PTF15 0x01bc 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF15__USB1_ULPI_DATA3 0x01bc 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF15__VIU_D11 0x01bc 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF15__FXIO1_D11 0x01bc 0x0230 0x2 0x2 +#define IMX7ULP_PAD_PTF15__LPUART7_RX 0x01bc 0x026c 0x4 0x3 +#define IMX7ULP_PAD_PTF15__TPM7_CH1 0x01bc 0x02e0 0x6 0x3 +#define IMX7ULP_PAD_PTF15__FB_AD27 0x01bc 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF16__PTF16 0x01c0 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF16__USB1_ULPI_DATA4 0x01c0 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF16__VIU_D12 0x01c0 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF16__FXIO1_D12 0x01c0 0x0234 0x2 0x2 +#define IMX7ULP_PAD_PTF16__LPSPI3_SIN 0x01c0 0x0324 0x3 0x3 +#define IMX7ULP_PAD_PTF16__TPM7_CH2 0x01c0 0x02e4 0x6 0x3 +#define IMX7ULP_PAD_PTF16__FB_AD28 0x01c0 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF17__PTF17 0x01c4 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF17__USB1_ULPI_DATA5 0x01c4 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF17__VIU_D13 0x01c4 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF17__FXIO1_D13 0x01c4 0x0238 0x2 0x2 +#define IMX7ULP_PAD_PTF17__LPSPI3_SOUT 0x01c4 0x0328 0x3 0x3 +#define IMX7ULP_PAD_PTF17__TPM6_CLKIN 0x01c4 0x02d8 0x6 0x3 +#define IMX7ULP_PAD_PTF17__FB_AD29 0x01c4 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF18__PTF18 0x01c8 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF18__USB1_ULPI_DATA6 0x01c8 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF18__VIU_D14 0x01c8 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF18__FXIO1_D14 0x01c8 0x023c 0x2 0x2 +#define IMX7ULP_PAD_PTF18__LPSPI3_SCK 0x01c8 0x0320 0x3 0x3 +#define IMX7ULP_PAD_PTF18__TPM6_CH0 0x01c8 0x02d0 0x6 0x3 +#define IMX7ULP_PAD_PTF18__FB_AD30 0x01c8 0x0000 0x9 0x0 +#define IMX7ULP_PAD_PTF19__PTF19 0x01cc 0x0000 0x1 0x0 +#define IMX7ULP_PAD_PTF19__USB1_ULPI_DATA7 0x01cc 0x0000 0xb 0x0 +#define IMX7ULP_PAD_PTF19__VIU_D15 0x01cc 0x0000 0xc 0x0 +#define IMX7ULP_PAD_PTF19__FXIO1_D15 0x01cc 0x0240 0x2 0x2 +#define IMX7ULP_PAD_PTF19__LPSPI3_PCS0 0x01cc 0x0310 0x3 0x3 +#define IMX7ULP_PAD_PTF19__TPM6_CH1 0x01cc 0x02d4 0x6 0x3 +#define IMX7ULP_PAD_PTF19__FB_AD31 0x01cc 0x0000 0x9 0x0 + +#endif /* __DTS_IMX7ULP_PINFUNC_H */ diff --git a/src/arm/integrator.dtsi b/src/arm/integrator.dtsi index 6fe0dd1d3541..380f9ae60c78 100644 --- a/src/arm/integrator.dtsi +++ b/src/arm/integrator.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * SoC core Device Tree for the ARM Integrator platforms */ diff --git a/src/arm/integratorap.dts b/src/arm/integratorap.dts index e8b249f92fb3..a5d88a213dcd 100644 --- a/src/arm/integratorap.dts +++ b/src/arm/integratorap.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree for the ARM Integrator/AP platform */ diff --git a/src/arm/integratorcp.dts b/src/arm/integratorcp.dts index 97f38b57a702..a185ab8759fa 100644 --- a/src/arm/integratorcp.dts +++ b/src/arm/integratorcp.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree for the ARM Integrator/CP platform */ diff --git a/src/arm/keystone-k2e-evm.dts b/src/arm/keystone-k2e-evm.dts index ae1ebe7ee021..f1f32c54e72f 100644 --- a/src/arm/keystone-k2e-evm.dts +++ b/src/arm/keystone-k2e-evm.dts @@ -16,6 +16,19 @@ compatible = "ti,k2e-evm", "ti,k2e", "ti,keystone"; model = "Texas Instruments Keystone 2 Edison EVM"; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + dsp_common_memory: dsp-common-memory@81f800000 { + compatible = "shared-dma-pool"; + reg = <0x00000008 0x1f800000 0x00000000 0x800000>; + reusable; + status = "okay"; + }; + }; + soc { clocks { @@ -160,3 +173,8 @@ reg = <1>; }; }; + +&dsp0 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; diff --git a/src/arm/keystone-k2e.dtsi b/src/arm/keystone-k2e.dtsi index 0dd4cdd6d40c..819ab8345916 100644 --- a/src/arm/keystone-k2e.dtsi +++ b/src/arm/keystone-k2e.dtsi @@ -45,6 +45,10 @@ }; }; + aliases { + rproc0 = &dsp0; + }; + soc { /include/ "keystone-k2e-clocks.dtsi" @@ -114,6 +118,22 @@ gpio,syscon-dev = <&devctrl 0x240>; }; + dsp0: dsp@10800000 { + compatible = "ti,k2e-dsp"; + reg = <0x10800000 0x00080000>, + <0x10e00000 0x00008000>, + <0x10f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem0>; + ti,syscon-dev = <&devctrl 0x844>; + resets = <&pscrst 0>; + interrupt-parent = <&kirq0>; + interrupts = <0 8>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio0 27 0>; + status = "disabled"; + }; + pcie1: pcie@21020000 { compatible = "ti,keystone-pcie","snps,dw-pcie"; clocks = <&clkpcie1>; diff --git a/src/arm/keystone-k2g-evm.dts b/src/arm/keystone-k2g-evm.dts index 61883cb969d2..f462f1043531 100644 --- a/src/arm/keystone-k2g-evm.dts +++ b/src/arm/keystone-k2g-evm.dts @@ -25,6 +25,26 @@ reg = <0x00000008 0x00000000 0x00000000 0x80000000>; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + dsp_common_memory: dsp-common-memory@81f800000 { + compatible = "shared-dma-pool"; + reg = <0x00000008 0x1f800000 0x00000000 0x800000>; + reusable; + status = "okay"; + }; + }; + + vcc3v3_dcin_reg: fixedregulator-vcc3v3-dcin { + compatible = "regulator-fixed"; + regulator-name = "mmc0_fixed"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; }; &k2g_pinctrl { @@ -34,6 +54,33 @@ K2G_CORE_IOPAD(0x11d0) (BUFFER_CLASS_B | PIN_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */ >; }; + + mmc0_pins: pinmux_mmc0_pins { + pinctrl-single,pins = < + K2G_CORE_IOPAD(0x1300) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE2) /* mmc0_dat3.mmc0_dat3 */ + K2G_CORE_IOPAD(0x1304) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE2) /* mmc0_dat2.mmc0_dat2 */ + K2G_CORE_IOPAD(0x1308) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE2) /* mmc0_dat1.mmc0_dat1 */ + K2G_CORE_IOPAD(0x130c) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE2) /* mmc0_dat0.mmc0_dat0 */ + K2G_CORE_IOPAD(0x1310) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE2) /* mmc0_clk.mmc0_clk */ + K2G_CORE_IOPAD(0x1314) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE2) /* mmc0_cmd.mmc0_cmd */ + K2G_CORE_IOPAD(0x12ec) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE3) /* mmc0_sdcd.gpio1_12 */ + >; + }; + + mmc1_pins: pinmux_mmc1_pins { + pinctrl-single,pins = < + K2G_CORE_IOPAD(0x10ec) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_dat7.mmc1_dat7 */ + K2G_CORE_IOPAD(0x10f0) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_dat6.mmc1_dat6 */ + K2G_CORE_IOPAD(0x10f4) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_dat5.mmc1_dat5 */ + K2G_CORE_IOPAD(0x10f8) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_dat4.mmc1_dat4 */ + K2G_CORE_IOPAD(0x10fc) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_dat3.mmc1_dat3 */ + K2G_CORE_IOPAD(0x1100) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_dat2.mmc1_dat2 */ + K2G_CORE_IOPAD(0x1104) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_dat1.mmc1_dat1 */ + K2G_CORE_IOPAD(0x1108) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_dat0.mmc1_dat0 */ + K2G_CORE_IOPAD(0x110c) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_clk.mmc1_clk */ + K2G_CORE_IOPAD(0x1110) (BUFFER_CLASS_B | PIN_PULLUP | MUX_MODE0) /* mmc1_cmd.mmc1_cmd */ + >; + }; }; &uart0 { @@ -41,3 +88,27 @@ pinctrl-0 = <&uart0_pins>; status = "okay"; }; + +&gpio1 { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <&vcc3v3_dcin_reg>; + cd-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins>; + vmmc-supply = <&vcc3v3_dcin_reg>; /* VCC3V3_EMMC is connected to VCC3V3_DCIN */ + status = "okay"; +}; + +&dsp0 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; diff --git a/src/arm/keystone-k2g-ice.dts b/src/arm/keystone-k2g-ice.dts index d820d37b5148..78692745e0af 100644 --- a/src/arm/keystone-k2g-ice.dts +++ b/src/arm/keystone-k2g-ice.dts @@ -17,6 +17,19 @@ device_type = "memory"; reg = <0x00000008 0x00000000 0x00000000 0x20000000>; }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + dsp_common_memory: dsp-common-memory@81f800000 { + compatible = "shared-dma-pool"; + reg = <0x00000008 0x1f800000 0x00000000 0x800000>; + reusable; + status = "okay"; + }; + }; }; &k2g_pinctrl { @@ -33,3 +46,8 @@ pinctrl-0 = <&uart0_pins>; status = "okay"; }; + +&dsp0 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; diff --git a/src/arm/keystone-k2g.dtsi b/src/arm/keystone-k2g.dtsi index a789f75a1ed5..826b286665e6 100644 --- a/src/arm/keystone-k2g.dtsi +++ b/src/arm/keystone-k2g.dtsi @@ -15,6 +15,7 @@ #include #include +#include / { compatible = "ti,k2g","ti,keystone"; @@ -27,6 +28,7 @@ aliases { serial0 = &uart0; + rproc0 = &dsp0; }; cpus { @@ -113,6 +115,24 @@ status = "disabled"; }; + dcan0: can@0260B200 { + compatible = "ti,am4372-d_can", "ti,am3352-d_can"; + reg = <0x0260B200 0x200>; + interrupts = ; + status = "disabled"; + power-domains = <&k2g_pds 0x0008>; + clocks = <&k2g_clks 0x0008 1>; + }; + + dcan1: can@0260B400 { + compatible = "ti,am4372-d_can", "ti,am3352-d_can"; + reg = <0x0260B400 0x200>; + interrupts = ; + status = "disabled"; + power-domains = <&k2g_pds 0x0009>; + clocks = <&k2g_clks 0x0009 1>; + }; + kirq0: keystone_irq@026202a0 { compatible = "ti,keystone-irq"; interrupts = ; @@ -128,6 +148,22 @@ gpio,syscon-dev = <&devctrl 0x240>; }; + dsp0: dsp@10800000 { + compatible = "ti,k2g-dsp"; + reg = <0x10800000 0x00100000>, + <0x10e00000 0x00008000>, + <0x10f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + power-domains = <&k2g_pds 0x0046>; + ti,syscon-dev = <&devctrl 0x844>; + resets = <&k2g_reset 0x0046 0x1>; + interrupt-parent = <&kirq0>; + interrupts = <0 8>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio0 27 0>; + status = "disabled"; + }; + msgmgr: msgmgr@02a00000 { compatible = "ti,k2g-message-manager"; #mbox-cells = <2>; @@ -139,5 +175,173 @@ interrupts = , ; }; + + pmmc: pmmc@02921c00 { + compatible = "ti,k2g-sci"; + /* + * In case of rare platforms that does not use k2g as + * system master, use /delete-property/ + */ + ti,system-reboot-controller; + mbox-names = "rx", "tx"; + mboxes= <&msgmgr 5 2>, + <&msgmgr 0 0>; + reg-names = "debug_messages"; + reg = <0x02921c00 0x400>; + + k2g_pds: power-controller { + compatible = "ti,sci-pm-domain"; + #power-domain-cells = <1>; + }; + + k2g_clks: clocks { + compatible = "ti,k2g-sci-clk"; + #clock-cells = <2>; + }; + + k2g_reset: reset-controller { + compatible = "ti,sci-reset"; + #reset-cells = <2>; + }; + }; + + gpio0: gpio@2603000 { + compatible = "ti,k2g-gpio", "ti,keystone-gpio"; + reg = <0x02603000 0x100>; + gpio-controller; + #gpio-cells = <2>; + + interrupts = , + , + , + , + , + , + , + , + ; + interrupt-controller; + #interrupt-cells = <2>; + ti,ngpio = <144>; + ti,davinci-gpio-unbanked = <0>; + clocks = <&k2g_clks 0x001b 0x0>; + clock-names = "gpio"; + }; + + gpio1: gpio@260a000 { + compatible = "ti,k2g-gpio", "ti,keystone-gpio"; + reg = <0x0260a000 0x100>; + gpio-controller; + #gpio-cells = <2>; + interrupts = , + , + , + , + ; + interrupt-controller; + #interrupt-cells = <2>; + ti,ngpio = <68>; + ti,davinci-gpio-unbanked = <0>; + clocks = <&k2g_clks 0x001c 0x0>; + clock-names = "gpio"; + }; + + edma0: edma@02700000 { + compatible = "ti,k2g-edma3-tpcc", "ti,edma3-tpcc"; + reg = <0x02700000 0x8000>; + reg-names = "edma3_cc"; + interrupts = , + , + ; + interrupt-names = "edma3_ccint", "emda3_mperr", + "edma3_ccerrint"; + dma-requests = <64>; + #dma-cells = <2>; + + ti,tptcs = <&edma0_tptc0 7>, <&edma0_tptc1 0>; + + ti,edma-memcpy-channels = <32 33 34 35>; + + power-domains = <&k2g_pds 0x3f>; + }; + + edma0_tptc0: tptc@02760000 { + compatible = "ti,k2g-edma3-tptc", "ti,edma3-tptc"; + reg = <0x02760000 0x400>; + power-domains = <&k2g_pds 0x3f>; + }; + + edma0_tptc1: tptc@02768000 { + compatible = "ti,k2g-edma3-tptc", "ti,edma3-tptc"; + reg = <0x02768000 0x400>; + power-domains = <&k2g_pds 0x3f>; + }; + + edma1: edma@02728000 { + compatible = "ti,k2g-edma3-tpcc", "ti,edma3-tpcc"; + reg = <0x02728000 0x8000>; + reg-names = "edma3_cc"; + interrupts = , + , + ; + interrupt-names = "edma3_ccint", "emda3_mperr", + "edma3_ccerrint"; + dma-requests = <64>; + #dma-cells = <2>; + + ti,tptcs = <&edma1_tptc0 7>, <&edma1_tptc1 0>; + + /* + * memcpy is disabled, can be enabled with: + * ti,edma-memcpy-channels = <12 13 14 15>; + * for example. + */ + + power-domains = <&k2g_pds 0x4f>; + }; + + edma1_tptc0: tptc@027b0000 { + compatible = "ti,k2g-edma3-tptc", "ti,edma3-tptc"; + reg = <0x027b0000 0x400>; + power-domains = <&k2g_pds 0x4f>; + }; + + edma1_tptc1: tptc@027b8000 { + compatible = "ti,k2g-edma3-tptc", "ti,edma3-tptc"; + reg = <0x027b8000 0x400>; + power-domains = <&k2g_pds 0x4f>; + }; + + mmc0: mmc@23000000 { + compatible = "ti,k2g-hsmmc", "ti,omap4-hsmmc"; + reg = <0x23000000 0x400>; + interrupts = ; + dmas = <&edma1 24 0>, <&edma1 25 0>; + dma-names = "tx", "rx"; + bus-width = <4>; + ti,needs-special-reset; + no-1-8-v; + max-frequency = <96000000>; + power-domains = <&k2g_pds 0xb>; + clocks = <&k2g_clks 0xb 1>, <&k2g_clks 0xb 2>; + clock-names = "fck", "mmchsdb_fck"; + status = "disabled"; + }; + + mmc1: mmc@23100000 { + compatible = "ti,k2g-hsmmc", "ti,omap4-hsmmc"; + reg = <0x23100000 0x400>; + interrupts = ; + dmas = <&edma1 26 0>, <&edma1 27 0>; + dma-names = "tx", "rx"; + bus-width = <8>; + ti,needs-special-reset; + ti,non-removable; + max-frequency = <96000000>; + power-domains = <&k2g_pds 0xc>; + clocks = <&k2g_clks 0xc 1>, <&k2g_clks 0xc 2>; + clock-names = "fck", "mmchsdb_fck"; + status = "disabled"; + }; }; }; diff --git a/src/arm/keystone-k2hk-evm.dts b/src/arm/keystone-k2hk-evm.dts index 2156ff92d08f..6dd13b98aaba 100644 --- a/src/arm/keystone-k2hk-evm.dts +++ b/src/arm/keystone-k2hk-evm.dts @@ -16,6 +16,19 @@ compatible = "ti,k2hk-evm", "ti,k2hk", "ti,keystone"; model = "Texas Instruments Keystone 2 Kepler/Hawking EVM"; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + dsp_common_memory: dsp-common-memory@81f800000 { + compatible = "shared-dma-pool"; + reg = <0x00000008 0x1f800000 0x00000000 0x800000>; + reusable; + status = "okay"; + }; + }; + soc { clocks { refclksys: refclksys { @@ -184,3 +197,43 @@ reg = <1>; }; }; + +&dsp0 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp1 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp2 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp3 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp4 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp5 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp6 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp7 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; diff --git a/src/arm/keystone-k2hk.dtsi b/src/arm/keystone-k2hk.dtsi index 69d449430511..31dc00e4e5fd 100644 --- a/src/arm/keystone-k2hk.dtsi +++ b/src/arm/keystone-k2hk.dtsi @@ -45,6 +45,17 @@ }; }; + aliases { + rproc0 = &dsp0; + rproc1 = &dsp1; + rproc2 = &dsp2; + rproc3 = &dsp3; + rproc4 = &dsp4; + rproc5 = &dsp5; + rproc6 = &dsp6; + rproc7 = &dsp7; + }; + soc { /include/ "keystone-k2hk-clocks.dtsi" @@ -134,6 +145,134 @@ gpio,syscon-dev = <&devctrl 0x25c>; }; + dsp0: dsp@10800000 { + compatible = "ti,k2hk-dsp"; + reg = <0x10800000 0x00100000>, + <0x10e00000 0x00008000>, + <0x10f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem0>; + ti,syscon-dev = <&devctrl 0x40>; + resets = <&pscrst 0>; + interrupt-parent = <&kirq0>; + interrupts = <0 8>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio0 27 0>; + status = "disabled"; + }; + + dsp1: dsp@11800000 { + compatible = "ti,k2hk-dsp"; + reg = <0x11800000 0x00100000>, + <0x11e00000 0x00008000>, + <0x11f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem1>; + ti,syscon-dev = <&devctrl 0x44>; + resets = <&pscrst 1>; + interrupt-parent = <&kirq0>; + interrupts = <1 9>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio1 27 0>; + status = "disabled"; + }; + + dsp2: dsp@12800000 { + compatible = "ti,k2hk-dsp"; + reg = <0x12800000 0x00100000>, + <0x12e00000 0x00008000>, + <0x12f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem2>; + ti,syscon-dev = <&devctrl 0x48>; + resets = <&pscrst 2>; + interrupt-parent = <&kirq0>; + interrupts = <2 10>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio2 27 0>; + status = "disabled"; + }; + + dsp3: dsp@13800000 { + compatible = "ti,k2hk-dsp"; + reg = <0x13800000 0x00100000>, + <0x13e00000 0x00008000>, + <0x13f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem3>; + ti,syscon-dev = <&devctrl 0x4c>; + resets = <&pscrst 3>; + interrupt-parent = <&kirq0>; + interrupts = <3 11>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio3 27 0>; + status = "disabled"; + }; + + dsp4: dsp@14800000 { + compatible = "ti,k2hk-dsp"; + reg = <0x14800000 0x00100000>, + <0x14e00000 0x00008000>, + <0x14f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem4>; + ti,syscon-dev = <&devctrl 0x50>; + resets = <&pscrst 4>; + interrupt-parent = <&kirq0>; + interrupts = <4 12>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio4 27 0>; + status = "disabled"; + }; + + dsp5: dsp@15800000 { + compatible = "ti,k2hk-dsp"; + reg = <0x15800000 0x00100000>, + <0x15e00000 0x00008000>, + <0x15f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem5>; + ti,syscon-dev = <&devctrl 0x54>; + resets = <&pscrst 5>; + interrupt-parent = <&kirq0>; + interrupts = <5 13>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio5 27 0>; + status = "disabled"; + }; + + dsp6: dsp@16800000 { + compatible = "ti,k2hk-dsp"; + reg = <0x16800000 0x00100000>, + <0x16e00000 0x00008000>, + <0x16f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem6>; + ti,syscon-dev = <&devctrl 0x58>; + resets = <&pscrst 6>; + interrupt-parent = <&kirq0>; + interrupts = <6 14>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio6 27 0>; + status = "disabled"; + }; + + dsp7: dsp@17800000 { + compatible = "ti,k2hk-dsp"; + reg = <0x17800000 0x00100000>, + <0x17e00000 0x00008000>, + <0x17f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem7>; + ti,syscon-dev = <&devctrl 0x5c>; + resets = <&pscrst 7>; + interrupt-parent = <&kirq0>; + interrupts = <7 15>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio7 27 0>; + status = "disabled"; + }; + mdio: mdio@02090300 { compatible = "ti,keystone_mdio", "ti,davinci_mdio"; #address-cells = <1>; diff --git a/src/arm/keystone-k2l-evm.dts b/src/arm/keystone-k2l-evm.dts index 056b42f99d7a..528667618db4 100644 --- a/src/arm/keystone-k2l-evm.dts +++ b/src/arm/keystone-k2l-evm.dts @@ -16,6 +16,19 @@ compatible = "ti,k2l-evm", "ti,k2l", "ti,keystone"; model = "Texas Instruments Keystone 2 Lamarr EVM"; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + dsp_common_memory: dsp-common-memory@81f800000 { + compatible = "shared-dma-pool"; + reg = <0x00000008 0x1f800000 0x00000000 0x800000>; + reusable; + status = "okay"; + }; + }; + soc { clocks { refclksys: refclksys { @@ -133,3 +146,23 @@ reg = <1>; }; }; + +&dsp0 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp1 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp2 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; + +&dsp3 { + memory-region = <&dsp_common_memory>; + status = "okay"; +}; diff --git a/src/arm/keystone-k2l.dtsi b/src/arm/keystone-k2l.dtsi index 148650406cf7..4431310bc922 100644 --- a/src/arm/keystone-k2l.dtsi +++ b/src/arm/keystone-k2l.dtsi @@ -33,6 +33,13 @@ }; }; + aliases { + rproc0 = &dsp0; + rproc1 = &dsp1; + rproc2 = &dsp2; + rproc3 = &dsp3; + }; + soc { /include/ "keystone-k2l-clocks.dtsi" @@ -268,6 +275,70 @@ gpio,syscon-dev = <&devctrl 0x24c>; }; + dsp0: dsp@10800000 { + compatible = "ti,k2l-dsp"; + reg = <0x10800000 0x00100000>, + <0x10e00000 0x00008000>, + <0x10f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem0>; + ti,syscon-dev = <&devctrl 0x844>; + resets = <&pscrst 0>; + interrupt-parent = <&kirq0>; + interrupts = <0 8>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio0 27 0>; + status = "disabled"; + }; + + dsp1: dsp@11800000 { + compatible = "ti,k2l-dsp"; + reg = <0x11800000 0x00100000>, + <0x11e00000 0x00008000>, + <0x11f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem1>; + ti,syscon-dev = <&devctrl 0x848>; + resets = <&pscrst 1>; + interrupt-parent = <&kirq0>; + interrupts = <1 9>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio1 27 0>; + status = "disabled"; + }; + + dsp2: dsp@12800000 { + compatible = "ti,k2l-dsp"; + reg = <0x12800000 0x00100000>, + <0x12e00000 0x00008000>, + <0x12f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem2>; + ti,syscon-dev = <&devctrl 0x84c>; + resets = <&pscrst 2>; + interrupt-parent = <&kirq0>; + interrupts = <2 10>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio2 27 0>; + status = "disabled"; + }; + + dsp3: dsp@13800000 { + compatible = "ti,k2l-dsp"; + reg = <0x13800000 0x00100000>, + <0x13e00000 0x00008000>, + <0x13f00000 0x00008000>; + reg-names = "l2sram", "l1pram", "l1dram"; + clocks = <&clkgem3>; + ti,syscon-dev = <&devctrl 0x850>; + resets = <&pscrst 3>; + interrupt-parent = <&kirq0>; + interrupts = <3 11>; + interrupt-names = "vring", "exception"; + kick-gpios = <&dspgpio3 27 0>; + status = "disabled"; + }; + mdio: mdio@26200f00 { compatible = "ti,keystone_mdio", "ti,davinci_mdio"; #address-cells = <1>; diff --git a/src/arm/kirkwood-6192.dtsi b/src/arm/kirkwood-6192.dtsi index d573e03f3134..396bcba08adb 100644 --- a/src/arm/kirkwood-6192.dtsi +++ b/src/arm/kirkwood-6192.dtsi @@ -1,6 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 / { mbus@f1000000 { - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,kirkwood-pcie"; status = "disabled"; device_type = "pci"; @@ -24,6 +25,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &intc 9>; marvell,pcie-port = <0>; diff --git a/src/arm/kirkwood-6281.dtsi b/src/arm/kirkwood-6281.dtsi index 748d0b62f233..faa05849a40d 100644 --- a/src/arm/kirkwood-6281.dtsi +++ b/src/arm/kirkwood-6281.dtsi @@ -1,6 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 / { mbus@f1000000 { - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,kirkwood-pcie"; status = "disabled"; device_type = "pci"; @@ -24,6 +25,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &intc 9>; marvell,pcie-port = <0>; diff --git a/src/arm/kirkwood-6282.dtsi b/src/arm/kirkwood-6282.dtsi index bb63d2d50fc5..e84c54b77dea 100644 --- a/src/arm/kirkwood-6282.dtsi +++ b/src/arm/kirkwood-6282.dtsi @@ -1,6 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 / { mbus@f1000000 { - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,kirkwood-pcie"; status = "disabled"; device_type = "pci"; @@ -28,6 +29,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &intc 9>; marvell,pcie-port = <0>; @@ -45,6 +47,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0 0x81000000 0 0 0x81000000 0x2 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &intc 10>; marvell,pcie-port = <1>; diff --git a/src/arm/kirkwood-98dx4122.dtsi b/src/arm/kirkwood-98dx4122.dtsi index 720c210d491d..299c147298c3 100644 --- a/src/arm/kirkwood-98dx4122.dtsi +++ b/src/arm/kirkwood-98dx4122.dtsi @@ -1,6 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0 / { mbus@f1000000 { - pciec: pcie-controller@82000000 { + pciec: pcie@82000000 { compatible = "marvell,kirkwood-pcie"; status = "disabled"; device_type = "pci"; @@ -24,6 +25,7 @@ #interrupt-cells = <1>; ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0 0x81000000 0 0 0x81000000 0x1 0 1 0>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0 0 0 0>; interrupt-map = <0 0 0 0 &intc 9>; marvell,pcie-port = <0>; diff --git a/src/arm/kirkwood-cloudbox.dts b/src/arm/kirkwood-cloudbox.dts index 555b7e4c58a5..448b0cd23b5f 100644 --- a/src/arm/kirkwood-cloudbox.dts +++ b/src/arm/kirkwood-cloudbox.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-dns320.dts b/src/arm/kirkwood-dns320.dts index d85ef0a91b50..d6b0f418fd01 100644 --- a/src/arm/kirkwood-dns320.dts +++ b/src/arm/kirkwood-dns320.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood-dnskw.dtsi" diff --git a/src/arm/kirkwood-dns325.dts b/src/arm/kirkwood-dns325.dts index 5e586ed04c58..94d9c06cbbf5 100644 --- a/src/arm/kirkwood-dns325.dts +++ b/src/arm/kirkwood-dns325.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood-dnskw.dtsi" diff --git a/src/arm/kirkwood-dnskw.dtsi b/src/arm/kirkwood-dnskw.dtsi index d8fca9db46d0..cbaf06f2f78e 100644 --- a/src/arm/kirkwood-dnskw.dtsi +++ b/src/arm/kirkwood-dnskw.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "kirkwood.dtsi" #include "kirkwood-6281.dtsi" diff --git a/src/arm/kirkwood-dockstar.dts b/src/arm/kirkwood-dockstar.dts index 849736349511..6a3f1bf6d9f1 100644 --- a/src/arm/kirkwood-dockstar.dts +++ b/src/arm/kirkwood-dockstar.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-dreamplug.dts b/src/arm/kirkwood-dreamplug.dts index e2abc8246bf3..7f326e267494 100644 --- a/src/arm/kirkwood-dreamplug.dts +++ b/src/arm/kirkwood-dreamplug.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-goflexnet.dts b/src/arm/kirkwood-goflexnet.dts index aa60a0b049a7..02d87e0a1061 100644 --- a/src/arm/kirkwood-goflexnet.dts +++ b/src/arm/kirkwood-goflexnet.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-guruplug-server-plus.dts b/src/arm/kirkwood-guruplug-server-plus.dts index b2d9834bf458..ff1260ee3fe8 100644 --- a/src/arm/kirkwood-guruplug-server-plus.dts +++ b/src/arm/kirkwood-guruplug-server-plus.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-ib62x0.dts b/src/arm/kirkwood-ib62x0.dts index 5bf62897014c..962a910a6f5c 100644 --- a/src/arm/kirkwood-ib62x0.dts +++ b/src/arm/kirkwood-ib62x0.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-iconnect.dts b/src/arm/kirkwood-iconnect.dts index d25184ae4af3..4a512d80912c 100644 --- a/src/arm/kirkwood-iconnect.dts +++ b/src/arm/kirkwood-iconnect.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-iomega_ix2_200.dts b/src/arm/kirkwood-iomega_ix2_200.dts index 8474bffec0ca..62272d58664f 100644 --- a/src/arm/kirkwood-iomega_ix2_200.dts +++ b/src/arm/kirkwood-iomega_ix2_200.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-is2.dts b/src/arm/kirkwood-is2.dts index 4121674abd1c..1bc16a5cdbaa 100644 --- a/src/arm/kirkwood-is2.dts +++ b/src/arm/kirkwood-is2.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/kirkwood-km_common.dtsi b/src/arm/kirkwood-km_common.dtsi index 7962bdefde49..75dc83914f56 100644 --- a/src/arm/kirkwood-km_common.dtsi +++ b/src/arm/kirkwood-km_common.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { chosen { bootargs = "console=ttyS0,115200n8 earlyprintk"; diff --git a/src/arm/kirkwood-km_fixedeth.dts b/src/arm/kirkwood-km_fixedeth.dts index 9895f2b10f8a..515be7bccc0a 100644 --- a/src/arm/kirkwood-km_fixedeth.dts +++ b/src/arm/kirkwood-km_fixedeth.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-km_kirkwood.dts b/src/arm/kirkwood-km_kirkwood.dts index 235bf382fff9..f035eff1c111 100644 --- a/src/arm/kirkwood-km_kirkwood.dts +++ b/src/arm/kirkwood-km_kirkwood.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-lschlv2.dts b/src/arm/kirkwood-lschlv2.dts index e2fa368aef25..1d737d903f5f 100644 --- a/src/arm/kirkwood-lschlv2.dts +++ b/src/arm/kirkwood-lschlv2.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood-lsxl.dtsi" diff --git a/src/arm/kirkwood-lsxhl.dts b/src/arm/kirkwood-lsxhl.dts index 8d89cdf8d6bf..a56e0d797778 100644 --- a/src/arm/kirkwood-lsxhl.dts +++ b/src/arm/kirkwood-lsxhl.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood-lsxl.dtsi" diff --git a/src/arm/kirkwood-lsxl.dtsi b/src/arm/kirkwood-lsxl.dtsi index 8b7c6ce79a41..7b151acb9984 100644 --- a/src/arm/kirkwood-lsxl.dtsi +++ b/src/arm/kirkwood-lsxl.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "kirkwood.dtsi" #include "kirkwood-6281.dtsi" diff --git a/src/arm/kirkwood-mplcec4.dts b/src/arm/kirkwood-mplcec4.dts index aa413b0bcce2..b80d12f6aa49 100644 --- a/src/arm/kirkwood-mplcec4.dts +++ b/src/arm/kirkwood-mplcec4.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-ns2-common.dtsi b/src/arm/kirkwood-ns2-common.dtsi index 282605f4c92c..51530ea86622 100644 --- a/src/arm/kirkwood-ns2-common.dtsi +++ b/src/arm/kirkwood-ns2-common.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "kirkwood.dtsi" #include "kirkwood-6281.dtsi" diff --git a/src/arm/kirkwood-ns2.dts b/src/arm/kirkwood-ns2.dts index 190189d235e6..7b67083e1ec0 100644 --- a/src/arm/kirkwood-ns2.dts +++ b/src/arm/kirkwood-ns2.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/kirkwood-ns2lite.dts b/src/arm/kirkwood-ns2lite.dts index 2c661add0cc0..b0cb5907ed63 100644 --- a/src/arm/kirkwood-ns2lite.dts +++ b/src/arm/kirkwood-ns2lite.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood-ns2-common.dtsi" diff --git a/src/arm/kirkwood-ns2max.dts b/src/arm/kirkwood-ns2max.dts index 55cc41d9c80c..c0a087e77408 100644 --- a/src/arm/kirkwood-ns2max.dts +++ b/src/arm/kirkwood-ns2max.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/kirkwood-ns2mini.dts b/src/arm/kirkwood-ns2mini.dts index 9935f3ec29b4..5b9fa14b6428 100644 --- a/src/arm/kirkwood-ns2mini.dts +++ b/src/arm/kirkwood-ns2mini.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/kirkwood-nsa310.dts b/src/arm/kirkwood-nsa310.dts index 0b69ee4934fa..9b861c2e76c5 100644 --- a/src/arm/kirkwood-nsa310.dts +++ b/src/arm/kirkwood-nsa310.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood-nsa3x0-common.dtsi" diff --git a/src/arm/kirkwood-nsa310a.dts b/src/arm/kirkwood-nsa310a.dts index 3d2b3d494c19..b85e314f045a 100644 --- a/src/arm/kirkwood-nsa310a.dts +++ b/src/arm/kirkwood-nsa310a.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood-nsa3x0-common.dtsi" diff --git a/src/arm/kirkwood-nsa3x0-common.dtsi b/src/arm/kirkwood-nsa3x0-common.dtsi index e09b79ac73fd..2c4037b07282 100644 --- a/src/arm/kirkwood-nsa3x0-common.dtsi +++ b/src/arm/kirkwood-nsa3x0-common.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "kirkwood.dtsi" #include "kirkwood-6281.dtsi" diff --git a/src/arm/kirkwood-openblocks_a6.dts b/src/arm/kirkwood-openblocks_a6.dts index c75da5f0ca48..8ea430168ea5 100644 --- a/src/arm/kirkwood-openblocks_a6.dts +++ b/src/arm/kirkwood-openblocks_a6.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-pogoplug-series-4.dts b/src/arm/kirkwood-pogoplug-series-4.dts index b2f26239d298..5ce220ac9611 100644 --- a/src/arm/kirkwood-pogoplug-series-4.dts +++ b/src/arm/kirkwood-pogoplug-series-4.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * kirkwood-pogoplug-series-4.dts - Device tree file for PogoPlug Series 4 * inspired by the board files made by Kevin Mihelich for ArchLinux, diff --git a/src/arm/kirkwood-topkick.dts b/src/arm/kirkwood-topkick.dts index 330aada6d33f..a5b51e29f63e 100644 --- a/src/arm/kirkwood-topkick.dts +++ b/src/arm/kirkwood-topkick.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-ts219-6281.dts b/src/arm/kirkwood-ts219-6281.dts index ee62204e4ecd..30892c19aceb 100644 --- a/src/arm/kirkwood-ts219-6281.dts +++ b/src/arm/kirkwood-ts219-6281.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-ts219-6282.dts b/src/arm/kirkwood-ts219-6282.dts index 3437bb396844..aba1205981f1 100644 --- a/src/arm/kirkwood-ts219-6282.dts +++ b/src/arm/kirkwood-ts219-6282.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "kirkwood.dtsi" diff --git a/src/arm/kirkwood-ts219.dtsi b/src/arm/kirkwood-ts219.dtsi index 62e5e2d5c348..4faea1d9facf 100644 --- a/src/arm/kirkwood-ts219.dtsi +++ b/src/arm/kirkwood-ts219.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { model = "QNAP TS219 family"; compatible = "qnap,ts219", "marvell,kirkwood"; diff --git a/src/arm/kirkwood.dtsi b/src/arm/kirkwood.dtsi index 29b8bd7e0d93..a70fc7f01fc3 100644 --- a/src/arm/kirkwood.dtsi +++ b/src/arm/kirkwood.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /include/ "skeleton.dtsi" #include #include diff --git a/src/arm/logicpd-torpedo-37xx-devkit.dts b/src/arm/logicpd-torpedo-37xx-devkit.dts index 43e9364083de..b4575bbaf085 100644 --- a/src/arm/logicpd-torpedo-37xx-devkit.dts +++ b/src/arm/logicpd-torpedo-37xx-devkit.dts @@ -192,7 +192,7 @@ interrupts-extended = <&intc 83 &omap3_pmx_core 0x11a>; pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins &mmc1_cd>; - cd-gpios = <&gpio4 31 IRQ_TYPE_LEVEL_LOW>; /* gpio127 */ + cd-gpios = <&gpio4 31 GPIO_ACTIVE_LOW>; /* gpio127 */ vmmc-supply = <&vmmc1>; bus-width = <4>; cap-power-off-card; diff --git a/src/arm/ls1021a.dtsi b/src/arm/ls1021a.dtsi index 7bb9df2c1460..9319e1f0f1d8 100644 --- a/src/arm/ls1021a.dtsi +++ b/src/arm/ls1021a.dtsi @@ -129,14 +129,14 @@ }; msi1: msi-controller@1570e00 { - compatible = "fsl,1s1021a-msi"; + compatible = "fsl,ls1021a-msi"; reg = <0x0 0x1570e00 0x0 0x8>; msi-controller; interrupts = ; }; msi2: msi-controller@1570e08 { - compatible = "fsl,1s1021a-msi"; + compatible = "fsl,ls1021a-msi"; reg = <0x0 0x1570e08 0x0 0x8>; msi-controller; interrupts = ; @@ -699,7 +699,7 @@ bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000 /* downstream I/O */ 0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ - msi-parent = <&msi1>; + msi-parent = <&msi1>, <&msi2>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 7>; interrupt-map = <0000 0 0 1 &gic GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>, @@ -722,7 +722,7 @@ bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x00000000 0x48 0x00010000 0x0 0x00010000 /* downstream I/O */ 0x82000000 0x0 0x40000000 0x48 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ - msi-parent = <&msi2>; + msi-parent = <&msi1>, <&msi2>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 7>; interrupt-map = <0000 0 0 1 &gic GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>, diff --git a/src/arm/meson.dtsi b/src/arm/meson.dtsi index 15204e44161d..cd6ad072e72c 100644 --- a/src/arm/meson.dtsi +++ b/src/arm/meson.dtsi @@ -86,14 +86,14 @@ }; uart_A: serial@84c0 { - compatible = "amlogic,meson-uart"; + compatible = "amlogic,meson6-uart", "amlogic,meson-uart"; reg = <0x84c0 0x18>; interrupts = ; status = "disabled"; }; uart_B: serial@84dc { - compatible = "amlogic,meson-uart"; + compatible = "amlogic,meson6-uart", "amlogic,meson-uart"; reg = <0x84dc 0x18>; interrupts = ; status = "disabled"; @@ -108,6 +108,20 @@ status = "disabled"; }; + pwm_ab: pwm@8550 { + compatible = "amlogic,meson-pwm"; + reg = <0x8550 0x10>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm_cd: pwm@8650 { + compatible = "amlogic,meson-pwm"; + reg = <0x8650 0x10>; + #pwm-cells = <3>; + status = "disabled"; + }; + saradc: adc@8680 { compatible = "amlogic,meson-saradc"; reg = <0x8680 0x34>; @@ -117,7 +131,7 @@ }; uart_C: serial@8700 { - compatible = "amlogic,meson-uart"; + compatible = "amlogic,meson6-uart", "amlogic,meson-uart"; reg = <0x8700 0x18>; interrupts = ; status = "disabled"; @@ -182,7 +196,7 @@ }; uart_AO: serial@4c0 { - compatible = "amlogic,meson-uart"; + compatible = "amlogic,meson6-uart", "amlogic,meson-ao-uart", "amlogic,meson-uart"; reg = <0x4c0 0x18>; interrupts = ; status = "disabled"; @@ -230,5 +244,13 @@ interrupt-names = "macirq"; status = "disabled"; }; + + ahb_sram: sram@d9000000 { + compatible = "mmio-sram"; + reg = <0xd9000000 0x20000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0xd9000000 0x20000>; + }; }; }; /* end of / */ diff --git a/src/arm/meson6.dtsi b/src/arm/meson6.dtsi index 8557b6117a4b..ef281d290052 100644 --- a/src/arm/meson6.dtsi +++ b/src/arm/meson6.dtsi @@ -70,9 +70,37 @@ }; }; + xtal: xtal-clk { + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "xtal"; + #clock-cells = <0>; + }; + clk81: clk@0 { #clock-cells = <0>; compatible = "fixed-clock"; clock-frequency = <200000000>; }; }; /* end of / */ + + +&uart_AO { + clocks = <&xtal>, <&clk81>, <&clk81>; + clock-names = "xtal", "pclk", "baud"; +}; + +&uart_A { + clocks = <&xtal>, <&clk81>, <&clk81>; + clock-names = "xtal", "pclk", "baud"; +}; + +&uart_B { + clocks = <&xtal>, <&clk81>, <&clk81>; + clock-names = "xtal", "pclk", "baud"; +}; + +&uart_C { + clocks = <&xtal>, <&clk81>, <&clk81>; + clock-names = "xtal", "pclk", "baud"; +}; diff --git a/src/arm/meson8.dtsi b/src/arm/meson8.dtsi index cada35828931..b98d44fde6b6 100644 --- a/src/arm/meson8.dtsi +++ b/src/arm/meson8.dtsi @@ -168,10 +168,18 @@ &cbus { clkc: clock-controller@4000 { #clock-cells = <1>; + #reset-cells = <1>; compatible = "amlogic,meson8-clkc"; reg = <0x8000 0x4>, <0x4000 0x460>; }; + pwm_ef: pwm@86c0 { + compatible = "amlogic,meson8-pwm", "amlogic,meson8b-pwm"; + reg = <0x86c0 0x10>; + #pwm-cells = <3>; + status = "disabled"; + }; + pinctrl_cbus: pinctrl@9880 { compatible = "amlogic,meson8-cbus-pinctrl"; reg = <0x9880 0x10>; @@ -270,6 +278,14 @@ arm,filter-ranges = <0x100000 0xc0000000>; }; +&pwm_ab { + compatible = "amlogic,meson8-pwm", "amlogic,meson8b-pwm"; +}; + +&pwm_cd { + compatible = "amlogic,meson8-pwm", "amlogic,meson8b-pwm"; +}; + &saradc { compatible = "amlogic,meson8-saradc", "amlogic,meson-saradc"; clocks = <&clkc CLKID_XTAL>, diff --git a/src/arm/meson8b.dtsi b/src/arm/meson8b.dtsi index 72e4f425f190..bc278da7df0d 100644 --- a/src/arm/meson8b.dtsi +++ b/src/arm/meson8b.dtsi @@ -119,6 +119,7 @@ &cbus { clkc: clock-controller@4000 { #clock-cells = <1>; + #reset-cells = <1>; compatible = "amlogic,meson8b-clkc"; reg = <0x8000 0x4>, <0x4000 0x460>; }; @@ -129,20 +130,6 @@ #reset-cells = <1>; }; - pwm_ab: pwm@8550 { - compatible = "amlogic,meson8b-pwm"; - reg = <0x8550 0x10>; - #pwm-cells = <3>; - status = "disabled"; - }; - - pwm_cd: pwm@8650 { - compatible = "amlogic,meson8b-pwm"; - reg = <0x8650 0x10>; - #pwm-cells = <3>; - status = "disabled"; - }; - pwm_ef: pwm@86c0 { compatible = "amlogic,meson8b-pwm"; reg = <0x86c0 0x10>; @@ -150,12 +137,6 @@ status = "disabled"; }; - wdt: watchdog@9900 { - compatible = "amlogic,meson8b-wdt"; - reg = <0x9900 0x8>; - interrupts = <0 0 1>; - }; - pinctrl_cbus: pinctrl@9880 { compatible = "amlogic,meson8b-cbus-pinctrl"; reg = <0x9880 0x10>; @@ -193,6 +174,14 @@ arm,filter-ranges = <0x100000 0xc0000000>; }; +&pwm_ab { + compatible = "amlogic,meson8b-pwm"; +}; + +&pwm_cd { + compatible = "amlogic,meson8b-pwm"; +}; + &saradc { compatible = "amlogic,meson8b-saradc", "amlogic,meson-saradc"; clocks = <&clkc CLKID_XTAL>, @@ -242,3 +231,7 @@ clock-names = "usb_general", "usb"; resets = <&reset RESET_USB_OTG>; }; + +&wdt { + compatible = "amlogic,meson8b-wdt"; +}; diff --git a/src/arm/motorola-cpcap-mapphone.dtsi b/src/arm/motorola-cpcap-mapphone.dtsi index 1eb5da1dc8f0..4d61e5b1334a 100644 --- a/src/arm/motorola-cpcap-mapphone.dtsi +++ b/src/arm/motorola-cpcap-mapphone.dtsi @@ -255,5 +255,6 @@ regulator-min-microvolt = <2775000>; regulator-max-microvolt = <2775000>; regulator-enable-ramp-delay = <1000>; + regulator-initial-mode = <0x00>; /* NORMAL */ }; }; diff --git a/src/arm/moxart.dtsi b/src/arm/moxart.dtsi index 1f4c795d3f72..da7b3237bfe9 100644 --- a/src/arm/moxart.dtsi +++ b/src/arm/moxart.dtsi @@ -87,9 +87,10 @@ }; watchdog: watchdog@98500000 { - compatible = "moxa,moxart-watchdog"; + compatible = "moxa,moxart-watchdog", "faraday,ftwdt010"; reg = <0x98500000 0x10>; clocks = <&clk_apb>; + clock-names = "PCLK"; }; sdhci: sdhci@98e00000 { diff --git a/src/arm/mt2701.dtsi b/src/arm/mt2701.dtsi index f1efdc63656a..afe12e5b51f9 100644 --- a/src/arm/mt2701.dtsi +++ b/src/arm/mt2701.dtsi @@ -13,6 +13,7 @@ */ #include +#include #include #include #include @@ -533,6 +534,7 @@ compatible = "mediatek,mt2701-smi-larb"; reg = <0 0x14010000 0 0x1000>; mediatek,smi = <&smi_common>; + mediatek,larb-id = <0>; clocks = <&mmsys CLK_MM_SMI_LARB0>, <&mmsys CLK_MM_SMI_LARB0>; clock-names = "apb", "smi"; @@ -549,6 +551,7 @@ compatible = "mediatek,mt2701-smi-larb"; reg = <0 0x15001000 0 0x1000>; mediatek,smi = <&smi_common>; + mediatek,larb-id = <2>; clocks = <&imgsys CLK_IMG_SMI_COMM>, <&imgsys CLK_IMG_SMI_COMM>; clock-names = "apb", "smi"; @@ -579,6 +582,7 @@ compatible = "mediatek,mt2701-smi-larb"; reg = <0 0x16010000 0 0x1000>; mediatek,smi = <&smi_common>; + mediatek,larb-id = <1>; clocks = <&vdecsys CLK_VDEC_CKGEN>, <&vdecsys CLK_VDEC_LARB>; clock-names = "apb", "smi"; @@ -591,12 +595,114 @@ #clock-cells = <1>; }; + usb0: usb@1a1c0000 { + compatible = "mediatek,mt8173-xhci"; + reg = <0 0x1a1c0000 0 0x1000>, + <0 0x1a1c4700 0 0x0100>; + reg-names = "mac", "ippc"; + interrupts = ; + clocks = <&hifsys CLK_HIFSYS_USB0PHY>, + <&topckgen CLK_TOP_ETHIF_SEL>; + clock-names = "sys_ck", "ref_ck"; + power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>; + phys = <&u2port0 PHY_TYPE_USB2>, <&u3port0 PHY_TYPE_USB3>; + status = "disabled"; + }; + + u3phy0: usb-phy@1a1c4000 { + compatible = "mediatek,mt2701-u3phy"; + reg = <0 0x1a1c4000 0 0x0700>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + status = "disabled"; + + u2port0: usb-phy@1a1c4800 { + reg = <0 0x1a1c4800 0 0x0100>; + clocks = <&topckgen CLK_TOP_USB_PHY48M>; + clock-names = "ref"; + #phy-cells = <1>; + status = "okay"; + }; + + u3port0: usb-phy@1a1c4900 { + reg = <0 0x1a1c4900 0 0x0700>; + clocks = <&clk26m>; + clock-names = "ref"; + #phy-cells = <1>; + status = "okay"; + }; + }; + + usb1: usb@1a240000 { + compatible = "mediatek,mt8173-xhci"; + reg = <0 0x1a240000 0 0x1000>, + <0 0x1a244700 0 0x0100>; + reg-names = "mac", "ippc"; + interrupts = ; + clocks = <&hifsys CLK_HIFSYS_USB1PHY>, + <&topckgen CLK_TOP_ETHIF_SEL>; + clock-names = "sys_ck", "ref_ck"; + power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>; + phys = <&u2port1 PHY_TYPE_USB2>, <&u3port1 PHY_TYPE_USB3>; + status = "disabled"; + }; + + u3phy1: usb-phy@1a244000 { + compatible = "mediatek,mt2701-u3phy"; + reg = <0 0x1a244000 0 0x0700>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + status = "disabled"; + + u2port1: usb-phy@1a244800 { + reg = <0 0x1a244800 0 0x0100>; + clocks = <&topckgen CLK_TOP_USB_PHY48M>; + clock-names = "ref"; + #phy-cells = <1>; + status = "okay"; + }; + + u3port1: usb-phy@1a244900 { + reg = <0 0x1a244900 0 0x0700>; + clocks = <&clk26m>; + clock-names = "ref"; + #phy-cells = <1>; + status = "okay"; + }; + }; + ethsys: syscon@1b000000 { compatible = "mediatek,mt2701-ethsys", "syscon"; reg = <0 0x1b000000 0 0x1000>; #clock-cells = <1>; }; + eth: ethernet@1b100000 { + compatible = "mediatek,mt2701-eth", "syscon"; + reg = <0 0x1b100000 0 0x20000>; + interrupts = , + , + ; + clocks = <&topckgen CLK_TOP_ETHIF_SEL>, + <ðsys CLK_ETHSYS_ESW>, + <ðsys CLK_ETHSYS_GP1>, + <ðsys CLK_ETHSYS_GP2>, + <&apmixedsys CLK_APMIXED_TRGPLL>; + clock-names = "ethif", "esw", "gp1", "gp2", "trgpll"; + resets = <ðsys MT2701_ETHSYS_FE_RST>, + <ðsys MT2701_ETHSYS_GMAC_RST>, + <ðsys MT2701_ETHSYS_PPE_RST>; + reset-names = "fe", "gmac", "ppe"; + power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>; + mediatek,ethsys = <ðsys>; + mediatek,pctl = <&syscfg_pctl_a>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + bdpsys: syscon@1c000000 { compatible = "mediatek,mt2701-bdpsys", "syscon"; reg = <0 0x1c000000 0 0x1000>; diff --git a/src/arm/mt6323.dtsi b/src/arm/mt6323.dtsi new file mode 100644 index 000000000000..7c783d6c750e --- /dev/null +++ b/src/arm/mt6323.dtsi @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2017 MediaTek Inc. + * Author: John Crispin + * Sean Wang + * 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. + * + * 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. + */ + +&pwrap { + pmic: mt6323 { + compatible = "mediatek,mt6323"; + interrupt-parent = <&pio>; + interrupts = <150 IRQ_TYPE_LEVEL_HIGH>; + interrupt-controller; + #interrupt-cells = <2>; + + mt6323regulator: mt6323regulator{ + compatible = "mediatek,mt6323-regulator"; + + mt6323_vproc_reg: buck_vproc{ + regulator-name = "vproc"; + regulator-min-microvolt = < 700000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <12500>; + regulator-always-on; + regulator-boot-on; + }; + + mt6323_vsys_reg: buck_vsys{ + regulator-name = "vsys"; + regulator-min-microvolt = <1400000>; + regulator-max-microvolt = <2987500>; + regulator-ramp-delay = <25000>; + regulator-always-on; + regulator-boot-on; + }; + + mt6323_vpa_reg: buck_vpa{ + regulator-name = "vpa"; + regulator-min-microvolt = < 500000>; + regulator-max-microvolt = <3650000>; + }; + + mt6323_vtcxo_reg: ldo_vtcxo{ + regulator-name = "vtcxo"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <90>; + regulator-always-on; + regulator-boot-on; + }; + + mt6323_vcn28_reg: ldo_vcn28{ + regulator-name = "vcn28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <185>; + }; + + mt6323_vcn33_bt_reg: ldo_vcn33_bt{ + regulator-name = "vcn33_bt"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3600000>; + regulator-enable-ramp-delay = <185>; + }; + + mt6323_vcn33_wifi_reg: ldo_vcn33_wifi{ + regulator-name = "vcn33_wifi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3600000>; + regulator-enable-ramp-delay = <185>; + }; + + mt6323_va_reg: ldo_va{ + regulator-name = "va"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <216>; + regulator-always-on; + regulator-boot-on; + }; + + mt6323_vcama_reg: ldo_vcama{ + regulator-name = "vcama"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <216>; + }; + + mt6323_vio28_reg: ldo_vio28{ + regulator-name = "vio28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <216>; + regulator-always-on; + regulator-boot-on; + }; + + mt6323_vusb_reg: ldo_vusb{ + regulator-name = "vusb"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <216>; + regulator-boot-on; + }; + + mt6323_vmc_reg: ldo_vmc{ + regulator-name = "vmc"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <36>; + regulator-boot-on; + }; + + mt6323_vmch_reg: ldo_vmch{ + regulator-name = "vmch"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <36>; + regulator-boot-on; + }; + + mt6323_vemc3v3_reg: ldo_vemc3v3{ + regulator-name = "vemc3v3"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <36>; + regulator-boot-on; + }; + + mt6323_vgp1_reg: ldo_vgp1{ + regulator-name = "vgp1"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <216>; + }; + + mt6323_vgp2_reg: ldo_vgp2{ + regulator-name = "vgp2"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3000000>; + regulator-enable-ramp-delay = <216>; + }; + + mt6323_vgp3_reg: ldo_vgp3{ + regulator-name = "vgp3"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <216>; + }; + + mt6323_vcn18_reg: ldo_vcn18{ + regulator-name = "vcn18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <216>; + }; + + mt6323_vsim1_reg: ldo_vsim1{ + regulator-name = "vsim1"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3000000>; + regulator-enable-ramp-delay = <216>; + }; + + mt6323_vsim2_reg: ldo_vsim2{ + regulator-name = "vsim2"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3000000>; + regulator-enable-ramp-delay = <216>; + }; + + mt6323_vrtc_reg: ldo_vrtc{ + regulator-name = "vrtc"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-always-on; + regulator-boot-on; + }; + + mt6323_vcamaf_reg: ldo_vcamaf{ + regulator-name = "vcamaf"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <216>; + }; + + mt6323_vibr_reg: ldo_vibr{ + regulator-name = "vibr"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <36>; + }; + + mt6323_vrf18_reg: ldo_vrf18{ + regulator-name = "vrf18"; + regulator-min-microvolt = <1825000>; + regulator-max-microvolt = <1825000>; + regulator-enable-ramp-delay = <187>; + }; + + mt6323_vm_reg: ldo_vm{ + regulator-name = "vm"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <216>; + regulator-always-on; + regulator-boot-on; + }; + + mt6323_vio18_reg: ldo_vio18{ + regulator-name = "vio18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <216>; + regulator-always-on; + regulator-boot-on; + }; + + mt6323_vcamd_reg: ldo_vcamd{ + regulator-name = "vcamd"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <216>; + }; + + mt6323_vcamio_reg: ldo_vcamio{ + regulator-name = "vcamio"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <216>; + }; + }; + }; +}; diff --git a/src/arm/mt7623-evb.dts b/src/arm/mt7623-evb.dts deleted file mode 100644 index b60b41cad592..000000000000 --- a/src/arm/mt7623-evb.dts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2016 MediaTek Inc. - * Author: John Crispin - * - * 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. - * - * 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. - */ - -/dts-v1/; -#include "mt7623.dtsi" - -/ { - model = "MediaTek MT7623 evaluation board"; - compatible = "mediatek,mt7623-evb", "mediatek,mt7623"; - - chosen { - stdout-path = &uart2; - }; - - memory { - reg = <0 0x80000000 0 0x40000000>; - }; -}; - -&uart2 { - status = "okay"; -}; diff --git a/src/arm/mt7623.dtsi b/src/arm/mt7623.dtsi index d81158b2b02f..ec8a07415cb3 100644 --- a/src/arm/mt7623.dtsi +++ b/src/arm/mt7623.dtsi @@ -21,36 +21,99 @@ #include #include #include +#include #include "skeleton64.dtsi" / { compatible = "mediatek,mt7623"; interrupt-parent = <&sysirq>; + cpu_opp_table: opp_table { + compatible = "operating-points-v2"; + opp-shared; + + opp-98000000 { + opp-hz = /bits/ 64 <98000000>; + opp-microvolt = <1050000>; + }; + + opp-198000000 { + opp-hz = /bits/ 64 <198000000>; + opp-microvolt = <1050000>; + }; + + opp-398000000 { + opp-hz = /bits/ 64 <398000000>; + opp-microvolt = <1050000>; + }; + + opp-598000000 { + opp-hz = /bits/ 64 <598000000>; + opp-microvolt = <1050000>; + }; + + opp-747500000 { + opp-hz = /bits/ 64 <747500000>; + opp-microvolt = <1050000>; + }; + + opp-1040000000 { + opp-hz = /bits/ 64 <1040000000>; + opp-microvolt = <1150000>; + }; + + opp-1196000000 { + opp-hz = /bits/ 64 <1196000000>; + opp-microvolt = <1200000>; + }; + + opp-1300000000 { + opp-hz = /bits/ 64 <1300000000>; + opp-microvolt = <1300000>; + }; + }; + cpus { #address-cells = <1>; #size-cells = <0>; enable-method = "mediatek,mt6589-smp"; - cpu@0 { + cpu0: cpu@0 { device_type = "cpu"; compatible = "arm,cortex-a7"; reg = <0x0>; + clocks = <&infracfg CLK_INFRA_CPUSEL>, + <&apmixedsys CLK_APMIXED_MAINPLL>; + clock-names = "cpu", "intermediate"; + operating-points-v2 = <&cpu_opp_table>; + #cooling-cells = <2>; + cooling-min-level = <0>; + cooling-max-level = <7>; + clock-frequency = <1300000000>; }; - cpu@1 { + + cpu1: cpu@1 { device_type = "cpu"; compatible = "arm,cortex-a7"; reg = <0x1>; + operating-points-v2 = <&cpu_opp_table>; + clock-frequency = <1300000000>; }; - cpu@2 { + + cpu2: cpu@2 { device_type = "cpu"; compatible = "arm,cortex-a7"; reg = <0x2>; + operating-points-v2 = <&cpu_opp_table>; + clock-frequency = <1300000000>; }; - cpu@3 { + + cpu3: cpu@3 { device_type = "cpu"; compatible = "arm,cortex-a7"; reg = <0x3>; + operating-points-v2 = <&cpu_opp_table>; + clock-frequency = <1300000000>; }; }; @@ -74,6 +137,58 @@ clock-output-names = "clk26m"; }; + thermal-zones { + cpu_thermal: cpu_thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + + thermal-sensors = <&thermal 0>; + + trips { + cpu_passive: cpu_passive { + temperature = <47000>; + hysteresis = <2000>; + type = "passive"; + }; + + cpu_active: cpu_active { + temperature = <67000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_hot: cpu_hot { + temperature = <87000>; + hysteresis = <2000>; + type = "hot"; + }; + + cpu_crit { + temperature = <107000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&cpu_passive>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + + map1 { + trip = <&cpu_active>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + + map2 { + trip = <&cpu_hot>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + }; + timer { compatible = "arm,armv7-timer"; interrupt-parent = <&gic>; @@ -172,7 +287,7 @@ clock-names = "spi", "wrap"; }; - cir: cir@0x10013000 { + cir: cir@10013000 { compatible = "mediatek,mt7623-cir"; reg = <0 0x10013000 0 0x1000>; interrupts = ; @@ -193,7 +308,7 @@ efuse: efuse@10206000 { compatible = "mediatek,mt7623-efuse", "mediatek,mt8173-efuse"; - reg = <0 0x10206000 0 0x1000>; + reg = <0 0x10206000 0 0x1000>; #address-cells = <1>; #size-cells = <1>; thermal_calibration_data: calib@424 { @@ -371,6 +486,31 @@ nvmem-cell-names = "calibration-data"; }; + nandc: nfi@1100d000 { + compatible = "mediatek,mt7623-nfc", + "mediatek,mt2701-nfc"; + reg = <0 0x1100d000 0 0x1000>; + interrupts = ; + power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>; + clocks = <&pericfg CLK_PERI_NFI>, + <&pericfg CLK_PERI_NFI_PAD>; + clock-names = "nfi_clk", "pad_clk"; + status = "disabled"; + ecc-engine = <&bch>; + #address-cells = <1>; + #size-cells = <0>; + }; + + bch: ecc@1100e000 { + compatible = "mediatek,mt7623-ecc", + "mediatek,mt2701-ecc"; + reg = <0 0x1100e000 0 0x1000>; + interrupts = ; + clocks = <&pericfg CLK_PERI_NFI_ECC>; + clock-names = "nfiecc_clk"; + status = "disabled"; + }; + spi1: spi@11016000 { compatible = "mediatek,mt7623-spi", "mediatek,mt2701-spi"; @@ -399,31 +539,6 @@ status = "disabled"; }; - nandc: nfi@1100d000 { - compatible = "mediatek,mt7623-nfc", - "mediatek,mt2701-nfc"; - reg = <0 0x1100d000 0 0x1000>; - interrupts = ; - power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>; - clocks = <&pericfg CLK_PERI_NFI>, - <&pericfg CLK_PERI_NFI_PAD>; - clock-names = "nfi_clk", "pad_clk"; - status = "disabled"; - ecc-engine = <&bch>; - #address-cells = <1>; - #size-cells = <0>; - }; - - bch: ecc@1100e000 { - compatible = "mediatek,mt7623-ecc", - "mediatek,mt2701-ecc"; - reg = <0 0x1100e000 0 0x1000>; - interrupts = ; - clocks = <&pericfg CLK_PERI_NFI_ECC>; - clock-names = "nfiecc_clk"; - status = "disabled"; - }; - afe: audio-controller@11220000 { compatible = "mediatek,mt7623-audio", "mediatek,mt2701-audio"; @@ -538,13 +653,22 @@ compatible = "mediatek,mt7623-mmc", "mediatek,mt8135-mmc"; reg = <0 0x11240000 0 0x1000>; - interrupts = ; + interrupts = ; clocks = <&pericfg CLK_PERI_MSDC30_1>, <&topckgen CLK_TOP_MSDC30_1_SEL>; clock-names = "source", "hclk"; status = "disabled"; }; + hifsys: syscon@1a000000 { + compatible = "mediatek,mt7623-hifsys", + "mediatek,mt2701-hifsys", + "syscon"; + reg = <0 0x1a000000 0 0x1000>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + usb1: usb@1a1c0000 { compatible = "mediatek,mt7623-xhci", "mediatek,mt8173-xhci"; @@ -561,7 +685,8 @@ }; u3phy1: usb-phy@1a1c4000 { - compatible = "mediatek,mt7623-u3phy", "mediatek,mt2701-u3phy"; + compatible = "mediatek,mt7623-u3phy", + "mediatek,mt2701-u3phy"; reg = <0 0x1a1c4000 0 0x0700>; clocks = <&clk26m>; clock-names = "u3phya_ref"; @@ -599,7 +724,8 @@ }; u3phy2: usb-phy@1a244000 { - compatible = "mediatek,mt7623-u3phy", "mediatek,mt2701-u3phy"; + compatible = "mediatek,mt7623-u3phy", + "mediatek,mt2701-u3phy"; reg = <0 0x1a244000 0 0x0700>; clocks = <&clk26m>; clock-names = "u3phya_ref"; @@ -621,15 +747,6 @@ }; }; - hifsys: syscon@1a000000 { - compatible = "mediatek,mt7623-hifsys", - "mediatek,mt2701-hifsys", - "syscon"; - reg = <0 0x1a000000 0 0x1000>; - #clock-cells = <1>; - #reset-cells = <1>; - }; - ethsys: syscon@1b000000 { compatible = "mediatek,mt7623-ethsys", "mediatek,mt2701-ethsys", @@ -639,7 +756,9 @@ }; eth: ethernet@1b100000 { - compatible = "mediatek,mt2701-eth", "syscon"; + compatible = "mediatek,mt7623-eth", + "mediatek,mt2701-eth", + "syscon"; reg = <0 0x1b100000 0 0x20000>; interrupts = , , @@ -650,6 +769,10 @@ <ðsys CLK_ETHSYS_GP2>, <&apmixedsys CLK_APMIXED_TRGPLL>; clock-names = "ethif", "esw", "gp1", "gp2", "trgpll"; + resets = <ðsys MT2701_ETHSYS_FE_RST>, + <ðsys MT2701_ETHSYS_GMAC_RST>, + <ðsys MT2701_ETHSYS_PPE_RST>; + reset-names = "fe", "gmac", "ppe"; power-domains = <&scpsys MT2701_POWER_DOMAIN_ETH>; mediatek,ethsys = <ðsys>; mediatek,pctl = <&syscfg_pctl_a>; diff --git a/src/arm/mt7623n-bananapi-bpi-r2.dts b/src/arm/mt7623n-bananapi-bpi-r2.dts new file mode 100644 index 000000000000..688a86378cee --- /dev/null +++ b/src/arm/mt7623n-bananapi-bpi-r2.dts @@ -0,0 +1,487 @@ +/* + * Copyright 2017 Sean Wang + * + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) + */ + +/dts-v1/; +#include +#include "mt7623.dtsi" +#include "mt6323.dtsi" + +/ { + model = "Bananapi BPI-R2"; + compatible = "bananapi,bpi-r2", "mediatek,mt7623"; + + aliases { + serial2 = &uart2; + }; + + chosen { + stdout-path = "serial2:115200n8"; + }; + + cpus { + cpu@0 { + proc-supply = <&mt6323_vproc_reg>; + }; + + cpu@1 { + proc-supply = <&mt6323_vproc_reg>; + }; + + cpu@2 { + proc-supply = <&mt6323_vproc_reg>; + }; + + cpu@3 { + proc-supply = <&mt6323_vproc_reg>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&key_pins_a>; + + factory { + label = "factory"; + linux,code = ; + gpios = <&pio 256 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 257 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_a>; + + blue { + label = "bpi-r2:pio:blue"; + gpios = <&pio 241 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + green { + label = "bpi-r2:pio:green"; + gpios = <&pio 240 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + + red { + label = "bpi-r2:pio:red"; + gpios = <&pio 239 GPIO_ACTIVE_HIGH>; + default-state = "off"; + }; + }; + + memory@80000000 { + reg = <0 0x80000000 0 0x40000000>; + }; +}; + +&cir { + pinctrl-names = "default"; + pinctrl-0 = <&cir_pins_a>; + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "trgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + pause; + }; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + switch@0 { + compatible = "mediatek,mt7530"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + pinctrl-names = "default"; + reset-gpios = <&pio 33 0>; + core-supply = <&mt6323_vpa_reg>; + io-supply = <&mt6323_vemc3v3_reg>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + port@0 { + reg = <0>; + label = "wan"; + }; + + port@1 { + reg = <1>; + label = "lan0"; + }; + + port@2 { + reg = <2>; + label = "lan1"; + }; + + port@3 { + reg = <3>; + label = "lan2"; + }; + + port@4 { + reg = <4>; + label = "lan3"; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "trgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + }; + }; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins_a>; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + status = "okay"; + bus-width = <8>; + max-frequency = <50000000>; + cap-mmc-highspeed; + vmmc-supply = <&mt6323_vemc3v3_reg>; + vqmmc-supply = <&mt6323_vio18_reg>; + non-removable; +}; + +&mmc1 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_uhs>; + status = "okay"; + bus-width = <4>; + max-frequency = <50000000>; + cap-sd-highspeed; + cd-gpios = <&pio 261 0>; + vmmc-supply = <&mt6323_vmch_reg>; + vqmmc-supply = <&mt6323_vio18_reg>; +}; + +&pio { + cir_pins_a:cir@0 { + pins_cir { + pinmux = ; + bias-disable; + }; + }; + + i2c0_pins_a: i2c@0 { + pins_i2c0 { + pinmux = , + ; + bias-disable; + }; + }; + + i2c1_pins_a: i2c@1 { + pin_i2c1 { + pinmux = , + ; + bias-disable; + }; + }; + + i2s0_pins_a: i2s@0 { + pin_i2s0 { + pinmux = , + , + , + , + ; + drive-strength = ; + bias-pull-down; + }; + }; + + i2s1_pins_a: i2s@1 { + pin_i2s1 { + pinmux = , + , + , + , + ; + drive-strength = ; + bias-pull-down; + }; + }; + + key_pins_a: keys@0 { + pins_keys { + pinmux = , + ; + input-enable; + }; + }; + + led_pins_a: leds@0 { + pins_leds { + pinmux = , + , + ; + }; + }; + + mmc0_pins_default: mmc0default { + pins_cmd_dat { + pinmux = , + , + , + , + , + , + , + , + ; + input-enable; + bias-pull-up; + }; + + pins_clk { + pinmux = ; + bias-pull-down; + }; + + pins_rst { + pinmux = ; + bias-pull-up; + }; + }; + + mmc0_pins_uhs: mmc0 { + pins_cmd_dat { + pinmux = , + , + , + , + , + , + , + , + ; + input-enable; + drive-strength = ; + bias-pull-up = ; + }; + + pins_clk { + pinmux = ; + drive-strength = ; + bias-pull-down = ; + }; + + pins_rst { + pinmux = ; + bias-pull-up; + }; + }; + + mmc1_pins_default: mmc1default { + pins_cmd_dat { + pinmux = , + , + , + , + ; + input-enable; + drive-strength = ; + bias-pull-up = ; + }; + + pins_clk { + pinmux = ; + bias-pull-down; + drive-strength = ; + }; + + pins_wp { + pinmux = ; + input-enable; + bias-pull-up; + }; + + pins_insert { + pinmux = ; + bias-pull-up; + }; + }; + + mmc1_pins_uhs: mmc1 { + pins_cmd_dat { + pinmux = , + , + , + , + ; + input-enable; + drive-strength = ; + bias-pull-up = ; + }; + + pins_clk { + pinmux = ; + drive-strength = ; + bias-pull-down = ; + }; + }; + + pwm_pins_a: pwm@0 { + pins_pwm { + pinmux = , + , + , + , + ; + }; + }; + + spi0_pins_a: spi@0 { + pins_spi { + pinmux = , + , + , + ; + bias-disable; + }; + }; + + uart0_pins_a: uart@0 { + pins_dat { + pinmux = , + ; + }; + }; + + uart1_pins_a: uart@1 { + pins_dat { + pinmux = , + ; + }; + }; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins_a>; + status = "okay"; +}; + +&pwrap { + mt6323 { + mt6323led: led { + compatible = "mediatek,mt6323-led"; + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + label = "bpi-r2:isink:green"; + default-state = "off"; + }; + + led@1 { + reg = <1>; + label = "bpi-r2:isink:red"; + default-state = "off"; + }; + + led@2 { + reg = <2>; + label = "bpi-r2:isink:blue"; + default-state = "off"; + }; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins_a>; + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "disabled"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins_a>; + status = "disabled"; +}; + +&uart2 { + status = "okay"; +}; + +&usb1 { + vusb33-supply = <&mt6323_vusb_reg>; + status = "okay"; +}; + +&usb2 { + vusb33-supply = <&mt6323_vusb_reg>; + status = "okay"; +}; + +&u3phy1 { + status = "okay"; +}; + +&u3phy2 { + status = "okay"; +}; + diff --git a/src/arm/mt7623n-rfb-nand.dts b/src/arm/mt7623n-rfb-nand.dts new file mode 100644 index 000000000000..17c578f0d261 --- /dev/null +++ b/src/arm/mt7623n-rfb-nand.dts @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2017 MediaTek Inc. + * Author: John Crispin + * + * 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. + * + * 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. + */ + +/dts-v1/; +#include "mt7623n-rfb.dtsi" + +/ { + model = "MediaTek MT7623N NAND reference board"; + compatible = "mediatek,mt7623n-rfb-nand", "mediatek,mt7623"; +}; + +&bch { + status = "okay"; +}; + +&nandc { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&nand_pins_default>; + + nand@0 { + reg = <0>; + spare_per_sector = <64>; + nand-ecc-mode = "hw"; + nand-ecc-strength = <12>; + nand-ecc-step-size = <1024>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "preloader"; + reg = <0x0 0x40000>; + }; + + partition@40000 { + label = "uboot"; + reg = <0x40000 0x80000>; + }; + + partition@C0000 { + label = "uboot-env"; + reg = <0xC0000 0x40000>; + }; + + partition@140000 { + label = "bootimg"; + reg = <0x140000 0x2000000>; + }; + + partition@2140000 { + label = "recovery"; + reg = <0x2140000 0x2000000>; + }; + + partition@4140000 { + label = "rootfs"; + reg = <0x4140000 0x1000000>; + }; + + partition@5140000 { + label = "usrdata"; + reg = <0x5140000 0x1000000>; + }; + }; + }; +}; + +&pio { + nand_pins_default: nanddefault { + pins_ale { + pinmux = ; + drive-strength = ; + bias-pull-down = ; + }; + + pins_dat { + pinmux = , + , + , + , + , + , + , + , + ; + input-enable; + drive-strength = ; + bias-pull-up; + }; + + pins_we { + pinmux = ; + drive-strength = ; + bias-pull-up = ; + }; + }; +}; diff --git a/src/arm/mt7623n-rfb.dtsi b/src/arm/mt7623n-rfb.dtsi new file mode 100644 index 000000000000..256c5fd947bf --- /dev/null +++ b/src/arm/mt7623n-rfb.dtsi @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2017 MediaTek Inc. + * Author: John Crispin + * Sean Wang + * + * 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. + * + * 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. + */ + +/dts-v1/; +#include "mt7623.dtsi" +#include "mt6323.dtsi" + +/ { + aliases { + serial0 = &uart0; + serial1 = &uart1; + serial2 = &uart2; + }; + + chosen { + stdout-path = "serial2:115200n8"; + }; + + cpus { + cpu0 { + proc-supply = <&mt6323_vproc_reg>; + }; + + cpu1 { + proc-supply = <&mt6323_vproc_reg>; + }; + + cpu2 { + proc-supply = <&mt6323_vproc_reg>; + }; + + cpu3 { + proc-supply = <&mt6323_vproc_reg>; + }; + }; + + memory@80000000 { + reg = <0 0x80000000 0 0x40000000>; + }; + + usb_p1_vbus: regulator@0 { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&pio 135 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; +}; + +&mmc0 { + vmmc-supply = <&mt6323_vemc3v3_reg>; + vqmmc-supply = <&mt6323_vio18_reg>; +}; + +&mmc1 { + vmmc-supply = <&mt6323_vmch_reg>; + vqmmc-supply = <&mt6323_vmc_reg>; +}; + +&uart0 { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&usb1 { + vbus-supply = <&usb_p1_vbus>; + status = "okay"; +}; + +&u3phy1 { + status = "okay"; +}; diff --git a/src/arm/omap-gpmc-smsc911x.dtsi b/src/arm/omap-gpmc-smsc911x.dtsi index 445fafc73254..ded7e8fec9eb 100644 --- a/src/arm/omap-gpmc-smsc911x.dtsi +++ b/src/arm/omap-gpmc-smsc911x.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common file for GPMC connected smsc911x on omaps * diff --git a/src/arm/omap-gpmc-smsc9221.dtsi b/src/arm/omap-gpmc-smsc9221.dtsi index 73e272fadc20..7f6aefd13451 100644 --- a/src/arm/omap-gpmc-smsc9221.dtsi +++ b/src/arm/omap-gpmc-smsc9221.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common file for GPMC connected smsc9221 on omaps * diff --git a/src/arm/omap-zoom-common.dtsi b/src/arm/omap-zoom-common.dtsi index 46ef3e443861..d4ad9e58b199 100644 --- a/src/arm/omap-zoom-common.dtsi +++ b/src/arm/omap-zoom-common.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common features on the Zoom debug board */ diff --git a/src/arm/omap2420-n800.dts b/src/arm/omap2420-n800.dts index d8c1b423606a..f06d767e818b 100644 --- a/src/arm/omap2420-n800.dts +++ b/src/arm/omap2420-n800.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "omap2420-n8x0-common.dtsi" diff --git a/src/arm/omap2420-n810-wimax.dts b/src/arm/omap2420-n810-wimax.dts index 6b25b0359ac9..ac9acbd609b6 100644 --- a/src/arm/omap2420-n810-wimax.dts +++ b/src/arm/omap2420-n810-wimax.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "omap2420-n8x0-common.dtsi" diff --git a/src/arm/omap2420-n810.dts b/src/arm/omap2420-n810.dts index b604d26bd48c..7c485fbfa535 100644 --- a/src/arm/omap2420-n810.dts +++ b/src/arm/omap2420-n810.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "omap2420-n8x0-common.dtsi" diff --git a/src/arm/omap2420-n8x0-common.dtsi b/src/arm/omap2420-n8x0-common.dtsi index 7e5ffc583c90..1de80c7886ab 100644 --- a/src/arm/omap2420-n8x0-common.dtsi +++ b/src/arm/omap2420-n8x0-common.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "omap2420.dtsi" / { @@ -15,8 +16,8 @@ >; #address-cells = <1>; #size-cells = <0>; - retu_mfd: retu@1 { - compatible = "retu-mfd"; + retu: retu@1 { + compatible = "nokia,retu"; interrupt-parent = <&gpio4>; interrupts = <12 IRQ_TYPE_EDGE_RISING>; reg = <0x1>; diff --git a/src/arm/omap3-beagle-xm.dts b/src/arm/omap3-beagle-xm.dts index 673cee2234b2..683b96a8f73e 100644 --- a/src/arm/omap3-beagle-xm.dts +++ b/src/arm/omap3-beagle-xm.dts @@ -299,7 +299,7 @@ &mmc1 { vmmc-supply = <&vmmc1>; - vmmc_aux-supply = <&vsim>; + vqmmc-supply = <&vsim>; bus-width = <8>; }; diff --git a/src/arm/omap3-beagle.dts b/src/arm/omap3-beagle.dts index 4be85ce59dd1..4d2eaf843fa9 100644 --- a/src/arm/omap3-beagle.dts +++ b/src/arm/omap3-beagle.dts @@ -283,7 +283,7 @@ &mmc1 { vmmc-supply = <&vmmc1>; - vmmc_aux-supply = <&vsim>; + vqmmc-supply = <&vsim>; bus-width = <8>; }; diff --git a/src/arm/omap3-cm-t3517.dts b/src/arm/omap3-cm-t3517.dts index 53ae04f9104d..4994e33bf663 100644 --- a/src/arm/omap3-cm-t3517.dts +++ b/src/arm/omap3-cm-t3517.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Support for CompuLab CM-T3517 */ @@ -129,7 +130,7 @@ pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; vmmc-supply = <&wl12xx_vmmc2>; - vmmc_aux-supply = <&wl12xx_vaux2>; + vqmmc-supply = <&wl12xx_vaux2>; non-removable; bus-width = <4>; cap-power-off-card; diff --git a/src/arm/omap3-cm-t3530.dts b/src/arm/omap3-cm-t3530.dts index 8dd14fcf6825..76e52c78cbb4 100644 --- a/src/arm/omap3-cm-t3530.dts +++ b/src/arm/omap3-cm-t3530.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Support for CompuLab CM-T3530 */ diff --git a/src/arm/omap3-cm-t3730.dts b/src/arm/omap3-cm-t3730.dts index 2294f5b0aa10..8c63ac5bbb12 100644 --- a/src/arm/omap3-cm-t3730.dts +++ b/src/arm/omap3-cm-t3730.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Support for CompuLab CM-T3730 */ @@ -69,7 +70,7 @@ pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; vmmc-supply = <&wl12xx_vmmc2>; - vmmc_aux-supply = <&wl12xx_vaux2>; + vqmmc-supply = <&wl12xx_vaux2>; non-removable; bus-width = <4>; cap-power-off-card; diff --git a/src/arm/omap3-cm-t3x.dtsi b/src/arm/omap3-cm-t3x.dtsi index fccd5383243c..31d5ebf38892 100644 --- a/src/arm/omap3-cm-t3x.dtsi +++ b/src/arm/omap3-cm-t3x.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common support for CompuLab CM-T3x CoMs */ diff --git a/src/arm/omap3-cm-t3x30.dtsi b/src/arm/omap3-cm-t3x30.dtsi index 046cd7733c4f..5e8943539fcc 100644 --- a/src/arm/omap3-cm-t3x30.dtsi +++ b/src/arm/omap3-cm-t3x30.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common support for CompuLab CM-T3x30 CoMs */ diff --git a/src/arm/omap3-devkit8000-common.dtsi b/src/arm/omap3-devkit8000-common.dtsi index 82aa9c4a0f1c..0c0bb1b01b0b 100644 --- a/src/arm/omap3-devkit8000-common.dtsi +++ b/src/arm/omap3-devkit8000-common.dtsi @@ -149,7 +149,7 @@ &mmc1 { vmmc-supply = <&vmmc1>; - vmmc_aux-supply = <&vsim>; + vqmmc-supply = <&vsim>; bus-width = <8>; }; diff --git a/src/arm/omap3-evm-common.dtsi b/src/arm/omap3-evm-common.dtsi index 2b1d6977a535..dbc3f030a16c 100644 --- a/src/arm/omap3-evm-common.dtsi +++ b/src/arm/omap3-evm-common.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common support for omap3 EVM boards */ @@ -115,7 +116,7 @@ &mmc1 { interrupts-extended = <&intc 83 &omap3_pmx_core 0x11a>; vmmc-supply = <&vmmc1>; - vmmc_aux-supply = <&vsim>; + vqmmc-supply = <&vsim>; bus-width = <8>; }; diff --git a/src/arm/omap3-n900.dts b/src/arm/omap3-n900.dts index 49f37084e435..4acd32a1c4ef 100644 --- a/src/arm/omap3-n900.dts +++ b/src/arm/omap3-n900.dts @@ -164,6 +164,29 @@ }; }; +&isp { + vdds_csib-supply = <&vaux2>; + + pinctrl-names = "default"; + pinctrl-0 = <&camera_pins>; + + ports { + port@1 { + reg = <1>; + + csi_isp: endpoint { + remote-endpoint = <&csi_cam1>; + bus-type = <3>; /* CCP2 */ + clock-lanes = <1>; + data-lanes = <0>; + lane-polarity = <0 0>; + /* Select strobe = <1> for back camera, <0> for front camera */ + strobe = <1>; + }; + }; + }; +}; + &omap3_pmx_core { pinctrl-names = "default"; @@ -328,6 +351,22 @@ OMAP3_CORE1_IOPAD(0x218e, PIN_OUTPUT | MUX_MODE4) /* gpio 157 => cmt_bsi */ >; }; + + camera_pins: pinmux_camera { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x210c, PIN_OUTPUT | MUX_MODE7) /* cam_hs */ + OMAP3_CORE1_IOPAD(0x210e, PIN_OUTPUT | MUX_MODE7) /* cam_vs */ + OMAP3_CORE1_IOPAD(0x2110, PIN_OUTPUT | MUX_MODE0) /* cam_xclka */ + OMAP3_CORE1_IOPAD(0x211e, PIN_OUTPUT | MUX_MODE7) /* cam_d4 */ + OMAP3_CORE1_IOPAD(0x2122, PIN_INPUT | MUX_MODE0) /* cam_d6 */ + OMAP3_CORE1_IOPAD(0x2124, PIN_INPUT | MUX_MODE0) /* cam_d7 */ + OMAP3_CORE1_IOPAD(0x2126, PIN_INPUT | MUX_MODE0) /* cam_d8 */ + OMAP3_CORE1_IOPAD(0x2128, PIN_INPUT | MUX_MODE0) /* cam_d9 */ + OMAP3_CORE1_IOPAD(0x212a, PIN_OUTPUT | MUX_MODE7) /* cam_d10 */ + OMAP3_CORE1_IOPAD(0x212e, PIN_OUTPUT | MUX_MODE7) /* cam_xclkb */ + OMAP3_CORE1_IOPAD(0x2132, PIN_OUTPUT | MUX_MODE0) /* cam_strobe */ + >; + }; }; &i2c1 { @@ -726,6 +765,40 @@ st,max-limit-y = <32>; st,max-limit-z = <32>; }; + + cam1: camera@3e { + compatible = "toshiba,et8ek8"; + reg = <0x3e>; + + vana-supply = <&vaux4>; + + clocks = <&isp 0>; + clock-names = "extclk"; + clock-frequency = <9600000>; + + reset-gpio = <&gpio4 6 GPIO_ACTIVE_HIGH>; /* 102 */ + + port { + csi_cam1: endpoint { + bus-type = <3>; /* CCP2 */ + strobe = <1>; + clock-inv = <0>; + crc = <1>; + + remote-endpoint = <&csi_isp>; + }; + }; + }; + + /* D/A converter for auto-focus */ + ad5820: dac@0c { + compatible = "adi,ad5820"; + reg = <0x0c>; + + VANA-supply = <&vaux4>; + + #io-channel-cells = <0>; + }; }; &mmc1 { @@ -733,6 +806,9 @@ pinctrl-0 = <&mmc1_pins>; vmmc-supply = <&vmmc1>; bus-width = <4>; + /* For debugging, it is often good idea to remove this GPIO. + It means you can remove back cover (to reboot by removing + battery) and still use the MMC card. */ cd-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; /* 160 */ }; @@ -741,7 +817,7 @@ pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; vmmc-supply = <&vaux3>; - vmmc_aux-supply = <&vsim>; + vqmmc-supply = <&vsim>; bus-width = <8>; non-removable; no-sdio; diff --git a/src/arm/omap3-n950-n9.dtsi b/src/arm/omap3-n950-n9.dtsi index df3366fa5409..1b0bd72945f2 100644 --- a/src/arm/omap3-n950-n9.dtsi +++ b/src/arm/omap3-n950-n9.dtsi @@ -265,6 +265,24 @@ &i2c2 { clock-frequency = <400000>; + + as3645a@30 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x30>; + compatible = "ams,as3645a"; + flash@0 { + reg = <0x0>; + flash-timeout-us = <150000>; + flash-max-microamp = <320000>; + led-max-microamp = <60000>; + ams,input-max-microamp = <1750000>; + }; + indicator@1 { + reg = <0x1>; + led-max-microamp = <10000>; + }; + }; }; &i2c3 { diff --git a/src/arm/omap3-overo-base.dtsi b/src/arm/omap3-overo-base.dtsi index cd220342a805..f25e158e7163 100644 --- a/src/arm/omap3-overo-base.dtsi +++ b/src/arm/omap3-overo-base.dtsi @@ -181,7 +181,7 @@ pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; vmmc-supply = <&w3cbw003c_npoweron>; - vmmc_aux-supply = <&w3cbw003c_wifi_nreset>; + vqmmc-supply = <&w3cbw003c_wifi_nreset>; bus-width = <4>; cap-sdio-irq; non-removable; diff --git a/src/arm/omap3-panel-sharp-ls037v7dw01.dtsi b/src/arm/omap3-panel-sharp-ls037v7dw01.dtsi index 157345bb8e79..25e100db7b1a 100644 --- a/src/arm/omap3-panel-sharp-ls037v7dw01.dtsi +++ b/src/arm/omap3-panel-sharp-ls037v7dw01.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common file for omap dpi panels with QVGA and reset pins * diff --git a/src/arm/omap3-sb-t35.dtsi b/src/arm/omap3-sb-t35.dtsi index 4476fb685a1b..22b4c8bdcc65 100644 --- a/src/arm/omap3-sb-t35.dtsi +++ b/src/arm/omap3-sb-t35.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730 */ diff --git a/src/arm/omap3-sbc-t3517.dts b/src/arm/omap3-sbc-t3517.dts index c2d5c28a1a70..a69d32860421 100644 --- a/src/arm/omap3-sbc-t3517.dts +++ b/src/arm/omap3-sbc-t3517.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Suppport for CompuLab SBC-T3517 with CM-T3517 */ diff --git a/src/arm/omap3-sbc-t3530.dts b/src/arm/omap3-sbc-t3530.dts index 834bc786cd12..ae96002abb3b 100644 --- a/src/arm/omap3-sbc-t3530.dts +++ b/src/arm/omap3-sbc-t3530.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Suppport for CompuLab SBC-T3530 with CM-T3530 */ diff --git a/src/arm/omap3-sbc-t3730.dts b/src/arm/omap3-sbc-t3730.dts index 73c7bf4a4a08..7de6df16fc17 100644 --- a/src/arm/omap3-sbc-t3730.dts +++ b/src/arm/omap3-sbc-t3730.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Suppport for CompuLab SBC-T3730 with CM-T3730 */ diff --git a/src/arm/omap3-tao3530.dtsi b/src/arm/omap3-tao3530.dtsi index 06ac0f80bcf0..9a601d15247b 100644 --- a/src/arm/omap3-tao3530.dtsi +++ b/src/arm/omap3-tao3530.dtsi @@ -223,7 +223,7 @@ pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; vmmc-supply = <&vmmc1>; - vmmc_aux-supply = <&vsim>; + vqmmc-supply = <&vsim>; cd-gpios = <&twl_gpio 0 GPIO_ACTIVE_HIGH>; bus-width = <8>; }; diff --git a/src/arm/omap3-zoom3.dts b/src/arm/omap3-zoom3.dts index 45e2ce0803de..96d0301a336a 100644 --- a/src/arm/omap3-zoom3.dts +++ b/src/arm/omap3-zoom3.dts @@ -174,7 +174,7 @@ &mmc1 { vmmc-supply = <&vmmc1>; - vmmc_aux-supply = <&vsim>; + vqmmc-supply = <&vsim>; bus-width = <4>; pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; diff --git a/src/arm/omap3.dtsi b/src/arm/omap3.dtsi index a3ff4933dbc1..bdaf30c8c405 100644 --- a/src/arm/omap3.dtsi +++ b/src/arm/omap3.dtsi @@ -713,14 +713,12 @@ usbhsohci: ohci@48064400 { compatible = "ti,ohci-omap3"; reg = <0x48064400 0x400>; - interrupt-parent = <&intc>; interrupts = <76>; }; usbhsehci: ehci@48064800 { compatible = "ti,ehci-omap"; reg = <0x48064800 0x400>; - interrupt-parent = <&intc>; interrupts = <77>; }; }; @@ -831,7 +829,6 @@ reg-names = "tx", "rx"; - interrupt-parent = <&intc>; interrupts = <67>, <68>; }; @@ -844,7 +841,6 @@ reg-names = "tx", "rx"; - interrupt-parent = <&intc>; interrupts = <69>, <70>; }; diff --git a/src/arm/omap3430-sdp.dts b/src/arm/omap3430-sdp.dts index abd6921143be..908951eb5943 100644 --- a/src/arm/omap3430-sdp.dts +++ b/src/arm/omap3430-sdp.dts @@ -33,7 +33,7 @@ &mmc1 { vmmc-supply = <&vmmc1>; - vmmc_aux-supply = <&vsim>; + vqmmc-supply = <&vsim>; /* * S6-3 must be in ON position for 8 bit mode to function * Else, use 4 bit mode diff --git a/src/arm/omap4-droid4-xt894.dts b/src/arm/omap4-droid4-xt894.dts index 10ca1c174995..8b93d37310f2 100644 --- a/src/arm/omap4-droid4-xt894.dts +++ b/src/arm/omap4-droid4-xt894.dts @@ -129,6 +129,34 @@ output-high; line-name = "touchscreen-reset"; }; + + pwm8: dmtimer-pwm-8 { + pinctrl-names = "default"; + pinctrl-0 = <&vibrator_direction_pin>; + + compatible = "ti,omap-dmtimer-pwm"; + #pwm-cells = <3>; + ti,timers = <&timer8>; + ti,clock-source = <0x01>; + }; + + pwm9: dmtimer-pwm-9 { + pinctrl-names = "default"; + pinctrl-0 = <&vibrator_enable_pin>; + + compatible = "ti,omap-dmtimer-pwm"; + #pwm-cells = <3>; + ti,timers = <&timer9>; + ti,clock-source = <0x01>; + }; + + vibrator { + compatible = "pwm-vibrator"; + pwms = <&pwm9 0 10000000 0>, <&pwm8 0 10000000 0>; + pwm-names = "enable", "direction"; + direction-duty-cycle-ns = <10000000>; + }; + }; &dsi1 { @@ -373,7 +401,7 @@ /* hdmi_cec.hdmi_cec, hdmi_scl.hdmi_scl, hdmi_sda.hdmi_sda */ dss_hdmi_pins: pinmux_dss_hdmi_pins { pinctrl-single,pins = < - OMAP4_IOPAD(0x09a, PIN_INPUT_PULLUP | MUX_MODE0) + OMAP4_IOPAD(0x09a, PIN_INPUT | MUX_MODE0) OMAP4_IOPAD(0x09c, PIN_INPUT | MUX_MODE0) OMAP4_IOPAD(0x09e, PIN_INPUT | MUX_MODE0) >; @@ -488,6 +516,18 @@ OMAP4_IOPAD(0x040, PIN_OUTPUT_PULLDOWN | MUX_MODE3) >; }; + + vibrator_direction_pin: pinmux_vibrator_direction_pin { + pinctrl-single,pins = < + OMAP4_IOPAD(0x1ce, PIN_OUTPUT | MUX_MODE1) /* dmtimer8_pwm_evt (gpio_27) */ + >; + }; + + vibrator_enable_pin: pinmux_vibrator_enable_pin { + pinctrl-single,pins = < + OMAP4_IOPAD(0X1d0, PIN_OUTPUT | MUX_MODE1) /* dmtimer9_pwm_evt (gpio_28) */ + >; + }; }; &uart3 { diff --git a/src/arm/omap4-duovero-parlor.dts b/src/arm/omap4-duovero-parlor.dts index 1b825128a7b9..a9a584b5b955 100644 --- a/src/arm/omap4-duovero-parlor.dts +++ b/src/arm/omap4-duovero-parlor.dts @@ -100,7 +100,7 @@ dss_hdmi_pins: pinmux_dss_hdmi_pins { pinctrl-single,pins = < OMAP4_IOPAD(0x098, PIN_INPUT | MUX_MODE3) /* hdmi_hpd.gpio_63 */ - OMAP4_IOPAD(0x09a, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_cec.hdmi_cec */ + OMAP4_IOPAD(0x09a, PIN_INPUT | MUX_MODE0) /* hdmi_cec.hdmi_cec */ OMAP4_IOPAD(0x09c, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_ddc_scl.hdmi_ddc_scl */ OMAP4_IOPAD(0x09e, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_ddc_sda.hdmi_ddc_sda */ >; diff --git a/src/arm/omap4-panda-common.dtsi b/src/arm/omap4-panda-common.dtsi index edbc4090297d..2b48e51c372a 100644 --- a/src/arm/omap4-panda-common.dtsi +++ b/src/arm/omap4-panda-common.dtsi @@ -267,7 +267,7 @@ dss_hdmi_pins: pinmux_dss_hdmi_pins { pinctrl-single,pins = < - OMAP4_IOPAD(0x09a, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_cec.hdmi_cec */ + OMAP4_IOPAD(0x09a, PIN_INPUT | MUX_MODE0) /* hdmi_cec.hdmi_cec */ OMAP4_IOPAD(0x09c, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_scl.hdmi_scl */ OMAP4_IOPAD(0x09e, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_sda.hdmi_sda */ >; diff --git a/src/arm/omap4-sdp-es23plus.dts b/src/arm/omap4-sdp-es23plus.dts index b4d19a7ae393..3d3140fd9659 100644 --- a/src/arm/omap4-sdp-es23plus.dts +++ b/src/arm/omap4-sdp-es23plus.dts @@ -10,7 +10,7 @@ /* SDP boards with 4430 ES2.3+ or 4460 have external pullups on SCL & SDA */ &dss_hdmi_pins { pinctrl-single,pins = < - OMAP4_IOPAD(0x09a, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_cec.hdmi_cec */ + OMAP4_IOPAD(0x09a, PIN_INPUT | MUX_MODE0) /* hdmi_cec.hdmi_cec */ OMAP4_IOPAD(0x09c, PIN_INPUT | MUX_MODE0) /* hdmi_scl.hdmi_scl */ OMAP4_IOPAD(0x09e, PIN_INPUT | MUX_MODE0) /* hdmi_sda.hdmi_sda */ >; diff --git a/src/arm/omap4-sdp.dts b/src/arm/omap4-sdp.dts index d728ec963111..280d92d42bf1 100644 --- a/src/arm/omap4-sdp.dts +++ b/src/arm/omap4-sdp.dts @@ -290,7 +290,7 @@ dss_hdmi_pins: pinmux_dss_hdmi_pins { pinctrl-single,pins = < - OMAP4_IOPAD(0x09a, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_cec.hdmi_cec */ + OMAP4_IOPAD(0x09a, PIN_INPUT | MUX_MODE0) /* hdmi_cec.hdmi_cec */ OMAP4_IOPAD(0x09c, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_scl.hdmi_scl */ OMAP4_IOPAD(0x09e, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_sda.hdmi_sda */ >; diff --git a/src/arm/omap4-var-om44customboard.dtsi b/src/arm/omap4-var-om44customboard.dtsi index 74940b6d7719..676d8dd0624a 100644 --- a/src/arm/omap4-var-om44customboard.dtsi +++ b/src/arm/omap4-var-om44customboard.dtsi @@ -122,7 +122,7 @@ dss_hdmi_pins: pinmux_dss_hdmi_pins { pinctrl-single,pins = < - OMAP4_IOPAD(0x09a, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_cec.hdmi_cec */ + OMAP4_IOPAD(0x09a, PIN_INPUT | MUX_MODE0) /* hdmi_cec.hdmi_cec */ OMAP4_IOPAD(0x09c, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_scl.hdmi_scl */ OMAP4_IOPAD(0x09e, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_sda.hdmi_sda */ >; diff --git a/src/arm/omap5-board-common.dtsi b/src/arm/omap5-board-common.dtsi index 4caadb253249..7824b2631cb6 100644 --- a/src/arm/omap5-board-common.dtsi +++ b/src/arm/omap5-board-common.dtsi @@ -290,7 +290,7 @@ dss_hdmi_pins: pinmux_dss_hdmi_pins { pinctrl-single,pins = < - OMAP5_IOPAD(0x13c, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_cec.hdmi_cec */ + OMAP5_IOPAD(0x13c, PIN_INPUT | MUX_MODE0) /* hdmi_cec.hdmi_cec */ OMAP5_IOPAD(0x140, PIN_INPUT | MUX_MODE0) /* hdmi_ddc_scl.hdmi_ddc_scl */ OMAP5_IOPAD(0x142, PIN_INPUT | MUX_MODE0) /* hdmi_ddc_sda.hdmi_ddc_sda */ >; diff --git a/src/arm/omap5-cm-t54.dts b/src/arm/omap5-cm-t54.dts index 78397f66d0b2..5b172a04b6f1 100644 --- a/src/arm/omap5-cm-t54.dts +++ b/src/arm/omap5-cm-t54.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Support for CompuLab CM-T54 */ @@ -266,7 +267,7 @@ dss_hdmi_pins: pinmux_dss_hdmi_pins { pinctrl-single,pins = < - OMAP5_IOPAD(0x013c, PIN_INPUT_PULLUP | MUX_MODE0) /* hdmi_cec */ + OMAP5_IOPAD(0x013c, PIN_INPUT | MUX_MODE0) /* hdmi_cec */ OMAP5_IOPAD(0x0140, PIN_INPUT | MUX_MODE0) /* hdmi_ddc_scl */ OMAP5_IOPAD(0x0142, PIN_INPUT | MUX_MODE0) /* hdmi_ddc_sda */ >; diff --git a/src/arm/omap5-sbc-t54.dts b/src/arm/omap5-sbc-t54.dts index 7b8810d13257..657df46251c2 100644 --- a/src/arm/omap5-sbc-t54.dts +++ b/src/arm/omap5-sbc-t54.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Suppport for CompuLab CM-T54 on SB-T54 baseboard */ diff --git a/src/arm/pxa27x.dtsi b/src/arm/pxa27x.dtsi index 5f1d6da02a4c..747f750f675d 100644 --- a/src/arm/pxa27x.dtsi +++ b/src/arm/pxa27x.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* The pxa3xx skeleton simply augments the 2xx version */ #include "pxa2xx.dtsi" #include "dt-bindings/clock/pxa-clock.h" diff --git a/src/arm/pxa3xx.dtsi b/src/arm/pxa3xx.dtsi index 7a0cc4ea819a..55c75b67351c 100644 --- a/src/arm/pxa3xx.dtsi +++ b/src/arm/pxa3xx.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* The pxa3xx skeleton simply augments the 2xx version */ #include "pxa2xx.dtsi" diff --git a/src/arm/qcom-apq8064-arrow-sd-600eval-pins.dtsi b/src/arm/qcom-apq8064-arrow-sd-600eval-pins.dtsi index a3efb9704fcd..8df73156b73a 100644 --- a/src/arm/qcom-apq8064-arrow-sd-600eval-pins.dtsi +++ b/src/arm/qcom-apq8064-arrow-sd-600eval-pins.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 &tlmm_pinmux { card_detect: card-detect { mux { diff --git a/src/arm/qcom-apq8064-arrow-sd-600eval.dts b/src/arm/qcom-apq8064-arrow-sd-600eval.dts index f245064f320e..76b56eafaab9 100644 --- a/src/arm/qcom-apq8064-arrow-sd-600eval.dts +++ b/src/arm/qcom-apq8064-arrow-sd-600eval.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8064-v2.0.dtsi" #include "qcom-apq8064-arrow-sd-600eval-pins.dtsi" #include diff --git a/src/arm/qcom-apq8064-asus-nexus7-flo.dts b/src/arm/qcom-apq8064-asus-nexus7-flo.dts index 3483a66e44c1..a701d4bac320 100644 --- a/src/arm/qcom-apq8064-asus-nexus7-flo.dts +++ b/src/arm/qcom-apq8064-asus-nexus7-flo.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8064-v2.0.dtsi" #include #include diff --git a/src/arm/qcom-apq8064-cm-qs600.dts b/src/arm/qcom-apq8064-cm-qs600.dts index 5b151e425530..b818ebce0978 100644 --- a/src/arm/qcom-apq8064-cm-qs600.dts +++ b/src/arm/qcom-apq8064-cm-qs600.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8064-v2.0.dtsi" #include #include diff --git a/src/arm/qcom-apq8064-ifc6410.dts b/src/arm/qcom-apq8064-ifc6410.dts index 053b5bdd7808..83aaf4a74398 100644 --- a/src/arm/qcom-apq8064-ifc6410.dts +++ b/src/arm/qcom-apq8064-ifc6410.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8064-v2.0.dtsi" #include #include diff --git a/src/arm/qcom-apq8064-pins.dtsi b/src/arm/qcom-apq8064-pins.dtsi index 173ab7c299ce..cbe42c4153a0 100644 --- a/src/arm/qcom-apq8064-pins.dtsi +++ b/src/arm/qcom-apq8064-pins.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 &tlmm_pinmux { sdc4_gpios: sdc4-gpios { diff --git a/src/arm/qcom-apq8064-sony-xperia-yuga.dts b/src/arm/qcom-apq8064-sony-xperia-yuga.dts index 88a9aff41e2f..8bf488fb86ad 100644 --- a/src/arm/qcom-apq8064-sony-xperia-yuga.dts +++ b/src/arm/qcom-apq8064-sony-xperia-yuga.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8064-v2.0.dtsi" #include #include diff --git a/src/arm/qcom-apq8064-v2.0.dtsi b/src/arm/qcom-apq8064-v2.0.dtsi index 935c3945fc5e..46ed48f0244f 100644 --- a/src/arm/qcom-apq8064-v2.0.dtsi +++ b/src/arm/qcom-apq8064-v2.0.dtsi @@ -1 +1,2 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8064.dtsi" diff --git a/src/arm/qcom-apq8064.dtsi b/src/arm/qcom-apq8064.dtsi index f3db185a6809..6089c8d56cd5 100644 --- a/src/arm/qcom-apq8064.dtsi +++ b/src/arm/qcom-apq8064.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "skeleton.dtsi" diff --git a/src/arm/qcom-apq8074-dragonboard.dts b/src/arm/qcom-apq8074-dragonboard.dts index 32f3b81f609c..244f04e19c9d 100644 --- a/src/arm/qcom-apq8074-dragonboard.dts +++ b/src/arm/qcom-apq8074-dragonboard.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-msm8974.dtsi" #include "qcom-pm8841.dtsi" #include "qcom-pm8941.dtsi" diff --git a/src/arm/qcom-apq8084-ifc6540.dts b/src/arm/qcom-apq8084-ifc6540.dts index 2052b84a77c6..44cd72f1b1be 100644 --- a/src/arm/qcom-apq8084-ifc6540.dts +++ b/src/arm/qcom-apq8084-ifc6540.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8084.dtsi" #include "qcom-pma8084.dtsi" diff --git a/src/arm/qcom-apq8084-mtp.dts b/src/arm/qcom-apq8084-mtp.dts index d174d15bcf70..c6b6680248a6 100644 --- a/src/arm/qcom-apq8084-mtp.dts +++ b/src/arm/qcom-apq8084-mtp.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8084.dtsi" #include "qcom-pma8084.dtsi" diff --git a/src/arm/qcom-apq8084.dtsi b/src/arm/qcom-apq8084.dtsi index 80d48867107f..0e1e98707e3f 100644 --- a/src/arm/qcom-apq8084.dtsi +++ b/src/arm/qcom-apq8084.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "skeleton.dtsi" diff --git a/src/arm/qcom-ipq4019-ap.dk01.1.dtsi b/src/arm/qcom-ipq4019-ap.dk01.1.dtsi index b9457dd21a69..e413b21ee331 100644 --- a/src/arm/qcom-ipq4019-ap.dk01.1.dtsi +++ b/src/arm/qcom-ipq4019-ap.dk01.1.dtsi @@ -20,27 +20,12 @@ model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK01.1"; compatible = "qcom,ipq4019"; - clocks { - xo: xo { - compatible = "fixed-clock"; - clock-frequency = <48000000>; - #clock-cells = <0>; - }; - }; - soc { - - - timer { - compatible = "arm,armv7-timer"; - interrupts = <1 2 0xf08>, - <1 3 0xf08>, - <1 4 0xf08>, - <1 1 0xf08>; - clock-frequency = <48000000>; + rng@22000 { + status = "ok"; }; - pinctrl@0x01000000 { + pinctrl@1000000 { serial_pins: serial_pinmux { mux { pins = "gpio60", "gpio61"; @@ -108,5 +93,13 @@ watchdog@b017000 { status = "ok"; }; + + wifi@a000000 { + status = "ok"; + }; + + wifi@a800000 { + status = "ok"; + }; }; }; diff --git a/src/arm/qcom-ipq4019.dtsi b/src/arm/qcom-ipq4019.dtsi index 4b7d97275c62..10d112a4078e 100644 --- a/src/arm/qcom-ipq4019.dtsi +++ b/src/arm/qcom-ipq4019.dtsi @@ -96,6 +96,21 @@ clock-frequency = <32768>; #clock-cells = <0>; }; + + xo: xo { + compatible = "fixed-clock"; + clock-frequency = <48000000>; + #clock-cells = <0>; + }; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = <1 2 0xf08>, + <1 3 0xf08>, + <1 4 0xf08>, + <1 1 0xf08>; + clock-frequency = <48000000>; }; soc { @@ -119,7 +134,15 @@ reg = <0x1800000 0x60000>; }; - tlmm: pinctrl@0x01000000 { + rng@22000 { + compatible = "qcom,prng"; + reg = <0x22000 0x140>; + clocks = <&gcc GCC_PRNG_AHB_CLK>; + clock-names = "core"; + status = "disabled"; + }; + + tlmm: pinctrl@1000000 { compatible = "qcom,ipq4019-pinctrl"; reg = <0x01000000 0x300000>; gpio-controller; @@ -269,5 +292,89 @@ compatible = "qcom,pshold"; reg = <0x4ab000 0x4>; }; + + wifi0: wifi@a000000 { + compatible = "qcom,ipq4019-wifi"; + reg = <0xa000000 0x200000>; + resets = <&gcc WIFI0_CPU_INIT_RESET>, + <&gcc WIFI0_RADIO_SRIF_RESET>, + <&gcc WIFI0_RADIO_WARM_RESET>, + <&gcc WIFI0_RADIO_COLD_RESET>, + <&gcc WIFI0_CORE_WARM_RESET>, + <&gcc WIFI0_CORE_COLD_RESET>; + reset-names = "wifi_cpu_init", "wifi_radio_srif", + "wifi_radio_warm", "wifi_radio_cold", + "wifi_core_warm", "wifi_core_cold"; + clocks = <&gcc GCC_WCSS2G_CLK>, + <&gcc GCC_WCSS2G_REF_CLK>, + <&gcc GCC_WCSS2G_RTC_CLK>; + clock-names = "wifi_wcss_cmd", "wifi_wcss_ref", + "wifi_wcss_rtc"; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names = "msi0", "msi1", "msi2", "msi3", + "msi4", "msi5", "msi6", "msi7", + "msi8", "msi9", "msi10", "msi11", + "msi12", "msi13", "msi14", "msi15", + "legacy"; + status = "disabled"; + }; + + wifi1: wifi@a800000 { + compatible = "qcom,ipq4019-wifi"; + reg = <0xa800000 0x200000>; + resets = <&gcc WIFI1_CPU_INIT_RESET>, + <&gcc WIFI1_RADIO_SRIF_RESET>, + <&gcc WIFI1_RADIO_WARM_RESET>, + <&gcc WIFI1_RADIO_COLD_RESET>, + <&gcc WIFI1_CORE_WARM_RESET>, + <&gcc WIFI1_CORE_COLD_RESET>; + reset-names = "wifi_cpu_init", "wifi_radio_srif", + "wifi_radio_warm", "wifi_radio_cold", + "wifi_core_warm", "wifi_core_cold"; + clocks = <&gcc GCC_WCSS5G_CLK>, + <&gcc GCC_WCSS5G_REF_CLK>, + <&gcc GCC_WCSS5G_RTC_CLK>; + clock-names = "wifi_wcss_cmd", "wifi_wcss_ref", + "wifi_wcss_rtc"; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + interrupt-names = "msi0", "msi1", "msi2", "msi3", + "msi4", "msi5", "msi6", "msi7", + "msi8", "msi9", "msi10", "msi11", + "msi12", "msi13", "msi14", "msi15", + "legacy"; + status = "disabled"; + }; }; }; diff --git a/src/arm/qcom-ipq8064-ap148.dts b/src/arm/qcom-ipq8064-ap148.dts index 348503d1a1c1..bcf53e37ed93 100644 --- a/src/arm/qcom-ipq8064-ap148.dts +++ b/src/arm/qcom-ipq8064-ap148.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-ipq8064-v1.0.dtsi" / { diff --git a/src/arm/qcom-ipq8064-v1.0.dtsi b/src/arm/qcom-ipq8064-v1.0.dtsi index 7093b075e408..e1181194e8d3 100644 --- a/src/arm/qcom-ipq8064-v1.0.dtsi +++ b/src/arm/qcom-ipq8064-v1.0.dtsi @@ -1 +1,2 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-ipq8064.dtsi" diff --git a/src/arm/qcom-ipq8064.dtsi b/src/arm/qcom-ipq8064.dtsi index f1fbffe59b93..1e0a3b446f7a 100644 --- a/src/arm/qcom-ipq8064.dtsi +++ b/src/arm/qcom-ipq8064.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "skeleton.dtsi" diff --git a/src/arm/qcom-msm8660-surf.dts b/src/arm/qcom-msm8660-surf.dts index 1adc04978a47..f01a11b18d6a 100644 --- a/src/arm/qcom-msm8660-surf.dts +++ b/src/arm/qcom-msm8660-surf.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include "qcom-msm8660.dtsi" diff --git a/src/arm/qcom-msm8660.dtsi b/src/arm/qcom-msm8660.dtsi index 1b5d31b33b5e..221c4584552f 100644 --- a/src/arm/qcom-msm8660.dtsi +++ b/src/arm/qcom-msm8660.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "skeleton.dtsi" diff --git a/src/arm/qcom-msm8960-cdp.dts b/src/arm/qcom-msm8960-cdp.dts index b72a55462caf..82d5d8267adf 100644 --- a/src/arm/qcom-msm8960-cdp.dts +++ b/src/arm/qcom-msm8960-cdp.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include "qcom-msm8960.dtsi" diff --git a/src/arm/qcom-msm8960.dtsi b/src/arm/qcom-msm8960.dtsi index 288f56e0ccf5..1733d8f40ab1 100644 --- a/src/arm/qcom-msm8960.dtsi +++ b/src/arm/qcom-msm8960.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "skeleton.dtsi" diff --git a/src/arm/qcom-msm8974-lge-nexus5-hammerhead.dts b/src/arm/qcom-msm8974-lge-nexus5-hammerhead.dts index 382bcc3231a9..4dc0b347b1ee 100644 --- a/src/arm/qcom-msm8974-lge-nexus5-hammerhead.dts +++ b/src/arm/qcom-msm8974-lge-nexus5-hammerhead.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-msm8974.dtsi" #include "qcom-pm8841.dtsi" #include "qcom-pm8941.dtsi" diff --git a/src/arm/qcom-msm8974-sony-xperia-honami.dts b/src/arm/qcom-msm8974-sony-xperia-honami.dts index 50966378f9e4..450b8321e0a6 100644 --- a/src/arm/qcom-msm8974-sony-xperia-honami.dts +++ b/src/arm/qcom-msm8974-sony-xperia-honami.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "qcom-msm8974.dtsi" #include "qcom-pm8841.dtsi" #include "qcom-pm8941.dtsi" diff --git a/src/arm/qcom-msm8974.dtsi b/src/arm/qcom-msm8974.dtsi index c5ee68a3f7f5..33002fed8cc3 100644 --- a/src/arm/qcom-msm8974.dtsi +++ b/src/arm/qcom-msm8974.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include @@ -779,7 +780,7 @@ }; replicator@fc31c000 { - compatible = "qcom,coresight-replicator1x", "arm,primecell"; + compatible = "arm,coresight-dynamic-replicator", "arm,primecell"; reg = <0xfc31c000 0x1000>; clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>; diff --git a/src/arm/qcom-pm8841.dtsi b/src/arm/qcom-pm8841.dtsi index 0512f645922e..2fd59c440903 100644 --- a/src/arm/qcom-pm8841.dtsi +++ b/src/arm/qcom-pm8841.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/src/arm/qcom-pm8941.dtsi b/src/arm/qcom-pm8941.dtsi index 3fc9f34f45bb..1d5ef55c7ee5 100644 --- a/src/arm/qcom-pm8941.dtsi +++ b/src/arm/qcom-pm8941.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/src/arm/qcom-pma8084.dtsi b/src/arm/qcom-pma8084.dtsi index 82d258094156..aac7e73b6872 100644 --- a/src/arm/qcom-pma8084.dtsi +++ b/src/arm/qcom-pma8084.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/src/arm/r7s72100-genmai.dts b/src/arm/r7s72100-genmai.dts index 52a7b586bac7..cd4d5ff7749e 100644 --- a/src/arm/r7s72100-genmai.dts +++ b/src/arm/r7s72100-genmai.dts @@ -11,6 +11,8 @@ /dts-v1/; #include "r7s72100.dtsi" +#include +#include / { model = "Genmai"; @@ -34,6 +36,54 @@ #address-cells = <1>; #size-cells = <1>; }; + + leds { + status = "okay"; + compatible = "gpio-leds"; + + led1 { + gpios = <&port4 10 GPIO_ACTIVE_LOW>; + }; + + led2 { + gpios = <&port4 11 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pinctrl { + + scif2_pins: serial2 { + /* P3_0 as TxD2; P3_2 as RxD2 */ + pinmux = , ; + }; + + i2c2_pins: i2c2 { + /* RIIC2: P1_4 as SCL, P1_5 as SDA */ + pinmux = , ; + }; + + ether_pins: ether { + /* Ethernet on Ports 1,2,3,5 */ + pinmux = ,/* P1_14 = ET_COL */ + , /* P5_9 = ET_MDC */ + , /* P3_3 = ET_MDIO */ + , /* P3_4 = ET_RXCLK */ + , /* P3_5 = ET_RXER */ + , /* P3_6 = ET_RXDV */ + , /* P2_0 = ET_TXCLK */ + , /* P2_1 = ET_TXER */ + , /* P2_2 = ET_TXEN */ + , /* P2_3 = ET_CRS */ + , /* P2_4 = ET_TXD0 */ + , /* P2_5 = ET_TXD1 */ + , /* P2_6 = ET_TXD2 */ + , /* P2_7 = ET_TXD3 */ + , /* P2_8 = ET_RXD0 */ + , /* P2_9 = ET_RXD1 */ + ,/* P2_10 = ET_RXD2 */ + ;/* P2_11 = ET_RXD3 */ + }; }; &extal_clk { @@ -52,12 +102,28 @@ status = "okay"; }; +ðer { + pinctrl-names = "default"; + pinctrl-0 = <ðer_pins>; + + status = "okay"; + + renesas,no-ether-link; + phy-handle = <&phy0>; + phy0: ethernet-phy@0 { + reg = <0>; + }; +}; + &i2c2 { status = "okay"; clock-frequency = <400000>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins>; + eeprom@50 { - compatible = "renesas,24c128"; + compatible = "renesas,24c128", "atmel,24c128"; reg = <0x50>; pagesize = <64>; }; @@ -68,6 +134,9 @@ }; &scif2 { + pinctrl-names = "default"; + pinctrl-0 = <&scif2_pins>; + status = "okay"; }; diff --git a/src/arm/r7s72100-rskrza1.dts b/src/arm/r7s72100-rskrza1.dts index 72df20a04320..5dcaaf131d27 100644 --- a/src/arm/r7s72100-rskrza1.dts +++ b/src/arm/r7s72100-rskrza1.dts @@ -10,6 +10,8 @@ /dts-v1/; #include "r7s72100.dtsi" +#include +#include / { model = "RSKRZA1"; @@ -33,6 +35,15 @@ #address-cells = <1>; #size-cells = <1>; }; + + leds { + status = "okay"; + compatible = "gpio-leds"; + + led0 { + gpios = <&port7 1 GPIO_ACTIVE_LOW>; + }; + }; }; &extal_clk { @@ -47,11 +58,57 @@ clock-frequency = <32768>; }; +&pinctrl { + + /* Serial Console */ + scif2_pins: serial2 { + pinmux = , /* TxD2 */ + ; /* RxD2 */ + }; + + /* Ethernet */ + ether_pins: ether { + /* Ethernet on Ports 1,2,3,5 */ + pinmux = , /* ET_COL */ + , /* ET_MDC */ + , /* ET_MDIO */ + , /* ET_RXCLK */ + , /* ET_RXER */ + , /* ET_RXDV */ + , /* ET_TXCLK */ + , /* ET_TXER */ + , /* ET_TXEN */ + , /* ET_CRS */ + , /* ET_TXD0 */ + , /* ET_TXD1 */ + , /* ET_TXD2 */ + , /* ET_TXD3 */ + , /* ET_RXD0 */ + , /* ET_RXD1 */ + , /* ET_RXD2 */ + ; /* ET_RXD3 */ + }; + + /* SDHI ch1 on CN1 */ + sdhi1_pins: sdhi1 { + pinmux = , /* SD_CD_1 */ + , /* SD_WP_1 */ + , /* SD_D1_1 */ + , /* SD_D0_1 */ + , /* SD_CLK_1 */ + , /* SD_CMD_1 */ + , /* SD_D3_1 */ + ; /* SD_D2_1 */ + }; +}; + &mtu2 { status = "okay"; }; ðer { + pinctrl-names = "default"; + pinctrl-0 = <ðer_pins>; status = "okay"; renesas,no-ether-link; phy-handle = <&phy0>; @@ -61,6 +118,8 @@ }; &sdhi1 { + pinctrl-names = "default"; + pinctrl-0 = <&sdhi1_pins>; bus-width = <4>; status = "okay"; }; @@ -78,5 +137,7 @@ }; &scif2 { + pinctrl-names = "default"; + pinctrl-0 = <&scif2_pins>; status = "okay"; }; diff --git a/src/arm/r7s72100.dtsi b/src/arm/r7s72100.dtsi index 5cf53e9943af..4ed12a4d9d51 100644 --- a/src/arm/r7s72100.dtsi +++ b/src/arm/r7s72100.dtsi @@ -207,6 +207,84 @@ }; }; + pinctrl: pin-controller@fcfe3000 { + compatible = "renesas,r7s72100-ports"; + + reg = <0xfcfe3000 0x4230>; + + port0: gpio-0 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 0 6>; + }; + + port1: gpio-1 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 16 16>; + }; + + port2: gpio-2 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 32 16>; + }; + + port3: gpio-3 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 48 16>; + }; + + port4: gpio-4 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 64 16>; + }; + + port5: gpio-5 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 80 11>; + }; + + port6: gpio-6 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 96 16>; + }; + + port7: gpio-7 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 112 16>; + }; + + port8: gpio-8 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 128 16>; + }; + + port9: gpio-9 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 144 8>; + }; + + port10: gpio-10 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 160 16>; + }; + + port11: gpio-11 { + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 176 16>; + }; + }; + scif0: serial@e8007000 { compatible = "renesas,scif-r7s72100", "renesas,scif"; reg = <0xe8007000 64>; diff --git a/src/arm/r8a7743-iwg20d-q7.dts b/src/arm/r8a7743-iwg20d-q7.dts index 9b54783cc2a5..081af0192851 100644 --- a/src/arm/r8a7743-iwg20d-q7.dts +++ b/src/arm/r8a7743-iwg20d-q7.dts @@ -17,9 +17,40 @@ aliases { serial0 = &scif0; + ethernet0 = &avb; + }; +}; + +&pfc { + scif0_pins: scif0 { + groups = "scif0_data_d"; + function = "scif0"; + }; + + avb_pins: avb { + groups = "avb_mdio", "avb_gmii"; + function = "avb"; }; }; &scif0 { + pinctrl-0 = <&scif0_pins>; + pinctrl-names = "default"; + status = "okay"; }; + +&avb { + pinctrl-0 = <&avb_pins>; + pinctrl-names = "default"; + + phy-handle = <&phy3>; + phy-mode = "gmii"; + renesas,no-ether-link; + status = "okay"; + + phy3: ethernet-phy@3 { + reg = <3>; + micrel,led-mode = <1>; + }; +}; diff --git a/src/arm/r8a7743-iwg20m.dtsi b/src/arm/r8a7743-iwg20m.dtsi index 001ca9144f4b..ff7993818637 100644 --- a/src/arm/r8a7743-iwg20m.dtsi +++ b/src/arm/r8a7743-iwg20m.dtsi @@ -22,8 +22,34 @@ device_type = "memory"; reg = <2 0x00000000 0 0x20000000>; }; + + reg_3p3v: 3p3v { + compatible = "regulator-fixed"; + regulator-name = "3P3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; }; &extal_clk { clock-frequency = <20000000>; }; + +&pfc { + mmcif0_pins: mmc { + groups = "mmc_data8_b", "mmc_ctrl"; + function = "mmc"; + }; +}; + +&mmcif0 { + pinctrl-0 = <&mmcif0_pins>; + pinctrl-names = "default"; + + vmmc-supply = <®_3p3v>; + bus-width = <8>; + non-removable; + status = "okay"; +}; diff --git a/src/arm/r8a7743-sk-rzg1m.dts b/src/arm/r8a7743-sk-rzg1m.dts index 3a22538208f2..3d918d106593 100644 --- a/src/arm/r8a7743-sk-rzg1m.dts +++ b/src/arm/r8a7743-sk-rzg1m.dts @@ -1,7 +1,7 @@ /* * Device Tree Source for the SK-RZG1M board * - * Copyright (C) 2016 Cogent Embedded, Inc. + * Copyright (C) 2016-2017 Cogent Embedded, Inc. * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any @@ -39,11 +39,34 @@ clock-frequency = <20000000>; }; +&pfc { + scif0_pins: scif0 { + groups = "scif0_data_d"; + function = "scif0"; + }; + + ether_pins: ether { + groups = "eth_link", "eth_mdio", "eth_rmii"; + function = "eth"; + }; + + phy1_pins: phy1 { + groups = "intc_irq0"; + function = "intc"; + }; +}; + &scif0 { + pinctrl-0 = <&scif0_pins>; + pinctrl-names = "default"; + status = "okay"; }; ðer { + pinctrl-0 = <ðer_pins &phy1_pins>; + pinctrl-names = "default"; + phy-handle = <&phy1>; renesas,ether-link-active-low; status = "okay"; diff --git a/src/arm/r8a7743.dtsi b/src/arm/r8a7743.dtsi index 0ddac81742e4..14222c72f0e0 100644 --- a/src/arm/r8a7743.dtsi +++ b/src/arm/r8a7743.dtsi @@ -1,7 +1,7 @@ /* * Device Tree Source for the r8a7743 SoC * - * Copyright (C) 2016 Cogent Embedded Inc. + * Copyright (C) 2016-2017 Cogent Embedded Inc. * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any @@ -18,9 +18,19 @@ #address-cells = <2>; #size-cells = <2>; + aliases { + i2c0 = &i2c0; + i2c1 = &i2c1; + i2c2 = &i2c2; + i2c3 = &i2c3; + i2c4 = &i2c4; + i2c5 = &i2c5; + }; + cpus { #address-cells = <1>; #size-cells = <0>; + enable-method = "renesas,apmu"; cpu0: cpu@0 { device_type = "cpu"; @@ -28,8 +38,26 @@ reg = <0>; clock-frequency = <1500000000>; clocks = <&cpg CPG_CORE R8A7743_CLK_Z>; + clock-latency = <300000>; /* 300 us */ power-domains = <&sysc R8A7743_PD_CA15_CPU0>; next-level-cache = <&L2_CA15>; + + /* kHz - uV - OPPs unknown yet */ + operating-points = <1500000 1000000>, + <1312500 1000000>, + <1125000 1000000>, + < 937500 1000000>, + < 750000 1000000>, + < 375000 1000000>; + }; + + cpu1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <1>; + clock-frequency = <1500000000>; + power-domains = <&sysc R8A7743_PD_CA15_CPU1>; + next-level-cache = <&L2_CA15>; }; L2_CA15: cache-controller-0 { @@ -48,6 +76,12 @@ #size-cells = <2>; ranges; + apmu@e6152000 { + compatible = "renesas,r8a7743-apmu", "renesas,apmu"; + reg = <0 0xe6152000 0 0x188>; + cpus = <&cpu0 &cpu1>; + }; + gic: interrupt-controller@f1001000 { compatible = "arm,gic-400"; #interrupt-cells = <3>; @@ -65,6 +99,126 @@ resets = <&cpg 408>; }; + gpio0: gpio@e6050000 { + compatible = "renesas,gpio-r8a7743", + "renesas,gpio-rcar"; + reg = <0 0xe6050000 0 0x50>; + interrupts = ; + #gpio-cells = <2>; + gpio-controller; + gpio-ranges = <&pfc 0 0 32>; + #interrupt-cells = <2>; + interrupt-controller; + clocks = <&cpg CPG_MOD 912>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 912>; + }; + + gpio1: gpio@e6051000 { + compatible = "renesas,gpio-r8a7743", + "renesas,gpio-rcar"; + reg = <0 0xe6051000 0 0x50>; + interrupts = ; + #gpio-cells = <2>; + gpio-controller; + gpio-ranges = <&pfc 0 32 26>; + #interrupt-cells = <2>; + interrupt-controller; + clocks = <&cpg CPG_MOD 911>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 911>; + }; + + gpio2: gpio@e6052000 { + compatible = "renesas,gpio-r8a7743", + "renesas,gpio-rcar"; + reg = <0 0xe6052000 0 0x50>; + interrupts = ; + #gpio-cells = <2>; + gpio-controller; + gpio-ranges = <&pfc 0 64 32>; + #interrupt-cells = <2>; + interrupt-controller; + clocks = <&cpg CPG_MOD 910>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 910>; + }; + + gpio3: gpio@e6053000 { + compatible = "renesas,gpio-r8a7743", + "renesas,gpio-rcar"; + reg = <0 0xe6053000 0 0x50>; + interrupts = ; + #gpio-cells = <2>; + gpio-controller; + gpio-ranges = <&pfc 0 96 32>; + #interrupt-cells = <2>; + interrupt-controller; + clocks = <&cpg CPG_MOD 909>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 909>; + }; + + gpio4: gpio@e6054000 { + compatible = "renesas,gpio-r8a7743", + "renesas,gpio-rcar"; + reg = <0 0xe6054000 0 0x50>; + interrupts = ; + #gpio-cells = <2>; + gpio-controller; + gpio-ranges = <&pfc 0 128 32>; + #interrupt-cells = <2>; + interrupt-controller; + clocks = <&cpg CPG_MOD 908>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 908>; + }; + + gpio5: gpio@e6055000 { + compatible = "renesas,gpio-r8a7743", + "renesas,gpio-rcar"; + reg = <0 0xe6055000 0 0x50>; + interrupts = ; + #gpio-cells = <2>; + gpio-controller; + gpio-ranges = <&pfc 0 160 32>; + #interrupt-cells = <2>; + interrupt-controller; + clocks = <&cpg CPG_MOD 907>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 907>; + }; + + gpio6: gpio@e6055400 { + compatible = "renesas,gpio-r8a7743", + "renesas,gpio-rcar"; + reg = <0 0xe6055400 0 0x50>; + interrupts = ; + #gpio-cells = <2>; + gpio-controller; + gpio-ranges = <&pfc 0 192 32>; + #interrupt-cells = <2>; + interrupt-controller; + clocks = <&cpg CPG_MOD 905>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 905>; + }; + + gpio7: gpio@e6055800 { + compatible = "renesas,gpio-r8a7743", + "renesas,gpio-rcar"; + reg = <0 0xe6055800 0 0x50>; + interrupts = ; + #gpio-cells = <2>; + gpio-controller; + gpio-ranges = <&pfc 0 224 26>; + #interrupt-cells = <2>; + interrupt-controller; + clocks = <&cpg CPG_MOD 904>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 904>; + }; + irqc: interrupt-controller@e61c0000 { compatible = "renesas,irqc-r8a7743", "renesas,irqc"; #interrupt-cells = <2>; @@ -123,6 +277,11 @@ #power-domain-cells = <1>; }; + pfc: pin-controller@e6060000 { + compatible = "renesas,pfc-r8a7743"; + reg = <0 0xe6060000 0 0x250>; + }; + dmac0: dma-controller@e6700000 { compatible = "renesas,dmac-r8a7743", "renesas,rcar-dmac"; @@ -189,6 +348,94 @@ dma-channels = <15>; }; + /* The memory map in the User's Manual maps the cores to bus + * numbers + */ + i2c0: i2c@e6508000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6508000 0 0x40>; + interrupts = ; + clocks = <&cpg CPG_MOD 931>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 931>; + i2c-scl-internal-delay-ns = <6>; + status = "disabled"; + }; + + i2c1: i2c@e6518000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6518000 0 0x40>; + interrupts = ; + clocks = <&cpg CPG_MOD 930>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 930>; + i2c-scl-internal-delay-ns = <6>; + status = "disabled"; + }; + + i2c2: i2c@e6530000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6530000 0 0x40>; + interrupts = ; + clocks = <&cpg CPG_MOD 929>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 929>; + i2c-scl-internal-delay-ns = <6>; + status = "disabled"; + }; + + i2c3: i2c@e6540000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6540000 0 0x40>; + interrupts = ; + clocks = <&cpg CPG_MOD 928>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 928>; + i2c-scl-internal-delay-ns = <6>; + status = "disabled"; + }; + + i2c4: i2c@e6520000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6520000 0 0x40>; + interrupts = ; + clocks = <&cpg CPG_MOD 927>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 927>; + i2c-scl-internal-delay-ns = <6>; + status = "disabled"; + }; + + i2c5: i2c@e6528000 { + /* doesn't need pinmux */ + #address-cells = <1>; + #size-cells = <0>; + compatible = "renesas,i2c-r8a7743", + "renesas,rcar-gen2-i2c"; + reg = <0 0xe6528000 0 0x40>; + interrupts = ; + clocks = <&cpg CPG_MOD 925>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 925>; + i2c-scl-internal-delay-ns = <110>; + status = "disabled"; + }; + scifa0: serial@e6c40000 { compatible = "renesas,scifa-r8a7743", "renesas,rcar-gen2-scifa", "renesas,scifa"; @@ -468,6 +715,29 @@ status = "disabled"; }; + icram2: sram@e6300000 { + compatible = "mmio-sram"; + reg = <0 0xe6300000 0 0x40000>; + }; + + icram0: sram@e63a0000 { + compatible = "mmio-sram"; + reg = <0 0xe63a0000 0 0x12000>; + }; + + icram1: sram@e63c0000 { + compatible = "mmio-sram"; + reg = <0 0xe63c0000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0xe63c0000 0x1000>; + + smp-sram@0 { + compatible = "renesas,smp-sram"; + reg = <0 0x10>; + }; + }; + ether: ethernet@ee700000 { compatible = "renesas,ether-r8a7743"; reg = <0 0xee700000 0 0x400>; @@ -480,6 +750,35 @@ #size-cells = <0>; status = "disabled"; }; + + avb: ethernet@e6800000 { + compatible = "renesas,etheravb-r8a7743", + "renesas,etheravb-rcar-gen2"; + reg = <0 0xe6800000 0 0x800>, <0 0xee0e8000 0 0x4000>; + interrupts = ; + clocks = <&cpg CPG_MOD 812>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 812>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + mmcif0: mmc@ee200000 { + compatible = "renesas,mmcif-r8a7743", + "renesas,sh-mmcif"; + reg = <0 0xee200000 0 0x80>; + interrupts = ; + clocks = <&cpg CPG_MOD 315>; + dmas = <&dmac0 0xd1>, <&dmac0 0xd2>, + <&dmac1 0xd1>, <&dmac1 0xd2>; + dma-names = "tx", "rx", "tx", "rx"; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 315>; + reg-io-width = <4>; + max-frequency = <97500000>; + status = "disabled"; + }; }; /* External root clock */ diff --git a/src/arm/r8a7745-sk-rzg1e.dts b/src/arm/r8a7745-sk-rzg1e.dts index 97840b340197..b4d679b04ad6 100644 --- a/src/arm/r8a7745-sk-rzg1e.dts +++ b/src/arm/r8a7745-sk-rzg1e.dts @@ -1,7 +1,7 @@ /* * Device Tree Source for the SK-RZG1E board * - * Copyright (C) 2016 Cogent Embedded, Inc. + * Copyright (C) 2016-2017 Cogent Embedded, Inc. * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any @@ -34,11 +34,34 @@ clock-frequency = <20000000>; }; +&pfc { + scif2_pins: scif2 { + groups = "scif2_data"; + function = "scif2"; + }; + + ether_pins: ether { + groups = "eth_link", "eth_mdio", "eth_rmii"; + function = "eth"; + }; + + phy1_pins: phy1 { + groups = "intc_irq8"; + function = "intc"; + }; +}; + &scif2 { + pinctrl-0 = <&scif2_pins>; + pinctrl-names = "default"; + status = "okay"; }; ðer { + pinctrl-0 = <ðer_pins &phy1_pins>; + pinctrl-names = "default"; + phy-handle = <&phy1>; renesas,ether-link-active-low; status = "okay"; diff --git a/src/arm/r8a7745.dtsi b/src/arm/r8a7745.dtsi index 2feb0084bb3b..aff90dfb8b32 100644 --- a/src/arm/r8a7745.dtsi +++ b/src/arm/r8a7745.dtsi @@ -1,7 +1,7 @@ /* * Device Tree Source for the r8a7745 SoC * - * Copyright (C) 2016 Cogent Embedded Inc. + * Copyright (C) 2016-2017 Cogent Embedded Inc. * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any @@ -123,6 +123,11 @@ #power-domain-cells = <1>; }; + pfc: pin-controller@e6060000 { + compatible = "renesas,pfc-r8a7745"; + reg = <0 0xe6060000 0 0x11c>; + }; + dmac0: dma-controller@e6700000 { compatible = "renesas,dmac-r8a7745", "renesas,rcar-dmac"; @@ -468,6 +473,29 @@ status = "disabled"; }; + icram2: sram@e6300000 { + compatible = "mmio-sram"; + reg = <0 0xe6300000 0 0x40000>; + }; + + icram0: sram@e63a0000 { + compatible = "mmio-sram"; + reg = <0 0xe63a0000 0 0x12000>; + }; + + icram1: sram@e63c0000 { + compatible = "mmio-sram"; + reg = <0 0xe63c0000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0xe63c0000 0x1000>; + + smp-sram@0 { + compatible = "renesas,smp-sram"; + reg = <0 0x10>; + }; + }; + ether: ethernet@ee700000 { compatible = "renesas,ether-r8a7745"; reg = <0 0xee700000 0 0x400>; diff --git a/src/arm/r8a7790.dtsi b/src/arm/r8a7790.dtsi index 2805a8608d4b..16358bf8d1db 100644 --- a/src/arm/r8a7790.dtsi +++ b/src/arm/r8a7790.dtsi @@ -830,6 +830,24 @@ status = "disabled"; }; + icram0: sram@e63a0000 { + compatible = "mmio-sram"; + reg = <0 0xe63a0000 0 0x12000>; + }; + + icram1: sram@e63c0000 { + compatible = "mmio-sram"; + reg = <0 0xe63c0000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0xe63c0000 0x1000>; + + smp-sram@0 { + compatible = "renesas,smp-sram"; + reg = <0 0x10>; + }; + }; + ether: ethernet@ee700000 { compatible = "renesas,ether-r8a7790"; reg = <0 0xee700000 0 0x400>; @@ -855,7 +873,7 @@ }; sata0: sata@ee300000 { - compatible = "renesas,sata-r8a7790"; + compatible = "renesas,sata-r8a7790", "renesas,rcar-gen2-sata"; reg = <0 0xee300000 0 0x2000>; interrupts = ; clocks = <&mstp8_clks R8A7790_CLK_SATA0>; @@ -864,7 +882,7 @@ }; sata1: sata@ee500000 { - compatible = "renesas,sata-r8a7790"; + compatible = "renesas,sata-r8a7790", "renesas,rcar-gen2-sata"; reg = <0 0xee500000 0 0x2000>; interrupts = ; clocks = <&mstp8_clks R8A7790_CLK_SATA1>; @@ -909,7 +927,7 @@ }; vin0: video@e6ef0000 { - compatible = "renesas,vin-r8a7790"; + compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin"; reg = <0 0xe6ef0000 0 0x1000>; interrupts = ; clocks = <&mstp8_clks R8A7790_CLK_VIN0>; @@ -918,7 +936,7 @@ }; vin1: video@e6ef1000 { - compatible = "renesas,vin-r8a7790"; + compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin"; reg = <0 0xe6ef1000 0 0x1000>; interrupts = ; clocks = <&mstp8_clks R8A7790_CLK_VIN1>; @@ -927,7 +945,7 @@ }; vin2: video@e6ef2000 { - compatible = "renesas,vin-r8a7790"; + compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin"; reg = <0 0xe6ef2000 0 0x1000>; interrupts = ; clocks = <&mstp8_clks R8A7790_CLK_VIN2>; @@ -936,7 +954,7 @@ }; vin3: video@e6ef3000 { - compatible = "renesas,vin-r8a7790"; + compatible = "renesas,vin-r8a7790", "renesas,rcar-gen2-vin"; reg = <0 0xe6ef3000 0 0x1000>; interrupts = ; clocks = <&mstp8_clks R8A7790_CLK_VIN3>; diff --git a/src/arm/r8a7791-koelsch.dts b/src/arm/r8a7791-koelsch.dts index 001e6116c47c..0ce0b278e1cb 100644 --- a/src/arm/r8a7791-koelsch.dts +++ b/src/arm/r8a7791-koelsch.dts @@ -642,11 +642,19 @@ }; }; + cec_clock: cec-clock { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12000000>; + }; + hdmi@39 { compatible = "adi,adv7511w"; reg = <0x39>; interrupt-parent = <&gpio3>; interrupts = <29 IRQ_TYPE_LEVEL_LOW>; + clocks = <&cec_clock>; + clock-names = "cec"; adi,input-depth = <8>; adi,input-colorspace = "rgb"; @@ -702,7 +710,7 @@ }; eeprom@50 { - compatible = "renesas,24c02"; + compatible = "renesas,24c02", "atmel,24c02"; reg = <0x50>; pagesize = <16>; }; diff --git a/src/arm/r8a7791.dtsi b/src/arm/r8a7791.dtsi index bd93f699ad84..f1d1a9772153 100644 --- a/src/arm/r8a7791.dtsi +++ b/src/arm/r8a7791.dtsi @@ -890,6 +890,24 @@ status = "disabled"; }; + icram0: sram@e63a0000 { + compatible = "mmio-sram"; + reg = <0 0xe63a0000 0 0x12000>; + }; + + icram1: sram@e63c0000 { + compatible = "mmio-sram"; + reg = <0 0xe63c0000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0xe63c0000 0x1000>; + + smp-sram@0 { + compatible = "renesas,smp-sram"; + reg = <0 0x10>; + }; + }; + ether: ethernet@ee700000 { compatible = "renesas,ether-r8a7791"; reg = <0 0xee700000 0 0x400>; @@ -915,7 +933,7 @@ }; sata0: sata@ee300000 { - compatible = "renesas,sata-r8a7791"; + compatible = "renesas,sata-r8a7791", "renesas,rcar-gen2-sata"; reg = <0 0xee300000 0 0x2000>; interrupts = ; clocks = <&mstp8_clks R8A7791_CLK_SATA0>; @@ -924,7 +942,7 @@ }; sata1: sata@ee500000 { - compatible = "renesas,sata-r8a7791"; + compatible = "renesas,sata-r8a7791", "renesas,rcar-gen2-sata"; reg = <0 0xee500000 0 0x2000>; interrupts = ; clocks = <&mstp8_clks R8A7791_CLK_SATA1>; @@ -969,7 +987,7 @@ }; vin0: video@e6ef0000 { - compatible = "renesas,vin-r8a7791"; + compatible = "renesas,vin-r8a7791", "renesas,rcar-gen2-vin"; reg = <0 0xe6ef0000 0 0x1000>; interrupts = ; clocks = <&mstp8_clks R8A7791_CLK_VIN0>; @@ -978,7 +996,7 @@ }; vin1: video@e6ef1000 { - compatible = "renesas,vin-r8a7791"; + compatible = "renesas,vin-r8a7791", "renesas,rcar-gen2-vin"; reg = <0 0xe6ef1000 0 0x1000>; interrupts = ; clocks = <&mstp8_clks R8A7791_CLK_VIN1>; @@ -987,7 +1005,7 @@ }; vin2: video@e6ef2000 { - compatible = "renesas,vin-r8a7791"; + compatible = "renesas,vin-r8a7791", "renesas,rcar-gen2-vin"; reg = <0 0xe6ef2000 0 0x1000>; interrupts = ; clocks = <&mstp8_clks R8A7791_CLK_VIN2>; diff --git a/src/arm/r8a7792.dtsi b/src/arm/r8a7792.dtsi index 0efecb232ee5..2623f39bed2b 100644 --- a/src/arm/r8a7792.dtsi +++ b/src/arm/r8a7792.dtsi @@ -465,6 +465,24 @@ status = "disabled"; }; + icram0: sram@e63a0000 { + compatible = "mmio-sram"; + reg = <0 0xe63a0000 0 0x12000>; + }; + + icram1: sram@e63c0000 { + compatible = "mmio-sram"; + reg = <0 0xe63c0000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0xe63c0000 0x1000>; + + smp-sram@0 { + compatible = "renesas,smp-sram"; + reg = <0 0x10>; + }; + }; + sdhi0: sd@ee100000 { compatible = "renesas,sdhi-r8a7792"; reg = <0 0xee100000 0 0x328>; diff --git a/src/arm/r8a7793.dtsi b/src/arm/r8a7793.dtsi index 13b980f27bbc..497716b6fbe2 100644 --- a/src/arm/r8a7793.dtsi +++ b/src/arm/r8a7793.dtsi @@ -848,6 +848,24 @@ status = "disabled"; }; + icram0: sram@e63a0000 { + compatible = "mmio-sram"; + reg = <0 0xe63a0000 0 0x12000>; + }; + + icram1: sram@e63c0000 { + compatible = "mmio-sram"; + reg = <0 0xe63c0000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0xe63c0000 0x1000>; + + smp-sram@0 { + compatible = "renesas,smp-sram"; + reg = <0 0x10>; + }; + }; + ether: ethernet@ee700000 { compatible = "renesas,ether-r8a7793"; reg = <0 0xee700000 0 0x400>; diff --git a/src/arm/r8a7794.dtsi b/src/arm/r8a7794.dtsi index 7d9a81d970d8..26535414203a 100644 --- a/src/arm/r8a7794.dtsi +++ b/src/arm/r8a7794.dtsi @@ -588,6 +588,24 @@ status = "disabled"; }; + icram0: sram@e63a0000 { + compatible = "mmio-sram"; + reg = <0 0xe63a0000 0 0x12000>; + }; + + icram1: sram@e63c0000 { + compatible = "mmio-sram"; + reg = <0 0xe63c0000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0xe63c0000 0x1000>; + + smp-sram@0 { + compatible = "renesas,smp-sram"; + reg = <0 0x10>; + }; + }; + ether: ethernet@ee700000 { compatible = "renesas,ether-r8a7794"; reg = <0 0xee700000 0 0x400>; @@ -783,7 +801,7 @@ }; vin0: video@e6ef0000 { - compatible = "renesas,vin-r8a7794"; + compatible = "renesas,vin-r8a7794", "renesas,rcar-gen2-vin"; reg = <0 0xe6ef0000 0 0x1000>; interrupts = ; clocks = <&mstp8_clks R8A7794_CLK_VIN0>; @@ -792,7 +810,7 @@ }; vin1: video@e6ef1000 { - compatible = "renesas,vin-r8a7794"; + compatible = "renesas,vin-r8a7794", "renesas,rcar-gen2-vin"; reg = <0 0xe6ef1000 0 0x1000>; interrupts = ; clocks = <&mstp8_clks R8A7794_CLK_VIN1>; diff --git a/src/arm/rk3036-kylin.dts b/src/arm/rk3036-kylin.dts index 5726135b7f8a..fdb1570bc7d3 100644 --- a/src/arm/rk3036-kylin.dts +++ b/src/arm/rk3036-kylin.dts @@ -357,7 +357,6 @@ keep-power-in-suspend; mmc-pwrseq = <&sdio_pwrseq>; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdio_clk &sdio_cmd &sdio_bus4>; sd-uhs-sdr12; @@ -372,7 +371,6 @@ cap-sd-highspeed; card-detect-delay = <200>; disable-wp; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>; }; diff --git a/src/arm/rk3036.dtsi b/src/arm/rk3036.dtsi index ec91325d3b6e..4916c65e0ace 100644 --- a/src/arm/rk3036.dtsi +++ b/src/arm/rk3036.dtsi @@ -287,7 +287,6 @@ fifo-depth = <0x100>; mmc-ddr-1_8v; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; resets = <&cru SRST_EMMC>; @@ -599,7 +598,7 @@ rockchip,pins = <1 15 RK_FUNC_1 &pcfg_pull_default>; }; - sdmmc_cd: sdmcc-cd { + sdmmc_cd: sdmmc-cd { rockchip,pins = <1 17 RK_FUNC_1 &pcfg_pull_default>; }; diff --git a/src/arm/rk3066a-bqcurie2.dts b/src/arm/rk3066a-bqcurie2.dts index e1f5198723b2..ef1eabf2512c 100644 --- a/src/arm/rk3066a-bqcurie2.dts +++ b/src/arm/rk3066a-bqcurie2.dts @@ -190,7 +190,6 @@ #include "tps65910.dtsi" &mmc0 { /* sdmmc */ - num-slots = <1>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>; @@ -202,7 +201,6 @@ }; &mmc1 { /* wifi */ - num-slots = <1>; status = "okay"; non-removable; diff --git a/src/arm/rk3066a-mk808.dts b/src/arm/rk3066a-mk808.dts index 7ca1cf5241e0..13e285c53def 100644 --- a/src/arm/rk3066a-mk808.dts +++ b/src/arm/rk3066a-mk808.dts @@ -132,7 +132,6 @@ bus-width = <4>; cap-mmc-highspeed; cap-sd-highspeed; - num-slots = <1>; vmmc-supply = <&vcc_sd>; status = "okay"; }; @@ -141,7 +140,6 @@ bus-width = <4>; disable-wp; non-removable; - num-slots = <1>; pinctrl-0 = <&sd1_clk &sd1_cmd &sd1_bus4>; pinctrl-names = "default"; vmmc-supply = <&vcc_wifi>; diff --git a/src/arm/rk3066a-rayeager.dts b/src/arm/rk3066a-rayeager.dts index 8907deaab18e..400cbf9609e3 100644 --- a/src/arm/rk3066a-rayeager.dts +++ b/src/arm/rk3066a-rayeager.dts @@ -185,7 +185,6 @@ cap-mmc-highspeed; disable-wp; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_rst>; vmmc-supply = <&vcc_emmc>; @@ -336,7 +335,6 @@ &mmc0 { bus-width = <4>; disable-wp; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>; vmmc-supply = <&vcc_sd>; @@ -349,7 +347,6 @@ bus-width = <4>; disable-wp; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sd1_clk>, <&sd1_cmd>, <&sd1_bus4>; vmmc-supply = <&vccio_wl>; diff --git a/src/arm/rk3188-px3-evb.dts b/src/arm/rk3188-px3-evb.dts index 5b2a0b6885cd..8ba9e06062f3 100644 --- a/src/arm/rk3188-px3-evb.dts +++ b/src/arm/rk3188-px3-evb.dts @@ -89,7 +89,6 @@ cap-mmc-highspeed; disable-wp; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_rst>; status = "okay"; @@ -256,7 +255,6 @@ }; &mmc0 { - num-slots = <1>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>; diff --git a/src/arm/rk3188-radxarock.dts b/src/arm/rk3188-radxarock.dts index ca0a1c4bc15c..53d6fc2fdbce 100644 --- a/src/arm/rk3188-radxarock.dts +++ b/src/arm/rk3188-radxarock.dts @@ -296,7 +296,6 @@ }; &mmc0 { - num-slots = <1>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>; diff --git a/src/arm/rk3228-evb.dts b/src/arm/rk3228-evb.dts index 58834330a5ba..1be9daacc4f9 100644 --- a/src/arm/rk3228-evb.dts +++ b/src/arm/rk3228-evb.dts @@ -50,6 +50,16 @@ device_type = "memory"; reg = <0x60000000 0x40000000>; }; + + vcc_phy: vcc-phy-regulator { + compatible = "regulator-fixed"; + enable-active-high; + regulator-name = "vcc_phy"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; }; &emmc { @@ -60,6 +70,30 @@ status = "okay"; }; +&gmac { + assigned-clocks = <&cru SCLK_MAC_SRC>; + assigned-clock-rates = <50000000>; + clock_in_out = "output"; + phy-supply = <&vcc_phy>; + phy-mode = "rmii"; + phy-handle = <&phy>; + status = "okay"; + + mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + phy: phy@0 { + compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22"; + reg = <0>; + clocks = <&cru SCLK_MAC_PHY>; + resets = <&cru SRST_MACPHY>; + phy-is-integrated; + }; + }; +}; + &tsadc { status = "okay"; diff --git a/src/arm/rk3229-evb.dts b/src/arm/rk3229-evb.dts index 1b55192b7d04..73e384585755 100644 --- a/src/arm/rk3229-evb.dts +++ b/src/arm/rk3229-evb.dts @@ -40,7 +40,8 @@ /dts-v1/; -#include "rk322x.dtsi" +#include +#include "rk3229.dtsi" / { model = "Rockchip RK3229 Evaluation board"; @@ -51,6 +52,15 @@ reg = <0x60000000 0x40000000>; }; + dc_12v: dc-12v-regulator { + compatible = "regulator-fixed"; + regulator-name = "dc_12v"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + ext_gmac: ext_gmac { compatible = "fixed-clock"; clock-frequency = <125000000>; @@ -67,6 +77,7 @@ regulator-name = "vcc_host"; regulator-always-on; regulator-boot-on; + vin-supply = <&vcc_sys>; }; vcc_phy: vcc-phy-regulator { @@ -77,7 +88,96 @@ regulator-max-microvolt = <1800000>; regulator-always-on; regulator-boot-on; + vin-supply = <&vccio_1v8>; }; + + vcc_sys: vcc-sys-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&dc_12v>; + }; + + vccio_1v8: vccio-1v8-regulator { + compatible = "regulator-fixed"; + regulator-name = "vccio_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + vin-supply = <&vcc_sys>; + }; + + vccio_3v3: vccio-3v3-regulator { + compatible = "regulator-fixed"; + regulator-name = "vccio_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + vin-supply = <&vcc_sys>; + }; + + vdd_arm: vdd-arm-regulator { + compatible = "pwm-regulator"; + pwms = <&pwm1 0 25000 1>; + pwm-supply = <&vcc_sys>; + regulator-name = "vdd_arm"; + regulator-min-microvolt = <950000>; + regulator-max-microvolt = <1400000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_log: vdd-log-regulator { + compatible = "pwm-regulator"; + pwms = <&pwm2 0 25000 1>; + pwm-supply = <&vcc_sys>; + regulator-name = "vdd_log"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1300000>; + regulator-always-on; + regulator-boot-on; + }; + + gpio_keys { + compatible = "gpio-keys"; + autorepeat; + pinctrl-names = "default"; + pinctrl-0 = <&pwr_key>; + + power_key: power-key { + label = "GPIO Key Power"; + gpios = <&gpio3 23 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <100>; + wakeup-source; + }; + }; +}; + +&cpu0 { + cpu-supply = <&vdd_arm>; +}; + +&cpu1 { + cpu-supply = <&vdd_arm>; +}; + +&cpu2 { + cpu-supply = <&vdd_arm>; +}; + +&cpu3 { + cpu-supply = <&vdd_arm>; +}; + +&emmc { + cap-mmc-highspeed; + disable-wp; + non-removable; + status = "okay"; }; &gmac { @@ -96,7 +196,21 @@ status = "okay"; }; +&io_domains { + status = "okay"; + + vccio1-supply = <&vccio_3v3>; + vccio2-supply = <&vccio_1v8>; + vccio4-supply = <&vccio_3v3>; +}; + &pinctrl { + keys { + pwr_key: pwr-key { + rockchip,pins = <3 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + usb { host_vbus_drv: host-vbus-drv { rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; @@ -104,6 +218,19 @@ }; }; +&pwm1 { + status = "okay"; +}; + +&pwm2 { + status = "okay"; +}; + +&tsadc { + rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */ + status = "okay"; +}; + &uart2 { status = "okay"; }; diff --git a/src/arm/rk3229.dtsi b/src/arm/rk3229.dtsi new file mode 100644 index 000000000000..6fe6c15fc13a --- /dev/null +++ b/src/arm/rk3229.dtsi @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library 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 library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "rk322x.dtsi" + +/ { + compatible = "rockchip,rk3229"; + + /delete-node/ opp-table0; + + cpu0_opp_table: opp_table0 { + compatible = "operating-points-v2"; + opp-shared; + + opp-408000000 { + opp-hz = /bits/ 64 <408000000>; + opp-microvolt = <950000>; + clock-latency-ns = <40000>; + opp-suspend; + }; + opp-600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <975000>; + }; + opp-816000000 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <1000000>; + }; + opp-1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1175000>; + }; + opp-1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <1275000>; + }; + opp-1296000000 { + opp-hz = /bits/ 64 <1296000000>; + opp-microvolt = <1325000>; + }; + opp-1392000000 { + opp-hz = /bits/ 64 <1392000000>; + opp-microvolt = <1375000>; + }; + opp-1464000000 { + opp-hz = /bits/ 64 <1464000000>; + opp-microvolt = <1400000>; + }; + }; +}; diff --git a/src/arm/rk322x.dtsi b/src/arm/rk322x.dtsi index f3e4ffd9f818..06814421eed2 100644 --- a/src/arm/rk322x.dtsi +++ b/src/arm/rk322x.dtsi @@ -55,6 +55,7 @@ serial0 = &uart0; serial1 = &uart1; serial2 = &uart2; + spi0 = &spi0; }; cpus { @@ -70,6 +71,7 @@ #cooling-cells = <2>; /* min followed by max */ clock-latency = <40000>; clocks = <&cru ARMCLK>; + enable-method = "psci"; }; cpu1: cpu@f01 { @@ -78,6 +80,7 @@ reg = <0xf01>; resets = <&cru SRST_CORE1>; operating-points-v2 = <&cpu0_opp_table>; + enable-method = "psci"; }; cpu2: cpu@f02 { @@ -86,6 +89,7 @@ reg = <0xf02>; resets = <&cru SRST_CORE2>; operating-points-v2 = <&cpu0_opp_table>; + enable-method = "psci"; }; cpu3: cpu@f03 { @@ -94,6 +98,7 @@ reg = <0xf03>; resets = <&cru SRST_CORE3>; operating-points-v2 = <&cpu0_opp_table>; + enable-method = "psci"; }; }; @@ -151,6 +156,11 @@ interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>; }; + psci { + compatible = "arm,psci-1.0", "arm,psci-0.2"; + method = "smc"; + }; + timer { compatible = "arm,armv7-timer"; arm,cpu-registers-not-fw-configured; @@ -196,6 +206,19 @@ status = "disabled"; }; + spdif: spdif@100d0000 { + compatible = "rockchip,rk3228-spdif"; + reg = <0x100d0000 0x1000>; + interrupts = ; + clocks = <&cru SCLK_SPDIF>, <&cru HCLK_SPDIF_8CH>; + clock-names = "mclk", "hclk"; + dmas = <&pdma 10>; + dma-names = "tx"; + pinctrl-names = "default"; + pinctrl-0 = <&spdif_tx>; + status = "disabled"; + }; + i2s2: i2s2@100e0000 { compatible = "rockchip,rk3228-i2s", "rockchip,rk3066-i2s"; reg = <0x100e0000 0x4000>; @@ -215,6 +238,11 @@ #address-cells = <1>; #size-cells = <1>; + io_domains: io-domains { + compatible = "rockchip,rk3228-io-voltage-domain"; + status = "disabled"; + }; + u2phy0: usb2-phy@760 { compatible = "rockchip,rk3228-usb2phy"; reg = <0x0760 0x0c>; @@ -309,6 +337,23 @@ status = "disabled"; }; + efuse: efuse@11040000 { + compatible = "rockchip,rk3228-efuse"; + reg = <0x11040000 0x20>; + clocks = <&cru PCLK_EFUSE_256>; + clock-names = "pclk_efuse"; + #address-cells = <1>; + #size-cells = <1>; + + /* Data cells */ + efuse_id: id@7 { + reg = <0x7 0x10>; + }; + cpu_leakage: cpu_leakage@17 { + reg = <0x17 0x1>; + }; + }; + i2c0: i2c@11050000 { compatible = "rockchip,rk3228-i2c"; reg = <0x11050000 0x1000>; @@ -361,6 +406,19 @@ status = "disabled"; }; + spi0: spi@11090000 { + compatible = "rockchip,rk3228-spi"; + reg = <0x11090000 0x1000>; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&cru SCLK_SPI0>, <&cru PCLK_SPI0>; + clock-names = "spiclk", "apb_pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&spi0_clk &spi0_tx &spi0_rx &spi0_cs0 &spi0_cs1>; + status = "disabled"; + }; + wdt: watchdog@110a0000 { compatible = "snps,dw-wdt"; reg = <0x110a0000 0x100>; @@ -500,8 +558,70 @@ status = "disabled"; }; + vpu_mmu: iommu@20020800 { + compatible = "rockchip,iommu"; + reg = <0x20020800 0x100>; + interrupts = ; + interrupt-names = "vpu_mmu"; + iommu-cells = <0>; + status = "disabled"; + }; + + vdec_mmu: iommu@20030480 { + compatible = "rockchip,iommu"; + reg = <0x20030480 0x40>, <0x200304c0 0x40>; + interrupts = ; + interrupt-names = "vdec_mmu"; + iommu-cells = <0>; + status = "disabled"; + }; + + vop_mmu: iommu@20053f00 { + compatible = "rockchip,iommu"; + reg = <0x20053f00 0x100>; + interrupts = ; + interrupt-names = "vop_mmu"; + iommu-cells = <0>; + status = "disabled"; + }; + + iep_mmu: iommu@20070800 { + compatible = "rockchip,iommu"; + reg = <0x20070800 0x100>; + interrupts = ; + interrupt-names = "iep_mmu"; + iommu-cells = <0>; + status = "disabled"; + }; + + sdmmc: dwmmc@30000000 { + compatible = "rockchip,rk3228-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0x30000000 0x4000>; + interrupts = ; + clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>, + <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; + clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; + fifo-depth = <0x100>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; + status = "disabled"; + }; + + sdio: dwmmc@30010000 { + compatible = "rockchip,rk3228-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0x30010000 0x4000>; + interrupts = ; + clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>, + <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; + clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; + fifo-depth = <0x100>; + pinctrl-names = "default"; + pinctrl-0 = <&sdio_clk &sdio_cmd &sdio_bus4>; + status = "disabled"; + }; + emmc: dwmmc@30020000 { - compatible = "rockchip,rk3288-dw-mshc"; + compatible = "rockchip,rk3228-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x30020000 0x4000>; interrupts = ; clock-frequency = <37500000>; @@ -511,7 +631,6 @@ clock-names = "biu", "ciu", "ciu_drv", "ciu_sample"; bus-width = <8>; default-sample-phase = <158>; - num-slots = <1>; fifo-depth = <0x100>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; @@ -710,6 +829,40 @@ drive-strength = <12>; }; + sdmmc { + sdmmc_clk: sdmmc-clk { + rockchip,pins = <1 RK_PC0 1 &pcfg_pull_none_drv_12ma>; + }; + + sdmmc_cmd: sdmmc-cmd { + rockchip,pins = <1 RK_PB7 1 &pcfg_pull_none_drv_12ma>; + }; + + sdmmc_bus4: sdmmc-bus4 { + rockchip,pins = <1 RK_PC2 1 &pcfg_pull_none_drv_12ma>, + <1 RK_PC3 1 &pcfg_pull_none_drv_12ma>, + <1 RK_PC4 1 &pcfg_pull_none_drv_12ma>, + <1 RK_PC5 1 &pcfg_pull_none_drv_12ma>; + }; + }; + + sdio { + sdio_clk: sdio-clk { + rockchip,pins = <3 RK_PA0 1 &pcfg_pull_none_drv_12ma>; + }; + + sdio_cmd: sdio-cmd { + rockchip,pins = <3 RK_PA1 1 &pcfg_pull_none_drv_12ma>; + }; + + sdio_bus4: sdio-bus4 { + rockchip,pins = <3 RK_PA2 1 &pcfg_pull_none_drv_12ma>, + <3 RK_PA3 1 &pcfg_pull_none_drv_12ma>, + <3 RK_PA4 1 &pcfg_pull_none_drv_12ma>, + <3 RK_PA5 1 &pcfg_pull_none_drv_12ma>; + }; + }; + emmc { emmc_clk: emmc-clk { rockchip,pins = <2 7 RK_FUNC_2 &pcfg_pull_none>; @@ -797,6 +950,42 @@ }; }; + spi-0 { + spi0_clk: spi0-clk { + rockchip,pins = <0 9 RK_FUNC_2 &pcfg_pull_up>; + }; + spi0_cs0: spi0-cs0 { + rockchip,pins = <0 14 RK_FUNC_2 &pcfg_pull_up>; + }; + spi0_tx: spi0-tx { + rockchip,pins = <0 11 RK_FUNC_2 &pcfg_pull_up>; + }; + spi0_rx: spi0-rx { + rockchip,pins = <0 13 RK_FUNC_2 &pcfg_pull_up>; + }; + spi0_cs1: spi0-cs1 { + rockchip,pins = <1 12 RK_FUNC_1 &pcfg_pull_up>; + }; + }; + + spi-1 { + spi1_clk: spi1-clk { + rockchip,pins = <0 23 RK_FUNC_2 &pcfg_pull_up>; + }; + spi1_cs0: spi1-cs0 { + rockchip,pins = <2 2 RK_FUNC_2 &pcfg_pull_up>; + }; + spi1_rx: spi1-rx { + rockchip,pins = <2 0 RK_FUNC_2 &pcfg_pull_up>; + }; + spi1_tx: spi1-tx { + rockchip,pins = <2 1 RK_FUNC_2 &pcfg_pull_up>; + }; + spi1_cs1: spi1-cs1 { + rockchip,pins = <2 3 RK_FUNC_2 &pcfg_pull_up>; + }; + }; + i2s1 { i2s1_bus: i2s1-bus { rockchip,pins = <0 8 RK_FUNC_1 &pcfg_pull_none>, @@ -835,6 +1024,12 @@ }; }; + spdif { + spdif_tx: spdif-tx { + rockchip,pins = <3 31 RK_FUNC_2 &pcfg_pull_none>; + }; + }; + tsadc { otp_gpio: otp-gpio { rockchip,pins = <0 24 RK_FUNC_GPIO &pcfg_pull_none>; diff --git a/src/arm/rk3288-evb.dtsi b/src/arm/rk3288-evb.dtsi index 0dec94c3583b..39b61dce97ad 100644 --- a/src/arm/rk3288-evb.dtsi +++ b/src/arm/rk3288-evb.dtsi @@ -45,7 +45,44 @@ / { memory@0 { device_type = "memory"; - reg = <0x0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; + }; + + adc-keys { + compatible = "adc-keys"; + io-channels = <&saradc 1>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1800000>; + + button-up { + label = "Volume Up"; + linux,code = ; + press-threshold-microvolt = <100000>; + }; + + button-down { + label = "Volume Down"; + linux,code = ; + press-threshold-microvolt = <300000>; + }; + + menu { + label = "Menu"; + linux,code = ; + press-threshold-microvolt = <640000>; + }; + + esc { + label = "Esc"; + linux,code = ; + press-threshold-microvolt = <1000000>; + }; + + home { + label = "Home"; + linux,code = ; + press-threshold-microvolt = <1300000>; + }; }; backlight: backlight { @@ -212,19 +249,22 @@ cap-mmc-highspeed; disable-wp; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>; status = "okay"; }; +&saradc { + vref-supply = <&vcc_18>; + status = "okay"; +}; + &sdmmc { bus-width = <4>; cap-mmc-highspeed; cap-sd-highspeed; card-detect-delay = <200>; disable-wp; /* wp not hooked up */ - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; status = "okay"; @@ -248,6 +288,11 @@ status = "ok"; }; +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + &hdmi { ddc-i2c-bus = <&i2c5>; status = "okay"; diff --git a/src/arm/rk3288-fennec.dts b/src/arm/rk3288-fennec.dts index 61d1c1028317..41405974253a 100644 --- a/src/arm/rk3288-fennec.dts +++ b/src/arm/rk3288-fennec.dts @@ -47,7 +47,7 @@ compatible = "rockchip,rk3288-fennec", "rockchip,rk3288"; memory@0 { - reg = <0x0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; device_type = "memory"; }; @@ -77,7 +77,6 @@ cap-mmc-highspeed; disable-wp; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>; status = "okay"; @@ -99,6 +98,11 @@ status = "okay"; }; +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + &hdmi { status = "okay"; }; diff --git a/src/arm/rk3288-firefly-reload-core.dtsi b/src/arm/rk3288-firefly-reload-core.dtsi index 813496618d08..5f05815f47e0 100644 --- a/src/arm/rk3288-firefly-reload-core.dtsi +++ b/src/arm/rk3288-firefly-reload-core.dtsi @@ -47,7 +47,7 @@ / { memory@0 { device_type = "memory"; - reg = <0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; }; ext_gmac: external-gmac-clock { @@ -78,7 +78,6 @@ mmc-ddr-1_8v; mmc-hs200-1_8v; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>; vmmc-supply = <&vcc_io>; diff --git a/src/arm/rk3288-firefly-reload.dts b/src/arm/rk3288-firefly-reload.dts index b11a282c334c..7da0947ababb 100644 --- a/src/arm/rk3288-firefly-reload.dts +++ b/src/arm/rk3288-firefly-reload.dts @@ -269,7 +269,6 @@ cap-sd-highspeed; card-detect-delay = <200>; disable-wp; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>; vmmc-supply = <&vcc_sd>; @@ -284,7 +283,6 @@ disable-wp; mmc-pwrseq = <&sdio_pwrseq>; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>, <&sdio0_int>; sd-uhs-sdr12; diff --git a/src/arm/rk3288-firefly.dtsi b/src/arm/rk3288-firefly.dtsi index 32dabae12e67..b9e6f3a97240 100644 --- a/src/arm/rk3288-firefly.dtsi +++ b/src/arm/rk3288-firefly.dtsi @@ -46,7 +46,7 @@ / { memory@0 { device_type = "memory"; - reg = <0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; }; adc-keys { @@ -208,7 +208,6 @@ cap-mmc-highspeed; disable-wp; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>; vmmc-supply = <&vcc_io>; @@ -527,7 +526,6 @@ bus-width = <4>; disable-wp; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>; vmmc-supply = <&vbat_wl>; @@ -541,7 +539,6 @@ cap-sd-highspeed; card-detect-delay = <200>; disable-wp; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>; vmmc-supply = <&vcc_sd>; diff --git a/src/arm/rk3288-miqi.dts b/src/arm/rk3288-miqi.dts index 30e93f694ae8..4d923aa6ed11 100644 --- a/src/arm/rk3288-miqi.dts +++ b/src/arm/rk3288-miqi.dts @@ -54,7 +54,7 @@ memory@0 { device_type = "memory"; - reg = <0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; }; ext_gmac: external-gmac-clock { @@ -126,7 +126,6 @@ cap-mmc-highspeed; disable-wp; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>; vmmc-supply = <&vcc_io>; @@ -404,7 +403,6 @@ cap-sd-highspeed; card-detect-delay = <200>; disable-wp; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>; vmmc-supply = <&vcc_sd>; diff --git a/src/arm/rk3288-phycore-rdk.dts b/src/arm/rk3288-phycore-rdk.dts index 3dda79579b51..1241cbcfc16f 100644 --- a/src/arm/rk3288-phycore-rdk.dts +++ b/src/arm/rk3288-phycore-rdk.dts @@ -263,7 +263,6 @@ cap-sd-highspeed; card-detect-delay = <200>; disable-wp; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; vmmc-supply = <&vdd_io_sd>; diff --git a/src/arm/rk3288-phycore-som.dtsi b/src/arm/rk3288-phycore-som.dtsi index 26cd3ad45160..99cfae875e12 100644 --- a/src/arm/rk3288-phycore-som.dtsi +++ b/src/arm/rk3288-phycore-som.dtsi @@ -55,7 +55,7 @@ */ memory { device_type = "memory"; - reg = <0 0x8000000>; + reg = <0x0 0x0 0x0 0x8000000>; }; aliases { @@ -136,7 +136,6 @@ cap-mmc-highspeed; disable-wp; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>; vmmc-supply = <&vdd_3v3_io>; diff --git a/src/arm/rk3288-popmetal.dts b/src/arm/rk3288-popmetal.dts index aa1f9ecff231..f084e0c8dcb3 100644 --- a/src/arm/rk3288-popmetal.dts +++ b/src/arm/rk3288-popmetal.dts @@ -50,7 +50,7 @@ memory@0 { device_type = "memory"; - reg = <0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; }; ext_gmac: external-gmac-clock { @@ -150,7 +150,6 @@ mmc-ddr-1_8v; mmc-hs200-1_8v; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>; vmmc-supply = <&vcc_io>; @@ -164,7 +163,6 @@ cap-sd-highspeed; card-detect-delay = <200>; disable-wp; /* wp not hooked up */ - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; sd-uhs-sdr12; diff --git a/src/arm/rk3288-r89.dts b/src/arm/rk3288-r89.dts index 1145b62edde7..e95215c9788b 100644 --- a/src/arm/rk3288-r89.dts +++ b/src/arm/rk3288-r89.dts @@ -50,7 +50,7 @@ memory@0 { device_type = "memory"; - reg = <0x0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; }; ext_gmac: external-gmac-clock { @@ -354,7 +354,6 @@ cap-sd-highspeed; card-detect-delay = <200>; disable-wp; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; vmmc-supply = <&vcc_sdmmc>; diff --git a/src/arm/rk3288-rock2-som.dtsi b/src/arm/rk3288-rock2-som.dtsi index 749a9b86e6e2..b9c471fcbd42 100644 --- a/src/arm/rk3288-rock2-som.dtsi +++ b/src/arm/rk3288-rock2-som.dtsi @@ -43,7 +43,7 @@ / { memory@0 { - reg = <0x0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; device_type = "memory"; }; @@ -89,7 +89,6 @@ cap-mmc-highspeed; disable-wp; non-removable; - num-slots = <1>; mmc-pwrseq = <&emmc_pwrseq>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; diff --git a/src/arm/rk3288-rock2-square.dts b/src/arm/rk3288-rock2-square.dts index 8ed25e9f60bc..0e084b8a86ac 100644 --- a/src/arm/rk3288-rock2-square.dts +++ b/src/arm/rk3288-rock2-square.dts @@ -147,7 +147,6 @@ disable-wp; mmc-pwrseq = <&sdio_pwrseq>; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>; vmmc-supply = <&vcc_io>; @@ -161,7 +160,6 @@ cap-sd-highspeed; card-detect-delay = <200>; disable-wp; /* wp not hooked up */ - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; vmmc-supply = <&vcc_sd>; diff --git a/src/arm/rk3288-tinker.dts b/src/arm/rk3288-tinker.dts index f601c78386a9..346b0d8b474d 100644 --- a/src/arm/rk3288-tinker.dts +++ b/src/arm/rk3288-tinker.dts @@ -50,7 +50,7 @@ compatible = "asus,rk3288-tinker", "rockchip,rk3288"; memory { - reg = <0x0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; device_type = "memory"; }; @@ -156,6 +156,11 @@ status = "ok"; }; +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + &hdmi { ddc-i2c-bus = <&i2c5>; status = "okay"; @@ -465,7 +470,6 @@ cap-sd-highspeed; card-detect-delay = <200>; disable-wp; /* wp not hooked up */ - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; status = "okay"; diff --git a/src/arm/rk3288-veyron-sdmmc.dtsi b/src/arm/rk3288-veyron-sdmmc.dtsi index aef07101e9ab..95e9bee8bca2 100644 --- a/src/arm/rk3288-veyron-sdmmc.dtsi +++ b/src/arm/rk3288-veyron-sdmmc.dtsi @@ -117,7 +117,6 @@ card-detect-delay = <200>; cd-gpios = <&gpio7 RK_PA5 GPIO_ACTIVE_LOW>; rockchip,default-sample-phase = <90>; - num-slots = <1>; sd-uhs-sdr12; sd-uhs-sdr25; sd-uhs-sdr50; diff --git a/src/arm/rk3288-veyron.dtsi b/src/arm/rk3288-veyron.dtsi index d709fa1847f9..6e5bd8974f22 100644 --- a/src/arm/rk3288-veyron.dtsi +++ b/src/arm/rk3288-veyron.dtsi @@ -49,7 +49,7 @@ / { memory@0 { device_type = "memory"; - reg = <0x0 0x80000000>; + reg = <0x0 0x0 0x0 0x80000000>; }; gpio_keys: gpio-keys { @@ -156,7 +156,6 @@ mmc-hs200-1_8v; mmc-pwrseq = <&emmc_pwrseq>; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; }; @@ -372,7 +371,6 @@ keep-power-in-suspend; mmc-pwrseq = <&sdio_pwrseq>; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_bus4>; sd-uhs-sdr12; diff --git a/src/arm/rk3288.dtsi b/src/arm/rk3288.dtsi index 858e1fed762a..356ed1e62452 100644 --- a/src/arm/rk3288.dtsi +++ b/src/arm/rk3288.dtsi @@ -49,8 +49,8 @@ #include / { - #address-cells = <1>; - #size-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; compatible = "rockchip,rk3288"; @@ -139,13 +139,13 @@ amba { compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; ranges; dmac_peri: dma-controller@ff250000 { compatible = "arm,pl330", "arm,primecell"; - reg = <0xff250000 0x4000>; + reg = <0x0 0xff250000 0x0 0x4000>; interrupts = , ; #dma-cells = <1>; @@ -156,7 +156,7 @@ dmac_bus_ns: dma-controller@ff600000 { compatible = "arm,pl330", "arm,primecell"; - reg = <0xff600000 0x4000>; + reg = <0x0 0xff600000 0x0 0x4000>; interrupts = , ; #dma-cells = <1>; @@ -168,7 +168,7 @@ dmac_bus_s: dma-controller@ffb20000 { compatible = "arm,pl330", "arm,primecell"; - reg = <0xffb20000 0x4000>; + reg = <0x0 0xffb20000 0x0 0x4000>; interrupts = , ; #dma-cells = <1>; @@ -179,8 +179,8 @@ }; reserved-memory { - #address-cells = <1>; - #size-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; ranges; /* @@ -194,7 +194,7 @@ * is found. */ dma-unusable@fe000000 { - reg = <0xfe000000 0x1000000>; + reg = <0x0 0xfe000000 0x0 0x1000000>; }; }; @@ -217,7 +217,7 @@ timer: timer@ff810000 { compatible = "rockchip,rk3288-timer"; - reg = <0xff810000 0x20>; + reg = <0x0 0xff810000 0x0 0x20>; interrupts = ; clocks = <&xin24m>, <&cru PCLK_TIMER>; clock-names = "timer", "pclk"; @@ -236,7 +236,7 @@ clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; interrupts = ; - reg = <0xff0c0000 0x4000>; + reg = <0x0 0xff0c0000 0x0 0x4000>; resets = <&cru SRST_MMC0>; reset-names = "reset"; status = "disabled"; @@ -250,7 +250,7 @@ clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; interrupts = ; - reg = <0xff0d0000 0x4000>; + reg = <0x0 0xff0d0000 0x0 0x4000>; resets = <&cru SRST_SDIO0>; reset-names = "reset"; status = "disabled"; @@ -264,7 +264,7 @@ clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; interrupts = ; - reg = <0xff0e0000 0x4000>; + reg = <0x0 0xff0e0000 0x0 0x4000>; resets = <&cru SRST_SDIO1>; reset-names = "reset"; status = "disabled"; @@ -278,7 +278,7 @@ clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; interrupts = ; - reg = <0xff0f0000 0x4000>; + reg = <0x0 0xff0f0000 0x0 0x4000>; resets = <&cru SRST_EMMC>; reset-names = "reset"; status = "disabled"; @@ -286,7 +286,7 @@ saradc: saradc@ff100000 { compatible = "rockchip,saradc"; - reg = <0xff100000 0x100>; + reg = <0x0 0xff100000 0x0 0x100>; interrupts = ; #io-channel-cells = <1>; clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>; @@ -305,7 +305,7 @@ interrupts = ; pinctrl-names = "default"; pinctrl-0 = <&spi0_clk &spi0_tx &spi0_rx &spi0_cs0>; - reg = <0xff110000 0x1000>; + reg = <0x0 0xff110000 0x0 0x1000>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -320,7 +320,7 @@ interrupts = ; pinctrl-names = "default"; pinctrl-0 = <&spi1_clk &spi1_tx &spi1_rx &spi1_cs0>; - reg = <0xff120000 0x1000>; + reg = <0x0 0xff120000 0x0 0x1000>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -335,7 +335,7 @@ interrupts = ; pinctrl-names = "default"; pinctrl-0 = <&spi2_clk &spi2_tx &spi2_rx &spi2_cs0>; - reg = <0xff130000 0x1000>; + reg = <0x0 0xff130000 0x0 0x1000>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -343,7 +343,7 @@ i2c1: i2c@ff140000 { compatible = "rockchip,rk3288-i2c"; - reg = <0xff140000 0x1000>; + reg = <0x0 0xff140000 0x0 0x1000>; interrupts = ; #address-cells = <1>; #size-cells = <0>; @@ -356,7 +356,7 @@ i2c3: i2c@ff150000 { compatible = "rockchip,rk3288-i2c"; - reg = <0xff150000 0x1000>; + reg = <0x0 0xff150000 0x0 0x1000>; interrupts = ; #address-cells = <1>; #size-cells = <0>; @@ -369,7 +369,7 @@ i2c4: i2c@ff160000 { compatible = "rockchip,rk3288-i2c"; - reg = <0xff160000 0x1000>; + reg = <0x0 0xff160000 0x0 0x1000>; interrupts = ; #address-cells = <1>; #size-cells = <0>; @@ -382,7 +382,7 @@ i2c5: i2c@ff170000 { compatible = "rockchip,rk3288-i2c"; - reg = <0xff170000 0x1000>; + reg = <0x0 0xff170000 0x0 0x1000>; interrupts = ; #address-cells = <1>; #size-cells = <0>; @@ -395,7 +395,7 @@ uart0: serial@ff180000 { compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart"; - reg = <0xff180000 0x100>; + reg = <0x0 0xff180000 0x0 0x100>; interrupts = ; reg-shift = <2>; reg-io-width = <4>; @@ -408,7 +408,7 @@ uart1: serial@ff190000 { compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart"; - reg = <0xff190000 0x100>; + reg = <0x0 0xff190000 0x0 0x100>; interrupts = ; reg-shift = <2>; reg-io-width = <4>; @@ -421,7 +421,7 @@ uart2: serial@ff690000 { compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart"; - reg = <0xff690000 0x100>; + reg = <0x0 0xff690000 0x0 0x100>; interrupts = ; reg-shift = <2>; reg-io-width = <4>; @@ -434,7 +434,7 @@ uart3: serial@ff1b0000 { compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart"; - reg = <0xff1b0000 0x100>; + reg = <0x0 0xff1b0000 0x0 0x100>; interrupts = ; reg-shift = <2>; reg-io-width = <4>; @@ -447,7 +447,7 @@ uart4: serial@ff1c0000 { compatible = "rockchip,rk3288-uart", "snps,dw-apb-uart"; - reg = <0xff1c0000 0x100>; + reg = <0x0 0xff1c0000 0x0 0x100>; interrupts = ; reg-shift = <2>; reg-io-width = <4>; @@ -535,7 +535,7 @@ tsadc: tsadc@ff280000 { compatible = "rockchip,rk3288-tsadc"; - reg = <0xff280000 0x100>; + reg = <0x0 0xff280000 0x0 0x100>; interrupts = ; clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>; clock-names = "tsadc", "apb_pclk"; @@ -552,7 +552,7 @@ gmac: ethernet@ff290000 { compatible = "rockchip,rk3288-gmac"; - reg = <0xff290000 0x10000>; + reg = <0x0 0xff290000 0x0 0x10000>; interrupts = , ; interrupt-names = "macirq", "eth_wake_irq"; @@ -572,7 +572,7 @@ usb_host0_ehci: usb@ff500000 { compatible = "generic-ehci"; - reg = <0xff500000 0x100>; + reg = <0x0 0xff500000 0x0 0x100>; interrupts = ; clocks = <&cru HCLK_USBHOST0>; clock-names = "usbhost"; @@ -586,7 +586,7 @@ usb_host1: usb@ff540000 { compatible = "rockchip,rk3288-usb", "rockchip,rk3066-usb", "snps,dwc2"; - reg = <0xff540000 0x40000>; + reg = <0x0 0xff540000 0x0 0x40000>; interrupts = ; clocks = <&cru HCLK_USBHOST1>; clock-names = "otg"; @@ -599,7 +599,7 @@ usb_otg: usb@ff580000 { compatible = "rockchip,rk3288-usb", "rockchip,rk3066-usb", "snps,dwc2"; - reg = <0xff580000 0x40000>; + reg = <0x0 0xff580000 0x0 0x40000>; interrupts = ; clocks = <&cru HCLK_OTG0>; clock-names = "otg"; @@ -614,7 +614,7 @@ usb_hsic: usb@ff5c0000 { compatible = "generic-ehci"; - reg = <0xff5c0000 0x100>; + reg = <0x0 0xff5c0000 0x0 0x100>; interrupts = ; clocks = <&cru HCLK_HSIC>; clock-names = "usbhost"; @@ -623,7 +623,7 @@ i2c0: i2c@ff650000 { compatible = "rockchip,rk3288-i2c"; - reg = <0xff650000 0x1000>; + reg = <0x0 0xff650000 0x0 0x1000>; interrupts = ; #address-cells = <1>; #size-cells = <0>; @@ -636,7 +636,7 @@ i2c2: i2c@ff660000 { compatible = "rockchip,rk3288-i2c"; - reg = <0xff660000 0x1000>; + reg = <0x0 0xff660000 0x0 0x1000>; interrupts = ; #address-cells = <1>; #size-cells = <0>; @@ -649,7 +649,7 @@ pwm0: pwm@ff680000 { compatible = "rockchip,rk3288-pwm"; - reg = <0xff680000 0x10>; + reg = <0x0 0xff680000 0x0 0x10>; #pwm-cells = <3>; pinctrl-names = "default"; pinctrl-0 = <&pwm0_pin>; @@ -660,7 +660,7 @@ pwm1: pwm@ff680010 { compatible = "rockchip,rk3288-pwm"; - reg = <0xff680010 0x10>; + reg = <0x0 0xff680010 0x0 0x10>; #pwm-cells = <3>; pinctrl-names = "default"; pinctrl-0 = <&pwm1_pin>; @@ -671,7 +671,7 @@ pwm2: pwm@ff680020 { compatible = "rockchip,rk3288-pwm"; - reg = <0xff680020 0x10>; + reg = <0x0 0xff680020 0x0 0x10>; #pwm-cells = <3>; pinctrl-names = "default"; pinctrl-0 = <&pwm2_pin>; @@ -682,7 +682,7 @@ pwm3: pwm@ff680030 { compatible = "rockchip,rk3288-pwm"; - reg = <0xff680030 0x10>; + reg = <0x0 0xff680030 0x0 0x10>; #pwm-cells = <2>; pinctrl-names = "default"; pinctrl-0 = <&pwm3_pin>; @@ -693,10 +693,10 @@ bus_intmem@ff700000 { compatible = "mmio-sram"; - reg = <0xff700000 0x18000>; + reg = <0x0 0xff700000 0x0 0x18000>; #address-cells = <1>; #size-cells = <1>; - ranges = <0 0xff700000 0x18000>; + ranges = <0 0x0 0xff700000 0x18000>; smp-sram@0 { compatible = "rockchip,rk3066-smp-sram"; reg = <0x00 0x10>; @@ -705,12 +705,12 @@ sram@ff720000 { compatible = "rockchip,rk3288-pmu-sram", "mmio-sram"; - reg = <0xff720000 0x1000>; + reg = <0x0 0xff720000 0x0 0x1000>; }; pmu: power-management@ff730000 { compatible = "rockchip,rk3288-pmu", "syscon", "simple-mfd"; - reg = <0xff730000 0x100>; + reg = <0x0 0xff730000 0x0 0x100>; power: power-controller { compatible = "rockchip,rk3288-power-controller"; @@ -831,12 +831,12 @@ sgrf: syscon@ff740000 { compatible = "rockchip,rk3288-sgrf", "syscon"; - reg = <0xff740000 0x1000>; + reg = <0x0 0xff740000 0x0 0x1000>; }; cru: clock-controller@ff760000 { compatible = "rockchip,rk3288-cru"; - reg = <0xff760000 0x1000>; + reg = <0x0 0xff760000 0x0 0x1000>; rockchip,grf = <&grf>; #clock-cells = <1>; #reset-cells = <1>; @@ -854,7 +854,7 @@ grf: syscon@ff770000 { compatible = "rockchip,rk3288-grf", "syscon", "simple-mfd"; - reg = <0xff770000 0x1000>; + reg = <0x0 0xff770000 0x0 0x1000>; edp_phy: edp-phy { compatible = "rockchip,rk3288-dp-phy"; @@ -903,7 +903,7 @@ wdt: watchdog@ff800000 { compatible = "rockchip,rk3288-wdt", "snps,dw-wdt"; - reg = <0xff800000 0x100>; + reg = <0x0 0xff800000 0x0 0x100>; clocks = <&cru PCLK_WDT>; interrupts = ; status = "disabled"; @@ -911,7 +911,7 @@ spdif: sound@ff88b0000 { compatible = "rockchip,rk3288-spdif", "rockchip,rk3066-spdif"; - reg = <0xff8b0000 0x10000>; + reg = <0x0 0xff8b0000 0x0 0x10000>; #sound-dai-cells = <0>; clock-names = "hclk", "mclk"; clocks = <&cru HCLK_SPDIF8CH>, <&cru SCLK_SPDIF8CH>; @@ -926,7 +926,7 @@ i2s: i2s@ff890000 { compatible = "rockchip,rk3288-i2s", "rockchip,rk3066-i2s"; - reg = <0xff890000 0x10000>; + reg = <0x0 0xff890000 0x0 0x10000>; interrupts = ; #address-cells = <1>; #size-cells = <0>; @@ -943,7 +943,7 @@ crypto: cypto-controller@ff8a0000 { compatible = "rockchip,rk3288-crypto"; - reg = <0xff8a0000 0x4000>; + reg = <0x0 0xff8a0000 0x0 0x4000>; interrupts = ; clocks = <&cru ACLK_CRYPTO>, <&cru HCLK_CRYPTO>, <&cru SCLK_CRYPTO>, <&cru ACLK_DMAC1>; @@ -953,9 +953,28 @@ status = "okay"; }; + iep_mmu: iommu@ff900800 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff900800 0x0 0x40>; + interrupts = ; + interrupt-names = "iep_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + isp_mmu: iommu@ff914000 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff914000 0x0 0x100>, <0x0 0xff915000 0x0 0x100>; + interrupts = ; + interrupt-names = "isp_mmu"; + #iommu-cells = <0>; + rockchip,disable-mmu-reset; + status = "disabled"; + }; + vopb: vop@ff930000 { compatible = "rockchip,rk3288-vop"; - reg = <0xff930000 0x19c>; + reg = <0x0 0xff930000 0x0 0x19c>; interrupts = ; clocks = <&cru ACLK_VOP0>, <&cru DCLK_VOP0>, <&cru HCLK_VOP0>; clock-names = "aclk_vop", "dclk_vop", "hclk_vop"; @@ -988,7 +1007,7 @@ vopb_mmu: iommu@ff930300 { compatible = "rockchip,iommu"; - reg = <0xff930300 0x100>; + reg = <0x0 0xff930300 0x0 0x100>; interrupts = ; interrupt-names = "vopb_mmu"; power-domains = <&power RK3288_PD_VIO>; @@ -998,7 +1017,7 @@ vopl: vop@ff940000 { compatible = "rockchip,rk3288-vop"; - reg = <0xff940000 0x19c>; + reg = <0x0 0xff940000 0x0 0x19c>; interrupts = ; clocks = <&cru ACLK_VOP1>, <&cru DCLK_VOP1>, <&cru HCLK_VOP1>; clock-names = "aclk_vop", "dclk_vop", "hclk_vop"; @@ -1031,7 +1050,7 @@ vopl_mmu: iommu@ff940300 { compatible = "rockchip,iommu"; - reg = <0xff940300 0x100>; + reg = <0x0 0xff940300 0x0 0x100>; interrupts = ; interrupt-names = "vopl_mmu"; power-domains = <&power RK3288_PD_VIO>; @@ -1041,7 +1060,7 @@ mipi_dsi: mipi@ff960000 { compatible = "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi"; - reg = <0xff960000 0x4000>; + reg = <0x0 0xff960000 0x0 0x4000>; interrupts = ; clocks = <&cru SCLK_MIPIDSI_24M>, <&cru PCLK_MIPI_DSI0>; clock-names = "ref", "pclk"; @@ -1069,7 +1088,7 @@ edp: dp@ff970000 { compatible = "rockchip,rk3288-dp"; - reg = <0xff970000 0x4000>; + reg = <0x0 0xff970000 0x0 0x4000>; interrupts = ; clocks = <&cru SCLK_EDP>, <&cru PCLK_EDP_CTRL>; clock-names = "dp", "pclk"; @@ -1101,7 +1120,7 @@ hdmi: hdmi@ff980000 { compatible = "rockchip,rk3288-dw-hdmi"; - reg = <0xff980000 0x20000>; + reg = <0x0 0xff980000 0x0 0x20000>; reg-io-width = <4>; rockchip,grf = <&grf>; interrupts = ; @@ -1126,9 +1145,27 @@ }; }; + vpu_mmu: iommu@ff9a0800 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff9a0800 0x0 0x100>; + interrupts = ; + interrupt-names = "vpu_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + hevc_mmu: iommu@ff9c0440 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff9c0440 0x0 0x40>, <0x0 0xff9c0480 0x0 0x40>; + interrupts = ; + interrupt-names = "hevc_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + gpu: gpu@ffa30000 { compatible = "rockchip,rk3288-mali", "arm,mali-t760"; - reg = <0xffa30000 0x10000>; + reg = <0x0 0xffa30000 0x0 0x10000>; interrupts = , , ; @@ -1170,72 +1207,72 @@ qos_gpu_r: qos@ffaa0000 { compatible = "syscon"; - reg = <0xffaa0000 0x20>; + reg = <0x0 0xffaa0000 0x0 0x20>; }; qos_gpu_w: qos@ffaa0080 { compatible = "syscon"; - reg = <0xffaa0080 0x20>; + reg = <0x0 0xffaa0080 0x0 0x20>; }; qos_vio1_vop: qos@ffad0000 { compatible = "syscon"; - reg = <0xffad0000 0x20>; + reg = <0x0 0xffad0000 0x0 0x20>; }; qos_vio1_isp_w0: qos@ffad0100 { compatible = "syscon"; - reg = <0xffad0100 0x20>; + reg = <0x0 0xffad0100 0x0 0x20>; }; qos_vio1_isp_w1: qos@ffad0180 { compatible = "syscon"; - reg = <0xffad0180 0x20>; + reg = <0x0 0xffad0180 0x0 0x20>; }; qos_vio0_vop: qos@ffad0400 { compatible = "syscon"; - reg = <0xffad0400 0x20>; + reg = <0x0 0xffad0400 0x0 0x20>; }; qos_vio0_vip: qos@ffad0480 { compatible = "syscon"; - reg = <0xffad0480 0x20>; + reg = <0x0 0xffad0480 0x0 0x20>; }; qos_vio0_iep: qos@ffad0500 { compatible = "syscon"; - reg = <0xffad0500 0x20>; + reg = <0x0 0xffad0500 0x0 0x20>; }; qos_vio2_rga_r: qos@ffad0800 { compatible = "syscon"; - reg = <0xffad0800 0x20>; + reg = <0x0 0xffad0800 0x0 0x20>; }; qos_vio2_rga_w: qos@ffad0880 { compatible = "syscon"; - reg = <0xffad0880 0x20>; + reg = <0x0 0xffad0880 0x0 0x20>; }; qos_vio1_isp_r: qos@ffad0900 { compatible = "syscon"; - reg = <0xffad0900 0x20>; + reg = <0x0 0xffad0900 0x0 0x20>; }; qos_video: qos@ffae0000 { compatible = "syscon"; - reg = <0xffae0000 0x20>; + reg = <0x0 0xffae0000 0x0 0x20>; }; qos_hevc_r: qos@ffaf0000 { compatible = "syscon"; - reg = <0xffaf0000 0x20>; + reg = <0x0 0xffaf0000 0x0 0x20>; }; qos_hevc_w: qos@ffaf0080 { compatible = "syscon"; - reg = <0xffaf0080 0x20>; + reg = <0x0 0xffaf0080 0x0 0x20>; }; gic: interrupt-controller@ffc01000 { @@ -1244,16 +1281,16 @@ #interrupt-cells = <3>; #address-cells = <0>; - reg = <0xffc01000 0x1000>, - <0xffc02000 0x2000>, - <0xffc04000 0x2000>, - <0xffc06000 0x2000>; + reg = <0x0 0xffc01000 0x0 0x1000>, + <0x0 0xffc02000 0x0 0x2000>, + <0x0 0xffc04000 0x0 0x2000>, + <0x0 0xffc06000 0x0 0x2000>; interrupts = ; }; efuse: efuse@ffb40000 { compatible = "rockchip,rk3288-efuse"; - reg = <0xffb40000 0x20>; + reg = <0x0 0xffb40000 0x0 0x20>; #address-cells = <1>; #size-cells = <1>; clocks = <&cru PCLK_EFUSE256>; @@ -1268,13 +1305,13 @@ compatible = "rockchip,rk3288-pinctrl"; rockchip,grf = <&grf>; rockchip,pmu = <&pmu>; - #address-cells = <1>; - #size-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; ranges; gpio0: gpio0@ff750000 { compatible = "rockchip,gpio-bank"; - reg = <0xff750000 0x100>; + reg = <0x0 0xff750000 0x0 0x100>; interrupts = ; clocks = <&cru PCLK_GPIO0>; @@ -1287,7 +1324,7 @@ gpio1: gpio1@ff780000 { compatible = "rockchip,gpio-bank"; - reg = <0xff780000 0x100>; + reg = <0x0 0xff780000 0x0 0x100>; interrupts = ; clocks = <&cru PCLK_GPIO1>; @@ -1300,7 +1337,7 @@ gpio2: gpio2@ff790000 { compatible = "rockchip,gpio-bank"; - reg = <0xff790000 0x100>; + reg = <0x0 0xff790000 0x0 0x100>; interrupts = ; clocks = <&cru PCLK_GPIO2>; @@ -1313,7 +1350,7 @@ gpio3: gpio3@ff7a0000 { compatible = "rockchip,gpio-bank"; - reg = <0xff7a0000 0x100>; + reg = <0x0 0xff7a0000 0x0 0x100>; interrupts = ; clocks = <&cru PCLK_GPIO3>; @@ -1326,7 +1363,7 @@ gpio4: gpio4@ff7b0000 { compatible = "rockchip,gpio-bank"; - reg = <0xff7b0000 0x100>; + reg = <0x0 0xff7b0000 0x0 0x100>; interrupts = ; clocks = <&cru PCLK_GPIO4>; @@ -1339,7 +1376,7 @@ gpio5: gpio5@ff7c0000 { compatible = "rockchip,gpio-bank"; - reg = <0xff7c0000 0x100>; + reg = <0x0 0xff7c0000 0x0 0x100>; interrupts = ; clocks = <&cru PCLK_GPIO5>; @@ -1352,7 +1389,7 @@ gpio6: gpio6@ff7d0000 { compatible = "rockchip,gpio-bank"; - reg = <0xff7d0000 0x100>; + reg = <0x0 0xff7d0000 0x0 0x100>; interrupts = ; clocks = <&cru PCLK_GPIO6>; @@ -1365,7 +1402,7 @@ gpio7: gpio7@ff7e0000 { compatible = "rockchip,gpio-bank"; - reg = <0xff7e0000 0x100>; + reg = <0x0 0xff7e0000 0x0 0x100>; interrupts = ; clocks = <&cru PCLK_GPIO7>; @@ -1378,7 +1415,7 @@ gpio8: gpio8@ff7f0000 { compatible = "rockchip,gpio-bank"; - reg = <0xff7f0000 0x100>; + reg = <0x0 0xff7f0000 0x0 0x100>; interrupts = ; clocks = <&cru PCLK_GPIO8>; diff --git a/src/arm/rv1108-evb.dts b/src/arm/rv1108-evb.dts index 58cf4ac079c3..86a57f823616 100644 --- a/src/arm/rv1108-evb.dts +++ b/src/arm/rv1108-evb.dts @@ -54,6 +54,184 @@ chosen { stdout-path = "serial2:1500000n8"; }; + + backlight: backlight { + compatible = "pwm-backlight"; + brightness-levels = < + 0 1 2 3 4 5 6 7 + 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 + 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 + 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 + 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 + 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 + 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 + 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 + 120 121 122 123 124 125 126 127 + 128 129 130 131 132 133 134 135 + 136 137 138 139 140 141 142 143 + 144 145 146 147 148 149 150 151 + 152 153 154 155 156 157 158 159 + 160 161 162 163 164 165 166 167 + 168 169 170 171 172 173 174 175 + 176 177 178 179 180 181 182 183 + 184 185 186 187 188 189 190 191 + 192 193 194 195 196 197 198 199 + 200 201 202 203 204 205 206 207 + 208 209 210 211 212 213 214 215 + 216 217 218 219 220 221 222 223 + 224 225 226 227 228 229 230 231 + 232 233 234 235 236 237 238 239 + 240 241 242 243 244 245 246 247 + 248 249 250 251 252 253 254 255>; + default-brightness-level = <200>; + pwms = <&pwm0 0 25000 0>; + }; + + vcc_sys: vsys-regulator { + compatible = "regulator-fixed"; + regulator-name = "vsys"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-boot-on; + }; +}; + +&cpu0 { + cpu-supply = <&vdd_core>; +}; + +&i2c0 { + status = "okay"; + i2c-scl-rising-time-ns = <275>; + i2c-scl-falling-time-ns = <16>; + clock-frequency = <400000>; + + rk805: pmic@18 { + compatible = "rockchip,rk805"; + reg = <0x18>; + interrupt-parent = <&gpio0>; + interrupts = ; + rockchip,system-power-controller; + + vcc1-supply = <&vcc_sys>; + vcc2-supply = <&vcc_sys>; + vcc3-supply = <&vcc_sys>; + vcc4-supply = <&vcc_sys>; + vcc5-supply = <&vcc_sys>; + vcc6-supply = <&vcc_sys>; + + regulators { + vdd_core: DCDC_REG1 { + regulator-name= "vdd_core"; + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <1500000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-state-enabled; + regulator-state-uv = <900000>; + }; + }; + + vdd_cam: DCDC_REG2 { + regulator-name= "vdd_cam"; + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <2000000>; + regulator-state-mem { + regulator-state-disabled; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name= "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-state-enabled; + }; + }; + + vcc_io: DCDC_REG4 { + regulator-name= "vcc_io"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-state-enabled; + regulator-state-uv = <3300000>; + }; + }; + + vdd_10: LDO_REG1 { + regulator-name= "vdd_10"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1000000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-state-disabled; + }; + }; + + vcc_18: LDO_REG2 { + regulator-name= "vcc_18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-state-disabled; + }; + }; + + vdd10_pmu: LDO_REG3 { + regulator-name= "vdd10_pmu"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1000000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-state-enabled; + regulator-state-uv = <1000000>; + }; + }; + }; + }; + + bma250: accelerometer@19 { + compatible = "bosch,bma250e"; + reg = <0x19>; + interrupt-parent = <&gpio0>; + interrupts = ; + }; +}; + +&pwm0 { + status = "okay"; +}; + +&sdmmc { + status = "okay"; +}; + +&u2phy { + status = "okay"; + + u2phy_host: host-port { + status = "okay"; + }; + + u2phy_otg: otg-port { + status = "okay"; + }; }; &uart0 { @@ -67,3 +245,15 @@ &uart2 { status = "okay"; }; + +&usb_host_ehci { + status = "okay"; +}; + +&usb_host_ohci { + status = "okay"; +}; + +&usb_otg { + status = "okay"; +}; diff --git a/src/arm/rv1108.dtsi b/src/arm/rv1108.dtsi index 437098b556eb..e7cd1315db1b 100644 --- a/src/arm/rv1108.dtsi +++ b/src/arm/rv1108.dtsi @@ -52,6 +52,10 @@ interrupt-parent = <&gic>; aliases { + i2c0 = &i2c0; + i2c1 = &i2c1; + i2c2 = &i2c2; + i2c3 = &i2c3; serial0 = &uart0; serial1 = &uart1; serial2 = &uart2; @@ -65,6 +69,33 @@ device_type = "cpu"; compatible = "arm,cortex-a7"; reg = <0xf00>; + clocks = <&cru ARMCLK>; + operating-points-v2 = <&cpu_opp_table>; + }; + }; + + cpu_opp_table: opp_table { + compatible = "operating-points-v2"; + + opp-408000000 { + opp-hz = /bits/ 64 <408000000>; + opp-microvolt = <975000>; + clock-latency-ns = <40000>; + }; + opp-600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <975000>; + clock-latency-ns = <40000>; + }; + opp-816000000 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <1025000>; + clock-latency-ns = <40000>; + }; + opp-1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1150000>; + clock-latency-ns = <40000>; }; }; @@ -154,9 +185,221 @@ status = "disabled"; }; + i2c1: i2c@10240000 { + compatible = "rockchip,rv1108-i2c"; + reg = <0x10240000 0x1000>; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&cru SCLK_I2C1>, <&cru PCLK_I2C1>; + clock-names = "i2c", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_xfer>; + rockchip,grf = <&grf>; + status = "disabled"; + }; + + i2c2: i2c@10250000 { + compatible = "rockchip,rv1108-i2c"; + reg = <0x10250000 0x1000>; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&cru SCLK_I2C2>, <&cru PCLK_I2C2>; + clock-names = "i2c", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c2m1_xfer>; + rockchip,grf = <&grf>; + status = "disabled"; + }; + + i2c3: i2c@10260000 { + compatible = "rockchip,rv1108-i2c"; + reg = <0x10260000 0x1000>; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&cru SCLK_I2C3>, <&cru PCLK_I2C3>; + clock-names = "i2c", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c3_xfer>; + rockchip,grf = <&grf>; + status = "disabled"; + }; + + spi: spi@10270000 { + compatible = "rockchip,rv1108-spi"; + reg = <0x10270000 0x1000>; + interrupts = ; + clocks = <&cru SCLK_SPI>, <&cru PCLK_SPI>; + clock-names = "spiclk", "apb_pclk"; + dmas = <&pdma 8>, <&pdma 9>; + #dma-cells = <2>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + pwm4: pwm@10280000 { + compatible = "rockchip,rv1108-pwm", "rockchip,rk3288-pwm"; + reg = <0x10280000 0x10>; + interrupts = ; + clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm4_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm5: pwm@10280010 { + compatible = "rockchip,rv1108-pwm", "rockchip,rk3288-pwm"; + reg = <0x10280010 0x10>; + interrupts = ; + clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm5_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm6: pwm@10280020 { + compatible = "rockchip,rv1108-pwm", "rockchip,rk3288-pwm"; + reg = <0x10280020 0x10>; + interrupts = ; + clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm6_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm7: pwm@10280030 { + compatible = "rockchip,rv1108-pwm", "rockchip,rk3288-pwm"; + reg = <0x10280030 0x10>; + interrupts = ; + clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm7_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + grf: syscon@10300000 { - compatible = "rockchip,rv1108-grf", "syscon"; + compatible = "rockchip,rv1108-grf", "syscon", "simple-mfd"; reg = <0x10300000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + + u2phy: usb2-phy@100 { + compatible = "rockchip,rv1108-usb2phy"; + reg = <0x100 0x0c>; + clocks = <&cru SCLK_USBPHY>; + clock-names = "phyclk"; + #clock-cells = <0>; + clock-output-names = "usbphy"; + rockchip,usbgrf = <&usbgrf>; + status = "disabled"; + + u2phy_otg: otg-port { + interrupts = ; + interrupt-names = "otg-mux"; + #phy-cells = <0>; + status = "disabled"; + }; + + u2phy_host: host-port { + interrupts = ; + interrupt-names = "linestate"; + #phy-cells = <0>; + status = "disabled"; + }; + }; + }; + + watchdog: wdt@10360000 { + compatible = "snps,dw-wdt"; + reg = <0x10360000 0x100>; + interrupts = ; + clocks = <&cru PCLK_WDT>; + clock-names = "pclk_wdt"; + status = "disabled"; + }; + + adc: adc@1038c000 { + compatible = "rockchip,rv1108-saradc", "rockchip,rk3399-saradc"; + reg = <0x1038c000 0x100>; + interrupts = ; + #io-channel-cells = <1>; + clock-frequency = <1000000>; + clocks = <&cru SCLK_SARADC>, <&cru PCLK_SARADC>; + clock-names = "saradc", "apb_pclk"; + status = "disabled"; + }; + + i2c0: i2c@20000000 { + compatible = "rockchip,rv1108-i2c"; + reg = <0x20000000 0x1000>; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&cru SCLK_I2C0_PMU>, <&cru PCLK_I2C0_PMU>; + clock-names = "i2c", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_xfer>; + rockchip,grf = <&grf>; + status = "disabled"; + }; + + pwm0: pwm@20040000 { + compatible = "rockchip,rv1108-pwm", "rockchip,rk3288-pwm"; + reg = <0x20040000 0x10>; + interrupts = ; + clocks = <&cru SCLK_PWM0_PMU>, <&cru PCLK_PWM0_PMU>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm1: pwm@20040010 { + compatible = "rockchip,rv1108-pwm", "rockchip,rk3288-pwm"; + reg = <0x20040010 0x10>; + interrupts = ; + clocks = <&cru SCLK_PWM0_PMU>, <&cru PCLK_PWM0_PMU>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm1_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm2: pwm@20040020 { + compatible = "rockchip,rv1108-pwm", "rockchip,rk3288-pwm"; + reg = <0x20040020 0x10>; + interrupts = ; + clocks = <&cru SCLK_PWM0_PMU>, <&cru PCLK_PWM0_PMU>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm2_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm3: pwm@20040030 { + compatible = "rockchip,rv1108-pwm", "rockchip,rk3288-pwm"; + reg = <0x20040030 0x10>; + interrupts = ; + clocks = <&cru SCLK_PWM0_PMU>, <&cru PCLK_PWM0_PMU>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm3_pin>; + #pwm-cells = <3>; + status = "disabled"; }; pmugrf: syscon@20060000 { @@ -164,6 +407,11 @@ reg = <0x20060000 0x1000>; }; + usbgrf: syscon@202a0000 { + compatible = "rockchip,rv1108-usbgrf", "syscon"; + reg = <0x202a0000 0x1000>; + }; + cru: clock-controller@20200000 { compatible = "rockchip,rv1108-cru"; reg = <0x20200000 0x1000>; @@ -174,37 +422,78 @@ emmc: dwmmc@30110000 { compatible = "rockchip,rv1108-dw-mshc", "rockchip,rk3288-dw-mshc"; - clock-freq-min-max = <400000 150000000>; + reg = <0x30110000 0x4000>; + interrupts = ; clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; - interrupts = ; - reg = <0x30110000 0x4000>; + max-frequency = <150000000>; status = "disabled"; }; sdio: dwmmc@30120000 { compatible = "rockchip,rv1108-dw-mshc", "rockchip,rk3288-dw-mshc"; - clock-freq-min-max = <400000 150000000>; + reg = <0x30120000 0x4000>; + interrupts = ; clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>, <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; - interrupts = ; - reg = <0x30120000 0x4000>; + max-frequency = <150000000>; status = "disabled"; }; sdmmc: dwmmc@30130000 { compatible = "rockchip,rv1108-dw-mshc", "rockchip,rk3288-dw-mshc"; - clock-freq-min-max = <400000 100000000>; + reg = <0x30130000 0x4000>; + interrupts = ; clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>, <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; - interrupts = ; - reg = <0x30130000 0x4000>; + max-frequency = <100000000>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; + status = "disabled"; + }; + + usb_host_ehci: usb@30140000 { + compatible = "generic-ehci"; + reg = <0x30140000 0x20000>; + interrupts = ; + clocks = <&cru HCLK_HOST0>, <&u2phy>; + clock-names = "usbhost", "utmi"; + phys = <&u2phy_host>; + phy-names = "usb"; + status = "disabled"; + }; + + usb_host_ohci: usb@30160000 { + compatible = "generic-ohci"; + reg = <0x30160000 0x20000>; + interrupts = ; + clocks = <&cru HCLK_HOST0>, <&u2phy>; + clock-names = "usbhost", "utmi"; + phys = <&u2phy_host>; + phy-names = "usb"; + status = "disabled"; + }; + + usb_otg: usb@30180000 { + compatible = "rockchip,rv1108-usb", "rockchip,rk3066-usb", + "snps,dwc2"; + reg = <0x30180000 0x40000>; + interrupts = ; + clocks = <&cru HCLK_OTG>; + clock-names = "otg"; + dr_mode = "otg"; + g-np-tx-fifo-size = <16>; + g-rx-fifo-size = <280>; + g-tx-fifo-size = <256 128 128 64 32 16>; + g-use-dma; + phys = <&u2phy_otg>; + phy-names = "usb2-phy"; status = "disabled"; }; @@ -301,6 +590,11 @@ drive-strength = <12>; }; + pcfg_pull_none_smt: pcfg-pull-none-smt { + bias-disable; + input-schmitt-enable; + }; + pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma { bias-pull-up; drive-strength = <8>; @@ -328,6 +622,13 @@ input-enable; }; + i2c0 { + i2c0_xfer: i2c0-xfer { + rockchip,pins = <0 RK_PB1 RK_FUNC_1 &pcfg_pull_none_smt>, + <0 RK_PB2 RK_FUNC_1 &pcfg_pull_none_smt>; + }; + }; + i2c1 { i2c1_xfer: i2c1-xfer { rockchip,pins = <2 RK_PD3 RK_FUNC_1 &pcfg_pull_up>, @@ -366,6 +667,54 @@ }; }; + pwm0 { + pwm0_pin: pwm0-pin { + rockchip,pins = <0 RK_PC5 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + pwm1 { + pwm1_pin: pwm1-pin { + rockchip,pins = <0 RK_PC4 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + pwm2 { + pwm2_pin: pwm2-pin { + rockchip,pins = <0 RK_PC6 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + pwm3 { + pwm3_pin: pwm3-pin { + rockchip,pins = <0 RK_PC0 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + + pwm4 { + pwm4_pin: pwm4-pin { + rockchip,pins = <1 RK_PC1 RK_FUNC_3 &pcfg_pull_none>; + }; + }; + + pwm5 { + pwm5_pin: pwm5-pin { + rockchip,pins = <1 RK_PA7 RK_FUNC_2 &pcfg_pull_none>; + }; + }; + + pwm6 { + pwm6_pin: pwm6-pin { + rockchip,pins = <1 RK_PB0 RK_FUNC_2 &pcfg_pull_none>; + }; + }; + + pwm7 { + pwm7_pin: pwm7-pin { + rockchip,pins = <1 RK_PB1 RK_FUNC_2 &pcfg_pull_none>; + }; + }; + sdmmc { sdmmc_clk: sdmmc-clk { rockchip,pins = <3 RK_PC4 RK_FUNC_1 &pcfg_pull_none_drv_4ma>; diff --git a/src/arm/sama5d2-pinfunc.h b/src/arm/sama5d2-pinfunc.h index 8a394f336003..e57191fb83de 100644 --- a/src/arm/sama5d2-pinfunc.h +++ b/src/arm/sama5d2-pinfunc.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #define PINMUX_PIN(no, func, ioset) \ (((no) & 0xffff) | (((func) & 0xf) << 16) | (((ioset) & 0xff) << 20)) diff --git a/src/arm/sama5d2.dtsi b/src/arm/sama5d2.dtsi index 60e69aeacbdb..b1a26b42d190 100644 --- a/src/arm/sama5d2.dtsi +++ b/src/arm/sama5d2.dtsi @@ -416,6 +416,17 @@ }; }; + isc: isc@f0008000 { + compatible = "atmel,sama5d2-isc"; + reg = <0xf0008000 0x4000>; + interrupts = <46 IRQ_TYPE_LEVEL_HIGH 5>; + clocks = <&isc_clk>, <&iscck>, <&isc_gclk>; + clock-names = "hclock", "iscck", "gck"; + #clock-cells = <0>; + clock-output-names = "isc-mck"; + status = "disabled"; + }; + ramc0: ramc@f000c000 { compatible = "atmel,sama5d3-ddramc"; reg = <0xf000c000 0x200>; @@ -494,6 +505,24 @@ clocks = <&plla>; }; + audio_pll_frac: audiopll_fracck { + compatible = "atmel,sama5d2-clk-audio-pll-frac"; + #clock-cells = <0>; + clocks = <&main>; + }; + + audio_pll_pad: audiopll_padck { + compatible = "atmel,sama5d2-clk-audio-pll-pad"; + #clock-cells = <0>; + clocks = <&audio_pll_frac>; + }; + + audio_pll_pmc: audiopll_pmcck { + compatible = "atmel,sama5d2-clk-audio-pll-pmc"; + #clock-cells = <0>; + clocks = <&audio_pll_frac>; + }; + utmi: utmick { compatible = "atmel,at91sam9x5-clk-utmi"; #clock-cells = <0>; @@ -895,7 +924,7 @@ #address-cells = <1>; #size-cells = <0>; interrupt-parent = <&pmc>; - clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>; + clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>, <&audio_pll_pmc>; sdmmc0_gclk: sdmmc0_gclk { #clock-cells = <0>; @@ -925,6 +954,11 @@ atmel,clk-output-range = <0 83000000>; }; + isc_gclk: isc_gclk { + #clock-cells = <0>; + reg = <46>; + }; + pdmic_gclk: pdmic_gclk { #clock-cells = <0>; reg = <48>; @@ -951,9 +985,37 @@ reg = <57>; atmel,clk-output-range = <0 80000000>; }; + + classd_gclk: classd_gclk { + #clock-cells = <0>; + reg = <59>; + atmel,clk-output-range = <0 100000000>; + }; }; }; + qspi0: spi@f0020000 { + compatible = "atmel,sama5d2-qspi"; + reg = <0xf0020000 0x100>, <0xd0000000 0x08000000>; + reg-names = "qspi_base", "qspi_mmap"; + interrupts = <52 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&qspi0_clk>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + qspi1: spi@f0024000 { + compatible = "atmel,sama5d2-qspi"; + reg = <0xf0024000 0x100>, <0xd8000000 0x08000000>; + reg-names = "qspi_base", "qspi_mmap"; + interrupts = <53 IRQ_TYPE_LEVEL_HIGH 7>; + clocks = <&qspi1_clk>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + sha@f0028000 { compatible = "atmel,at91sam9g46-sha"; reg = <0xf0028000 0x100>; @@ -1368,6 +1430,7 @@ atmel,min-sample-rate-hz = <200000>; atmel,max-sample-rate-hz = <20000000>; atmel,startup-time-ms = <4>; + atmel,trigger-edge-type = ; status = "disabled"; }; @@ -1406,6 +1469,19 @@ status = "okay"; }; + classd: classd@fc048000 { + compatible = "atmel,sama5d2-classd"; + reg = <0xfc048000 0x100>; + interrupts = <59 IRQ_TYPE_LEVEL_HIGH 7>; + dmas = <&dma0 + (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | + AT91_XDMAC_DT_PERID(47))>; + dma-names = "tx"; + clocks = <&classd_clk>, <&classd_gclk>; + clock-names = "pclk", "gclk"; + status = "disabled"; + }; + can1: can@fc050000 { compatible = "bosch,m_can"; reg = <0xfc050000 0x4000>, <0x210000 0x4000>; diff --git a/src/arm/samsung_k3pe0e000b.dtsi b/src/arm/samsung_k3pe0e000b.dtsi index 9657a5cbc3ad..dbdda36179ee 100644 --- a/src/arm/samsung_k3pe0e000b.dtsi +++ b/src/arm/samsung_k3pe0e000b.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Timings and Geometry for Samsung K3PE0E000B memory part */ diff --git a/src/arm/skeleton.dtsi b/src/arm/skeleton.dtsi index 28b81d60b407..34eda68d9ea2 100644 --- a/src/arm/skeleton.dtsi +++ b/src/arm/skeleton.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * This file is deprecated, and will be removed once existing users have been * updated. New dts{,i} files should *not* include skeleton.dtsi, and should diff --git a/src/arm/skeleton64.dtsi b/src/arm/skeleton64.dtsi index b5d7f36f33de..54e637752b9d 100644 --- a/src/arm/skeleton64.dtsi +++ b/src/arm/skeleton64.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Skeleton device tree in the 64 bits version; the bare minimum * needed to boot; just include and add a compatible value. The diff --git a/src/arm/spear1310.dtsi b/src/arm/spear1310.dtsi index 54bc6d3cf290..40f4ad3c34c6 100644 --- a/src/arm/spear1310.dtsi +++ b/src/arm/spear1310.dtsi @@ -98,6 +98,7 @@ device_type = "pci"; ranges = <0x81000000 0 0 0x80020000 0 0x00010000 /* downstream I/O */ 0x82000000 0 0x80030000 0xc0030000 0 0x0ffd0000>; /* non-prefetchable memory */ + bus-range = <0x00 0xff>; status = "disabled"; }; @@ -116,6 +117,7 @@ device_type = "pci"; ranges = <0x81000000 0 0 0x90020000 0 0x00010000 /* downstream I/O */ 0x82000000 0 0x90030000 0x90030000 0 0x0ffd0000>; /* non-prefetchable memory */ + bus-range = <0x00 0xff>; status = "disabled"; }; @@ -134,6 +136,7 @@ device_type = "pci"; ranges = <0x81000000 0 0 0xc0020000 0 0x00010000 /* downstream I/O */ 0x82000000 0 0xc0030000 0xc0030000 0 0x0ffd0000>; /* non-prefetchable memory */ + bus-range = <0x00 0xff>; status = "disabled"; }; diff --git a/src/arm/spear1340.dtsi b/src/arm/spear1340.dtsi index df2232d767ed..5f347054527d 100644 --- a/src/arm/spear1340.dtsi +++ b/src/arm/spear1340.dtsi @@ -63,6 +63,7 @@ device_type = "pci"; ranges = <0x81000000 0 0 0x80020000 0 0x00010000 /* downstream I/O */ 0x82000000 0 0x80030000 0xc0030000 0 0x0ffd0000>; /* non-prefetchable memory */ + bus-range = <0x00 0xff>; status = "disabled"; }; diff --git a/src/arm/st-pincfg.h b/src/arm/st-pincfg.h index 4851c387d52d..d80551202292 100644 --- a/src/arm/st-pincfg.h +++ b/src/arm/st-pincfg.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ST_PINCFG_H_ #define _ST_PINCFG_H_ diff --git a/src/arm/ste-dbx5x0.dtsi b/src/arm/ste-dbx5x0.dtsi index 6c5affe2d0f5..2310a4e97768 100644 --- a/src/arm/ste-dbx5x0.dtsi +++ b/src/arm/ste-dbx5x0.dtsi @@ -37,6 +37,14 @@ device_type = "cpu"; compatible = "arm,cortex-a9"; reg = <0x300>; + /* cpufreq controls */ + operating-points = <998400 0 + 800000 0 + 400000 0 + 200000 0>; + clocks = <&prcmu_clk PRCMU_ARMSS>; + clock-names = "cpu"; + clock-latency = <20000>; }; CPU1: cpu@301 { device_type = "cpu"; @@ -494,13 +502,6 @@ reg = <0x80157450 0xC>; }; - cpufreq { - compatible = "stericsson,cpufreq-ux500"; - clocks = <&prcmu_clk PRCMU_ARMSS>; - clock-names = "armss"; - status = "disabled"; - }; - thermal@801573c0 { compatible = "stericsson,db8500-thermal"; reg = <0x801573c0 0x40>; diff --git a/src/arm/ste-hrefprev60.dtsi b/src/arm/ste-hrefprev60.dtsi index 5882a2606ac3..3f14b4df69b4 100644 --- a/src/arm/ste-hrefprev60.dtsi +++ b/src/arm/ste-hrefprev60.dtsi @@ -30,7 +30,7 @@ i2c@80004000 { tps61052@33 { - compatible = "tps61052"; + compatible = "ti,tps61052"; reg = <0x33>; }; diff --git a/src/arm/ste-nomadik-nhk15.dts b/src/arm/ste-nomadik-nhk15.dts index 1ec46a794a4d..12afdc7467e7 100644 --- a/src/arm/ste-nomadik-nhk15.dts +++ b/src/arm/ste-nomadik-nhk15.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree for the ST-Ericsson Nomadik S8815 board * Produced by Calao Systems diff --git a/src/arm/ste-nomadik-s8815.dts b/src/arm/ste-nomadik-s8815.dts index 789329030658..4445446fa828 100644 --- a/src/arm/ste-nomadik-s8815.dts +++ b/src/arm/ste-nomadik-s8815.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree for the ST-Ericsson Nomadik S8815 board * Produced by Calao Systems diff --git a/src/arm/ste-nomadik-stn8815.dtsi b/src/arm/ste-nomadik-stn8815.dtsi index adb1c0998b81..68aab50a73ab 100644 --- a/src/arm/ste-nomadik-stn8815.dtsi +++ b/src/arm/ste-nomadik-stn8815.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree for the ST-Ericsson Nomadik 8815 STn8815 SoC */ diff --git a/src/arm/ste-u300.dts b/src/arm/ste-u300.dts index 2f5107ffeef0..62ecb6a2fa39 100644 --- a/src/arm/ste-u300.dts +++ b/src/arm/ste-u300.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Device Tree for the ST-Ericsson U300 Machine and SoC */ diff --git a/src/arm/stm32429i-eval.dts b/src/arm/stm32429i-eval.dts index dcda0bbefe5b..293ecb957227 100644 --- a/src/arm/stm32429i-eval.dts +++ b/src/arm/stm32429i-eval.dts @@ -47,6 +47,7 @@ /dts-v1/; #include "stm32f429.dtsi" +#include "stm32f429-pinctrl.dtsi" #include #include @@ -55,7 +56,7 @@ compatible = "st,stm32429i-eval", "st,stm32f429"; chosen { - bootargs = "root=/dev/ram rdinit=/linuxrc"; + bootargs = "root=/dev/ram"; stdout-path = "serial0:115200n8"; }; @@ -202,10 +203,8 @@ stmpe1600: stmpe1600@42 { compatible = "st,stmpe1600"; reg = <0x42>; - irq-gpio = <&gpioi 8 0>; - irq-trigger = <3>; interrupts = <8 3>; - interrupt-parent = <&exti>; + interrupt-parent = <&gpioi>; interrupt-controller; wakeup-source; diff --git a/src/arm/stm32f4-pinctrl.dtsi b/src/arm/stm32f4-pinctrl.dtsi new file mode 100644 index 000000000000..7f3560c0211d --- /dev/null +++ b/src/arm/stm32f4-pinctrl.dtsi @@ -0,0 +1,343 @@ +/* + * Copyright 2017 - Alexandre Torgue + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +#include + +/ { + soc { + pinctrl: pin-controller { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x40020000 0x3000>; + interrupt-parent = <&exti>; + st,syscfg = <&syscfg 0x8>; + pins-are-numbered; + + gpioa: gpio@40020000 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x0 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOA)>; + st,bank-name = "GPIOA"; + }; + + gpiob: gpio@40020400 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x400 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOB)>; + st,bank-name = "GPIOB"; + }; + + gpioc: gpio@40020800 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x800 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOC)>; + st,bank-name = "GPIOC"; + }; + + gpiod: gpio@40020c00 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0xc00 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOD)>; + st,bank-name = "GPIOD"; + }; + + gpioe: gpio@40021000 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x1000 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOE)>; + st,bank-name = "GPIOE"; + }; + + gpiof: gpio@40021400 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x1400 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOF)>; + st,bank-name = "GPIOF"; + }; + + gpiog: gpio@40021800 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x1800 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOG)>; + st,bank-name = "GPIOG"; + }; + + gpioh: gpio@40021c00 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x1c00 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOH)>; + st,bank-name = "GPIOH"; + }; + + gpioi: gpio@40022000 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x2000 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOI)>; + st,bank-name = "GPIOI"; + }; + + gpioj: gpio@40022400 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x2400 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOJ)>; + st,bank-name = "GPIOJ"; + }; + + gpiok: gpio@40022800 { + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x2800 0x400>; + clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOK)>; + st,bank-name = "GPIOK"; + }; + + usart1_pins_a: usart1@0 { + pins1 { + pinmux = ; + bias-disable; + drive-push-pull; + slew-rate = <0>; + }; + pins2 { + pinmux = ; + bias-disable; + }; + }; + + usart3_pins_a: usart3@0 { + pins1 { + pinmux = ; + bias-disable; + drive-push-pull; + slew-rate = <0>; + }; + pins2 { + pinmux = ; + bias-disable; + }; + }; + + usbotg_fs_pins_a: usbotg_fs@0 { + pins { + pinmux = , + , + ; + bias-disable; + drive-push-pull; + slew-rate = <2>; + }; + }; + + usbotg_fs_pins_b: usbotg_fs@1 { + pins { + pinmux = , + , + ; + bias-disable; + drive-push-pull; + slew-rate = <2>; + }; + }; + + usbotg_hs_pins_a: usbotg_hs@0 { + pins { + pinmux = , + , + , + , + , + , + , + , + , + , + , + ; + bias-disable; + drive-push-pull; + slew-rate = <2>; + }; + }; + + ethernet_mii: mii@0 { + pins { + pinmux = , + , + , + , + , + , + , + , + , + , + , + , + , + ; + slew-rate = <2>; + }; + }; + + adc3_in8_pin: adc@200 { + pins { + pinmux = ; + }; + }; + + pwm1_pins: pwm@1 { + pins { + pinmux = , + , + ; + }; + }; + + pwm3_pins: pwm@3 { + pins { + pinmux = , + ; + }; + }; + + i2c1_pins: i2c1@0 { + pins { + pinmux = , + ; + bias-disable; + drive-open-drain; + slew-rate = <3>; + }; + }; + + ltdc_pins: ltdc@0 { + pins { + pinmux = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + slew-rate = <2>; + }; + }; + + dcmi_pins: dcmi@0 { + pins { + pinmux = , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + bias-disable; + drive-push-pull; + slew-rate = <3>; + }; + }; + }; + }; +}; diff --git a/src/arm/stm32f429-disco.dts b/src/arm/stm32f429-disco.dts index ae47cde7952f..5ceb2cf3777f 100644 --- a/src/arm/stm32f429-disco.dts +++ b/src/arm/stm32f429-disco.dts @@ -47,6 +47,7 @@ /dts-v1/; #include "stm32f429.dtsi" +#include "stm32f429-pinctrl.dtsi" #include / { @@ -54,7 +55,7 @@ compatible = "st,stm32f429i-disco", "st,stm32f429"; chosen { - bootargs = "root=/dev/ram rdinit=/linuxrc"; + bootargs = "root=/dev/ram"; stdout-path = "serial0:115200n8"; }; diff --git a/src/arm/imx6ul-geam-kit.dts b/src/arm/stm32f429-pinctrl.dtsi similarity index 63% rename from src/arm/imx6ul-geam-kit.dts rename to src/arm/stm32f429-pinctrl.dtsi index 142e60cab65f..3e7a17d9112e 100644 --- a/src/arm/imx6ul-geam-kit.dts +++ b/src/arm/stm32f429-pinctrl.dtsi @@ -1,6 +1,5 @@ /* - * Copyright (C) 2016 Amarula Solutions B.V. - * Copyright (C) 2016 Engicam S.r.l. + * Copyright 2017 - Alexandre Torgue * * This file is dual-licensed: you can use it either under the terms * of the GPL or the X11 license, at your option. Note that this dual @@ -8,8 +7,9 @@ * whole. * * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2 as published by the Free Software Foundation. + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. * * This file is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -40,62 +40,56 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -/dts-v1/; - -#include -#include "imx6ul-geam.dtsi" +#include "stm32f4-pinctrl.dtsi" / { - model = "Engicam GEAM6UL"; - compatible = "engicam,imx6ul-geam", "fsl,imx6ul"; -}; + soc { + pinctrl: pin-controller { + compatible = "st,stm32f429-pinctrl"; -&can1 { - status = "okay"; -}; + gpioa: gpio@40020000 { + gpio-ranges = <&pinctrl 0 0 16>; + }; -&can2 { - status = "okay"; -}; + gpiob: gpio@40020400 { + gpio-ranges = <&pinctrl 0 16 16>; + }; -&lcdif { - display = <&display0>; - status = "okay"; + gpioc: gpio@40020800 { + gpio-ranges = <&pinctrl 0 32 16>; + }; - display0: display { - bits-per-pixel = <16>; - bus-width = <18>; - status = "okay"; + gpiod: gpio@40020c00 { + gpio-ranges = <&pinctrl 0 48 16>; + }; - display-timings { - native-mode = <&timing0>; - timing0: timing0 { - clock-frequency = <28000000>; - hactive = <800>; - vactive = <480>; - hfront-porch = <30>; - hback-porch = <30>; - hsync-len = <64>; - vback-porch = <5>; - vfront-porch = <5>; - vsync-len = <20>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <0>; + gpioe: gpio@40021000 { + gpio-ranges = <&pinctrl 0 64 16>; + }; + + gpiof: gpio@40021400 { + gpio-ranges = <&pinctrl 0 80 16>; + }; + + gpiog: gpio@40021800 { + gpio-ranges = <&pinctrl 0 96 16>; + }; + + gpioh: gpio@40021c00 { + gpio-ranges = <&pinctrl 0 112 16>; + }; + + gpioi: gpio@40022000 { + gpio-ranges = <&pinctrl 0 128 16>; + }; + + gpioj: gpio@40022400 { + gpio-ranges = <&pinctrl 0 144 16>; + }; + + gpiok: gpio@40022800 { + gpio-ranges = <&pinctrl 0 160 8>; }; }; }; }; - -&usdhc1 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_usdhc1>; - status = "okay"; -}; - -&tsc { - measure-delay-time = <0x1ffff>; - pre-charge-time = <0x1fff>; - status = "okay"; -}; diff --git a/src/arm/stm32f429.dtsi b/src/arm/stm32f429.dtsi index a8113dc879cf..5b36eb114ddc 100644 --- a/src/arm/stm32f429.dtsi +++ b/src/arm/stm32f429.dtsi @@ -47,7 +47,6 @@ #include "skeleton.dtsi" #include "armv7-m.dtsi" -#include #include #include @@ -361,6 +360,31 @@ status = "disabled"; }; + dac: dac@40007400 { + compatible = "st,stm32f4-dac-core"; + reg = <0x40007400 0x400>; + resets = <&rcc STM32F4_APB1_RESET(DAC)>; + clocks = <&rcc 0 STM32F4_APB1_CLOCK(DAC)>; + clock-names = "pclk"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + dac1: dac@1 { + compatible = "st,stm32-dac"; + #io-channels-cells = <1>; + reg = <1>; + status = "disabled"; + }; + + dac2: dac@2 { + compatible = "st,stm32-dac"; + #io-channels-cells = <1>; + reg = <2>; + status = "disabled"; + }; + }; + usart7: serial@40007800 { compatible = "st,stm32-usart", "st,stm32-uart"; reg = <0x40007800 0x400>; @@ -566,302 +590,6 @@ status = "disabled"; }; - pinctrl: pin-controller { - #address-cells = <1>; - #size-cells = <1>; - compatible = "st,stm32f429-pinctrl"; - ranges = <0 0x40020000 0x3000>; - interrupt-parent = <&exti>; - st,syscfg = <&syscfg 0x8>; - pins-are-numbered; - - gpioa: gpio@40020000 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x0 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOA)>; - st,bank-name = "GPIOA"; - }; - - gpiob: gpio@40020400 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x400 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOB)>; - st,bank-name = "GPIOB"; - }; - - gpioc: gpio@40020800 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x800 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOC)>; - st,bank-name = "GPIOC"; - }; - - gpiod: gpio@40020c00 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0xc00 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOD)>; - st,bank-name = "GPIOD"; - }; - - gpioe: gpio@40021000 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x1000 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOE)>; - st,bank-name = "GPIOE"; - }; - - gpiof: gpio@40021400 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x1400 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOF)>; - st,bank-name = "GPIOF"; - }; - - gpiog: gpio@40021800 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x1800 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOG)>; - st,bank-name = "GPIOG"; - }; - - gpioh: gpio@40021c00 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x1c00 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOH)>; - st,bank-name = "GPIOH"; - }; - - gpioi: gpio@40022000 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x2000 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOI)>; - st,bank-name = "GPIOI"; - }; - - gpioj: gpio@40022400 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x2400 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOJ)>; - st,bank-name = "GPIOJ"; - }; - - gpiok: gpio@40022800 { - gpio-controller; - #gpio-cells = <2>; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x2800 0x400>; - clocks = <&rcc 0 STM32F4_AHB1_CLOCK(GPIOK)>; - st,bank-name = "GPIOK"; - }; - - usart1_pins_a: usart1@0 { - pins1 { - pinmux = ; - bias-disable; - drive-push-pull; - slew-rate = <0>; - }; - pins2 { - pinmux = ; - bias-disable; - }; - }; - - usart3_pins_a: usart3@0 { - pins1 { - pinmux = ; - bias-disable; - drive-push-pull; - slew-rate = <0>; - }; - pins2 { - pinmux = ; - bias-disable; - }; - }; - - usbotg_fs_pins_a: usbotg_fs@0 { - pins { - pinmux = , - , - ; - bias-disable; - drive-push-pull; - slew-rate = <2>; - }; - }; - - usbotg_fs_pins_b: usbotg_fs@1 { - pins { - pinmux = , - , - ; - bias-disable; - drive-push-pull; - slew-rate = <2>; - }; - }; - - usbotg_hs_pins_a: usbotg_hs@0 { - pins { - pinmux = , - , - , - , - , - , - , - , - , - , - , - ; - bias-disable; - drive-push-pull; - slew-rate = <2>; - }; - }; - - ethernet_mii: mii@0 { - pins { - pinmux = , - , - , - , - , - , - , - , - , - , - , - , - , - ; - slew-rate = <2>; - }; - }; - - adc3_in8_pin: adc@200 { - pins { - pinmux = ; - }; - }; - - pwm1_pins: pwm@1 { - pins { - pinmux = , - , - ; - }; - }; - - pwm3_pins: pwm@3 { - pins { - pinmux = , - ; - }; - }; - - i2c1_pins: i2c1@0 { - pins { - pinmux = , - ; - bias-disable; - drive-open-drain; - slew-rate = <3>; - }; - }; - - ltdc_pins: ltdc@0 { - pins { - pinmux = , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - , - ; - slew-rate = <2>; - }; - }; - - dcmi_pins: dcmi@0 { - pins { - pinmux = , - , - , - , - , - , - , - , - , - , - , - , - , - , - ; - bias-disable; - drive-push-pull; - slew-rate = <3>; - }; - }; - }; - crc: crc@40023000 { compatible = "st,stm32f4-crc"; reg = <0x40023000 0x400>; diff --git a/src/arm/stm32f469-disco.dts b/src/arm/stm32f469-disco.dts index 75470c34b92c..c18acbe4cf4e 100644 --- a/src/arm/stm32f469-disco.dts +++ b/src/arm/stm32f469-disco.dts @@ -47,13 +47,14 @@ /dts-v1/; #include "stm32f429.dtsi" +#include "stm32f469-pinctrl.dtsi" / { model = "STMicroelectronics STM32F469i-DISCO board"; compatible = "st,stm32f469i-disco", "st,stm32f469"; chosen { - bootargs = "root=/dev/ram rdinit=/linuxrc"; + bootargs = "root=/dev/ram"; stdout-path = "serial0:115200n8"; }; diff --git a/src/arm/stm32f469-pinctrl.dtsi b/src/arm/stm32f469-pinctrl.dtsi new file mode 100644 index 000000000000..fff542662eea --- /dev/null +++ b/src/arm/stm32f469-pinctrl.dtsi @@ -0,0 +1,96 @@ +/* + * Copyright 2017 - Alexandre Torgue + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "stm32f4-pinctrl.dtsi" + +/ { + soc { + pinctrl: pin-controller { + compatible = "st,stm32f469-pinctrl"; + + gpioa: gpio@40020000 { + gpio-ranges = <&pinctrl 0 0 16>; + }; + + gpiob: gpio@40020400 { + gpio-ranges = <&pinctrl 0 16 16>; + }; + + gpioc: gpio@40020800 { + gpio-ranges = <&pinctrl 0 32 16>; + }; + + gpiod: gpio@40020c00 { + gpio-ranges = <&pinctrl 0 48 16>; + }; + + gpioe: gpio@40021000 { + gpio-ranges = <&pinctrl 0 64 16>; + }; + + gpiof: gpio@40021400 { + gpio-ranges = <&pinctrl 0 80 16>; + }; + + gpiog: gpio@40021800 { + gpio-ranges = <&pinctrl 0 96 16>; + }; + + gpioh: gpio@40021c00 { + gpio-ranges = <&pinctrl 0 112 16>; + }; + + gpioi: gpio@40022000 { + gpio-ranges = <&pinctrl 0 128 16>; + }; + + gpioj: gpio@40022400 { + gpio-ranges = <&pinctrl 0 144 6>, + <&pinctrl 12 156 4>; + }; + + gpiok: gpio@40022800 { + gpio-ranges = <&pinctrl 3 163 5>; + }; + }; + }; +}; diff --git a/src/arm/stm32f746.dtsi b/src/arm/stm32f746.dtsi index 4506eb97a4ab..5633860037d2 100644 --- a/src/arm/stm32f746.dtsi +++ b/src/arm/stm32f746.dtsi @@ -167,6 +167,15 @@ status = "disabled"; }; + cec: cec@40006c00 { + compatible = "st,stm32-cec"; + reg = <0x40006C00 0x400>; + interrupts = <94>; + clocks = <&rcc 0 STM32F7_APB1_CLOCK(CEC)>, <&rcc 1 CLK_HDMI_CEC>; + clock-names = "cec", "hdmi-cec"; + status = "disabled"; + }; + usart7: serial@40007800 { compatible = "st,stm32f7-usart", "st,stm32f7-uart"; reg = <0x40007800 0x400>; @@ -336,6 +345,15 @@ st,bank-name = "GPIOK"; }; + cec_pins_a: cec@0 { + pins { + pinmux = ; + slew-rate = <0>; + drive-open-drain; + bias-disable; + }; + }; + usart1_pins_a: usart1@0 { pins1 { pinmux = ; @@ -380,6 +398,39 @@ assigned-clocks = <&rcc 1 CLK_HSE_RTC>; assigned-clock-rates = <1000000>; }; + + dma1: dma@40026000 { + compatible = "st,stm32-dma"; + reg = <0x40026000 0x400>; + interrupts = <11>, + <12>, + <13>, + <14>, + <15>, + <16>, + <17>, + <47>; + clocks = <&rcc 0 STM32F7_AHB1_CLOCK(DMA1)>; + #dma-cells = <4>; + status = "disabled"; + }; + + dma2: dma@40026400 { + compatible = "st,stm32-dma"; + reg = <0x40026400 0x400>; + interrupts = <56>, + <57>, + <58>, + <59>, + <60>, + <68>, + <69>, + <70>; + clocks = <&rcc 0 STM32F7_AHB1_CLOCK(DMA2)>; + #dma-cells = <4>; + st,mem2mem; + status = "disabled"; + }; }; }; diff --git a/src/arm/stm32f769-disco.dts b/src/arm/stm32f769-disco.dts index 166728aeb166..4463ca13a740 100644 --- a/src/arm/stm32f769-disco.dts +++ b/src/arm/stm32f769-disco.dts @@ -63,6 +63,12 @@ }; +&cec { + pinctrl-0 = <&cec_pins_a>; + pinctrl-names = "default"; + status = "okay"; +}; + &clk_hse { clock-frequency = <25000000>; }; diff --git a/src/arm/stm32h743.dtsi b/src/arm/stm32h743.dtsi index 36a99db0a3b4..58ec2275181e 100644 --- a/src/arm/stm32h743.dtsi +++ b/src/arm/stm32h743.dtsi @@ -59,13 +59,11 @@ }; soc { - usart1: serial@40011000 { - compatible = "st,stm32f7-usart", "st,stm32f7-uart"; - reg = <0x40011000 0x400>; - interrupts = <37>; - status = "disabled"; + timer5: timer@40000c00 { + compatible = "st,stm32-timer"; + reg = <0x40000c00 0x400>; + interrupts = <50>; clocks = <&timer_clk>; - }; usart2: serial@40004400 { @@ -76,11 +74,124 @@ clocks = <&timer_clk>; }; - timer5: timer@40000c00 { - compatible = "st,stm32-timer"; - reg = <0x40000c00 0x400>; - interrupts = <50>; + dac: dac@40007400 { + compatible = "st,stm32h7-dac-core"; + reg = <0x40007400 0x400>; clocks = <&timer_clk>; + clock-names = "pclk"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + dac1: dac@1 { + compatible = "st,stm32-dac"; + #io-channels-cells = <1>; + reg = <1>; + status = "disabled"; + }; + + dac2: dac@2 { + compatible = "st,stm32-dac"; + #io-channels-cells = <1>; + reg = <2>; + status = "disabled"; + }; + }; + + usart1: serial@40011000 { + compatible = "st,stm32f7-usart", "st,stm32f7-uart"; + reg = <0x40011000 0x400>; + interrupts = <37>; + status = "disabled"; + clocks = <&timer_clk>; + + }; + + dma1: dma@40020000 { + compatible = "st,stm32-dma"; + reg = <0x40020000 0x400>; + interrupts = <11>, + <12>, + <13>, + <14>, + <15>, + <16>, + <17>, + <47>; + clocks = <&timer_clk>; + #dma-cells = <4>; + st,mem2mem; + status = "disabled"; + }; + + dma2: dma@40020400 { + compatible = "st,stm32-dma"; + reg = <0x40020400 0x400>; + interrupts = <56>, + <57>, + <58>, + <59>, + <60>, + <68>, + <69>, + <70>; + clocks = <&timer_clk>; + #dma-cells = <4>; + st,mem2mem; + status = "disabled"; + }; + + adc_12: adc@40022000 { + compatible = "st,stm32h7-adc-core"; + reg = <0x40022000 0x400>; + interrupts = <18>; + clocks = <&timer_clk>; + clock-names = "bus"; + interrupt-controller; + #interrupt-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + adc1: adc@0 { + compatible = "st,stm32h7-adc"; + #io-channel-cells = <1>; + reg = <0x0>; + interrupt-parent = <&adc_12>; + interrupts = <0>; + status = "disabled"; + }; + + adc2: adc@100 { + compatible = "st,stm32h7-adc"; + #io-channel-cells = <1>; + reg = <0x100>; + interrupt-parent = <&adc_12>; + interrupts = <1>; + status = "disabled"; + }; + }; + + adc_3: adc@58026000 { + compatible = "st,stm32h7-adc-core"; + reg = <0x58026000 0x400>; + interrupts = <127>; + clocks = <&timer_clk>; + clock-names = "bus"; + interrupt-controller; + #interrupt-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + adc3: adc@0 { + compatible = "st,stm32h7-adc"; + #io-channel-cells = <1>; + reg = <0x0>; + interrupt-parent = <&adc_3>; + interrupts = <0>; + status = "disabled"; + }; }; }; }; diff --git a/src/arm/stm32h743i-eval.dts b/src/arm/stm32h743i-eval.dts index c6effbb36e4a..6c07786e7ddb 100644 --- a/src/arm/stm32h743i-eval.dts +++ b/src/arm/stm32h743i-eval.dts @@ -60,6 +60,24 @@ aliases { serial0 = &usart1; }; + + vdda: regulator-vdda { + compatible = "regulator-fixed"; + regulator-name = "vdda"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; +}; + +&adc_12 { + vref-supply = <&vdda>; + status = "okay"; + adc1: adc@0 { + /* potentiometer */ + st,adc-channels = <0>; + status = "okay"; + }; }; &clk_hse { diff --git a/src/arm/sun6i-a31.dtsi b/src/arm/sun6i-a31.dtsi index aebc3f9dc7b6..eef072a21acc 100644 --- a/src/arm/sun6i-a31.dtsi +++ b/src/arm/sun6i-a31.dtsi @@ -311,8 +311,8 @@ #size-cells = <0>; reg = <0>; - tcon1_in_drc1: endpoint@0 { - reg = <0>; + tcon1_in_drc1: endpoint@1 { + reg = <1>; remote-endpoint = <&drc1_out_tcon1>; }; }; @@ -1012,8 +1012,8 @@ #size-cells = <0>; reg = <1>; - be1_out_drc1: endpoint@0 { - reg = <0>; + be1_out_drc1: endpoint@1 { + reg = <1>; remote-endpoint = <&drc1_in_be1>; }; }; @@ -1042,8 +1042,8 @@ #size-cells = <0>; reg = <0>; - drc1_in_be1: endpoint@0 { - reg = <0>; + drc1_in_be1: endpoint@1 { + reg = <1>; remote-endpoint = <&be1_out_drc1>; }; }; @@ -1053,8 +1053,8 @@ #size-cells = <0>; reg = <1>; - drc1_out_tcon1: endpoint@0 { - reg = <0>; + drc1_out_tcon1: endpoint@1 { + reg = <1>; remote-endpoint = <&tcon1_in_drc1>; }; }; @@ -1155,11 +1155,11 @@ ; }; - nmi_intc: interrupt-controller@01f00c0c { - compatible = "allwinner,sun6i-a31-sc-nmi"; + nmi_intc: interrupt-controller@1f00c00 { + compatible = "allwinner,sun6i-a31-r-intc"; interrupt-controller; #interrupt-cells = <2>; - reg = <0x01f00c0c 0x38>; + reg = <0x01f00c00 0x400>; interrupts = ; }; diff --git a/src/arm/sun7i-a20-cubietruck.dts b/src/arm/sun7i-a20-cubietruck.dts index bb510187602c..852a0aa24dce 100644 --- a/src/arm/sun7i-a20-cubietruck.dts +++ b/src/arm/sun7i-a20-cubietruck.dts @@ -271,6 +271,10 @@ status = "okay"; }; +&battery_power_supply { + status = "okay"; +}; + ®_dcdc2 { regulator-always-on; regulator-min-microvolt = <1000000>; diff --git a/src/arm/sun8i-a23-a33.dtsi b/src/arm/sun8i-a23-a33.dtsi index a8b978d0f35b..ea50dda75adc 100644 --- a/src/arm/sun8i-a23-a33.dtsi +++ b/src/arm/sun8i-a23-a33.dtsi @@ -519,11 +519,11 @@ #clock-cells = <1>; }; - nmi_intc: interrupt-controller@01f00c0c { - compatible = "allwinner,sun6i-a31-sc-nmi"; + nmi_intc: interrupt-controller@1f00c00 { + compatible = "allwinner,sun6i-a31-r-intc"; interrupt-controller; #interrupt-cells = <2>; - reg = <0x01f00c0c 0x38>; + reg = <0x01f00c00 0x400>; interrupts = ; }; diff --git a/src/arm/sun8i-a83t-allwinner-h8homlet-v2.dts b/src/arm/sun8i-a83t-allwinner-h8homlet-v2.dts index aecdeeb368ed..1f0d60afb25b 100644 --- a/src/arm/sun8i-a83t-allwinner-h8homlet-v2.dts +++ b/src/arm/sun8i-a83t-allwinner-h8homlet-v2.dts @@ -43,6 +43,7 @@ /dts-v1/; #include "sun8i-a83t.dtsi" +#include "sunxi-common-regulators.dtsi" / { model = "Allwinner A83T H8Homlet Proto Dev Board v2.0"; @@ -57,8 +58,92 @@ }; }; +&ehci0 { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_vcc3v0>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ + bus-width = <4>; + cd-inverted; + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_emmc_pins>; + vmmc-supply = <®_vcc3v0>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +®_usb0_vbus { + gpio = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */ + status = "okay"; +}; + +®_usb1_vbus { + gpio = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp81x: pmic@3a3 { + compatible = "x-powers,axp818", "x-powers,axp813"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; + + ac100: codec@e89 { + compatible = "x-powers,ac100"; + reg = <0xe89>; + + ac100_codec: codec { + compatible = "x-powers,ac100-codec"; + interrupt-parent = <&r_pio>; + interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */ + #clock-cells = <0>; + clock-output-names = "4M_adda"; + }; + + ac100_rtc: rtc { + compatible = "x-powers,ac100-rtc"; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + clocks = <&ac100_codec>; + #clock-cells = <1>; + clock-output-names = "cko1_rtc", + "cko2_rtc", + "cko3_rtc"; + }; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pb_pins>; status = "okay"; }; + +&usbphy { + usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "host"; + status = "okay"; +}; diff --git a/src/arm/sun8i-a83t-bananapi-m3.dts b/src/arm/sun8i-a83t-bananapi-m3.dts new file mode 100644 index 000000000000..2bafd7e99ef7 --- /dev/null +++ b/src/arm/sun8i-a83t-bananapi-m3.dts @@ -0,0 +1,148 @@ +/* + * Copyright 2017 Chen-Yu Tsai + * + * Chen-Yu Tsai + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "sun8i-a83t.dtsi" +#include "sunxi-common-regulators.dtsi" + +#include + +/ { + model = "Banana Pi BPI-M3"; + compatible = "sinovoip,bpi-m3", "allwinner,sun8i-a83t"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&ehci0 { + /* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */ + status = "okay"; + + /* TODO GL830 USB-to-SATA bridge downstream w/ GPIO power controls */ +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ + cd-inverted; + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_emmc_pins>; + vmmc-supply = <®_vcc3v3>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp81x: pmic@3a3 { + compatible = "x-powers,axp813"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; + + ac100: codec@e89 { + compatible = "x-powers,ac100"; + reg = <0xe89>; + + ac100_codec: codec { + compatible = "x-powers,ac100-codec"; + interrupt-parent = <&r_pio>; + interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */ + #clock-cells = <0>; + clock-output-names = "4M_adda"; + }; + + ac100_rtc: rtc { + compatible = "x-powers,ac100-rtc"; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + clocks = <&ac100_codec>; + #clock-cells = <1>; + clock-output-names = "cko1_rtc", + "cko2_rtc", + "cko3_rtc"; + }; + }; +}; + +®_usb1_vbus { + gpio = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ + status = "okay"; +}; + +®_vcc3v0 { + status = "disabled"; +}; + +®_vcc5v0 { + status = "disabled"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pb_pins>; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; diff --git a/src/arm/sun8i-a83t-cubietruck-plus.dts b/src/arm/sun8i-a83t-cubietruck-plus.dts index cff33454fc24..716a205c6dbb 100644 --- a/src/arm/sun8i-a83t-cubietruck-plus.dts +++ b/src/arm/sun8i-a83t-cubietruck-plus.dts @@ -44,6 +44,7 @@ /dts-v1/; #include "sun8i-a83t.dtsi" +#include "sunxi-common-regulators.dtsi" #include @@ -83,6 +84,17 @@ }; }; + usb-hub { + /* I2C is not connected */ + compatible = "smsc,usb3503"; + initial-mode = <1>; /* initialize in HUB mode */ + disabled-ports = <1>; + intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ + reset-gpios = <&pio 4 16 GPIO_ACTIVE_HIGH>; /* PE16 */ + connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */ + refclk-frequency = <19200000>; + }; + sound { compatible = "simple-audio-card"; simple-audio-card,name = "On-board SPDIF"; @@ -102,6 +114,89 @@ }; }; +&ehci0 { + /* GL830 USB-to-SATA bridge here */ + status = "okay"; +}; + +&ehci1 { + /* USB3503 HSIC USB 2.0 hub here */ + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ + cd-inverted; + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_emmc_pins>; + vmmc-supply = <®_vcc3v3>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp81x: pmic@3a3 { + compatible = "x-powers,axp818", "x-powers,axp813"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; + + ac100: codec@e89 { + compatible = "x-powers,ac100"; + reg = <0xe89>; + + ac100_codec: codec { + compatible = "x-powers,ac100-codec"; + interrupt-parent = <&r_pio>; + interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */ + #clock-cells = <0>; + clock-output-names = "4M_adda"; + }; + + ac100_rtc: rtc { + compatible = "x-powers,ac100-rtc"; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + clocks = <&ac100_codec>; + #clock-cells = <1>; + clock-output-names = "cko1_rtc", + "cko2_rtc", + "cko3_rtc"; + }; + }; +}; + +®_usb1_vbus { + gpio = <&pio 3 29 GPIO_ACTIVE_HIGH>; /* PD29 */ + status = "okay"; +}; + +®_usb2_vbus { + gpio = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */ + status = "okay"; +}; + +®_vcc3v0 { + status = "disabled"; +}; + +®_vcc5v0 { + status = "disabled"; +}; + &spdif { status = "okay"; }; @@ -111,3 +206,9 @@ pinctrl-0 = <&uart0_pb_pins>; status = "okay"; }; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +}; diff --git a/src/arm/sun8i-a83t.dtsi b/src/arm/sun8i-a83t.dtsi index 19a8f4fcfab5..f996bd343e50 100644 --- a/src/arm/sun8i-a83t.dtsi +++ b/src/arm/sun8i-a83t.dtsi @@ -47,6 +47,7 @@ #include #include #include +#include / { interrupt-parent = <&gic>; @@ -182,6 +183,141 @@ #dma-cells = <1>; }; + mmc0: mmc@1c0f000 { + compatible = "allwinner,sun8i-a83t-mmc", + "allwinner,sun7i-a20-mmc"; + reg = <0x01c0f000 0x1000>; + clocks = <&ccu CLK_BUS_MMC0>, + <&ccu CLK_MMC0>, + <&ccu CLK_MMC0_OUTPUT>, + <&ccu CLK_MMC0_SAMPLE>; + clock-names = "ahb", + "mmc", + "output", + "sample"; + resets = <&ccu RST_BUS_MMC0>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc1: mmc@1c10000 { + compatible = "allwinner,sun8i-a83t-mmc", + "allwinner,sun7i-a20-mmc"; + reg = <0x01c10000 0x1000>; + clocks = <&ccu CLK_BUS_MMC1>, + <&ccu CLK_MMC1>, + <&ccu CLK_MMC1_OUTPUT>, + <&ccu CLK_MMC1_SAMPLE>; + clock-names = "ahb", + "mmc", + "output", + "sample"; + resets = <&ccu RST_BUS_MMC1>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc2: mmc@1c11000 { + compatible = "allwinner,sun8i-a83t-emmc"; + reg = <0x01c11000 0x1000>; + clocks = <&ccu CLK_BUS_MMC2>, + <&ccu CLK_MMC2>, + <&ccu CLK_MMC2_OUTPUT>, + <&ccu CLK_MMC2_SAMPLE>; + clock-names = "ahb", + "mmc", + "output", + "sample"; + resets = <&ccu RST_BUS_MMC2>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + usb_otg: usb@01c19000 { + compatible = "allwinner,sun8i-a83t-musb", + "allwinner,sun8i-a33-musb"; + reg = <0x01c19000 0x0400>; + clocks = <&ccu CLK_BUS_OTG>; + resets = <&ccu RST_BUS_OTG>; + interrupts = ; + interrupt-names = "mc"; + phys = <&usbphy 0>; + phy-names = "usb"; + extcon = <&usbphy 0>; + status = "disabled"; + }; + + usbphy: phy@1c19400 { + compatible = "allwinner,sun8i-a83t-usb-phy"; + reg = <0x01c19400 0x10>, + <0x01c1a800 0x14>, + <0x01c1b800 0x14>; + reg-names = "phy_ctrl", + "pmu1", + "pmu2"; + clocks = <&ccu CLK_USB_PHY0>, + <&ccu CLK_USB_PHY1>, + <&ccu CLK_USB_HSIC>, + <&ccu CLK_USB_HSIC_12M>; + clock-names = "usb0_phy", + "usb1_phy", + "usb2_phy", + "usb2_hsic_12M"; + resets = <&ccu RST_USB_PHY0>, + <&ccu RST_USB_PHY1>, + <&ccu RST_USB_HSIC>; + reset-names = "usb0_reset", + "usb1_reset", + "usb2_reset"; + status = "disabled"; + #phy-cells = <1>; + }; + + ehci0: usb@1c1a000 { + compatible = "allwinner,sun8i-a83t-ehci", + "generic-ehci"; + reg = <0x01c1a000 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_EHCI0>; + resets = <&ccu RST_BUS_EHCI0>; + phys = <&usbphy 1>; + phy-names = "usb"; + status = "disabled"; + }; + + ohci0: usb@1c1a400 { + compatible = "allwinner,sun8i-a83t-ohci", + "generic-ohci"; + reg = <0x01c1a400 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_OHCI0>, <&ccu CLK_USB_OHCI0>; + resets = <&ccu RST_BUS_OHCI0>; + phys = <&usbphy 1>; + phy-names = "usb"; + status = "disabled"; + }; + + ehci1: usb@1c1b000 { + compatible = "allwinner,sun8i-a83t-ehci", + "generic-ehci"; + reg = <0x01c1b000 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_EHCI1>; + resets = <&ccu RST_BUS_EHCI1>; + phys = <&usbphy 2>; + phy-names = "usb"; + status = "disabled"; + }; + ccu: clock@1c20000 { compatible = "allwinner,sun8i-a83t-ccu"; reg = <0x01c20000 0x400>; @@ -212,6 +348,15 @@ bias-pull-up; }; + mmc2_8bit_emmc_pins: mmc2-8bit-emmc-pins { + pins = "PC5", "PC6", "PC8", "PC9", + "PC10", "PC11", "PC12", "PC13", + "PC14", "PC15", "PC16"; + function = "mmc2"; + drive-strength = <30>; + bias-pull-up; + }; + spdif_tx_pin: spdif-tx-pin { pins = "PE18"; function = "spdif"; @@ -281,6 +426,15 @@ interrupts = ; }; + r_intc: interrupt-controller@1f00c00 { + compatible = "allwinner,sun8i-a83t-r-intc", + "allwinner,sun6i-a31-r-intc"; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x01f00c00 0x400>; + interrupts = ; + }; + r_ccu: clock@1f01400 { compatible = "allwinner,sun8i-a83t-r-ccu"; reg = <0x01f01400 0x400>; @@ -302,6 +456,28 @@ #gpio-cells = <3>; interrupt-controller; #interrupt-cells = <3>; + + r_rsb_pins: r-rsb-pins { + pins = "PL0", "PL1"; + function = "s_rsb"; + drive-strength = <20>; + bias-pull-up; + }; + }; + + r_rsb: rsb@1f03400 { + compatible = "allwinner,sun8i-a83t-rsb", + "allwinner,sun8i-a23-rsb"; + reg = <0x01f03400 0x400>; + interrupts = ; + clocks = <&r_ccu CLK_APB0_RSB>; + clock-frequency = <3000000>; + resets = <&r_ccu RST_APB0_RSB>; + pinctrl-names = "default"; + pinctrl-0 = <&r_rsb_pins>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; }; }; }; diff --git a/src/arm/sun8i-h3-beelink-x2.dts b/src/arm/sun8i-h3-beelink-x2.dts index e7fae65eb5d3..10da56e86ab8 100644 --- a/src/arm/sun8i-h3-beelink-x2.dts +++ b/src/arm/sun8i-h3-beelink-x2.dts @@ -100,6 +100,10 @@ }; }; +&ehci0 { + status = "okay"; +}; + &ehci1 { status = "okay"; }; @@ -147,10 +151,19 @@ status = "okay"; }; +&ohci0 { + status = "okay"; +}; + &ohci1 { status = "okay"; }; +®_usb0_vbus { + gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */ + status = "okay"; +}; + &spdif { pinctrl-names = "default"; pinctrl-0 = <&spdif_tx_pins_a>; @@ -163,7 +176,14 @@ status = "okay"; }; -&usbphy { - /* USB VBUS is on as long as VCC-IO is on */ +&usb_otg { + dr_mode = "otg"; status = "okay"; }; + +&usbphy { + /* USB VBUS is always on except for the OTG port */ + status = "okay"; + usb0_id_det-gpios = <&pio 0 7 GPIO_ACTIVE_HIGH>; /* PA07 */ + usb0_vbus-supply = <®_usb0_vbus>; +}; diff --git a/src/arm/sun8i-r16-bananapi-m2m.dts b/src/arm/sun8i-r16-bananapi-m2m.dts new file mode 100644 index 000000000000..eaf09666720d --- /dev/null +++ b/src/arm/sun8i-r16-bananapi-m2m.dts @@ -0,0 +1,321 @@ +/* + * Copyright (c) 2017 Free Electrons + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "sun8i-a33.dtsi" + +#include + +/ { + model = "BananaPi M2 Magic"; + compatible = "sinovoip,bananapi-m2m", "allwinner,sun8i-a33"; + + aliases { + i2c0 = &i2c0; + i2c1 = &i2c1; + i2c2 = &i2c2; + serial0 = &uart0; + serial1 = &uart1; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + blue { + label = "bpi-m2m:blue:usr"; + gpios = <&pio 2 7 GPIO_ACTIVE_LOW>; + }; + + green { + label = "bpi-m2m:green:usr"; + gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; + }; + + red { + label = "bpi-m2m:red:power"; + gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + reg_vcc5v0: vcc5v0 { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL06 */ + }; +}; + +&codec { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <®_dcdc3>; +}; + +&cpu0_opp_table { + opp@1104000000 { + opp-hz = /bits/ 64 <1104000000>; + opp-microvolt = <1320000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp@1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <1320000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; +}; + +&dai { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +/* This is the i2c bus exposed on the DSI connector for the touch panel */ +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins_a>; + status = "disabled"; +}; + +/* This is the i2c bus exposed on the GPIO header */ +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; + status = "disabled"; +}; + +/* This is the i2c bus exposed on the CSI connector to control the sensor */ +&i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins_a>; + status = "disabled"; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>; + vmmc-supply = <®_dcdc1>; + bus-width = <4>; + cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ + cd-inverted; + status = "okay"; +}; + +&mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins_a>; + vmmc-supply = <®_aldo1>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; +}; + +&mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; + vmmc-supply = <®_dcdc1>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp22x: pmic@3a3 { + compatible = "x-powers,axp223"; + reg = <0x3a3>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + eldoin-supply = <®_dcdc1>; + x-powers,drive-vbus-en; + }; +}; + +#include "axp223.dtsi" + +&ac_power_supply { + status = "okay"; +}; + +®_aldo1 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-io"; +}; + +®_aldo2 { + regulator-always-on; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-name = "vdd-dll"; +}; + +®_aldo3 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "avcc"; +}; + +®_dc1sw { + regulator-name = "vcc-lcd"; +}; + +®_dc5ldo { + regulator-always-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-cpus"; +}; + +®_dcdc1 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-3v0"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-sys"; +}; + +®_dcdc3 { + regulator-always-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1400000>; + regulator-name = "vdd-cpu"; +}; + +®_dcdc5 { + regulator-always-on; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-name = "vcc-dram"; +}; + +/* + * Our WiFi chip needs both DLDO1 and DLDO2 to be powered at the same + * time, with the two being in sync. Since this is not really + * supported right now, just use the two as always on, and we will fix + * it later. + */ +®_dldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi0"; +}; + +®_dldo2 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi1"; +}; + +®_drivevbus { + regulator-name = "usb0-vbus"; + status = "okay"; +}; + +®_rtc_ldo { + regulator-name = "vcc-rtc"; +}; + +&sound { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_b>; + status = "okay"; +}; + +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins_a>, <&uart1_pins_cts_rts_a>; + status = "okay"; +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&usb_power_supply { + status = "okay"; +}; + +&usbphy { + usb0_id_det-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */ + usb0_vbus_power-supply = <&usb_power_supply>; + usb0_vbus-supply = <®_drivevbus>; + usb1_vbus-supply = <®_vcc5v0>; + status = "okay"; +}; diff --git a/src/arm/tango4-common.dtsi b/src/arm/tango4-common.dtsi index 0c8cad4d6ee6..12ab6e0c0331 100644 --- a/src/arm/tango4-common.dtsi +++ b/src/arm/tango4-common.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Based on Mans Rullgard's Tango3 DT * https://github.com/mansr/linux-tangox diff --git a/src/arm/tango4-smp8758.dtsi b/src/arm/tango4-smp8758.dtsi index d2e65c46bcc7..1c6a5bf1a86b 100644 --- a/src/arm/tango4-smp8758.dtsi +++ b/src/arm/tango4-smp8758.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "tango4-common.dtsi" / { @@ -13,7 +14,6 @@ reg = <0>; clocks = <&clkgen CPU_CLK>; clock-latency = <1>; - operating-points = <1215000 0 607500 0 405000 0 243000 0 135000 0>; }; cpu1: cpu@1 { diff --git a/src/arm/tango4-vantage-1172.dts b/src/arm/tango4-vantage-1172.dts index 13bcc460bcb2..d237d7f02c51 100644 --- a/src/arm/tango4-vantage-1172.dts +++ b/src/arm/tango4-vantage-1172.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tango4-smp8758.dtsi" diff --git a/src/arm/tegra114-dalmore.dts b/src/arm/tegra114-dalmore.dts index 1444fbd543e7..acd6cf51b15b 100644 --- a/src/arm/tegra114-dalmore.dts +++ b/src/arm/tegra114-dalmore.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * This dts file supports Dalmore A04. * Other board revisions are not supported @@ -1122,6 +1123,16 @@ non-removable; }; + usb@7d000000 { + compatible = "nvidia,tegra114-udc"; + status = "okay"; + dr_mode = "peripheral"; + }; + + usb-phy@7d000000 { + status = "okay"; + }; + usb@7d008000 { status = "okay"; }; diff --git a/src/arm/tegra114-roth.dts b/src/arm/tegra114-roth.dts index 966a7fc044af..7ed7370ee67a 100644 --- a/src/arm/tegra114-roth.dts +++ b/src/arm/tegra114-roth.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/tegra114-tn7.dts b/src/arm/tegra114-tn7.dts index a161fa1dfb61..7fc4a8b31e45 100644 --- a/src/arm/tegra114-tn7.dts +++ b/src/arm/tegra114-tn7.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/tegra114.dtsi b/src/arm/tegra114.dtsi index 8932ea3afd5f..0e4a13295d8a 100644 --- a/src/arm/tegra114.dtsi +++ b/src/arm/tegra114.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/src/arm/tegra124-jetson-tk1-emc.dtsi b/src/arm/tegra124-jetson-tk1-emc.dtsi index accb7055165a..784a529e1f19 100644 --- a/src/arm/tegra124-jetson-tk1-emc.dtsi +++ b/src/arm/tegra124-jetson-tk1-emc.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { clock@60006000 { emc-timings-3 { diff --git a/src/arm/tegra124-jetson-tk1.dts b/src/arm/tegra124-jetson-tk1.dts index 7bacb2954f58..e8e777b8ef1b 100644 --- a/src/arm/tegra124-jetson-tk1.dts +++ b/src/arm/tegra124-jetson-tk1.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include @@ -1722,7 +1723,7 @@ lanes { usb2-0 { - nvidia,function = "xusb"; + nvidia,function = "snps"; status = "okay"; }; @@ -1829,6 +1830,16 @@ }; }; + usb@7d000000 { + compatible = "nvidia,tegra124-udc"; + status = "okay"; + dr_mode = "peripheral"; + }; + + usb-phy@7d000000 { + status = "okay"; + }; + /* mini-PCIe USB */ usb@7d004000 { status = "okay"; diff --git a/src/arm/tegra124-nyan-big-emc.dtsi b/src/arm/tegra124-nyan-big-emc.dtsi index 4458e86b2769..9af21fe93a5c 100644 --- a/src/arm/tegra124-nyan-big-emc.dtsi +++ b/src/arm/tegra124-nyan-big-emc.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { clock@60006000 { emc-timings-1 { diff --git a/src/arm/tegra124-nyan-big.dts b/src/arm/tegra124-nyan-big.dts index 12eb7809d9ab..d97791b98958 100644 --- a/src/arm/tegra124-nyan-big.dts +++ b/src/arm/tegra124-nyan-big.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra124-nyan.dtsi" diff --git a/src/arm/tegra124-nyan-blaze-emc.dtsi b/src/arm/tegra124-nyan-blaze-emc.dtsi index 4e7b59e25728..c7c31d4c1a2b 100644 --- a/src/arm/tegra124-nyan-blaze-emc.dtsi +++ b/src/arm/tegra124-nyan-blaze-emc.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { clock@60006000 { emc-timings-1 { diff --git a/src/arm/tegra124-nyan-blaze.dts b/src/arm/tegra124-nyan-blaze.dts index 1078a73d5092..2a029ee86dd7 100644 --- a/src/arm/tegra124-nyan-blaze.dts +++ b/src/arm/tegra124-nyan-blaze.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra124-nyan.dtsi" diff --git a/src/arm/tegra124-nyan.dtsi b/src/arm/tegra124-nyan.dtsi index 5cf987b5401e..3609367037a6 100644 --- a/src/arm/tegra124-nyan.dtsi +++ b/src/arm/tegra124-nyan.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include "tegra124.dtsi" diff --git a/src/arm/tegra124-venice2.dts b/src/arm/tegra124-venice2.dts index 6e59cec0962b..32d9079f025b 100644 --- a/src/arm/tegra124-venice2.dts +++ b/src/arm/tegra124-venice2.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/tegra124.dtsi b/src/arm/tegra124.dtsi index 1b10b14a6abd..a7e43dcbf744 100644 --- a/src/arm/tegra124.dtsi +++ b/src/arm/tegra124.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include @@ -87,6 +88,7 @@ clocks = <&tegra_car TEGRA124_CLK_HOST1X>; resets = <&tegra_car 28>; reset-names = "host1x"; + iommus = <&mc TEGRA_SWGROUP_HC>; #address-cells = <2>; #size-cells = <2>; diff --git a/src/arm/tegra20-colibri-512.dtsi b/src/arm/tegra20-colibri-512.dtsi index 1242b841f147..813ae34edd6a 100644 --- a/src/arm/tegra20-colibri-512.dtsi +++ b/src/arm/tegra20-colibri-512.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "tegra20.dtsi" / { diff --git a/src/arm/tegra20-harmony.dts b/src/arm/tegra20-harmony.dts index 41749693ec3c..628a55a9318b 100644 --- a/src/arm/tegra20-harmony.dts +++ b/src/arm/tegra20-harmony.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/tegra20-iris-512.dts b/src/arm/tegra20-iris-512.dts index bb56dfe9e10c..40126388946d 100644 --- a/src/arm/tegra20-iris-512.dts +++ b/src/arm/tegra20-iris-512.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra20-colibri-512.dtsi" diff --git a/src/arm/tegra20-medcom-wide.dts b/src/arm/tegra20-medcom-wide.dts index 34c6588e92ef..cda5448c2ace 100644 --- a/src/arm/tegra20-medcom-wide.dts +++ b/src/arm/tegra20-medcom-wide.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra20-tamonten.dtsi" diff --git a/src/arm/tegra20-paz00.dts b/src/arm/tegra20-paz00.dts index b4bfa5586c23..30436969adc0 100644 --- a/src/arm/tegra20-paz00.dts +++ b/src/arm/tegra20-paz00.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include @@ -452,7 +453,9 @@ }; usb@c5000000 { + compatible = "nvidia,tegra20-udc"; status = "okay"; + dr_mode = "peripheral"; }; usb-phy@c5000000 { diff --git a/src/arm/tegra20-plutux.dts b/src/arm/tegra20-plutux.dts index a10b415bbdee..429e4605fbdb 100644 --- a/src/arm/tegra20-plutux.dts +++ b/src/arm/tegra20-plutux.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra20-tamonten.dtsi" diff --git a/src/arm/tegra20-seaboard.dts b/src/arm/tegra20-seaboard.dts index 2017acacc00c..284aae351ff2 100644 --- a/src/arm/tegra20-seaboard.dts +++ b/src/arm/tegra20-seaboard.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/tegra20-tamonten.dtsi b/src/arm/tegra20-tamonten.dtsi index 7361f4a82e80..872046d48709 100644 --- a/src/arm/tegra20-tamonten.dtsi +++ b/src/arm/tegra20-tamonten.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "tegra20.dtsi" / { diff --git a/src/arm/tegra20-tec.dts b/src/arm/tegra20-tec.dts index 9cb534f4441e..4dec27737238 100644 --- a/src/arm/tegra20-tec.dts +++ b/src/arm/tegra20-tec.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra20-tamonten.dtsi" diff --git a/src/arm/tegra20-trimslice.dts b/src/arm/tegra20-trimslice.dts index b902ab594afa..d55c6b240a30 100644 --- a/src/arm/tegra20-trimslice.dts +++ b/src/arm/tegra20-trimslice.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/tegra20-ventana.dts b/src/arm/tegra20-ventana.dts index 8f0aaabf7e28..ee3fbf941e79 100644 --- a/src/arm/tegra20-ventana.dts +++ b/src/arm/tegra20-ventana.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/tegra20.dtsi b/src/arm/tegra20.dtsi index 7c85f97f72ea..914f59166a99 100644 --- a/src/arm/tegra20.dtsi +++ b/src/arm/tegra20.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/src/arm/tegra30-apalis-eval.dts b/src/arm/tegra30-apalis-eval.dts index fc530e4a96c4..07b945b0391a 100644 --- a/src/arm/tegra30-apalis-eval.dts +++ b/src/arm/tegra30-apalis-eval.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm/tegra30-apalis.dtsi b/src/arm/tegra30-apalis.dtsi index 7a6a1a014603..faa8cd2914e8 100644 --- a/src/arm/tegra30-apalis.dtsi +++ b/src/arm/tegra30-apalis.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "tegra30.dtsi" /* diff --git a/src/arm/tegra30-beaver.dts b/src/arm/tegra30-beaver.dts index 4f41b18d9547..5331a8f7dcf8 100644 --- a/src/arm/tegra30-beaver.dts +++ b/src/arm/tegra30-beaver.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra30.dtsi" @@ -1927,6 +1928,16 @@ non-removable; }; + usb@7d000000 { + compatible = "nvidia,tegra30-udc"; + status = "okay"; + dr_mode = "peripheral"; + }; + + usb-phy@7d000000 { + status = "okay"; + }; + usb@7d004000 { status = "okay"; }; diff --git a/src/arm/tegra30-cardhu-a02.dts b/src/arm/tegra30-cardhu-a02.dts index c9bfedcca6ed..a02ec5082287 100644 --- a/src/arm/tegra30-cardhu-a02.dts +++ b/src/arm/tegra30-cardhu-a02.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra30-cardhu.dtsi" diff --git a/src/arm/tegra30-cardhu-a04.dts b/src/arm/tegra30-cardhu-a04.dts index fadf55e46b2b..4dbd4af679f0 100644 --- a/src/arm/tegra30-cardhu-a04.dts +++ b/src/arm/tegra30-cardhu-a04.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra30-cardhu.dtsi" diff --git a/src/arm/tegra30-cardhu.dtsi b/src/arm/tegra30-cardhu.dtsi index 83dc14a9b353..92a9740c533f 100644 --- a/src/arm/tegra30-cardhu.dtsi +++ b/src/arm/tegra30-cardhu.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include "tegra30.dtsi" diff --git a/src/arm/tegra30-colibri-eval-v3.dts b/src/arm/tegra30-colibri-eval-v3.dts index a8c0318743b6..3c5fb2430212 100644 --- a/src/arm/tegra30-colibri-eval-v3.dts +++ b/src/arm/tegra30-colibri-eval-v3.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra30-colibri.dtsi" diff --git a/src/arm/tegra30-colibri.dtsi b/src/arm/tegra30-colibri.dtsi index 5360d638eedc..139bfa028b04 100644 --- a/src/arm/tegra30-colibri.dtsi +++ b/src/arm/tegra30-colibri.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include "tegra30.dtsi" diff --git a/src/arm/tegra30.dtsi b/src/arm/tegra30.dtsi index 13960fda7471..c3e9f1e847db 100644 --- a/src/arm/tegra30.dtsi +++ b/src/arm/tegra30.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/src/arm/tps65217.dtsi b/src/arm/tps65217.dtsi index 02de56b55823..399baaa0a2ab 100644 --- a/src/arm/tps65217.dtsi +++ b/src/arm/tps65217.dtsi @@ -18,11 +18,14 @@ charger { compatible = "ti,tps65217-charger"; + interrupts = <0>, <1>; + interrupt-names = "USB", "AC"; status = "disabled"; }; pwrbutton { compatible = "ti,tps65217-pwrbutton"; + interrupts = <2>; status = "disabled"; }; diff --git a/src/arm/uniphier-ld4-ref.dts b/src/arm/uniphier-ld4-ref.dts index 4817ebb28eb2..b3aaab354f3e 100644 --- a/src/arm/uniphier-ld4-ref.dts +++ b/src/arm/uniphier-ld4-ref.dts @@ -8,9 +8,9 @@ */ /dts-v1/; -/include/ "uniphier-ld4.dtsi" -/include/ "uniphier-ref-daughter.dtsi" -/include/ "uniphier-support-card.dtsi" +#include "uniphier-ld4.dtsi" +#include "uniphier-ref-daughter.dtsi" +#include "uniphier-support-card.dtsi" / { model = "UniPhier LD4 Reference Board"; @@ -64,3 +64,7 @@ &usb1 { status = "okay"; }; + +&nand { + status = "okay"; +}; diff --git a/src/arm/uniphier-ld4.dtsi b/src/arm/uniphier-ld4.dtsi index fb2fd9605b9d..93586faf950f 100644 --- a/src/arm/uniphier-ld4.dtsi +++ b/src/arm/uniphier-ld4.dtsi @@ -209,7 +209,8 @@ interrupts = <0 80 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb0>; - clocks = <&mio_clk 7>, <&mio_clk 8>, <&mio_clk 12>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 8>, + <&mio_clk 12>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 8>, <&mio_rst 12>; }; @@ -221,7 +222,8 @@ interrupts = <0 81 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb1>; - clocks = <&mio_clk 7>, <&mio_clk 9>, <&mio_clk 13>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 9>, + <&mio_clk 13>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 9>, <&mio_rst 13>; }; @@ -233,7 +235,8 @@ interrupts = <0 82 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb2>; - clocks = <&mio_clk 7>, <&mio_clk 10>, <&mio_clk 14>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 10>, + <&mio_clk 14>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 10>, <&mio_rst 14>; }; @@ -270,6 +273,13 @@ interrupt-controller; }; + aidet: aidet@61830000 { + compatible = "socionext,uniphier-ld4-aidet"; + reg = <0x61830000 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + sysctrl@61840000 { compatible = "socionext,uniphier-ld4-sysctrl", "simple-mfd", "syscon"; @@ -285,7 +295,18 @@ #reset-cells = <1>; }; }; + + nand: nand@68000000 { + compatible = "socionext,uniphier-denali-nand-v5a"; + status = "disabled"; + reg-names = "nand_data", "denali_reg"; + reg = <0x68000000 0x20>, <0x68100000 0x1000>; + interrupts = <0 65 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_nand2cs>; + clocks = <&sys_clk 2>; + }; }; }; -/include/ "uniphier-pinctrl.dtsi" +#include "uniphier-pinctrl.dtsi" diff --git a/src/arm/uniphier-ld6b-ref.dts b/src/arm/uniphier-ld6b-ref.dts index 96db4abc02c3..2188d114d79b 100644 --- a/src/arm/uniphier-ld6b-ref.dts +++ b/src/arm/uniphier-ld6b-ref.dts @@ -8,9 +8,9 @@ */ /dts-v1/; -/include/ "uniphier-ld6b.dtsi" -/include/ "uniphier-ref-daughter.dtsi" -/include/ "uniphier-support-card.dtsi" +#include "uniphier-ld6b.dtsi" +#include "uniphier-ref-daughter.dtsi" +#include "uniphier-support-card.dtsi" / { model = "UniPhier LD6b Reference Board"; @@ -58,3 +58,7 @@ &i2c0 { status = "okay"; }; + +&nand { + status = "okay"; +}; diff --git a/src/arm/uniphier-ld6b.dtsi b/src/arm/uniphier-ld6b.dtsi index 8b9a79731bd3..9a7b25cc8233 100644 --- a/src/arm/uniphier-ld6b.dtsi +++ b/src/arm/uniphier-ld6b.dtsi @@ -12,7 +12,7 @@ * The D-chip (digital chip) is the same as the PXs2 die. * Reuse the PXs2 device tree with some properties overridden. */ -/include/ "uniphier-pxs2.dtsi" +#include "uniphier-pxs2.dtsi" / { compatible = "socionext,uniphier-ld6b"; diff --git a/src/arm/uniphier-pinctrl.dtsi b/src/arm/uniphier-pinctrl.dtsi index 246f35ffb638..be82cddc4072 100644 --- a/src/arm/uniphier-pinctrl.dtsi +++ b/src/arm/uniphier-pinctrl.dtsi @@ -4,51 +4,35 @@ * Copyright (C) 2015-2017 Socionext Inc. * Author: Masahiro Yamada * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ &pinctrl { + pinctrl_aout: aout_grp { + groups = "aout"; + function = "aout"; + }; + pinctrl_emmc: emmc_grp { groups = "emmc", "emmc_dat8"; function = "emmc"; }; + pinctrl_ether_mii: ether_mii_grp { + groups = "ether_mii"; + function = "ether_mii"; + }; + + pinctrl_ether_rgmii: ether_rgmii_grp { + groups = "ether_rgmii"; + function = "ether_rgmii"; + }; + + pinctrl_ether_rmii: ether_rmii_grp { + groups = "ether_rmii"; + function = "ether_rmii"; + }; + pinctrl_i2c0: i2c0_grp { groups = "i2c0"; function = "i2c0"; diff --git a/src/arm/uniphier-pro4-ace.dts b/src/arm/uniphier-pro4-ace.dts index 11690b57931c..089419cee273 100644 --- a/src/arm/uniphier-pro4-ace.dts +++ b/src/arm/uniphier-pro4-ace.dts @@ -8,7 +8,7 @@ */ /dts-v1/; -/include/ "uniphier-pro4.dtsi" +#include "uniphier-pro4.dtsi" / { model = "UniPhier Pro4 Ace Board"; diff --git a/src/arm/uniphier-pro4-ref.dts b/src/arm/uniphier-pro4-ref.dts index 4cf539245f2e..903df6348e77 100644 --- a/src/arm/uniphier-pro4-ref.dts +++ b/src/arm/uniphier-pro4-ref.dts @@ -8,9 +8,9 @@ */ /dts-v1/; -/include/ "uniphier-pro4.dtsi" -/include/ "uniphier-ref-daughter.dtsi" -/include/ "uniphier-support-card.dtsi" +#include "uniphier-pro4.dtsi" +#include "uniphier-ref-daughter.dtsi" +#include "uniphier-support-card.dtsi" / { model = "UniPhier Pro4 Reference Board"; @@ -66,3 +66,7 @@ &usb3 { status = "okay"; }; + +&nand { + status = "okay"; +}; diff --git a/src/arm/uniphier-pro4-sanji.dts b/src/arm/uniphier-pro4-sanji.dts index 2763cebcd76a..adef212b45b2 100644 --- a/src/arm/uniphier-pro4-sanji.dts +++ b/src/arm/uniphier-pro4-sanji.dts @@ -8,7 +8,7 @@ */ /dts-v1/; -/include/ "uniphier-pro4.dtsi" +#include "uniphier-pro4.dtsi" / { model = "UniPhier Pro4 Sanji Board"; diff --git a/src/arm/uniphier-pro4.dtsi b/src/arm/uniphier-pro4.dtsi index 37400becf4ba..2a9bd7f9f5db 100644 --- a/src/arm/uniphier-pro4.dtsi +++ b/src/arm/uniphier-pro4.dtsi @@ -241,7 +241,8 @@ interrupts = <0 80 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb2>; - clocks = <&mio_clk 7>, <&mio_clk 8>, <&mio_clk 12>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 8>, + <&mio_clk 12>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 8>, <&mio_rst 12>; }; @@ -253,7 +254,8 @@ interrupts = <0 81 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb3>; - clocks = <&mio_clk 7>, <&mio_clk 9>, <&mio_clk 13>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 9>, + <&mio_clk 13>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 9>, <&mio_rst 13>; }; @@ -268,6 +270,13 @@ }; }; + aidet: aidet@5fc20000 { + compatible = "socionext,uniphier-pro4-aidet"; + reg = <0x5fc20000 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + timer@60000200 { compatible = "arm,cortex-a9-global-timer"; reg = <0x60000200 0x20>; @@ -305,7 +314,18 @@ #reset-cells = <1>; }; }; + + nand: nand@68000000 { + compatible = "socionext,uniphier-denali-nand-v5a"; + status = "disabled"; + reg-names = "nand_data", "denali_reg"; + reg = <0x68000000 0x20>, <0x68100000 0x1000>; + interrupts = <0 65 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_nand>; + clocks = <&sys_clk 2>; + }; }; }; -/include/ "uniphier-pinctrl.dtsi" +#include "uniphier-pinctrl.dtsi" diff --git a/src/arm/uniphier-pro5.dtsi b/src/arm/uniphier-pro5.dtsi index 9577769a0add..b026bcd42a06 100644 --- a/src/arm/uniphier-pro5.dtsi +++ b/src/arm/uniphier-pro5.dtsi @@ -4,43 +4,7 @@ * Copyright (C) 2015-2016 Socionext Inc. * Author: Masahiro Yamada * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ / { @@ -328,7 +292,7 @@ sdctrl@59810000 { compatible = "socionext,uniphier-pro5-sdctrl", "simple-mfd", "syscon"; - reg = <0x59810000 0x800>; + reg = <0x59810000 0x400>; sd_clk: clock { compatible = "socionext,uniphier-pro5-sd-clock"; @@ -367,6 +331,13 @@ }; }; + aidet: aidet@5fc20000 { + compatible = "socionext,uniphier-pro5-aidet"; + reg = <0x5fc20000 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + timer@60000200 { compatible = "arm,cortex-a9-global-timer"; reg = <0x60000200 0x20>; @@ -404,7 +375,18 @@ #reset-cells = <1>; }; }; + + nand: nand@68000000 { + compatible = "socionext,uniphier-denali-nand-v5b"; + status = "disabled"; + reg-names = "nand_data", "denali_reg"; + reg = <0x68000000 0x20>, <0x68100000 0x1000>; + interrupts = <0 65 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_nand2cs>; + clocks = <&sys_clk 2>; + }; }; }; -/include/ "uniphier-pinctrl.dtsi" +#include "uniphier-pinctrl.dtsi" diff --git a/src/arm/uniphier-pxs2-gentil.dts b/src/arm/uniphier-pxs2-gentil.dts index 81560f75bfa7..7dfae2667f50 100644 --- a/src/arm/uniphier-pxs2-gentil.dts +++ b/src/arm/uniphier-pxs2-gentil.dts @@ -8,7 +8,7 @@ */ /dts-v1/; -/include/ "uniphier-pxs2.dtsi" +#include "uniphier-pxs2.dtsi" / { model = "UniPhier PXs2 Gentil Board"; diff --git a/src/arm/uniphier-pxs2-vodka.dts b/src/arm/uniphier-pxs2-vodka.dts index dc2d0579c666..0cf615463a82 100644 --- a/src/arm/uniphier-pxs2-vodka.dts +++ b/src/arm/uniphier-pxs2-vodka.dts @@ -8,7 +8,7 @@ */ /dts-v1/; -/include/ "uniphier-pxs2.dtsi" +#include "uniphier-pxs2.dtsi" / { model = "UniPhier PXs2 Vodka Board"; diff --git a/src/arm/uniphier-pxs2.dtsi b/src/arm/uniphier-pxs2.dtsi index bace751d4023..90b020c95083 100644 --- a/src/arm/uniphier-pxs2.dtsi +++ b/src/arm/uniphier-pxs2.dtsi @@ -276,7 +276,7 @@ sdctrl@59810000 { compatible = "socionext,uniphier-pxs2-sdctrl", "simple-mfd", "syscon"; - reg = <0x59810000 0x800>; + reg = <0x59810000 0x400>; sd_clk: clock { compatible = "socionext,uniphier-pxs2-sd-clock"; @@ -315,6 +315,13 @@ }; }; + aidet: aidet@5fc20000 { + compatible = "socionext,uniphier-pxs2-aidet"; + reg = <0x5fc20000 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + timer@60000200 { compatible = "arm,cortex-a9-global-timer"; reg = <0x60000200 0x20>; @@ -352,7 +359,18 @@ #reset-cells = <1>; }; }; + + nand: nand@68000000 { + compatible = "socionext,uniphier-denali-nand-v5b"; + status = "disabled"; + reg-names = "nand_data", "denali_reg"; + reg = <0x68000000 0x20>, <0x68100000 0x1000>; + interrupts = <0 65 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_nand2cs>; + clocks = <&sys_clk 2>; + }; }; }; -/include/ "uniphier-pinctrl.dtsi" +#include "uniphier-pinctrl.dtsi" diff --git a/src/arm/uniphier-sld3-ref.dts b/src/arm/uniphier-sld3-ref.dts deleted file mode 100644 index 70cda39a3dd2..000000000000 --- a/src/arm/uniphier-sld3-ref.dts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Device Tree Source for UniPhier sLD3 Reference Board - * - * Copyright (C) 2015-2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: (GPL-2.0+ OR MIT) - */ - -/dts-v1/; -/include/ "uniphier-sld3.dtsi" -/include/ "uniphier-ref-daughter.dtsi" -/include/ "uniphier-support-card.dtsi" - -/ { - model = "UniPhier sLD3 Reference Board"; - compatible = "socionext,uniphier-sld3-ref", "socionext,uniphier-sld3"; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - aliases { - serial0 = &serial0; - serial1 = &serial1; - serial2 = &serial2; - i2c0 = &i2c0; - i2c1 = &i2c1; - i2c2 = &i2c2; - i2c3 = &i2c3; - i2c4 = &i2c4; - }; - - memory@8000000 { - device_type = "memory"; - reg = <0x80000000 0x20000000 - 0xc0000000 0x20000000>; - }; -}; - -ðsc { - interrupts = <0 49 4>; -}; - -&serial0 { - status = "okay"; -}; - -&serial1 { - status = "okay"; -}; - -&serial2 { - status = "okay"; -}; - -&i2c0 { - status = "okay"; -}; - -&usb0 { - status = "okay"; -}; - -&usb1 { - status = "okay"; -}; - -&usb2 { - status = "okay"; -}; - -&usb3 { - status = "okay"; -}; diff --git a/src/arm/uniphier-sld3.dtsi b/src/arm/uniphier-sld3.dtsi deleted file mode 100644 index 408287936613..000000000000 --- a/src/arm/uniphier-sld3.dtsi +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Device Tree Source for UniPhier sLD3 SoC - * - * Copyright (C) 2015-2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: (GPL-2.0+ OR MIT) - */ - -/ { - compatible = "socionext,uniphier-sld3"; - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - reg = <0>; - enable-method = "psci"; - next-level-cache = <&l2>; - }; - - cpu@1 { - device_type = "cpu"; - compatible = "arm,cortex-a9"; - reg = <1>; - enable-method = "psci"; - next-level-cache = <&l2>; - }; - }; - - psci { - compatible = "arm,psci-0.2"; - method = "smc"; - }; - - clocks { - refclk: ref { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <24576000>; - }; - - arm_timer_clk: arm_timer_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <50000000>; - }; - }; - - soc { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - interrupt-parent = <&intc>; - - timer@20000200 { - compatible = "arm,cortex-a9-global-timer"; - reg = <0x20000200 0x20>; - interrupts = <1 11 0x304>; - clocks = <&arm_timer_clk>; - }; - - timer@20000600 { - compatible = "arm,cortex-a9-twd-timer"; - reg = <0x20000600 0x20>; - interrupts = <1 13 0x304>; - clocks = <&arm_timer_clk>; - }; - - intc: interrupt-controller@20001000 { - compatible = "arm,cortex-a9-gic"; - #interrupt-cells = <3>; - interrupt-controller; - reg = <0x20001000 0x1000>, - <0x20000100 0x100>; - }; - - l2: l2-cache@500c0000 { - compatible = "socionext,uniphier-system-cache"; - reg = <0x500c0000 0x2000>, <0x503c0100 0x4>, - <0x506c0000 0x400>; - interrupts = <0 174 4>, <0 175 4>; - cache-unified; - cache-size = <(512 * 1024)>; - cache-sets = <256>; - cache-line-size = <128>; - cache-level = <2>; - }; - - serial0: serial@54006800 { - compatible = "socionext,uniphier-uart"; - status = "disabled"; - reg = <0x54006800 0x40>; - interrupts = <0 33 4>; - clocks = <&sys_clk 0>; - }; - - serial1: serial@54006900 { - compatible = "socionext,uniphier-uart"; - status = "disabled"; - reg = <0x54006900 0x40>; - interrupts = <0 35 4>; - clocks = <&sys_clk 0>; - }; - - serial2: serial@54006a00 { - compatible = "socionext,uniphier-uart"; - status = "disabled"; - reg = <0x54006a00 0x40>; - interrupts = <0 37 4>; - clocks = <&sys_clk 0>; - }; - - i2c0: i2c@58400000 { - compatible = "socionext,uniphier-i2c"; - status = "disabled"; - reg = <0x58400000 0x40>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <0 41 1>; - clocks = <&sys_clk 1>; - clock-frequency = <100000>; - }; - - i2c1: i2c@58480000 { - compatible = "socionext,uniphier-i2c"; - status = "disabled"; - reg = <0x58480000 0x40>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <0 42 1>; - clocks = <&sys_clk 1>; - clock-frequency = <100000>; - }; - - i2c2: i2c@58500000 { - compatible = "socionext,uniphier-i2c"; - status = "disabled"; - reg = <0x58500000 0x40>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <0 43 1>; - clocks = <&sys_clk 1>; - clock-frequency = <100000>; - }; - - i2c3: i2c@58580000 { - compatible = "socionext,uniphier-i2c"; - status = "disabled"; - reg = <0x58580000 0x40>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <0 44 1>; - clocks = <&sys_clk 1>; - clock-frequency = <100000>; - }; - - /* chip-internal connection for DMD */ - i2c4: i2c@58600000 { - compatible = "socionext,uniphier-i2c"; - reg = <0x58600000 0x40>; - #address-cells = <1>; - #size-cells = <0>; - interrupts = <0 45 1>; - clocks = <&sys_clk 1>; - clock-frequency = <400000>; - }; - - system_bus: system-bus@58c00000 { - compatible = "socionext,uniphier-system-bus"; - status = "disabled"; - reg = <0x58c00000 0x400>; - #address-cells = <2>; - #size-cells = <1>; - }; - - smpctrl@59801000 { - compatible = "socionext,uniphier-smpctrl"; - reg = <0x59801000 0x400>; - }; - - mioctrl@59810000 { - compatible = "socionext,uniphier-sld3-mioctrl", - "simple-mfd", "syscon"; - reg = <0x59810000 0x800>; - - mio_clk: clock { - compatible = "socionext,uniphier-sld3-mio-clock"; - #clock-cells = <1>; - }; - - mio_rst: reset { - compatible = "socionext,uniphier-sld3-mio-reset"; - #reset-cells = <1>; - }; - }; - - usb0: usb@5a800100 { - compatible = "socionext,uniphier-ehci", "generic-ehci"; - status = "disabled"; - reg = <0x5a800100 0x100>; - interrupts = <0 80 4>; - clocks = <&mio_clk 7>, <&mio_clk 8>, <&mio_clk 12>; - resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 8>, - <&mio_rst 12>; - }; - - usb1: usb@5a810100 { - compatible = "socionext,uniphier-ehci", "generic-ehci"; - status = "disabled"; - reg = <0x5a810100 0x100>; - interrupts = <0 81 4>; - clocks = <&mio_clk 7>, <&mio_clk 9>, <&mio_clk 13>; - resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 9>, - <&mio_rst 13>; - }; - - usb2: usb@5a820100 { - compatible = "socionext,uniphier-ehci", "generic-ehci"; - status = "disabled"; - reg = <0x5a820100 0x100>; - interrupts = <0 82 4>; - clocks = <&mio_clk 7>, <&mio_clk 10>, <&mio_clk 14>; - resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 10>, - <&mio_rst 14>; - }; - - usb3: usb@5a830100 { - compatible = "socionext,uniphier-ehci", "generic-ehci"; - status = "disabled"; - reg = <0x5a830100 0x100>; - interrupts = <0 83 4>; - clocks = <&mio_clk 7>, <&mio_clk 11>, <&mio_clk 15>; - resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 11>, - <&mio_rst 15>; - }; - - sysctrl@f1840000 { - compatible = "socionext,uniphier-sld3-sysctrl", - "simple-mfd", "syscon"; - reg = <0xf1840000 0x10000>; - - sys_clk: clock { - compatible = "socionext,uniphier-sld3-clock"; - #clock-cells = <1>; - }; - - sys_rst: reset { - compatible = "socionext,uniphier-sld3-reset"; - #reset-cells = <1>; - }; - }; - }; -}; diff --git a/src/arm/uniphier-sld8-ref.dts b/src/arm/uniphier-sld8-ref.dts index 4536d5b71297..5accd3cc76e4 100644 --- a/src/arm/uniphier-sld8-ref.dts +++ b/src/arm/uniphier-sld8-ref.dts @@ -8,9 +8,9 @@ */ /dts-v1/; -/include/ "uniphier-sld8.dtsi" -/include/ "uniphier-ref-daughter.dtsi" -/include/ "uniphier-support-card.dtsi" +#include "uniphier-sld8.dtsi" +#include "uniphier-ref-daughter.dtsi" +#include "uniphier-support-card.dtsi" / { model = "UniPhier sLD8 Reference Board"; @@ -68,3 +68,7 @@ &usb2 { status = "okay"; }; + +&nand { + status = "okay"; +}; diff --git a/src/arm/uniphier-sld8.dtsi b/src/arm/uniphier-sld8.dtsi index 9fb9167f2db4..ebd0c3f63e7f 100644 --- a/src/arm/uniphier-sld8.dtsi +++ b/src/arm/uniphier-sld8.dtsi @@ -209,7 +209,8 @@ interrupts = <0 80 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb0>; - clocks = <&mio_clk 7>, <&mio_clk 8>, <&mio_clk 12>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 8>, + <&mio_clk 12>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 8>, <&mio_rst 12>; }; @@ -221,7 +222,8 @@ interrupts = <0 81 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb1>; - clocks = <&mio_clk 7>, <&mio_clk 9>, <&mio_clk 13>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 9>, + <&mio_clk 13>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 9>, <&mio_rst 13>; }; @@ -233,7 +235,8 @@ interrupts = <0 82 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb2>; - clocks = <&mio_clk 7>, <&mio_clk 10>, <&mio_clk 14>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 10>, + <&mio_clk 14>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 10>, <&mio_rst 14>; }; @@ -270,6 +273,13 @@ interrupt-controller; }; + aidet: aidet@61830000 { + compatible = "socionext,uniphier-sld8-aidet"; + reg = <0x61830000 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + sysctrl@61840000 { compatible = "socionext,uniphier-sld8-sysctrl", "simple-mfd", "syscon"; @@ -285,7 +295,18 @@ #reset-cells = <1>; }; }; + + nand: nand@68000000 { + compatible = "socionext,uniphier-denali-nand-v5a"; + status = "disabled"; + reg-names = "nand_data", "denali_reg"; + reg = <0x68000000 0x20>, <0x68100000 0x1000>; + interrupts = <0 65 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_nand2cs>; + clocks = <&sys_clk 2>; + }; }; }; -/include/ "uniphier-pinctrl.dtsi" +#include "uniphier-pinctrl.dtsi" diff --git a/src/arm/versatile-ab.dts b/src/arm/versatile-ab.dts index 409e069b3a84..4a51612996bc 100644 --- a/src/arm/versatile-ab.dts +++ b/src/arm/versatile-ab.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "skeleton.dtsi" diff --git a/src/arm/versatile-pb.dts b/src/arm/versatile-pb.dts index 06e2331f666d..06a0fdf24026 100644 --- a/src/arm/versatile-pb.dts +++ b/src/arm/versatile-pb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "versatile-ab.dts" / { @@ -39,7 +40,7 @@ clock-names = "apb_pclk"; }; - pci-controller@10001000 { + pci@10001000 { compatible = "arm,versatile-pci"; device_type = "pci"; reg = <0x10001000 0x1000 diff --git a/src/arm/vexpress-v2m.dtsi b/src/arm/vexpress-v2m.dtsi index 1b6f6393be93..b0021a816028 100644 --- a/src/arm/vexpress-v2m.dtsi +++ b/src/arm/vexpress-v2m.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. Versatile Express * diff --git a/src/arm/vexpress-v2p-ca15-tc1.dts b/src/arm/vexpress-v2p-ca15-tc1.dts index 0c8de0ca73ee..a8ac4e2ed290 100644 --- a/src/arm/vexpress-v2p-ca15-tc1.dts +++ b/src/arm/vexpress-v2p-ca15-tc1.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. Versatile Express * diff --git a/src/arm/vexpress-v2p-ca15_a7.dts b/src/arm/vexpress-v2p-ca15_a7.dts index 65ecf206388c..a4c7713edfcd 100644 --- a/src/arm/vexpress-v2p-ca15_a7.dts +++ b/src/arm/vexpress-v2p-ca15_a7.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. Versatile Express * diff --git a/src/arm/vexpress-v2p-ca5s.dts b/src/arm/vexpress-v2p-ca5s.dts index 6e69b8e6c1a7..32f1906ffecf 100644 --- a/src/arm/vexpress-v2p-ca5s.dts +++ b/src/arm/vexpress-v2p-ca5s.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. Versatile Express * diff --git a/src/arm/vexpress-v2p-ca9.dts b/src/arm/vexpress-v2p-ca9.dts index c9305b58afc2..5814460e0549 100644 --- a/src/arm/vexpress-v2p-ca9.dts +++ b/src/arm/vexpress-v2p-ca9.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. Versatile Express * diff --git a/src/arm/xenvm-4.2.dts b/src/arm/xenvm-4.2.dts index 336915151398..384cd92f1f84 100644 --- a/src/arm/xenvm-4.2.dts +++ b/src/arm/xenvm-4.2.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Xen Virtual Machine for unprivileged guests * diff --git a/src/arm/zx296702-ad1.dts b/src/arm/zx296702-ad1.dts index 081f980cfbe6..eedd3fcbc002 100644 --- a/src/arm/zx296702-ad1.dts +++ b/src/arm/zx296702-ad1.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; @@ -18,7 +19,6 @@ }; &mmc0 { - num-slots = <1>; supports-highspeed; non-removable; disable-wp; @@ -31,7 +31,6 @@ }; &mmc1 { - num-slots = <1>; supports-highspeed; non-removable; disable-wp; diff --git a/src/arm/zx296702.dtsi b/src/arm/zx296702.dtsi index d45c8fcd7ab4..752d28e0f9b0 100644 --- a/src/arm/zx296702.dtsi +++ b/src/arm/zx296702.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "skeleton.dtsi" #include diff --git a/src/arm/zynq-7000.dtsi b/src/arm/zynq-7000.dtsi index f3ac9bfe580e..0f79fe1ccd9d 100644 --- a/src/arm/zynq-7000.dtsi +++ b/src/arm/zynq-7000.dtsi @@ -42,6 +42,14 @@ }; }; + fpga_full: fpga-full { + compatible = "fpga-region"; + fpga-mgr = <&devcfg>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + }; + pmu@f8891000 { compatible = "arm,cortex-a9-pmu"; interrupts = <0 5 4>, <0 6 4>; diff --git a/src/arm/zynq-parallella.dts b/src/arm/zynq-parallella.dts index 64a6390fc501..0144acfa9793 100644 --- a/src/arm/zynq-parallella.dts +++ b/src/arm/zynq-parallella.dts @@ -34,7 +34,7 @@ }; chosen { - bootargs = "earlycon root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait"; + bootargs = "root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait"; stdout-path = "serial0:115200n8"; }; }; @@ -54,6 +54,7 @@ compatible = "ethernet-phy-id0141.0e90", "ethernet-phy-ieee802.3-c22"; reg = <0>; + device_type = "ethernet-phy"; marvell,reg-init = <0x3 0x10 0xff00 0x1e>, <0x3 0x11 0xfff0 0xa>; }; diff --git a/src/arm/zynq-zc702.dts b/src/arm/zynq-zc702.dts index 0cdad2cc8b78..34e8277fce0d 100644 --- a/src/arm/zynq-zc702.dts +++ b/src/arm/zynq-zc702.dts @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ /dts-v1/; -/include/ "zynq-7000.dtsi" +#include "zynq-7000.dtsi" / { model = "Zynq ZC702 Development Board"; @@ -30,7 +30,7 @@ }; chosen { - bootargs = "earlycon"; + bootargs = ""; stdout-path = "serial0:115200n8"; }; @@ -97,6 +97,7 @@ ethernet_phy: ethernet-phy@7 { reg = <7>; + device_type = "ethernet-phy"; }; }; @@ -131,6 +132,21 @@ }; }; + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + adv7511: hdmi-tx@39 { + compatible = "adi,adv7511"; + reg = <0x39>; + adi,input-depth = <8>; + adi,input-colorspace = "yuv422"; + adi,input-clock = "1x"; + adi,input-style = <3>; + adi,input-justification = "right"; + }; + }; + i2c@2 { #address-cells = <1>; #size-cells = <0>; diff --git a/src/arm/zynq-zc706.dts b/src/arm/zynq-zc706.dts index ad4bb06dba25..7ebc8c5ae39d 100644 --- a/src/arm/zynq-zc706.dts +++ b/src/arm/zynq-zc706.dts @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ /dts-v1/; -/include/ "zynq-7000.dtsi" +#include "zynq-7000.dtsi" / { model = "Zynq ZC706 Development Board"; @@ -30,7 +30,7 @@ }; chosen { - bootargs = "earlycon"; + bootargs = ""; stdout-path = "serial0:115200n8"; }; @@ -53,6 +53,7 @@ ethernet_phy: ethernet-phy@7 { reg = <7>; + device_type = "ethernet-phy"; }; }; @@ -87,6 +88,21 @@ }; }; + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + adv7511: hdmi-tx@39 { + compatible = "adi,adv7511"; + reg = <0x39>; + adi,input-depth = <8>; + adi,input-colorspace = "yuv422"; + adi,input-clock = "1x"; + adi,input-style = <3>; + adi,input-justification = "evenly"; + }; + }; + i2c@2 { #address-cells = <1>; #size-cells = <0>; diff --git a/src/arm/zynq-zed.dts b/src/arm/zynq-zed.dts index 325379f7983c..5e44dc12fd60 100644 --- a/src/arm/zynq-zed.dts +++ b/src/arm/zynq-zed.dts @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ /dts-v1/; -/include/ "zynq-7000.dtsi" +#include "zynq-7000.dtsi" / { model = "Zynq Zed Development Board"; @@ -29,7 +29,7 @@ }; chosen { - bootargs = "earlycon"; + bootargs = ""; stdout-path = "serial0:115200n8"; }; @@ -50,6 +50,7 @@ ethernet_phy: ethernet-phy@0 { reg = <0>; + device_type = "ethernet-phy"; }; }; diff --git a/src/arm/zynq-zybo.dts b/src/arm/zynq-zybo.dts index 590ec24b8749..e40cafc5ee5b 100644 --- a/src/arm/zynq-zybo.dts +++ b/src/arm/zynq-zybo.dts @@ -12,7 +12,7 @@ * GNU General Public License for more details. */ /dts-v1/; -/include/ "zynq-7000.dtsi" +#include "zynq-7000.dtsi" / { model = "Zynq ZYBO Development Board"; @@ -29,7 +29,7 @@ }; chosen { - bootargs = "earlycon"; + bootargs = ""; stdout-path = "serial0:115200n8"; }; @@ -51,6 +51,7 @@ ethernet_phy: ethernet-phy@0 { reg = <0>; + device_type = "ethernet-phy"; }; }; diff --git a/src/arm64/allwinner/axp803.dtsi b/src/arm64/allwinner/axp803.dtsi new file mode 100644 index 000000000000..ff8af52743ff --- /dev/null +++ b/src/arm64/allwinner/axp803.dtsi @@ -0,0 +1,150 @@ +/* + * Copyright 2017 Icenowy Zheng + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * AXP803 Integrated Power Management Chip + * http://files.pine64.org/doc/datasheet/pine64/AXP803_Datasheet_V1.0.pdf + */ + +&axp803 { + interrupt-controller; + #interrupt-cells = <1>; + + regulators { + /* Default work frequency for buck regulators */ + x-powers,dcdc-freq = <3000>; + + reg_aldo1: aldo1 { + regulator-name = "aldo1"; + }; + + reg_aldo2: aldo2 { + regulator-name = "aldo2"; + }; + + reg_aldo3: aldo3 { + regulator-name = "aldo3"; + }; + + reg_dc1sw: dc1sw { + regulator-name = "dc1sw"; + }; + + reg_dcdc1: dcdc1 { + regulator-name = "dcdc1"; + }; + + reg_dcdc2: dcdc2 { + regulator-name = "dcdc2"; + }; + + reg_dcdc3: dcdc3 { + regulator-name = "dcdc3"; + }; + + reg_dcdc4: dcdc4 { + regulator-name = "dcdc4"; + }; + + reg_dcdc5: dcdc5 { + regulator-name = "dcdc5"; + }; + + reg_dcdc6: dcdc6 { + regulator-name = "dcdc6"; + }; + + reg_dldo1: dldo1 { + regulator-name = "dldo1"; + }; + + reg_dldo2: dldo2 { + regulator-name = "dldo2"; + }; + + reg_dldo3: dldo3 { + regulator-name = "dldo3"; + }; + + reg_dldo4: dldo4 { + regulator-name = "dldo4"; + }; + + reg_eldo1: eldo1 { + regulator-name = "eldo1"; + }; + + reg_eldo2: eldo2 { + regulator-name = "eldo2"; + }; + + reg_eldo3: eldo3 { + regulator-name = "eldo3"; + }; + + reg_fldo1: fldo1 { + regulator-name = "fldo1"; + }; + + reg_fldo2: fldo2 { + regulator-name = "fldo2"; + }; + + reg_ldo_io0: ldo-io0 { + regulator-name = "ldo-io0"; + status = "disabled"; + }; + + reg_ldo_io1: ldo-io1 { + regulator-name = "ldo-io1"; + status = "disabled"; + }; + + reg_rtc_ldo: rtc-ldo { + /* RTC_LDO is a fixed, always-on regulator */ + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "rtc-ldo"; + }; + }; +}; diff --git a/src/arm64/allwinner/sun50i-a64-bananapi-m64.dts b/src/arm64/allwinner/sun50i-a64-bananapi-m64.dts index 6872135d7f84..d347f52e27f6 100644 --- a/src/arm64/allwinner/sun50i-a64-bananapi-m64.dts +++ b/src/arm64/allwinner/sun50i-a64-bananapi-m64.dts @@ -59,14 +59,16 @@ stdout-path = "serial0:115200n8"; }; - reg_vcc3v3: vcc3v3 { - compatible = "regulator-fixed"; - regulator-name = "vcc3v3"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; + wifi_pwrseq: wifi_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ }; }; +&ehci1 { + status = "okay"; +}; + &i2c1 { pinctrl-names = "default"; pinctrl-0 = <&i2c1_pins>; @@ -80,7 +82,7 @@ &mmc0 { pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins>; - vmmc-supply = <®_vcc3v3>; + vmmc-supply = <®_dcdc1>; cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; cd-inverted; disable-wp; @@ -91,22 +93,143 @@ &mmc1 { pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; - vmmc-supply = <®_vcc3v3>; + vmmc-supply = <®_dldo2>; + vqmmc-supply = <®_dldo4>; + mmc-pwrseq = <&wifi_pwrseq>; bus-width = <4>; non-removable; status = "okay"; + + brcmf: wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + interrupt-parent = <&r_pio>; + interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */ + interrupt-names = "host-wake"; + }; }; &mmc2 { pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; - vmmc-supply = <®_vcc3v3>; + vmmc-supply = <®_dcdc1>; bus-width = <8>; non-removable; cap-mmc-hw-reset; status = "okay"; }; +&ohci1 { + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp803: pmic@3a3 { + compatible = "x-powers,axp803"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +#include "axp803.dtsi" + +®_aldo2 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl"; +}; + +®_aldo3 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-pll-avcc"; +}; + +®_dc1sw { + regulator-name = "vcc-phy"; +}; + +®_dcdc1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-3v3"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1040000>; + regulator-max-microvolt = <1300000>; + regulator-name = "vdd-cpux"; +}; + +/* DCDC3 is polyphased with DCDC2 */ + +®_dcdc5 { + regulator-always-on; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-name = "vcc-dram"; +}; + +®_dcdc6 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-sys"; +}; + +®_dldo1 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-hdmi-dsi"; +}; + +®_dldo2 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi"; +}; + +®_dldo4 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi-io"; +}; + +®_eldo1 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "cpvdd"; +}; + +®_fldo1 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-1v2-hsic"; +}; + +/* + * The A64 chip cannot work without this regulator off, although + * it seems to be only driving the AR100 core. + * Maybe we don't still know well about CPUs domain. + */ +®_fldo2 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpus"; +}; + +®_rtc_ldo { + regulator-name = "vcc-rtc"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>; @@ -118,3 +241,7 @@ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; status = "okay"; }; + +&usbphy { + status = "okay"; +}; diff --git a/src/arm64/allwinner/sun50i-a64-nanopi-a64.dts b/src/arm64/allwinner/sun50i-a64-nanopi-a64.dts new file mode 100644 index 000000000000..2beef9e6cb88 --- /dev/null +++ b/src/arm64/allwinner/sun50i-a64-nanopi-a64.dts @@ -0,0 +1,207 @@ +/* + * Copyright (C) 2017 Jagan Teki + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library 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 library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; + +#include "sun50i-a64.dtsi" + +#include + +/ { + model = "FriendlyARM NanoPi A64"; + compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +/* i2c1 connected with gpio headers like pine64, bananapi */ +&i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins>; + status = "disabled"; +}; + +&i2c1_pins { + bias-pull-up; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_dcdc1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted; + disable-wp; + bus-width = <4>; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp803: pmic@3a3 { + compatible = "x-powers,axp803"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +#include "axp803.dtsi" + +®_aldo2 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl"; +}; + +®_aldo3 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-pll-avcc"; +}; + +®_dcdc1 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-3v"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1040000>; + regulator-max-microvolt = <1300000>; + regulator-name = "vdd-cpux"; +}; + +/* DCDC3 is polyphased with DCDC2 */ + +®_dcdc5 { + regulator-always-on; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-name = "vcc-dram"; +}; + +®_dcdc6 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-sys"; +}; + +®_dldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-hdmi-dsi"; +}; + +®_dldo4 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-pg-wifi-io"; +}; + +®_eldo1 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "cpvdd"; +}; + +®_fldo1 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-1v2-hsic"; +}; + +/* + * The A64 chip cannot work without this regulator off, although + * it seems to be only driving the AR100 core. + * Maybe we don't still know well about CPUs domain. + */ +®_fldo2 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpus"; +}; + +®_rtc_ldo { + regulator-name = "vcc-rtc"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; + +&usbphy { + status = "okay"; +}; diff --git a/src/arm64/allwinner/sun50i-a64-olinuxino.dts b/src/arm64/allwinner/sun50i-a64-olinuxino.dts new file mode 100644 index 000000000000..338e786155b1 --- /dev/null +++ b/src/arm64/allwinner/sun50i-a64-olinuxino.dts @@ -0,0 +1,199 @@ +/* + * Copyright (C) 2017 Jagan Teki + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library 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 library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; + +#include "sun50i-a64.dtsi" + +#include + +/ { + model = "Olimex A64-Olinuxino"; + compatible = "olimex,a64-olinuxino", "allwinner,sun50i-a64"; + + aliases { + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; +}; + +&mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; + vmmc-supply = <®_dcdc1>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted; + disable-wp; + bus-width = <4>; + status = "okay"; +}; + +&r_rsb { + status = "okay"; + + axp803: pmic@3a3 { + compatible = "x-powers,axp803"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +#include "axp803.dtsi" + +®_aldo1 { + regulator-always-on; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-name = "vcc-pe"; +}; + +®_aldo2 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl"; +}; + +®_aldo3 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-pll-avcc"; +}; + +®_dcdc1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-3v3"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1040000>; + regulator-max-microvolt = <1300000>; + regulator-name = "vdd-cpux"; +}; + +/* DCDC3 is polyphased with DCDC2 */ + +®_dcdc5 { + regulator-always-on; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-name = "vcc-ddr3"; +}; + +®_dcdc6 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-sys"; +}; + +®_dldo1 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-hdmi"; +}; + +®_dldo2 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-mipi"; +}; + +®_dldo3 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-name = "vcc-avdd-csi"; +}; + +®_dldo4 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi-io"; +}; + +®_eldo1 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "cpvdd"; +}; + +®_eldo2 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc-dvdd-csi"; +}; + +®_fldo1 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-1v2-hsic"; +}; + +/* + * The A64 chip cannot work without this regulator off, although + * it seems to be only driving the AR100 core. + * Maybe we don't still know well about CPUs domain. + */ +®_fldo2 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpus"; +}; + +®_rtc_ldo { + regulator-name = "vcc-rtc"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; diff --git a/src/arm64/allwinner/sun50i-a64-pine64.dts b/src/arm64/allwinner/sun50i-a64-pine64.dts index 7c533b6d4ba9..d06e34b5d192 100644 --- a/src/arm64/allwinner/sun50i-a64-pine64.dts +++ b/src/arm64/allwinner/sun50i-a64-pine64.dts @@ -61,13 +61,6 @@ chosen { stdout-path = "serial0:115200n8"; }; - - reg_vcc3v3: vcc3v3 { - compatible = "regulator-fixed"; - regulator-name = "vcc3v3"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - }; }; &ehci0 { @@ -91,7 +84,7 @@ &mmc0 { pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins>; - vmmc-supply = <®_vcc3v3>; + vmmc-supply = <®_dcdc1>; cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; cd-inverted; disable-wp; @@ -107,6 +100,118 @@ status = "okay"; }; +&r_rsb { + status = "okay"; + + axp803: pmic@3a3 { + compatible = "x-powers,axp803"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +#include "axp803.dtsi" + +®_aldo2 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl"; +}; + +®_aldo3 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-pll-avcc"; +}; + +®_dc1sw { + regulator-name = "vcc-phy"; +}; + +®_dcdc1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-3v3"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1040000>; + regulator-max-microvolt = <1300000>; + regulator-name = "vdd-cpux"; +}; + +/* DCDC3 is polyphased with DCDC2 */ + +/* + * The DRAM chips used by Pine64 boards are DDR3L-compatible, so they can + * work at 1.35V with less power consumption. + * As AXP803 DCDC5 cannot reach 1.35V accurately, use 1.36V instead. + */ +®_dcdc5 { + regulator-always-on; + regulator-min-microvolt = <1360000>; + regulator-max-microvolt = <1360000>; + regulator-name = "vcc-dram"; +}; + +®_dcdc6 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-sys"; +}; + +®_dldo1 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-hdmi"; +}; + +®_dldo2 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-mipi"; +}; + +®_dldo4 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi"; +}; + +®_eldo1 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "cpvdd"; +}; + +®_fldo1 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-1v2-hsic"; +}; + +/* + * The A64 chip cannot work without this regulator off, although + * it seems to be only driving the AR100 core. + * Maybe we don't still know well about CPUs domain. + */ +®_fldo2 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpus"; +}; + +®_rtc_ldo { + regulator-name = "vcc-rtc"; +}; + /* On Exp and Euler connectors */ &uart0 { pinctrl-names = "default"; diff --git a/src/arm64/allwinner/sun50i-a64-sopine-baseboard.dts b/src/arm64/allwinner/sun50i-a64-sopine-baseboard.dts index d891a1a27f6c..17ccc12b58df 100644 --- a/src/arm64/allwinner/sun50i-a64-sopine-baseboard.dts +++ b/src/arm64/allwinner/sun50i-a64-sopine-baseboard.dts @@ -95,6 +95,28 @@ status = "okay"; }; +®_dc1sw { + regulator-name = "vcc-phy"; +}; + +®_dldo1 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-hdmi"; +}; + +®_dldo2 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-mipi"; +}; + +®_dldo4 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-wifi"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>; diff --git a/src/arm64/allwinner/sun50i-a64-sopine.dtsi b/src/arm64/allwinner/sun50i-a64-sopine.dtsi index 475518b031dd..a5da18a6f286 100644 --- a/src/arm64/allwinner/sun50i-a64-sopine.dtsi +++ b/src/arm64/allwinner/sun50i-a64-sopine.dtsi @@ -63,3 +63,89 @@ bus-width = <4>; status = "okay"; }; + +&r_rsb { + status = "okay"; + + axp803: pmic@3a3 { + compatible = "x-powers,axp803"; + reg = <0x3a3>; + interrupt-parent = <&r_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; + }; +}; + +#include "axp803.dtsi" + +®_aldo2 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-pl"; +}; + +®_aldo3 { + regulator-always-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-name = "vcc-pll-avcc"; +}; + +®_dcdc1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-3v3"; +}; + +®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1040000>; + regulator-max-microvolt = <1300000>; + regulator-name = "vdd-cpux"; +}; + +/* DCDC3 is polyphased with DCDC2 */ + +®_dcdc5 { + regulator-always-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-dram"; +}; + +®_dcdc6 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-sys"; +}; + +®_eldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vdd-1v8-lpddr"; +}; + +®_fldo1 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vcc-1v2-hsic"; +}; + +/* + * The A64 chip cannot work without this regulator off, although + * it seems to be only driving the AR100 core. + * Maybe we don't still know well about CPUs domain. + */ +®_fldo2 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpus"; +}; + +®_rtc_ldo { + regulator-name = "vcc-rtc"; +}; diff --git a/src/arm64/allwinner/sun50i-a64.dtsi b/src/arm64/allwinner/sun50i-a64.dtsi index 68aadc9b96dc..8c8db1b057df 100644 --- a/src/arm64/allwinner/sun50i-a64.dtsi +++ b/src/arm64/allwinner/sun50i-a64.dtsi @@ -467,6 +467,15 @@ ; }; + r_intc: interrupt-controller@1f00c00 { + compatible = "allwinner,sun50i-a64-r-intc", + "allwinner,sun6i-a31-r-intc"; + interrupt-controller; + #interrupt-cells = <2>; + reg = <0x01f00c00 0x400>; + interrupts = ; + }; + r_ccu: clock@1f01400 { compatible = "allwinner,sun50i-a64-r-ccu"; reg = <0x01f01400 0x100>; diff --git a/src/arm64/amd/amd-overdrive-rev-b0.dts b/src/arm64/amd/amd-overdrive-rev-b0.dts index 8e3074a4947d..8e341be9a399 100644 --- a/src/arm64/amd/amd-overdrive-rev-b0.dts +++ b/src/arm64/amd/amd-overdrive-rev-b0.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * DTS file for AMD Seattle Overdrive Development Board * Note: For Seattle Rev.B0 diff --git a/src/arm64/amd/amd-overdrive-rev-b1.dts b/src/arm64/amd/amd-overdrive-rev-b1.dts index ed5e043f37aa..92cef05c6b74 100644 --- a/src/arm64/amd/amd-overdrive-rev-b1.dts +++ b/src/arm64/amd/amd-overdrive-rev-b1.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * DTS file for AMD Seattle Overdrive Development Board * Note: For Seattle Rev.B1 diff --git a/src/arm64/amd/amd-overdrive.dts b/src/arm64/amd/amd-overdrive.dts index 128fa942f09e..41b3a6c0993d 100644 --- a/src/arm64/amd/amd-overdrive.dts +++ b/src/arm64/amd/amd-overdrive.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * DTS file for AMD Seattle Overdrive Development Board * diff --git a/src/arm64/amd/amd-seattle-clks.dtsi b/src/arm64/amd/amd-seattle-clks.dtsi index f623c46525a6..2dd2c28171ee 100644 --- a/src/arm64/amd/amd-seattle-clks.dtsi +++ b/src/arm64/amd/amd-seattle-clks.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * DTS file for AMD Seattle Clocks * diff --git a/src/arm64/amd/amd-seattle-soc.dtsi b/src/arm64/amd/amd-seattle-soc.dtsi index bd3adeac374f..125f4deb52fe 100644 --- a/src/arm64/amd/amd-seattle-soc.dtsi +++ b/src/arm64/amd/amd-seattle-soc.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * DTS file for AMD Seattle SoC * diff --git a/src/arm64/amd/amd-seattle-xgbe-b.dtsi b/src/arm64/amd/amd-seattle-xgbe-b.dtsi index 8e8631952497..d97498361ce3 100644 --- a/src/arm64/amd/amd-seattle-xgbe-b.dtsi +++ b/src/arm64/amd/amd-seattle-xgbe-b.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * DTS file for AMD Seattle XGBE (RevB) * diff --git a/src/arm64/amd/husky.dts b/src/arm64/amd/husky.dts index 1381d4b2bf1b..7acde34772cb 100644 --- a/src/arm64/amd/husky.dts +++ b/src/arm64/amd/husky.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * DTS file for AMD/Linaro 96Boards Enterprise Edition Server (Husky) Board * Note: Based-on AMD Seattle Rev.B0 diff --git a/src/arm64/amlogic/meson-gx-p23x-q20x.dtsi b/src/arm64/amlogic/meson-gx-p23x-q20x.dtsi index dc478d094c11..4157987f4a3d 100644 --- a/src/arm64/amlogic/meson-gx-p23x-q20x.dtsi +++ b/src/arm64/amlogic/meson-gx-p23x-q20x.dtsi @@ -121,6 +121,13 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; @@ -161,7 +168,8 @@ &sd_emmc_a { status = "okay"; pinctrl-0 = <&sdio_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdio_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; #address-cells = <1>; #size-cells = <0>; @@ -187,7 +195,8 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; @@ -205,10 +214,10 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <200000000>; non-removable; diff --git a/src/arm64/amlogic/meson-gx.dtsi b/src/arm64/amlogic/meson-gx.dtsi index 738ed689ff69..f175db846286 100644 --- a/src/arm64/amlogic/meson-gx.dtsi +++ b/src/arm64/amlogic/meson-gx.dtsi @@ -225,7 +225,7 @@ }; uart_A: serial@84c0 { - compatible = "amlogic,meson-uart"; + compatible = "amlogic,meson-gx-uart", "amlogic,meson-uart"; reg = <0x0 0x84c0 0x0 0x14>; interrupts = ; clocks = <&xtal>; @@ -233,7 +233,7 @@ }; uart_B: serial@84dc { - compatible = "amlogic,meson-uart"; + compatible = "amlogic,meson-gx-uart", "amlogic,meson-uart"; reg = <0x0 0x84dc 0x0 0x14>; interrupts = ; clocks = <&xtal>; @@ -279,7 +279,7 @@ }; uart_C: serial@8700 { - compatible = "amlogic,meson-uart"; + compatible = "amlogic,meson-gx-uart", "amlogic,meson-uart"; reg = <0x0 0x8700 0x0 0x14>; interrupts = ; clocks = <&xtal>; @@ -367,26 +367,40 @@ #size-cells = <2>; ranges = <0x0 0x0 0x0 0xc8100000 0x0 0x100000>; - clkc_AO: clock-controller@040 { - compatible = "amlogic,gx-aoclkc", "amlogic,gxbb-aoclkc"; - reg = <0x0 0x00040 0x0 0x4>; - #clock-cells = <1>; - #reset-cells = <1>; + sysctrl_AO: sys-ctrl@0 { + compatible = "amlogic,meson-gx-ao-sysctrl", "syscon", "simple-mfd"; + reg = <0x0 0x0 0x0 0x100>; + + clkc_AO: clock-controller { + compatible = "amlogic,meson-gx-aoclkc"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + }; + + cec_AO: cec@100 { + compatible = "amlogic,meson-gx-ao-cec"; + reg = <0x0 0x00100 0x0 0x14>; + interrupts = ; + }; + + sec_AO: ao-secure@140 { + compatible = "amlogic,meson-gx-ao-secure", "syscon"; + reg = <0x0 0x140 0x0 0x140>; + amlogic,has-chip-id; }; uart_AO: serial@4c0 { - compatible = "amlogic,meson-uart"; + compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart", "amlogic,meson-uart"; reg = <0x0 0x004c0 0x0 0x14>; interrupts = ; - clocks = <&xtal>; status = "disabled"; }; uart_AO_B: serial@4e0 { - compatible = "amlogic,meson-uart"; + compatible = "amlogic,meson-gx-uart", "amlogic,meson-ao-uart", "amlogic,meson-uart"; reg = <0x0 0x004e0 0x0 0x14>; interrupts = ; - clocks = <&xtal>; status = "disabled"; }; @@ -437,9 +451,9 @@ mailbox: mailbox@404 { compatible = "amlogic,meson-gx-mhu", "amlogic,meson-gxbb-mhu"; reg = <0 0x404 0 0x4c>; - interrupts = <0 208 IRQ_TYPE_EDGE_RISING>, - <0 209 IRQ_TYPE_EDGE_RISING>, - <0 210 IRQ_TYPE_EDGE_RISING>; + interrupts = , + , + ; #mbox-cells = <1>; }; }; @@ -448,7 +462,7 @@ compatible = "amlogic,meson-gx-dwmac", "amlogic,meson-gxbb-dwmac", "snps,dwmac"; reg = <0x0 0xc9410000 0x0 0x10000 0x0 0xc8834540 0x0 0x4>; - interrupts = <0 8 1>; + interrupts = ; interrupt-names = "macirq"; status = "disabled"; }; diff --git a/src/arm64/amlogic/meson-gxbb-nanopi-k2.dts b/src/arm64/amlogic/meson-gxbb-nanopi-k2.dts index fa462831ccaf..4b17a76959b2 100644 --- a/src/arm64/amlogic/meson-gxbb-nanopi-k2.dts +++ b/src/arm64/amlogic/meson-gxbb-nanopi-k2.dts @@ -107,6 +107,9 @@ states = <3300000 0>, <1800000 1>; + + regulator-settling-time-up-us = <100>; + regulator-settling-time-down-us = <5000>; }; wifi_32k: wifi-32k { @@ -175,6 +178,64 @@ pinctrl-names = "default"; }; +&pinctrl_aobus { + gpio-line-names = "UART TX", "UART RX", "Power Control", "Power Key In", + "VCCK En", "CON1 Header Pin31", + "I2S Header Pin6", "IR In", "I2S Header Pin7", + "I2S Header Pin3", "I2S Header Pin4", + "I2S Header Pin5", "HDMI CEC", "SYS LED"; +}; + +&pinctrl_periphs { + gpio-line-names = /* Bank GPIOZ */ + "Eth MDIO", "Eth MDC", "Eth RGMII RX Clk", + "Eth RX DV", "Eth RX D0", "Eth RX D1", "Eth RX D2", + "Eth RX D3", "Eth RGMII TX Clk", "Eth TX En", + "Eth TX D0", "Eth TX D1", "Eth TX D2", "Eth TX D3", + "Eth PHY nRESET", "Eth PHY Intc", + /* Bank GPIOH */ + "HDMI HPD", "HDMI DDC SDA", "HDMI DDC SCL", + "CON1 Header Pin33", + /* Bank BOOT */ + "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3", "eMMC D4", + "eMMC D5", "eMMC D6", "eMMC D7", "eMMC Clk", + "eMMC Reset", "eMMC CMD", + "", "", "", "", "eMMC DS", + "", "", + /* Bank CARD */ + "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD", + "SDCard D3", "SDCard D2", "SDCard Det", + /* Bank GPIODV */ + "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", + "I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK", + "VDDEE Regulator", "VCCK Regulator", + /* Bank GPIOY */ + "CON1 Header Pin7", "CON1 Header Pin11", + "CON1 Header Pin13", "CON1 Header Pin15", + "CON1 Header Pin18", "CON1 Header Pin19", + "CON1 Header Pin22", "CON1 Header Pin21", + "CON1 Header Pin24", "CON1 Header Pin23", + "CON1 Header Pin26", "CON1 Header Pin29", + "CON1 Header Pin32", "CON1 Header Pin8", + "CON1 Header Pin10", "CON1 Header Pin16", + "CON1 Header Pin12", + /* Bank GPIOX */ + "WIFI SDIO D0", "WIFI SDIO D1", "WIFI SDIO D2", + "WIFI SDIO D3", "WIFI SDIO CLK", "WIFI SDIO CMD", + "WIFI Power Enable", "WIFI WAKE HOST", + "Bluetooth PCM DOUT", "Bluetooth PCM DIN", + "Bluetooth PCM SYNC", "Bluetooth PCM CLK", + "Bluetooth UART TX", "Bluetooth UART RX", + "Bluetooth UART CTS", "Bluetooth UART RTS", + "", "", "", "WIFI 32K", "Bluetooth Enable", + "Bluetooth WAKE HOST", + /* Bank GPIOCLK */ + "", "CON1 Header Pin35", "", "", + /* GPIO_TEST_N */ + ""; +}; + &pwm_ef { status = "okay"; pinctrl-0 = <&pwm_e_pins>; @@ -192,7 +253,8 @@ &sd_emmc_a { status = "okay"; pinctrl-0 = <&sdio_pins>, <&sdio_irq_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdio_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; #address-cells = <1>; #size-cells = <0>; @@ -218,11 +280,16 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; - max-frequency = <100000000>; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; + sd-uhs-sdr104; + max-frequency = <200000000>; disable-wp; cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>; @@ -236,10 +303,10 @@ &sd_emmc_c { status = "disabled"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; max-frequency = <200000000>; non-removable; disable-wp; diff --git a/src/arm64/amlogic/meson-gxbb-nexbox-a95x.dts b/src/arm64/amlogic/meson-gxbb-nexbox-a95x.dts index a1078b3e1c76..38dfdde5c147 100644 --- a/src/arm64/amlogic/meson-gxbb-nexbox-a95x.dts +++ b/src/arm64/amlogic/meson-gxbb-nexbox-a95x.dts @@ -51,7 +51,7 @@ / { compatible = "nexbox,a95x", "amlogic,meson-gxbb"; model = "NEXBOX A95X"; - + aliases { serial0 = &uart_AO; }; @@ -171,6 +171,13 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + ðmac { status = "okay"; pinctrl-0 = <ð_rmii_pins>; @@ -225,7 +232,8 @@ &sd_emmc_a { status = "okay"; pinctrl-0 = <&sdio_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdio_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; #address-cells = <1>; #size-cells = <0>; @@ -246,7 +254,8 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; @@ -264,10 +273,10 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <200000000>; non-removable; diff --git a/src/arm64/amlogic/meson-gxbb-odroidc2.dts b/src/arm64/amlogic/meson-gxbb-odroidc2.dts index d147c853ab05..1ffa1c238a72 100644 --- a/src/arm64/amlogic/meson-gxbb-odroidc2.dts +++ b/src/arm64/amlogic/meson-gxbb-odroidc2.dts @@ -50,7 +50,7 @@ / { compatible = "hardkernel,odroid-c2", "amlogic,meson-gxbb"; model = "Hardkernel ODROID-C2"; - + aliases { serial0 = &uart_AO; }; @@ -253,7 +253,8 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; @@ -271,10 +272,10 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; max-frequency = <200000000>; non-removable; disable-wp; diff --git a/src/arm64/amlogic/meson-gxbb-p20x.dtsi b/src/arm64/amlogic/meson-gxbb-p20x.dtsi index d904deb1018c..23c08c3afd0a 100644 --- a/src/arm64/amlogic/meson-gxbb-p20x.dtsi +++ b/src/arm64/amlogic/meson-gxbb-p20x.dtsi @@ -84,6 +84,9 @@ /* Based on P200 schematics, signal CARD_1.8V/3.3V_CTR */ states = <1800000 0 3300000 1>; + + regulator-settling-time-up-us = <10000>; + regulator-settling-time-down-us = <150000>; }; vddio_boot: regulator-vddio_boot { @@ -148,6 +151,13 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; @@ -184,7 +194,8 @@ &sd_emmc_a { status = "okay"; pinctrl-0 = <&sdio_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdio_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; #address-cells = <1>; #size-cells = <0>; @@ -210,10 +221,14 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; max-frequency = <100000000>; disable-wp; @@ -228,10 +243,10 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <200000000>; non-removable; diff --git a/src/arm64/amlogic/meson-gxbb-vega-s95.dtsi b/src/arm64/amlogic/meson-gxbb-vega-s95.dtsi index 346753fb6324..f2bc6dea1fc6 100644 --- a/src/arm64/amlogic/meson-gxbb-vega-s95.dtsi +++ b/src/arm64/amlogic/meson-gxbb-vega-s95.dtsi @@ -155,7 +155,8 @@ &sd_emmc_a { status = "okay"; pinctrl-0 = <&sdio_pins &sdio_irq_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdio_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; #address-cells = <1>; #size-cells = <0>; @@ -181,7 +182,8 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; @@ -198,10 +200,10 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <200000000>; non-removable; diff --git a/src/arm64/amlogic/meson-gxbb-wetek-play2.dts b/src/arm64/amlogic/meson-gxbb-wetek-play2.dts index e76ac313fef9..f7144fd5e03f 100644 --- a/src/arm64/amlogic/meson-gxbb-wetek-play2.dts +++ b/src/arm64/amlogic/meson-gxbb-wetek-play2.dts @@ -108,6 +108,12 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; &cvbs_vdac_port { cvbs_vdac_out: endpoint { diff --git a/src/arm64/amlogic/meson-gxbb.dtsi b/src/arm64/amlogic/meson-gxbb.dtsi index 17d3efdf1469..af834cdbba79 100644 --- a/src/arm64/amlogic/meson-gxbb.dtsi +++ b/src/arm64/amlogic/meson-gxbb.dtsi @@ -307,6 +307,15 @@ }; }; +&cec_AO { + clocks = <&clkc_AO CLKID_AO_CEC_32K>; + clock-names = "core"; +}; + +&clkc_AO { + compatible = "amlogic,meson-gxbb-aoclkc", "amlogic,meson-gx-aoclkc"; +}; + ðmac { clocks = <&clkc CLKID_ETH>, <&clkc CLKID_FCLK_DIV2>, @@ -383,6 +392,17 @@ }; }; + emmc_clk_gate_pins: emmc_clk_gate { + mux { + groups = "BOOT_8"; + function = "gpio_periphs"; + }; + cfg-pull-down { + pins = "BOOT_8"; + bias-pull-down; + }; + }; + nor_pins: nor { mux { groups = "nor_d", @@ -421,6 +441,17 @@ }; }; + sdcard_clk_gate_pins: sdcard_clk_gate { + mux { + groups = "CARD_2"; + function = "gpio_periphs"; + }; + cfg-pull-down { + pins = "CARD_2"; + bias-pull-down; + }; + }; + sdio_pins: sdio { mux { groups = "sdio_d0", @@ -433,6 +464,17 @@ }; }; + sdio_clk_gate_pins: sdio_clk_gate { + mux { + groups = "GPIOX_4"; + function = "gpio_periphs"; + }; + cfg-pull-down { + pins = "GPIOX_4"; + bias-pull-down; + }; + }; + sdio_irq_pins: sdio_irq { mux { groups = "sdio_irq"; @@ -652,21 +694,21 @@ &sd_emmc_a { clocks = <&clkc CLKID_SD_EMMC_A>, - <&xtal>, + <&clkc CLKID_SD_EMMC_A_CLK0>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; }; &sd_emmc_b { clocks = <&clkc CLKID_SD_EMMC_B>, - <&xtal>, + <&clkc CLKID_SD_EMMC_B_CLK0>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; }; &sd_emmc_c { clocks = <&clkc CLKID_SD_EMMC_C>, - <&xtal>, + <&clkc CLKID_SD_EMMC_C_CLK0>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; }; @@ -682,6 +724,31 @@ clocks = <&clkc CLKID_SPI>; }; +&uart_A { + clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>; + clock-names = "xtal", "pclk", "baud"; +}; + +&uart_AO { + clocks = <&xtal>, <&clkc CLKID_CLK81>, <&xtal>; + clock-names = "xtal", "pclk", "baud"; +}; + +&uart_AO_B { + clocks = <&xtal>, <&clkc CLKID_CLK81>, <&xtal>; + clock-names = "xtal", "pclk", "baud"; +}; + +&uart_B { + clocks = <&xtal>, <&clkc CLKID_UART1>, <&xtal>; + clock-names = "xtal", "core", "baud"; +}; + +&uart_C { + clocks = <&xtal>, <&clkc CLKID_UART2>, <&xtal>; + clock-names = "xtal", "core", "baud"; +}; + &vpu { compatible = "amlogic,meson-gxbb-vpu", "amlogic,meson-gx-vpu"; }; diff --git a/src/arm64/amlogic/meson-gxl-s905d-p230.dts b/src/arm64/amlogic/meson-gxl-s905d-p230.dts index 3e0c023d6abd..6827f235d7cf 100644 --- a/src/arm64/amlogic/meson-gxl-s905d-p230.dts +++ b/src/arm64/amlogic/meson-gxl-s905d-p230.dts @@ -97,6 +97,13 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + /* P230 has exclusive choice between internal or external PHY */ ðmac { pinctrl-0 = <ð_pins>; @@ -124,7 +131,6 @@ }; }; - &hdmi_tx { status = "okay"; pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; diff --git a/src/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts b/src/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts index 2a5804ce7f4b..977b4240f3c1 100644 --- a/src/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts +++ b/src/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts @@ -123,7 +123,8 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; @@ -141,10 +142,10 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <100000000>; non-removable; diff --git a/src/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts b/src/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts index 94567eb17875..edc512ad0bac 100644 --- a/src/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts +++ b/src/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts @@ -67,6 +67,13 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + &hdmi_tx { status = "okay"; pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; @@ -105,6 +112,62 @@ linux,rc-map-name = "rc-geekbox"; }; +&pinctrl_aobus { + gpio-line-names = "UART TX", + "UART RX", + "Power Key In", + "J9 Header Pin35", + "J9 Header Pin16", + "J9 Header Pin15", + "J9 Header Pin33", + "IR In", + "HDMI CEC", + "SYS LED"; +}; + +&pinctrl_periphs { + gpio-line-names = /* Bank GPIOZ */ + "", "", "", "", "", "", "", + "", "", "", "", "", "", "", + "Power OFF", + "VCCK Enable", + /* Bank GPIOH */ + "HDMI HPD", "HDMI SDA", "HDMI SCL", + "HDMI_5V_EN", "SPDIF", + "J9 Header Pin37", + "J9 Header Pin30", + "J9 Header Pin29", + "J9 Header Pin32", + "J9 Header Pin31", + /* Bank BOOT */ + "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3", + "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7", + "eMMC Clk", "eMMC Reset", "eMMC CMD", + "", "BOOT_MODE", "", "", "eMMC Data Strobe", + /* Bank CARD */ + "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD", + "SDCard D3", "SDCard D2", "SDCard Det", + /* Bank GPIODV */ + "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", + "I2C A SDA", "I2C A SCK", "I2C B SDA", "I2C B SCK", + "VCCK Regulator", "VDDEE Regulator", + /* Bank GPIOX */ + "WIFI SDIO D0", "WIFI SDIO D1", "WIFI SDIO D2", + "WIFI SDIO D3", "WIFI SDIO CLK", "WIFI SDIO CMD", + "WIFI Power Enable", "WIFI WAKE HOST", + "Bluetooth PCM DOUT", "Bluetooth PCM DIN", + "Bluetooth PCM SYNC", "Bluetooth PCM CLK", + "Bluetooth UART TX", "Bluetooth UART RX", + "Bluetooth UART CTS", "Bluetooth UART RTS", + "WIFI 32K", "Bluetooth Enable", + "Bluetooth WAKE HOST", + /* Bank GPIOCLK */ + "", "J9 Header Pin39", + /* GPIO_TEST_N */ + ""; +}; + &pwm_AO_ab { status = "okay"; pinctrl-0 = <&pwm_ao_a_3_pins>, <&pwm_ao_b_pins>; diff --git a/src/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts b/src/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts index 266fbcf3e47f..64c54c92e214 100644 --- a/src/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts +++ b/src/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts @@ -91,6 +91,9 @@ states = <3300000 0>, <1800000 1>; + + regulator-settling-time-up-us = <200>; + regulator-settling-time-down-us = <50000>; }; vddio_boot: regulator-vddio_boot { @@ -101,6 +104,13 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; @@ -129,14 +139,75 @@ }; }; +&pinctrl_aobus { + gpio-line-names = "UART TX", + "UART RX", + "Blue LED", + "SDCard Voltage Switch", + "7J1 Header Pin5", + "7J1 Header Pin3", + "7J1 Header Pin12", + "IR In", + "9J3 Switch HDMI CEC/7J1 Header Pin11", + "7J1 Header Pin13"; +}; + +&pinctrl_periphs { + gpio-line-names = /* Bank GPIOZ */ + "", "", "", "", "", "", "", + "", "", "", "", "", "", "", + "Eth Link LED", "Eth Activity LED", + /* Bank GPIOH */ + "HDMI HPD", "HDMI SDA", "HDMI SCL", + "HDMI_5V_EN", "9J1 Header Pin2", + "Analog Audio Mute", + "2J3 Header Pin6", + "2J3 Header Pin5", + "2J3 Header Pin4", + "2J3 Header Pin3", + /* Bank BOOT */ + "eMMC D0", "eMMC D1", "eMMC D2", "eMMC D3", + "eMMC D4", "eMMC D5", "eMMC D6", "eMMC D7", + "eMMC Clk", "eMMC Reset", "eMMC CMD", + "ALT BOOT MODE", "", "", "", "eMMC Data Strobe", + /* Bank CARD */ + "SDCard D1", "SDCard D0", "SDCard CLK", "SDCard CMD", + "SDCard D3", "SDCard D2", "SDCard Det", + /* Bank GPIODV */ + "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", + "Green LED", "VCCK Enable", + "7J1 Header Pin27", "7J1 Header Pin28", + "VCCK Regulator", "VDDEE Regulator", + /* Bank GPIOX */ + "7J1 Header Pin22", "7J1 Header Pin26", + "7J1 Header Pin36", "7J1 Header Pin38", + "7J1 Header Pin40", "7J1 Header Pin37", + "7J1 Header Pin33", "7J1 Header Pin35", + "7J1 Header Pin19", "7J1 Header Pin21", + "7J1 Header Pin24", "7J1 Header Pin23", + "7J1 Header Pin8", "7J1 Header Pin10", + "7J1 Header Pin16", "7J1 Header Pin18", + "7J1 Header Pin32", "7J1 Header Pin29", + "7J1 Header Pin31", + /* Bank GPIOCLK */ + "7J1 Header Pin7", "", + /* GPIO_TEST_N */ + "7J1 Header Pin15"; +}; + /* SD card */ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; max-frequency = <100000000>; disable-wp; @@ -151,10 +222,12 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; cap-mmc-highspeed; + mmc-ddr-3_3v; max-frequency = <50000000>; non-removable; disable-wp; diff --git a/src/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts b/src/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts index 6633a5d8fdd3..1b8f32867aa1 100644 --- a/src/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts +++ b/src/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts @@ -140,6 +140,13 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; @@ -182,7 +189,8 @@ &sd_emmc_a { status = "okay"; pinctrl-0 = <&sdio_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdio_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; #address-cells = <1>; #size-cells = <0>; @@ -203,7 +211,8 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; @@ -221,10 +230,10 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <200000000>; non-removable; diff --git a/src/arm64/amlogic/meson-gxl-s905x-p212.dts b/src/arm64/amlogic/meson-gxl-s905x-p212.dts index 6ab17c1eeefd..6e2bf858291c 100644 --- a/src/arm64/amlogic/meson-gxl-s905x-p212.dts +++ b/src/arm64/amlogic/meson-gxl-s905x-p212.dts @@ -71,6 +71,13 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; diff --git a/src/arm64/amlogic/meson-gxl-s905x-p212.dtsi b/src/arm64/amlogic/meson-gxl-s905x-p212.dtsi index f3eea8e89d12..129af9068814 100644 --- a/src/arm64/amlogic/meson-gxl-s905x-p212.dtsi +++ b/src/arm64/amlogic/meson-gxl-s905x-p212.dtsi @@ -95,7 +95,8 @@ &sd_emmc_a { status = "okay"; pinctrl-0 = <&sdio_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdio_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; #address-cells = <1>; #size-cells = <0>; @@ -116,7 +117,8 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; @@ -134,10 +136,10 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <200000000>; non-removable; diff --git a/src/arm64/amlogic/meson-gxl.dtsi b/src/arm64/amlogic/meson-gxl.dtsi index 8d4f3160a0ee..d8dd3298b15c 100644 --- a/src/arm64/amlogic/meson-gxl.dtsi +++ b/src/arm64/amlogic/meson-gxl.dtsi @@ -43,6 +43,7 @@ #include "meson-gx.dtsi" #include +#include #include #include @@ -207,6 +208,15 @@ }; }; +&cec_AO { + clocks = <&clkc_AO CLKID_AO_CEC_32K>; + clock-names = "core"; +}; + +&clkc_AO { + compatible = "amlogic,meson-gxl-aoclkc", "amlogic,meson-gx-aoclkc"; +}; + &hdmi_tx { compatible = "amlogic,meson-gxl-dw-hdmi", "amlogic,meson-gx-dw-hdmi"; resets = <&reset RESET_HDMITX_CAPB3>, @@ -271,6 +281,17 @@ }; }; + emmc_clk_gate_pins: emmc_clk_gate { + mux { + groups = "BOOT_8"; + function = "gpio_periphs"; + }; + cfg-pull-down { + pins = "BOOT_8"; + bias-pull-down; + }; + }; + nor_pins: nor { mux { groups = "nor_d", @@ -309,6 +330,17 @@ }; }; + sdcard_clk_gate_pins: sdcard_clk_gate { + mux { + groups = "CARD_2"; + function = "gpio_periphs"; + }; + cfg-pull-down { + pins = "CARD_2"; + bias-pull-down; + }; + }; + sdio_pins: sdio { mux { groups = "sdio_d0", @@ -321,6 +353,17 @@ }; }; + sdio_clk_gate_pins: sdio_clk_gate { + mux { + groups = "GPIOX_4"; + function = "gpio_periphs"; + }; + cfg-pull-down { + pins = "GPIOX_4"; + bias-pull-down; + }; + }; + sdio_irq_pins: sdio_irq { mux { groups = "sdio_irq"; @@ -593,21 +636,21 @@ &sd_emmc_a { clocks = <&clkc CLKID_SD_EMMC_A>, - <&xtal>, + <&clkc CLKID_SD_EMMC_A_CLK0>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; }; &sd_emmc_b { clocks = <&clkc CLKID_SD_EMMC_B>, - <&xtal>, + <&clkc CLKID_SD_EMMC_B_CLK0>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; }; &sd_emmc_c { clocks = <&clkc CLKID_SD_EMMC_C>, - <&xtal>, + <&clkc CLKID_SD_EMMC_C_CLK0>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; }; @@ -623,6 +666,31 @@ clocks = <&clkc CLKID_SPI>; }; +&uart_A { + clocks = <&xtal>, <&clkc CLKID_UART0>, <&xtal>; + clock-names = "xtal", "core", "baud"; +}; + +&uart_AO { + clocks = <&xtal>, <&clkc CLKID_CLK81>, <&xtal>; + clock-names = "xtal", "pclk", "baud"; +}; + +&uart_AO_B { + clocks = <&xtal>, <&clkc CLKID_CLK81>, <&xtal>; + clock-names = "xtal", "pclk", "baud"; +}; + +&uart_B { + clocks = <&xtal>, <&clkc CLKID_UART1>, <&xtal>; + clock-names = "xtal", "core", "baud"; +}; + +&uart_C { + clocks = <&xtal>, <&clkc CLKID_UART2>, <&xtal>; + clock-names = "xtal", "core", "baud"; +}; + &vpu { compatible = "amlogic,meson-gxl-vpu", "amlogic,meson-gx-vpu"; }; diff --git a/src/arm64/amlogic/meson-gxm-nexbox-a1.dts b/src/arm64/amlogic/meson-gxm-nexbox-a1.dts index 5f626d683088..22c697732f66 100644 --- a/src/arm64/amlogic/meson-gxm-nexbox-a1.dts +++ b/src/arm64/amlogic/meson-gxm-nexbox-a1.dts @@ -113,6 +113,13 @@ }; }; +&cec_AO { + status = "okay"; + pinctrl-0 = <&ao_cec_pins>; + pinctrl-names = "default"; + hdmi-phandle = <&hdmi_tx>; +}; + &cvbs_vdac_port { cvbs_vdac_out: endpoint { remote-endpoint = <&cvbs_connector_in>; @@ -168,7 +175,8 @@ &sd_emmc_b { status = "okay"; pinctrl-0 = <&sdcard_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&sdcard_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <4>; cap-sd-highspeed; @@ -186,10 +194,10 @@ &sd_emmc_c { status = "okay"; pinctrl-0 = <&emmc_pins>; - pinctrl-names = "default"; + pinctrl-1 = <&emmc_clk_gate_pins>; + pinctrl-names = "default", "clk-gate"; bus-width = <8>; - cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <200000000>; non-removable; diff --git a/src/arm64/amlogic/meson-gxm-rbox-pro.dts b/src/arm64/amlogic/meson-gxm-rbox-pro.dts index 08f1dd69b679..470f72bb863c 100644 --- a/src/arm64/amlogic/meson-gxm-rbox-pro.dts +++ b/src/arm64/amlogic/meson-gxm-rbox-pro.dts @@ -220,7 +220,6 @@ pinctrl-names = "default"; bus-width = <8>; - cap-sd-highspeed; cap-mmc-highspeed; max-frequency = <200000000>; non-removable; diff --git a/src/arm64/amlogic/meson-gxm.dtsi b/src/arm64/amlogic/meson-gxm.dtsi index fe451cce93e7..19a798d2ae2f 100644 --- a/src/arm64/amlogic/meson-gxm.dtsi +++ b/src/arm64/amlogic/meson-gxm.dtsi @@ -117,6 +117,10 @@ }; }; +&clkc_AO { + compatible = "amlogic,meson-gxm-aoclkc", "amlogic,meson-gx-aoclkc"; +}; + &saradc { compatible = "amlogic,meson-gxm-saradc", "amlogic,meson-saradc"; }; diff --git a/src/arm64/apm/apm-shadowcat.dtsi b/src/arm64/apm/apm-shadowcat.dtsi index 72720e9132a1..c9ffffb96e43 100644 --- a/src/arm64/apm/apm-shadowcat.dtsi +++ b/src/arm64/apm/apm-shadowcat.dtsi @@ -626,6 +626,7 @@ 0x43000000 0xe0 0x00000000 0xe0 0x00000000 0x20 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0x0 0x0 0x10 0x4 0x0 0x0 0x0 0x2 &gic 0x0 0x0 0x0 0x11 0x4 @@ -651,6 +652,7 @@ 0x43000000 0xb0 0x00000000 0xb0 0x00000000 0x10 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0x0 0x0 0x16 0x4 0x0 0x0 0x0 0x2 &gic 0x0 0x0 0x0 0x17 0x4 diff --git a/src/arm64/apm/apm-storm.dtsi b/src/arm64/apm/apm-storm.dtsi index 63be8e51eaa8..c09a36fed917 100644 --- a/src/arm64/apm/apm-storm.dtsi +++ b/src/arm64/apm/apm-storm.dtsi @@ -626,6 +626,7 @@ 0x43000000 0xf0 0x00000000 0xf0 0x00000000 0x10 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xc2 0x4 0x0 0x0 0x0 0x2 &gic 0x0 0xc3 0x4 @@ -651,6 +652,7 @@ 0x43000000 0xd8 0x00000000 0xd8 0x00000000 0x08 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xc8 0x4 0x0 0x0 0x0 0x2 &gic 0x0 0xc9 0x4 @@ -676,6 +678,7 @@ 0x43000000 0x94 0x00000000 0x94 0x00000000 0x04 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xce 0x4 0x0 0x0 0x0 0x2 &gic 0x0 0xcf 0x4 @@ -701,6 +704,7 @@ 0x43000000 0xb0 0x00000000 0xb0 0x00000000 0x10 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xd4 0x4 0x0 0x0 0x0 0x2 &gic 0x0 0xd5 0x4 @@ -726,6 +730,7 @@ 0x43000000 0xc8 0x00000000 0xc8 0x00000000 0x08 0x00000000>; /* mem */ dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; + bus-range = <0x00 0xff>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; interrupt-map = <0x0 0x0 0x0 0x1 &gic 0x0 0xda 0x4 0x0 0x0 0x0 0x2 &gic 0x0 0xdb 0x4 diff --git a/src/arm64/arm/foundation-v8-gicv3.dts b/src/arm64/arm/foundation-v8-gicv3.dts index 35588dfa095c..4825cdbdcf46 100644 --- a/src/arm64/arm/foundation-v8-gicv3.dts +++ b/src/arm64/arm/foundation-v8-gicv3.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. * diff --git a/src/arm64/arm/foundation-v8.dts b/src/arm64/arm/foundation-v8.dts index 71168077312d..8a9136f4ab74 100644 --- a/src/arm64/arm/foundation-v8.dts +++ b/src/arm64/arm/foundation-v8.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. * diff --git a/src/arm64/arm/foundation-v8.dtsi b/src/arm64/arm/foundation-v8.dtsi index 7cfa8e414e7f..f0b67e439f58 100644 --- a/src/arm64/arm/foundation-v8.dtsi +++ b/src/arm64/arm/foundation-v8.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. * @@ -226,7 +227,7 @@ clock-names = "uartclk", "apb_pclk"; }; - virtio_block@0130000 { + virtio-block@0130000 { compatible = "virtio,mmio"; reg = <0x130000 0x200>; interrupts = <42>; diff --git a/src/arm64/arm/juno-base.dtsi b/src/arm64/arm/juno-base.dtsi index e8b7413ec890..f165f04db0c9 100644 --- a/src/arm64/arm/juno-base.dtsi +++ b/src/arm64/arm/juno-base.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "juno-clocks.dtsi" / { @@ -201,7 +202,7 @@ }; }; - cpu_debug0: cpu_debug@22010000 { + cpu_debug0: cpu-debug@22010000 { compatible = "arm,coresight-cpu-debug", "arm,primecell"; reg = <0x0 0x22010000 0x0 0x1000>; @@ -260,7 +261,7 @@ }; }; - cpu_debug1: cpu_debug@22110000 { + cpu_debug1: cpu-debug@22110000 { compatible = "arm,coresight-cpu-debug", "arm,primecell"; reg = <0x0 0x22110000 0x0 0x1000>; @@ -283,7 +284,7 @@ }; }; - cpu_debug2: cpu_debug@23010000 { + cpu_debug2: cpu-debug@23010000 { compatible = "arm,coresight-cpu-debug", "arm,primecell"; reg = <0x0 0x23010000 0x0 0x1000>; @@ -356,7 +357,7 @@ }; }; - cpu_debug3: cpu_debug@23110000 { + cpu_debug3: cpu-debug@23110000 { compatible = "arm,coresight-cpu-debug", "arm,primecell"; reg = <0x0 0x23110000 0x0 0x1000>; @@ -379,7 +380,7 @@ }; }; - cpu_debug4: cpu_debug@23210000 { + cpu_debug4: cpu-debug@23210000 { compatible = "arm,coresight-cpu-debug", "arm,primecell"; reg = <0x0 0x23210000 0x0 0x1000>; @@ -402,7 +403,7 @@ }; }; - cpu_debug5: cpu_debug@23310000 { + cpu_debug5: cpu-debug@23310000 { compatible = "arm,coresight-cpu-debug", "arm,primecell"; reg = <0x0 0x23310000 0x0 0x1000>; @@ -426,7 +427,7 @@ }; replicator@20120000 { - compatible = "qcom,coresight-replicator1x", "arm,primecell"; + compatible = "arm,coresight-dynamic-replicator", "arm,primecell"; reg = <0 0x20120000 0 0x1000>; clocks = <&soc_smc50mhz>; diff --git a/src/arm64/arm/juno-cs-r1r2.dtsi b/src/arm64/arm/juno-cs-r1r2.dtsi index aa03050dd7df..0c43fb3525eb 100644 --- a/src/arm64/arm/juno-cs-r1r2.dtsi +++ b/src/arm64/arm/juno-cs-r1r2.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { funnel@20130000 { /* cssys1 */ compatible = "arm,coresight-funnel", "arm,primecell"; diff --git a/src/arm64/arm/rtsm_ve-aemv8a.dts b/src/arm64/arm/rtsm_ve-aemv8a.dts index a83ed2c6bbf7..7810632d3438 100644 --- a/src/arm64/arm/rtsm_ve-aemv8a.dts +++ b/src/arm64/arm/rtsm_ve-aemv8a.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. Fast Models * diff --git a/src/arm64/arm/rtsm_ve-motherboard.dtsi b/src/arm64/arm/rtsm_ve-motherboard.dtsi index 161ac98418a3..e18fe006cc2a 100644 --- a/src/arm64/arm/rtsm_ve-motherboard.dtsi +++ b/src/arm64/arm/rtsm_ve-motherboard.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. Fast Models * @@ -219,7 +220,7 @@ }; }; - virtio_block@0130000 { + virtio-block@0130000 { compatible = "virtio,mmio"; reg = <0x130000 0x200>; interrupts = <42>; diff --git a/src/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts b/src/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts index e3a171162bb4..2cb604957808 100644 --- a/src/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts +++ b/src/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARM Ltd. Versatile Express * diff --git a/src/arm64/broadcom/bcm2835-rpi.dtsi b/src/arm64/broadcom/bcm2835-rpi.dtsi deleted file mode 100644 index e55b362b9d6e..000000000000 --- a/src/arm64/broadcom/bcm2835-rpi.dtsi +++ /dev/null @@ -1,108 +0,0 @@ -#include - -/ { - memory { - device_type = "memory"; - reg = <0 0x10000000>; - }; - - leds { - compatible = "gpio-leds"; - - act { - label = "ACT"; - default-state = "keep"; - linux,default-trigger = "heartbeat"; - }; - }; - - soc { - firmware: firmware { - compatible = "raspberrypi,bcm2835-firmware"; - mboxes = <&mailbox>; - }; - - power: power { - compatible = "raspberrypi,bcm2835-power"; - firmware = <&firmware>; - #power-domain-cells = <1>; - }; - }; -}; - -&gpio { - pinctrl-names = "default"; - - gpioout: gpioout { - brcm,pins = <6>; - brcm,function = ; - }; - - alt0: alt0 { - brcm,pins = <4 5 7 8 9 10 11 14 15>; - brcm,function = ; - }; -}; - -&i2c0 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c0_gpio0>; - status = "okay"; - clock-frequency = <100000>; -}; - -&i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_gpio2>; - status = "okay"; - clock-frequency = <100000>; -}; - -&i2c2 { - status = "okay"; -}; - -&sdhci { - pinctrl-names = "default"; - pinctrl-0 = <&emmc_gpio48>; - bus-width = <4>; -}; - -&sdhost { - pinctrl-names = "default"; - pinctrl-0 = <&sdhost_gpio48>; - status = "okay"; - bus-width = <4>; -}; - -&pwm { - pinctrl-names = "default"; - pinctrl-0 = <&pwm0_gpio40 &pwm1_gpio45>; - status = "okay"; -}; - -&usb { - power-domains = <&power RPI_POWER_DOMAIN_USB>; -}; - -&v3d { - power-domains = <&power RPI_POWER_DOMAIN_V3D>; -}; - -&hdmi { - power-domains = <&power RPI_POWER_DOMAIN_HDMI>; - status = "okay"; -}; - -&vec { - power-domains = <&power RPI_POWER_DOMAIN_VEC>; - status = "okay"; -}; - -&dsi0 { - power-domains = <&power RPI_POWER_DOMAIN_DSI0>; -}; - -&dsi1 { - power-domains = <&power RPI_POWER_DOMAIN_DSI1>; -}; diff --git a/src/arm64/broadcom/bcm2837-rpi-3-b.dts b/src/arm64/broadcom/bcm2837-rpi-3-b.dts index 972f14db28ac..89b78d6c19bf 100644 --- a/src/arm64/broadcom/bcm2837-rpi-3-b.dts +++ b/src/arm64/broadcom/bcm2837-rpi-3-b.dts @@ -1,41 +1,2 @@ -/dts-v1/; -#include "bcm2837.dtsi" -#include "bcm2835-rpi.dtsi" -#include "bcm283x-rpi-smsc9514.dtsi" -#include "bcm283x-rpi-usb-host.dtsi" - -/ { - compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; - model = "Raspberry Pi 3 Model B"; - - memory { - reg = <0 0x40000000>; - }; - - leds { - act { - gpios = <&gpio 47 0>; - }; - }; -}; - -&uart1 { - status = "okay"; -}; - -/* SDHCI is used to control the SDIO for wireless */ -&sdhci { - pinctrl-names = "default"; - pinctrl-0 = <&emmc_gpio34>; - status = "okay"; - bus-width = <4>; - non-removable; -}; - -/* SDHOST is used to drive the SD card */ -&sdhost { - pinctrl-names = "default"; - pinctrl-0 = <&sdhost_gpio48>; - status = "okay"; - bus-width = <4>; -}; +// SPDX-License-Identifier: GPL-2.0 +#include "arm/bcm2837-rpi-3-b.dts" diff --git a/src/arm64/broadcom/bcm283x-rpi-smsc9514.dtsi b/src/arm64/broadcom/bcm283x-rpi-smsc9514.dtsi deleted file mode 100644 index dc7ae776db5f..000000000000 --- a/src/arm64/broadcom/bcm283x-rpi-smsc9514.dtsi +++ /dev/null @@ -1,19 +0,0 @@ -/ { - aliases { - ethernet0 = ðernet; - }; -}; - -&usb { - usb1@1 { - compatible = "usb424,9514"; - reg = <1>; - #address-cells = <1>; - #size-cells = <0>; - - ethernet: usbether@1 { - compatible = "usb424,ec00"; - reg = <1>; - }; - }; -}; diff --git a/src/arm64/broadcom/bcm283x-rpi-usb-host.dtsi b/src/arm64/broadcom/bcm283x-rpi-usb-host.dtsi deleted file mode 100644 index 73f4ece8dcd0..000000000000 --- a/src/arm64/broadcom/bcm283x-rpi-usb-host.dtsi +++ /dev/null @@ -1,3 +0,0 @@ -&usb { - dr_mode = "host"; -}; diff --git a/src/arm64/broadcom/bcm283x.dtsi b/src/arm64/broadcom/bcm283x.dtsi deleted file mode 100644 index 431dcfc900c0..000000000000 --- a/src/arm64/broadcom/bcm283x.dtsi +++ /dev/null @@ -1,638 +0,0 @@ -#include -#include -#include -#include - -/* firmware-provided startup stubs live here, where the secondary CPUs are - * spinning. - */ -/memreserve/ 0x00000000 0x00001000; - -/* This include file covers the common peripherals and configuration between - * bcm2835 and bcm2836 implementations, leaving the CPU configuration to - * bcm2835.dtsi and bcm2836.dtsi. - */ - -/ { - compatible = "brcm,bcm2835"; - model = "BCM2835"; - interrupt-parent = <&intc>; - #address-cells = <1>; - #size-cells = <1>; - - chosen { - bootargs = "earlyprintk console=ttyAMA0"; - }; - - thermal-zones { - cpu_thermal: cpu-thermal { - polling-delay-passive = <0>; - polling-delay = <1000>; - - thermal-sensors = <&thermal>; - - trips { - cpu-crit { - temperature = <80000>; - hysteresis = <0>; - type = "critical"; - }; - }; - - cooling-maps { - }; - }; - }; - - soc { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - - timer@7e003000 { - compatible = "brcm,bcm2835-system-timer"; - reg = <0x7e003000 0x1000>; - interrupts = <1 0>, <1 1>, <1 2>, <1 3>; - /* This could be a reference to BCM2835_CLOCK_TIMER, - * but we don't have the driver using the common clock - * support yet. - */ - clock-frequency = <1000000>; - }; - - dma: dma@7e007000 { - compatible = "brcm,bcm2835-dma"; - reg = <0x7e007000 0xf00>; - interrupts = <1 16>, - <1 17>, - <1 18>, - <1 19>, - <1 20>, - <1 21>, - <1 22>, - <1 23>, - <1 24>, - <1 25>, - <1 26>, - /* dma channel 11-14 share one irq */ - <1 27>, - <1 27>, - <1 27>, - <1 27>, - /* unused shared irq for all channels */ - <1 28>; - interrupt-names = "dma0", - "dma1", - "dma2", - "dma3", - "dma4", - "dma5", - "dma6", - "dma7", - "dma8", - "dma9", - "dma10", - "dma11", - "dma12", - "dma13", - "dma14", - "dma-shared-all"; - #dma-cells = <1>; - brcm,dma-channel-mask = <0x7f35>; - }; - - intc: interrupt-controller@7e00b200 { - compatible = "brcm,bcm2835-armctrl-ic"; - reg = <0x7e00b200 0x200>; - interrupt-controller; - #interrupt-cells = <2>; - }; - - watchdog@7e100000 { - compatible = "brcm,bcm2835-pm-wdt"; - reg = <0x7e100000 0x28>; - }; - - clocks: cprman@7e101000 { - compatible = "brcm,bcm2835-cprman"; - #clock-cells = <1>; - reg = <0x7e101000 0x2000>; - - /* CPRMAN derives almost everything from the - * platform's oscillator. However, the DSI - * pixel clocks come from the DSI analog PHY. - */ - clocks = <&clk_osc>, - <&dsi0 0>, <&dsi0 1>, <&dsi0 2>, - <&dsi1 0>, <&dsi1 1>, <&dsi1 2>; - }; - - rng@7e104000 { - compatible = "brcm,bcm2835-rng"; - reg = <0x7e104000 0x10>; - }; - - mailbox: mailbox@7e00b880 { - compatible = "brcm,bcm2835-mbox"; - reg = <0x7e00b880 0x40>; - interrupts = <0 1>; - #mbox-cells = <0>; - }; - - gpio: gpio@7e200000 { - compatible = "brcm,bcm2835-gpio"; - reg = <0x7e200000 0xb4>; - /* - * The GPIO IP block is designed for 3 banks of GPIOs. - * Each bank has a GPIO interrupt for itself. - * There is an overall "any bank" interrupt. - * In order, these are GIC interrupts 17, 18, 19, 20. - * Since the BCM2835 only has 2 banks, the 2nd bank - * interrupt output appears to be mirrored onto the - * 3rd bank's interrupt signal. - * So, a bank0 interrupt shows up on 17, 20, and - * a bank1 interrupt shows up on 18, 19, 20! - */ - interrupts = <2 17>, <2 18>, <2 19>, <2 20>; - - gpio-controller; - #gpio-cells = <2>; - - interrupt-controller; - #interrupt-cells = <2>; - - /* Defines pin muxing groups according to - * BCM2835-ARM-Peripherals.pdf page 102. - * - * While each pin can have its mux selected - * for various functions individually, some - * groups only make sense to switch to a - * particular function together. - */ - dpi_gpio0: dpi_gpio0 { - brcm,pins = <0 1 2 3 4 5 6 7 8 9 10 11 - 12 13 14 15 16 17 18 19 - 20 21 22 23 24 25 26 27>; - brcm,function = ; - }; - emmc_gpio22: emmc_gpio22 { - brcm,pins = <22 23 24 25 26 27>; - brcm,function = ; - }; - emmc_gpio34: emmc_gpio34 { - brcm,pins = <34 35 36 37 38 39>; - brcm,function = ; - brcm,pull = ; - }; - emmc_gpio48: emmc_gpio48 { - brcm,pins = <48 49 50 51 52 53>; - brcm,function = ; - }; - - gpclk0_gpio4: gpclk0_gpio4 { - brcm,pins = <4>; - brcm,function = ; - }; - gpclk1_gpio5: gpclk1_gpio5 { - brcm,pins = <5>; - brcm,function = ; - }; - gpclk1_gpio42: gpclk1_gpio42 { - brcm,pins = <42>; - brcm,function = ; - }; - gpclk1_gpio44: gpclk1_gpio44 { - brcm,pins = <44>; - brcm,function = ; - }; - gpclk2_gpio6: gpclk2_gpio6 { - brcm,pins = <6>; - brcm,function = ; - }; - gpclk2_gpio43: gpclk2_gpio43 { - brcm,pins = <43>; - brcm,function = ; - }; - - i2c0_gpio0: i2c0_gpio0 { - brcm,pins = <0 1>; - brcm,function = ; - }; - i2c0_gpio28: i2c0_gpio28 { - brcm,pins = <28 29>; - brcm,function = ; - }; - i2c0_gpio44: i2c0_gpio44 { - brcm,pins = <44 45>; - brcm,function = ; - }; - i2c1_gpio2: i2c1_gpio2 { - brcm,pins = <2 3>; - brcm,function = ; - }; - i2c1_gpio44: i2c1_gpio44 { - brcm,pins = <44 45>; - brcm,function = ; - }; - i2c_slave_gpio18: i2c_slave_gpio18 { - brcm,pins = <18 19 20 21>; - brcm,function = ; - }; - - jtag_gpio4: jtag_gpio4 { - brcm,pins = <4 5 6 12 13>; - brcm,function = ; - }; - jtag_gpio22: jtag_gpio22 { - brcm,pins = <22 23 24 25 26 27>; - brcm,function = ; - }; - - pcm_gpio18: pcm_gpio18 { - brcm,pins = <18 19 20 21>; - brcm,function = ; - }; - pcm_gpio28: pcm_gpio28 { - brcm,pins = <28 29 30 31>; - brcm,function = ; - }; - - pwm0_gpio12: pwm0_gpio12 { - brcm,pins = <12>; - brcm,function = ; - }; - pwm0_gpio18: pwm0_gpio18 { - brcm,pins = <18>; - brcm,function = ; - }; - pwm0_gpio40: pwm0_gpio40 { - brcm,pins = <40>; - brcm,function = ; - }; - pwm1_gpio13: pwm1_gpio13 { - brcm,pins = <13>; - brcm,function = ; - }; - pwm1_gpio19: pwm1_gpio19 { - brcm,pins = <19>; - brcm,function = ; - }; - pwm1_gpio41: pwm1_gpio41 { - brcm,pins = <41>; - brcm,function = ; - }; - pwm1_gpio45: pwm1_gpio45 { - brcm,pins = <45>; - brcm,function = ; - }; - - sdhost_gpio48: sdhost_gpio48 { - brcm,pins = <48 49 50 51 52 53>; - brcm,function = ; - }; - - spi0_gpio7: spi0_gpio7 { - brcm,pins = <7 8 9 10 11>; - brcm,function = ; - }; - spi0_gpio35: spi0_gpio35 { - brcm,pins = <35 36 37 38 39>; - brcm,function = ; - }; - spi1_gpio16: spi1_gpio16 { - brcm,pins = <16 17 18 19 20 21>; - brcm,function = ; - }; - spi2_gpio40: spi2_gpio40 { - brcm,pins = <40 41 42 43 44 45>; - brcm,function = ; - }; - - uart0_gpio14: uart0_gpio14 { - brcm,pins = <14 15>; - brcm,function = ; - }; - /* Separate from the uart0_gpio14 group - * because it conflicts with spi1_gpio16, and - * people often run uart0 on the two pins - * without flow control. - */ - uart0_ctsrts_gpio16: uart0_ctsrts_gpio16 { - brcm,pins = <16 17>; - brcm,function = ; - }; - uart0_ctsrts_gpio30: uart0_ctsrts_gpio30 { - brcm,pins = <30 31>; - brcm,function = ; - }; - uart0_gpio32: uart0_gpio32 { - brcm,pins = <32 33>; - brcm,function = ; - }; - uart0_gpio36: uart0_gpio36 { - brcm,pins = <36 37>; - brcm,function = ; - }; - uart0_ctsrts_gpio38: uart0_ctsrts_gpio38 { - brcm,pins = <38 39>; - brcm,function = ; - }; - - uart1_gpio14: uart1_gpio14 { - brcm,pins = <14 15>; - brcm,function = ; - }; - uart1_ctsrts_gpio16: uart1_ctsrts_gpio16 { - brcm,pins = <16 17>; - brcm,function = ; - }; - uart1_gpio32: uart1_gpio32 { - brcm,pins = <32 33>; - brcm,function = ; - }; - uart1_ctsrts_gpio30: uart1_ctsrts_gpio30 { - brcm,pins = <30 31>; - brcm,function = ; - }; - uart1_gpio40: uart1_gpio40 { - brcm,pins = <40 41>; - brcm,function = ; - }; - uart1_ctsrts_gpio42: uart1_ctsrts_gpio42 { - brcm,pins = <42 43>; - brcm,function = ; - }; - }; - - uart0: serial@7e201000 { - compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell"; - reg = <0x7e201000 0x1000>; - interrupts = <2 25>; - clocks = <&clocks BCM2835_CLOCK_UART>, - <&clocks BCM2835_CLOCK_VPU>; - clock-names = "uartclk", "apb_pclk"; - arm,primecell-periphid = <0x00241011>; - }; - - sdhost: mmc@7e202000 { - compatible = "brcm,bcm2835-sdhost"; - reg = <0x7e202000 0x100>; - interrupts = <2 24>; - clocks = <&clocks BCM2835_CLOCK_VPU>; - dmas = <&dma 13>; - dma-names = "rx-tx"; - status = "disabled"; - }; - - i2s: i2s@7e203000 { - compatible = "brcm,bcm2835-i2s"; - reg = <0x7e203000 0x20>, - <0x7e101098 0x02>; - - dmas = <&dma 2>, - <&dma 3>; - dma-names = "tx", "rx"; - status = "disabled"; - }; - - spi: spi@7e204000 { - compatible = "brcm,bcm2835-spi"; - reg = <0x7e204000 0x1000>; - interrupts = <2 22>; - clocks = <&clocks BCM2835_CLOCK_VPU>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - }; - - i2c0: i2c@7e205000 { - compatible = "brcm,bcm2835-i2c"; - reg = <0x7e205000 0x1000>; - interrupts = <2 21>; - clocks = <&clocks BCM2835_CLOCK_VPU>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - }; - - pixelvalve@7e206000 { - compatible = "brcm,bcm2835-pixelvalve0"; - reg = <0x7e206000 0x100>; - interrupts = <2 13>; /* pwa0 */ - }; - - pixelvalve@7e207000 { - compatible = "brcm,bcm2835-pixelvalve1"; - reg = <0x7e207000 0x100>; - interrupts = <2 14>; /* pwa1 */ - }; - - dsi0: dsi@7e209000 { - compatible = "brcm,bcm2835-dsi0"; - reg = <0x7e209000 0x78>; - interrupts = <2 4>; - #address-cells = <1>; - #size-cells = <0>; - #clock-cells = <1>; - - clocks = <&clocks BCM2835_PLLA_DSI0>, - <&clocks BCM2835_CLOCK_DSI0E>, - <&clocks BCM2835_CLOCK_DSI0P>; - clock-names = "phy", "escape", "pixel"; - - clock-output-names = "dsi0_byte", - "dsi0_ddr2", - "dsi0_ddr"; - - }; - - thermal: thermal@7e212000 { - compatible = "brcm,bcm2835-thermal"; - reg = <0x7e212000 0x8>; - clocks = <&clocks BCM2835_CLOCK_TSENS>; - #thermal-sensor-cells = <0>; - status = "disabled"; - }; - - aux: aux@0x7e215000 { - compatible = "brcm,bcm2835-aux"; - #clock-cells = <1>; - reg = <0x7e215000 0x8>; - clocks = <&clocks BCM2835_CLOCK_VPU>; - }; - - uart1: serial@7e215040 { - compatible = "brcm,bcm2835-aux-uart"; - reg = <0x7e215040 0x40>; - interrupts = <1 29>; - clocks = <&aux BCM2835_AUX_CLOCK_UART>; - status = "disabled"; - }; - - spi1: spi@7e215080 { - compatible = "brcm,bcm2835-aux-spi"; - reg = <0x7e215080 0x40>; - interrupts = <1 29>; - clocks = <&aux BCM2835_AUX_CLOCK_SPI1>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - }; - - spi2: spi@7e2150c0 { - compatible = "brcm,bcm2835-aux-spi"; - reg = <0x7e2150c0 0x40>; - interrupts = <1 29>; - clocks = <&aux BCM2835_AUX_CLOCK_SPI2>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - }; - - pwm: pwm@7e20c000 { - compatible = "brcm,bcm2835-pwm"; - reg = <0x7e20c000 0x28>; - clocks = <&clocks BCM2835_CLOCK_PWM>; - assigned-clocks = <&clocks BCM2835_CLOCK_PWM>; - assigned-clock-rates = <10000000>; - #pwm-cells = <2>; - status = "disabled"; - }; - - sdhci: sdhci@7e300000 { - compatible = "brcm,bcm2835-sdhci"; - reg = <0x7e300000 0x100>; - interrupts = <2 30>; - clocks = <&clocks BCM2835_CLOCK_EMMC>; - status = "disabled"; - }; - - hvs@7e400000 { - compatible = "brcm,bcm2835-hvs"; - reg = <0x7e400000 0x6000>; - interrupts = <2 1>; - }; - - dsi1: dsi@7e700000 { - compatible = "brcm,bcm2835-dsi1"; - reg = <0x7e700000 0x8c>; - interrupts = <2 12>; - #address-cells = <1>; - #size-cells = <0>; - #clock-cells = <1>; - - clocks = <&clocks BCM2835_PLLD_DSI1>, - <&clocks BCM2835_CLOCK_DSI1E>, - <&clocks BCM2835_CLOCK_DSI1P>; - clock-names = "phy", "escape", "pixel"; - - clock-output-names = "dsi1_byte", - "dsi1_ddr2", - "dsi1_ddr"; - - status = "disabled"; - }; - - i2c1: i2c@7e804000 { - compatible = "brcm,bcm2835-i2c"; - reg = <0x7e804000 0x1000>; - interrupts = <2 21>; - clocks = <&clocks BCM2835_CLOCK_VPU>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - }; - - i2c2: i2c@7e805000 { - compatible = "brcm,bcm2835-i2c"; - reg = <0x7e805000 0x1000>; - interrupts = <2 21>; - clocks = <&clocks BCM2835_CLOCK_VPU>; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - }; - - vec: vec@7e806000 { - compatible = "brcm,bcm2835-vec"; - reg = <0x7e806000 0x1000>; - clocks = <&clocks BCM2835_CLOCK_VEC>; - interrupts = <2 27>; - status = "disabled"; - }; - - pixelvalve@7e807000 { - compatible = "brcm,bcm2835-pixelvalve2"; - reg = <0x7e807000 0x100>; - interrupts = <2 10>; /* pixelvalve */ - }; - - hdmi: hdmi@7e902000 { - compatible = "brcm,bcm2835-hdmi"; - reg = <0x7e902000 0x600>, - <0x7e808000 0x100>; - interrupts = <2 8>, <2 9>; - ddc = <&i2c2>; - clocks = <&clocks BCM2835_PLLH_PIX>, - <&clocks BCM2835_CLOCK_HSM>; - clock-names = "pixel", "hdmi"; - dmas = <&dma 17>; - dma-names = "audio-rx"; - status = "disabled"; - }; - - usb: usb@7e980000 { - compatible = "brcm,bcm2835-usb"; - reg = <0x7e980000 0x10000>; - interrupts = <1 9>; - #address-cells = <1>; - #size-cells = <0>; - clocks = <&clk_usb>; - clock-names = "otg"; - phys = <&usbphy>; - phy-names = "usb2-phy"; - }; - - v3d: v3d@7ec00000 { - compatible = "brcm,bcm2835-v3d"; - reg = <0x7ec00000 0x1000>; - interrupts = <1 10>; - }; - - vc4: gpu { - compatible = "brcm,bcm2835-vc4"; - }; - }; - - clocks { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <0>; - - /* The oscillator is the root of the clock tree. */ - clk_osc: clock@3 { - compatible = "fixed-clock"; - reg = <3>; - #clock-cells = <0>; - clock-output-names = "osc"; - clock-frequency = <19200000>; - }; - - clk_usb: clock@4 { - compatible = "fixed-clock"; - reg = <4>; - #clock-cells = <0>; - clock-output-names = "otg"; - clock-frequency = <480000000>; - }; - }; - - usbphy: phy { - compatible = "usb-nop-xceiv"; - }; -}; diff --git a/src/arm64/broadcom/ns2-clock.dtsi b/src/arm64/broadcom/northstar2/ns2-clock.dtsi similarity index 100% rename from src/arm64/broadcom/ns2-clock.dtsi rename to src/arm64/broadcom/northstar2/ns2-clock.dtsi diff --git a/src/arm64/broadcom/ns2-svk.dts b/src/arm64/broadcom/northstar2/ns2-svk.dts similarity index 100% rename from src/arm64/broadcom/ns2-svk.dts rename to src/arm64/broadcom/northstar2/ns2-svk.dts diff --git a/src/arm64/broadcom/ns2-xmc.dts b/src/arm64/broadcom/northstar2/ns2-xmc.dts similarity index 100% rename from src/arm64/broadcom/ns2-xmc.dts rename to src/arm64/broadcom/northstar2/ns2-xmc.dts diff --git a/src/arm64/broadcom/ns2.dtsi b/src/arm64/broadcom/northstar2/ns2.dtsi similarity index 100% rename from src/arm64/broadcom/ns2.dtsi rename to src/arm64/broadcom/northstar2/ns2.dtsi diff --git a/src/arm64/broadcom/stingray/bcm958742-base.dtsi b/src/arm64/broadcom/stingray/bcm958742-base.dtsi index 5dca7d10253b..8862ec907fd8 100644 --- a/src/arm64/broadcom/stingray/bcm958742-base.dtsi +++ b/src/arm64/broadcom/stingray/bcm958742-base.dtsi @@ -72,6 +72,78 @@ <0x00000008 0x80000000 0x1 0x80000000>; /* 6G @ 34G */ }; +&sata0 { + status = "okay"; +}; + +&sata_phy0{ + status = "okay"; +}; + +&sata1 { + status = "okay"; +}; + +&sata_phy1{ + status = "okay"; +}; + +&sata2 { + status = "okay"; +}; + +&sata_phy2{ + status = "okay"; +}; + +&sata3 { + status = "okay"; +}; + +&sata_phy3{ + status = "okay"; +}; + +&sata4 { + status = "okay"; +}; + +&sata_phy4{ + status = "okay"; +}; + +&sata5 { + status = "okay"; +}; + +&sata_phy5{ + status = "okay"; +}; + +&sata6 { + status = "okay"; +}; + +&sata_phy6{ + status = "okay"; +}; + +&sata7 { + status = "okay"; +}; + +&sata_phy7{ + status = "okay"; +}; + +&mdio_mux_iproc { + mdio@10 { + gphy0: eth-phy@10 { + reg = <0x10>; + }; + }; +}; + &uart1 { status = "okay"; }; @@ -102,6 +174,12 @@ }; }; +&enet { + phy-mode = "rgmii-id"; + phy-handle = <&gphy0>; + status = "okay"; +}; + &nand { status = "ok"; nandcs@0 { diff --git a/src/arm64/broadcom/stingray/bcm958742k.dts b/src/arm64/broadcom/stingray/bcm958742k.dts index 5671669ba348..eb6f08cdbd79 100644 --- a/src/arm64/broadcom/stingray/bcm958742k.dts +++ b/src/arm64/broadcom/stingray/bcm958742k.dts @@ -39,6 +39,10 @@ model = "Stingray Combo SVK (BCM958742K)"; }; +&gphy0 { + enet-phy-lane-swap; +}; + &uart2 { status = "okay"; }; diff --git a/src/arm64/broadcom/stingray/bcm958742t.dts b/src/arm64/broadcom/stingray/bcm958742t.dts index 6ebe399fda6a..5084b037320f 100644 --- a/src/arm64/broadcom/stingray/bcm958742t.dts +++ b/src/arm64/broadcom/stingray/bcm958742t.dts @@ -38,3 +38,7 @@ compatible = "brcm,bcm958742t", "brcm,stingray"; model = "Stingray SST100 (BCM958742T)"; }; + +&gphy0 { + enet-phy-lane-swap; +}; diff --git a/src/arm64/broadcom/stingray/stingray-fs4.dtsi b/src/arm64/broadcom/stingray/stingray-fs4.dtsi new file mode 100644 index 000000000000..8bf1dc6b46ca --- /dev/null +++ b/src/arm64/broadcom/stingray/stingray-fs4.dtsi @@ -0,0 +1,118 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2016-2017 Broadcom. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + fs4: fs4 { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x67000000 0x00800000>; + + crypto_mbox: crypto_mbox@00000000 { + compatible = "brcm,iproc-flexrm-mbox"; + reg = <0x00000000 0x200000>; + msi-parent = <&gic_its 0x4100>; + #mbox-cells = <3>; + dma-coherent; + }; + + raid_mbox: raid_mbox@00400000 { + compatible = "brcm,iproc-flexrm-mbox"; + reg = <0x00400000 0x200000>; + dma-coherent; + msi-parent = <&gic_its 0x4300>; + #mbox-cells = <3>; + }; + + raid0: raid@0 { + compatible = "brcm,iproc-sba-v2"; + mboxes = <&raid_mbox 0 0x1 0xff00>, + <&raid_mbox 1 0x1 0xff00>, + <&raid_mbox 2 0x1 0xff00>, + <&raid_mbox 3 0x1 0xff00>; + }; + + raid1: raid@1 { + compatible = "brcm,iproc-sba-v2"; + mboxes = <&raid_mbox 4 0x1 0xff00>, + <&raid_mbox 5 0x1 0xff00>, + <&raid_mbox 6 0x1 0xff00>, + <&raid_mbox 7 0x1 0xff00>; + }; + + raid2: raid@2 { + compatible = "brcm,iproc-sba-v2"; + mboxes = <&raid_mbox 8 0x1 0xff00>, + <&raid_mbox 9 0x1 0xff00>, + <&raid_mbox 10 0x1 0xff00>, + <&raid_mbox 11 0x1 0xff00>; + }; + + raid3: raid@3 { + compatible = "brcm,iproc-sba-v2"; + mboxes = <&raid_mbox 12 0x1 0xff00>, + <&raid_mbox 13 0x1 0xff00>, + <&raid_mbox 14 0x1 0xff00>, + <&raid_mbox 15 0x1 0xff00>; + }; + + raid4: raid@4 { + compatible = "brcm,iproc-sba-v2"; + mboxes = <&raid_mbox 16 0x1 0xff00>, + <&raid_mbox 17 0x1 0xff00>, + <&raid_mbox 18 0x1 0xff00>, + <&raid_mbox 19 0x1 0xff00>; + }; + + raid5: raid@5 { + compatible = "brcm,iproc-sba-v2"; + mboxes = <&raid_mbox 20 0x1 0xff00>, + <&raid_mbox 21 0x1 0xff00>, + <&raid_mbox 22 0x1 0xff00>, + <&raid_mbox 23 0x1 0xff00>; + }; + + raid6: raid@6 { + compatible = "brcm,iproc-sba-v2"; + mboxes = <&raid_mbox 24 0x1 0xff00>, + <&raid_mbox 25 0x1 0xff00>, + <&raid_mbox 26 0x1 0xff00>, + <&raid_mbox 27 0x1 0xff00>; + }; + + raid7: raid@7 { + compatible = "brcm,iproc-sba-v2"; + mboxes = <&raid_mbox 28 0x1 0xff00>, + <&raid_mbox 29 0x1 0xff00>, + <&raid_mbox 30 0x1 0xff00>, + <&raid_mbox 31 0x1 0xff00>; + }; + }; diff --git a/src/arm64/broadcom/stingray/stingray-sata.dtsi b/src/arm64/broadcom/stingray/stingray-sata.dtsi new file mode 100644 index 000000000000..a774709388df --- /dev/null +++ b/src/arm64/broadcom/stingray/stingray-sata.dtsi @@ -0,0 +1,278 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2016-2017 Broadcom. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + sata { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x67d00000 0x00800000>; + + sata0: ahci@00210000 { + compatible = "brcm,iproc-ahci", "generic-ahci"; + reg = <0x00210000 0x1000>; + reg-names = "ahci"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata0_port0: sata-port@0 { + reg = <0>; + phys = <&sata0_phy0>; + phy-names = "sata-phy"; + }; + }; + + sata_phy0: sata_phy@00212100 { + compatible = "brcm,iproc-sr-sata-phy"; + reg = <0x00212100 0x1000>; + reg-names = "phy"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata0_phy0: sata-phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + }; + + sata1: ahci@00310000 { + compatible = "brcm,iproc-ahci", "generic-ahci"; + reg = <0x00310000 0x1000>; + reg-names = "ahci"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata1_port0: sata-port@0 { + reg = <0>; + phys = <&sata1_phy0>; + phy-names = "sata-phy"; + }; + }; + + sata_phy1: sata_phy@00312100 { + compatible = "brcm,iproc-sr-sata-phy"; + reg = <0x00312100 0x1000>; + reg-names = "phy"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata1_phy0: sata-phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + }; + + sata2: ahci@00120000 { + compatible = "brcm,iproc-ahci", "generic-ahci"; + reg = <0x00120000 0x1000>; + reg-names = "ahci"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata2_port0: sata-port@0 { + reg = <0>; + phys = <&sata2_phy0>; + phy-names = "sata-phy"; + }; + }; + + sata_phy2: sata_phy@00122100 { + compatible = "brcm,iproc-sr-sata-phy"; + reg = <0x00122100 0x1000>; + reg-names = "phy"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata2_phy0: sata-phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + }; + + sata3: ahci@00130000 { + compatible = "brcm,iproc-ahci", "generic-ahci"; + reg = <0x00130000 0x1000>; + reg-names = "ahci"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata3_port0: sata-port@0 { + reg = <0>; + phys = <&sata3_phy0>; + phy-names = "sata-phy"; + }; + }; + + sata_phy3: sata_phy@00132100 { + compatible = "brcm,iproc-sr-sata-phy"; + reg = <0x00132100 0x1000>; + reg-names = "phy"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata3_phy0: sata-phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + }; + + sata4: ahci@00330000 { + compatible = "brcm,iproc-ahci", "generic-ahci"; + reg = <0x00330000 0x1000>; + reg-names = "ahci"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata4_port0: sata-port@0 { + reg = <0>; + phys = <&sata4_phy0>; + phy-names = "sata-phy"; + }; + }; + + sata_phy4: sata_phy@00332100 { + compatible = "brcm,iproc-sr-sata-phy"; + reg = <0x00332100 0x1000>; + reg-names = "phy"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata4_phy0: sata-phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + }; + + sata5: ahci@00400000 { + compatible = "brcm,iproc-ahci", "generic-ahci"; + reg = <0x00400000 0x1000>; + reg-names = "ahci"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata5_port0: sata-port@0 { + reg = <0>; + phys = <&sata5_phy0>; + phy-names = "sata-phy"; + }; + }; + + sata_phy5: sata_phy@00402100 { + compatible = "brcm,iproc-sr-sata-phy"; + reg = <0x00402100 0x1000>; + reg-names = "phy"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata5_phy0: sata-phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + }; + + sata6: ahci@00410000 { + compatible = "brcm,iproc-ahci", "generic-ahci"; + reg = <0x00410000 0x1000>; + reg-names = "ahci"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata6_port0: sata-port@0 { + reg = <0>; + phys = <&sata6_phy0>; + phy-names = "sata-phy"; + }; + }; + + sata_phy6: sata_phy@00412100 { + compatible = "brcm,iproc-sr-sata-phy"; + reg = <0x00412100 0x1000>; + reg-names = "phy"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata6_phy0: sata-phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + }; + + sata7: ahci@00420000 { + compatible = "brcm,iproc-ahci", "generic-ahci"; + reg = <0x00420000 0x1000>; + reg-names = "ahci"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata7_port0: sata-port@0 { + reg = <0>; + phys = <&sata7_phy0>; + phy-names = "sata-phy"; + }; + }; + + sata_phy7: sata_phy@00422100 { + compatible = "brcm,iproc-sr-sata-phy"; + reg = <0x00422100 0x1000>; + reg-names = "phy"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + sata7_phy0: sata-phy@0 { + reg = <0>; + #phy-cells = <0>; + }; + }; + }; diff --git a/src/arm64/broadcom/stingray/stingray.dtsi b/src/arm64/broadcom/stingray/stingray.dtsi index 49933cf16c92..e6f75c633623 100644 --- a/src/arm64/broadcom/stingray/stingray.dtsi +++ b/src/arm64/broadcom/stingray/stingray.dtsi @@ -152,6 +152,12 @@ #size-cells = <1>; ranges = <0x0 0x0 0x61000000 0x05000000>; + ccn: ccn@00000000 { + compatible = "arm,ccn-502"; + reg = <0x00000000 0x900000>; + interrupts = ; + }; + gic: interrupt-controller@02c00000 { compatible = "arm,gic-v3"; #interrupt-cells = <3>; @@ -261,6 +267,9 @@ }; }; + #include "stingray-fs4.dtsi" + #include "stingray-sata.dtsi" + hsls { compatible = "simple-bus"; #address-cells = <1>; @@ -269,6 +278,37 @@ #include "stingray-pinctrl.dtsi" + mdio_mux_iproc: mdio-mux@0002023c { + compatible = "brcm,mdio-mux-iproc"; + reg = <0x0002023c 0x14>; + #address-cells = <1>; + #size-cells = <0>; + + mdio@0 { /* PCIe serdes */ + reg = <0x0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + mdio@2 { /* SATA */ + reg = <0x2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + mdio@3 { /* USB */ + reg = <0x3>; + #address-cells = <1>; + #size-cells = <0>; + }; + + mdio@10 { /* RGMII */ + reg = <0x10>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + pwm: pwm@00010000 { compatible = "brcm,iproc-pwm"; reg = <0x00010000 0x1000>; @@ -277,6 +317,93 @@ status = "disabled"; }; + timer0: timer@00030000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x00030000 0x1000>; + interrupts = ; + clocks = <&hsls_25m_div2_clk>, + <&hsls_25m_div2_clk>, + <&hsls_div4_clk>; + clock-names = "timer1", "timer2", "apb_pclk"; + status = "disabled"; + }; + + timer1: timer@00040000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x00040000 0x1000>; + interrupts = ; + clocks = <&hsls_25m_div2_clk>, + <&hsls_25m_div2_clk>, + <&hsls_div4_clk>; + clock-names = "timer1", "timer2", "apb_pclk"; + }; + + timer2: timer@00050000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x00050000 0x1000>; + interrupts = ; + clocks = <&hsls_25m_div2_clk>, + <&hsls_25m_div2_clk>, + <&hsls_div4_clk>; + clock-names = "timer1", "timer2", "apb_pclk"; + status = "disabled"; + }; + + timer3: timer@00060000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x00060000 0x1000>; + interrupts = ; + clocks = <&hsls_25m_div2_clk>, + <&hsls_25m_div2_clk>, + <&hsls_div4_clk>; + clock-names = "timer1", "timer2", "apb_pclk"; + status = "disabled"; + }; + + timer4: timer@00070000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x00070000 0x1000>; + interrupts = ; + clocks = <&hsls_25m_div2_clk>, + <&hsls_25m_div2_clk>, + <&hsls_div4_clk>; + clock-names = "timer1", "timer2", "apb_pclk"; + status = "disabled"; + }; + + timer5: timer@00080000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x00080000 0x1000>; + interrupts = ; + clocks = <&hsls_25m_div2_clk>, + <&hsls_25m_div2_clk>, + <&hsls_div4_clk>; + clock-names = "timer1", "timer2", "apb_pclk"; + status = "disabled"; + }; + + timer6: timer@00090000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x00090000 0x1000>; + interrupts = ; + clocks = <&hsls_25m_div2_clk>, + <&hsls_25m_div2_clk>, + <&hsls_div4_clk>; + clock-names = "timer1", "timer2", "apb_pclk"; + status = "disabled"; + }; + + timer7: timer@000a0000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x000a0000 0x1000>; + interrupts = ; + clocks = <&hsls_25m_div2_clk>, + <&hsls_25m_div2_clk>, + <&hsls_div4_clk>; + clock-names = "timer1", "timer2", "apb_pclk"; + status = "disabled"; + }; + i2c0: i2c@000b0000 { compatible = "brcm,iproc-i2c"; reg = <0x000b0000 0x100>; @@ -424,6 +551,15 @@ iommus = <&smmu 0x6000 0x0000>; }; + enet: ethernet@00340000{ + compatible = "brcm,amac"; + reg = <0x00340000 0x1000>; + reg-names = "amac_base"; + dma-coherent; + interrupts = ; + status= "disabled"; + }; + nand: nand@00360000 { compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1"; reg = <0x00360000 0x600>, diff --git a/src/arm64/exynos/exynos5433-tm2-common.dtsi b/src/arm64/exynos/exynos5433-tm2-common.dtsi index e2b0da2c0bc7..297597442c44 100644 --- a/src/arm64/exynos/exynos5433-tm2-common.dtsi +++ b/src/arm64/exynos/exynos5433-tm2-common.dtsi @@ -280,9 +280,6 @@ &decon { status = "okay"; - - i80-if-timings { - }; }; &decon_tv { @@ -310,20 +307,6 @@ samsung,pll-clock-frequency = <24000000>; pinctrl-names = "default"; pinctrl-0 = <&te_irq>; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@1 { - reg = <1>; - - dsi_out: endpoint { - samsung,burst-clock-frequency = <512000000>; - samsung,esc-clock-frequency = <16000000>; - }; - }; - }; }; &hdmi { @@ -846,7 +829,6 @@ &mshc_0 { status = "okay"; - num-slots = <1>; mmc-hs200-1_8v; mmc-hs400-1_8v; cap-mmc-highspeed; @@ -868,7 +850,6 @@ &mshc_2 { status = "okay"; - num-slots = <1>; cap-sd-highspeed; disable-wp; cd-gpios = <&gpa2 4 GPIO_ACTIVE_HIGH>; @@ -1116,9 +1097,6 @@ &mic { status = "okay"; - - i80-if-timings { - }; }; &pmu_system_controller { @@ -1216,8 +1194,9 @@ status = "okay"; }; -&usbdrd_dwc3_0 { +&usbdrd_dwc3 { dr_mode = "otg"; + extcon = <&muic>; }; &usbdrd30_phy { diff --git a/src/arm64/exynos/exynos5433.dtsi b/src/arm64/exynos/exynos5433.dtsi index 727f36abf3d4..7fe994b750da 100644 --- a/src/arm64/exynos/exynos5433.dtsi +++ b/src/arm64/exynos/exynos5433.dtsi @@ -1367,7 +1367,7 @@ ranges; status = "disabled"; - dwc3@15400000 { + usbdrd_dwc3: dwc3@15400000 { compatible = "snps,dwc3"; reg = <0x15400000 0x10000>; interrupts = ; @@ -1414,7 +1414,7 @@ ranges; status = "disabled"; - usbdrd_dwc3_0: dwc3@15a00000 { + usbhost_dwc3: dwc3@15a00000 { compatible = "snps,dwc3"; reg = <0x15a00000 0x10000>; interrupts = ; diff --git a/src/arm64/exynos/exynos7-espresso.dts b/src/arm64/exynos/exynos7-espresso.dts index e5892bb0ae6e..4a8b1fb51243 100644 --- a/src/arm64/exynos/exynos7-espresso.dts +++ b/src/arm64/exynos/exynos7-espresso.dts @@ -359,7 +359,6 @@ &mmc_0 { status = "okay"; - num-slots = <1>; cap-mmc-highspeed; mmc-hs200-1_8v; non-removable; @@ -375,7 +374,6 @@ &mmc_2 { status = "okay"; - num-slots = <1>; cap-sd-highspeed; card-detect-delay = <200>; clock-frequency = <400000000>; diff --git a/src/arm64/freescale/fsl-ls1012a.dtsi b/src/arm64/freescale/fsl-ls1012a.dtsi index b1554cbd2c54..df83915d6ea6 100644 --- a/src/arm64/freescale/fsl-ls1012a.dtsi +++ b/src/arm64/freescale/fsl-ls1012a.dtsi @@ -444,6 +444,15 @@ <&clockgen 4 3>; }; + usb0: usb3@2f00000 { + compatible = "snps,dwc3"; + reg = <0x0 0x2f00000 0x0 0x10000>; + interrupts = <0 60 0x4>; + dr_mode = "host"; + snps,quirk-frame-length-adjustment = <0x20>; + snps,dis_rxdet_inp3_quirk; + }; + sata: sata@3200000 { compatible = "fsl,ls1012a-ahci", "fsl,ls1043a-ahci"; reg = <0x0 0x3200000 0x0 0x10000>, @@ -454,5 +463,13 @@ dma-coherent; status = "disabled"; }; + + usb1: usb2@8600000 { + compatible = "fsl-usb2-dr-v2.5", "fsl-usb2-dr"; + reg = <0x0 0x8600000 0x0 0x1000>; + interrupts = <0 139 0x4>; + dr_mode = "host"; + phy_type = "ulpi"; + }; }; }; diff --git a/src/arm64/freescale/fsl-ls1043a.dtsi b/src/arm64/freescale/fsl-ls1043a.dtsi index 31fd77f82ced..d16b9cc1e825 100644 --- a/src/arm64/freescale/fsl-ls1043a.dtsi +++ b/src/arm64/freescale/fsl-ls1043a.dtsi @@ -653,21 +653,21 @@ }; msi1: msi-controller1@1571000 { - compatible = "fsl,1s1043a-msi"; + compatible = "fsl,ls1043a-msi"; reg = <0x0 0x1571000 0x0 0x8>; msi-controller; interrupts = <0 116 0x4>; }; msi2: msi-controller2@1572000 { - compatible = "fsl,1s1043a-msi"; + compatible = "fsl,ls1043a-msi"; reg = <0x0 0x1572000 0x0 0x8>; msi-controller; interrupts = <0 126 0x4>; }; msi3: msi-controller3@1573000 { - compatible = "fsl,1s1043a-msi"; + compatible = "fsl,ls1043a-msi"; reg = <0x0 0x1573000 0x0 0x8>; msi-controller; interrupts = <0 160 0x4>; @@ -689,7 +689,7 @@ bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000 /* downstream I/O */ 0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ - msi-parent = <&msi1>; + msi-parent = <&msi1>, <&msi2>, <&msi3>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 7>; interrupt-map = <0000 0 0 1 &gic 0 110 0x4>, @@ -714,7 +714,7 @@ bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x00000000 0x48 0x00010000 0x0 0x00010000 /* downstream I/O */ 0x82000000 0x0 0x40000000 0x48 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ - msi-parent = <&msi2>; + msi-parent = <&msi1>, <&msi2>, <&msi3>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 7>; interrupt-map = <0000 0 0 1 &gic 0 120 0x4>, @@ -739,7 +739,7 @@ bus-range = <0x0 0xff>; ranges = <0x81000000 0x0 0x00000000 0x50 0x00010000 0x0 0x00010000 /* downstream I/O */ 0x82000000 0x0 0x40000000 0x50 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ - msi-parent = <&msi3>; + msi-parent = <&msi1>, <&msi2>, <&msi3>; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 7>; interrupt-map = <0000 0 0 1 &gic 0 154 0x4>, diff --git a/src/arm64/freescale/fsl-ls1046a.dtsi b/src/arm64/freescale/fsl-ls1046a.dtsi index dc1640be0345..c8ff0baddf1d 100644 --- a/src/arm64/freescale/fsl-ls1046a.dtsi +++ b/src/arm64/freescale/fsl-ls1046a.dtsi @@ -630,6 +630,37 @@ interrupts = ; clocks = <&clockgen 4 1>; }; + + msi1: msi-controller@1580000 { + compatible = "fsl,ls1046a-msi"; + msi-controller; + reg = <0x0 0x1580000 0x0 0x10000>; + interrupts = , + , + , + ; + }; + + msi2: msi-controller@1590000 { + compatible = "fsl,ls1046a-msi"; + msi-controller; + reg = <0x0 0x1590000 0x0 0x10000>; + interrupts = , + , + , + ; + }; + + msi3: msi-controller@15a0000 { + compatible = "fsl,ls1046a-msi"; + msi-controller; + reg = <0x0 0x15a0000 0x0 0x10000>; + interrupts = , + , + , + ; + }; + }; reserved-memory { diff --git a/src/arm64/freescale/fsl-ls1088a-rdb.dts b/src/arm64/freescale/fsl-ls1088a-rdb.dts index 213abb72de93..0f6fcda36b9e 100644 --- a/src/arm64/freescale/fsl-ls1088a-rdb.dts +++ b/src/arm64/freescale/fsl-ls1088a-rdb.dts @@ -49,7 +49,7 @@ #include "fsl-ls1088a.dtsi" / { - model = "L1088A RDB Board"; + model = "LS1088A RDB Board"; compatible = "fsl,ls1088a-rdb", "fsl,ls1088a"; }; diff --git a/src/arm64/freescale/fsl-ls1088a.dtsi b/src/arm64/freescale/fsl-ls1088a.dtsi index c144d06a6e33..33797b373674 100644 --- a/src/arm64/freescale/fsl-ls1088a.dtsi +++ b/src/arm64/freescale/fsl-ls1088a.dtsi @@ -52,6 +52,10 @@ #address-cells = <2>; #size-cells = <2>; + aliases { + crypto = &crypto; + }; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -62,6 +66,7 @@ compatible = "arm,cortex-a53"; reg = <0x0>; clocks = <&clockgen 1 0>; + cpu-idle-states = <&CPU_PH20>; #cooling-cells = <2>; }; @@ -70,6 +75,7 @@ compatible = "arm,cortex-a53"; reg = <0x1>; clocks = <&clockgen 1 0>; + cpu-idle-states = <&CPU_PH20>; }; cpu2: cpu@2 { @@ -77,6 +83,7 @@ compatible = "arm,cortex-a53"; reg = <0x2>; clocks = <&clockgen 1 0>; + cpu-idle-states = <&CPU_PH20>; }; cpu3: cpu@3 { @@ -84,6 +91,7 @@ compatible = "arm,cortex-a53"; reg = <0x3>; clocks = <&clockgen 1 0>; + cpu-idle-states = <&CPU_PH20>; }; cpu4: cpu@100 { @@ -91,6 +99,7 @@ compatible = "arm,cortex-a53"; reg = <0x100>; clocks = <&clockgen 1 1>; + cpu-idle-states = <&CPU_PH20>; #cooling-cells = <2>; }; @@ -99,6 +108,7 @@ compatible = "arm,cortex-a53"; reg = <0x101>; clocks = <&clockgen 1 1>; + cpu-idle-states = <&CPU_PH20>; }; cpu6: cpu@102 { @@ -106,6 +116,7 @@ compatible = "arm,cortex-a53"; reg = <0x102>; clocks = <&clockgen 1 1>; + cpu-idle-states = <&CPU_PH20>; }; cpu7: cpu@103 { @@ -113,6 +124,16 @@ compatible = "arm,cortex-a53"; reg = <0x103>; clocks = <&clockgen 1 1>; + cpu-idle-states = <&CPU_PH20>; + }; + + CPU_PH20: cpu-ph20 { + compatible = "arm,idle-state"; + idle-state-name = "PH20"; + arm,psci-suspend-param = <0x00010000>; + entry-latency-us = <1000>; + exit-latency-us = <1000>; + min-residency-us = <3000>; }; }; @@ -136,6 +157,11 @@ <1 10 IRQ_TYPE_LEVEL_LOW>;/* Hypervisor PPI */ }; + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + sysclk: sysclk { compatible = "fixed-clock"; #clock-cells = <0>; @@ -369,6 +395,45 @@ dma-coherent; status = "disabled"; }; + + crypto: crypto@8000000 { + compatible = "fsl,sec-v5.0", "fsl,sec-v4.0"; + fsl,sec-era = <8>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x00 0x8000000 0x100000>; + reg = <0x00 0x8000000 0x0 0x100000>; + interrupts = ; + dma-coherent; + + sec_jr0: jr@10000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x10000 0x10000>; + interrupts = ; + }; + + sec_jr1: jr@20000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x20000 0x10000>; + interrupts = ; + }; + + sec_jr2: jr@30000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x30000 0x10000>; + interrupts = ; + }; + + sec_jr3: jr@40000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x40000 0x10000>; + interrupts = ; + }; + }; }; }; diff --git a/src/arm64/freescale/fsl-ls2080a-qds.dts b/src/arm64/freescale/fsl-ls2080a-qds.dts index ed209cd57283..3c99608b9b45 100644 --- a/src/arm64/freescale/fsl-ls2080a-qds.dts +++ b/src/arm64/freescale/fsl-ls2080a-qds.dts @@ -55,11 +55,6 @@ model = "Freescale Layerscape 2080a QDS Board"; compatible = "fsl,ls2080a-qds", "fsl,ls2080a"; - aliases { - serial0 = &serial0; - serial1 = &serial1; - }; - chosen { stdout-path = "serial0:115200n8"; }; diff --git a/src/arm64/freescale/fsl-ls2080a-rdb.dts b/src/arm64/freescale/fsl-ls2080a-rdb.dts index 67ec3f9c81a1..a4e7de9f70d8 100644 --- a/src/arm64/freescale/fsl-ls2080a-rdb.dts +++ b/src/arm64/freescale/fsl-ls2080a-rdb.dts @@ -55,11 +55,6 @@ model = "Freescale Layerscape 2080a RDB Board"; compatible = "fsl,ls2080a-rdb", "fsl,ls2080a"; - aliases { - serial0 = &serial0; - serial1 = &serial1; - }; - chosen { stdout-path = "serial1:115200n8"; }; diff --git a/src/arm64/freescale/fsl-ls2080a-simu.dts b/src/arm64/freescale/fsl-ls2080a-simu.dts index 3ee718f0aaf8..fbbb73e571c0 100644 --- a/src/arm64/freescale/fsl-ls2080a-simu.dts +++ b/src/arm64/freescale/fsl-ls2080a-simu.dts @@ -52,11 +52,6 @@ model = "Freescale Layerscape 2080a software Simulator model"; compatible = "fsl,ls2080a-simu", "fsl,ls2080a"; - aliases { - serial0 = &serial0; - serial1 = &serial1; - }; - ethernet@2210000 { compatible = "smsc,lan91c111"; reg = <0x0 0x2210000 0x0 0x100>; diff --git a/src/arm64/freescale/fsl-ls2080a.dtsi b/src/arm64/freescale/fsl-ls2080a.dtsi index d789c6814e6a..8d739301e7b8 100644 --- a/src/arm64/freescale/fsl-ls2080a.dtsi +++ b/src/arm64/freescale/fsl-ls2080a.dtsi @@ -53,6 +53,7 @@ compatible = "arm,cortex-a57"; reg = <0x0>; clocks = <&clockgen 1 0>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster0_l2>; #cooling-cells = <2>; }; @@ -62,6 +63,7 @@ compatible = "arm,cortex-a57"; reg = <0x1>; clocks = <&clockgen 1 0>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster0_l2>; }; @@ -70,6 +72,7 @@ compatible = "arm,cortex-a57"; reg = <0x100>; clocks = <&clockgen 1 1>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster1_l2>; #cooling-cells = <2>; }; @@ -79,6 +82,7 @@ compatible = "arm,cortex-a57"; reg = <0x101>; clocks = <&clockgen 1 1>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster1_l2>; }; @@ -87,6 +91,7 @@ compatible = "arm,cortex-a57"; reg = <0x200>; clocks = <&clockgen 1 2>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster2_l2>; #cooling-cells = <2>; }; @@ -96,6 +101,7 @@ compatible = "arm,cortex-a57"; reg = <0x201>; clocks = <&clockgen 1 2>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster2_l2>; }; @@ -105,6 +111,7 @@ reg = <0x300>; clocks = <&clockgen 1 3>; next-level-cache = <&cluster3_l2>; + cpu-idle-states = <&CPU_PW20>; #cooling-cells = <2>; }; @@ -113,6 +120,7 @@ compatible = "arm,cortex-a57"; reg = <0x301>; clocks = <&clockgen 1 3>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster3_l2>; }; @@ -131,6 +139,15 @@ cluster3_l2: l2-cache3 { compatible = "cache"; }; + + CPU_PW20: cpu-pw20 { + compatible = "arm,idle-state"; + idle-state-name = "PW20"; + arm,psci-suspend-param = <0x00010000>; + entry-latency-us = <2000>; + exit-latency-us = <2000>; + min-residency-us = <6000>; + }; }; &pcie1 { diff --git a/src/arm64/freescale/fsl-ls2088a-qds.dts b/src/arm64/freescale/fsl-ls2088a-qds.dts index 4a1df5ce3229..eaee5b1c3a44 100644 --- a/src/arm64/freescale/fsl-ls2088a-qds.dts +++ b/src/arm64/freescale/fsl-ls2088a-qds.dts @@ -54,11 +54,6 @@ model = "Freescale Layerscape 2088A QDS Board"; compatible = "fsl,ls2088a-qds", "fsl,ls2088a"; - aliases { - serial0 = &serial0; - serial1 = &serial1; - }; - chosen { stdout-path = "serial0:115200n8"; }; diff --git a/src/arm64/freescale/fsl-ls2088a-rdb.dts b/src/arm64/freescale/fsl-ls2088a-rdb.dts index a76d4b4debd1..c411442cac62 100644 --- a/src/arm64/freescale/fsl-ls2088a-rdb.dts +++ b/src/arm64/freescale/fsl-ls2088a-rdb.dts @@ -54,11 +54,6 @@ model = "Freescale Layerscape 2088A RDB Board"; compatible = "fsl,ls2088a-rdb", "fsl,ls2088a"; - aliases { - serial0 = &serial0; - serial1 = &serial1; - }; - chosen { stdout-path = "serial1:115200n8"; }; diff --git a/src/arm64/freescale/fsl-ls2088a.dtsi b/src/arm64/freescale/fsl-ls2088a.dtsi index 5c695c658056..6aa319dae396 100644 --- a/src/arm64/freescale/fsl-ls2088a.dtsi +++ b/src/arm64/freescale/fsl-ls2088a.dtsi @@ -53,6 +53,7 @@ compatible = "arm,cortex-a72"; reg = <0x0>; clocks = <&clockgen 1 0>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster0_l2>; #cooling-cells = <2>; }; @@ -62,6 +63,7 @@ compatible = "arm,cortex-a72"; reg = <0x1>; clocks = <&clockgen 1 0>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster0_l2>; }; @@ -70,6 +72,7 @@ compatible = "arm,cortex-a72"; reg = <0x100>; clocks = <&clockgen 1 1>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster1_l2>; #cooling-cells = <2>; }; @@ -79,6 +82,7 @@ compatible = "arm,cortex-a72"; reg = <0x101>; clocks = <&clockgen 1 1>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster1_l2>; }; @@ -88,6 +92,7 @@ reg = <0x200>; clocks = <&clockgen 1 2>; next-level-cache = <&cluster2_l2>; + cpu-idle-states = <&CPU_PW20>; #cooling-cells = <2>; }; @@ -96,6 +101,7 @@ compatible = "arm,cortex-a72"; reg = <0x201>; clocks = <&clockgen 1 2>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster2_l2>; }; @@ -104,6 +110,7 @@ compatible = "arm,cortex-a72"; reg = <0x300>; clocks = <&clockgen 1 3>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster3_l2>; #cooling-cells = <2>; }; @@ -113,6 +120,7 @@ compatible = "arm,cortex-a72"; reg = <0x301>; clocks = <&clockgen 1 3>; + cpu-idle-states = <&CPU_PW20>; next-level-cache = <&cluster3_l2>; }; @@ -131,6 +139,15 @@ cluster3_l2: l2-cache3 { compatible = "cache"; }; + + CPU_PW20: cpu-pw20 { + compatible = "arm,idle-state"; + idle-state-name = "PW20"; + arm,psci-suspend-param = <0x00010000>; + entry-latency-us = <2000>; + exit-latency-us = <2000>; + min-residency-us = <6000>; + }; }; &pcie1 { diff --git a/src/arm64/freescale/fsl-ls208xa.dtsi b/src/arm64/freescale/fsl-ls208xa.dtsi index 94cdd3045037..4fb9a0966a84 100644 --- a/src/arm64/freescale/fsl-ls208xa.dtsi +++ b/src/arm64/freescale/fsl-ls208xa.dtsi @@ -46,6 +46,7 @@ */ #include +#include / { compatible = "fsl,ls2080a"; @@ -53,6 +54,12 @@ #address-cells = <2>; #size-cells = <2>; + aliases { + crypto = &crypto; + serial0 = &serial0; + serial1 = &serial1; + }; + cpu: cpus { #address-cells = <1>; #size-cells = <0>; @@ -118,6 +125,11 @@ interrupts = <1 7 0x8>; /* PMU PPI, Level low type */ }; + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + soc { compatible = "simple-bus"; #address-cells = <2>; @@ -301,6 +313,45 @@ clock-names = "apb_pclk", "wdog_clk"; }; + crypto: crypto@8000000 { + compatible = "fsl,sec-v5.0", "fsl,sec-v4.0"; + fsl,sec-era = <8>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x00 0x8000000 0x100000>; + reg = <0x00 0x8000000 0x0 0x100000>; + interrupts = ; + dma-coherent; + + sec_jr0: jr@10000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x10000 0x10000>; + interrupts = ; + }; + + sec_jr1: jr@20000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x20000 0x10000>; + interrupts = ; + }; + + sec_jr2: jr@30000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x30000 0x10000>; + interrupts = ; + }; + + sec_jr3: jr@40000 { + compatible = "fsl,sec-v5.0-job-ring", + "fsl,sec-v4.0-job-ring"; + reg = <0x40000 0x10000>; + interrupts = ; + }; + }; + fsl_mc: fsl-mc@80c000000 { compatible = "fsl,qoriq-mc"; reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */ diff --git a/src/arm64/hisilicon/hi3660-hikey960.dts b/src/arm64/hisilicon/hi3660-hikey960.dts index 6609b0fe7a8b..e9f87cb61ade 100644 --- a/src/arm64/hisilicon/hi3660-hikey960.dts +++ b/src/arm64/hisilicon/hi3660-hikey960.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dts file for Hisilicon HiKey960 Development Board * @@ -39,6 +40,34 @@ reg = <0x0 0x0 0x0 0x0>; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + ramoops@32000000 { + compatible = "ramoops"; + reg = <0x0 0x32000000 0x0 0x00100000>; + record-size = <0x00020000>; + console-size = <0x00020000>; + ftrace-size = <0x00020000>; + }; + }; + + reboot-mode-syscon@32100000 { + compatible = "syscon", "simple-mfd"; + reg = <0x0 0x32100000 0x0 0x00001000>; + + reboot-mode { + compatible = "syscon-reboot-mode"; + offset = <0x0>; + + mode-normal = <0x77665501>; + mode-bootloader = <0x77665500>; + mode-recovery = <0x77665502>; + }; + }; + keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -159,6 +188,13 @@ startup-delay-us = <70000>; enable-active-high; }; + + firmware { + optee { + compatible = "linaro,optee-tz"; + method = "smc"; + }; + }; }; &i2c0 { @@ -195,7 +231,7 @@ bluetooth { compatible = "ti,wl1837-st"; enable-gpios = <&gpio15 6 GPIO_ACTIVE_HIGH>; - max-speed = <921600>; + max-speed = <3000000>; }; }; diff --git a/src/arm64/hisilicon/hi3660.dtsi b/src/arm64/hisilicon/hi3660.dtsi index c6a1961e8d55..13ae69f5a327 100644 --- a/src/arm64/hisilicon/hi3660.dtsi +++ b/src/arm64/hisilicon/hi3660.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dts file for Hisilicon Hi3660 SoC * @@ -58,6 +59,8 @@ device_type = "cpu"; reg = <0x0 0x0>; enable-method = "psci"; + next-level-cache = <&A53_L2>; + cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; }; cpu1: cpu@1 { @@ -65,6 +68,8 @@ device_type = "cpu"; reg = <0x0 0x1>; enable-method = "psci"; + next-level-cache = <&A53_L2>; + cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; }; cpu2: cpu@2 { @@ -72,6 +77,8 @@ device_type = "cpu"; reg = <0x0 0x2>; enable-method = "psci"; + next-level-cache = <&A53_L2>; + cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; }; cpu3: cpu@3 { @@ -79,6 +86,8 @@ device_type = "cpu"; reg = <0x0 0x3>; enable-method = "psci"; + next-level-cache = <&A53_L2>; + cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; }; cpu4: cpu@100 { @@ -86,6 +95,12 @@ device_type = "cpu"; reg = <0x0 0x100>; enable-method = "psci"; + next-level-cache = <&A73_L2>; + cpu-idle-states = < + &CPU_NAP + &CPU_SLEEP + &CLUSTER_SLEEP_1 + >; }; cpu5: cpu@101 { @@ -93,6 +108,12 @@ device_type = "cpu"; reg = <0x0 0x101>; enable-method = "psci"; + next-level-cache = <&A73_L2>; + cpu-idle-states = < + &CPU_NAP + &CPU_SLEEP + &CLUSTER_SLEEP_1 + >; }; cpu6: cpu@102 { @@ -100,6 +121,12 @@ device_type = "cpu"; reg = <0x0 0x102>; enable-method = "psci"; + next-level-cache = <&A73_L2>; + cpu-idle-states = < + &CPU_NAP + &CPU_SLEEP + &CLUSTER_SLEEP_1 + >; }; cpu7: cpu@103 { @@ -107,6 +134,59 @@ device_type = "cpu"; reg = <0x0 0x103>; enable-method = "psci"; + next-level-cache = <&A73_L2>; + cpu-idle-states = < + &CPU_NAP + &CPU_SLEEP + &CLUSTER_SLEEP_1 + >; + }; + + idle-states { + entry-method = "psci"; + + CPU_NAP: cpu-nap { + compatible = "arm,idle-state"; + arm,psci-suspend-param = <0x0000001>; + entry-latency-us = <7>; + exit-latency-us = <2>; + min-residency-us = <15>; + }; + + CPU_SLEEP: cpu-sleep { + compatible = "arm,idle-state"; + local-timer-stop; + arm,psci-suspend-param = <0x0010000>; + entry-latency-us = <40>; + exit-latency-us = <70>; + min-residency-us = <3000>; + }; + + CLUSTER_SLEEP_0: cluster-sleep-0 { + compatible = "arm,idle-state"; + local-timer-stop; + arm,psci-suspend-param = <0x1010000>; + entry-latency-us = <500>; + exit-latency-us = <5000>; + min-residency-us = <20000>; + }; + + CLUSTER_SLEEP_1: cluster-sleep-1 { + compatible = "arm,idle-state"; + local-timer-stop; + arm,psci-suspend-param = <0x1010000>; + entry-latency-us = <1000>; + exit-latency-us = <5000>; + min-residency-us = <20000>; + }; + }; + + A53_L2: l2-cache0 { + compatible = "cache"; + }; + + A73_L2: l2-cache1 { + compatible = "cache"; }; }; @@ -123,6 +203,26 @@ IRQ_TYPE_LEVEL_HIGH)>; }; + pmu { + compatible = "arm,armv8-pmuv3"; + interrupts = , + , + , + , + , + , + , + ; + interrupt-affinity = <&cpu0>, + <&cpu1>, + <&cpu2>, + <&cpu3>, + <&cpu4>, + <&cpu5>, + <&cpu6>, + <&cpu7>; + }; + timer { compatible = "arm,armv8-timer"; interrupt-parent = <&gic>; @@ -337,6 +437,19 @@ status = "disabled"; }; + dma0: dma@fdf30000 { + compatible = "hisilicon,k3-dma-1.0"; + reg = <0x0 0xfdf30000 0x0 0x1000>; + #dma-cells = <1>; + dma-channels = <16>; + dma-requests = <32>; + dma-min-chan = <1>; + interrupts = ; + clocks = <&crg_ctrl HI3660_CLK_GATE_DMAC>; + dma-no-cci; + dma-type = "hi3660_dma"; + }; + rtc0: rtc@fff04000 { compatible = "arm,pl031", "arm,primecell"; reg = <0x0 0Xfff04000 0x0 0x1000>; @@ -810,6 +923,7 @@ clock-names = "ciu", "biu"; clock-frequency = <3200000>; resets = <&crg_rst 0x94 18>; + reset-names = "reset"; cd-gpios = <&gpio25 3 0>; hisilicon,peripheral-syscon = <&sctrl>; pinctrl-names = "default"; @@ -839,6 +953,7 @@ <&crg_ctrl HI3660_HCLK_GATE_SDIO0>; clock-names = "ciu", "biu"; resets = <&crg_rst 0x94 20>; + reset-names = "reset"; card-detect-delay = <200>; supports-highspeed; keep-power-in-suspend; @@ -848,5 +963,21 @@ &sdio_cfg_func>; status = "disabled"; }; + + watchdog0: watchdog@e8a06000 { + compatible = "arm,sp805-wdt", "arm,primecell"; + reg = <0x0 0xe8a06000 0x0 0x1000>; + interrupts = ; + clocks = <&crg_ctrl HI3660_OSC32K>; + clock-names = "apb_pclk"; + }; + + watchdog1: watchdog@e8a07000 { + compatible = "arm,sp805-wdt", "arm,primecell"; + reg = <0x0 0xe8a07000 0x0 0x1000>; + interrupts = ; + clocks = <&crg_ctrl HI3660_OSC32K>; + clock-names = "apb_pclk"; + }; }; }; diff --git a/src/arm64/hisilicon/hi6220-hikey.dts b/src/arm64/hisilicon/hi6220-hikey.dts index 2b526304ed27..3aee6123d161 100644 --- a/src/arm64/hisilicon/hi6220-hikey.dts +++ b/src/arm64/hisilicon/hi6220-hikey.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dts file for Hisilicon HiKey Development Board * diff --git a/src/arm64/hisilicon/hi6220.dtsi b/src/arm64/hisilicon/hi6220.dtsi index eacbe0db5bc2..ff1dc89f599e 100644 --- a/src/arm64/hisilicon/hi6220.dtsi +++ b/src/arm64/hisilicon/hi6220.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dts file for Hisilicon Hi6220 SoC * @@ -262,6 +263,12 @@ #clock-cells = <1>; }; + acpu_sctrl: acpu_sctrl@f6504000 { + compatible = "hisilicon,hi6220-acpu-sctrl", "syscon"; + reg = <0x0 0xf6504000 0x0 0x1000>; + #clock-cells = <1>; + }; + medianoc_ade: medianoc_ade@f4520000 { compatible = "syscon"; reg = <0x0 0xf4520000 0x0 0x4000>; @@ -755,7 +762,8 @@ dr_mode = "otg"; g-rx-fifo-size = <512>; g-np-tx-fifo-size = <128>; - g-tx-fifo-size = <128 128 128 128 128 128>; + g-tx-fifo-size = <128 128 128 128 128 128 128 128 + 16 16 16 16 16 16 16>; interrupts = <0 77 0x4>; }; diff --git a/src/arm64/hisilicon/hikey-pinctrl.dtsi b/src/arm64/hisilicon/hikey-pinctrl.dtsi index 0916e8459d6b..e7d22619a4c0 100644 --- a/src/arm64/hisilicon/hikey-pinctrl.dtsi +++ b/src/arm64/hisilicon/hikey-pinctrl.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * pinctrl dts fils for Hislicon HiKey development board * diff --git a/src/arm64/hisilicon/hikey960-pinctrl.dtsi b/src/arm64/hisilicon/hikey960-pinctrl.dtsi index 7e542d28dadb..d11efc81958c 100644 --- a/src/arm64/hisilicon/hikey960-pinctrl.dtsi +++ b/src/arm64/hisilicon/hikey960-pinctrl.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * pinctrl dts fils for Hislicon HiKey960 development board * diff --git a/src/arm64/hisilicon/hip07-d05.dts b/src/arm64/hisilicon/hip07-d05.dts index f5d7f0889b41..fe7c16c36025 100644 --- a/src/arm64/hisilicon/hip07-d05.dts +++ b/src/arm64/hisilicon/hip07-d05.dts @@ -84,3 +84,7 @@ &sas1 { status = "ok"; }; + +&p0_pcie2_a { + status = "ok"; +}; diff --git a/src/arm64/hisilicon/hip07.dtsi b/src/arm64/hisilicon/hip07.dtsi index 283d7b532e16..2c01a21c3665 100644 --- a/src/arm64/hisilicon/hip07.dtsi +++ b/src/arm64/hisilicon/hip07.dtsi @@ -1534,5 +1534,27 @@ <637 1>,<638 1>,<639 1>; status = "disabled"; }; + + p0_pcie2_a: pcie@a00a0000 { + compatible = "hisilicon,hip07-pcie-ecam"; + reg = <0 0xaf800000 0 0x800000>, + <0 0xa00a0000 0 0x10000>; + bus-range = <0xf8 0xff>; + msi-map = <0xf800 &p0_its_dsa_a 0xf800 0x800>; + msi-map-mask = <0xffff>; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + dma-coherent; + ranges = <0x02000000 0 0xa8000000 0 0xa8000000 0 0x77f0000 + 0x01000000 0 0 0 0xaf7f0000 0 0x10000>; + #interrupt-cells = <1>; + interrupt-map-mask = <0xf800 0 0 7>; + interrupt-map = <0x0 0 0 1 &mbigen_pcie2_a 671 4 + 0x0 0 0 2 &mbigen_pcie2_a 671 4 + 0x0 0 0 3 &mbigen_pcie2_a 671 4 + 0x0 0 0 4 &mbigen_pcie2_a 671 4>; + status = "disabled"; + }; }; }; diff --git a/src/arm64/lg/lg1312-ref.dts b/src/arm64/lg/lg1312-ref.dts index 6d78d6bc7f9c..260a2c5b19e5 100644 --- a/src/arm64/lg/lg1312-ref.dts +++ b/src/arm64/lg/lg1312-ref.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dts file for lg1312 Reference Board. * diff --git a/src/arm64/lg/lg1312.dtsi b/src/arm64/lg/lg1312.dtsi index fbafa24cd533..860c8fb10795 100644 --- a/src/arm64/lg/lg1312.dtsi +++ b/src/arm64/lg/lg1312.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dts file for lg1312 SoC * diff --git a/src/arm64/lg/lg1313-ref.dts b/src/arm64/lg/lg1313-ref.dts index df0ece43cfbf..e89ae853788a 100644 --- a/src/arm64/lg/lg1313-ref.dts +++ b/src/arm64/lg/lg1313-ref.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dts file for lg1313 Reference Board. * diff --git a/src/arm64/lg/lg1313.dtsi b/src/arm64/lg/lg1313.dtsi index e703e1149c75..1887af654a7d 100644 --- a/src/arm64/lg/lg1313.dtsi +++ b/src/arm64/lg/lg1313.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dts file for lg1313 SoC * diff --git a/src/arm64/marvell/armada-3720-espressobin.dts b/src/arm64/marvell/armada-3720-espressobin.dts index e3a136ed77b0..2ce52ba74f73 100644 --- a/src/arm64/marvell/armada-3720-espressobin.dts +++ b/src/arm64/marvell/armada-3720-espressobin.dts @@ -45,6 +45,7 @@ /dts-v1/; +#include #include "armada-372x.dtsi" / { @@ -59,6 +60,20 @@ device_type = "memory"; reg = <0x00000000 0x00000000 0x00000000 0x20000000>; }; + + vcc_sd_reg1: regulator { + compatible = "regulator-gpio"; + regulator-name = "vcc_sd1"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + + gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>; + gpios-states = <0>; + states = <1800000 0x1 + 3300000 0x0>; + enable-active-high; + }; }; /* J9 */ @@ -71,6 +86,16 @@ status = "okay"; }; +/* J1 */ +&sdhci1 { + wp-inverted; + bus-width = <4>; + cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>; + marvell,pad-type = "sd"; + vqmmc-supply = <&vcc_sd_reg1>; + status = "okay"; +}; + /* Exported on the micro USB connector J5 through an FTDI */ &uart0 { status = "okay"; @@ -81,6 +106,11 @@ status = "okay"; }; +/* J8 */ +&usb2 { + status = "okay"; +}; + &mdio { switch0: switch0@1 { compatible = "marvell,mv88e6085"; diff --git a/src/arm64/marvell/armada-37xx.dtsi b/src/arm64/marvell/armada-37xx.dtsi index 51763d674050..8c0cf7efac65 100644 --- a/src/arm64/marvell/armada-37xx.dtsi +++ b/src/arm64/marvell/armada-37xx.dtsi @@ -81,6 +81,11 @@ ; }; + pmu { + compatible = "arm,armv8-pmuv3"; + interrupts = ; + }; + soc { compatible = "simple-bus"; #address-cells = <2>; @@ -322,7 +327,11 @@ #interrupt-cells = <3>; interrupt-controller; reg = <0x1d00000 0x10000>, /* GICD */ - <0x1d40000 0x40000>; /* GICR */ + <0x1d40000 0x40000>, /* GICR */ + <0x1d80000 0x2000>, /* GICC */ + <0x1d90000 0x2000>, /* GICH */ + <0x1da0000 0x20000>; /* GICV */ + interrupts = ; }; }; diff --git a/src/arm64/marvell/armada-7040-db.dts b/src/arm64/marvell/armada-7040-db.dts index 92c761c380d3..9c3bdf87e543 100644 --- a/src/arm64/marvell/armada-7040-db.dts +++ b/src/arm64/marvell/armada-7040-db.dts @@ -44,6 +44,7 @@ * Device Tree file for Marvell Armada 7040 Development board platform */ +#include #include "armada-7040.dtsi" / { @@ -59,6 +60,34 @@ device_type = "memory"; reg = <0x0 0x0 0x0 0x80000000>; }; + + cpm_reg_usb3_0_vbus: cpm-usb3-0-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb3h0-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&expander0 0 GPIO_ACTIVE_HIGH>; + }; + + cpm_reg_usb3_1_vbus: cpm-usb3-1-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb3h1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&expander0 1 GPIO_ACTIVE_HIGH>; + }; + + cpm_usb3_0_phy: cpm-usb3-0-phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <&cpm_reg_usb3_0_vbus>; + }; + + cpm_usb3_1_phy: cpm-usb3-1-phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <&cpm_reg_usb3_1_vbus>; + }; }; &i2c0 { @@ -105,6 +134,14 @@ &cpm_i2c0 { status = "okay"; clock-frequency = <100000>; + + expander0: pca9555@21 { + compatible = "nxp,pca9555"; + pinctrl-names = "default"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x21>; + }; }; &cpm_spi1 { @@ -140,10 +177,12 @@ }; &cpm_usb3_0 { + usb-phy = <&cpm_usb3_0_phy>; status = "okay"; }; &cpm_usb3_1 { + usb-phy = <&cpm_usb3_1_phy>; status = "okay"; }; diff --git a/src/arm64/marvell/armada-8040-db.dts b/src/arm64/marvell/armada-8040-db.dts index 1e8f7242ed6f..0d7b2ae46610 100644 --- a/src/arm64/marvell/armada-8040-db.dts +++ b/src/arm64/marvell/armada-8040-db.dts @@ -44,6 +44,7 @@ * Device Tree file for Marvell Armada 8040 Development board platform */ +#include #include "armada-8040.dtsi" / { @@ -59,6 +60,48 @@ device_type = "memory"; reg = <0x0 0x0 0x0 0x80000000>; }; + + cpm_reg_usb3_0_vbus: cpm-usb3-0-vbus { + compatible = "regulator-fixed"; + regulator-name = "cpm-usb3h0-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&expander0 0 GPIO_ACTIVE_HIGH>; + }; + + cpm_reg_usb3_1_vbus: cpm-usb3-1-vbus { + compatible = "regulator-fixed"; + regulator-name = "cpm-usb3h1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&expander0 1 GPIO_ACTIVE_HIGH>; + }; + + cpm_usb3_0_phy: cpm-usb3-0-phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <&cpm_reg_usb3_0_vbus>; + }; + + cpm_usb3_1_phy: cpm-usb3-1-phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <&cpm_reg_usb3_1_vbus>; + }; + + cps_reg_usb3_0_vbus: cps-usb3-0-vbus { + compatible = "regulator-fixed"; + regulator-name = "cps-usb3h0-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&expander1 0 GPIO_ACTIVE_HIGH>; + }; + + cps_usb3_0_phy: cps-usb3-0-phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <&cps_reg_usb3_0_vbus>; + }; }; &i2c0 { @@ -107,6 +150,25 @@ &cpm_i2c0 { status = "okay"; clock-frequency = <100000>; + + /* U31 */ + expander0: pca9555@21 { + compatible = "nxp,pca9555"; + pinctrl-names = "default"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x21>; + }; + + /* U25 */ + expander1: pca9555@25 { + compatible = "nxp,pca9555"; + pinctrl-names = "default"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x25>; + }; + }; /* CON4 on CP0 expansion */ @@ -116,11 +178,13 @@ /* CON9 on CP0 expansion */ &cpm_usb3_0 { + usb-phy = <&cpm_usb3_0_phy>; status = "okay"; }; /* CON10 on CP0 expansion */ &cpm_usb3_1 { + usb-phy = <&cpm_usb3_1_phy>; status = "okay"; }; @@ -159,6 +223,7 @@ /* CON9 on CP1 expansion */ &cps_usb3_0 { + usb-phy = <&cps_usb3_0_phy>; status = "okay"; }; diff --git a/src/arm64/marvell/armada-8040-mcbin.dts b/src/arm64/marvell/armada-8040-mcbin.dts index 4968e731de61..acf5c7d16d79 100644 --- a/src/arm64/marvell/armada-8040-mcbin.dts +++ b/src/arm64/marvell/armada-8040-mcbin.dts @@ -46,11 +46,17 @@ #include "armada-8040.dtsi" +#include + / { model = "Marvell 8040 MACHIATOBin"; compatible = "marvell,armada8040-mcbin", "marvell,armada8040", "marvell,armada-ap806-quad", "marvell,armada-ap806"; + chosen { + stdout-path = "serial0:115200n8"; + }; + memory@00000000 { device_type = "memory"; reg = <0x0 0x0 0x0 0x80000000>; @@ -77,11 +83,13 @@ v_5v0_usb3_hst_vbus: regulator-usb3-vbus0 { compatible = "regulator-fixed"; + enable-active-high; + gpio = <&cpm_gpio2 15 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&cpm_xhci_vbus_pins>; regulator-name = "v_5v0_usb3_hst_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - /* actually GPIO controlled, but 8k has no GPIO support yet */ - regulator-always-on; status = "okay"; }; @@ -112,10 +120,44 @@ &cpm_i2c0 { clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&cpm_i2c0_pins>; status = "okay"; }; +&cpm_i2c1 { + clock-frequency = <100000>; + pinctrl-names = "default"; + pinctrl-0 = <&cpm_i2c1_pins>; + status = "okay"; + + i2c-switch@70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + + sfpp0_i2c: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + sfpp1_i2c: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + sfp_1g_i2c: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + }; +}; + &cpm_mdio { + pinctrl-names = "default"; + pinctrl-0 = <&cpm_ge_mdio_pins>; status = "okay"; ge_phy: ethernet-phy@0 { @@ -123,6 +165,67 @@ }; }; +&cpm_pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&cpm_pcie_pins>; + num-lanes = <4>; + num-viewport = <8>; + reset-gpio = <&cpm_gpio1 20 GPIO_ACTIVE_LOW>; + status = "okay"; +}; + +&cpm_pinctrl { + cpm_ge_mdio_pins: ge-mdio-pins { + marvell,pins = "mpp32", "mpp34"; + marvell,function = "ge"; + }; + cpm_i2c1_pins: i2c1-pins { + marvell,pins = "mpp35", "mpp36"; + marvell,function = "i2c1"; + }; + cpm_i2c0_pins: i2c0-pins { + marvell,pins = "mpp37", "mpp38"; + marvell,function = "i2c0"; + }; + cpm_xhci_vbus_pins: xhci0-vbus-pins { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + cpm_pcie_pins: pcie-pins { + marvell,pins = "mpp52"; + marvell,function = "gpio"; + }; + cpm_sdhci_pins: sdhci-pins { + marvell,pins = "mpp55", "mpp56", "mpp57", "mpp58", "mpp59", + "mpp60", "mpp61"; + marvell,function = "sdio"; + }; +}; + +&cpm_xmdio { + status = "okay"; + + phy0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <0>; + }; + + phy8: ethernet-phy@8 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <8>; + }; +}; + +&cpm_ethernet { + status = "okay"; +}; + +&cpm_eth0 { + status = "okay"; + phy = <&phy0>; + phy-mode = "10gbase-kr"; +}; + &cpm_sata0 { /* CPM Lane 0 - U29 */ status = "okay"; @@ -132,6 +235,8 @@ /* U6 */ broken-cd; bus-width = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&cpm_sdhci_pins>; status = "okay"; vqmmc-supply = <&v_3_3>; }; @@ -150,6 +255,12 @@ status = "okay"; }; +&cps_eth0 { + status = "okay"; + phy = <&phy8>; + phy-mode = "10gbase-kr"; +}; + &cps_eth1 { /* CPS Lane 0 - J5 (Gigabit RJ45) */ status = "okay"; @@ -157,6 +268,13 @@ phy-mode = "sgmii"; }; +&cps_pinctrl { + cps_spi1_pins: spi1-pins { + marvell,pins = "mpp12", "mpp13", "mpp14", "mpp15", "mpp16"; + marvell,function = "spi1"; + }; +}; + &cps_sata0 { /* CPS Lane 1 - U32 */ /* CPS Lane 3 - U31 */ @@ -164,6 +282,8 @@ }; &cps_spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&cps_spi1_pins>; status = "okay"; spi-flash@0 { diff --git a/src/arm64/marvell/armada-8080-db.dts b/src/arm64/marvell/armada-8080-db.dts new file mode 100644 index 000000000000..707af833832b --- /dev/null +++ b/src/arm64/marvell/armada-8080-db.dts @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2017 Marvell Technology Group Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPLv2 or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library 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 library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * Device Tree file for Marvell Armada-8080 Development board platform + */ + +#include "armada-8080.dtsi" + +/ { + model = "Marvell 8080 board"; + compatible = "marvell,armada-8080-db", "marvell,armada-8080", + "marvell,armada-ap810-octa", "marvell,armada-ap810"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@00000000 { + device_type = "memory"; + reg = <0x0 0x0 0x0 0x80000000>; + }; +}; + +&uart0_ap0 { + clock-frequency = <384000>; + status = "okay"; +}; diff --git a/src/arm64/marvell/armada-8080.dtsi b/src/arm64/marvell/armada-8080.dtsi new file mode 100644 index 000000000000..d5535b716735 --- /dev/null +++ b/src/arm64/marvell/armada-8080.dtsi @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2017 Marvell Technology Group Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPLv2 or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library 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 library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * Device Tree file for Marvell Armada-8080 SoC, made of an AP810 OCTA. + */ + +#include "armada-ap810-ap0-octa-core.dtsi" + +/ { + model = "Marvell 8080 board"; + compatible = "marvell,armada-8080", "marvell,armada-ap810-octa", + "marvell,armada-ap810"; +}; diff --git a/src/arm64/marvell/armada-ap806.dtsi b/src/arm64/marvell/armada-ap806.dtsi index 4d360713ed12..30d48ecf46e0 100644 --- a/src/arm64/marvell/armada-ap806.dtsi +++ b/src/arm64/marvell/armada-ap806.dtsi @@ -254,7 +254,7 @@ ap_syscon: system-controller@6f4000 { compatible = "syscon", "simple-mfd"; - reg = <0x6f4000 0x1000>; + reg = <0x6f4000 0x2000>; ap_clk: clock { compatible = "marvell,ap806-clock"; @@ -265,7 +265,7 @@ compatible = "marvell,ap806-pinctrl"; }; - ap_gpio: gpio { + ap_gpio: gpio@1040 { compatible = "marvell,armada-8k-gpio"; offset = <0x1040>; ngpios = <20>; diff --git a/src/arm64/marvell/armada-ap810-ap0-octa-core.dtsi b/src/arm64/marvell/armada-ap810-ap0-octa-core.dtsi new file mode 100644 index 000000000000..bf1b22b70384 --- /dev/null +++ b/src/arm64/marvell/armada-ap810-ap0-octa-core.dtsi @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2017 Marvell Technology Group Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPLv2 or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library 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 library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * Device Tree file for Marvell Armada AP810 OCTA cores. + */ + +#include "armada-ap810-ap0.dtsi" + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + compatible = "marvell,armada-ap810-octa"; + + cpu@000 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0x000>; + enable-method = "psci"; + }; + cpu@001 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0x001>; + enable-method = "psci"; + }; + cpu@100 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0x100>; + enable-method = "psci"; + }; + cpu@101 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0x101>; + enable-method = "psci"; + }; + cpu@200 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0x200>; + enable-method = "psci"; + }; + cpu@201 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0x201>; + enable-method = "psci"; + }; + cpu@300 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0x300>; + enable-method = "psci"; + }; + cpu@301 { + device_type = "cpu"; + compatible = "arm,cortex-a72", "arm,armv8"; + reg = <0x301>; + enable-method = "psci"; + }; + }; +}; diff --git a/src/arm64/marvell/armada-ap810-ap0.dtsi b/src/arm64/marvell/armada-ap810-ap0.dtsi new file mode 100644 index 000000000000..7e6f039f0f80 --- /dev/null +++ b/src/arm64/marvell/armada-ap810-ap0.dtsi @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2017 Marvell Technology Group Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPLv2 or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library 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 library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * Device Tree file for Marvell Armada AP810. + */ + +#include + +/dts-v1/; + +/ { + model = "Marvell Armada AP810"; + compatible = "marvell,armada-ap810"; + #address-cells = <2>; + #size-cells = <2>; + + aliases { + serial0 = &uart0_ap0; + serial1 = &uart1_ap0; + }; + + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + + ap810-ap0 { + #address-cells = <2>; + #size-cells = <2>; + compatible = "simple-bus"; + interrupt-parent = <&gic>; + ranges; + + config-space@e8000000 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges = <0x0 0x0 0xe8000000 0x4000000>; + interrupt-parent = <&gic>; + + gic: interrupt-controller@3000000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + #address-cells = <1>; + #size-cells = <1>; + interrupt-controller; + interrupts = ; + ranges; + + reg = <0x3000000 0x10000>, /* GICD */ + <0x3060000 0x100000>, /* GICR */ + <0x00c0000 0x2000>, /* GICC */ + <0x00d0000 0x1000>, /* GICH */ + <0x00e0000 0x2000>; /* GICV */ + + gic_its_ap0: interrupt-controller@3040000 { + compatible = "arm,gic-v3-its"; + msi-controller; + #msi-cells = <1>; + reg = <0x3040000 0x20000>; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = , + , + , + ; + }; + + xor@400000 { + compatible = "marvell,armada-7k-xor", "marvell,xor-v2"; + reg = <0x400000 0x1000>, + <0x410000 0x1000>; + msi-parent = <&gic_its_ap0 0xa0>; + dma-coherent; + }; + + xor@420000 { + compatible = "marvell,armada-7k-xor", "marvell,xor-v2"; + reg = <0x420000 0x1000>, + <0x430000 0x1000>; + msi-parent = <&gic_its_ap0 0xa1>; + dma-coherent; + }; + + xor@440000 { + compatible = "marvell,armada-7k-xor", "marvell,xor-v2"; + reg = <0x440000 0x1000>, + <0x450000 0x1000>; + msi-parent = <&gic_its_ap0 0xa2>; + dma-coherent; + }; + + xor@460000 { + compatible = "marvell,armada-7k-xor", "marvell,xor-v2"; + reg = <0x460000 0x1000>, + <0x470000 0x1000>; + msi-parent = <&gic_its_ap0 0xa3>; + dma-coherent; + }; + + uart0_ap0: serial@512000 { + compatible = "snps,dw-apb-uart"; + reg = <0x512000 0x100>; + reg-shift = <2>; + interrupts = ; + reg-io-width = <1>; + status = "disabled"; + }; + + uart1_ap0: serial@512100 { + compatible = "snps,dw-apb-uart"; + reg = <0x512100 0x100>; + reg-shift = <2>; + interrupts = ; + reg-io-width = <1>; + status = "disabled"; + }; + }; + }; +}; diff --git a/src/arm64/marvell/armada-cp110-master.dtsi b/src/arm64/marvell/armada-cp110-master.dtsi index 4c68605675a8..f2aa2a81de4d 100644 --- a/src/arm64/marvell/armada-cp110-master.dtsi +++ b/src/arm64/marvell/armada-cp110-master.dtsi @@ -65,25 +65,44 @@ reg = <0x0 0x100000>, <0x129000 0xb000>; clocks = <&cpm_clk 1 3>, <&cpm_clk 1 9>, <&cpm_clk 1 5>; clock-names = "pp_clk", "gop_clk", "mg_clk"; + marvell,system-controller = <&cpm_syscon0>; status = "disabled"; dma-coherent; cpm_eth0: eth0 { - interrupts = ; + interrupts = , + , + , + , + ; + interrupt-names = "tx-cpu0", "tx-cpu1", "tx-cpu2", + "tx-cpu3", "rx-shared"; port-id = <0>; gop-port-id = <0>; status = "disabled"; }; cpm_eth1: eth1 { - interrupts = ; + interrupts = , + , + , + , + ; + interrupt-names = "tx-cpu0", "tx-cpu1", "tx-cpu2", + "tx-cpu3", "rx-shared"; port-id = <1>; gop-port-id = <2>; status = "disabled"; }; cpm_eth2: eth2 { - interrupts = ; + interrupts = , + , + , + , + ; + interrupt-names = "tx-cpu0", "tx-cpu1", "tx-cpu2", + "tx-cpu3", "rx-shared"; port-id = <2>; gop-port-id = <3>; status = "disabled"; @@ -115,6 +134,13 @@ msi-parent = <&gicp>; }; + cpm_rtc: rtc@284000 { + compatible = "marvell,armada-8k-rtc"; + reg = <0x284000 0x20>, <0x284080 0x24>; + reg-names = "rtc", "rtc-soc"; + interrupts = ; + }; + cpm_syscon0: system-controller@440000 { compatible = "syscon", "simple-mfd"; reg = <0x440000 0x1000>; @@ -131,8 +157,12 @@ gpio-controller; #gpio-cells = <2>; gpio-ranges = <&cpm_pinctrl 0 0 32>; + interrupt-controller; + interrupts = , + , + , + ; status = "disabled"; - }; cpm_gpio2: gpio@140 { @@ -142,26 +172,15 @@ gpio-controller; #gpio-cells = <2>; gpio-ranges = <&cpm_pinctrl 0 32 31>; + interrupt-controller; + interrupts = , + , + , + ; status = "disabled"; }; }; - cpm_rtc: rtc@284000 { - compatible = "marvell,armada-8k-rtc"; - reg = <0x284000 0x20>, <0x284080 0x24>; - reg-names = "rtc", "rtc-soc"; - interrupts = ; - }; - - cpm_sata0: sata@540000 { - compatible = "marvell,armada-8k-ahci", - "generic-ahci"; - reg = <0x540000 0x30000>; - interrupts = ; - clocks = <&cpm_clk 1 15>; - status = "disabled"; - }; - cpm_usb3_0: usb3@500000 { compatible = "marvell,armada-8k-xhci", "generic-xhci"; @@ -182,6 +201,15 @@ status = "disabled"; }; + cpm_sata0: sata@540000 { + compatible = "marvell,armada-8k-ahci", + "generic-ahci"; + reg = <0x540000 0x30000>; + interrupts = ; + clocks = <&cpm_clk 1 15>; + status = "disabled"; + }; + cpm_xor0: xor@6a0000 { compatible = "marvell,armada-7k-xor", "marvell,xor-v2"; reg = <0x6a0000 0x1000>, @@ -240,6 +268,21 @@ status = "disabled"; }; + cpm_nand: nand@720000 { + /* + * Due to the limiation of the pin available + * this controller is only usable on the CPM + * for A7K and on the CPS for A8K. + */ + compatible = "marvell,armada370-nand"; + reg = <0x720000 0x54>; + #address-cells = <1>; + #size-cells = <1>; + interrupts = ; + clocks = <&cpm_clk 1 2>; + status = "disabled"; + }; + cpm_trng: trng@760000 { compatible = "marvell,armada-8k-rng", "inside-secure,safexcel-eip76"; reg = <0x760000 0x7d>; @@ -293,7 +336,7 @@ /* non-prefetchable memory */ 0x82000000 0 0xf6000000 0 0xf6000000 0 0xf00000>; interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &cpm_icu 0 ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 0 &cpm_icu ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>; interrupts = ; num-lanes = <1>; clocks = <&cpm_clk 1 13>; @@ -319,7 +362,7 @@ /* non-prefetchable memory */ 0x82000000 0 0xf7000000 0 0xf7000000 0 0xf00000>; interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &cpm_icu 0 ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 0 &cpm_icu ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>; interrupts = ; num-lanes = <1>; @@ -346,7 +389,7 @@ /* non-prefetchable memory */ 0x82000000 0 0xf8000000 0 0xf8000000 0 0xf00000>; interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &cpm_icu 0 ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 0 &cpm_icu ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>; interrupts = ; num-lanes = <1>; diff --git a/src/arm64/marvell/armada-cp110-slave.dtsi b/src/arm64/marvell/armada-cp110-slave.dtsi index 923f354b02f0..4fe70323abb3 100644 --- a/src/arm64/marvell/armada-cp110-slave.dtsi +++ b/src/arm64/marvell/armada-cp110-slave.dtsi @@ -60,37 +60,49 @@ compatible = "simple-bus"; ranges = <0x0 0x0 0xf4000000 0x2000000>; - cps_rtc: rtc@284000 { - compatible = "marvell,armada-8k-rtc"; - reg = <0x284000 0x20>, <0x284080 0x24>; - reg-names = "rtc", "rtc-soc"; - interrupts = ; - }; - cps_ethernet: ethernet@0 { compatible = "marvell,armada-7k-pp22"; reg = <0x0 0x100000>, <0x129000 0xb000>; clocks = <&cps_clk 1 3>, <&cps_clk 1 9>, <&cps_clk 1 5>; clock-names = "pp_clk", "gop_clk", "mg_clk"; + marvell,system-controller = <&cps_syscon0>; status = "disabled"; dma-coherent; cps_eth0: eth0 { - interrupts = ; + interrupts = , + , + , + , + ; + interrupt-names = "tx-cpu0", "tx-cpu1", "tx-cpu2", + "tx-cpu3", "rx-shared"; port-id = <0>; gop-port-id = <0>; status = "disabled"; }; cps_eth1: eth1 { - interrupts = ; + interrupts = , + , + , + , + ; + interrupt-names = "tx-cpu0", "tx-cpu1", "tx-cpu2", + "tx-cpu3", "rx-shared"; port-id = <1>; gop-port-id = <2>; status = "disabled"; }; cps_eth2: eth2 { - interrupts = ; + interrupts = , + , + , + , + ; + interrupt-names = "tx-cpu0", "tx-cpu1", "tx-cpu2", + "tx-cpu3", "rx-shared"; port-id = <2>; gop-port-id = <3>; status = "disabled"; @@ -122,6 +134,13 @@ msi-parent = <&gicp>; }; + cps_rtc: rtc@284000 { + compatible = "marvell,armada-8k-rtc"; + reg = <0x284000 0x20>, <0x284080 0x24>; + reg-names = "rtc", "rtc-soc"; + interrupts = ; + }; + cps_syscon0: system-controller@440000 { compatible = "syscon", "simple-mfd"; reg = <0x440000 0x1000>; @@ -138,8 +157,12 @@ gpio-controller; #gpio-cells = <2>; gpio-ranges = <&cps_pinctrl 0 0 32>; + interrupt-controller; + interrupts = , + , + , + ; status = "disabled"; - }; cps_gpio2: gpio@140 { @@ -149,20 +172,16 @@ gpio-controller; #gpio-cells = <2>; gpio-ranges = <&cps_pinctrl 0 32 31>; + interrupt-controller; + interrupts = , + , + , + ; status = "disabled"; }; }; - cps_sata0: sata@540000 { - compatible = "marvell,armada-8k-ahci", - "generic-ahci"; - reg = <0x540000 0x30000>; - interrupts = ; - clocks = <&cps_clk 1 15>; - status = "disabled"; - }; - cps_usb3_0: usb3@500000 { compatible = "marvell,armada-8k-xhci", "generic-xhci"; @@ -183,6 +202,15 @@ status = "disabled"; }; + cps_sata0: sata@540000 { + compatible = "marvell,armada-8k-ahci", + "generic-ahci"; + reg = <0x540000 0x30000>; + interrupts = ; + clocks = <&cps_clk 1 15>; + status = "disabled"; + }; + cps_xor0: xor@6a0000 { compatible = "marvell,armada-7k-xor", "marvell,xor-v2"; reg = <0x6a0000 0x1000>, @@ -241,6 +269,21 @@ status = "disabled"; }; + cps_nand: nand@720000 { + /* + * Due to the limiation of the pin available + * this controller is only usable on the CPM + * for A7K and on the CPS for A8K. + */ + compatible = "marvell,armada370-nand"; + reg = <0x720000 0x54>; + #address-cells = <1>; + #size-cells = <1>; + interrupts = ; + clocks = <&cps_clk 1 2>; + status = "disabled"; + }; + cps_trng: trng@760000 { compatible = "marvell,armada-8k-rng", "inside-secure,safexcel-eip76"; reg = <0x760000 0x7d>; @@ -292,7 +335,7 @@ /* non-prefetchable memory */ 0x82000000 0 0xfa000000 0 0xfa000000 0 0xf00000>; interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &cps_icu 0 ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 0 &cps_icu ICU_GRP_NSR 22 IRQ_TYPE_LEVEL_HIGH>; interrupts = ; num-lanes = <1>; clocks = <&cps_clk 1 13>; @@ -318,7 +361,7 @@ /* non-prefetchable memory */ 0x82000000 0 0xfb000000 0 0xfb000000 0 0xf00000>; interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &cps_icu 0 ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 0 &cps_icu ICU_GRP_NSR 24 IRQ_TYPE_LEVEL_HIGH>; interrupts = ; num-lanes = <1>; @@ -345,7 +388,7 @@ /* non-prefetchable memory */ 0x82000000 0 0xfc000000 0 0xfc000000 0 0xf00000>; interrupt-map-mask = <0 0 0 0>; - interrupt-map = <0 0 0 0 &cps_icu 0 ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>; + interrupt-map = <0 0 0 0 &cps_icu ICU_GRP_NSR 23 IRQ_TYPE_LEVEL_HIGH>; interrupts = ; num-lanes = <1>; diff --git a/src/arm64/mediatek/mt2712-evb.dts b/src/arm64/mediatek/mt2712-evb.dts new file mode 100644 index 000000000000..8c804df3da4e --- /dev/null +++ b/src/arm64/mediatek/mt2712-evb.dts @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2017 MediaTek Inc. + * Author: YT Shen + * + * SPDX-License-Identifier: (GPL-2.0 OR MIT) + */ + +/dts-v1/; +#include "mt2712e.dtsi" + +/ { + model = "MediaTek MT2712 evaluation board"; + compatible = "mediatek,mt2712-evb", "mediatek,mt2712"; + + aliases { + serial0 = &uart0; + }; + + memory@40000000 { + device_type = "memory"; + reg = <0 0x40000000 0 0x80000000>; + }; + + chosen { + stdout-path = "serial0:921600n8"; + }; +}; + +&uart0 { + status = "okay"; +}; + diff --git a/src/arm64/mediatek/mt2712e.dtsi b/src/arm64/mediatek/mt2712e.dtsi new file mode 100644 index 000000000000..57d0396b7faa --- /dev/null +++ b/src/arm64/mediatek/mt2712e.dtsi @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2017 MediaTek Inc. + * Author: YT Shen + * + * SPDX-License-Identifier: (GPL-2.0 OR MIT) + */ + +#include +#include + +/ { + compatible = "mediatek,mt2712"; + interrupt-parent = <&sysirq>; + #address-cells = <2>; + #size-cells = <2>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu-map { + cluster0 { + core0 { + cpu = <&cpu0>; + }; + core1 { + cpu = <&cpu1>; + }; + }; + + cluster1 { + core0 { + cpu = <&cpu2>; + }; + }; + }; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a35"; + reg = <0x000>; + }; + + cpu1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a35"; + reg = <0x001>; + enable-method = "psci"; + }; + + cpu2: cpu@200 { + device_type = "cpu"; + compatible = "arm,cortex-a72"; + reg = <0x200>; + enable-method = "psci"; + }; + }; + + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + + baud_clk: dummy26m { + compatible = "fixed-clock"; + clock-frequency = <26000000>; + #clock-cells = <0>; + }; + + sys_clk: dummyclk { + compatible = "fixed-clock"; + clock-frequency = <26000000>; + #clock-cells = <0>; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupt-parent = <&gic>; + interrupts = , + , + , + ; + }; + + uart5: serial@1000f000 { + compatible = "mediatek,mt2712-uart", + "mediatek,mt6577-uart"; + reg = <0 0x1000f000 0 0x400>; + interrupts = ; + clocks = <&baud_clk>, <&sys_clk>; + clock-names = "baud", "bus"; + status = "disabled"; + }; + + sysirq: interrupt-controller@10220a80 { + compatible = "mediatek,mt2712-sysirq", + "mediatek,mt6577-sysirq"; + interrupt-controller; + #interrupt-cells = <3>; + interrupt-parent = <&gic>; + reg = <0 0x10220a80 0 0x40>; + }; + + gic: interrupt-controller@10510000 { + compatible = "arm,gic-400"; + #interrupt-cells = <3>; + interrupt-parent = <&gic>; + interrupt-controller; + reg = <0 0x10510000 0 0x10000>, + <0 0x10520000 0 0x20000>, + <0 0x10540000 0 0x20000>, + <0 0x10560000 0 0x20000>; + interrupts = ; + }; + + uart0: serial@11002000 { + compatible = "mediatek,mt2712-uart", + "mediatek,mt6577-uart"; + reg = <0 0x11002000 0 0x400>; + interrupts = ; + clocks = <&baud_clk>, <&sys_clk>; + clock-names = "baud", "bus"; + status = "disabled"; + }; + + uart1: serial@11003000 { + compatible = "mediatek,mt2712-uart", + "mediatek,mt6577-uart"; + reg = <0 0x11003000 0 0x400>; + interrupts = ; + clocks = <&baud_clk>, <&sys_clk>; + clock-names = "baud", "bus"; + status = "disabled"; + }; + + uart2: serial@11004000 { + compatible = "mediatek,mt2712-uart", + "mediatek,mt6577-uart"; + reg = <0 0x11004000 0 0x400>; + interrupts = ; + clocks = <&baud_clk>, <&sys_clk>; + clock-names = "baud", "bus"; + status = "disabled"; + }; + + uart3: serial@11005000 { + compatible = "mediatek,mt2712-uart", + "mediatek,mt6577-uart"; + reg = <0 0x11005000 0 0x400>; + interrupts = ; + clocks = <&baud_clk>, <&sys_clk>; + clock-names = "baud", "bus"; + status = "disabled"; + }; + + uart4: serial@11019000 { + compatible = "mediatek,mt2712-uart", + "mediatek,mt6577-uart"; + reg = <0 0x11019000 0 0x400>; + interrupts = ; + clocks = <&baud_clk>, <&sys_clk>; + clock-names = "baud", "bus"; + status = "disabled"; + }; +}; + diff --git a/src/arm64/mediatek/mt6797.dtsi b/src/arm64/mediatek/mt6797.dtsi index 31088a9f71de..4beaa71107d7 100644 --- a/src/arm64/mediatek/mt6797.dtsi +++ b/src/arm64/mediatek/mt6797.dtsi @@ -108,13 +108,6 @@ clock-output-names = "clk26m"; }; - clk32k: oscillator@1 { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <32000>; - clock-output-names = "clk32k"; - }; - timer { compatible = "arm,armv8-timer"; interrupt-parent = <&gic>; @@ -147,6 +140,11 @@ infracfg = <&infrasys>; }; + watchdog: watchdog@10007000 { + compatible = "mediatek,mt6797-wdt", "mediatek,mt6589-wdt"; + reg = <0 0x10007000 0 0x100>; + }; + apmixedsys: apmixed@1000c000 { compatible = "mediatek,mt6797-apmixedsys"; reg = <0 0x1000c000 0 0x1000>; diff --git a/src/arm64/mediatek/mt7622-rfb1.dts b/src/arm64/mediatek/mt7622-rfb1.dts new file mode 100644 index 000000000000..c08309df2cc7 --- /dev/null +++ b/src/arm64/mediatek/mt7622-rfb1.dts @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017 MediaTek Inc. + * Author: Ming Huang + * Sean Wang + * + * SPDX-License-Identifier: (GPL-2.0 OR MIT) + */ + +/dts-v1/; +#include "mt7622.dtsi" + +/ { + model = "MediaTek MT7622 RFB1 board"; + compatible = "mediatek,mt7622-rfb1", "mediatek,mt7622"; + + chosen { + bootargs = "console=ttyS0,115200n1"; + }; + + memory { + reg = <0 0x40000000 0 0x3F000000>; + }; +}; + +&uart0 { + status = "okay"; +}; diff --git a/src/arm64/mediatek/mt7622.dtsi b/src/arm64/mediatek/mt7622.dtsi new file mode 100644 index 000000000000..b111fec2ed9d --- /dev/null +++ b/src/arm64/mediatek/mt7622.dtsi @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2017 MediaTek Inc. + * Author: Ming Huang + * Sean Wang + * + * SPDX-License-Identifier: (GPL-2.0 OR MIT) + */ + +#include +#include + +/ { + compatible = "mediatek,mt7622"; + interrupt-parent = <&sysirq>; + #address-cells = <2>; + #size-cells = <2>; + + cpus { + #address-cells = <2>; + #size-cells = <0>; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0x0 0x0>; + enable-method = "psci"; + clock-frequency = <1300000000>; + }; + + cpu1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0x0 0x1>; + enable-method = "psci"; + clock-frequency = <1300000000>; + }; + }; + + uart_clk: dummy25m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + }; + + bus_clk: dummy280m { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <280000000>; + }; + + psci { + compatible = "arm,psci-0.2"; + method = "smc"; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + /* 192 KiB reserved for ARM Trusted Firmware (BL31) */ + secmon_reserved: secmon@43000000 { + reg = <0 0x43000000 0 0x30000>; + no-map; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupt-parent = <&gic>; + interrupts = , + , + , + ; + }; + + sysirq: interrupt-controller@10200620 { + compatible = "mediatek,mt7622-sysirq", + "mediatek,mt6577-sysirq"; + interrupt-controller; + #interrupt-cells = <3>; + interrupt-parent = <&gic>; + reg = <0 0x10200620 0 0x20>; + }; + + gic: interrupt-controller@10300000 { + compatible = "arm,gic-400"; + interrupt-controller; + #interrupt-cells = <3>; + interrupt-parent = <&gic>; + reg = <0 0x10310000 0 0x1000>, + <0 0x10320000 0 0x1000>, + <0 0x10340000 0 0x2000>, + <0 0x10360000 0 0x2000>; + }; + + uart0: serial@11002000 { + compatible = "mediatek,mt7622-uart", + "mediatek,mt6577-uart"; + reg = <0 0x11002000 0 0x400>; + interrupts = ; + clocks = <&uart_clk>, <&bus_clk>; + clock-names = "baud", "bus"; + status = "disabled"; + }; +}; diff --git a/src/arm64/nvidia/tegra132-norrin.dts b/src/arm64/nvidia/tegra132-norrin.dts index 759af96a6b49..a0385a386a3f 100644 --- a/src/arm64/nvidia/tegra132-norrin.dts +++ b/src/arm64/nvidia/tegra132-norrin.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm64/nvidia/tegra132.dtsi b/src/arm64/nvidia/tegra132.dtsi index c2f0f2743578..fa5a7c4bc807 100644 --- a/src/arm64/nvidia/tegra132.dtsi +++ b/src/arm64/nvidia/tegra132.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/src/arm64/nvidia/tegra186-p2771-0000.dts b/src/arm64/nvidia/tegra186-p2771-0000.dts index 8daadadec63a..c71d762bf697 100644 --- a/src/arm64/nvidia/tegra186-p2771-0000.dts +++ b/src/arm64/nvidia/tegra186-p2771-0000.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm64/nvidia/tegra186-p3310.dtsi b/src/arm64/nvidia/tegra186-p3310.dtsi index cf84d7046ad5..54f418d05e15 100644 --- a/src/arm64/nvidia/tegra186-p3310.dtsi +++ b/src/arm64/nvidia/tegra186-p3310.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "tegra186.dtsi" #include diff --git a/src/arm64/nvidia/tegra186.dtsi b/src/arm64/nvidia/tegra186.dtsi index 0b0552c9f7dd..a9c3eef6c4e0 100644 --- a/src/arm64/nvidia/tegra186.dtsi +++ b/src/arm64/nvidia/tegra186.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/src/arm64/nvidia/tegra210-p2180.dtsi b/src/arm64/nvidia/tegra210-p2180.dtsi index 906fb836d241..d10d4430537a 100644 --- a/src/arm64/nvidia/tegra210-p2180.dtsi +++ b/src/arm64/nvidia/tegra210-p2180.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include "tegra210.dtsi" diff --git a/src/arm64/nvidia/tegra210-p2371-0000.dts b/src/arm64/nvidia/tegra210-p2371-0000.dts index 1ddd8512e100..21c6d3749bc6 100644 --- a/src/arm64/nvidia/tegra210-p2371-0000.dts +++ b/src/arm64/nvidia/tegra210-p2371-0000.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra210-p2530.dtsi" diff --git a/src/arm64/nvidia/tegra210-p2371-2180.dts b/src/arm64/nvidia/tegra210-p2371-2180.dts index 7cb95e042117..37e3c46e753f 100644 --- a/src/arm64/nvidia/tegra210-p2371-2180.dts +++ b/src/arm64/nvidia/tegra210-p2371-2180.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "tegra210-p2180.dtsi" diff --git a/src/arm64/nvidia/tegra210-p2530.dtsi b/src/arm64/nvidia/tegra210-p2530.dtsi index 0ec92578cacb..be6066ff97c9 100644 --- a/src/arm64/nvidia/tegra210-p2530.dtsi +++ b/src/arm64/nvidia/tegra210-p2530.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include "tegra210.dtsi" / { diff --git a/src/arm64/nvidia/tegra210-p2571.dts b/src/arm64/nvidia/tegra210-p2571.dts index 576957a55801..e2a347e57215 100644 --- a/src/arm64/nvidia/tegra210-p2571.dts +++ b/src/arm64/nvidia/tegra210-p2571.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm64/nvidia/tegra210-p2595.dtsi b/src/arm64/nvidia/tegra210-p2595.dtsi index e008e3364d2a..6ae292da7294 100644 --- a/src/arm64/nvidia/tegra210-p2595.dtsi +++ b/src/arm64/nvidia/tegra210-p2595.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { model = "NVIDIA Tegra210 P2595 I/O board"; compatible = "nvidia,p2595", "nvidia,tegra210"; diff --git a/src/arm64/nvidia/tegra210-p2597.dtsi b/src/arm64/nvidia/tegra210-p2597.dtsi index e5fc67bf46c2..d67ef4319f3b 100644 --- a/src/arm64/nvidia/tegra210-p2597.dtsi +++ b/src/arm64/nvidia/tegra210-p2597.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include / { diff --git a/src/arm64/nvidia/tegra210-smaug.dts b/src/arm64/nvidia/tegra210-smaug.dts index 7703227f5d1a..43cae4798870 100644 --- a/src/arm64/nvidia/tegra210-smaug.dts +++ b/src/arm64/nvidia/tegra210-smaug.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/arm64/nvidia/tegra210.dtsi b/src/arm64/nvidia/tegra210.dtsi index 29f471e0f22a..9bdf19f2cca7 100644 --- a/src/arm64/nvidia/tegra210.dtsi +++ b/src/arm64/nvidia/tegra210.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/src/arm64/qcom/apq8016-sbc-pmic-pins.dtsi b/src/arm64/qcom/apq8016-sbc-pmic-pins.dtsi index d94640812194..ec2f0de67993 100644 --- a/src/arm64/qcom/apq8016-sbc-pmic-pins.dtsi +++ b/src/arm64/qcom/apq8016-sbc-pmic-pins.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include @@ -17,6 +18,7 @@ function = PMIC_GPIO_FUNC_NORMAL; power-source = ; input-disable; + output-high; }; }; diff --git a/src/arm64/qcom/apq8016-sbc-soc-pins.dtsi b/src/arm64/qcom/apq8016-sbc-soc-pins.dtsi index 185388de914c..21d0822f1ca6 100644 --- a/src/arm64/qcom/apq8016-sbc-soc-pins.dtsi +++ b/src/arm64/qcom/apq8016-sbc-soc-pins.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include diff --git a/src/arm64/qcom/apq8016-sbc.dtsi b/src/arm64/qcom/apq8016-sbc.dtsi index bd310ac1967a..1d63e6b879de 100644 --- a/src/arm64/qcom/apq8016-sbc.dtsi +++ b/src/arm64/qcom/apq8016-sbc.dtsi @@ -88,6 +88,8 @@ interrupts = <31 2>; adi,dsi-lanes = <4>; + clocks = <&rpmcc RPM_SMD_BB_CLK2>; + clock-names = "cec"; pd-gpios = <&msmgpio 32 0>; @@ -213,11 +215,14 @@ }; usb@78d9000 { - extcon = <&usb_id>, <&usb_id>; + extcon = <&usb_id>; status = "okay"; adp-disable; hnp-disable; srp-disable; + dr_mode = "host"; + pinctrl-names = "default"; + pinctrl-0 = <&usb_sw_sel_pm>; ulpi { phy { v1p8-supply = <&pm8916_l7>; @@ -337,19 +342,11 @@ usb_id: usb-id { compatible = "linux,extcon-usb-gpio"; - id-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>; + vbus-gpio = <&msmgpio 121 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&usb_id_default>; }; - usb-switch { - compatible = "toshiba,tc7usb40mu"; - switch-gpios = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>; - extcon = <&usb_id>; - pinctrl-names = "default"; - pinctrl-0 = <&usb_sw_sel_pm>; - }; - hdmi-out { compatible = "hdmi-connector"; type = "a"; diff --git a/src/arm64/qcom/apq8096-db820c-pmic-pins.dtsi b/src/arm64/qcom/apq8096-db820c-pmic-pins.dtsi index b1142c45fdc9..59b29ddfb6e9 100644 --- a/src/arm64/qcom/apq8096-db820c-pmic-pins.dtsi +++ b/src/arm64/qcom/apq8096-db820c-pmic-pins.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include &pm8994_gpios { @@ -24,4 +25,28 @@ power-source = ; // 1.8V }; }; + + usb3_vbus_det_gpio: pm8996_gpio22 { + pinconf { + pins = "gpio22"; + function = PMIC_GPIO_FUNC_NORMAL; + input-enable; + bias-pull-down; + qcom,drive-strength = ; + power-source = ; // 1.8V + }; + }; +}; + +&pmi8994_gpios { + usb2_vbus_det_gpio: pmi8996_gpio6 { + pinconf { + pins = "gpio6"; + function = PMIC_GPIO_FUNC_NORMAL; + input-enable; + bias-pull-down; + qcom,drive-strength = ; + power-source = ; // 1.8V + }; + }; }; diff --git a/src/arm64/qcom/apq8096-db820c.dtsi b/src/arm64/qcom/apq8096-db820c.dtsi index d2196fc6d739..789f3e87321e 100644 --- a/src/arm64/qcom/apq8096-db820c.dtsi +++ b/src/arm64/qcom/apq8096-db820c.dtsi @@ -13,6 +13,7 @@ #include "msm8996.dtsi" #include "pm8994.dtsi" +#include "pmi8994.dtsi" #include "apq8096-db820c-pins.dtsi" #include "apq8096-db820c-pmic-pins.dtsi" #include @@ -88,6 +89,55 @@ cd-gpios = <&msmgpio 38 0x1>; status = "okay"; }; + + phy@34000 { + status = "okay"; + }; + + phy@7410000 { + status = "okay"; + }; + + phy@7411000 { + status = "okay"; + }; + + phy@7412000 { + status = "okay"; + }; + + usb@6a00000 { + status = "okay"; + + dwc3@6a00000 { + extcon = <&usb3_id>; + dr_mode = "otg"; + }; + }; + + usb3_id: usb3-id { + compatible = "linux,extcon-usb-gpio"; + id-gpio = <&pm8994_gpios 22 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&usb3_vbus_det_gpio>; + }; + + usb@7600000 { + status = "okay"; + + dwc3@7600000 { + extcon = <&usb2_id>; + dr_mode = "otg"; + maximum-speed = "high-speed"; + }; + }; + + usb2_id: usb2-id { + compatible = "linux,extcon-usb-gpio"; + id-gpio = <&pmi8994_gpios 6 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&usb2_vbus_det_gpio>; + }; }; @@ -106,4 +156,152 @@ gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>; }; }; + + rpm-glink { + rpm_requests { + pm8994-regulators { + vdd_l1-supply = <&pm8994_s3>; + vdd_l2_l26_l28-supply = <&pm8994_s3>; + vdd_l3_l11-supply = <&pm8994_s3>; + vdd_l4_l27_l31-supply = <&pm8994_s3>; + vdd_l5_l7-supply = <&pm8994_s5>; + vdd_l14_l15-supply = <&pm8994_s5>; + vdd_l20_l21-supply = <&pm8994_s5>; + vdd_l25-supply = <&pm8994_s3>; + + s3 { + regulator-min-microvolt = <1300000>; + regulator-max-microvolt = <1300000>; + }; + s4 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + s5 { + regulator-min-microvolt = <2150000>; + regulator-max-microvolt = <2150000>; + }; + s7 { + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + }; + + l1 { + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1000000>; + }; + l2 { + regulator-min-microvolt = <1250000>; + regulator-max-microvolt = <1250000>; + }; + l3 { + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + }; + l4 { + regulator-min-microvolt = <1225000>; + regulator-max-microvolt = <1225000>; + }; + l6 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + }; + l8 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + l9 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + l10 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + l11 { + regulator-min-microvolt = <1150000>; + regulator-max-microvolt = <1150000>; + }; + l12 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + l13 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2950000>; + }; + l14 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + l15 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + l16 { + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <2700000>; + }; + l17 { + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + }; + l18 { + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <2900000>; + }; + l19 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + }; + l20 { + regulator-min-microvolt = <2950000>; + regulator-max-microvolt = <2950000>; + regulator-allow-set-load; + }; + l21 { + regulator-min-microvolt = <2950000>; + regulator-max-microvolt = <2950000>; + }; + l22 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + l23 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + l24 { + regulator-min-microvolt = <3075000>; + regulator-max-microvolt = <3075000>; + }; + l25 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-allow-set-load; + }; + l27 { + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1000000>; + }; + l28 { + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <925000>; + regulator-allow-set-load; + }; + l29 { + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + }; + l30 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + l32 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + }; + }; + }; }; diff --git a/src/arm64/qcom/ipq8074-hk01.dts b/src/arm64/qcom/ipq8074-hk01.dts new file mode 100644 index 000000000000..6a838b5d321e --- /dev/null +++ b/src/arm64/qcom/ipq8074-hk01.dts @@ -0,0 +1,52 @@ +/dts-v1/; +/* Copyright (c) 2017, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#include "ipq8074.dtsi" + +/ { + #address-cells = <0x2>; + #size-cells = <0x2>; + model = "Qualcomm Technologies, Inc. IPQ8074-HK01"; + compatible = "qcom,ipq8074-hk01", "qcom,ipq8074"; + interrupt-parent = <&intc>; + + aliases { + serial0 = &blsp1_uart5; + }; + + chosen { + stdout-path = "serial0"; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x40000000 0x0 0x20000000>; + }; + + soc { + pinctrl@1000000 { + serial_4_pins: serial4_pinmux { + mux { + pins = "gpio23", "gpio24"; + function = "blsp4_uart1"; + bias-disable; + }; + }; + }; + + serial@78b3000 { + pinctrl-0 = <&serial_4_pins>; + pinctrl-names = "default"; + status = "ok"; + }; + }; +}; diff --git a/src/arm64/qcom/ipq8074.dtsi b/src/arm64/qcom/ipq8074.dtsi new file mode 100644 index 000000000000..2bc5dec5614d --- /dev/null +++ b/src/arm64/qcom/ipq8074.dtsi @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2017, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include + +/ { + model = "Qualcomm Technologies, Inc. IPQ8074"; + compatible = "qcom,ipq8074"; + + soc: soc { + #address-cells = <0x1>; + #size-cells = <0x1>; + ranges = <0 0 0 0xffffffff>; + compatible = "simple-bus"; + + pinctrl@1000000 { + compatible = "qcom,ipq8074-pinctrl"; + reg = <0x1000000 0x300000>; + interrupts = ; + gpio-controller; + #gpio-cells = <0x2>; + interrupt-controller; + #interrupt-cells = <0x2>; + }; + + intc: interrupt-controller@b000000 { + compatible = "qcom,msm-qgic2"; + interrupt-controller; + #interrupt-cells = <0x3>; + reg = <0xb000000 0x1000>, <0xb002000 0x1000>; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = , + , + , + ; + }; + + timer@b120000 { + #address-cells = <1>; + #size-cells = <1>; + ranges; + compatible = "arm,armv7-timer-mem"; + reg = <0xb120000 0x1000>; + clock-frequency = <19200000>; + + frame@b120000 { + frame-number = <0>; + interrupts = , + ; + reg = <0xb121000 0x1000>, + <0xb122000 0x1000>; + }; + + frame@b123000 { + frame-number = <1>; + interrupts = ; + reg = <0xb123000 0x1000>; + status = "disabled"; + }; + + frame@b124000 { + frame-number = <2>; + interrupts = ; + reg = <0xb124000 0x1000>; + status = "disabled"; + }; + + frame@b125000 { + frame-number = <3>; + interrupts = ; + reg = <0xb125000 0x1000>; + status = "disabled"; + }; + + frame@b126000 { + frame-number = <4>; + interrupts = ; + reg = <0xb126000 0x1000>; + status = "disabled"; + }; + + frame@b127000 { + frame-number = <5>; + interrupts = ; + reg = <0xb127000 0x1000>; + status = "disabled"; + }; + + frame@b128000 { + frame-number = <6>; + interrupts = ; + reg = <0xb128000 0x1000>; + status = "disabled"; + }; + }; + + gcc: gcc@1800000 { + compatible = "qcom,gcc-ipq8074"; + reg = <0x1800000 0x80000>; + #clock-cells = <0x1>; + #reset-cells = <0x1>; + }; + + blsp1_uart5: serial@78b3000 { + compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm"; + reg = <0x78b3000 0x200>; + interrupts = ; + clocks = <&gcc GCC_BLSP1_UART5_APPS_CLK>, + <&gcc GCC_BLSP1_AHB_CLK>; + clock-names = "core", "iface"; + status = "disabled"; + }; + }; + + cpus { + #address-cells = <0x1>; + #size-cells = <0x0>; + + CPU0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0x0>; + next-level-cache = <&L2_0>; + enable-method = "psci"; + }; + + CPU1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + enable-method = "psci"; + reg = <0x1>; + next-level-cache = <&L2_0>; + }; + + CPU2: cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + enable-method = "psci"; + reg = <0x2>; + next-level-cache = <&L2_0>; + }; + + CPU3: cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + enable-method = "psci"; + reg = <0x3>; + next-level-cache = <&L2_0>; + }; + + L2_0: l2-cache { + compatible = "cache"; + cache-level = <0x2>; + }; + }; + + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; + + pmu { + compatible = "arm,armv8-pmuv3"; + interrupts = ; + }; + + clocks { + sleep_clk: sleep_clk { + compatible = "fixed-clock"; + clock-frequency = <32000>; + #clock-cells = <0>; + }; + + xo: xo { + compatible = "fixed-clock"; + clock-frequency = <19200000>; + #clock-cells = <0>; + }; + }; +}; diff --git a/src/arm64/qcom/msm8916.dtsi b/src/arm64/qcom/msm8916.dtsi index 039991f80831..dc3817593e14 100644 --- a/src/arm64/qcom/msm8916.dtsi +++ b/src/arm64/qcom/msm8916.dtsi @@ -88,6 +88,11 @@ no-map; }; + venus_mem: venus@89900000 { + reg = <0x0 0x89900000 0x0 0x600000>; + no-map; + }; + mba_mem: mba@8ea00000 { no-map; reg = <0 0x8ea00000 0 0x100000>; @@ -204,6 +209,17 @@ }; + gpu_opp_table: opp_table { + compatible = "operating-points-v2"; + + opp-400000000 { + opp-hz = /bits/ 64 <400000000>; + }; + opp-19200000 { + opp-hz = /bits/ 64 <19200000>; + }; + }; + timer { compatible = "arm,armv8-timer"; interrupts = , @@ -694,6 +710,84 @@ #thermal-sensor-cells = <1>; }; + apps_iommu: iommu@1ef0000 { + #address-cells = <1>; + #size-cells = <1>; + #iommu-cells = <1>; + compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; + ranges = <0 0x1e20000 0x40000>; + reg = <0x1ef0000 0x3000>; + clocks = <&gcc GCC_SMMU_CFG_CLK>, + <&gcc GCC_APSS_TCU_CLK>; + clock-names = "iface", "bus"; + qcom,iommu-secure-id = <17>; + + // mdp_0: + iommu-ctx@4000 { + compatible = "qcom,msm-iommu-v1-ns"; + reg = <0x4000 0x1000>; + interrupts = ; + }; + + // venus_ns: + iommu-ctx@5000 { + compatible = "qcom,msm-iommu-v1-sec"; + reg = <0x5000 0x1000>; + interrupts = ; + }; + }; + + gpu_iommu: iommu@1f08000 { + #address-cells = <1>; + #size-cells = <1>; + #iommu-cells = <1>; + compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; + ranges = <0 0x1f08000 0x10000>; + clocks = <&gcc GCC_SMMU_CFG_CLK>, + <&gcc GCC_GFX_TCU_CLK>; + clock-names = "iface", "bus"; + qcom,iommu-secure-id = <18>; + + // gfx3d_user: + iommu-ctx@1000 { + compatible = "qcom,msm-iommu-v1-ns"; + reg = <0x1000 0x1000>; + interrupts = ; + }; + + // gfx3d_priv: + iommu-ctx@2000 { + compatible = "qcom,msm-iommu-v1-ns"; + reg = <0x2000 0x1000>; + interrupts = ; + }; + }; + + gpu@1c00000 { + compatible = "qcom,adreno-306.0", "qcom,adreno"; + reg = <0x01c00000 0x20000>; + reg-names = "kgsl_3d0_reg_memory"; + interrupts = ; + interrupt-names = "kgsl_3d0_irq"; + clock-names = + "core", + "iface", + "mem", + "mem_iface", + "alt_mem_iface", + "gfx3d"; + clocks = + <&gcc GCC_OXILI_GFX3D_CLK>, + <&gcc GCC_OXILI_AHB_CLK>, + <&gcc GCC_OXILI_GMEM_CLK>, + <&gcc GCC_BIMC_GFX_CLK>, + <&gcc GCC_BIMC_GPU_CLK>, + <&gcc GFX3D_CLK_SRC>; + power-domains = <&gcc OXILI_GDSC>; + operating-points-v2 = <&gpu_opp_table>; + iommus = <&gpu_iommu 1>, <&gpu_iommu 2>; + }; + mdss: mdss@1a00000 { compatible = "qcom,mdss"; reg = <0x1a00000 0x1000>, @@ -735,6 +829,8 @@ "core_clk", "vsync_clk"; + iommus = <&apps_iommu 4>; + ports { #address-cells = <1>; #size-cells = <0>; @@ -990,7 +1086,7 @@ }; replicator@824000 { - compatible = "qcom,coresight-replicator1x", "arm,primecell"; + compatible = "arm,coresight-dynamic-replicator", "arm,primecell"; reg = <0x824000 0x1000>; clocks = <&rpmcc RPM_QDSS_CLK>, <&rpmcc RPM_QDSS_A_CLK>; @@ -1207,6 +1303,28 @@ }; }; }; + + venus: video-codec@1d00000 { + compatible = "qcom,msm8916-venus"; + reg = <0x01d00000 0xff000>; + interrupts = ; + power-domains = <&gcc VENUS_GDSC>; + clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>, + <&gcc GCC_VENUS0_AHB_CLK>, + <&gcc GCC_VENUS0_AXI_CLK>; + clock-names = "core", "iface", "bus"; + iommus = <&apps_iommu 5>; + memory-region = <&venus_mem>; + status = "okay"; + + video-decoder { + compatible = "venus-decoder"; + }; + + video-encoder { + compatible = "venus-encoder"; + }; + }; }; smd { diff --git a/src/arm64/qcom/msm8996.dtsi b/src/arm64/qcom/msm8996.dtsi index 8f085716e258..887b61c872dd 100644 --- a/src/arm64/qcom/msm8996.dtsi +++ b/src/arm64/qcom/msm8996.dtsi @@ -276,12 +276,83 @@ hwlocks = <&tcsr_mutex 3>; }; + rpm-glink { + compatible = "qcom,glink-rpm"; + + interrupts = ; + + qcom,rpm-msg-ram = <&rpm_msg_ram>; + + mboxes = <&apcs_glb 0>; + + rpm_requests { + compatible = "qcom,rpm-msm8996"; + qcom,glink-channels = "rpm_requests"; + + pm8994-regulators { + compatible = "qcom,rpm-pm8994-regulators"; + + pm8994_s1: s1 {}; + pm8994_s2: s2 {}; + pm8994_s3: s3 {}; + pm8994_s4: s4 {}; + pm8994_s5: s5 {}; + pm8994_s6: s6 {}; + pm8994_s7: s7 {}; + pm8994_s8: s8 {}; + pm8994_s9: s9 {}; + pm8994_s10: s10 {}; + pm8994_s11: s11 {}; + pm8994_s12: s12 {}; + + pm8994_l1: l1 {}; + pm8994_l2: l2 {}; + pm8994_l3: l3 {}; + pm8994_l4: l4 {}; + pm8994_l5: l5 {}; + pm8994_l6: l6 {}; + pm8994_l7: l7 {}; + pm8994_l8: l8 {}; + pm8994_l9: l9 {}; + pm8994_l10: l10 {}; + pm8994_l11: l11 {}; + pm8994_l12: l12 {}; + pm8994_l13: l13 {}; + pm8994_l14: l14 {}; + pm8994_l15: l15 {}; + pm8994_l16: l16 {}; + pm8994_l17: l17 {}; + pm8994_l18: l18 {}; + pm8994_l19: l19 {}; + pm8994_l20: l20 {}; + pm8994_l21: l21 {}; + pm8994_l22: l22 {}; + pm8994_l23: l23 {}; + pm8994_l24: l24 {}; + pm8994_l25: l25 {}; + pm8994_l26: l26 {}; + pm8994_l27: l27 {}; + pm8994_l28: l28 {}; + pm8994_l29: l29 {}; + pm8994_l30: l30 {}; + pm8994_l31: l31 {}; + pm8994_l32: l32 {}; + }; + + }; + }; + soc: soc { #address-cells = <1>; #size-cells = <1>; ranges = <0 0 0 0xffffffff>; compatible = "simple-bus"; + rpm_msg_ram: memory@68000 { + compatible = "qcom,rpm-msg-ram"; + reg = <0x68000 0x6000>; + }; + tcsr_mutex_regs: syscon@740000 { compatible = "syscon"; reg = <0x740000 0x20000>; @@ -303,6 +374,13 @@ reg = <0x9820000 0x1000>; }; + apcs_glb: mailbox@9820000 { + compatible = "qcom,msm8996-apcs-hmss-global"; + reg = <0x9820000 0x1000>; + + #mbox-cells = <1>; + }; + gcc: clock-controller@300000 { compatible = "qcom,gcc-msm8996"; #clock-cells = <1>; @@ -538,6 +616,209 @@ <960000000>, <825000000>; }; + + qfprom@74000 { + compatible = "qcom,qfprom"; + reg = <0x74000 0x8ff>; + #address-cells = <1>; + #size-cells = <1>; + + qusb2p_hstx_trim: hstx_trim@24e { + reg = <0x24e 0x2>; + bits = <5 4>; + }; + + qusb2s_hstx_trim: hstx_trim@24f { + reg = <0x24f 0x1>; + bits = <1 4>; + }; + }; + + phy@34000 { + compatible = "qcom,msm8996-qmp-pcie-phy"; + reg = <0x34000 0x488>; + #clock-cells = <1>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>, + <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>, + <&gcc GCC_PCIE_CLKREF_CLK>; + clock-names = "aux", "cfg_ahb", "ref"; + + vdda-phy-supply = <&pm8994_l28>; + vdda-pll-supply = <&pm8994_l12>; + + resets = <&gcc GCC_PCIE_PHY_BCR>, + <&gcc GCC_PCIE_PHY_COM_BCR>, + <&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>; + reset-names = "phy", "common", "cfg"; + status = "disabled"; + + pciephy_0: lane@35000 { + reg = <0x035000 0x130>, + <0x035200 0x200>, + <0x035400 0x1dc>; + #phy-cells = <0>; + + clock-output-names = "pcie_0_pipe_clk_src"; + clocks = <&gcc GCC_PCIE_0_PIPE_CLK>; + clock-names = "pipe0"; + resets = <&gcc GCC_PCIE_0_PHY_BCR>; + reset-names = "lane0"; + }; + + pciephy_1: lane@36000 { + reg = <0x036000 0x130>, + <0x036200 0x200>, + <0x036400 0x1dc>; + #phy-cells = <0>; + + clock-output-names = "pcie_1_pipe_clk_src"; + clocks = <&gcc GCC_PCIE_1_PIPE_CLK>; + clock-names = "pipe1"; + resets = <&gcc GCC_PCIE_1_PHY_BCR>; + reset-names = "lane1"; + }; + + pciephy_2: lane@37000 { + reg = <0x037000 0x130>, + <0x037200 0x200>, + <0x037400 0x1dc>; + #phy-cells = <0>; + + clock-output-names = "pcie_2_pipe_clk_src"; + clocks = <&gcc GCC_PCIE_2_PIPE_CLK>; + clock-names = "pipe2"; + resets = <&gcc GCC_PCIE_2_PHY_BCR>; + reset-names = "lane2"; + }; + }; + + phy@7410000 { + compatible = "qcom,msm8996-qmp-usb3-phy"; + reg = <0x7410000 0x1c4>; + #clock-cells = <1>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + clocks = <&gcc GCC_USB3_PHY_AUX_CLK>, + <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, + <&gcc GCC_USB3_CLKREF_CLK>; + clock-names = "aux", "cfg_ahb", "ref"; + + vdda-phy-supply = <&pm8994_l28>; + vdda-pll-supply = <&pm8994_l12>; + + resets = <&gcc GCC_USB3_PHY_BCR>, + <&gcc GCC_USB3PHY_PHY_BCR>; + reset-names = "phy", "common"; + status = "disabled"; + + ssusb_phy_0: lane@7410200 { + reg = <0x7410200 0x200>, + <0x7410400 0x130>, + <0x7410600 0x1a8>; + #phy-cells = <0>; + + clock-output-names = "usb3_phy_pipe_clk_src"; + clocks = <&gcc GCC_USB3_PHY_PIPE_CLK>; + clock-names = "pipe0"; + }; + }; + + hsusb_phy1: phy@7411000 { + compatible = "qcom,msm8996-qusb2-phy"; + reg = <0x7411000 0x180>; + #phy-cells = <0>; + + clocks = <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, + <&gcc GCC_RX1_USB2_CLKREF_CLK>; + clock-names = "cfg_ahb", "ref"; + + vdda-pll-supply = <&pm8994_l12>; + vdda-phy-dpdm-supply = <&pm8994_l24>; + + resets = <&gcc GCC_QUSB2PHY_PRIM_BCR>; + nvmem-cells = <&qusb2p_hstx_trim>; + status = "disabled"; + }; + + hsusb_phy2: phy@7412000 { + compatible = "qcom,msm8996-qusb2-phy"; + reg = <0x7412000 0x180>; + #phy-cells = <0>; + + clocks = <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>, + <&gcc GCC_RX2_USB2_CLKREF_CLK>; + clock-names = "cfg_ahb", "ref"; + + vdda-pll-supply = <&pm8994_l12>; + vdda-phy-dpdm-supply = <&pm8994_l24>; + + resets = <&gcc GCC_QUSB2PHY_SEC_BCR>; + nvmem-cells = <&qusb2s_hstx_trim>; + status = "disabled"; + }; + + usb2: usb@7600000 { + compatible = "qcom,dwc3"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + clocks = <&gcc GCC_PERIPH_NOC_USB20_AHB_CLK>, + <&gcc GCC_USB20_MASTER_CLK>, + <&gcc GCC_USB20_MOCK_UTMI_CLK>, + <&gcc GCC_USB20_SLEEP_CLK>, + <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>; + + assigned-clocks = <&gcc GCC_USB20_MOCK_UTMI_CLK>, + <&gcc GCC_USB20_MASTER_CLK>; + assigned-clock-rates = <19200000>, <60000000>; + + power-domains = <&gcc USB30_GDSC>; + status = "disabled"; + + dwc3@7600000 { + compatible = "snps,dwc3"; + reg = <0x7600000 0xcc00>; + interrupts = <0 138 0>; + phys = <&hsusb_phy2>; + phy-names = "usb2-phy"; + }; + }; + + usb3: usb@6a00000 { + compatible = "qcom,dwc3"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + clocks = <&gcc GCC_SYS_NOC_USB3_AXI_CLK>, + <&gcc GCC_USB30_MASTER_CLK>, + <&gcc GCC_AGGRE2_USB3_AXI_CLK>, + <&gcc GCC_USB30_MOCK_UTMI_CLK>, + <&gcc GCC_USB30_SLEEP_CLK>, + <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>; + + assigned-clocks = <&gcc GCC_USB30_MOCK_UTMI_CLK>, + <&gcc GCC_USB30_MASTER_CLK>; + assigned-clock-rates = <19200000>, <120000000>; + + power-domains = <&gcc USB30_GDSC>; + status = "disabled"; + + dwc3@6a00000 { + compatible = "snps,dwc3"; + reg = <0x6a00000 0xcc00>; + interrupts = <0 131 0>; + phys = <&hsusb_phy1>, <&ssusb_phy_0>; + phy-names = "usb2-phy", "usb3-phy"; + }; + }; }; adsp-pil { @@ -558,6 +839,15 @@ qcom,smem-states = <&adsp_smp2p_out 0>; qcom,smem-state-names = "stop"; + + smd-edge { + interrupts = ; + + label = "lpass"; + qcom,ipc = <&apcs 16 8>; + qcom,smd-edge = <1>; + qcom,remote-pid = <2>; + }; }; adsp-smp2p { @@ -584,6 +874,30 @@ }; }; + modem-smp2p { + compatible = "qcom,smp2p"; + qcom,smem = <435>, <428>; + + interrupts = ; + + qcom,ipc = <&apcs 16 14>; + + qcom,local-pid = <0>; + qcom,remote-pid = <1>; + + modem_smp2p_out: master-kernel { + qcom,entry-name = "master-kernel"; + #qcom,smem-state-cells = <1>; + }; + + modem_smp2p_in: slave-kernel { + qcom,entry-name = "slave-kernel"; + + interrupt-controller; + #interrupt-cells = <2>; + }; + }; + smp2p-slpi { compatible = "qcom,smp2p"; qcom,smem = <481>, <430>; diff --git a/src/arm64/qcom/pm8004.dtsi b/src/arm64/qcom/pm8004.dtsi index ef2207afa86b..297b57bfa87a 100644 --- a/src/arm64/qcom/pm8004.dtsi +++ b/src/arm64/qcom/pm8004.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/src/arm64/qcom/pm8916.dtsi b/src/arm64/qcom/pm8916.dtsi index 53deebf9f515..0223e60d8b6a 100644 --- a/src/arm64/qcom/pm8916.dtsi +++ b/src/arm64/qcom/pm8916.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/src/arm64/qcom/pm8994.dtsi b/src/arm64/qcom/pm8994.dtsi index b413e44fd09e..80024c0b1c7c 100644 --- a/src/arm64/qcom/pm8994.dtsi +++ b/src/arm64/qcom/pm8994.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/src/arm64/qcom/pmi8994.dtsi b/src/arm64/qcom/pmi8994.dtsi index d3879a4e8076..dae1cdc23f54 100644 --- a/src/arm64/qcom/pmi8994.dtsi +++ b/src/arm64/qcom/pmi8994.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include @@ -8,6 +9,23 @@ reg = <0x2 SPMI_USID>; #address-cells = <1>; #size-cells = <0>; + + pmi8994_gpios: gpios@c000 { + compatible = "qcom,pmi8994-gpio", "qcom,spmi-gpio"; + reg = <0xc000>; + gpio-controller; + #gpio-cells = <2>; + interrupts = <2 0xc0 0 IRQ_TYPE_NONE>, + <2 0xc1 0 IRQ_TYPE_NONE>, + <2 0xc2 0 IRQ_TYPE_NONE>, + <2 0xc3 0 IRQ_TYPE_NONE>, + <2 0xc4 0 IRQ_TYPE_NONE>, + <2 0xc5 0 IRQ_TYPE_NONE>, + <2 0xc6 0 IRQ_TYPE_NONE>, + <2 0xc7 0 IRQ_TYPE_NONE>, + <2 0xc8 0 IRQ_TYPE_NONE>, + <2 0xc9 0 IRQ_TYPE_NONE>; + }; }; pmic@3 { diff --git a/src/arm64/renesas/r8a7795-es1-h3ulcb.dts b/src/arm64/renesas/r8a7795-es1-h3ulcb.dts index 95fe207cb6a3..dd4f9b6a4254 100644 --- a/src/arm64/renesas/r8a7795-es1-h3ulcb.dts +++ b/src/arm64/renesas/r8a7795-es1-h3ulcb.dts @@ -9,8 +9,6 @@ * kind, whether express or implied. */ -#define CPG_AUDIO_CLK_I R8A7795_CLK_S0D4 - /dts-v1/; #include "r8a7795-es1.dtsi" #include "ulcb.dtsi" diff --git a/src/arm64/renesas/r8a7795-es1-salvator-x.dts b/src/arm64/renesas/r8a7795-es1-salvator-x.dts index b84c156ed696..3f7d5f51e428 100644 --- a/src/arm64/renesas/r8a7795-es1-salvator-x.dts +++ b/src/arm64/renesas/r8a7795-es1-salvator-x.dts @@ -8,8 +8,6 @@ * kind, whether express or implied. */ -#define CPG_AUDIO_CLK_I R8A7795_CLK_S0D4 - /dts-v1/; #include "r8a7795-es1.dtsi" #include "salvator-x.dtsi" diff --git a/src/arm64/renesas/r8a7795-es1.dtsi b/src/arm64/renesas/r8a7795-es1.dtsi index a0ba7bd21ea3..aaa5e67a963e 100644 --- a/src/arm64/renesas/r8a7795-es1.dtsi +++ b/src/arm64/renesas/r8a7795-es1.dtsi @@ -21,6 +21,14 @@ status = "disabled"; }; + /delete-node/ usb-phy@ee0e0200; + /delete-node/ usb@ee0e0100; + /delete-node/ usb@ee0e0000; + /delete-node/ usb@e659c000; + + /delete-node/ dma-controller@e6460000; + /delete-node/ dma-controller@e6470000; + fcpf2: fcp@fe952000 { compatible = "renesas,fcpf"; reg = <0 0xfe952000 0 0x200>; @@ -79,6 +87,5 @@ }; &du { - compatible = "renesas,du-r8a7795"; vsps = <&vspd0 &vspd1 &vspd2 &vspd3>; }; diff --git a/src/arm64/renesas/r8a7795-h3ulcb.dts b/src/arm64/renesas/r8a7795-h3ulcb.dts index 0426f41765f0..0afe777973de 100644 --- a/src/arm64/renesas/r8a7795-h3ulcb.dts +++ b/src/arm64/renesas/r8a7795-h3ulcb.dts @@ -9,8 +9,6 @@ * kind, whether express or implied. */ -#define CPG_AUDIO_CLK_I R8A7795_CLK_S0D4 - /dts-v1/; #include "r8a7795.dtsi" #include "ulcb.dtsi" @@ -40,3 +38,17 @@ reg = <0x7 0x00000000 0x0 0x40000000>; }; }; + +&du { + clocks = <&cpg CPG_MOD 724>, + <&cpg CPG_MOD 723>, + <&cpg CPG_MOD 722>, + <&cpg CPG_MOD 721>, + <&cpg CPG_MOD 727>, + <&versaclock5 1>, + <&versaclock5 3>, + <&versaclock5 4>, + <&versaclock5 2>; + clock-names = "du.0", "du.1", "du.2", "du.3", "lvds.0", + "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3"; +}; diff --git a/src/arm64/renesas/r8a7795-salvator-x.dts b/src/arm64/renesas/r8a7795-salvator-x.dts index 684fb3b9d154..17953070f38d 100644 --- a/src/arm64/renesas/r8a7795-salvator-x.dts +++ b/src/arm64/renesas/r8a7795-salvator-x.dts @@ -8,8 +8,6 @@ * kind, whether express or implied. */ -#define CPG_AUDIO_CLK_I R8A7795_CLK_S0D4 - /dts-v1/; #include "r8a7795.dtsi" #include "salvator-x.dtsi" diff --git a/src/arm64/renesas/r8a7795-salvator-xs.dts b/src/arm64/renesas/r8a7795-salvator-xs.dts index de354957144b..7675de5d4f2c 100644 --- a/src/arm64/renesas/r8a7795-salvator-xs.dts +++ b/src/arm64/renesas/r8a7795-salvator-xs.dts @@ -8,8 +8,6 @@ * kind, whether express or implied. */ -#define CPG_AUDIO_CLK_I R8A7795_CLK_S0D4 - /dts-v1/; #include "r8a7795.dtsi" #include "salvator-xs.dtsi" @@ -46,10 +44,12 @@ <&cpg CPG_MOD 722>, <&cpg CPG_MOD 721>, <&cpg CPG_MOD 727>, + <&versaclock6 1>, <&x21_clk>, - <&x22_clk>; + <&x22_clk>, + <&versaclock6 2>; clock-names = "du.0", "du.1", "du.2", "du.3", "lvds.0", - "dclkin.1", "dclkin.2"; + "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3"; }; &ehci2 { diff --git a/src/arm64/renesas/r8a7795.dtsi b/src/arm64/renesas/r8a7795.dtsi index e31c1b660b3f..2938195b9571 100644 --- a/src/arm64/renesas/r8a7795.dtsi +++ b/src/arm64/renesas/r8a7795.dtsi @@ -12,6 +12,8 @@ #include #include +#define CPG_AUDIO_CLK_I R8A7795_CLK_S0D4 + / { compatible = "renesas,r8a7795"; #address-cells = <2>; @@ -691,6 +693,126 @@ }; }; + drif00: rif@e6f40000 { + compatible = "renesas,r8a7795-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f40000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 515>; + clock-names = "fck"; + dmas = <&dmac1 0x20>, <&dmac2 0x20>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 515>; + renesas,bonding = <&drif01>; + status = "disabled"; + }; + + drif01: rif@e6f50000 { + compatible = "renesas,r8a7795-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f50000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 514>; + clock-names = "fck"; + dmas = <&dmac1 0x22>, <&dmac2 0x22>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 514>; + renesas,bonding = <&drif00>; + status = "disabled"; + }; + + drif10: rif@e6f60000 { + compatible = "renesas,r8a7795-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f60000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 513>; + clock-names = "fck"; + dmas = <&dmac1 0x24>, <&dmac2 0x24>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 513>; + renesas,bonding = <&drif11>; + status = "disabled"; + }; + + drif11: rif@e6f70000 { + compatible = "renesas,r8a7795-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f70000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 512>; + clock-names = "fck"; + dmas = <&dmac1 0x26>, <&dmac2 0x26>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 512>; + renesas,bonding = <&drif10>; + status = "disabled"; + }; + + drif20: rif@e6f80000 { + compatible = "renesas,r8a7795-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f80000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 511>; + clock-names = "fck"; + dmas = <&dmac1 0x28>, <&dmac2 0x28>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 511>; + renesas,bonding = <&drif21>; + status = "disabled"; + }; + + drif21: rif@e6f90000 { + compatible = "renesas,r8a7795-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f90000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 510>; + clock-names = "fck"; + dmas = <&dmac1 0x2a>, <&dmac2 0x2a>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 510>; + renesas,bonding = <&drif20>; + status = "disabled"; + }; + + drif30: rif@e6fa0000 { + compatible = "renesas,r8a7795-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6fa0000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 509>; + clock-names = "fck"; + dmas = <&dmac1 0x2c>, <&dmac2 0x2c>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 509>; + renesas,bonding = <&drif31>; + status = "disabled"; + }; + + drif31: rif@e6fb0000 { + compatible = "renesas,r8a7795-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6fb0000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 508>; + clock-names = "fck"; + dmas = <&dmac1 0x2e>, <&dmac2 0x2e>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 508>; + renesas,bonding = <&drif30>; + status = "disabled"; + }; + hscif0: serial@e6540000 { compatible = "renesas,hscif-r8a7795", "renesas,rcar-gen3-hscif", @@ -776,6 +898,68 @@ status = "disabled"; }; + msiof0: spi@e6e90000 { + compatible = "renesas,msiof-r8a7795", + "renesas,rcar-gen3-msiof"; + reg = <0 0xe6e90000 0 0x0064>; + interrupts = ; + clocks = <&cpg CPG_MOD 211>; + dmas = <&dmac1 0x41>, <&dmac1 0x40>, + <&dmac2 0x41>, <&dmac2 0x40>; + dma-names = "tx", "rx", "tx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 211>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + msiof1: spi@e6ea0000 { + compatible = "renesas,msiof-r8a7795", + "renesas,rcar-gen3-msiof"; + reg = <0 0xe6ea0000 0 0x0064>; + interrupts = ; + clocks = <&cpg CPG_MOD 210>; + dmas = <&dmac1 0x43>, <&dmac1 0x42>, + <&dmac2 0x43>, <&dmac2 0x42>; + dma-names = "tx", "rx", "tx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 210>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + msiof2: spi@e6c00000 { + compatible = "renesas,msiof-r8a7795", + "renesas,rcar-gen3-msiof"; + reg = <0 0xe6c00000 0 0x0064>; + interrupts = ; + clocks = <&cpg CPG_MOD 209>; + dmas = <&dmac0 0x45>, <&dmac0 0x44>; + dma-names = "tx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 209>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + + msiof3: spi@e6c10000 { + compatible = "renesas,msiof-r8a7795", + "renesas,rcar-gen3-msiof"; + reg = <0 0xe6c10000 0 0x0064>; + interrupts = ; + clocks = <&cpg CPG_MOD 208>; + dmas = <&dmac0 0x47>, <&dmac0 0x46>; + dma-names = "tx", "rx"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 208>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + scif0: serial@e6e60000 { compatible = "renesas,scif-r8a7795", "renesas,rcar-gen3-scif", "renesas,scif"; @@ -1267,7 +1451,8 @@ }; sata: sata@ee300000 { - compatible = "renesas,sata-r8a7795"; + compatible = "renesas,sata-r8a7795", + "renesas,rcar-gen3-sata"; reg = <0 0xee300000 0 0x200000>; interrupts = ; clocks = <&cpg CPG_MOD 815>; @@ -1314,6 +1499,34 @@ dma-channels = <2>; }; + usb_dmac2: dma-controller@e6460000 { + compatible = "renesas,r8a7795-usb-dmac", + "renesas,usb-dmac"; + reg = <0 0xe6460000 0 0x100>; + interrupts = ; + interrupt-names = "ch0", "ch1"; + clocks = <&cpg CPG_MOD 326>; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 326>; + #dma-cells = <1>; + dma-channels = <2>; + }; + + usb_dmac3: dma-controller@e6470000 { + compatible = "renesas,r8a7795-usb-dmac", + "renesas,usb-dmac"; + reg = <0 0xe6470000 0 0x100>; + interrupts = ; + interrupt-names = "ch0", "ch1"; + clocks = <&cpg CPG_MOD 329>; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 329>; + #dma-cells = <1>; + dma-channels = <2>; + }; + sdhi0: sd@ee100000 { compatible = "renesas,sdhi-r8a7795"; reg = <0 0xee100000 0 0x2000>; @@ -1392,6 +1605,18 @@ status = "disabled"; }; + usb2_phy3: usb-phy@ee0e0200 { + compatible = "renesas,usb2-phy-r8a7795", + "renesas,rcar-gen3-usb2-phy"; + reg = <0 0xee0e0200 0 0x700>; + interrupts = ; + clocks = <&cpg CPG_MOD 700>; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 700>; + #phy-cells = <0>; + status = "disabled"; + }; + ehci0: usb@ee080100 { compatible = "generic-ehci"; reg = <0 0xee080100 0 0x100>; @@ -1399,6 +1624,7 @@ clocks = <&cpg CPG_MOD 703>; phys = <&usb2_phy0>; phy-names = "usb"; + companion = <&ohci0>; power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; resets = <&cpg 703>; status = "disabled"; @@ -1411,6 +1637,7 @@ clocks = <&cpg CPG_MOD 702>; phys = <&usb2_phy1>; phy-names = "usb"; + companion = <&ohci1>; power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; resets = <&cpg 702>; status = "disabled"; @@ -1423,11 +1650,25 @@ clocks = <&cpg CPG_MOD 701>; phys = <&usb2_phy2>; phy-names = "usb"; + companion = <&ohci2>; power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; resets = <&cpg 701>; status = "disabled"; }; + ehci3: usb@ee0e0100 { + compatible = "generic-ehci"; + reg = <0 0xee0e0100 0 0x100>; + interrupts = ; + clocks = <&cpg CPG_MOD 700>; + phys = <&usb2_phy3>; + phy-names = "usb"; + companion = <&ohci3>; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 700>; + status = "disabled"; + }; + ohci0: usb@ee080000 { compatible = "generic-ohci"; reg = <0 0xee080000 0 0x100>; @@ -1464,6 +1705,18 @@ status = "disabled"; }; + ohci3: usb@ee0e0000 { + compatible = "generic-ohci"; + reg = <0 0xee0e0000 0 0x100>; + interrupts = ; + clocks = <&cpg CPG_MOD 700>; + phys = <&usb2_phy3>; + phy-names = "usb"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 700>; + status = "disabled"; + }; + hsusb: usb@e6590000 { compatible = "renesas,usbhs-r8a7795", "renesas,rcar-gen3-usbhs"; @@ -1481,6 +1734,23 @@ status = "disabled"; }; + hsusb3: usb@e659c000 { + compatible = "renesas,usbhs-r8a7795", + "renesas,rcar-gen3-usbhs"; + reg = <0 0xe659c000 0 0x100>; + interrupts = ; + clocks = <&cpg CPG_MOD 705>; + dmas = <&usb_dmac2 0>, <&usb_dmac2 1>, + <&usb_dmac3 0>, <&usb_dmac3 1>; + dma-names = "ch0", "ch1", "ch2", "ch3"; + renesas,buswait = <11>; + phys = <&usb2_phy3>; + phy-names = "usb"; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; + resets = <&cpg 705>; + status = "disabled"; + }; + pciec0: pcie@fe000000 { compatible = "renesas,pcie-r8a7795", "renesas,pcie-rcar-gen3"; @@ -1535,6 +1805,46 @@ status = "disabled"; }; + imr-lx4@fe860000 { + compatible = "renesas,r8a7795-imr-lx4", + "renesas,imr-lx4"; + reg = <0 0xfe860000 0 0x2000>; + interrupts = ; + clocks = <&cpg CPG_MOD 823>; + power-domains = <&sysc R8A7795_PD_A3VC>; + resets = <&cpg 823>; + }; + + imr-lx4@fe870000 { + compatible = "renesas,r8a7795-imr-lx4", + "renesas,imr-lx4"; + reg = <0 0xfe870000 0 0x2000>; + interrupts = ; + clocks = <&cpg CPG_MOD 822>; + power-domains = <&sysc R8A7795_PD_A3VC>; + resets = <&cpg 822>; + }; + + imr-lx4@fe880000 { + compatible = "renesas,r8a7795-imr-lx4", + "renesas,imr-lx4"; + reg = <0 0xfe880000 0 0x2000>; + interrupts = ; + clocks = <&cpg CPG_MOD 821>; + power-domains = <&sysc R8A7795_PD_A3VC>; + resets = <&cpg 821>; + }; + + imr-lx4@fe890000 { + compatible = "renesas,r8a7795-imr-lx4", + "renesas,imr-lx4"; + reg = <0 0xfe890000 0 0x2000>; + interrupts = ; + clocks = <&cpg CPG_MOD 820>; + power-domains = <&sysc R8A7795_PD_A3VC>; + resets = <&cpg 820>; + }; + vspbc: vsp@fe920000 { compatible = "renesas,vsp2"; reg = <0 0xfe920000 0 0x8000>; @@ -1755,6 +2065,7 @@ }; du: display@feb00000 { + compatible = "renesas,du-r8a7795"; reg = <0 0xfeb00000 0 0x80000>, <0 0xfeb90000 0 0x14>; reg-names = "du", "lvds.0"; @@ -1768,6 +2079,7 @@ <&cpg CPG_MOD 721>, <&cpg CPG_MOD 727>; clock-names = "du.0", "du.1", "du.2", "du.3", "lvds.0"; + vsps = <&vspd0 0 &vspd1 0 &vspd2 0 &vspd0 1>; status = "disabled"; ports { diff --git a/src/arm64/renesas/r8a7796-m3ulcb.dts b/src/arm64/renesas/r8a7796-m3ulcb.dts index 38b58b7fca4b..daee1f1a3f68 100644 --- a/src/arm64/renesas/r8a7796-m3ulcb.dts +++ b/src/arm64/renesas/r8a7796-m3ulcb.dts @@ -9,8 +9,6 @@ * kind, whether express or implied. */ -#define CPG_AUDIO_CLK_I R8A7796_CLK_S0D4 - /dts-v1/; #include "r8a7796.dtsi" #include "ulcb.dtsi" @@ -30,3 +28,15 @@ reg = <0x6 0x00000000 0x0 0x40000000>; }; }; + +&du { + clocks = <&cpg CPG_MOD 724>, + <&cpg CPG_MOD 723>, + <&cpg CPG_MOD 722>, + <&cpg CPG_MOD 727>, + <&versaclock5 1>, + <&versaclock5 3>, + <&versaclock5 2>; + clock-names = "du.0", "du.1", "du.2", "lvds.0", + "dclkin.0", "dclkin.1", "dclkin.2"; +}; diff --git a/src/arm64/renesas/r8a7796-salvator-x.dts b/src/arm64/renesas/r8a7796-salvator-x.dts index db4f162d6bdd..b317be03306e 100644 --- a/src/arm64/renesas/r8a7796-salvator-x.dts +++ b/src/arm64/renesas/r8a7796-salvator-x.dts @@ -8,8 +8,6 @@ * kind, whether express or implied. */ -#define CPG_AUDIO_CLK_I R8A7796_CLK_S0D4 - /dts-v1/; #include "r8a7796.dtsi" #include "salvator-x.dtsi" @@ -29,3 +27,32 @@ reg = <0x6 0x00000000 0x0 0x80000000>; }; }; + +&du { + clocks = <&cpg CPG_MOD 724>, + <&cpg CPG_MOD 723>, + <&cpg CPG_MOD 722>, + <&cpg CPG_MOD 727>, + <&versaclock5 1>, + <&x21_clk>, + <&versaclock5 2>; + clock-names = "du.0", "du.1", "du.2", "lvds.0", + "dclkin.0", "dclkin.1", "dclkin.2"; +}; + +&hdmi0 { + status = "okay"; + + ports { + port@1 { + reg = <1>; + rcar_dw_hdmi0_out: endpoint { + remote-endpoint = <&hdmi0_con>; + }; + }; + }; +}; + +&hdmi0_con { + remote-endpoint = <&rcar_dw_hdmi0_out>; +}; diff --git a/src/arm64/renesas/r8a7796.dtsi b/src/arm64/renesas/r8a7796.dtsi index 1f6710912045..369092e17e34 100644 --- a/src/arm64/renesas/r8a7796.dtsi +++ b/src/arm64/renesas/r8a7796.dtsi @@ -12,6 +12,8 @@ #include #include +#define CPG_AUDIO_CLK_I R8A7796_CLK_S0D4 + / { compatible = "renesas,r8a7796"; #address-cells = <2>; @@ -639,6 +641,126 @@ }; }; + drif00: rif@e6f40000 { + compatible = "renesas,r8a7796-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f40000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 515>; + clock-names = "fck"; + dmas = <&dmac1 0x20>, <&dmac2 0x20>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 515>; + renesas,bonding = <&drif01>; + status = "disabled"; + }; + + drif01: rif@e6f50000 { + compatible = "renesas,r8a7796-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f50000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 514>; + clock-names = "fck"; + dmas = <&dmac1 0x22>, <&dmac2 0x22>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 514>; + renesas,bonding = <&drif00>; + status = "disabled"; + }; + + drif10: rif@e6f60000 { + compatible = "renesas,r8a7796-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f60000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 513>; + clock-names = "fck"; + dmas = <&dmac1 0x24>, <&dmac2 0x24>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 513>; + renesas,bonding = <&drif11>; + status = "disabled"; + }; + + drif11: rif@e6f70000 { + compatible = "renesas,r8a7796-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f70000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 512>; + clock-names = "fck"; + dmas = <&dmac1 0x26>, <&dmac2 0x26>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 512>; + renesas,bonding = <&drif10>; + status = "disabled"; + }; + + drif20: rif@e6f80000 { + compatible = "renesas,r8a7796-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f80000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 511>; + clock-names = "fck"; + dmas = <&dmac1 0x28>, <&dmac2 0x28>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 511>; + renesas,bonding = <&drif21>; + status = "disabled"; + }; + + drif21: rif@e6f90000 { + compatible = "renesas,r8a7796-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6f90000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 510>; + clock-names = "fck"; + dmas = <&dmac1 0x2a>, <&dmac2 0x2a>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 510>; + renesas,bonding = <&drif20>; + status = "disabled"; + }; + + drif30: rif@e6fa0000 { + compatible = "renesas,r8a7796-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6fa0000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 509>; + clock-names = "fck"; + dmas = <&dmac1 0x2c>, <&dmac2 0x2c>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 509>; + renesas,bonding = <&drif31>; + status = "disabled"; + }; + + drif31: rif@e6fb0000 { + compatible = "renesas,r8a7796-drif", + "renesas,rcar-gen3-drif"; + reg = <0 0xe6fb0000 0 0x64>; + interrupts = ; + clocks = <&cpg CPG_MOD 508>; + clock-names = "fck"; + dmas = <&dmac1 0x2e>, <&dmac2 0x2e>; + dma-names = "rx", "rx"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 508>; + renesas,bonding = <&drif30>; + status = "disabled"; + }; + avb: ethernet@e6800000 { compatible = "renesas,etheravb-r8a7796", "renesas,etheravb-rcar-gen3"; @@ -877,7 +999,7 @@ clocks = <&cpg CPG_MOD 211>; dmas = <&dmac1 0x41>, <&dmac1 0x40>, <&dmac2 0x41>, <&dmac2 0x40>; - dma-names = "tx", "rx"; + dma-names = "tx", "rx", "tx", "rx"; power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; resets = <&cpg 211>; #address-cells = <1>; @@ -893,7 +1015,7 @@ clocks = <&cpg CPG_MOD 210>; dmas = <&dmac1 0x43>, <&dmac1 0x42>, <&dmac2 0x43>, <&dmac2 0x42>; - dma-names = "tx", "rx"; + dma-names = "tx", "rx", "tx", "rx"; power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; resets = <&cpg 210>; #address-cells = <1>; @@ -1101,36 +1223,133 @@ dma-channels = <16>; }; + usb_dmac0: dma-controller@e65a0000 { + compatible = "renesas,r8a7796-usb-dmac", + "renesas,usb-dmac"; + reg = <0 0xe65a0000 0 0x100>; + interrupts = ; + interrupt-names = "ch0", "ch1"; + clocks = <&cpg CPG_MOD 330>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 330>; + #dma-cells = <1>; + dma-channels = <2>; + }; + + usb_dmac1: dma-controller@e65b0000 { + compatible = "renesas,r8a7796-usb-dmac", + "renesas,usb-dmac"; + reg = <0 0xe65b0000 0 0x100>; + interrupts = ; + interrupt-names = "ch0", "ch1"; + clocks = <&cpg CPG_MOD 331>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 331>; + #dma-cells = <1>; + dma-channels = <2>; + }; + hsusb: usb@e6590000 { - /* placeholder */ + compatible = "renesas,usbhs-r8a7796", + "renesas,rcar-gen3-usbhs"; + reg = <0 0xe6590000 0 0x100>; + interrupts = ; + clocks = <&cpg CPG_MOD 704>; + dmas = <&usb_dmac0 0>, <&usb_dmac0 1>, + <&usb_dmac1 0>, <&usb_dmac1 1>; + dma-names = "ch0", "ch1", "ch2", "ch3"; + renesas,buswait = <11>; + phys = <&usb2_phy0>; + phy-names = "usb"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 704>; + status = "disabled"; }; xhci0: usb@ee000000 { - /* placeholder */ + compatible = "renesas,xhci-r8a7796", + "renesas,rcar-gen3-xhci"; + reg = <0 0xee000000 0 0xc00>; + interrupts = ; + clocks = <&cpg CPG_MOD 328>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 328>; + status = "disabled"; }; ohci0: usb@ee080000 { - /* placeholder */ + compatible = "generic-ohci"; + reg = <0 0xee080000 0 0x100>; + interrupts = ; + clocks = <&cpg CPG_MOD 703>; + phys = <&usb2_phy0>; + phy-names = "usb"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 703>; + status = "disabled"; }; ehci0: usb@ee080100 { - /* placeholder */ + compatible = "generic-ehci"; + reg = <0 0xee080100 0 0x100>; + interrupts = ; + clocks = <&cpg CPG_MOD 703>; + phys = <&usb2_phy0>; + phy-names = "usb"; + companion= <&ohci0>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 703>; + status = "disabled"; }; usb2_phy0: usb-phy@ee080200 { - /* placeholder */ + compatible = "renesas,usb2-phy-r8a7796", + "renesas,rcar-gen3-usb2-phy"; + reg = <0 0xee080200 0 0x700>; + interrupts = ; + clocks = <&cpg CPG_MOD 703>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 703>; + #phy-cells = <0>; + status = "disabled"; }; ohci1: usb@ee0a0000 { - /* placeholder */ + compatible = "generic-ohci"; + reg = <0 0xee0a0000 0 0x100>; + interrupts = ; + clocks = <&cpg CPG_MOD 702>; + phys = <&usb2_phy1>; + phy-names = "usb"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 702>; + status = "disabled"; }; ehci1: usb@ee0a0100 { - /* placeholder */ + compatible = "generic-ehci"; + reg = <0 0xee0a0100 0 0x100>; + interrupts = ; + clocks = <&cpg CPG_MOD 702>; + phys = <&usb2_phy1>; + phy-names = "usb"; + companion= <&ohci1>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 702>; + status = "disabled"; }; usb2_phy1: usb-phy@ee0a0200 { - /* placeholder */ + compatible = "renesas,usb2-phy-r8a7796", + "renesas,rcar-gen3-usb2-phy"; + reg = <0 0xee0a0200 0 0x700>; + clocks = <&cpg CPG_MOD 702>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 702>; + #phy-cells = <0>; + status = "disabled"; }; sdhi0: sd@ee100000 { @@ -1440,8 +1659,150 @@ /* placeholder */ }; + fcpf0: fcp@fe950000 { + compatible = "renesas,fcpf"; + reg = <0 0xfe950000 0 0x200>; + clocks = <&cpg CPG_MOD 615>; + power-domains = <&sysc R8A7796_PD_A3VC>; + resets = <&cpg 615>; + }; + + vspb: vsp@fe960000 { + compatible = "renesas,vsp2"; + reg = <0 0xfe960000 0 0x8000>; + interrupts = ; + clocks = <&cpg CPG_MOD 626>; + power-domains = <&sysc R8A7796_PD_A3VC>; + resets = <&cpg 626>; + + renesas,fcp = <&fcpvb0>; + }; + + fcpvb0: fcp@fe96f000 { + compatible = "renesas,fcpv"; + reg = <0 0xfe96f000 0 0x200>; + clocks = <&cpg CPG_MOD 607>; + power-domains = <&sysc R8A7796_PD_A3VC>; + resets = <&cpg 607>; + }; + + vspi0: vsp@fe9a0000 { + compatible = "renesas,vsp2"; + reg = <0 0xfe9a0000 0 0x8000>; + interrupts = ; + clocks = <&cpg CPG_MOD 631>; + power-domains = <&sysc R8A7796_PD_A3VC>; + resets = <&cpg 631>; + + renesas,fcp = <&fcpvi0>; + }; + + fcpvi0: fcp@fe9af000 { + compatible = "renesas,fcpv"; + reg = <0 0xfe9af000 0 0x200>; + clocks = <&cpg CPG_MOD 611>; + power-domains = <&sysc R8A7796_PD_A3VC>; + resets = <&cpg 611>; + }; + + vspd0: vsp@fea20000 { + compatible = "renesas,vsp2"; + reg = <0 0xfea20000 0 0x4000>; + interrupts = ; + clocks = <&cpg CPG_MOD 623>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 623>; + + renesas,fcp = <&fcpvd0>; + }; + + fcpvd0: fcp@fea27000 { + compatible = "renesas,fcpv"; + reg = <0 0xfea27000 0 0x200>; + clocks = <&cpg CPG_MOD 603>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 603>; + }; + + vspd1: vsp@fea28000 { + compatible = "renesas,vsp2"; + reg = <0 0xfea28000 0 0x4000>; + interrupts = ; + clocks = <&cpg CPG_MOD 622>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 622>; + + renesas,fcp = <&fcpvd1>; + }; + + fcpvd1: fcp@fea2f000 { + compatible = "renesas,fcpv"; + reg = <0 0xfea2f000 0 0x200>; + clocks = <&cpg CPG_MOD 602>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 602>; + }; + + vspd2: vsp@fea30000 { + compatible = "renesas,vsp2"; + reg = <0 0xfea30000 0 0x4000>; + interrupts = ; + clocks = <&cpg CPG_MOD 621>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 621>; + + renesas,fcp = <&fcpvd2>; + }; + + fcpvd2: fcp@fea37000 { + compatible = "renesas,fcpv"; + reg = <0 0xfea37000 0 0x200>; + clocks = <&cpg CPG_MOD 601>; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 601>; + }; + + hdmi0: hdmi@fead0000 { + compatible = "renesas,r8a7796-hdmi", "renesas,rcar-gen3-hdmi"; + reg = <0 0xfead0000 0 0x10000>; + interrupts = ; + clocks = <&cpg CPG_MOD 729>, <&cpg CPG_CORE R8A7796_CLK_HDMI>; + clock-names = "iahb", "isfr"; + power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; + resets = <&cpg 729>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + dw_hdmi0_in: endpoint { + remote-endpoint = <&du_out_hdmi0>; + }; + }; + port@1 { + reg = <1>; + }; + }; + }; + du: display@feb00000 { - /* placeholder */ + compatible = "renesas,du-r8a7796"; + reg = <0 0xfeb00000 0 0x70000>, + <0 0xfeb90000 0 0x14>; + reg-names = "du", "lvds.0"; + interrupts = , + , + ; + clocks = <&cpg CPG_MOD 724>, + <&cpg CPG_MOD 723>, + <&cpg CPG_MOD 722>, + <&cpg CPG_MOD 727>; + clock-names = "du.0", "du.1", "du.2", "lvds.0"; + status = "disabled"; + + vsps = <&vspd0 &vspd1 &vspd2>; ports { #address-cells = <1>; @@ -1452,7 +1813,38 @@ du_out_rgb: endpoint { }; }; + port@1 { + reg = <1>; + du_out_hdmi0: endpoint { + remote-endpoint = <&dw_hdmi0_in>; + }; + }; + port@2 { + reg = <2>; + du_out_lvds0: endpoint { + }; + }; }; }; + + imr-lx4@fe860000 { + compatible = "renesas,r8a7796-imr-lx4", + "renesas,imr-lx4"; + reg = <0 0xfe860000 0 0x2000>; + interrupts = ; + clocks = <&cpg CPG_MOD 823>; + power-domains = <&sysc R8A7796_PD_A3VC>; + resets = <&cpg 823>; + }; + + imr-lx4@fe870000 { + compatible = "renesas,r8a7796-imr-lx4", + "renesas,imr-lx4"; + reg = <0 0xfe870000 0 0x2000>; + interrupts = ; + clocks = <&cpg CPG_MOD 822>; + power-domains = <&sysc R8A7796_PD_A3VC>; + resets = <&cpg 822>; + }; }; }; diff --git a/src/arm64/renesas/r8a77995-draak.dts b/src/arm64/renesas/r8a77995-draak.dts new file mode 100644 index 000000000000..d144370051d5 --- /dev/null +++ b/src/arm64/renesas/r8a77995-draak.dts @@ -0,0 +1,46 @@ +/* + * Device Tree Source for the Draak board + * + * Copyright (C) 2016 Renesas Electronics Corp. + * Copyright (C) 2017 Glider bvba + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +/dts-v1/; +#include "r8a77995.dtsi" + +/ { + model = "Renesas Draak board based on r8a77995"; + compatible = "renesas,draak", "renesas,r8a77995"; + + aliases { + serial0 = &scif2; + }; + + chosen { + bootargs = "ignore_loglevel"; + stdout-path = "serial0:115200n8"; + }; + + memory@48000000 { + device_type = "memory"; + /* first 128MB is reserved for secure area. */ + reg = <0x0 0x48000000 0x0 0x18000000>; + }; +}; + +&extal_clk { + clock-frequency = <48000000>; +}; + +&scif2 { + status = "okay"; +}; + +&rwdt { + timeout-sec = <60>; + status = "okay"; +}; diff --git a/src/arm64/renesas/r8a77995.dtsi b/src/arm64/renesas/r8a77995.dtsi new file mode 100644 index 000000000000..d0f95b78c022 --- /dev/null +++ b/src/arm64/renesas/r8a77995.dtsi @@ -0,0 +1,155 @@ +/* + * Device Tree Source for the r8a77995 SoC + * + * Copyright (C) 2016 Renesas Electronics Corp. + * Copyright (C) 2017 Glider bvba + * + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed "as is" without any warranty of any + * kind, whether express or implied. + */ + +#include +#include + +/ { + compatible = "renesas,r8a77995"; + #address-cells = <2>; + #size-cells = <2>; + + psci { + compatible = "arm,psci-1.0", "arm,psci-0.2"; + method = "smc"; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + a53_0: cpu@0 { + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0x0>; + device_type = "cpu"; + power-domains = <&sysc 5>; + next-level-cache = <&L2_CA53>; + enable-method = "psci"; + }; + + L2_CA53: cache-controller-1 { + compatible = "cache"; + power-domains = <&sysc 21>; + cache-unified; + cache-level = <2>; + }; + }; + + extal_clk: extal { + compatible = "fixed-clock"; + #clock-cells = <0>; + /* This value must be overridden by the board */ + clock-frequency = <0>; + }; + + scif_clk: scif { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <0>; + }; + + soc { + compatible = "simple-bus"; + interrupt-parent = <&gic>; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + gic: interrupt-controller@f1010000 { + compatible = "arm,gic-400"; + #interrupt-cells = <3>; + #address-cells = <0>; + interrupt-controller; + reg = <0x0 0xf1010000 0 0x1000>, + <0x0 0xf1020000 0 0x20000>, + <0x0 0xf1040000 0 0x20000>, + <0x0 0xf1060000 0 0x20000>; + interrupts = ; + clocks = <&cpg CPG_MOD 408>; + clock-names = "clk"; + power-domains = <&sysc 32>; + resets = <&cpg 408>; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = , + , + , + ; + }; + + rwdt: watchdog@e6020000 { + compatible = "renesas,r8a77995-wdt", + "renesas,rcar-gen3-wdt"; + reg = <0 0xe6020000 0 0x0c>; + clocks = <&cpg CPG_MOD 402>; + power-domains = <&sysc 32>; + resets = <&cpg 402>; + status = "disabled"; + }; + + pmu_a53 { + compatible = "arm,cortex-a53-pmu"; + interrupts = ; + }; + + cpg: clock-controller@e6150000 { + compatible = "renesas,r8a77995-cpg-mssr"; + reg = <0 0xe6150000 0 0x1000>; + clocks = <&extal_clk>; + clock-names = "extal"; + #clock-cells = <2>; + #power-domain-cells = <0>; + #reset-cells = <1>; + }; + + rst: reset-controller@e6160000 { + compatible = "renesas,r8a77995-rst"; + reg = <0 0xe6160000 0 0x0200>; + }; + + pfc: pfc@e6060000 { + compatible = "renesas,pfc-r8a77995"; + reg = <0 0xe6060000 0 0x508>; + }; + + prr: chipid@fff00044 { + compatible = "renesas,prr"; + reg = <0 0xfff00044 0 4>; + }; + + sysc: system-controller@e6180000 { + compatible = "renesas,r8a77995-sysc"; + reg = <0 0xe6180000 0 0x0400>; + #power-domain-cells = <1>; + }; + + scif2: serial@e6e88000 { + compatible = "renesas,scif-r8a77995", + "renesas,rcar-gen3-scif", "renesas,scif"; + reg = <0 0xe6e88000 0 64>; + interrupts = ; + clocks = <&cpg CPG_MOD 310>, + <&cpg CPG_CORE 16>, + <&scif_clk>; + clock-names = "fck", "brg_int", "scif_clk"; + power-domains = <&sysc 32>; + resets = <&cpg 310>; + status = "disabled"; + }; + }; +}; diff --git a/src/arm64/renesas/salvator-common.dtsi b/src/arm64/renesas/salvator-common.dtsi index f903957da504..d9d885006a8e 100644 --- a/src/arm64/renesas/salvator-common.dtsi +++ b/src/arm64/renesas/salvator-common.dtsi @@ -62,6 +62,7 @@ brightness-levels = <256 128 64 16 8 4 0>; default-brightness-level = <6>; + power-supply = <®_12v>; enable-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>; }; @@ -83,6 +84,15 @@ regulator-always-on; }; + reg_12v: regulator2 { + compatible = "regulator-fixed"; + regulator-name = "fixed-12V"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + regulator-boot-on; + regulator-always-on; + }; + rsnd_ak4613: sound { compatible = "simple-audio-card"; @@ -268,10 +278,6 @@ remote-endpoint = <&adv7123_in>; }; }; - port@3 { - lvds_connector: endpoint { - }; - }; }; }; diff --git a/src/arm64/renesas/salvator-xs.dtsi b/src/arm64/renesas/salvator-xs.dtsi index 81227e3c2c6f..bf4d200fb546 100644 --- a/src/arm64/renesas/salvator-xs.dtsi +++ b/src/arm64/renesas/salvator-xs.dtsi @@ -18,3 +18,13 @@ &extal_clk { clock-frequency = <16640000>; }; + +&i2c4 { + versaclock6: clock-generator@6a { + compatible = "idt,5p49v6901"; + reg = <0x6a>; + #clock-cells = <1>; + clocks = <&x23_clk>; + clock-names = "xin"; + }; +}; diff --git a/src/arm64/renesas/ulcb.dtsi b/src/arm64/renesas/ulcb.dtsi index d1a3f3b7a0ab..1b868df2393f 100644 --- a/src/arm64/renesas/ulcb.dtsi +++ b/src/arm64/renesas/ulcb.dtsi @@ -34,6 +34,16 @@ clock-frequency = <11289600>; }; + hdmi0-out { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi0_con: endpoint { + }; + }; + }; + keyboard { compatible = "gpio-keys"; @@ -120,6 +130,12 @@ #clock-cells = <0>; clock-frequency = <24576000>; }; + + x23_clk: x23-clock { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + }; }; &audio_clk_a { @@ -153,6 +169,23 @@ clock-frequency = <32768>; }; +&hdmi0 { + status = "okay"; + + ports { + port@1 { + reg = <1>; + rcar_dw_hdmi0_out: endpoint { + remote-endpoint = <&hdmi0_con>; + }; + }; + }; +}; + +&hdmi0_con { + remote-endpoint = <&rcar_dw_hdmi0_out>; +}; + &i2c2 { pinctrl-0 = <&i2c2_pins>; pinctrl-names = "default"; @@ -189,6 +222,24 @@ }; }; +&i2c4 { + status = "okay"; + + clock-frequency = <400000>; + + versaclock5: clock-generator@6a { + compatible = "idt,5p49v5925"; + reg = <0x6a>; + #clock-cells = <1>; + clocks = <&x23_clk>; + clock-names = "xin"; + }; +}; + +&i2c_dvfs { + status = "okay"; +}; + &ohci1 { status = "okay"; }; diff --git a/src/arm64/rockchip/rk3328-evb.dts b/src/arm64/rockchip/rk3328-evb.dts index cf272392cebf..8e6a65431756 100644 --- a/src/arm64/rockchip/rk3328-evb.dts +++ b/src/arm64/rockchip/rk3328-evb.dts @@ -50,8 +50,189 @@ chosen { stdout-path = "serial2:1500000n8"; }; + + dc_12v: dc-12v { + compatible = "regulator-fixed"; + regulator-name = "dc_12v"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + + vcc_sys: vcc-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&dc_12v>; + }; + + vcc_phy: vcc-phy-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc_phy"; + regulator-always-on; + regulator-boot-on; + }; +}; + +&gmac2phy { + phy-supply = <&vcc_phy>; + clock_in_out = "output"; + assigned-clocks = <&cru SCLK_MAC2PHY_SRC>; + assigned-clock-rate = <50000000>; + assigned-clocks = <&cru SCLK_MAC2PHY>; + assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>; + status = "okay"; +}; + +&i2c1 { + status = "okay"; + + rk805: rk805@18 { + compatible = "rockchip,rk805"; + reg = <0x18>; + interrupt-parent = <&gpio2>; + interrupts = <6 IRQ_TYPE_LEVEL_LOW>; + #clock-cells = <1>; + clock-output-names = "xin32k", "rk805-clkout2"; + gpio-controller; + #gpio-cells = <2>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc_sys>; + vcc2-supply = <&vcc_sys>; + vcc3-supply = <&vcc_sys>; + vcc4-supply = <&vcc_sys>; + vcc5-supply = <&vcc_io>; + vcc6-supply = <&vcc_io>; + + regulators { + vdd_logic: DCDC_REG1 { + regulator-name = "vdd_logic"; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1450000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1000000>; + }; + }; + + vdd_arm: DCDC_REG2 { + regulator-name = "vdd_arm"; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1450000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <950000>; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vcc_io: DCDC_REG4 { + regulator-name = "vcc_io"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcc_18: LDO_REG1 { + regulator-name = "vcc_18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc18_emmc: LDO_REG2 { + regulator-name = "vcc18_emmc"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vdd_10: LDO_REG3 { + regulator-name = "vdd_10"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1000000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1000000>; + }; + }; + }; + }; +}; + +&pinctrl { + pmic { + pmic_int_l: pmic-int-l { + rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + +&tsadc { + status = "okay"; }; &uart2 { status = "okay"; }; + +&u2phy { + status = "okay"; +}; + +&u2phy_host { + status = "okay"; +}; + +&u2phy_otg { + status = "okay"; +}; + +&usb20_otg { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; diff --git a/src/arm64/rockchip/rk3328-rock64.dts b/src/arm64/rockchip/rk3328-rock64.dts new file mode 100644 index 000000000000..d4f80786e7c2 --- /dev/null +++ b/src/arm64/rockchip/rk3328-rock64.dts @@ -0,0 +1,333 @@ +/* + * Copyright (c) 2017 PINE64 + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library 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 library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "rk3328.dtsi" + +/ { + model = "Pine64 Rock64"; + compatible = "pine64,rock64", "rockchip,rk3328"; + + chosen { + stdout-path = "serial2:1500000n8"; + }; + + gmac_clkin: external-gmac-clock { + compatible = "fixed-clock"; + clock-frequency = <125000000>; + clock-output-names = "gmac_clkin"; + #clock-cells = <0>; + }; + + vcc_sd: sdmmc-regulator { + compatible = "regulator-fixed"; + gpio = <&gpio0 RK_PD6 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc0m1_gpio>; + regulator-name = "vcc_sd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc_io>; + }; + + vcc_host_5v: vcc-host-5v-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&usb30_host_drv>; + regulator-name = "vcc_host_5v"; + regulator-always-on; + vin-supply = <&vcc_sys>; + }; + + vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&usb20_host_drv>; + regulator-name = "vcc_host1_5v"; + regulator-always-on; + vin-supply = <&vcc_sys>; + }; + + vcc_sys: vcc-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; +}; + +&cpu0 { + cpu-supply = <&vdd_arm>; +}; + +&cpu1 { + cpu-supply = <&vdd_arm>; +}; + +&cpu2 { + cpu-supply = <&vdd_arm>; +}; + +&cpu3 { + cpu-supply = <&vdd_arm>; +}; + +&emmc { + bus-width = <8>; + cap-mmc-highspeed; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; + vmmc-supply = <&vcc_io>; + vqmmc-supply = <&vcc18_emmc>; + status = "okay"; +}; + +&gmac2io { + assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>; + assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>; + clock_in_out = "input"; + phy-supply = <&vcc_io>; + phy-mode = "rgmii"; + pinctrl-names = "default"; + pinctrl-0 = <&rgmiim1_pins>; + snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + snps,reset-delays-us = <0 10000 50000>; + tx_delay = <0x26>; + rx_delay = <0x11>; + status = "okay"; +}; + +&i2c1 { + status = "okay"; + + rk805: rk805@18 { + compatible = "rockchip,rk805"; + reg = <0x18>; + interrupt-parent = <&gpio2>; + interrupts = <6 IRQ_TYPE_LEVEL_LOW>; + #clock-cells = <1>; + clock-output-names = "xin32k", "rk805-clkout2"; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc_sys>; + vcc2-supply = <&vcc_sys>; + vcc3-supply = <&vcc_sys>; + vcc4-supply = <&vcc_sys>; + vcc5-supply = <&vcc_io>; + vcc6-supply = <&vcc_sys>; + + regulators { + vdd_logic: DCDC_REG1 { + regulator-name = "vdd_logic"; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1450000>; + regulator-ramp-delay = <12500>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1000000>; + }; + }; + + vdd_arm: DCDC_REG2 { + regulator-name = "vdd_arm"; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1450000>; + regulator-ramp-delay = <12500>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <950000>; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vcc_io: DCDC_REG4 { + regulator-name = "vcc_io"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcc_18: LDO_REG1 { + regulator-name = "vdd_18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc18_emmc: LDO_REG2 { + regulator-name = "vcc_18emmc"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vdd_10: LDO_REG3 { + regulator-name = "vdd_10"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1000000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1000000>; + }; + }; + }; + }; +}; + +&io_domains { + status = "okay"; + + vccio1-supply = <&vcc_io>; + vccio2-supply = <&vcc18_emmc>; + vccio3-supply = <&vcc_io>; + vccio4-supply = <&vcc_18>; + vccio5-supply = <&vcc_io>; + vccio6-supply = <&vcc_io>; + pmuio-supply = <&vcc_io>; +}; + +&pinctrl { + pmic { + pmic_int_l: pmic-int-l { + rockchip,pins = <2 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + usb2 { + usb20_host_drv: usb20-host-drv { + rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + usb3 { + usb30_host_drv: usb30-host-drv { + rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&sdmmc { + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + disable-wp; + max-frequency = <150000000>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>; + vmmc-supply = <&vcc_sd>; + status = "okay"; +}; + +&tsadc { + rockchip,hw-tshut-mode = <0>; + rockchip,hw-tshut-polarity = <0>; + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&u2phy { + status = "okay"; + + u2phy_host: host-port { + status = "okay"; + }; + + u2phy_otg: otg-port { + status = "okay"; + }; +}; + +&usb20_otg { + dr_mode = "host"; + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; diff --git a/src/arm64/rockchip/rk3328.dtsi b/src/arm64/rockchip/rk3328.dtsi index 0be96cee27bd..41d61840fb99 100644 --- a/src/arm64/rockchip/rk3328.dtsi +++ b/src/arm64/rockchip/rk3328.dtsi @@ -47,6 +47,7 @@ #include #include #include +#include / { compatible = "rockchip,rk3328"; @@ -63,6 +64,8 @@ i2c1 = &i2c1; i2c2 = &i2c2; i2c3 = &i2c3; + ethernet0 = &gmac2io; + ethernet1 = &gmac2phy; }; cpus { @@ -74,8 +77,11 @@ compatible = "arm,cortex-a53", "arm,armv8"; reg = <0x0 0x0>; clocks = <&cru ARMCLK>; + #cooling-cells = <2>; + dynamic-power-coefficient = <120>; enable-method = "psci"; next-level-cache = <&l2>; + operating-points-v2 = <&cpu0_opp_table>; }; cpu1: cpu@1 { @@ -83,8 +89,10 @@ compatible = "arm,cortex-a53", "arm,armv8"; reg = <0x0 0x1>; clocks = <&cru ARMCLK>; + dynamic-power-coefficient = <120>; enable-method = "psci"; next-level-cache = <&l2>; + operating-points-v2 = <&cpu0_opp_table>; }; cpu2: cpu@2 { @@ -92,8 +100,10 @@ compatible = "arm,cortex-a53", "arm,armv8"; reg = <0x0 0x2>; clocks = <&cru ARMCLK>; + dynamic-power-coefficient = <120>; enable-method = "psci"; next-level-cache = <&l2>; + operating-points-v2 = <&cpu0_opp_table>; }; cpu3: cpu@3 { @@ -101,8 +111,10 @@ compatible = "arm,cortex-a53", "arm,armv8"; reg = <0x0 0x3>; clocks = <&cru ARMCLK>; + dynamic-power-coefficient = <120>; enable-method = "psci"; next-level-cache = <&l2>; + operating-points-v2 = <&cpu0_opp_table>; }; l2: l2-cache0 { @@ -110,6 +122,43 @@ }; }; + cpu0_opp_table: opp_table0 { + compatible = "operating-points-v2"; + opp-shared; + + opp-408000000 { + opp-hz = /bits/ 64 <408000000>; + opp-microvolt = <950000>; + clock-latency-ns = <40000>; + opp-suspend; + }; + opp-600000000 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <950000>; + clock-latency-ns = <40000>; + }; + opp-816000000 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <1000000>; + clock-latency-ns = <40000>; + }; + opp-1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1100000>; + clock-latency-ns = <40000>; + }; + opp-1200000000 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <1225000>; + clock-latency-ns = <40000>; + }; + opp-1296000000 { + opp-hz = /bits/ 64 <1296000000>; + opp-microvolt = <1300000>; + clock-latency-ns = <40000>; + }; + }; + amba { compatible = "simple-bus"; #address-cells = <2>; @@ -156,12 +205,84 @@ clock-output-names = "xin24m"; }; + i2s0: i2s@ff000000 { + compatible = "rockchip,rk3328-i2s", "rockchip,rk3066-i2s"; + reg = <0x0 0xff000000 0x0 0x1000>; + interrupts = ; + clocks = <&cru SCLK_I2S0>, <&cru HCLK_I2S0_8CH>; + clock-names = "i2s_clk", "i2s_hclk"; + dmas = <&dmac 11>, <&dmac 12>; + dma-names = "tx", "rx"; + status = "disabled"; + }; + + i2s1: i2s@ff010000 { + compatible = "rockchip,rk3328-i2s", "rockchip,rk3066-i2s"; + reg = <0x0 0xff010000 0x0 0x1000>; + interrupts = ; + clocks = <&cru SCLK_I2S1>, <&cru HCLK_I2S1_8CH>; + clock-names = "i2s_clk", "i2s_hclk"; + dmas = <&dmac 14>, <&dmac 15>; + dma-names = "tx", "rx"; + status = "disabled"; + }; + + i2s2: i2s@ff020000 { + compatible = "rockchip,rk3328-i2s", "rockchip,rk3066-i2s"; + reg = <0x0 0xff020000 0x0 0x1000>; + interrupts = ; + clocks = <&cru SCLK_I2S2>, <&cru HCLK_I2S2_2CH>; + clock-names = "i2s_clk", "i2s_hclk"; + dmas = <&dmac 0>, <&dmac 1>; + dma-names = "tx", "rx"; + status = "disabled"; + }; + + spdif: spdif@ff030000 { + compatible = "rockchip,rk3328-spdif"; + reg = <0x0 0xff030000 0x0 0x1000>; + interrupts = ; + clocks = <&cru SCLK_SPDIF>, <&cru HCLK_SPDIF_8CH>; + clock-names = "mclk", "hclk"; + dmas = <&dmac 10>; + dma-names = "tx"; + pinctrl-names = "default"; + pinctrl-0 = <&spdifm2_tx>; + status = "disabled"; + }; + + pdm: pdm@ff040000 { + compatible = "rockchip,pdm"; + reg = <0x0 0xff040000 0x0 0x1000>; + clocks = <&cru SCLK_PDM>, <&cru HCLK_PDM>; + clock-names = "pdm_clk", "pdm_hclk"; + dmas = <&dmac 16>; + dma-names = "rx"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&pdmm0_clk + &pdmm0_sdi0 + &pdmm0_sdi1 + &pdmm0_sdi2 + &pdmm0_sdi3>; + pinctrl-1 = <&pdmm0_clk_sleep + &pdmm0_sdi0_sleep + &pdmm0_sdi1_sleep + &pdmm0_sdi2_sleep + &pdmm0_sdi3_sleep>; + status = "disabled"; + }; + grf: syscon@ff100000 { compatible = "rockchip,rk3328-grf", "syscon", "simple-mfd"; reg = <0x0 0xff100000 0x0 0x1000>; #address-cells = <1>; #size-cells = <1>; + io_domains: io-domains { + compatible = "rockchip,rk3328-io-voltage-domain"; + status = "disabled"; + }; + power: power-controller { compatible = "rockchip,rk3328-power-controller"; #power-domain-cells = <1>; @@ -308,6 +429,108 @@ interrupts = ; }; + pwm0: pwm@ff1b0000 { + compatible = "rockchip,rk3328-pwm"; + reg = <0x0 0xff1b0000 0x0 0x10>; + clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm0_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm1: pwm@ff1b0010 { + compatible = "rockchip,rk3328-pwm"; + reg = <0x0 0xff1b0010 0x0 0x10>; + clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm1_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm2: pwm@ff1b0020 { + compatible = "rockchip,rk3328-pwm"; + reg = <0x0 0xff1b0020 0x0 0x10>; + clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwm2_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + pwm3: pwm@ff1b0030 { + compatible = "rockchip,rk3328-pwm"; + reg = <0x0 0xff1b0030 0x0 0x10>; + interrupts = ; + clocks = <&cru SCLK_PWM>, <&cru PCLK_PWM>; + clock-names = "pwm", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&pwmir_pin>; + #pwm-cells = <3>; + status = "disabled"; + }; + + thermal-zones { + soc_thermal: soc-thermal { + polling-delay-passive = <20>; + polling-delay = <1000>; + sustainable-power = <1000>; + + thermal-sensors = <&tsadc 0>; + + trips { + threshold: trip-point0 { + temperature = <70000>; + hysteresis = <2000>; + type = "passive"; + }; + target: trip-point1 { + temperature = <85000>; + hysteresis = <2000>; + type = "passive"; + }; + soc_crit: soc-crit { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&target>; + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <4096>; + }; + }; + }; + + }; + + tsadc: tsadc@ff250000 { + compatible = "rockchip,rk3328-tsadc"; + reg = <0x0 0xff250000 0x0 0x100>; + interrupts = ; + assigned-clocks = <&cru SCLK_TSADC>; + assigned-clock-rates = <50000>; + clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>; + clock-names = "tsadc", "apb_pclk"; + pinctrl-names = "init", "default", "sleep"; + pinctrl-0 = <&otp_gpio>; + pinctrl-1 = <&otp_out>; + pinctrl-2 = <&otp_gpio>; + resets = <&cru SRST_TSADC>; + reset-names = "tsadc-apb"; + rockchip,grf = <&grf>; + rockchip,hw-tshut-temp = <100000>; + #thermal-sensor-cells = <1>; + status = "disabled"; + }; + saradc: adc@ff280000 { compatible = "rockchip,rk3328-saradc", "rockchip,rk3399-saradc"; reg = <0x0 0xff280000 0x0 0x100>; @@ -320,6 +543,51 @@ status = "disabled"; }; + h265e_mmu: iommu@ff330200 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff330200 0 0x100>; + interrupts = ; + interrupt-names = "h265e_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + vepu_mmu: iommu@ff340800 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff340800 0x0 0x40>; + interrupts = ; + interrupt-names = "vepu_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + vpu_mmu: iommu@ff350800 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff350800 0x0 0x40>; + interrupts = ; + interrupt-names = "vpu_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + rkvdec_mmu: iommu@ff360480 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff360480 0x0 0x40>, <0x0 0xff3604c0 0x0 0x40>; + interrupts = ; + interrupt-names = "rkvdec_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + vop_mmu: iommu@ff373f00 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff373f00 0x0 0x100>; + interrupts = ; + interrupt-names = "vop_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + cru: clock-controller@ff440000 { compatible = "rockchip,rk3328-cru", "rockchip,cru", "syscon"; reg = <0x0 0xff440000 0x0 0x1000>; @@ -372,6 +640,43 @@ <32768>; }; + usb2phy_grf: syscon@ff450000 { + compatible = "rockchip,rk3328-usb2phy-grf", "syscon", + "simple-mfd"; + reg = <0x0 0xff450000 0x0 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + + u2phy: usb2-phy@100 { + compatible = "rockchip,rk3328-usb2phy"; + reg = <0x100 0x10>; + clocks = <&xin24m>; + clock-names = "phyclk"; + clock-output-names = "usb480m_phy"; + #clock-cells = <0>; + assigned-clocks = <&cru USB480M>; + assigned-clock-parents = <&u2phy>; + status = "disabled"; + + u2phy_otg: otg-port { + #phy-cells = <0>; + interrupts = , + , + ; + interrupt-names = "otg-bvalid", "otg-id", + "linestate"; + status = "disabled"; + }; + + u2phy_host: host-port { + #phy-cells = <0>; + interrupts = ; + interrupt-names = "linestate"; + status = "disabled"; + }; + }; + }; + sdmmc: dwmmc@ff500000 { compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x0 0xff500000 0x0 0x4000>; @@ -424,6 +729,82 @@ status = "disabled"; }; + gmac2phy: ethernet@ff550000 { + compatible = "rockchip,rk3328-gmac"; + reg = <0x0 0xff550000 0x0 0x10000>; + rockchip,grf = <&grf>; + interrupts = ; + interrupt-names = "macirq"; + clocks = <&cru SCLK_MAC2PHY_SRC>, <&cru SCLK_MAC2PHY_RXTX>, + <&cru SCLK_MAC2PHY_RXTX>, <&cru SCLK_MAC2PHY_REF>, + <&cru ACLK_MAC2PHY>, <&cru PCLK_MAC2PHY>, + <&cru SCLK_MAC2PHY_OUT>; + clock-names = "stmmaceth", "mac_clk_rx", + "mac_clk_tx", "clk_mac_ref", + "aclk_mac", "pclk_mac", + "clk_macphy"; + resets = <&cru SRST_GMAC2PHY_A>, <&cru SRST_MACPHY>; + reset-names = "stmmaceth", "mac-phy"; + phy-mode = "rmii"; + phy-handle = <&phy>; + status = "disabled"; + + mdio { + compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + phy: phy@0 { + compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22"; + reg = <0>; + clocks = <&cru SCLK_MAC2PHY_OUT>; + resets = <&cru SRST_MACPHY>; + pinctrl-names = "default"; + pinctrl-0 = <&fephyled_rxm1 &fephyled_linkm1>; + phy-is-integrated; + }; + }; + }; + + usb20_otg: usb@ff580000 { + compatible = "rockchip,rk3328-usb", "rockchip,rk3066-usb", + "snps,dwc2"; + reg = <0x0 0xff580000 0x0 0x40000>; + interrupts = ; + clocks = <&cru HCLK_OTG>; + clock-names = "otg"; + dr_mode = "otg"; + g-np-tx-fifo-size = <16>; + g-rx-fifo-size = <280>; + g-tx-fifo-size = <256 128 128 64 32 16>; + g-use-dma; + phys = <&u2phy_otg>; + phy-names = "usb2-phy"; + status = "disabled"; + }; + + usb_host0_ehci: usb@ff5c0000 { + compatible = "generic-ehci"; + reg = <0x0 0xff5c0000 0x0 0x10000>; + interrupts = ; + clocks = <&cru HCLK_HOST0>, <&u2phy>; + clock-names = "usbhost", "utmi"; + phys = <&u2phy_host>; + phy-names = "usb"; + status = "disabled"; + }; + + usb_host0_ohci: usb@ff5d0000 { + compatible = "generic-ohci"; + reg = <0x0 0xff5d0000 0x0 0x10000>; + interrupts = ; + clocks = <&cru HCLK_HOST0>, <&u2phy>; + clock-names = "usbhost", "utmi"; + phys = <&u2phy_host>; + phy-names = "usb"; + status = "disabled"; + }; + gic: interrupt-controller@ff811000 { compatible = "arm,gic-400"; #interrupt-cells = <3>; @@ -610,6 +991,62 @@ }; }; + pdm-0 { + pdmm0_clk: pdmm0-clk { + rockchip,pins = <2 RK_PC2 2 &pcfg_pull_none>; + }; + + pdmm0_fsync: pdmm0-fsync { + rockchip,pins = <2 RK_PC7 2 &pcfg_pull_none>; + }; + + pdmm0_sdi0: pdmm0-sdi0 { + rockchip,pins = <2 RK_PC3 2 &pcfg_pull_none>; + }; + + pdmm0_sdi1: pdmm0-sdi1 { + rockchip,pins = <2 RK_PC4 2 &pcfg_pull_none>; + }; + + pdmm0_sdi2: pdmm0-sdi2 { + rockchip,pins = <2 RK_PC5 2 &pcfg_pull_none>; + }; + + pdmm0_sdi3: pdmm0-sdi3 { + rockchip,pins = <2 RK_PC6 2 &pcfg_pull_none>; + }; + + pdmm0_clk_sleep: pdmm0-clk-sleep { + rockchip,pins = + <2 RK_PC2 RK_FUNC_GPIO &pcfg_input_high>; + }; + + pdmm0_sdi0_sleep: pdmm0-sdi0-sleep { + rockchip,pins = + <2 RK_PC3 RK_FUNC_GPIO &pcfg_input_high>; + }; + + pdmm0_sdi1_sleep: pdmm0-sdi1-sleep { + rockchip,pins = + <2 RK_PC4 RK_FUNC_GPIO &pcfg_input_high>; + }; + + pdmm0_sdi2_sleep: pdmm0-sdi2-sleep { + rockchip,pins = + <2 RK_PC5 RK_FUNC_GPIO &pcfg_input_high>; + }; + + pdmm0_sdi3_sleep: pdmm0-sdi3-sleep { + rockchip,pins = + <2 RK_PC6 RK_FUNC_GPIO &pcfg_input_high>; + }; + + pdmm0_fsync_sleep: pdmm0-fsync-sleep { + rockchip,pins = + <2 RK_PC7 RK_FUNC_GPIO &pcfg_input_high>; + }; + }; + tsadc { otp_gpio: otp-gpio { rockchip,pins = <2 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; diff --git a/src/arm64/rockchip/rk3368-evb.dtsi b/src/arm64/rockchip/rk3368-evb.dtsi index 4772917c5f7e..a37220a9387c 100644 --- a/src/arm64/rockchip/rk3368-evb.dtsi +++ b/src/arm64/rockchip/rk3368-evb.dtsi @@ -156,7 +156,6 @@ disable-wp; mmc-pwrseq = <&emmc_pwrseq>; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; status = "okay"; diff --git a/src/arm64/rockchip/rk3368-geekbox.dts b/src/arm64/rockchip/rk3368-geekbox.dts index e631d424f08e..5e4d3a7015f5 100644 --- a/src/arm64/rockchip/rk3368-geekbox.dts +++ b/src/arm64/rockchip/rk3368-geekbox.dts @@ -117,7 +117,6 @@ clock-frequency = <150000000>; disable-wp; non-removable; - num-slots = <1>; vmmc-supply = <&vcc_io>; vqmmc-supply = <&vcc18_flash>; pinctrl-names = "default"; diff --git a/src/arm64/rockchip/rk3368-orion-r68-meta.dts b/src/arm64/rockchip/rk3368-orion-r68-meta.dts index fac116acc12f..d3f6c8e0d206 100644 --- a/src/arm64/rockchip/rk3368-orion-r68-meta.dts +++ b/src/arm64/rockchip/rk3368-orion-r68-meta.dts @@ -203,7 +203,6 @@ mmc-hs200-1_2v; mmc-hs200-1_8v; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; status = "okay"; @@ -347,7 +346,6 @@ max-frequency = <50000000>; cap-sd-highspeed; card-detect-delay = <200>; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; vmmc-supply = <&vcc_sd>; diff --git a/src/arm64/rockchip/rk3368-px5-evb.dts b/src/arm64/rockchip/rk3368-px5-evb.dts index ff48edd8e348..13a9e22f5d2d 100644 --- a/src/arm64/rockchip/rk3368-px5-evb.dts +++ b/src/arm64/rockchip/rk3368-px5-evb.dts @@ -86,12 +86,10 @@ cap-mmc-highspeed; clock-frequency = <150000000>; disable-wp; - keep-power-in-suspend; mmc-hs200-1_8v; no-sdio; no-sd; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_bus8>; vmmc-supply = <&vcc_io>; @@ -281,7 +279,6 @@ card-detect-delay = <200>; no-emmc; no-sdio; - num-slots = <1>; sd-uhs-sdr12; sd-uhs-sdr25; pinctrl-names = "default"; diff --git a/src/arm64/rockchip/rk3368-r88.dts b/src/arm64/rockchip/rk3368-r88.dts index 7134181f1dc2..b3510d56517a 100644 --- a/src/arm64/rockchip/rk3368-r88.dts +++ b/src/arm64/rockchip/rk3368-r88.dts @@ -189,7 +189,6 @@ disable-wp; mmc-pwrseq = <&emmc_pwrseq>; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; status = "okay"; @@ -254,7 +253,6 @@ keep-power-in-suspend; mmc-pwrseq = <&sdio_pwrseq>; non-removable; - num-slots = <1>; pinctrl-names = "default"; pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_bus4>; vmmc-supply = <&vcc_io>; diff --git a/src/arm64/rockchip/rk3368.dtsi b/src/arm64/rockchip/rk3368.dtsi index 6d5dc0587e59..1070c8264c13 100644 --- a/src/arm64/rockchip/rk3368.dtsi +++ b/src/arm64/rockchip/rk3368.dtsi @@ -700,6 +700,19 @@ interrupts = ; }; + spdif: spdif@ff880000 { + compatible = "rockchip,rk3368-spdif"; + reg = <0x0 0xff880000 0x0 0x1000>; + interrupts = ; + clocks = <&cru SCLK_SPDIF_8CH>, <&cru HCLK_SPDIF>; + clock-names = "mclk", "hclk"; + dmas = <&dmac_bus 3>; + dma-names = "tx"; + pinctrl-names = "default"; + pinctrl-0 = <&spdif_tx>; + status = "disabled"; + }; + i2s_2ch: i2s-2ch@ff890000 { compatible = "rockchip,rk3368-i2s", "rockchip,rk3066-i2s"; reg = <0x0 0xff890000 0x0 0x1000>; @@ -724,6 +737,55 @@ status = "disabled"; }; + iep_mmu: iommu@ff900800 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff900800 0x0 0x100>; + interrupts = ; + interrupt-names = "iep_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + isp_mmu: iommu@ff914000 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff914000 0x0 0x100>, + <0x0 0xff915000 0x0 0x100>; + interrupts = ; + interrupt-names = "isp_mmu"; + #iommu-cells = <0>; + rockchip,disable-mmu-reset; + status = "disabled"; + }; + + vop_mmu: iommu@ff930300 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff930300 0x0 0x100>; + interrupts = ; + interrupt-names = "vop_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + hevc_mmu: iommu@ff9a0440 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff9a0440 0x0 0x40>, + <0x0 0xff9a0480 0x0 0x40>; + interrupts = ; + interrupt-names = "hevc_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + vpu_mmu: iommu@ff9a0800 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff9a0800 0x0 0x100>; + interrupts = , + ; + interrupt-names = "vepu_mmu", "vdpu_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + gic: interrupt-controller@ffb71000 { compatible = "arm,gic-400"; interrupt-controller; @@ -1024,6 +1086,12 @@ }; }; + spdif { + spdif_tx: spdif-tx { + rockchip,pins = <2 RK_PC7 RK_FUNC_1 &pcfg_pull_none>; + }; + }; + spi0 { spi0_clk: spi0-clk { rockchip,pins = <1 29 RK_FUNC_2 &pcfg_pull_up>; diff --git a/src/arm64/rockchip/rk3399-evb.dts b/src/arm64/rockchip/rk3399-evb.dts index 42033bcc614c..56533c344ef2 100644 --- a/src/arm64/rockchip/rk3399-evb.dts +++ b/src/arm64/rockchip/rk3399-evb.dts @@ -199,7 +199,7 @@ ep-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; num-lanes = <4>; pinctrl-names = "default"; - pinctrl-0 = <&pcie_clkreqn>; + pinctrl-0 = <&pcie_clkreqn_cpm>; status = "disabled"; }; diff --git a/src/arm64/rockchip/rk3399-firefly.dts b/src/arm64/rockchip/rk3399-firefly.dts index ba1d9810ad1e..fef82274a39d 100644 --- a/src/arm64/rockchip/rk3399-firefly.dts +++ b/src/arm64/rockchip/rk3399-firefly.dts @@ -43,6 +43,7 @@ /dts-v1/; #include #include "rk3399.dtsi" +#include "rk3399-opp.dtsi" / { model = "Firefly-RK3399 Board"; @@ -370,10 +371,10 @@ regulator-always-on; regulator-boot-on; regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; + regulator-max-microvolt = <3000000>; regulator-state-mem { regulator-on-in-suspend; - regulator-suspend-microvolt = <3300000>; + regulator-suspend-microvolt = <3000000>; }; }; @@ -550,7 +551,7 @@ ep-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>; num-lanes = <4>; pinctrl-names = "default"; - pinctrl-0 = <&pcie_clkreqn>; + pinctrl-0 = <&pcie_clkreqn_cpm>; status = "okay"; }; @@ -630,9 +631,20 @@ status = "okay"; }; +&sdmmc { + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + disable-wp; + max-frequency = <150000000>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; + status = "okay"; +}; + &sdhci { bus-width = <8>; - keep-power-in-suspend; mmc-hs400-1_8v; mmc-hs400-enhanced-strobe; non-removable; diff --git a/src/arm64/rockchip/rk3399-gru-kevin.dts b/src/arm64/rockchip/rk3399-gru-kevin.dts index 7bd31066399b..a3d3cea7dc4f 100644 --- a/src/arm64/rockchip/rk3399-gru-kevin.dts +++ b/src/arm64/rockchip/rk3399-gru-kevin.dts @@ -264,6 +264,50 @@ ap_i2c_dig: &i2c2 { }; }; +&ppvar_bigcpu_pwm { + regulator-min-microvolt = <798674>; + regulator-max-microvolt = <1302172>; +}; + +&ppvar_bigcpu { + regulator-min-microvolt = <798674>; + regulator-max-microvolt = <1302172>; + ctrl-voltage-range = <798674 1302172>; +}; + +&ppvar_litcpu_pwm { + regulator-min-microvolt = <799065>; + regulator-max-microvolt = <1303738>; +}; + +&ppvar_litcpu { + regulator-min-microvolt = <799065>; + regulator-max-microvolt = <1303738>; + ctrl-voltage-range = <799065 1303738>; +}; + +&ppvar_gpu_pwm { + regulator-min-microvolt = <785782>; + regulator-max-microvolt = <1217729>; +}; + +&ppvar_gpu { + regulator-min-microvolt = <785782>; + regulator-max-microvolt = <1217729>; + ctrl-voltage-range = <785782 1217729>; +}; + +&ppvar_centerlogic_pwm { + regulator-min-microvolt = <800069>; + regulator-max-microvolt = <1049692>; +}; + +&ppvar_centerlogic { + regulator-min-microvolt = <800069>; + regulator-max-microvolt = <1049692>; + ctrl-voltage-range = <800069 1049692>; +}; + &saradc { status = "okay"; vref-supply = <&pp1800_ap_io>; diff --git a/src/arm64/rockchip/rk3399-gru.dtsi b/src/arm64/rockchip/rk3399-gru.dtsi index eb5059344023..199a5118b20d 100644 --- a/src/arm64/rockchip/rk3399-gru.dtsi +++ b/src/arm64/rockchip/rk3399-gru.dtsi @@ -164,14 +164,9 @@ vin-supply = <&ppvar_sys>; }; - ppvar_bigcpu: ppvar-bigcpu { + ppvar_bigcpu_pwm: ppvar-bigcpu-pwm { compatible = "pwm-regulator"; - regulator-name = "ppvar_bigcpu"; - /* - * OVP circuit requires special handling which is not yet - * represented. Keep disabled for now. - */ - status = "disabled"; + regulator-name = "ppvar_bigcpu_pwm"; pwms = <&pwm1 0 3337 0>; pwm-supply = <&ppvar_sys>; @@ -181,18 +176,28 @@ /* EC turns on w/ ap_core_en; always on for AP */ regulator-always-on; regulator-boot-on; - regulator-min-microvolt = <798674>; - regulator-max-microvolt = <1302172>; + regulator-min-microvolt = <800107>; + regulator-max-microvolt = <1302232>; }; - ppvar_litcpu: ppvar-litcpu { + ppvar_bigcpu: ppvar-bigcpu { + compatible = "vctrl-regulator"; + regulator-name = "ppvar_bigcpu"; + + regulator-min-microvolt = <800107>; + regulator-max-microvolt = <1302232>; + + ctrl-supply = <&ppvar_bigcpu_pwm>; + ctrl-voltage-range = <800107 1302232>; + + regulator-settling-time-up-us = <322>; + min-slew-down-rate = <225>; + ovp-threshold-percent = <16>; + }; + + ppvar_litcpu_pwm: ppvar-litcpu-pwm { compatible = "pwm-regulator"; - regulator-name = "ppvar_litcpu"; - /* - * OVP circuit requires special handling which is not yet - * represented. Keep disabled for now. - */ - status = "disabled"; + regulator-name = "ppvar_litcpu_pwm"; pwms = <&pwm2 0 3337 0>; pwm-supply = <&ppvar_sys>; @@ -202,18 +207,28 @@ /* EC turns on w/ ap_core_en; always on for AP */ regulator-always-on; regulator-boot-on; - regulator-min-microvolt = <799065>; - regulator-max-microvolt = <1303738>; + regulator-min-microvolt = <797743>; + regulator-max-microvolt = <1307837>; }; - ppvar_gpu: ppvar-gpu { + ppvar_litcpu: ppvar-litcpu { + compatible = "vctrl-regulator"; + regulator-name = "ppvar_litcpu"; + + regulator-min-microvolt = <797743>; + regulator-max-microvolt = <1307837>; + + ctrl-supply = <&ppvar_litcpu_pwm>; + ctrl-voltage-range = <797743 1307837>; + + regulator-settling-time-up-us = <384>; + min-slew-down-rate = <225>; + ovp-threshold-percent = <16>; + }; + + ppvar_gpu_pwm: ppvar-gpu-pwm { compatible = "pwm-regulator"; - regulator-name = "ppvar_gpu"; - /* - * OVP circuit requires special handling which is not yet - * represented. Keep disabled for now. - */ - status = "disabled"; + regulator-name = "ppvar_gpu_pwm"; pwms = <&pwm0 0 3337 0>; pwm-supply = <&ppvar_sys>; @@ -223,18 +238,28 @@ /* EC turns on w/ ap_core_en; always on for AP */ regulator-always-on; regulator-boot-on; - regulator-min-microvolt = <785782>; - regulator-max-microvolt = <1217729>; + regulator-min-microvolt = <786384>; + regulator-max-microvolt = <1217747>; }; - ppvar_centerlogic: ppvar-centerlogic { + ppvar_gpu: ppvar-gpu { + compatible = "vctrl-regulator"; + regulator-name = "ppvar_gpu"; + + regulator-min-microvolt = <786384>; + regulator-max-microvolt = <1217747>; + + ctrl-supply = <&ppvar_gpu_pwm>; + ctrl-voltage-range = <786384 1217747>; + + regulator-settling-time-up-us = <390>; + min-slew-down-rate = <225>; + ovp-threshold-percent = <16>; + }; + + ppvar_centerlogic_pwm: ppvar-centerlogic-pwm { compatible = "pwm-regulator"; - regulator-name = "ppvar_centerlogic"; - /* - * OVP circuit requires special handling which is not yet - * represented. Keep disabled for now. - */ - status = "disabled"; + regulator-name = "ppvar_centerlogic_pwm"; pwms = <&pwm3 0 3337 0>; pwm-supply = <&ppvar_sys>; @@ -244,8 +269,23 @@ /* EC turns on w/ ppvar_centerlogic_en; always on for AP */ regulator-always-on; regulator-boot-on; - regulator-min-microvolt = <800069>; - regulator-max-microvolt = <1049692>; + regulator-min-microvolt = <799434>; + regulator-max-microvolt = <1049925>; + }; + + ppvar_centerlogic: ppvar-centerlogic { + compatible = "vctrl-regulator"; + regulator-name = "ppvar_centerlogic"; + + regulator-min-microvolt = <799434>; + regulator-max-microvolt = <1049925>; + + ctrl-supply = <&ppvar_centerlogic_pwm>; + ctrl-voltage-range = <799434 1049925>; + + regulator-settling-time-up-us = <378>; + min-slew-down-rate = <225>; + ovp-threshold-percent = <16>; }; /* Schematics call this PPVAR even though it's fixed */ @@ -555,6 +595,11 @@ status = "okay"; }; +&gpu { + mali-supply = <&ppvar_gpu>; + status = "okay"; +}; + ap_i2c_mic: &i2c1 { status = "okay"; @@ -567,12 +612,7 @@ ap_i2c_mic: &i2c1 { headsetcodec: rt5514@57 { compatible = "realtek,rt5514"; reg = <0x57>; - interrupt-parent = <&gpio1>; - interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; - pinctrl-names = "default"; - pinctrl-0 = <&mic_int>; - realtek,dmic-init-delay = <20>; - wakeup-source; + realtek,dmic-init-delay-ms = <20>; }; }; @@ -781,9 +821,13 @@ ap_i2c_audio: &i2c8 { wacky_spi_audio: spi2@0 { compatible = "realtek,rt5514"; reg = <0>; - + interrupt-parent = <&gpio1>; + interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&mic_int>; /* May run faster once verified. */ spi-max-frequency = <10000000>; + wakeup-source; }; }; @@ -1031,7 +1075,7 @@ ap_i2c_audio: &i2c8 { * hurt and dw_mmc will ignore it. We make sure to disable * the pull though so we don't burn needless power. */ - sdmmc_cd: sdmcc-cd { + sdmmc_cd: sdmmc-cd { rockchip,pins = <0 7 RK_FUNC_1 &pcfg_pull_none>; }; diff --git a/src/arm64/rockchip/rk3399-op1-opp.dtsi b/src/arm64/rockchip/rk3399-op1-opp.dtsi index be7fe635f7c1..d8a120f945c8 100644 --- a/src/arm64/rockchip/rk3399-op1-opp.dtsi +++ b/src/arm64/rockchip/rk3399-op1-opp.dtsi @@ -118,6 +118,35 @@ opp-microvolt = <1250000>; }; }; + + gpu_opp_table: opp-table2 { + compatible = "operating-points-v2"; + + opp00 { + opp-hz = /bits/ 64 <200000000>; + opp-microvolt = <800000>; + }; + opp01 { + opp-hz = /bits/ 64 <297000000>; + opp-microvolt = <800000>; + }; + opp02 { + opp-hz = /bits/ 64 <400000000>; + opp-microvolt = <825000>; + }; + opp03 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <850000>; + }; + opp04 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <925000>; + }; + opp05 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <1075000>; + }; + }; }; &cpu_l0 { @@ -143,3 +172,7 @@ &cpu_b1 { operating-points-v2 = <&cluster1_opp>; }; + +&gpu { + operating-points-v2 = <&gpu_opp_table>; +}; diff --git a/src/arm64/rockchip/rk3399-opp.dtsi b/src/arm64/rockchip/rk3399-opp.dtsi index c83460db130a..81617bcf2522 100644 --- a/src/arm64/rockchip/rk3399-opp.dtsi +++ b/src/arm64/rockchip/rk3399-opp.dtsi @@ -110,6 +110,35 @@ opp-microvolt = <1200000>; }; }; + + gpu_opp_table: opp-table2 { + compatible = "operating-points-v2"; + + opp00 { + opp-hz = /bits/ 64 <200000000>; + opp-microvolt = <800000>; + }; + opp01 { + opp-hz = /bits/ 64 <297000000>; + opp-microvolt = <800000>; + }; + opp02 { + opp-hz = /bits/ 64 <400000000>; + opp-microvolt = <825000>; + }; + opp03 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <875000>; + }; + opp04 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <925000>; + }; + opp05 { + opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <1100000>; + }; + }; }; &cpu_l0 { @@ -135,3 +164,7 @@ &cpu_b1 { operating-points-v2 = <&cluster1_opp>; }; + +&gpu { + operating-points-v2 = <&gpu_opp_table>; +}; diff --git a/src/arm64/rockchip/rk3399-puma-haikou.dts b/src/arm64/rockchip/rk3399-puma-haikou.dts new file mode 100644 index 000000000000..9a7486058455 --- /dev/null +++ b/src/arm64/rockchip/rk3399-puma-haikou.dts @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include "rk3399-puma.dtsi" + +/ { + model = "Theobroma Systems RK3399-Q7 SoM"; + compatible = "tsd,rk3399-puma-haikou", "rockchip,rk3399"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + pinctrl-0 = <&led_pin_module>, <&led_sd_haikou>; + + sd-card-led { + label = "sd_card_led"; + gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + }; + }; + + dc_12v: dc-12v { + compatible = "regulator-fixed"; + regulator-name = "dc_12v"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + + vcc3v3_baseboard: vcc3v3-baseboard { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_baseboard"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&dc_12v>; + }; + + vcc5v0_otg: vcc5v0-otg-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&otg_vbus_drv>; + regulator-name = "vcc5v0_otg"; + regulator-always-on; + }; +}; + +&i2c1 { + status = "okay"; + clock-frequency = <400000>; +}; + +&i2c2 { + status = "okay"; + clock-frequency = <400000>; +}; + +&i2c3 { + i2c-scl-rising-time-ns = <450>; + i2c-scl-falling-time-ns = <15>; + status = "okay"; +}; + +&i2c4 { + status = "okay"; + clock-frequency = <400000>; +}; + +&i2c6 { + status = "okay"; + clock-frequency = <400000>; +}; + +&i2s0 { + status = "okay"; + rockchip,playback-channels = <8>; + rockchip,capture-channels = <8>; + #sound-dai-cells = <0>; + status = "okay"; +}; + +&pcie_phy { + status = "okay"; +}; + +&pcie0 { + ep-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_LOW>; + num-lanes = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_clkreqn_cpm>; + status = "okay"; +}; + +&pinctrl { + pinctrl-names = "default"; + pinctrl-0 = <&haikou_pin_hog>; + + hog { + haikou_pin_hog: haikou-pin-hog { + rockchip,pins = + /* LID_BTN */ + , + /* BATLOW# */ + , + /* SLP_BTN# */ + , + /* BIOS_DISABLE# */ + ; + }; + }; + + leds { + led_sd_haikou: led-sd-gpio { + rockchip,pins = + ; + }; + }; + + usb2 { + otg_vbus_drv: otg-vbus-drv { + rockchip,pins = + ; + }; + }; +}; + +&pwm0 { + status = "okay"; +}; + +&sdmmc { + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; + disable-wp; + max-frequency = <150000000>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; + vmmc-supply = <&vcc3v3_baseboard>; + status = "okay"; +}; + +&spi5 { + status = "okay"; +}; + +&u2phy0 { + status = "okay"; +}; + +&usbdrd3_0 { + status = "okay"; +}; + +&usbdrd_dwc3_0 { + dr_mode = "otg"; + status = "okay"; +}; + +&u2phy0_host { + phy-supply = <&vcc5v0_otg>; + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; diff --git a/src/arm64/rockchip/rk3399-puma.dtsi b/src/arm64/rockchip/rk3399-puma.dtsi new file mode 100644 index 000000000000..910628d18add --- /dev/null +++ b/src/arm64/rockchip/rk3399-puma.dtsi @@ -0,0 +1,547 @@ +/* + * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +#include "rk3399.dtsi" +#include "rk3399-opp.dtsi" + +/ { + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pin_module>; + + module-led { + label = "module_led"; + gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + panic-indicator; + }; + }; + + /* + * Overwrite the opp-table for CPUB as this board uses a different + * regulator (FAN53555) that only allows 10mV steps and therefore + * can't reach the operation point target voltages from rk3399-opp.dtsi + */ + /delete-node/ opp-table1; + cluster1_opp: opp-table1 { + compatible = "operating-points-v2"; + opp-shared; + + opp00 { + opp-hz = /bits/ 64 <408000000>; + opp-microvolt = <800000>; + clock-latency-ns = <40000>; + }; + opp01 { + opp-hz = /bits/ 64 <600000000>; + opp-microvolt = <800000>; + }; + opp02 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <830000>; + opp-suspend; + }; + opp03 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <880000>; + }; + opp04 { + opp-hz = /bits/ 64 <1200000000>; + opp-microvolt = <950000>; + }; + opp05 { + opp-hz = /bits/ 64 <1416000000>; + opp-microvolt = <1030000>; + }; + opp06 { + opp-hz = /bits/ 64 <1608000000>; + opp-microvolt = <1100000>; + }; + opp07 { + opp-hz = /bits/ 64 <1800000000>; + opp-microvolt = <1200000>; + }; + opp08 { + opp-hz = /bits/ 64 <1992000000>; + opp-microvolt = <1230000>; + turbo-mode; + }; + }; + + clkin_gmac: external-gmac-clock { + compatible = "fixed-clock"; + clock-frequency = <125000000>; + clock-output-names = "clkin_gmac"; + #clock-cells = <0>; + }; + + vcc1v2_phy: vcc1v2-phy { + compatible = "regulator-fixed"; + regulator-name = "vcc1v2_phy"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + vin-supply = <&vcc5v0_sys>; + }; + + vcc3v3_sys: vcc3v3-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc5v0_sys>; + }; + + vcc5v0_host: vcc5v0-host-regulator { + compatible = "regulator-fixed"; + gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>; + enable-active-low; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_host_en>; + regulator-name = "vcc5v0_host"; + regulator-always-on; + vin-supply = <&vcc5v0_sys>; + }; + + vcc5v0_sys: vcc5v0-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + vdd_log: vdd-log { + compatible = "pwm-regulator"; + pwms = <&pwm2 0 25000 0>; + regulator-name = "vdd_log"; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1400000>; + regulator-always-on; + regulator-boot-on; + status = "okay"; + }; +}; + +&cpu_b0 { + cpu-supply = <&vdd_cpu_b>; +}; + +&cpu_b1 { + cpu-supply = <&vdd_cpu_b>; +}; + +&cpu_l0 { + cpu-supply = <&vdd_cpu_l>; +}; + +&cpu_l1 { + cpu-supply = <&vdd_cpu_l>; +}; + +&cpu_l2 { + cpu-supply = <&vdd_cpu_l>; +}; + +&cpu_l3 { + cpu-supply = <&vdd_cpu_l>; +}; + +&emmc_phy { + status = "okay"; +}; + +&gmac { + assigned-clocks = <&cru SCLK_RMII_SRC>; + assigned-clock-parents = <&clkin_gmac>; + clock_in_out = "input"; + phy-supply = <&vcc1v2_phy>; + phy-mode = "rgmii"; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>; + snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>; + snps,reset-active-low; + snps,reset-delays-us = <0 10000 50000>; + tx_delay = <0x10>; + rx_delay = <0x10>; + status = "okay"; +}; + +&i2c0 { + status = "okay"; + i2c-scl-rising-time-ns = <168>; + i2c-scl-falling-time-ns = <4>; + clock-frequency = <400000>; + + rk808: pmic@1b { + compatible = "rockchip,rk808"; + reg = <0x1b>; + interrupt-parent = <&gpio1>; + interrupts = <22 IRQ_TYPE_LEVEL_LOW>; + #clock-cells = <1>; + clock-output-names = "xin32k", "rk808-clkout2"; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc5v0_sys>; + vcc2-supply = <&vcc5v0_sys>; + vcc3-supply = <&vcc5v0_sys>; + vcc4-supply = <&vcc5v0_sys>; + vcc6-supply = <&vcc5v0_sys>; + vcc7-supply = <&vcc5v0_sys>; + vcc8-supply = <&vcc3v3_sys>; + vcc9-supply = <&vcc5v0_sys>; + vcc10-supply = <&vcc5v0_sys>; + vcc11-supply = <&vcc5v0_sys>; + vcc12-supply = <&vcc3v3_sys>; + vddio-supply = <&vcc1v8_pmu>; + + regulators { + vdd_center: DCDC_REG1 { + regulator-name = "vdd_center"; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_cpu_l: DCDC_REG2 { + regulator-name = "vdd_cpu_l"; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vcc_1v8: DCDC_REG4 { + regulator-name = "vcc_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc_ldo1: LDO_REG1 { + regulator-name = "vcc_ldo1"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc1v8_hdmi: LDO_REG2 { + regulator-name = "vcc1v8_hdmi"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc1v8_pmu: LDO_REG3 { + regulator-name = "vcc1v8_pmu"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc_sd: LDO_REG4 { + regulator-name = "vcc_sd"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3000000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3000000>; + }; + }; + + vcc_ldo5: LDO_REG5 { + regulator-name = "vcc_ldo5"; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_ldo6: LDO_REG6 { + regulator-name = "vcc_ldo6"; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc0v9_hdmi: LDO_REG7 { + regulator-name = "vcc0v9_hdmi"; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_efuse: LDO_REG8 { + regulator-name = "vcc_efuse"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_s3: SWITCH_REG1 { + regulator-name = "vcc3v3_s3"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_s0: SWITCH_REG2 { + regulator-name = "vcc3v3_s0"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + }; + }; + + vdd_gpu: regulator@60 { + compatible = "fcs,fan53555"; + reg = <0x60>; + fcs,suspend-voltage-selector = <1>; + regulator-name = "vdd_gpu"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1230000>; + regulator-ramp-delay = <1000>; + regulator-always-on; + regulator-boot-on; + vin-supply = <&vcc5v0_sys>; + }; +}; + +&i2c7 { + status = "okay"; + clock-frequency = <400000>; + + fan: fan@18 { + compatible = "ti,amc6821"; + reg = <0x18>; + cooling-min-state = <0>; + cooling-max-state = <9>; + #cooling-cells = <2>; + }; + + rtc_twi: rtc@6f { + compatible = "isil,isl1208"; + reg = <0x6f>; + }; +}; + +&i2c8 { + status = "okay"; + clock-frequency = <400000>; + + vdd_cpu_b: regulator@60 { + compatible = "fcs,fan53555"; + reg = <0x60>; + vin-supply = <&vcc5v0_sys>; + regulator-name = "vdd_cpu_b"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1230000>; + regulator-ramp-delay = <1000>; + fcs,suspend-voltage-selector = <1>; + regulator-always-on; + regulator-boot-on; + }; +}; + +&io_domains { + status = "okay"; + bt656-supply = <&vcc_1v8>; + audio-supply = <&vcc_1v8>; + sdmmc-supply = <&vcc_sd>; + gpio1830-supply = <&vcc_1v8>; +}; + +&pmu_io_domains { + status = "okay"; + pmu1830-supply = <&vcc_1v8>; +}; + +&pwm2 { + status = "okay"; +}; + +&pinctrl { + i2c8 { + i2c8_xfer_a: i2c8-xfer { + rockchip,pins = + , + ; + }; + }; + + leds { + led_pin_module: led-module-gpio { + rockchip,pins = + ; + }; + }; + + pmic { + pmic_int_l: pmic-int-l { + rockchip,pins = + ; + }; + }; + + usb2 { + vcc5v0_host_en: vcc5v0-host-en { + rockchip,pins = + ; + }; + }; +}; + +&sdhci { + bus-width = <8>; + mmc-hs400-1_8v; + mmc-hs400-enhanced-strobe; + non-removable; + status = "okay"; +}; + +&sdmmc { + vqmmc = <&vcc_sd>; +}; + +&spi1 { + status = "okay"; + + norflash: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + }; +}; + +&u2phy1 { + status = "okay"; + + u2phy1_otg: otg-port { + status = "okay"; + }; + + u2phy1_host: host-port { + phy-supply = <&vcc5v0_host>; + status = "okay"; + }; +}; + +&usbdrd3_1 { + status = "okay"; +}; + +&usbdrd_dwc3_1 { + status = "okay"; + dr_mode = "host"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; diff --git a/src/arm64/rockchip/rk3399-sapphire-excavator.dts b/src/arm64/rockchip/rk3399-sapphire-excavator.dts new file mode 100644 index 000000000000..b7bd88fb3ae3 --- /dev/null +++ b/src/arm64/rockchip/rk3399-sapphire-excavator.dts @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; +#include +#include "rk3399-sapphire.dtsi" + +/ { + model = "Excavator-RK3399 Board"; + compatible = "rockchip,rk3399-sapphire-excavator", "rockchip,rk3399"; + + adc-keys { + compatible = "adc-keys"; + io-channels = <&saradc 1>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1800000>; + poll-interval = <100>; + + button-up { + label = "Volume Up"; + linux,code = ; + press-threshold-microvolt = <100000>; + }; + + button-down { + label = "Volume Down"; + linux,code = ; + press-threshold-microvolt = <300000>; + }; + + back { + label = "Back"; + linux,code = ; + press-threshold-microvolt = <985000>; + }; + + menu { + label = "Menu"; + linux,code = ; + press-threshold-microvolt = <1314000>; + }; + }; + + edp_panel: edp-panel { + compatible ="lg,lp079qx1-sp0v", "simple-panel"; + backlight = <&backlight>; + enable-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&lcd_panel_reset>; + power-supply = <&vcc3v3_s0>; + + ports { + panel_in_edp: endpoint { + remote-endpoint = <&edp_out_panel>; + }; + }; + }; + + keys: gpio-keys { + compatible = "gpio-keys"; + autorepeat; + + power { + debounce-interval = <100>; + gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; + label = "GPIO Power"; + linux,code = ; + linux,input-type = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&pwr_btn>; + wakeup-source; + }; + }; + + rt5651-sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "realtek,rt5651-codec"; + simple-audio-card,format = "i2s"; + simple-audio-card,mclk-fs = <256>; + simple-audio-card,widgets = + "Microphone", "Mic Jack", + "Headphone", "Headphone Jack"; + simple-audio-card,routing = + "Mic Jack", "MICBIAS1", + "IN1P", "Mic Jack", + "Headphone Jack", "HPOL", + "Headphone Jack", "HPOR"; + simple-audio-card,cpu { + sound-dai = <&i2s0>; + }; + simple-audio-card,codec { + sound-dai = <&rt5651>; + }; + }; + + sdio_pwrseq: sdio-pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rk808 1>; + clock-names = "ext_clock"; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_enable_h>; + + /* + * On the module itself this is one of these (depending + * on the actual card populated): + * - SDIO_RESET_L_WL_REG_ON + * - PDN (power down when low) + */ + reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; + }; +}; + +&backlight { + enable-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>; + status = "okay"; +}; + +&edp { + status = "okay"; + + ports { + edp_out: port@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + edp_out_panel: endpoint@0 { + reg = <0>; + remote-endpoint = <&panel_in_edp>; + }; + }; + }; +}; + +&i2c1 { + i2c-scl-rising-time-ns = <300>; + i2c-scl-falling-time-ns = <15>; + status = "okay"; + + rt5651: rt5651@1a { + compatible = "rockchip,rt5651"; + reg = <0x1a>; + clocks = <&cru SCLK_I2S_8CH_OUT>; + clock-names = "mclk"; + hp-det-gpio = <&gpio4 RK_PC4 GPIO_ACTIVE_LOW>; + spk-con-gpio = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>; + #sound-dai-cells = <0>; + }; +}; + +&i2c4 { + i2c-scl-rising-time-ns = <600>; + i2c-scl-falling-time-ns = <20>; + status = "okay"; + + accelerometer@68 { + compatible = "invensense,mpu6500"; + reg = <0x68>; + interrupt-parent = <&gpio1>; + interrupts = ; + }; +}; + +&i2s0 { + rockchip,playback-channels = <8>; + rockchip,capture-channels = <8>; + #sound-dai-cells = <0>; + status = "okay"; +}; + +&i2s2 { + #sound-dai-cells = <0>; + status = "okay"; +}; + +&pinctrl { + buttons { + pwr_btn: pwr-btn { + rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + sdio-pwrseq { + wifi_enable_h: wifi-enable-h { + rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + lcd-panel { + lcd_panel_reset: lcd-panel-reset { + rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + +&spdif { + i2c-scl-rising-time-ns = <450>; + i2c-scl-falling-time-ns = <15>; + #sound-dai-cells = <0>; + status = "okay"; +}; diff --git a/src/arm64/rockchip/rk3399-sapphire.dtsi b/src/arm64/rockchip/rk3399-sapphire.dtsi new file mode 100644 index 000000000000..0f873c897d0d --- /dev/null +++ b/src/arm64/rockchip/rk3399-sapphire.dtsi @@ -0,0 +1,644 @@ +/* + * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "dt-bindings/pwm/pwm.h" +#include "rk3399.dtsi" +#include "rk3399-opp.dtsi" + +/ { + compatible = "rockchip,rk3399-sapphire", "rockchip,rk3399"; + + backlight: backlight { + compatible = "pwm-backlight"; + brightness-levels = < + 0 1 2 3 4 5 6 7 + 8 9 10 11 12 13 14 15 + 16 17 18 19 20 21 22 23 + 24 25 26 27 28 29 30 31 + 32 33 34 35 36 37 38 39 + 40 41 42 43 44 45 46 47 + 48 49 50 51 52 53 54 55 + 56 57 58 59 60 61 62 63 + 64 65 66 67 68 69 70 71 + 72 73 74 75 76 77 78 79 + 80 81 82 83 84 85 86 87 + 88 89 90 91 92 93 94 95 + 96 97 98 99 100 101 102 103 + 104 105 106 107 108 109 110 111 + 112 113 114 115 116 117 118 119 + 120 121 122 123 124 125 126 127 + 128 129 130 131 132 133 134 135 + 136 137 138 139 140 141 142 143 + 144 145 146 147 148 149 150 151 + 152 153 154 155 156 157 158 159 + 160 161 162 163 164 165 166 167 + 168 169 170 171 172 173 174 175 + 176 177 178 179 180 181 182 183 + 184 185 186 187 188 189 190 191 + 192 193 194 195 196 197 198 199 + 200 201 202 203 204 205 206 207 + 208 209 210 211 212 213 214 215 + 216 217 218 219 220 221 222 223 + 224 225 226 227 228 229 230 231 + 232 233 234 235 236 237 238 239 + 240 241 242 243 244 245 246 247 + 248 249 250 251 252 253 254 255>; + default-brightness-level = <200>; + pwms = <&pwm0 0 25000 0>; + }; + + clkin_gmac: external-gmac-clock { + compatible = "fixed-clock"; + clock-frequency = <125000000>; + clock-output-names = "clkin_gmac"; + #clock-cells = <0>; + }; + + dc_12v: dc-12v { + compatible = "regulator-fixed"; + regulator-name = "dc_12v"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + + /* switched by pmic_sleep */ + vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 { + compatible = "regulator-fixed"; + regulator-name = "vcc1v8_s3"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&vcc_1v8>; + }; + + vcc3v3_sys: vcc3v3-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc_sys>; + }; + + vcc_sys: vcc-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&dc_12v>; + }; + + vcc5v0_host: vcc5v0-host-regulator { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_host_en>; + regulator-name = "vcc5v0_host"; + regulator-always-on; + vin-supply = <&vcc_sys>; + }; +}; + +&cpu_l0 { + cpu-supply = <&vdd_cpu_l>; +}; + +&cpu_l1 { + cpu-supply = <&vdd_cpu_l>; +}; + +&cpu_l2 { + cpu-supply = <&vdd_cpu_l>; +}; + +&cpu_l3 { + cpu-supply = <&vdd_cpu_l>; +}; + +&cpu_b0 { + cpu-supply = <&vdd_cpu_b>; +}; + +&cpu_b1 { + cpu-supply = <&vdd_cpu_b>; +}; + +&emmc_phy { + status = "okay"; +}; + +&gmac { + assigned-clocks = <&cru SCLK_RMII_SRC>; + assigned-clock-parents = <&clkin_gmac>; + clock_in_out = "input"; + phy-supply = <&vcc_lan>; + phy-mode = "rgmii"; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>; + snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + snps,reset-delays-us = <0 10000 50000>; + tx_delay = <0x28>; + rx_delay = <0x11>; + status = "okay"; +}; + +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + +&hdmi { + ddc-i2c-bus = <&i2c3>; + status = "okay"; +}; + +&i2c0 { + clock-frequency = <400000>; + i2c-scl-rising-time-ns = <168>; + i2c-scl-falling-time-ns = <4>; + status = "okay"; + + rk808: pmic@1b { + compatible = "rockchip,rk808"; + reg = <0x1b>; + interrupt-parent = <&gpio1>; + interrupts = <21 IRQ_TYPE_LEVEL_LOW>; + #clock-cells = <1>; + clock-output-names = "xin32k", "rk808-clkout2"; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l &pmic_dvs2>; + rockchip,system-power-controller; + wakeup-source; + + vcc1-supply = <&vcc_sys>; + vcc2-supply = <&vcc_sys>; + vcc3-supply = <&vcc_sys>; + vcc4-supply = <&vcc_sys>; + vcc6-supply = <&vcc_sys>; + vcc7-supply = <&vcc_sys>; + vcc8-supply = <&vcc3v3_sys>; + vcc9-supply = <&vcc_sys>; + vcc10-supply = <&vcc_sys>; + vcc11-supply = <&vcc_sys>; + vcc12-supply = <&vcc3v3_sys>; + vddio-supply = <&vcc1v8_pmu>; + + regulators { + vdd_center: DCDC_REG1 { + regulator-name = "vdd_center"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_cpu_l: DCDC_REG2 { + regulator-name = "vdd_cpu_l"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vcc_1v8: DCDC_REG4 { + regulator-name = "vcc_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc1v8_dvp: LDO_REG1 { + regulator-name = "vcc1v8_dvp"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v0_tp: LDO_REG2 { + regulator-name = "vcc3v0_tp"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc1v8_pmu: LDO_REG3 { + regulator-name = "vcc1v8_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcc_sdio: LDO_REG4 { + regulator-name = "vcc_sdio"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3000000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3000000>; + }; + }; + + vcca3v0_codec: LDO_REG5 { + regulator-name = "vcca3v0_codec"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_1v5: LDO_REG6 { + regulator-name = "vcc_1v5"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1500000>; + }; + }; + + vcca1v8_codec: LDO_REG7 { + regulator-name = "vcca1v8_codec"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_3v0: LDO_REG8 { + regulator-name = "vcc_3v0"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3000000>; + }; + }; + + vcc3v3_s3: vcc_lan: SWITCH_REG1 { + regulator-name = "vcc3v3_s3"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_s0: SWITCH_REG2 { + regulator-name = "vcc3v3_s0"; + regulator-always-on; + regulator-boot-on; + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + }; + }; + + vdd_cpu_b: regulator@40 { + compatible = "silergy,syr827"; + reg = <0x40>; + fcs,suspend-voltage-selector = <1>; + regulator-name = "vdd_cpu_b"; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1500000>; + regulator-ramp-delay = <1000>; + regulator-always-on; + regulator-boot-on; + vin-supply = <&vcc_sys>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_gpu: regulator@41 { + compatible = "silergy,syr828"; + reg = <0x41>; + fcs,suspend-voltage-selector = <1>; + regulator-name = "vdd_gpu"; + regulator-min-microvolt = <712500>; + regulator-max-microvolt = <1500000>; + regulator-ramp-delay = <1000>; + regulator-always-on; + regulator-boot-on; + vin-supply = <&vcc_sys>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_log: vdd-log { + compatible = "pwm-regulator"; + pwms = <&pwm2 0 25000 1>; + regulator-name = "vdd_log"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1400000>; + vin-supply = <&vcc_sys>; + }; +}; + +&i2c3 { + i2c-scl-rising-time-ns = <450>; + i2c-scl-falling-time-ns = <15>; + status = "okay"; +}; + +&io_domains { + status = "okay"; + + bt656-supply = <&vcc_3v0>; + audio-supply = <&vcca1v8_codec>; + sdmmc-supply = <&vcc_sdio>; + gpio1830-supply = <&vcc_3v0>; +}; + +&pcie_phy { + status = "okay"; +}; + +&pcie0 { + assigned-clocks = <&cru SCLK_PCIEPHY_REF>; + assigned-clock-parents = <&cru SCLK_PCIEPHY_REF100M>; + assigned-clock-rates = <100000000>; + ep-gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_HIGH>; + num-lanes = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_clkreqn_cpm>; + status = "okay"; +}; + +&pmu_io_domains { + pmu1830-supply = <&vcc_3v0>; + status = "okay"; +}; + +&pinctrl { + pmic { + pmic_int_l: pmic-int-l { + rockchip,pins = + <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + pmic_dvs2: pmic-dvs2 { + rockchip,pins = + <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + vsel1_gpio: vsel1-gpio { + rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + vsel2_gpio: vsel2-gpio { + rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + + usb2 { + vcc5v0_host_en: vcc5v0-host-en { + rockchip,pins = + <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&pwm0 { + status = "okay"; +}; + +&pwm2 { + status = "okay"; +}; + +&saradc { + vref-supply = <&vcca1v8_s3>; + status = "okay"; +}; + +&sdhci { + bus-width = <8>; + keep-power-in-suspend; + mmc-hs400-1_8v; + mmc-hs400-enhanced-strobe; + non-removable; + status = "okay"; +}; + +&sdio0 { + bus-width = <4>; + cap-sd-highspeed; + cap-sdio-irq; + clock-frequency = <50000000>; + disable-wp; + keep-power-in-suspend; + max-frequency = <50000000>; + mmc-pwrseq = <&sdio_pwrseq>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; + sd-uhs-sdr104; + status = "okay"; +}; + +&sdmmc { + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + clock-frequency = <150000000>; + disable-wp; + max-frequency = <150000000>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; + vqmmc-supply = <&vcc_sdio>; + status = "okay"; +}; + +&tsadc { + /* tshut mode 0:CRU 1:GPIO */ + rockchip,hw-tshut-mode = <1>; + /* tshut polarity 0:LOW 1:HIGH */ + rockchip,hw-tshut-polarity = <1>; + status = "okay"; +}; + +&u2phy0 { + status = "okay"; + + u2phy0_otg: otg-port { + status = "okay"; + }; + + u2phy0_host: host-port { + phy-supply = <&vcc5v0_host>; + status = "okay"; + }; +}; + +&u2phy1 { + status = "okay"; + + u2phy1_otg: otg-port { + status = "okay"; + }; + + u2phy1_host: host-port { + phy-supply = <&vcc5v0_host>; + status = "okay"; + }; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_xfer &uart0_cts>; + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + +&usbdrd3_0 { + status = "okay"; +}; + +&usbdrd_dwc3_0 { + status = "okay"; + dr_mode = "otg"; +}; + +&usbdrd3_1 { + status = "okay"; +}; + +&usbdrd_dwc3_1 { + status = "okay"; + dr_mode = "host"; +}; + +&vopb { + status = "okay"; +}; + +&vopb_mmu { + status = "okay"; +}; + +&vopl { + status = "okay"; +}; + +&vopl_mmu { + status = "okay"; +}; diff --git a/src/arm64/rockchip/rk3399.dtsi b/src/arm64/rockchip/rk3399.dtsi index 69c56f7316c4..ab7629c5b856 100644 --- a/src/arm64/rockchip/rk3399.dtsi +++ b/src/arm64/rockchip/rk3399.dtsi @@ -110,6 +110,7 @@ enable-method = "psci"; #cooling-cells = <2>; /* min followed by max */ clocks = <&cru ARMCLKL>; + dynamic-power-coefficient = <100>; }; cpu_l1: cpu@1 { @@ -118,6 +119,7 @@ reg = <0x0 0x1>; enable-method = "psci"; clocks = <&cru ARMCLKL>; + dynamic-power-coefficient = <100>; }; cpu_l2: cpu@2 { @@ -126,6 +128,7 @@ reg = <0x0 0x2>; enable-method = "psci"; clocks = <&cru ARMCLKL>; + dynamic-power-coefficient = <100>; }; cpu_l3: cpu@3 { @@ -134,6 +137,7 @@ reg = <0x0 0x3>; enable-method = "psci"; clocks = <&cru ARMCLKL>; + dynamic-power-coefficient = <100>; }; cpu_b0: cpu@100 { @@ -143,6 +147,7 @@ enable-method = "psci"; #cooling-cells = <2>; /* min followed by max */ clocks = <&cru ARMCLKB>; + dynamic-power-coefficient = <436>; }; cpu_b1: cpu@101 { @@ -151,9 +156,15 @@ reg = <0x0 0x101>; enable-method = "psci"; clocks = <&cru ARMCLKB>; + dynamic-power-coefficient = <436>; }; }; + display-subsystem { + compatible = "rockchip,display-subsystem"; + ports = <&vopl_out>, <&vopb_out>; + }; + pmu_a53 { compatible = "arm,cortex-a53-pmu"; interrupts = ; @@ -238,8 +249,10 @@ linux,pci-domain = <0>; max-link-speed = <1>; msi-map = <0x0 &its 0x0 0x1000>; - phys = <&pcie_phy>; - phy-names = "pcie-phy"; + phys = <&pcie_phy 0>, <&pcie_phy 1>, + <&pcie_phy 2>, <&pcie_phy 3>; + phy-names = "pcie-phy-0", "pcie-phy-1", + "pcie-phy-2", "pcie-phy-3"; ranges = <0x83000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000 0x81000000 0x0 0xfbe00000 0x0 0xfbe00000 0x0 0x100000>; resets = <&cru SRST_PCIE_CORE>, <&cru SRST_PCIE_MGMT>, @@ -287,6 +300,7 @@ <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; + power-domains = <&power RK3399_PD_SDIOAUDIO>; resets = <&cru SRST_SDIO0>; reset-names = "reset"; status = "disabled"; @@ -400,6 +414,7 @@ snps,dis-u2-freeclk-exists-quirk; snps,dis_u2_susphy_quirk; snps,dis-del-phy-power-chg-quirk; + snps,dis-tx-ipgap-linecheck-quirk; status = "disabled"; }; }; @@ -427,6 +442,7 @@ snps,dis-u2-freeclk-exists-quirk; snps,dis_u2_susphy_quirk; snps,dis-del-phy-power-chg-quirk; + snps,dis-tx-ipgap-linecheck-quirk; status = "disabled"; }; }; @@ -676,6 +692,7 @@ interrupts = ; pinctrl-names = "default"; pinctrl-0 = <&spi5_clk &spi5_tx &spi5_rx &spi5_cs0>; + power-domains = <&power RK3399_PD_SDIOAUDIO>; #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -948,6 +965,10 @@ }; /* These power domains are grouped by VD_LOGIC */ + pd_edp@RK3399_PD_EDP { + reg = ; + clocks = <&cru PCLK_EDP_CTRL>; + }; pd_emmc@RK3399_PD_EMMC { reg = ; clocks = <&cru ACLK_EMMC>; @@ -965,6 +986,11 @@ <&cru SCLK_SDMMC>; pm_qos = <&qos_sd>; }; + pd_sdioaudio@RK3399_PD_SDIOAUDIO { + reg = ; + clocks = <&cru HCLK_SDIO>; + pm_qos = <&qos_sdioaudio>; + }; pd_vio@RK3399_PD_VIO { reg = ; #address-cells = <1>; @@ -1151,6 +1177,33 @@ status = "disabled"; }; + vpu_mmu: iommu@ff650800 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff650800 0x0 0x40>; + interrupts = ; + interrupt-names = "vpu_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + vdec_mmu: iommu@ff660480 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff660480 0x0 0x40>, <0x0 0xff6604c0 0x0 0x40>; + interrupts = ; + interrupt-names = "vdec_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + + iep_mmu: iommu@ff670800 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff670800 0x0 0x40>; + interrupts = ; + interrupt-names = "iep_mmu"; + #iommu-cells = <0>; + status = "disabled"; + }; + efuse0: efuse@ff690000 { compatible = "rockchip,rk3399-efuse"; reg = <0x0 0xff690000 0x0 0x80>; @@ -1295,7 +1348,7 @@ compatible = "rockchip,rk3399-pcie-phy"; clocks = <&cru SCLK_PCIEPHY_REF>; clock-names = "refclk"; - #phy-cells = <0>; + #phy-cells = <1>; resets = <&cru SRST_PCIEPHY>; reset-names = "phy"; status = "disabled"; @@ -1385,6 +1438,7 @@ clocks = <&cru SCLK_SPDIF_8CH>, <&cru HCLK_SPDIF>; pinctrl-names = "default"; pinctrl-0 = <&spdif_bus>; + power-domains = <&power RK3399_PD_SDIOAUDIO>; status = "disabled"; }; @@ -1399,6 +1453,7 @@ clocks = <&cru SCLK_I2S0_8CH>, <&cru HCLK_I2S0_8CH>; pinctrl-names = "default"; pinctrl-0 = <&i2s0_8ch_bus>; + power-domains = <&power RK3399_PD_SDIOAUDIO>; status = "disabled"; }; @@ -1412,6 +1467,7 @@ clocks = <&cru SCLK_I2S1_8CH>, <&cru HCLK_I2S1_8CH>; pinctrl-names = "default"; pinctrl-0 = <&i2s1_2ch_bus>; + power-domains = <&power RK3399_PD_SDIOAUDIO>; status = "disabled"; }; @@ -1423,6 +1479,224 @@ dma-names = "tx", "rx"; clock-names = "i2s_clk", "i2s_hclk"; clocks = <&cru SCLK_I2S2_8CH>, <&cru HCLK_I2S2_8CH>; + power-domains = <&power RK3399_PD_SDIOAUDIO>; + status = "disabled"; + }; + + vopl: vop@ff8f0000 { + compatible = "rockchip,rk3399-vop-lit"; + reg = <0x0 0xff8f0000 0x0 0x3efc>; + interrupts = ; + assigned-clocks = <&cru ACLK_VOP1>, <&cru HCLK_VOP1>; + assigned-clock-rates = <400000000>, <100000000>; + clocks = <&cru ACLK_VOP1>, <&cru DCLK_VOP1>, <&cru HCLK_VOP1>; + clock-names = "aclk_vop", "dclk_vop", "hclk_vop"; + iommus = <&vopl_mmu>; + power-domains = <&power RK3399_PD_VOPL>; + resets = <&cru SRST_A_VOP1>, <&cru SRST_H_VOP1>, <&cru SRST_D_VOP1>; + reset-names = "axi", "ahb", "dclk"; + status = "disabled"; + + vopl_out: port { + #address-cells = <1>; + #size-cells = <0>; + + vopl_out_mipi: endpoint@0 { + reg = <0>; + remote-endpoint = <&mipi_in_vopl>; + }; + + vopl_out_edp: endpoint@1 { + reg = <1>; + remote-endpoint = <&edp_in_vopl>; + }; + + vopl_out_hdmi: endpoint@2 { + reg = <2>; + remote-endpoint = <&hdmi_in_vopl>; + }; + }; + }; + + vopl_mmu: iommu@ff8f3f00 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff8f3f00 0x0 0x100>; + interrupts = ; + interrupt-names = "vopl_mmu"; + clocks = <&cru ACLK_VOP1>, <&cru HCLK_VOP1>; + clock-names = "aclk", "hclk"; + power-domains = <&power RK3399_PD_VOPL>; + #iommu-cells = <0>; + status = "disabled"; + }; + + vopb: vop@ff900000 { + compatible = "rockchip,rk3399-vop-big"; + reg = <0x0 0xff900000 0x0 0x3efc>; + interrupts = ; + assigned-clocks = <&cru ACLK_VOP0>, <&cru HCLK_VOP0>; + assigned-clock-rates = <400000000>, <100000000>; + clocks = <&cru ACLK_VOP0>, <&cru DCLK_VOP0>, <&cru HCLK_VOP0>; + clock-names = "aclk_vop", "dclk_vop", "hclk_vop"; + iommus = <&vopb_mmu>; + power-domains = <&power RK3399_PD_VOPB>; + resets = <&cru SRST_A_VOP0>, <&cru SRST_H_VOP0>, <&cru SRST_D_VOP0>; + reset-names = "axi", "ahb", "dclk"; + status = "disabled"; + + vopb_out: port { + #address-cells = <1>; + #size-cells = <0>; + + vopb_out_edp: endpoint@0 { + reg = <0>; + remote-endpoint = <&edp_in_vopb>; + }; + + vopb_out_mipi: endpoint@1 { + reg = <1>; + remote-endpoint = <&mipi_in_vopb>; + }; + + vopb_out_hdmi: endpoint@2 { + reg = <2>; + remote-endpoint = <&hdmi_in_vopb>; + }; + }; + }; + + vopb_mmu: iommu@ff903f00 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff903f00 0x0 0x100>; + interrupts = ; + interrupt-names = "vopb_mmu"; + clocks = <&cru ACLK_VOP0>, <&cru HCLK_VOP0>; + clock-names = "aclk", "hclk"; + power-domains = <&power RK3399_PD_VOPB>; + #iommu-cells = <0>; + status = "disabled"; + }; + + isp0_mmu: iommu@ff914000 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff914000 0x0 0x100>, <0x0 0xff915000 0x0 0x100>; + interrupts = ; + interrupt-names = "isp0_mmu"; + #iommu-cells = <0>; + rockchip,disable-mmu-reset; + status = "disabled"; + }; + + isp1_mmu: iommu@ff924000 { + compatible = "rockchip,iommu"; + reg = <0x0 0xff924000 0x0 0x100>, <0x0 0xff925000 0x0 0x100>; + interrupts = ; + interrupt-names = "isp1_mmu"; + #iommu-cells = <0>; + rockchip,disable-mmu-reset; + status = "disabled"; + }; + + hdmi: hdmi@ff940000 { + compatible = "rockchip,rk3399-dw-hdmi"; + reg = <0x0 0xff940000 0x0 0x20000>; + interrupts = ; + clocks = <&cru PCLK_HDMI_CTRL>, <&cru SCLK_HDMI_SFR>, <&cru PLL_VPLL>, <&cru PCLK_VIO_GRF>; + clock-names = "iahb", "isfr", "vpll", "grf"; + power-domains = <&power RK3399_PD_HDCP>; + reg-io-width = <4>; + rockchip,grf = <&grf>; + status = "disabled"; + + ports { + hdmi_in: port { + #address-cells = <1>; + #size-cells = <0>; + + hdmi_in_vopb: endpoint@0 { + reg = <0>; + remote-endpoint = <&vopb_out_hdmi>; + }; + hdmi_in_vopl: endpoint@1 { + reg = <1>; + remote-endpoint = <&vopl_out_hdmi>; + }; + }; + }; + }; + + mipi_dsi: mipi@ff960000 { + compatible = "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi"; + reg = <0x0 0xff960000 0x0 0x8000>; + interrupts = ; + clocks = <&cru SCLK_DPHY_PLL>, <&cru PCLK_MIPI_DSI0>, + <&cru SCLK_DPHY_TX0_CFG>, <&cru PCLK_VIO_GRF>; + clock-names = "ref", "pclk", "phy_cfg", "grf"; + power-domains = <&power RK3399_PD_VIO>; + rockchip,grf = <&grf>; + status = "disabled"; + + ports { + mipi_in: port { + #address-cells = <1>; + #size-cells = <0>; + + mipi_in_vopb: endpoint@0 { + reg = <0>; + remote-endpoint = <&vopb_out_mipi>; + }; + mipi_in_vopl: endpoint@1 { + reg = <1>; + remote-endpoint = <&vopl_out_mipi>; + }; + }; + }; + }; + + edp: edp@ff970000 { + compatible = "rockchip,rk3399-edp"; + reg = <0x0 0xff970000 0x0 0x8000>; + interrupts = ; + clocks = <&cru PCLK_EDP>, <&cru PCLK_EDP_CTRL>; + clock-names = "dp", "pclk"; + pinctrl-names = "default"; + pinctrl-0 = <&edp_hpd>; + power-domains = <&power RK3399_PD_EDP>; + resets = <&cru SRST_P_EDP_CTRL>; + reset-names = "dp"; + rockchip,grf = <&grf>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + edp_in: port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + edp_in_vopb: endpoint@0 { + reg = <0>; + remote-endpoint = <&vopb_out_edp>; + }; + + edp_in_vopl: endpoint@1 { + reg = <1>; + remote-endpoint = <&vopl_out_edp>; + }; + }; + }; + }; + + gpu: gpu@ff9a0000 { + compatible = "rockchip,rk3399-mali", "arm,mali-t860"; + reg = <0x0 0xff9a0000 0x0 0x10000>; + interrupts = , + , + ; + interrupt-names = "gpu", "job", "mmu"; + clocks = <&cru ACLK_GPU>; + power-domains = <&power RK3399_PD_GPU>; status = "disabled"; }; @@ -1786,7 +2060,7 @@ <4 RK_PB5 RK_FUNC_1 &pcfg_pull_up>; }; - sdmmc_cd: sdmcc-cd { + sdmmc_cd: sdmmc-cd { rockchip,pins = <0 RK_PA7 RK_FUNC_1 &pcfg_pull_up>; }; @@ -2090,16 +2364,6 @@ }; pcie { - pcie_clkreqn: pci-clkreqn { - rockchip,pins = - <2 26 RK_FUNC_2 &pcfg_pull_none>; - }; - - pcie_clkreqnb: pci-clkreqnb { - rockchip,pins = - <4 24 RK_FUNC_1 &pcfg_pull_none>; - }; - pcie_clkreqn_cpm: pci-clkreqn-cpm { rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; diff --git a/src/arm64/socionext/uniphier-ld11-global.dts b/src/arm64/socionext/uniphier-ld11-global.dts index 115357018ef7..2452b2243f42 100644 --- a/src/arm64/socionext/uniphier-ld11-global.dts +++ b/src/arm64/socionext/uniphier-ld11-global.dts @@ -9,7 +9,7 @@ */ /dts-v1/; -/include/ "uniphier-ld11.dtsi" +#include "uniphier-ld11.dtsi" / { model = "UniPhier LD11 Global Board (REF_LD11_GP)"; @@ -68,3 +68,7 @@ &usb2 { status = "okay"; }; + +&nand { + status = "okay"; +}; diff --git a/src/arm64/socionext/uniphier-ld11-ref.dts b/src/arm64/socionext/uniphier-ld11-ref.dts index cc8ebe34c27c..ffb473ad2e0f 100644 --- a/src/arm64/socionext/uniphier-ld11-ref.dts +++ b/src/arm64/socionext/uniphier-ld11-ref.dts @@ -8,9 +8,9 @@ */ /dts-v1/; -/include/ "uniphier-ld11.dtsi" -/include/ "uniphier-ref-daughter.dtsi" -/include/ "uniphier-support-card.dtsi" +#include "uniphier-ld11.dtsi" +#include "uniphier-ref-daughter.dtsi" +#include "uniphier-support-card.dtsi" / { model = "UniPhier LD11 Reference Board"; diff --git a/src/arm64/socionext/uniphier-ld11.dtsi b/src/arm64/socionext/uniphier-ld11.dtsi index bdce5b89baec..09c429cb6d61 100644 --- a/src/arm64/socionext/uniphier-ld11.dtsi +++ b/src/arm64/socionext/uniphier-ld11.dtsi @@ -150,6 +150,17 @@ clocks = <&peri_clk 3>; }; + adamv@57920000 { + compatible = "socionext,uniphier-ld11-adamv", + "simple-mfd", "syscon"; + reg = <0x57920000 0x1000>; + + adamv_rst: reset { + compatible = "socionext,uniphier-ld11-adamv-reset"; + #reset-cells = <1>; + }; + }; + i2c0: i2c@58780000 { compatible = "socionext,uniphier-fi2c"; status = "disabled"; @@ -288,7 +299,8 @@ interrupts = <0 243 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb0>; - clocks = <&mio_clk 7>, <&mio_clk 8>, <&mio_clk 12>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 8>, + <&mio_clk 12>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 8>, <&mio_rst 12>; }; @@ -300,7 +312,8 @@ interrupts = <0 244 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb1>; - clocks = <&mio_clk 7>, <&mio_clk 9>, <&mio_clk 13>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 9>, + <&mio_clk 13>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 9>, <&mio_rst 13>; }; @@ -312,7 +325,8 @@ interrupts = <0 245 4>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb2>; - clocks = <&mio_clk 7>, <&mio_clk 10>, <&mio_clk 14>; + clocks = <&sys_clk 8>, <&mio_clk 7>, <&mio_clk 10>, + <&mio_clk 14>; resets = <&sys_rst 8>, <&mio_rst 7>, <&mio_rst 10>, <&mio_rst 14>; }; @@ -344,6 +358,13 @@ }; }; + aidet: aidet@5fc20000 { + compatible = "socionext,uniphier-ld11-aidet"; + reg = <0x5fc20000 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + gic: interrupt-controller@5fe00000 { compatible = "arm,gic-v3"; reg = <0x5fe00000 0x10000>, /* GICD */ @@ -367,8 +388,23 @@ compatible = "socionext,uniphier-ld11-reset"; #reset-cells = <1>; }; + + watchdog { + compatible = "socionext,uniphier-wdt"; + }; + }; + + nand: nand@68000000 { + compatible = "socionext,uniphier-denali-nand-v5b"; + status = "disabled"; + reg-names = "nand_data", "denali_reg"; + reg = <0x68000000 0x20>, <0x68100000 0x1000>; + interrupts = <0 65 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_nand>; + clocks = <&sys_clk 2>; }; }; }; -/include/ "uniphier-pinctrl.dtsi" +#include "uniphier-pinctrl.dtsi" diff --git a/src/arm64/socionext/uniphier-ld20-global.dts b/src/arm64/socionext/uniphier-ld20-global.dts index 9f620d4101b5..fc2bc9d75d35 100644 --- a/src/arm64/socionext/uniphier-ld20-global.dts +++ b/src/arm64/socionext/uniphier-ld20-global.dts @@ -9,7 +9,7 @@ */ /dts-v1/; -/include/ "uniphier-ld20.dtsi" +#include "uniphier-ld20.dtsi" / { model = "UniPhier LD20 Global Board (REF_LD20_GP)"; @@ -50,3 +50,7 @@ &i2c0 { status = "okay"; }; + +&nand { + status = "okay"; +}; diff --git a/src/arm64/socionext/uniphier-ld20-ref.dts b/src/arm64/socionext/uniphier-ld20-ref.dts index 494166aee24c..1ca0c8620dc5 100644 --- a/src/arm64/socionext/uniphier-ld20-ref.dts +++ b/src/arm64/socionext/uniphier-ld20-ref.dts @@ -8,9 +8,9 @@ */ /dts-v1/; -/include/ "uniphier-ld20.dtsi" -/include/ "uniphier-ref-daughter.dtsi" -/include/ "uniphier-support-card.dtsi" +#include "uniphier-ld20.dtsi" +#include "uniphier-ref-daughter.dtsi" +#include "uniphier-support-card.dtsi" / { model = "UniPhier LD20 Reference Board"; diff --git a/src/arm64/socionext/uniphier-ld20.dtsi b/src/arm64/socionext/uniphier-ld20.dtsi index de1e75362817..a29c279b6e8e 100644 --- a/src/arm64/socionext/uniphier-ld20.dtsi +++ b/src/arm64/socionext/uniphier-ld20.dtsi @@ -219,6 +219,17 @@ clocks = <&peri_clk 3>; }; + adamv@57920000 { + compatible = "socionext,uniphier-ld20-adamv", + "simple-mfd", "syscon"; + reg = <0x57920000 0x1000>; + + adamv_rst: reset { + compatible = "socionext,uniphier-ld20-adamv-reset"; + #reset-cells = <1>; + }; + }; + i2c0: i2c@58780000 { compatible = "socionext,uniphier-fi2c"; status = "disabled"; @@ -309,7 +320,7 @@ sdctrl@59810000 { compatible = "socionext,uniphier-ld20-sdctrl", "simple-mfd", "syscon"; - reg = <0x59810000 0x800>; + reg = <0x59810000 0x400>; sd_clk: clock { compatible = "socionext,uniphier-ld20-sd-clock"; @@ -365,6 +376,13 @@ }; }; + aidet: aidet@5fc20000 { + compatible = "socionext,uniphier-ld20-aidet"; + reg = <0x5fc20000 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + gic: interrupt-controller@5fe00000 { compatible = "arm,gic-v3"; reg = <0x5fe00000 0x10000>, /* GICD */ @@ -388,8 +406,23 @@ compatible = "socionext,uniphier-ld20-reset"; #reset-cells = <1>; }; + + watchdog { + compatible = "socionext,uniphier-wdt"; + }; + }; + + nand: nand@68000000 { + compatible = "socionext,uniphier-denali-nand-v5b"; + status = "disabled"; + reg-names = "nand_data", "denali_reg"; + reg = <0x68000000 0x20>, <0x68100000 0x1000>; + interrupts = <0 65 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_nand>; + clocks = <&sys_clk 2>; }; }; }; -/include/ "uniphier-pinctrl.dtsi" +#include "uniphier-pinctrl.dtsi" diff --git a/src/arm64/socionext/uniphier-pinctrl.dtsi b/src/arm64/socionext/uniphier-pinctrl.dtsi index 246f35ffb638..9caabbb8bae3 100644 --- a/src/arm64/socionext/uniphier-pinctrl.dtsi +++ b/src/arm64/socionext/uniphier-pinctrl.dtsi @@ -1,141 +1 @@ -/* - * Device Tree Source for UniPhier SoCs default pinctrl settings - * - * Copyright (C) 2015-2017 Socionext Inc. - * Author: Masahiro Yamada - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -&pinctrl { - pinctrl_emmc: emmc_grp { - groups = "emmc", "emmc_dat8"; - function = "emmc"; - }; - - pinctrl_i2c0: i2c0_grp { - groups = "i2c0"; - function = "i2c0"; - }; - - pinctrl_i2c1: i2c1_grp { - groups = "i2c1"; - function = "i2c1"; - }; - - pinctrl_i2c2: i2c2_grp { - groups = "i2c2"; - function = "i2c2"; - }; - - pinctrl_i2c3: i2c3_grp { - groups = "i2c3"; - function = "i2c3"; - }; - - pinctrl_i2c4: i2c4_grp { - groups = "i2c4"; - function = "i2c4"; - }; - - pinctrl_nand: nand_grp { - groups = "nand"; - function = "nand"; - }; - - pinctrl_nand2cs: nand2cs_grp { - groups = "nand", "nand_cs1"; - function = "nand"; - }; - - pinctrl_sd: sd_grp { - groups = "sd"; - function = "sd"; - }; - - pinctrl_sd1: sd1_grp { - groups = "sd1"; - function = "sd1"; - }; - - pinctrl_system_bus: system_bus_grp { - groups = "system_bus", "system_bus_cs1"; - function = "system_bus"; - }; - - pinctrl_uart0: uart0_grp { - groups = "uart0"; - function = "uart0"; - }; - - pinctrl_uart1: uart1_grp { - groups = "uart1"; - function = "uart1"; - }; - - pinctrl_uart2: uart2_grp { - groups = "uart2"; - function = "uart2"; - }; - - pinctrl_uart3: uart3_grp { - groups = "uart3"; - function = "uart3"; - }; - - pinctrl_usb0: usb0_grp { - groups = "usb0"; - function = "usb0"; - }; - - pinctrl_usb1: usb1_grp { - groups = "usb1"; - function = "usb1"; - }; - - pinctrl_usb2: usb2_grp { - groups = "usb2"; - function = "usb2"; - }; - - pinctrl_usb3: usb3_grp { - groups = "usb3"; - function = "usb3"; - }; -}; +#include diff --git a/src/arm64/socionext/uniphier-pxs3-ref.dts b/src/arm64/socionext/uniphier-pxs3-ref.dts new file mode 100644 index 000000000000..d65f746a3f9d --- /dev/null +++ b/src/arm64/socionext/uniphier-pxs3-ref.dts @@ -0,0 +1,62 @@ +/* + * Device Tree Source for UniPhier PXs3 Reference Board + * + * Copyright (C) 2017 Socionext Inc. + * Author: Masahiro Yamada + * + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) + */ + +/dts-v1/; +#include "uniphier-pxs3.dtsi" +#include "uniphier-support-card.dtsi" + +/ { + model = "UniPhier PXs3 Reference Board"; + compatible = "socionext,uniphier-pxs3-ref", "socionext,uniphier-pxs3"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + serial0 = &serial0; + serial1 = &serial1; + serial2 = &serial2; + serial3 = &serial3; + i2c0 = &i2c0; + i2c1 = &i2c1; + i2c2 = &i2c2; + i2c3 = &i2c3; + i2c6 = &i2c6; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0 0x80000000 0 0xa0000000>; + }; +}; + +ðsc { + interrupts = <0 52 4>; +}; + +&serial0 { + status = "okay"; +}; + +&i2c0 { + status = "okay"; +}; + +&i2c1 { + status = "okay"; +}; + +&i2c2 { + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; diff --git a/src/arm64/socionext/uniphier-pxs3.dtsi b/src/arm64/socionext/uniphier-pxs3.dtsi new file mode 100644 index 000000000000..384729fa740f --- /dev/null +++ b/src/arm64/socionext/uniphier-pxs3.dtsi @@ -0,0 +1,367 @@ +/* + * Device Tree Source for UniPhier PXs3 SoC + * + * Copyright (C) 2017 Socionext Inc. + * Author: Masahiro Yamada + * + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) + */ + +/memreserve/ 0x80000000 0x02000000; + +/ { + compatible = "socionext,uniphier-pxs3"; + #address-cells = <2>; + #size-cells = <2>; + interrupt-parent = <&gic>; + + cpus { + #address-cells = <2>; + #size-cells = <0>; + + cpu-map { + cluster0 { + core0 { + cpu = <&cpu0>; + }; + core1 { + cpu = <&cpu1>; + }; + core2 { + cpu = <&cpu2>; + }; + core3 { + cpu = <&cpu3>; + }; + }; + }; + + cpu0: cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0 0x000>; + clocks = <&sys_clk 33>; + enable-method = "psci"; + operating-points-v2 = <&cluster0_opp>; + }; + + cpu1: cpu@1 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0 0x001>; + clocks = <&sys_clk 33>; + enable-method = "psci"; + operating-points-v2 = <&cluster0_opp>; + }; + + cpu2: cpu@2 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0 0x002>; + clocks = <&sys_clk 33>; + enable-method = "psci"; + operating-points-v2 = <&cluster0_opp>; + }; + + cpu3: cpu@3 { + device_type = "cpu"; + compatible = "arm,cortex-a53", "arm,armv8"; + reg = <0 0x003>; + clocks = <&sys_clk 33>; + enable-method = "psci"; + operating-points-v2 = <&cluster0_opp>; + }; + }; + + cluster0_opp: opp_table { + compatible = "operating-points-v2"; + opp-shared; + + opp-250000000 { + opp-hz = /bits/ 64 <250000000>; + clock-latency-ns = <300>; + }; + opp-325000000 { + opp-hz = /bits/ 64 <325000000>; + clock-latency-ns = <300>; + }; + opp-500000000 { + opp-hz = /bits/ 64 <500000000>; + clock-latency-ns = <300>; + }; + opp-650000000 { + opp-hz = /bits/ 64 <650000000>; + clock-latency-ns = <300>; + }; + opp-666667000 { + opp-hz = /bits/ 64 <666667000>; + clock-latency-ns = <300>; + }; + opp-866667000 { + opp-hz = /bits/ 64 <866667000>; + clock-latency-ns = <300>; + }; + opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + clock-latency-ns = <300>; + }; + opp-1300000000 { + opp-hz = /bits/ 64 <1300000000>; + clock-latency-ns = <300>; + }; + }; + + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; + + clocks { + refclk: ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = <1 13 4>, + <1 14 4>, + <1 11 4>, + <1 10 4>; + }; + + soc@0 { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0 0xffffffff>; + + serial0: serial@54006800 { + compatible = "socionext,uniphier-uart"; + status = "disabled"; + reg = <0x54006800 0x40>; + interrupts = <0 33 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart0>; + clocks = <&peri_clk 0>; + }; + + serial1: serial@54006900 { + compatible = "socionext,uniphier-uart"; + status = "disabled"; + reg = <0x54006900 0x40>; + interrupts = <0 35 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart1>; + clocks = <&peri_clk 1>; + }; + + serial2: serial@54006a00 { + compatible = "socionext,uniphier-uart"; + status = "disabled"; + reg = <0x54006a00 0x40>; + interrupts = <0 37 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart2>; + clocks = <&peri_clk 2>; + }; + + serial3: serial@54006b00 { + compatible = "socionext,uniphier-uart"; + status = "disabled"; + reg = <0x54006b00 0x40>; + interrupts = <0 177 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_uart3>; + clocks = <&peri_clk 3>; + }; + + i2c0: i2c@58780000 { + compatible = "socionext,uniphier-fi2c"; + status = "disabled"; + reg = <0x58780000 0x80>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <0 41 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c0>; + clocks = <&peri_clk 4>; + clock-frequency = <100000>; + }; + + i2c1: i2c@58781000 { + compatible = "socionext,uniphier-fi2c"; + status = "disabled"; + reg = <0x58781000 0x80>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <0 42 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; + clocks = <&peri_clk 5>; + clock-frequency = <100000>; + }; + + i2c2: i2c@58782000 { + compatible = "socionext,uniphier-fi2c"; + status = "disabled"; + reg = <0x58782000 0x80>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <0 43 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c2>; + clocks = <&peri_clk 6>; + clock-frequency = <100000>; + }; + + i2c3: i2c@58783000 { + compatible = "socionext,uniphier-fi2c"; + status = "disabled"; + reg = <0x58783000 0x80>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <0 44 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c3>; + clocks = <&peri_clk 7>; + clock-frequency = <100000>; + }; + + /* chip-internal connection for HDMI */ + i2c6: i2c@58786000 { + compatible = "socionext,uniphier-fi2c"; + reg = <0x58786000 0x80>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <0 26 4>; + clocks = <&peri_clk 10>; + clock-frequency = <400000>; + }; + + system_bus: system-bus@58c00000 { + compatible = "socionext,uniphier-system-bus"; + status = "disabled"; + reg = <0x58c00000 0x400>; + #address-cells = <2>; + #size-cells = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_system_bus>; + }; + + smpctrl@59801000 { + compatible = "socionext,uniphier-smpctrl"; + reg = <0x59801000 0x400>; + }; + + sdctrl@59810000 { + compatible = "socionext,uniphier-pxs3-sdctrl", + "simple-mfd", "syscon"; + reg = <0x59810000 0x400>; + + sd_clk: clock { + compatible = "socionext,uniphier-pxs3-sd-clock"; + #clock-cells = <1>; + }; + + sd_rst: reset { + compatible = "socionext,uniphier-pxs3-sd-reset"; + #reset-cells = <1>; + }; + }; + + perictrl@59820000 { + compatible = "socionext,uniphier-pxs3-perictrl", + "simple-mfd", "syscon"; + reg = <0x59820000 0x200>; + + peri_clk: clock { + compatible = "socionext,uniphier-pxs3-peri-clock"; + #clock-cells = <1>; + }; + + peri_rst: reset { + compatible = "socionext,uniphier-pxs3-peri-reset"; + #reset-cells = <1>; + }; + }; + + emmc: sdhc@5a000000 { + compatible = "socionext,uniphier-sd4hc", "cdns,sd4hc"; + reg = <0x5a000000 0x400>; + interrupts = <0 78 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_emmc>; + clocks = <&sys_clk 4>; + bus-width = <8>; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + cdns,phy-input-delay-legacy = <4>; + cdns,phy-input-delay-mmc-highspeed = <2>; + cdns,phy-input-delay-mmc-ddr = <3>; + cdns,phy-dll-delay-sdclk = <21>; + cdns,phy-dll-delay-sdclk-hsmmc = <21>; + }; + + soc-glue@5f800000 { + compatible = "socionext,uniphier-pxs3-soc-glue", + "simple-mfd", "syscon"; + reg = <0x5f800000 0x2000>; + + pinctrl: pinctrl { + compatible = "socionext,uniphier-pxs3-pinctrl"; + }; + }; + + aidet: aidet@5fc20000 { + compatible = "socionext,uniphier-pxs3-aidet"; + reg = <0x5fc20000 0x200>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + gic: interrupt-controller@5fe00000 { + compatible = "arm,gic-v3"; + reg = <0x5fe00000 0x10000>, /* GICD */ + <0x5fe80000 0x80000>; /* GICR */ + interrupt-controller; + #interrupt-cells = <3>; + interrupts = <1 9 4>; + }; + + sysctrl@61840000 { + compatible = "socionext,uniphier-pxs3-sysctrl", + "simple-mfd", "syscon"; + reg = <0x61840000 0x10000>; + + sys_clk: clock { + compatible = "socionext,uniphier-pxs3-clock"; + #clock-cells = <1>; + }; + + sys_rst: reset { + compatible = "socionext,uniphier-pxs3-reset"; + #reset-cells = <1>; + }; + + watchdog { + compatible = "socionext,uniphier-wdt"; + }; + }; + + nand: nand@68000000 { + compatible = "socionext,uniphier-denali-nand-v5b"; + status = "disabled"; + reg-names = "nand_data", "denali_reg"; + reg = <0x68000000 0x20>, <0x68100000 0x1000>; + interrupts = <0 65 4>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_nand>; + clocks = <&sys_clk 2>; + }; + }; +}; + +#include "uniphier-pinctrl.dtsi" diff --git a/src/arm64/socionext/uniphier-ref-daughter.dtsi b/src/arm64/socionext/uniphier-ref-daughter.dtsi index 7a1c29b558d5..e66d999d9f5d 100644 --- a/src/arm64/socionext/uniphier-ref-daughter.dtsi +++ b/src/arm64/socionext/uniphier-ref-daughter.dtsi @@ -1,16 +1 @@ -/* - * Device Tree Source for UniPhier Reference Daughter Board - * - * Copyright (C) 2015-2017 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: (GPL-2.0+ OR MIT) - */ - -&i2c0 { - eeprom@50 { - compatible = "microchip,24lc128"; - reg = <0x50>; - pagesize = <64>; - }; -}; +#include diff --git a/src/arm64/socionext/uniphier-support-card.dtsi b/src/arm64/socionext/uniphier-support-card.dtsi index 6c825f192e65..28c5b4ed1d95 100644 --- a/src/arm64/socionext/uniphier-support-card.dtsi +++ b/src/arm64/socionext/uniphier-support-card.dtsi @@ -1,34 +1 @@ -/* - * Device Tree Source for UniPhier Support Card (Expansion Board) - * - * Copyright (C) 2015-2017 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: (GPL-2.0+ OR MIT) - */ - -&system_bus { - status = "okay"; - ranges = <1 0x00000000 0x42000000 0x02000000>; - - support_card: support_card@1,1f00000 { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x00000000 1 0x01f00000 0x00100000>; - - ethsc: ethernet@0 { - compatible = "smsc,lan9118", "smsc,lan9115"; - reg = <0x00000000 0x1000>; - phy-mode = "mii"; - reg-io-width = <4>; - }; - - serialsc: uart@b0000 { - compatible = "ns16550a"; - reg = <0x000b0000 0x20>; - clock-frequency = <12288000>; - reg-shift = <1>; - }; - }; -}; +#include diff --git a/src/arm64/xilinx/zynqmp-ep108-clk.dtsi b/src/arm64/xilinx/zynqmp-ep108-clk.dtsi index cdc6a437dcc7..b87b8316f4ac 100644 --- a/src/arm64/xilinx/zynqmp-ep108-clk.dtsi +++ b/src/arm64/xilinx/zynqmp-ep108-clk.dtsi @@ -11,7 +11,7 @@ * the License, or (at your option) any later version. */ -&amba { +/ { misc_clk: misc_clk { compatible = "fixed-clock"; #clock-cells = <0>; @@ -29,12 +29,60 @@ #clock-cells = <0>; clock-frequency = <75000000>; }; + + clk100: clk100 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk600: clk600 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <600000000>; + }; }; &can0 { clocks = <&misc_clk &misc_clk>; }; +&can1 { + clocks = <&misc_clk &misc_clk>; +}; + +&fpd_dma_chan1 { + clocks = <&clk600>, <&clk100>; +}; + +&fpd_dma_chan2 { + clocks = <&clk600>, <&clk100>; +}; + +&fpd_dma_chan3 { + clocks = <&clk600>, <&clk100>; +}; + +&fpd_dma_chan4 { + clocks = <&clk600>, <&clk100>; +}; + +&fpd_dma_chan5 { + clocks = <&clk600>, <&clk100>; +}; + +&fpd_dma_chan6 { + clocks = <&clk600>, <&clk100>; +}; + +&fpd_dma_chan7 { + clocks = <&clk600>, <&clk100>; +}; + +&fpd_dma_chan8 { + clocks = <&clk600>, <&clk100>; +}; + &gem0 { clocks = <&misc_clk>, <&misc_clk>, <&misc_clk>; }; diff --git a/src/arm64/xilinx/zynqmp-ep108.dts b/src/arm64/xilinx/zynqmp-ep108.dts index ef1b9e573af0..bf552674a834 100644 --- a/src/arm64/xilinx/zynqmp-ep108.dts +++ b/src/arm64/xilinx/zynqmp-ep108.dts @@ -13,13 +13,15 @@ /dts-v1/; -/include/ "zynqmp.dtsi" -/include/ "zynqmp-ep108-clk.dtsi" +#include "zynqmp.dtsi" +#include "zynqmp-ep108-clk.dtsi" / { model = "ZynqMP EP108"; aliases { + mmc0 = &sdhci0; + mmc1 = &sdhci1; serial0 = &uart0; }; @@ -37,6 +39,10 @@ status = "okay"; }; +&can1 { + status = "okay"; +}; + &gem0 { status = "okay"; phy-handle = <&phy0>; @@ -55,7 +61,7 @@ status = "okay"; clock-frequency = <400000>; eeprom@54 { - compatible = "at,24c64"; + compatible = "atmel,24c64"; reg = <0x54>; }; }; @@ -64,7 +70,7 @@ status = "okay"; clock-frequency = <400000>; eeprom@55 { - compatible = "at,24c64"; + compatible = "atmel,24c64"; reg = <0x55>; }; }; @@ -92,7 +98,7 @@ spi-max-frequency = <50000000>; reg = <0>; - spi0_flash0@00000000 { + spi0_flash0@0 { label = "spi0_flash0"; reg = <0x0 0x100000>; }; @@ -109,7 +115,7 @@ spi-max-frequency = <50000000>; reg = <0>; - spi1_flash0@00000000 { + spi1_flash0@0 { label = "spi1_flash0"; reg = <0x0 0x100000>; }; diff --git a/src/arm64/xilinx/zynqmp.dtsi b/src/arm64/xilinx/zynqmp.dtsi index 54dc28351c8c..7665fbddff28 100644 --- a/src/arm64/xilinx/zynqmp.dtsi +++ b/src/arm64/xilinx/zynqmp.dtsi @@ -20,33 +20,84 @@ #address-cells = <1>; #size-cells = <0>; - cpu@0 { + cpu0: cpu@0 { compatible = "arm,cortex-a53", "arm,armv8"; device_type = "cpu"; enable-method = "psci"; + operating-points-v2 = <&cpu_opp_table>; reg = <0x0>; + cpu-idle-states = <&CPU_SLEEP_0>; }; - cpu@1 { + cpu1: cpu@1 { compatible = "arm,cortex-a53", "arm,armv8"; device_type = "cpu"; enable-method = "psci"; reg = <0x1>; + operating-points-v2 = <&cpu_opp_table>; + cpu-idle-states = <&CPU_SLEEP_0>; }; - cpu@2 { + cpu2: cpu@2 { compatible = "arm,cortex-a53", "arm,armv8"; device_type = "cpu"; enable-method = "psci"; reg = <0x2>; + operating-points-v2 = <&cpu_opp_table>; + cpu-idle-states = <&CPU_SLEEP_0>; }; - cpu@3 { + cpu3: cpu@3 { compatible = "arm,cortex-a53", "arm,armv8"; device_type = "cpu"; enable-method = "psci"; reg = <0x3>; + operating-points-v2 = <&cpu_opp_table>; + cpu-idle-states = <&CPU_SLEEP_0>; }; + + idle-states { + entry-method = "arm,psci"; + + CPU_SLEEP_0: cpu-sleep-0 { + compatible = "arm,idle-state"; + arm,psci-suspend-param = <0x40000000>; + local-timer-stop; + entry-latency-us = <300>; + exit-latency-us = <600>; + min-residency-us = <10000>; + }; + }; + }; + + cpu_opp_table: cpu_opp_table { + compatible = "operating-points-v2"; + opp-shared; + opp00 { + opp-hz = /bits/ 64 <1199999988>; + opp-microvolt = <1000000>; + clock-latency-ns = <500000>; + }; + opp01 { + opp-hz = /bits/ 64 <599999994>; + opp-microvolt = <1000000>; + clock-latency-ns = <500000>; + }; + opp02 { + opp-hz = /bits/ 64 <399999996>; + opp-microvolt = <1000000>; + clock-latency-ns = <500000>; + }; + opp03 { + opp-hz = /bits/ 64 <299999997>; + opp-microvolt = <1000000>; + clock-latency-ns = <500000>; + }; + }; + + dcc: dcc { + compatible = "arm,dcc"; + status = "disabled"; }; pmu { @@ -119,6 +170,190 @@ rx-fifo-depth = <0x40>; }; + cci: cci@fd6e0000 { + compatible = "arm,cci-400"; + reg = <0x0 0xfd6e0000 0x0 0x9000>; + ranges = <0x0 0x0 0xfd6e0000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + + pmu@9000 { + compatible = "arm,cci-400-pmu,r1"; + reg = <0x9000 0x5000>; + interrupt-parent = <&gic>; + interrupts = <0 123 4>, + <0 123 4>, + <0 123 4>, + <0 123 4>, + <0 123 4>; + }; + }; + + /* GDMA */ + fpd_dma_chan1: dma@fd500000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xfd500000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 124 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <128>; + }; + + fpd_dma_chan2: dma@fd510000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xfd510000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 125 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <128>; + }; + + fpd_dma_chan3: dma@fd520000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xfd520000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 126 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <128>; + }; + + fpd_dma_chan4: dma@fd530000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xfd530000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 127 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <128>; + }; + + fpd_dma_chan5: dma@fd540000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xfd540000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 128 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <128>; + }; + + fpd_dma_chan6: dma@fd550000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xfd550000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 129 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <128>; + }; + + fpd_dma_chan7: dma@fd560000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xfd560000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 130 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <128>; + }; + + fpd_dma_chan8: dma@fd570000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xfd570000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 131 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <128>; + }; + + /* LPDDMA default allows only secured access. inorder to enable + * These dma channels, Users should ensure that these dma + * Channels are allowed for non secure access. + */ + lpd_dma_chan1: dma@ffa80000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xffa80000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 77 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <64>; + }; + + lpd_dma_chan2: dma@ffa90000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xffa90000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 78 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <64>; + }; + + lpd_dma_chan3: dma@ffaa0000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xffaa0000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 79 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <64>; + }; + + lpd_dma_chan4: dma@ffab0000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xffab0000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 80 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <64>; + }; + + lpd_dma_chan5: dma@ffac0000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xffac0000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 81 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <64>; + }; + + lpd_dma_chan6: dma@ffad0000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xffad0000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 82 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <64>; + }; + + lpd_dma_chan7: dma@ffae0000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xffae0000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 83 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <64>; + }; + + lpd_dma_chan8: dma@ffaf0000 { + status = "disabled"; + compatible = "xlnx,zynqmp-dma-1.0"; + reg = <0x0 0xffaf0000 0x0 0x1000>; + interrupt-parent = <&gic>; + interrupts = <0 84 4>; + clock-names = "clk_main", "clk_apb"; + xlnx,bus-width = <64>; + }; + gem0: ethernet@ff0b0000 { compatible = "cdns,gem"; status = "disabled"; @@ -215,12 +450,9 @@ <0x0 0xfd480000 0x0 0x1000>, <0x80 0x00000000 0x0 0x1000000>; reg-names = "breg", "pcireg", "cfg"; - ranges = <0x02000000 0x00000000 0xe0000000 0x00000000 - 0xe0000000 0x00000000 0x10000000 - /* non-prefetchable memory */ - 0x43000000 0x00000006 0x00000000 0x00000006 - 0x00000000 0x00000002 0x00000000>; - /* prefetchable memory */ + ranges = <0x02000000 0x00000000 0xe0000000 0x00000000 0xe0000000 0x00000000 0x10000000 /* non-prefetchable memory */ + 0x43000000 0x00000006 0x00000000 0x00000006 0x00000000 0x00000002 0x00000000>;/* prefetchable memory */ + bus-range = <0x00 0xff>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; interrupt-map = <0x0 0x0 0x0 0x1 &pcie_intc 0x1>, <0x0 0x0 0x0 0x2 &pcie_intc 0x2>, @@ -233,6 +465,16 @@ }; }; + rtc: rtc@ffa60000 { + compatible = "xlnx,zynqmp-rtc"; + status = "disabled"; + reg = <0x0 0xffa60000 0x0 0x100>; + interrupt-parent = <&gic>; + interrupts = <0 26 4>, <0 27 4>; + interrupt-names = "alarm", "sec"; + calibration = <0x8000>; + }; + sata: ahci@fd0c0000 { compatible = "ceva,ahci-1v84"; status = "disabled"; @@ -262,13 +504,14 @@ smmu: smmu@fd800000 { compatible = "arm,mmu-500"; reg = <0x0 0xfd800000 0x0 0x20000>; + status = "disabled"; #global-interrupts = <1>; interrupt-parent = <&gic>; - interrupts = <0 157 4>, - <0 157 4>, <0 157 4>, <0 157 4>, <0 157 4>, - <0 157 4>, <0 157 4>, <0 157 4>, <0 157 4>, - <0 157 4>, <0 157 4>, <0 157 4>, <0 157 4>, - <0 157 4>, <0 157 4>, <0 157 4>, <0 157 4>; + interrupts = <0 155 4>, + <0 155 4>, <0 155 4>, <0 155 4>, <0 155 4>, + <0 155 4>, <0 155 4>, <0 155 4>, <0 155 4>, + <0 155 4>, <0 155 4>, <0 155 4>, <0 155 4>, + <0 155 4>, <0 155 4>, <0 155 4>, <0 155 4>; }; spi0: spi@ff040000 { @@ -330,7 +573,7 @@ }; uart0: serial@ff000000 { - compatible = "cdns,uart-r1p8"; + compatible = "cdns,uart-r1p12", "xlnx,xuartps"; status = "disabled"; interrupt-parent = <&gic>; interrupts = <0 21 4>; @@ -339,7 +582,7 @@ }; uart1: serial@ff010000 { - compatible = "cdns,uart-r1p8"; + compatible = "cdns,uart-r1p12", "xlnx,xuartps"; status = "disabled"; interrupt-parent = <&gic>; interrupts = <0 22 4>; diff --git a/src/arm64/zte/zx296718-evb.dts b/src/arm64/zte/zx296718-evb.dts index bb900d2bbcfb..cb2519ecd724 100644 --- a/src/arm64/zte/zx296718-evb.dts +++ b/src/arm64/zte/zx296718-evb.dts @@ -57,16 +57,28 @@ reg = <0x40000000 0x40000000>; }; - sound0 { - compatible = "simple-audio-card"; - simple-audio-card,name = "zx_snd_spdif0"; + sound-spdif0 { + compatible = "audio-graph-card"; + dais = <&spdif0_port>; + }; - simple-audio-card,cpu { - sound-dai = <&spdif0>; - }; + sound-i2s0 { + compatible = "audio-graph-card"; + dais = <&i2s0_port>; + pinctrl-names = "default"; + pinctrl-0 = <&lifier_pins>; + pa-gpios = <&bgpio4 0 GPIO_ACTIVE_HIGH>; + widgets = "Line", "Line Out Jack"; + routing = "Amplifier", "LINEOUTL", + "Amplifier", "LINEOUTR", + "Line Out Jack", "Amplifier"; + }; +}; - simple-audio-card,codec { - sound-dai = <&hdmi>; +&aud96p22 { + port { + aud96p22_endpoint: endpoint { + remote-endpoint = <&i2s0_endpoint>; }; }; }; @@ -77,6 +89,36 @@ &hdmi { status = "okay"; + + port { + hdmi_endpoint: endpoint { + remote-endpoint = <&spdif0_endpoint>; + }; + }; +}; + +&i2c0 { + status = "okay"; +}; + +&i2s0 { + status = "okay"; + + i2s0_port: port { + i2s0_endpoint: endpoint { + remote-endpoint = <&aud96p22_endpoint>; + dai-format = "i2s"; + frame-master; + bitclock-master; + }; + }; +}; + +&pmm { + amplifier_pins: amplifier { + pins = "TSI3_DATA"; + function = "BGPIO"; + }; }; &sd1 { @@ -85,6 +127,16 @@ &spdif0 { status = "okay"; + + spdif0_port: port { + spdif0_endpoint: endpoint { + remote-endpoint = <&hdmi_endpoint>; + }; + }; +}; + +&tvenc { + status = "okay"; }; &uart0 { diff --git a/src/arm64/zte/zx296718-pcbox.dts b/src/arm64/zte/zx296718-pcbox.dts new file mode 100644 index 000000000000..e02509f7082b --- /dev/null +++ b/src/arm64/zte/zx296718-pcbox.dts @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2017 Sanechips Technology Co., Ltd. + * Copyright 2017 Linaro Ltd. + * + * SPDX-License-Identifier: (GPL-2.0+ OR MIT) + */ + +/dts-v1/; +#include "zx296718.dtsi" +#include + +/ { + model = "ZTE ZX296718 PCBOX Board"; + compatible = "zte,zx296718-pcbox", "zte,zx296718"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; + + a53_vdd0v9: regulator-a53 { + compatible = "pwm-regulator"; + pwms = <&pwm 3 1250 PWM_POLARITY_INVERTED>; + regulator-name = "A53_VDD0V9"; + regulator-min-microvolt = <855000>; + regulator-max-microvolt = <1183000>; + pwm-dutycycle-unit = <100>; + pwm-dutycycle-range = <0 100>; + regulator-always-on; + regulator-boot-on; + }; + + sound-spdif0 { + compatible = "audio-graph-card"; + dais = <&spdif0_port>; + }; + + sound-i2s0 { + compatible = "audio-graph-card"; + dais = <&i2s0_port>; + }; +}; + +&aud96p22 { + port { + aud96p22_endpoint: endpoint { + remote-endpoint = <&i2s0_endpoint>; + }; + }; +}; + +&cpu0 { + cpu-supply = <&a53_vdd0v9>; +}; + +&emmc { + status = "okay"; +}; + +&hdmi { + status = "disabled"; + + port { + hdmi_endpoint: endpoint { + remote-endpoint = <&spdif0_endpoint>; + }; + }; +}; + +&i2c0 { + status = "okay"; +}; + +&i2s0 { + status = "okay"; + + i2s0_port: port { + i2s0_endpoint: endpoint { + remote-endpoint = <&aud96p22_endpoint>; + dai-format = "i2s"; + frame-master; + bitclock-master; + }; + }; +}; + +&irdec { + status = "okay"; +}; + +&pmm { + pwm3_pins: pwm3 { + pins = "KEY_ROW2"; + function = "PWM"; + }; + + vga_pins: vga { + pins = "KEY_COL1", "KEY_COL2", "VGA_HS", "VGA_VS"; + function = "VGA"; + }; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm3_pins>; + status = "okay"; +}; + +&sd0 { + status = "okay"; +}; + +&sd1 { + status = "okay"; +}; + +&spdif0 { + status = "okay"; + + spdif0_port: port { + spdif0_endpoint: endpoint { + remote-endpoint = <&hdmi_endpoint>; + }; + }; +}; + +&tvenc { + status = "disabled"; +}; + +&uart0 { + status = "okay"; +}; + +&vga { + pinctrl-names = "default"; + pinctrl-0 = <&vga_pins>; + status = "okay"; +}; diff --git a/src/arm64/zte/zx296718.dtsi b/src/arm64/zte/zx296718.dtsi index d83bf789c864..6eef64761009 100644 --- a/src/arm64/zte/zx296718.dtsi +++ b/src/arm64/zte/zx296718.dtsi @@ -53,6 +53,13 @@ interrupt-parent = <&gic>; aliases { + gpio0 = &bgpio0; + gpio1 = &bgpio1; + gpio2 = &bgpio2; + gpio3 = &bgpio3; + gpio4 = &bgpio4; + gpio5 = &bgpio5; + gpio6 = &bgpio6; serial0 = &uart0; }; @@ -120,26 +127,31 @@ opp-500000000 { opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <866000>; clock-latency-ns = <500000>; }; opp-648000000 { opp-hz = /bits/ 64 <648000000>; + opp-microvolt = <866000>; clock-latency-ns = <500000>; }; opp-800000000 { opp-hz = /bits/ 64 <800000000>; + opp-microvolt = <888000>; clock-latency-ns = <500000>; }; opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <898000>; clock-latency-ns = <500000>; }; opp-1188000000 { opp-hz = /bits/ 64 <1188000000>; + opp-microvolt = <1015000>; clock-latency-ns = <500000>; }; }; @@ -283,11 +295,23 @@ compatible = "simple-bus"; ranges; + irdec: ir-decoder@111000 { + compatible = "zte,zx296718-irdec"; + reg = <0x111000 0x1000>; + interrupts = ; + status = "disabled"; + }; + aon_sysctrl: aon-sysctrl@116000 { compatible = "zte,zx296718-aon-sysctrl", "syscon"; reg = <0x116000 0x1000>; }; + iocfg: pin-controller@119000 { + compatible = "zte,zx296718-iocfg"; + reg = <0x119000 0x1000>; + }; + uart0: uart@11f000 { compatible = "arm,pl011", "arm,primecell"; arm,primecell-periphid = <0x001feffe>; @@ -311,7 +335,6 @@ clock-frequency = <50000000>; clocks = <&topcrm SD0_AHB>, <&topcrm SD0_WCLK>; clock-names = "biu", "ciu"; - num-slots = <1>; max-frequency = <50000000>; cap-sdio-irq; cap-sd-highspeed; @@ -336,7 +359,6 @@ clock-frequency = <167000000>; clocks = <&topcrm SD1_AHB>, <&topcrm SD1_WCLK>; clock-names = "biu", "ciu"; - num-slots = <1>; max-frequency = <167000000>; cap-sdio-irq; cap-sd-highspeed; @@ -360,12 +382,109 @@ #clock-cells = <1>; }; + bgpio0: gpio@142d000 { + compatible = "zte,zx296718-gpio", "zte,zx296702-gpio"; + reg = <0x142d000 0x40>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pmm 0 48 16>; + interrupts = ; + interrupt-parent = <&gic>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + bgpio1: gpio@142d040 { + compatible = "zte,zx296718-gpio", "zte,zx296702-gpio"; + reg = <0x142d040 0x40>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pmm 0 80 16>; + interrupts = ; + interrupt-parent = <&gic>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + bgpio2: gpio@142d080 { + compatible = "zte,zx296718-gpio", "zte,zx296702-gpio"; + reg = <0x142d080 0x40>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pmm 0 80 3 + &pmm 3 32 4 + &pmm 7 83 9>; + interrupts = ; + interrupt-parent = <&gic>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + bgpio3: gpio@142d0c0 { + compatible = "zte,zx296718-gpio", "zte,zx296702-gpio"; + reg = <0x142d0c0 0x40>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pmm 0 92 16>; + interrupts = ; + interrupt-parent = <&gic>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + bgpio4: gpio@142d100 { + compatible = "zte,zx296718-gpio", "zte,zx296702-gpio"; + reg = <0x142d100 0x40>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pmm 0 108 12 + &pmm 12 121 4>; + interrupts = ; + interrupt-parent = <&gic>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + bgpio5: gpio@142d140 { + compatible = "zte,zx296718-gpio", "zte,zx296702-gpio"; + reg = <0x142d140 0x40>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pmm 0 125 16>; + interrupts = ; + interrupt-parent = <&gic>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + bgpio6: gpio@142d180 { + compatible = "zte,zx296718-gpio", "zte,zx296702-gpio"; + reg = <0x142d180 0x40>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pmm 0 141 2>; + interrupts = ; + interrupt-parent = <&gic>; + interrupt-controller; + #interrupt-cells = <2>; + }; + lsp1crm: clock-controller@1430000 { compatible = "zte,zx296718-lsp1crm"; reg = <0x01430000 0x1000>; #clock-cells = <1>; }; + pwm: pwm@1439000 { + compatible = "zte,zx296718-pwm"; + reg = <0x1439000 0x1000>; + clocks = <&lsp1crm LSP1_PWM_PCLK>, + <&lsp1crm LSP1_PWM_WCLK>; + clock-names = "pclk", "wclk"; + #pwm-cells = <3>; + status = "disabled"; + }; + vou: vou@1440000 { compatible = "zte,zx296718-vou"; #address-cells = <1>; @@ -387,6 +506,16 @@ "main_wclk", "aux_wclk"; }; + vga: vga@8000 { + compatible = "zte,zx296718-vga"; + reg = <0x8000 0x1000>; + interrupts = ; + clocks = <&topcrm VGA_I2C_WCLK>; + clock-names = "i2c_wclk"; + zte,vga-power-control = <&sysctrl 0x170 0xe0>; + status = "disabled"; + }; + hdmi: hdmi@c000 { compatible = "zte,zx296718-hdmi"; reg = <0xc000 0x4000>; @@ -413,6 +542,12 @@ #clock-cells = <1>; }; + pmm: pin-controller@1462000 { + compatible = "zte,zx296718-pmm"; + reg = <0x1462000 0x1000>; + zte,auxiliary-controller = <&iocfg>; + }; + sysctrl: sysctrl@1463000 { compatible = "zte,zx296718-sysctrl", "syscon"; reg = <0x1463000 0x1000>; @@ -445,6 +580,38 @@ #clock-cells = <1>; }; + i2s0: i2s@1482000 { + compatible = "zte,zx296718-i2s", "zte,zx296702-i2s"; + reg = <0x01482000 0x1000>; + clocks = <&audiocrm AUDIO_I2S0_WCLK>, + <&audiocrm AUDIO_I2S0_PCLK>; + clock-names = "wclk", "pclk"; + assigned-clocks = <&audiocrm I2S0_WCLK_MUX>; + assigned-clock-parents = <&topcrm AUDIO_99M>; + interrupts = ; + dmas = <&dma 22>, <&dma 23>; + dma-names = "tx", "rx"; + #sound-dai-cells = <0>; + status = "disabled"; + }; + + i2c0: i2c@1486000 { + compatible = "zte,zx296718-i2c"; + reg = <0x01486000 0x1000>; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&audiocrm AUDIO_I2C0_WCLK>; + clock-frequency = <1600000>; + status = "disabled"; + + aud96p22: codec@22 { + compatible = "zte,zx-aud96p22"; + #sound-dai-cells = <0>; + reg = <0x22>; + }; + }; + spdif0: spdif@1488000 { compatible = "zte,zx296702-spdif"; reg = <0x1488000 0x1000>; diff --git a/src/c6x/tms320c6455.dtsi b/src/c6x/tms320c6455.dtsi index a804ec1e018b..0b21cb30343b 100644 --- a/src/c6x/tms320c6455.dtsi +++ b/src/c6x/tms320c6455.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; diff --git a/src/c6x/tms320c6457.dtsi b/src/c6x/tms320c6457.dtsi index 35f40709a719..e49f7ae19124 100644 --- a/src/c6x/tms320c6457.dtsi +++ b/src/c6x/tms320c6457.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; diff --git a/src/c6x/tms320c6472.dtsi b/src/c6x/tms320c6472.dtsi index b488aaec65c0..9dd4b04e78ef 100644 --- a/src/c6x/tms320c6472.dtsi +++ b/src/c6x/tms320c6472.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; diff --git a/src/c6x/tms320c6474.dtsi b/src/c6x/tms320c6474.dtsi index cc601bf348a1..0ef5333629a6 100644 --- a/src/c6x/tms320c6474.dtsi +++ b/src/c6x/tms320c6474.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; diff --git a/src/c6x/tms320c6678.dtsi b/src/c6x/tms320c6678.dtsi index 386196e5eae7..da1e3f2bf062 100644 --- a/src/c6x/tms320c6678.dtsi +++ b/src/c6x/tms320c6678.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; diff --git a/src/cris/artpec3.dtsi b/src/cris/artpec3.dtsi index be15be67b653..f857300f4edd 100644 --- a/src/cris/artpec3.dtsi +++ b/src/cris/artpec3.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/cris/dev88.dts b/src/cris/dev88.dts index b9a230d10874..415270ea5309 100644 --- a/src/cris/dev88.dts +++ b/src/cris/dev88.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/cris/etraxfs.dtsi b/src/cris/etraxfs.dtsi index bf1b8582d4d8..4513edf72545 100644 --- a/src/cris/etraxfs.dtsi +++ b/src/cris/etraxfs.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/cris/p1343.dts b/src/cris/p1343.dts index fab7bdbd0f15..6030561d4574 100644 --- a/src/cris/p1343.dts +++ b/src/cris/p1343.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/h8300/edosk2674.dts b/src/h8300/edosk2674.dts index 6ae884bf66a5..d1733805ea67 100644 --- a/src/h8300/edosk2674.dts +++ b/src/h8300/edosk2674.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; / { compatible = "renesas,edosk2674"; diff --git a/src/h8300/h8300h_sim.dts b/src/h8300/h8300h_sim.dts index 9c733d920f1f..f1c31cecdec8 100644 --- a/src/h8300/h8300h_sim.dts +++ b/src/h8300/h8300h_sim.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; / { compatible = "gnu,gdbsim"; diff --git a/src/h8300/h8s_sim.dts b/src/h8300/h8s_sim.dts index 97e1f4b17ef0..932cc3c5a81b 100644 --- a/src/h8300/h8s_sim.dts +++ b/src/h8300/h8s_sim.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; / { compatible = "gnu,gdbsim"; diff --git a/src/metag/skeleton.dtsi b/src/metag/skeleton.dtsi index 78229eacced7..43e2ffe73c27 100644 --- a/src/metag/skeleton.dtsi +++ b/src/metag/skeleton.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Skeleton device tree; the bare minimum needed to boot; just include and * add a compatible value. The bootloader will typically populate the memory diff --git a/src/mips/brcm/bcm3368-netgear-cvg834g.dts b/src/mips/brcm/bcm3368-netgear-cvg834g.dts index 2f2e80fdcde8..ed6023a91763 100644 --- a/src/mips/brcm/bcm3368-netgear-cvg834g.dts +++ b/src/mips/brcm/bcm3368-netgear-cvg834g.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm3368.dtsi" diff --git a/src/mips/brcm/bcm3368.dtsi b/src/mips/brcm/bcm3368.dtsi index bee855cb8073..277cde02b744 100644 --- a/src/mips/brcm/bcm3368.dtsi +++ b/src/mips/brcm/bcm3368.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm3384_viper.dtsi b/src/mips/brcm/bcm3384_viper.dtsi index aa406b43c65f..eb2a9c6ed604 100644 --- a/src/mips/brcm/bcm3384_viper.dtsi +++ b/src/mips/brcm/bcm3384_viper.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm3384_zephyr.dtsi b/src/mips/brcm/bcm3384_zephyr.dtsi index a7bd8564e9f6..d7ad769a42fc 100644 --- a/src/mips/brcm/bcm3384_zephyr.dtsi +++ b/src/mips/brcm/bcm3384_zephyr.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm63268-comtrend-vr-3032u.dts b/src/mips/brcm/bcm63268-comtrend-vr-3032u.dts index 430d35ca33d5..2bc0d8401ad6 100644 --- a/src/mips/brcm/bcm63268-comtrend-vr-3032u.dts +++ b/src/mips/brcm/bcm63268-comtrend-vr-3032u.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm63268.dtsi" diff --git a/src/mips/brcm/bcm63268.dtsi b/src/mips/brcm/bcm63268.dtsi index 7e6bf2cc0287..3b09f44e67fb 100644 --- a/src/mips/brcm/bcm63268.dtsi +++ b/src/mips/brcm/bcm63268.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm6328.dtsi b/src/mips/brcm/bcm6328.dtsi index 5633b9d90f55..644486fe4159 100644 --- a/src/mips/brcm/bcm6328.dtsi +++ b/src/mips/brcm/bcm6328.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm6358-neufbox4-sercomm.dts b/src/mips/brcm/bcm6358-neufbox4-sercomm.dts index 702eae2a22a0..5e62190aa3d5 100644 --- a/src/mips/brcm/bcm6358-neufbox4-sercomm.dts +++ b/src/mips/brcm/bcm6358-neufbox4-sercomm.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm6358.dtsi" diff --git a/src/mips/brcm/bcm6358.dtsi b/src/mips/brcm/bcm6358.dtsi index f9d8d392162b..682df7fb7069 100644 --- a/src/mips/brcm/bcm6358.dtsi +++ b/src/mips/brcm/bcm6358.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm6362-neufbox6-sercomm.dts b/src/mips/brcm/bcm6362-neufbox6-sercomm.dts index 480f2a5bf1da..3e83bee5b91e 100644 --- a/src/mips/brcm/bcm6362-neufbox6-sercomm.dts +++ b/src/mips/brcm/bcm6362-neufbox6-sercomm.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm6362.dtsi" diff --git a/src/mips/brcm/bcm6362.dtsi b/src/mips/brcm/bcm6362.dtsi index c507da594f2f..a82a5e5de672 100644 --- a/src/mips/brcm/bcm6362.dtsi +++ b/src/mips/brcm/bcm6362.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm6368.dtsi b/src/mips/brcm/bcm6368.dtsi index d0e3a70b32e2..7a72f59ae457 100644 --- a/src/mips/brcm/bcm6368.dtsi +++ b/src/mips/brcm/bcm6368.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm7125.dtsi b/src/mips/brcm/bcm7125.dtsi index 79f838ed96c5..2f9ef565e5d0 100644 --- a/src/mips/brcm/bcm7125.dtsi +++ b/src/mips/brcm/bcm7125.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm7346.dtsi b/src/mips/brcm/bcm7346.dtsi index da7bfa45a57d..02e426fe6013 100644 --- a/src/mips/brcm/bcm7346.dtsi +++ b/src/mips/brcm/bcm7346.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm7358.dtsi b/src/mips/brcm/bcm7358.dtsi index 9b05760453f0..1089d6ebc841 100644 --- a/src/mips/brcm/bcm7358.dtsi +++ b/src/mips/brcm/bcm7358.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm7360.dtsi b/src/mips/brcm/bcm7360.dtsi index 57b613c6acf2..4b87ebec407a 100644 --- a/src/mips/brcm/bcm7360.dtsi +++ b/src/mips/brcm/bcm7360.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm7362.dtsi b/src/mips/brcm/bcm7362.dtsi index c2a2843aaa9a..ca657df34b6d 100644 --- a/src/mips/brcm/bcm7362.dtsi +++ b/src/mips/brcm/bcm7362.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm7420.dtsi b/src/mips/brcm/bcm7420.dtsi index 532fc8a15796..d262e11bc3f9 100644 --- a/src/mips/brcm/bcm7420.dtsi +++ b/src/mips/brcm/bcm7420.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm7425.dtsi b/src/mips/brcm/bcm7425.dtsi index f56fb25f2e6b..e4fb9b6e6dce 100644 --- a/src/mips/brcm/bcm7425.dtsi +++ b/src/mips/brcm/bcm7425.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm7435.dtsi b/src/mips/brcm/bcm7435.dtsi index f2cead2eae5c..1484e8990e52 100644 --- a/src/mips/brcm/bcm7435.dtsi +++ b/src/mips/brcm/bcm7435.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/brcm/bcm93384wvg.dts b/src/mips/brcm/bcm93384wvg.dts index d1e44a17d41a..601e4d9293ab 100644 --- a/src/mips/brcm/bcm93384wvg.dts +++ b/src/mips/brcm/bcm93384wvg.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm3384_zephyr.dtsi" diff --git a/src/mips/brcm/bcm93384wvg_viper.dts b/src/mips/brcm/bcm93384wvg_viper.dts index 1ecb2696aca8..938a8e66128c 100644 --- a/src/mips/brcm/bcm93384wvg_viper.dts +++ b/src/mips/brcm/bcm93384wvg_viper.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm3384_viper.dtsi" diff --git a/src/mips/brcm/bcm96368mvwg.dts b/src/mips/brcm/bcm96368mvwg.dts index 8c71c6845730..6d772c394e41 100644 --- a/src/mips/brcm/bcm96368mvwg.dts +++ b/src/mips/brcm/bcm96368mvwg.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm6368.dtsi" diff --git a/src/mips/brcm/bcm97125cbmb.dts b/src/mips/brcm/bcm97125cbmb.dts index d72bc423ceaa..7f59ea2ded6c 100644 --- a/src/mips/brcm/bcm97125cbmb.dts +++ b/src/mips/brcm/bcm97125cbmb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm7125.dtsi" diff --git a/src/mips/brcm/bcm97346dbsmb.dts b/src/mips/brcm/bcm97346dbsmb.dts index ea52d7b5772f..9e7d5228f2b7 100644 --- a/src/mips/brcm/bcm97346dbsmb.dts +++ b/src/mips/brcm/bcm97346dbsmb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm7346.dtsi" diff --git a/src/mips/brcm/bcm97358svmb.dts b/src/mips/brcm/bcm97358svmb.dts index 71357fdc19af..708207a0002d 100644 --- a/src/mips/brcm/bcm97358svmb.dts +++ b/src/mips/brcm/bcm97358svmb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm7358.dtsi" diff --git a/src/mips/brcm/bcm97360svmb.dts b/src/mips/brcm/bcm97360svmb.dts index e2fed406c6ee..73c6dc9c8c6d 100644 --- a/src/mips/brcm/bcm97360svmb.dts +++ b/src/mips/brcm/bcm97360svmb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm7360.dtsi" diff --git a/src/mips/brcm/bcm97362svmb.dts b/src/mips/brcm/bcm97362svmb.dts index 78bffdf11872..37bacfdcf9d9 100644 --- a/src/mips/brcm/bcm97362svmb.dts +++ b/src/mips/brcm/bcm97362svmb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm7362.dtsi" diff --git a/src/mips/brcm/bcm97420c.dts b/src/mips/brcm/bcm97420c.dts index d62b448a152d..f96241e94874 100644 --- a/src/mips/brcm/bcm97420c.dts +++ b/src/mips/brcm/bcm97420c.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm7420.dtsi" diff --git a/src/mips/brcm/bcm97425svmb.dts b/src/mips/brcm/bcm97425svmb.dts index 73aa006bd9ce..ce762c7b2e54 100644 --- a/src/mips/brcm/bcm97425svmb.dts +++ b/src/mips/brcm/bcm97425svmb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm7425.dtsi" diff --git a/src/mips/brcm/bcm97435svmb.dts b/src/mips/brcm/bcm97435svmb.dts index 0a915f3feab6..d4dd31a543fd 100644 --- a/src/mips/brcm/bcm97435svmb.dts +++ b/src/mips/brcm/bcm97435svmb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm7435.dtsi" diff --git a/src/mips/brcm/bcm97xxx-nand-cs1-bch24.dtsi b/src/mips/brcm/bcm97xxx-nand-cs1-bch24.dtsi index 3c24f97de922..96c30d857be4 100644 --- a/src/mips/brcm/bcm97xxx-nand-cs1-bch24.dtsi +++ b/src/mips/brcm/bcm97xxx-nand-cs1-bch24.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 &nand { nandcs@1 { compatible = "brcm,nandcs"; diff --git a/src/mips/brcm/bcm97xxx-nand-cs1-bch4.dtsi b/src/mips/brcm/bcm97xxx-nand-cs1-bch4.dtsi index cb531816ef4c..7b5afefbbfab 100644 --- a/src/mips/brcm/bcm97xxx-nand-cs1-bch4.dtsi +++ b/src/mips/brcm/bcm97xxx-nand-cs1-bch4.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 &nand { nandcs@1 { compatible = "brcm,nandcs"; diff --git a/src/mips/brcm/bcm9ejtagprb.dts b/src/mips/brcm/bcm9ejtagprb.dts index 1da4608680aa..8d58c1971b30 100644 --- a/src/mips/brcm/bcm9ejtagprb.dts +++ b/src/mips/brcm/bcm9ejtagprb.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "bcm6328.dtsi" diff --git a/src/mips/cavium-octeon/octeon_3xxx.dts b/src/mips/cavium-octeon/octeon_3xxx.dts index ca6b4467bcd3..0fa3dd1819ff 100644 --- a/src/mips/cavium-octeon/octeon_3xxx.dts +++ b/src/mips/cavium-octeon/octeon_3xxx.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * OCTEON 3XXX, 5XXX, 63XX device tree skeleton. * diff --git a/src/mips/cavium-octeon/octeon_3xxx.dtsi b/src/mips/cavium-octeon/octeon_3xxx.dtsi index 5302148e05a3..3c296623d870 100644 --- a/src/mips/cavium-octeon/octeon_3xxx.dtsi +++ b/src/mips/cavium-octeon/octeon_3xxx.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* OCTEON 3XXX DTS common parts. */ /dts-v1/; diff --git a/src/mips/cavium-octeon/octeon_68xx.dts b/src/mips/cavium-octeon/octeon_68xx.dts index 79b46fcb0a11..3d0acbb2e15f 100644 --- a/src/mips/cavium-octeon/octeon_68xx.dts +++ b/src/mips/cavium-octeon/octeon_68xx.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /* * OCTEON 68XX device tree skeleton. diff --git a/src/mips/img/boston.dts b/src/mips/img/boston.dts index 53bfa29a7093..2cd49b60e030 100644 --- a/src/mips/img/boston.dts +++ b/src/mips/img/boston.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/mips/ingenic/ci20.dts b/src/mips/ingenic/ci20.dts index fd138d9978c1..a4cc52214dbd 100644 --- a/src/mips/ingenic/ci20.dts +++ b/src/mips/ingenic/ci20.dts @@ -1,6 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "jz4780.dtsi" +#include / { compatible = "img,ci20", "ingenic,jz4780"; @@ -21,6 +23,13 @@ reg = <0x0 0x10000000 0x30000000 0x30000000>; }; + + eth0_power: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "eth0_power"; + gpio = <&gpb 25 GPIO_ACTIVE_LOW>; + enable-active-high; + }; }; &ext { @@ -123,6 +132,29 @@ }; }; }; + + dm9000@6 { + compatible = "davicom,dm9000"; + davicom,no-eeprom; + + pinctrl-names = "default"; + pinctrl-0 = <&pins_nemc_cs6>; + + reg = <6 0 1 /* addr */ + 6 2 1>; /* data */ + + ingenic,nemc-tAS = <15>; + ingenic,nemc-tAH = <10>; + ingenic,nemc-tBP = <20>; + ingenic,nemc-tAW = <50>; + ingenic,nemc-tSTRV = <100>; + + reset-gpios = <&gpf 12 GPIO_ACTIVE_HIGH>; + vcc-supply = <ð0_power>; + + interrupt-parent = <&gpe>; + interrupts = <19 4>; + }; }; &bch { @@ -165,4 +197,10 @@ groups = "nemc-cs1"; bias-disable; }; + + pins_nemc_cs6: nemc-cs6 { + function = "nemc-cs6"; + groups = "nemc-cs6"; + bias-disable; + }; }; diff --git a/src/mips/ingenic/jz4740.dtsi b/src/mips/ingenic/jz4740.dtsi index 2ca7ce7481f1..cd5185bb90ae 100644 --- a/src/mips/ingenic/jz4740.dtsi +++ b/src/mips/ingenic/jz4740.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include / { diff --git a/src/mips/ingenic/jz4780.dtsi b/src/mips/ingenic/jz4780.dtsi index 4853ef67b3ab..ff3298f29ec4 100644 --- a/src/mips/ingenic/jz4780.dtsi +++ b/src/mips/ingenic/jz4780.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include / { @@ -44,6 +45,17 @@ #clock-cells = <1>; }; + rtc_dev: rtc@10003000 { + compatible = "ingenic,jz4780-rtc"; + reg = <0x10003000 0x4c>; + + interrupt-parent = <&intc>; + interrupts = <32>; + + clocks = <&cgu JZ4780_CLK_RTCLK>; + clock-names = "rtc"; + }; + pinctrl: pin-controller@10010000 { compatible = "ingenic,jz4780-pinctrl"; reg = <0x10010000 0x600>; diff --git a/src/mips/ingenic/qi_lb60.dts b/src/mips/ingenic/qi_lb60.dts index b715ee2ac2ee..76aaf8982554 100644 --- a/src/mips/ingenic/qi_lb60.dts +++ b/src/mips/ingenic/qi_lb60.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "jz4740.dtsi" diff --git a/src/mips/lantiq/danube.dtsi b/src/mips/lantiq/danube.dtsi index d4c59e003708..2dd950181f8a 100644 --- a/src/mips/lantiq/danube.dtsi +++ b/src/mips/lantiq/danube.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/lantiq/easy50712.dts b/src/mips/lantiq/easy50712.dts index b59962585dde..c37a33962f28 100644 --- a/src/mips/lantiq/easy50712.dts +++ b/src/mips/lantiq/easy50712.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "danube.dtsi" diff --git a/src/mips/mti/malta.dts b/src/mips/mti/malta.dts index ffe3a1508e72..9944e716eac8 100644 --- a/src/mips/mti/malta.dts +++ b/src/mips/mti/malta.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/mips/mti/sead3.dts b/src/mips/mti/sead3.dts index 4f8bc83c2960..192c26ff1d3d 100644 --- a/src/mips/mti/sead3.dts +++ b/src/mips/mti/sead3.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /memreserve/ 0x00000000 0x00001000; // reserved diff --git a/src/mips/netlogic/xlp_evp.dts b/src/mips/netlogic/xlp_evp.dts index ec16ec2d8d02..e63e55926e04 100644 --- a/src/mips/netlogic/xlp_evp.dts +++ b/src/mips/netlogic/xlp_evp.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * XLP8XX Device Tree Source for EVP boards */ diff --git a/src/mips/netlogic/xlp_fvp.dts b/src/mips/netlogic/xlp_fvp.dts index 4bcebe641d8e..d05abf13fb7d 100644 --- a/src/mips/netlogic/xlp_fvp.dts +++ b/src/mips/netlogic/xlp_fvp.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * XLP2XX Device Tree Source for FVP boards */ diff --git a/src/mips/netlogic/xlp_gvp.dts b/src/mips/netlogic/xlp_gvp.dts index b3ccb82ad7e4..d47de4851786 100644 --- a/src/mips/netlogic/xlp_gvp.dts +++ b/src/mips/netlogic/xlp_gvp.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * XLP9XX Device Tree Source for GVP boards */ diff --git a/src/mips/netlogic/xlp_rvp.dts b/src/mips/netlogic/xlp_rvp.dts index 3783639a318a..aa0faee194ec 100644 --- a/src/mips/netlogic/xlp_rvp.dts +++ b/src/mips/netlogic/xlp_rvp.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * XLP5XX Device Tree Source for RVP boards */ diff --git a/src/mips/netlogic/xlp_svp.dts b/src/mips/netlogic/xlp_svp.dts index 44d6640c1441..3bb0b2e08e4a 100644 --- a/src/mips/netlogic/xlp_svp.dts +++ b/src/mips/netlogic/xlp_svp.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * XLP3XX Device Tree Source for SVP boards */ diff --git a/src/mips/ni/169445.dts b/src/mips/ni/169445.dts new file mode 100644 index 000000000000..5389ef46c480 --- /dev/null +++ b/src/mips/ni/169445.dts @@ -0,0 +1,100 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + compatible = "ni,169445"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu@0 { + device_type = "cpu"; + compatible = "mti,mips14KEc"; + clocks = <&baseclk>; + reg = <0>; + }; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x10000000>; + }; + + baseclk: baseclock { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + }; + + cpu_intc: interrupt-controller { + #address-cells = <0>; + compatible = "mti,cpu-interrupt-controller"; + interrupt-controller; + #interrupt-cells = <1>; + }; + + ahb@1f300000 { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x1f300000 0x80FFF>; + + gpio1: gpio@10 { + compatible = "ni,169445-nand-gpio"; + reg = <0x10 0x4>; + reg-names = "dat"; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio2: gpio@14 { + compatible = "ni,169445-nand-gpio"; + reg = <0x14 0x4>; + reg-names = "dat"; + gpio-controller; + #gpio-cells = <2>; + no-output; + }; + + nand@0 { + compatible = "gpio-control-nand"; + nand-on-flash-bbt; + nand-ecc-mode = "soft_bch"; + nand-ecc-step-size = <512>; + nand-ecc-strength = <4>; + reg = <0x0 4>; + gpios = <&gpio2 0 0>, /* rdy */ + <&gpio1 1 0>, /* nce */ + <&gpio1 2 0>, /* ale */ + <&gpio1 3 0>, /* cle */ + <&gpio1 4 0>; /* nwp */ + }; + + serial@80000 { + compatible = "ns16550a"; + reg = <0x80000 0x1000>; + interrupt-parent = <&cpu_intc>; + interrupts = <6>; + clocks = <&baseclk>; + reg-shift = <0>; + }; + + ethernet@40000 { + compatible = "snps,dwmac-4.10a"; + interrupt-parent = <&cpu_intc>; + interrupts = <5>; + interrupt-names = "macirq"; + reg = <0x40000 0x2000>; + clock-names = "stmmaceth", "pclk"; + clocks = <&baseclk>, <&baseclk>; + + phy-mode = "rgmii"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/src/mips/qca/ar9132.dtsi b/src/mips/qca/ar9132.dtsi index 302f0a8d2988..1fe561c5f90e 100644 --- a/src/mips/qca/ar9132.dtsi +++ b/src/mips/qca/ar9132.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include / { diff --git a/src/mips/qca/ar9132_tl_wr1043nd_v1.dts b/src/mips/qca/ar9132_tl_wr1043nd_v1.dts index 3c3b7ce5737b..3931033e47c8 100644 --- a/src/mips/qca/ar9132_tl_wr1043nd_v1.dts +++ b/src/mips/qca/ar9132_tl_wr1043nd_v1.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/mips/qca/ar9331.dtsi b/src/mips/qca/ar9331.dtsi index cf47ed4d8569..efd5f0722206 100644 --- a/src/mips/qca/ar9331.dtsi +++ b/src/mips/qca/ar9331.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include / { diff --git a/src/mips/qca/ar9331_dpt_module.dts b/src/mips/qca/ar9331_dpt_module.dts index 98e74500e79d..d4e4502daaa8 100644 --- a/src/mips/qca/ar9331_dpt_module.dts +++ b/src/mips/qca/ar9331_dpt_module.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/mips/qca/ar9331_dragino_ms14.dts b/src/mips/qca/ar9331_dragino_ms14.dts index 56f832076a69..4f95ccf17c4c 100644 --- a/src/mips/qca/ar9331_dragino_ms14.dts +++ b/src/mips/qca/ar9331_dragino_ms14.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/mips/qca/ar9331_omega.dts b/src/mips/qca/ar9331_omega.dts index b2be3b04479d..f70f79c4d0d5 100644 --- a/src/mips/qca/ar9331_omega.dts +++ b/src/mips/qca/ar9331_omega.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/mips/qca/ar9331_tl_mr3020.dts b/src/mips/qca/ar9331_tl_mr3020.dts index 919cf3b854a5..748131aea22e 100644 --- a/src/mips/qca/ar9331_tl_mr3020.dts +++ b/src/mips/qca/ar9331_tl_mr3020.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include diff --git a/src/mips/ralink/mt7620a.dtsi b/src/mips/ralink/mt7620a.dtsi index 793c0c7ca921..1f6e5320f486 100644 --- a/src/mips/ralink/mt7620a.dtsi +++ b/src/mips/ralink/mt7620a.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/ralink/mt7620a_eval.dts b/src/mips/ralink/mt7620a_eval.dts index 709f58132f5c..8de8f89f31b8 100644 --- a/src/mips/ralink/mt7620a_eval.dts +++ b/src/mips/ralink/mt7620a_eval.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "mt7620a.dtsi" diff --git a/src/mips/ralink/mt7628a.dtsi b/src/mips/ralink/mt7628a.dtsi new file mode 100644 index 000000000000..9ff7e8faaecc --- /dev/null +++ b/src/mips/ralink/mt7628a.dtsi @@ -0,0 +1,126 @@ +/ { + #address-cells = <1>; + #size-cells = <1>; + compatible = "ralink,mt7628a-soc"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "mti,mips24KEc"; + device_type = "cpu"; + reg = <0>; + }; + }; + + resetc: reset-controller { + compatible = "ralink,rt2880-reset"; + #reset-cells = <1>; + }; + + cpuintc: interrupt-controller { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + compatible = "mti,cpu-interrupt-controller"; + }; + + palmbus@10000000 { + compatible = "palmbus"; + reg = <0x10000000 0x200000>; + ranges = <0x0 0x10000000 0x1FFFFF>; + + #address-cells = <1>; + #size-cells = <1>; + + sysc: system-controller@0 { + compatible = "ralink,mt7620a-sysc", "syscon"; + reg = <0x0 0x100>; + }; + + intc: interrupt-controller@200 { + compatible = "ralink,rt2880-intc"; + reg = <0x200 0x100>; + + interrupt-controller; + #interrupt-cells = <1>; + + resets = <&resetc 9>; + reset-names = "intc"; + + interrupt-parent = <&cpuintc>; + interrupts = <2>; + + ralink,intc-registers = <0x9c 0xa0 + 0x6c 0xa4 + 0x80 0x78>; + }; + + memory-controller@300 { + compatible = "ralink,mt7620a-memc"; + reg = <0x300 0x100>; + }; + + uart0: uartlite@c00 { + compatible = "ns16550a"; + reg = <0xc00 0x100>; + + resets = <&resetc 12>; + reset-names = "uart0"; + + interrupt-parent = <&intc>; + interrupts = <20>; + + reg-shift = <2>; + }; + + uart1: uart1@d00 { + compatible = "ns16550a"; + reg = <0xd00 0x100>; + + resets = <&resetc 19>; + reset-names = "uart1"; + + interrupt-parent = <&intc>; + interrupts = <21>; + + reg-shift = <2>; + }; + + uart2: uart2@e00 { + compatible = "ns16550a"; + reg = <0xe00 0x100>; + + resets = <&resetc 20>; + reset-names = "uart2"; + + interrupt-parent = <&intc>; + interrupts = <22>; + + reg-shift = <2>; + }; + }; + + usb_phy: usb-phy@10120000 { + compatible = "mediatek,mt7628-usbphy"; + reg = <0x10120000 0x1000>; + + #phy-cells = <0>; + + ralink,sysctl = <&sysc>; + resets = <&resetc 22 &resetc 25>; + reset-names = "host", "device"; + }; + + ehci@101c0000 { + compatible = "generic-ehci"; + reg = <0x101c0000 0x1000>; + + phys = <&usb_phy>; + phy-names = "usb"; + + interrupt-parent = <&intc>; + interrupts = <18>; + }; +}; diff --git a/src/mips/ralink/omega2p.dts b/src/mips/ralink/omega2p.dts new file mode 100644 index 000000000000..5884fd48f59a --- /dev/null +++ b/src/mips/ralink/omega2p.dts @@ -0,0 +1,18 @@ +/dts-v1/; + +/include/ "mt7628a.dtsi" + +/ { + compatible = "onion,omega2+", "ralink,mt7688a-soc", "ralink,mt7628a-soc"; + model = "Onion Omega2+"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + stdout-path = &uart0; + }; +}; diff --git a/src/mips/ralink/rt2880.dtsi b/src/mips/ralink/rt2880.dtsi index fb2faef0ab79..8fc1987d9063 100644 --- a/src/mips/ralink/rt2880.dtsi +++ b/src/mips/ralink/rt2880.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/ralink/rt2880_eval.dts b/src/mips/ralink/rt2880_eval.dts index 0a685db093d4..759bc1dd5b83 100644 --- a/src/mips/ralink/rt2880_eval.dts +++ b/src/mips/ralink/rt2880_eval.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "rt2880.dtsi" diff --git a/src/mips/ralink/rt3050.dtsi b/src/mips/ralink/rt3050.dtsi index d3cb57f985da..23062333a76d 100644 --- a/src/mips/ralink/rt3050.dtsi +++ b/src/mips/ralink/rt3050.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/ralink/rt3052_eval.dts b/src/mips/ralink/rt3052_eval.dts index ec9e9a035541..674efdd42e74 100644 --- a/src/mips/ralink/rt3052_eval.dts +++ b/src/mips/ralink/rt3052_eval.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "rt3050.dtsi" diff --git a/src/mips/ralink/rt3883.dtsi b/src/mips/ralink/rt3883.dtsi index 3d6fc9afdaf6..61132cf157e5 100644 --- a/src/mips/ralink/rt3883.dtsi +++ b/src/mips/ralink/rt3883.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/ralink/rt3883_eval.dts b/src/mips/ralink/rt3883_eval.dts index e8df21a5d10d..c22bc84df219 100644 --- a/src/mips/ralink/rt3883_eval.dts +++ b/src/mips/ralink/rt3883_eval.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "rt3883.dtsi" diff --git a/src/mips/ralink/vocore2.dts b/src/mips/ralink/vocore2.dts new file mode 100644 index 000000000000..fa8a5f8f236a --- /dev/null +++ b/src/mips/ralink/vocore2.dts @@ -0,0 +1,18 @@ +/dts-v1/; + +#include "mt7628a.dtsi" + +/ { + compatible = "vocore,vocore2", "ralink,mt7628a-soc"; + model = "VoCore2"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + chosen { + bootargs = "console=ttyS2,115200"; + stdout-path = &uart2; + }; +}; diff --git a/src/mips/xilfpga/microAptiv.dtsi b/src/mips/xilfpga/microAptiv.dtsi index 81d518e75785..87b2b1f9a1b0 100644 --- a/src/mips/xilfpga/microAptiv.dtsi +++ b/src/mips/xilfpga/microAptiv.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { #address-cells = <1>; #size-cells = <1>; diff --git a/src/mips/xilfpga/nexys4ddr.dts b/src/mips/xilfpga/nexys4ddr.dts index 09a62f2e2f8f..41fee03dc312 100644 --- a/src/mips/xilfpga/nexys4ddr.dts +++ b/src/mips/xilfpga/nexys4ddr.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; #include "microAptiv.dtsi" diff --git a/src/nios2/3c120_devboard.dts b/src/nios2/3c120_devboard.dts index 31c51f9a2f09..36ccdf05837d 100644 --- a/src/nios2/3c120_devboard.dts +++ b/src/nios2/3c120_devboard.dts @@ -159,6 +159,7 @@ }; chosen { - bootargs = "debug console=ttyJ0,115200"; + bootargs = "debug earlycon console=ttyJ0,115200"; + stdout-path = &jtag_uart; }; }; diff --git a/src/openrisc/or1ksim.dts b/src/openrisc/or1ksim.dts index 5d4f9027afaf..9f4b856da580 100644 --- a/src/openrisc/or1ksim.dts +++ b/src/openrisc/or1ksim.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; / { compatible = "opencores,or1ksim"; diff --git a/src/powerpc/fsp2.dts b/src/powerpc/fsp2.dts index 475953ada707..f10a64aeb83b 100644 --- a/src/powerpc/fsp2.dts +++ b/src/powerpc/fsp2.dts @@ -52,6 +52,7 @@ clocks { mmc_clk: mmc_clk { compatible = "fixed-clock"; + #clock-cells = <0>; clock-frequency = <50000000>; clock-output-names = "mmc_clk"; }; @@ -359,20 +360,6 @@ interrupts = <31 0x4 15 0x84>; }; - mmc0: sdhci@020c0000 { - compatible = "st,sdhci-stih407", "st,sdhci"; - status = "disabled"; - reg = <0x020c0000 0x20000>; - reg-names = "mmc"; - interrupt-parent = <&UIC1_3>; - interrupts = <21 0x4 22 0x4>; - interrupt-names = "mmcirq"; - pinctrl-names = "default"; - pinctrl-0 = <>; - clock-names = "mmc"; - clocks = <&mmc_clk>; - }; - plb6 { compatible = "ibm,plb6"; #address-cells = <2>; @@ -501,6 +488,24 @@ /*RXDE*/ 4 &UIC1_2 13 0x4>; }; + mmc0: mmc@20c0000 { + compatible = "st,sdhci-stih407", "st,sdhci"; + reg = <0x020c0000 0x20000>; + reg-names = "mmc"; + interrupts = <21 0x4>; + interrupt-parent = <&UIC1_3>; + interrupt-names = "mmcirq"; + pinctrl-names = "default"; + pinctrl-0 = <>; + clock-names = "mmc"; + clocks = <&mmc_clk>; + bus-width = <4>; + non-removable; + sd-uhs-sdr50; + sd-uhs-sdr104; + sd-uhs-ddr50; + }; + opb { compatible = "ibm,opb"; #address-cells = <1>; diff --git a/src/powerpc/virtex440-ml510.dts b/src/powerpc/virtex440-ml510.dts index 81a8dc2c6365..81201d3907e2 100644 --- a/src/powerpc/virtex440-ml510.dts +++ b/src/powerpc/virtex440-ml510.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Xilinx ML510 Reference Design support * diff --git a/src/sh/j2_mimas_v2.dts b/src/sh/j2_mimas_v2.dts index 880de75360b3..9f4742fab329 100755 --- a/src/sh/j2_mimas_v2.dts +++ b/src/sh/j2_mimas_v2.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; / { diff --git a/src/xtensa/csp.dts b/src/xtensa/csp.dts index 4082f26716b9..885495460f7e 100644 --- a/src/xtensa/csp.dts +++ b/src/xtensa/csp.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; / { diff --git a/src/xtensa/kc705.dts b/src/xtensa/kc705.dts index 6106bdc097ad..6887ff090fce 100644 --- a/src/xtensa/kc705.dts +++ b/src/xtensa/kc705.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "xtfpga.dtsi" /include/ "xtfpga-flash-128m.dtsi" diff --git a/src/xtensa/kc705_nommu.dts b/src/xtensa/kc705_nommu.dts index 65f3d741b964..d8e194a0f64e 100644 --- a/src/xtensa/kc705_nommu.dts +++ b/src/xtensa/kc705_nommu.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "xtfpga.dtsi" /include/ "xtfpga-flash-128m.dtsi" diff --git a/src/xtensa/lx200mx.dts b/src/xtensa/lx200mx.dts index 249822b99bd6..974a8d9041b3 100644 --- a/src/xtensa/lx200mx.dts +++ b/src/xtensa/lx200mx.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "xtfpga.dtsi" /include/ "xtfpga-flash-16m.dtsi" diff --git a/src/xtensa/lx60.dts b/src/xtensa/lx60.dts index a0f8b8ad3920..7c203c1c746a 100644 --- a/src/xtensa/lx60.dts +++ b/src/xtensa/lx60.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "xtfpga.dtsi" /include/ "xtfpga-flash-4m.dtsi" diff --git a/src/xtensa/ml605.dts b/src/xtensa/ml605.dts index 905c3a5035e9..08e5c8d47197 100644 --- a/src/xtensa/ml605.dts +++ b/src/xtensa/ml605.dts @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /dts-v1/; /include/ "xtfpga.dtsi" /include/ "xtfpga-flash-16m.dtsi" diff --git a/src/xtensa/xtfpga-flash-128m.dtsi b/src/xtensa/xtfpga-flash-128m.dtsi index d3a88e029873..9bf8bad1dd18 100644 --- a/src/xtensa/xtfpga-flash-128m.dtsi +++ b/src/xtensa/xtfpga-flash-128m.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { soc { flash: flash@00000000 { diff --git a/src/xtensa/xtfpga-flash-16m.dtsi b/src/xtensa/xtfpga-flash-16m.dtsi index 1d97203c18e7..40c2f81f7cb6 100644 --- a/src/xtensa/xtfpga-flash-16m.dtsi +++ b/src/xtensa/xtfpga-flash-16m.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { soc { flash: flash@08000000 { diff --git a/src/xtensa/xtfpga-flash-4m.dtsi b/src/xtensa/xtfpga-flash-4m.dtsi index d1c621ca8be1..fb8d3a9f33c2 100644 --- a/src/xtensa/xtfpga-flash-4m.dtsi +++ b/src/xtensa/xtfpga-flash-4m.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { soc { flash: flash@08000000 { diff --git a/src/xtensa/xtfpga.dtsi b/src/xtensa/xtfpga.dtsi index 91616a9d79df..1090528825ec 100644 --- a/src/xtensa/xtfpga.dtsi +++ b/src/xtensa/xtfpga.dtsi @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 / { compatible = "cdns,xtensa-xtfpga"; #address-cells = <1>; From 58c8430a32463db3d29e4c701f2e72653269274c Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Wed, 15 Nov 2017 12:27:02 +0000 Subject: [PATCH 02/92] pfctl: teach route-to to deal with interfaces with multiple addresses The route_host parsing code set the interface name, but only for the first node_host in the list. If that one happened to be the inet6 address and the rule wanted an inet address it'd get removed by remove_invalid_hosts() later on, and we'd have no interface name. We must set the interface name for all node_host entries in the list, not just the first one. PR: 223208 MFC after: 2 weeks --- sbin/pfctl/parse.y | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 5652845d4195..db09a44ad6b4 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -4390,8 +4390,11 @@ route_host : STRING { $$->tail = $$; } | '(' STRING host ')' { + struct node_host *n; + $$ = $3; - $$->ifname = $2; + for (n = $3; n != NULL; n = n->next) + n->ifname = $2; } ; From c07d14deb549f76ef59dd1085ca73c38537ea73e Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 15 Nov 2017 12:48:36 +0000 Subject: [PATCH 03/92] remove the poor emulation of the IllumOS needfree global variable to prevent the ARC reclaim thread running longer than needed. Update the arc::needfree dtrace probe triggered in arc_lowmem() to also report the value we may want to free. Submitted by: Nikita Kozlov Reviewed by: avg Approved by: avg MFC after: 3 weeks Sponsored by: blade Differential Revision: https://reviews.freebsd.org/D12163 --- .../opensolaris/uts/common/fs/zfs/arc.c | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c index 92d8b41c24ac..209b33f16347 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c @@ -4199,8 +4199,6 @@ arc_shrink(int64_t to_free) } } -static long needfree = 0; - typedef enum free_memory_reason_t { FMR_UNKNOWN, FMR_NEEDFREE, @@ -4238,14 +4236,6 @@ arc_available_memory(void) free_memory_reason_t r = FMR_UNKNOWN; #ifdef _KERNEL - if (needfree > 0) { - n = PAGESIZE * (-needfree); - if (n < lowest) { - lowest = n; - r = FMR_NEEDFREE; - } - } - /* * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. @@ -4510,9 +4500,6 @@ arc_reclaim_thread(void *dummy __unused) int64_t to_free = (arc_c >> arc_shrink_shift) - free_memory; if (to_free > 0) { -#ifdef _KERNEL - to_free = MAX(to_free, ptob(needfree)); -#endif arc_shrink(to_free); } } else if (free_memory < arc_c >> arc_no_grow_shift) { @@ -4533,9 +4520,6 @@ arc_reclaim_thread(void *dummy __unused) * infinite loop. */ if (arc_size <= arc_c || evicted == 0) { -#ifdef _KERNEL - needfree = 0; -#endif /* * We're either no longer overflowing, or we * can't evict anything more, so we should wake @@ -6310,9 +6294,7 @@ arc_lowmem(void *arg __unused, int howto __unused) { mutex_enter(&arc_reclaim_lock); - /* XXX: Memory deficit should be passed as argument. */ - needfree = btoc(arc_c >> arc_shrink_shift); - DTRACE_PROBE(arc__needfree); + DTRACE_PROBE1(arc__needfree, int64_t, ((int64_t)freemem - zfs_arc_free_target) * PAGESIZE); cv_signal(&arc_reclaim_thread_cv); /* From 1c778d91b5e506fc4fe93e008f464dd62e039e21 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 15 Nov 2017 13:41:03 +0000 Subject: [PATCH 04/92] vmtotal: extend memory counters to accomodate for current and future hardware sizes. 32bit counters already overflow on approachable virtual memory page counts, and soon would overflow on the physical pages counts as well. Bump sizes to 64bit types. Bump __FreeBSD_version. It is impossible to provide perfect backward ABI compat for this change. If a program requests an old structure, it can be detected by size. But if it queries the size first by passing NULL old req pointer, there is almost nothing we can do to detect the desired ABI. As a partial solution, check p_osrel of the quering process when selecting the size to report. Submitted by: Pawel Biernacki Differential revision: https://reviews.freebsd.org/D13018 --- sys/sys/param.h | 3 ++- sys/sys/vmmeter.h | 31 ++++++++++++++------------ sys/vm/vm_meter.c | 57 ++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 73 insertions(+), 18 deletions(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index a5d1730f8f9b..cac8cbad00dd 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200053 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200054 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, @@ -84,6 +84,7 @@ #define P_OSREL_SHUTDOWN_ENOTCONN 1100077 #define P_OSREL_MAP_GUARD 1200035 #define P_OSREL_WRFSBASE 1200041 +#define P_OSREL_VMTOTAL64 1200054 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif diff --git a/sys/sys/vmmeter.h b/sys/sys/vmmeter.h index 62106ee7e989..0c94b9d18eb6 100644 --- a/sys/sys/vmmeter.h +++ b/sys/sys/vmmeter.h @@ -41,20 +41,23 @@ /* Systemwide totals computed every five seconds. */ struct vmtotal { - int16_t t_rq; /* length of the run queue */ - int16_t t_dw; /* jobs in ``disk wait'' (neg priority) */ - int16_t t_pw; /* jobs in page wait */ - int16_t t_sl; /* jobs sleeping in core */ - int16_t t_sw; /* swapped out runnable/short block jobs */ - int32_t t_vm; /* total virtual memory */ - int32_t t_avm; /* active virtual memory */ - int32_t t_rm; /* total real memory in use */ - int32_t t_arm; /* active real memory */ - int32_t t_vmshr; /* shared virtual memory */ - int32_t t_avmshr; /* active shared virtual memory */ - int32_t t_rmshr; /* shared real memory */ - int32_t t_armshr; /* active shared real memory */ - int32_t t_free; /* free memory pages */ + uint64_t t_vm; /* total virtual memory */ + uint64_t t_avm; /* active virtual memory */ + uint64_t t_rm; /* total real memory in use */ + uint64_t t_arm; /* active real memory */ + uint64_t t_vmshr; /* shared virtual memory */ + uint64_t t_avmshr; /* active shared virtual memory */ + uint64_t t_rmshr; /* shared real memory */ + uint64_t t_armshr; /* active shared real memory */ + uint64_t t_free; /* free memory pages */ + int16_t t_rq; /* length of the run queue */ + int16_t t_dw; /* jobs in ``disk wait'' (neg + priority) */ + int16_t t_pw; /* jobs in page wait */ + int16_t t_sl; /* jobs sleeping in core */ + int16_t t_sw; /* swapped out runnable/short + block jobs */ + uint16_t t_pad[3]; }; #if defined(_KERNEL) || defined(_WANT_VMMETER) diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index f4313a42fb5f..50a8bdce2963 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -152,14 +152,43 @@ is_object_active(vm_object_t obj) return (obj->ref_count > obj->shadow_count); } +#if defined(COMPAT_FREEBSD11) +struct vmtotal11 { + int16_t t_rq; + int16_t t_dw; + int16_t t_pw; + int16_t t_sl; + int16_t t_sw; + int32_t t_vm; + int32_t t_avm; + int32_t t_rm; + int32_t t_arm; + int32_t t_vmshr; + int32_t t_avmshr; + int32_t t_rmshr; + int32_t t_armshr; + int32_t t_free; +}; +#endif + static int vmtotal(SYSCTL_HANDLER_ARGS) { struct vmtotal total; +#if defined(COMPAT_FREEBSD11) + struct vmtotal11 total11; +#endif vm_object_t object; struct proc *p; struct thread *td; + if (req->oldptr == NULL) { +#if defined(COMPAT_FREEBSD11) + if (curproc->p_osrel < P_OSREL_VMTOTAL64) + return (SYSCTL_OUT(req, NULL, sizeof(total11))); +#endif + return (SYSCTL_OUT(req, NULL, sizeof(total))); + } bzero(&total, sizeof(total)); /* @@ -253,11 +282,33 @@ vmtotal(SYSCTL_HANDLER_ARGS) } mtx_unlock(&vm_object_list_mtx); total.t_free = vm_cnt.v_free_count; - return (sysctl_handle_opaque(oidp, &total, sizeof(total), req)); +#if defined(COMPAT_FREEBSD11) + /* sysctl(8) allocates twice as much memory as reported by sysctl(3) */ + if (curproc->p_osrel < P_OSREL_VMTOTAL64 && (req->oldlen == + sizeof(total11) || req->oldlen == 2 * sizeof(total11))) { + bzero(&total11, sizeof(total11)); + total11.t_rq = total.t_rq; + total11.t_dw = total.t_dw; + total11.t_pw = total.t_pw; + total11.t_sl = total.t_sl; + total11.t_sw = total.t_sw; + total11.t_vm = total.t_vm; /* truncate */ + total11.t_avm = total.t_avm; /* truncate */ + total11.t_rm = total.t_rm; /* truncate */ + total11.t_arm = total.t_arm; /* truncate */ + total11.t_vmshr = total.t_vmshr; /* truncate */ + total11.t_avmshr = total.t_avmshr; /* truncate */ + total11.t_rmshr = total.t_rmshr; /* truncate */ + total11.t_armshr = total.t_armshr; /* truncate */ + total11.t_free = total.t_free; /* truncate */ + return (SYSCTL_OUT(req, &total11, sizeof(total11))); + } +#endif + return (SYSCTL_OUT(req, &total, sizeof(total))); } -SYSCTL_PROC(_vm, VM_TOTAL, vmtotal, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE, - 0, sizeof(struct vmtotal), vmtotal, "S,vmtotal", +SYSCTL_PROC(_vm, VM_TOTAL, vmtotal, CTLTYPE_OPAQUE | CTLFLAG_RD | + CTLFLAG_MPSAFE, NULL, 0, vmtotal, "S,vmtotal", "System virtual memory statistics"); SYSCTL_NODE(_vm, OID_AUTO, stats, CTLFLAG_RW, 0, "VM meter stats"); static SYSCTL_NODE(_vm_stats, OID_AUTO, sys, CTLFLAG_RW, 0, From bf1dea9b13d40b606627200a9e28fb1d1dbe3322 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 15 Nov 2017 15:00:02 +0000 Subject: [PATCH 05/92] Reword a bit for clarity. Sponsored by: Netflix --- share/man/man7/arch.7 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 4d15b8683280..3693ed11e535 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -418,9 +418,12 @@ For example, .Dv MACHINE_CPUARCH is defined to be mips for all the flavors of mips that we support since we support them all with a shared set of sources. -One might thing that it should be x86 for both amd64 and i386. -However, since we don't support these two architectures with the same -source base, that's not done despite it's logical appeal. +While amd64 and i386 are closely related, MACHINE_CPUARCH is not x86 +for them. +The FreeBSD source base supports amd64 and i386 with two +distinct source bases living in subdirectories named amd64 and i386 +(though behind the scenes there's some sharing that fits into this +framework). .It Dv CPUTYPE Sets the flavor of .Dv MACHINE_ARCH to build. @@ -433,7 +436,8 @@ Unused outside of that scope. It is not passed down to the rest of the build. Makefiles outside of the top level shouldn't use it at all (though some have their own private copy for hysterical raisons). -.It Dv TARGET_ARCH Used to set Dv MACHINE_ARCH by Fx's top level Makefile for cross building. +.It Dv TARGET_ARCH Used to set +.Dv MACHINE_ARCH by Fx's top level Makefile for cross building. Like .Dv TARGET , it is unused outside of that scope. .El From 12497aa5be83a3678101438bc963c1809c337de8 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 15 Nov 2017 15:02:45 +0000 Subject: [PATCH 06/92] Replace Fx's with 'the' since expanding FreeBSD here didn't seem quite right. Sponsored by: Netflix --- share/man/man7/arch.7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 3693ed11e535..bb586caf92f8 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -437,7 +437,7 @@ It is not passed down to the rest of the build. Makefiles outside of the top level shouldn't use it at all (though some have their own private copy for hysterical raisons). .It Dv TARGET_ARCH Used to set -.Dv MACHINE_ARCH by Fx's top level Makefile for cross building. +.Dv MACHINE_ARCH by the top level Makefile for cross building. Like .Dv TARGET , it is unused outside of that scope. .El From 30083240bcb72a3db19cf2273f9592fad355bfa1 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Wed, 15 Nov 2017 15:52:06 +0000 Subject: [PATCH 07/92] Remove a double free(9) in xpt_bus_register In xpt_bus_register(), remove superfluous call to free(). This was mostly benign since free(9) checks for NULL before doing anything, and xpt_create_path() is nice enough to NULL out the pointer on failure. However, it could've segfaulted if malloc(9) failed during xpt_create_path(). Submitted by: gibbs MFC after: 3 weeks Sponsored by: Spectra Logic Corp --- sys/cam/cam_xpt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 1107993ec2fb..94baf5d7fa33 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -4049,7 +4049,6 @@ xpt_bus_register(struct cam_sim *sim, device_t parent, u_int32_t bus) CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { xpt_release_bus(new_bus); - free(path, M_CAMXPT); return (CAM_RESRC_UNAVAIL); } From 92b800cc1aa98c9dc19e35aebc51558ca2b0dc36 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 15 Nov 2017 18:03:31 +0000 Subject: [PATCH 08/92] Sort pkgbase mtree metadata, for reproducible builds Packaged base packages are created by running the stageworld and stagekernel targets with -DNO_ROOT, and converting the resulting mtree file into a set of pkg plists. If stage* is run with multiple processes the order of entries in the mtree file may be nondeterministic, and the resulting package tbz also had nondeterministic file ordering. The mtree file generated by -DNO_ROOT builds consists of one line per file, with the filename starting in the first column, so is easily sorted. There's one exception: the first line of the mtree file is a comment, but the # character sorts before the filenames anyhow and needs no special treatment. PR: 223673 Reviewed by: bapt, gjb Sponsored by: The Linux Foundation, Core Infrastructure Initiative Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13103 --- Makefile.inc1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 8c5ba9407c24..c4042e109953 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1613,8 +1613,8 @@ create-packages: .PHONY create-packages-world create-packages-kernel create-world-packages: _pkgbootstrap .PHONY @rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || : @cd ${WSTAGEDIR} ; \ - awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ - ${WSTAGEDIR}/METALOG + env -i LC_COLLATE=C sort ${WSTAGEDIR}/METALOG | \ + awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk @for plist in ${WSTAGEDIR}/*.plist; do \ plist=$${plist##*/} ; \ pkgname=$${plist%.plist} ; \ @@ -1658,9 +1658,9 @@ _debug=-debug create-kernel-packages: create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},} create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap .PHONY @cd ${KSTAGEDIR}/${DISTDIR} ; \ + env -i LC_COLLATE=C sort ${KSTAGEDIR}/kernel.meta | \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ - -v kernel=yes -v _kernconf=${INSTALLKERNEL} \ - ${KSTAGEDIR}/kernel.meta ; \ + -v kernel=yes -v _kernconf=${INSTALLKERNEL} ; \ cap_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VCAP_MKDB_ENDIAN` ; \ pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \ sed -e "s/%VERSION%/${PKG_VERSION}/" \ @@ -1693,9 +1693,9 @@ _debug=-debug create-kernel-packages: create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel} create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kernel}: _pkgbootstrap .PHONY @cd ${KSTAGEDIR}/kernel.${_kernel} ; \ + env -i LC_COLLATE=C sort ${KSTAGEDIR}/kernel.${_kernel}.meta | \ awk -f ${SRCDIR}/release/scripts/mtree-to-plist.awk \ - -v kernel=yes -v _kernconf=${_kernel} \ - ${KSTAGEDIR}/kernel.${_kernel}.meta ; \ + -v kernel=yes -v _kernconf=${_kernel} ; \ cap_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VCAP_MKDB_ENDIAN` ; \ pwd_arg=`cd ${SRCDIR}/etc ; ${MAKE} -VPWD_MKDB_ENDIAN` ; \ sed -e "s/%VERSION%/${PKG_VERSION}/" \ From 4acb68a8a5ca6cf1547cc672fb7a4a4822af9341 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Wed, 15 Nov 2017 18:40:40 +0000 Subject: [PATCH 09/92] newfs: warn if newer than kernel Creating a UFS filesystem with a newfs newer than the running kernel, and then mounting that filesystem, can lead to interesting failures. Add a safety belt to explicitly warn when newfs is newer than the running kernel. Reviewed by: gjb, jhb, mckusick Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12765 --- sbin/newfs/newfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 8b32792c3c83..2928878ad901 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -398,6 +398,10 @@ main(int argc, char *argv[]) if (pp != NULL) pp->p_size *= secperblk; } + if (getosreldate() < __FreeBSD_version) { + warnx("%s is newer than the running kernel and may not be compatible", + getprogname()); + } mkfs(pp, special); ufs_disk_close(&disk); if (!jflag) From e69ce19b6acc89b0d4eca53e380bb16281fd81fc Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Wed, 15 Nov 2017 19:03:06 +0000 Subject: [PATCH 10/92] release: Update u-boot and firmware file for RPI-B target THe u-boot port for RPI-B was updated to use u-boot-master, this cause an update in u-boot version to v2017.09 and changing the filename. The various firmware files for the RPI* are now in a common ports sysutils/rpi-firmware as they are shared on all the RPI version. Update the release files to copy the right files from the right location. Reviewed by: gjb MFC after: 3 days --- release/arm/RPI-B.conf | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index 74f50bcd2ab9..e317da7ac57c 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -6,7 +6,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" -EMBEDDEDPORTS="sysutils/u-boot-rpi" +EMBEDDEDPORTS="sysutils/u-boot-rpi sysutils/rpi-firmware" KERNEL="RPI-B" IMAGE_SIZE="3072M" PART_SCHEME="MBR" @@ -17,8 +17,11 @@ NODOC=1 arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi" - UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ - start.elf start_cd.elf u-boot.img" + RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware" + UBOOT_FILES="u-boot.bin" + RPI_FIRMWARE_FILES="bootcode.bin config.txt \ + fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ + start.elf start_cd.elf start_db.elf start_x.elf" FATMOUNT="${DESTDIR%${KERNEL}}/fat" UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" @@ -28,6 +31,10 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ ${FATMOUNT}/${_UF} done + for _UF in ${RPI_FIRMWARE_FILES}; do + chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \ + ${FATMOUNT}/${_UF} + done chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi.dtb \ From cac201b866281310782dd6bdbc75c3be777a1066 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Wed, 15 Nov 2017 19:04:23 +0000 Subject: [PATCH 11/92] release: Update u-boot and firmware file for RPI2 target The u-boot port for RPI-2 was updated to use u-boot-master, this cause an update in u-boot version to v2017.09 and changing the filename. The various firmware files for the RPI* are now in a common ports sysutils/rpi-firmware as they are shared on all the RPI version. Update the release files to copy the right files from the right location. Reviewed by: gjb MFC after: 3 days --- release/arm/RPI2.conf | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf index 0d2e5595e882..421f022427c3 100644 --- a/release/arm/RPI2.conf +++ b/release/arm/RPI2.conf @@ -6,7 +6,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" -EMBEDDEDPORTS="sysutils/u-boot-rpi2" +EMBEDDEDPORTS="sysutils/u-boot-rpi2 sysutils/rpi-firmware" KERNEL="GENERIC" IMAGE_SIZE="3072M" PART_SCHEME="MBR" @@ -18,8 +18,11 @@ export BOARDNAME="RPI2" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2" - UBOOT_FILES="bootcode.bin config.txt fixup.dat fixup_cd.dat \ - fixup_x.dat start.elf start_cd.elf start_x.elf u-boot.bin" + RPI_FIRMWARE_DIR="/usr/local/share/rpi-firmware" + UBOOT_FILES="u-boot.bin" + RPI_FIRMWARE_FILES="bootcode.bin config.txt \ + fixup.dat fixup_cd.dat fixup_db.dat fixup_x.dat \ + start.elf start_cd.elf start_db.elf start_x.elf" FATMOUNT="${DESTDIR%${KERNEL}}/fat" UFSMOUNT="${DESTDIR%${KERNEL}}/ufs" chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" @@ -29,6 +32,10 @@ arm_install_uboot() { chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/${_UF} \ ${FATMOUNT}/${_UF} done + for _UF in ${RPI_FIRMWARE_FILES}; do + chroot ${CHROOTDIR} cp -p ${RPI_FIRMWARE_DIR}/${_UF} \ + ${FATMOUNT}/${_UF} + done chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi2.dtb \ From d294a5246f25d3d5070c74809b6ab9aa703d0d31 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 15 Nov 2017 19:14:44 +0000 Subject: [PATCH 12/92] Only copy /etc/resolv.conf to ${CHROOTDIR} if /etc/resolv.conf does not already exist within ${CHROOTDIR}. This allows re-using a build chroot with CHROOTBUILD_SKIP set to a non-empty value and CHROOTDIR set to '/' in release.conf. MFC after: 3 days Sponsored by: The FreeBSD Foundation --- release/release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/release.sh b/release/release.sh index 6a9a1fd7f2fe..067eec5c09a1 100755 --- a/release/release.sh +++ b/release/release.sh @@ -252,8 +252,8 @@ chroot_setup() { extra_chroot_setup() { mkdir -p ${CHROOTDIR}/dev mount -t devfs devfs ${CHROOTDIR}/dev - [ -e /etc/resolv.conf ] && cp /etc/resolv.conf \ - ${CHROOTDIR}/etc/resolv.conf + [ -e /etc/resolv.conf -a ! -e ${CHROOTDIR}/etc/resolv.conf ] && \ + cp /etc/resolv.conf ${CHROOTDIR}/etc/resolv.conf # Run ldconfig(8) in the chroot directory so /var/run/ld-elf*.so.hints # is created. This is needed by ports-mgmt/pkg. eval chroot ${CHROOTDIR} /etc/rc.d/ldconfig forcerestart From 3e87bccde3a468d5735a9aab40cc9f5e4fc2fbd8 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Wed, 15 Nov 2017 22:13:10 +0000 Subject: [PATCH 13/92] Fix the handling of ERROR chunks which a lot of error causes. While there, clean up the code. Thanks to Felix Weinrank who found the bug by using fuzz-testing the SCTP userland stack. MFC after: 1 week --- sys/netinet/sctp_input.c | 132 ++++++++++++++++++++++----------------- 1 file changed, 74 insertions(+), 58 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index c769ec621b81..3a8602d2b5e1 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1098,19 +1098,11 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED, #endif } -/* - * Skip past the param header and then we will find the chunk that caused the - * problem. There are two possibilities ASCONF or FWD-TSN other than that and - * our peer must be broken. - */ static void -sctp_process_unrecog_chunk(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr, +sctp_process_unrecog_chunk(struct sctp_tcb *stcb, uint8_t chunk_type, struct sctp_nets *net) { - struct sctp_chunkhdr *chk; - - chk = (struct sctp_chunkhdr *)((caddr_t)phdr + sizeof(*phdr)); - switch (chk->chunk_type) { + switch (chunk_type) { case SCTP_ASCONF_ACK: case SCTP_ASCONF: sctp_asconf_cleanup(stcb, net); @@ -1121,8 +1113,8 @@ sctp_process_unrecog_chunk(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr, break; default: SCTPDBG(SCTP_DEBUG_INPUT2, - "Peer does not support chunk type %d(%x)??\n", - chk->chunk_type, (uint32_t)chk->chunk_type); + "Peer does not support chunk type %d (0x%x).\n", + chunk_type, chunk_type); break; } } @@ -1134,12 +1126,9 @@ sctp_process_unrecog_chunk(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr, * XXX: Is this the right thing to do? */ static void -sctp_process_unrecog_param(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr) +sctp_process_unrecog_param(struct sctp_tcb *stcb, uint16_t parameter_type) { - struct sctp_paramhdr *pbad; - - pbad = phdr + 1; - switch (ntohs(pbad->param_type)) { + switch (parameter_type) { /* pr-sctp draft */ case SCTP_PRSCTP_SUPPORTED: stcb->asoc.prsctp_supported = 0; @@ -1164,63 +1153,69 @@ sctp_process_unrecog_param(struct sctp_tcb *stcb, struct sctp_paramhdr *phdr) break; default: SCTPDBG(SCTP_DEBUG_INPUT2, - "Peer does not support param type %d(%x)??\n", - pbad->param_type, (uint32_t)pbad->param_type); + "Peer does not support param type %d (0x%x)??\n", + parameter_type, parameter_type); break; } } static int sctp_handle_error(struct sctp_chunkhdr *ch, - struct sctp_tcb *stcb, struct sctp_nets *net) + struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t limit) { - int chklen; - struct sctp_paramhdr *phdr; - uint16_t error, error_type; - uint16_t error_len; + struct sctp_error_cause *cause; struct sctp_association *asoc; - int adjust; + uint32_t remaining_length, adjust; + uint16_t code, cause_code, cause_length; #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif /* parse through all of the errors and process */ asoc = &stcb->asoc; - phdr = (struct sctp_paramhdr *)((caddr_t)ch + + cause = (struct sctp_error_cause *)((caddr_t)ch + sizeof(struct sctp_chunkhdr)); - chklen = ntohs(ch->chunk_length) - sizeof(struct sctp_chunkhdr); - error = 0; - while ((size_t)chklen >= sizeof(struct sctp_paramhdr)) { + remaining_length = ntohs(ch->chunk_length); + if (remaining_length > limit) { + remaining_length = limit; + } + if (remaining_length >= sizeof(struct sctp_chunkhdr)) { + remaining_length -= sizeof(struct sctp_chunkhdr); + } else { + remaining_length = 0; + } + code = 0; + while (remaining_length >= sizeof(struct sctp_error_cause)) { /* Process an Error Cause */ - error_type = ntohs(phdr->param_type); - error_len = ntohs(phdr->param_length); - if ((error_len > chklen) || (error_len == 0)) { - /* invalid param length for this param */ - SCTPDBG(SCTP_DEBUG_INPUT1, "Bogus length in error param- chunk left:%d errorlen:%d\n", - chklen, error_len); + cause_code = ntohs(cause->code); + cause_length = ntohs(cause->length); + if ((cause_length > remaining_length) || (cause_length == 0)) { + /* Invalid cause length, possibly due to truncation. */ + SCTPDBG(SCTP_DEBUG_INPUT1, "Bogus length in cause - bytes left: %u cause length: %u\n", + remaining_length, cause_length); return (0); } - if (error == 0) { + if (code == 0) { /* report the first error cause */ - error = error_type; + code = cause_code; } - switch (error_type) { + switch (cause_code) { case SCTP_CAUSE_INVALID_STREAM: case SCTP_CAUSE_MISSING_PARAM: case SCTP_CAUSE_INVALID_PARAM: case SCTP_CAUSE_NO_USER_DATA: - SCTPDBG(SCTP_DEBUG_INPUT1, "Software error we got a %d back? We have a bug :/ (or do they?)\n", - error_type); + SCTPDBG(SCTP_DEBUG_INPUT1, "Software error we got a %u back? We have a bug :/ (or do they?)\n", + cause_code); break; case SCTP_CAUSE_NAT_COLLIDING_STATE: - SCTPDBG(SCTP_DEBUG_INPUT2, "Received Colliding state abort flags:%x\n", + SCTPDBG(SCTP_DEBUG_INPUT2, "Received Colliding state abort flags: %x\n", ch->chunk_flags); if (sctp_handle_nat_colliding_state(stcb)) { return (0); } break; case SCTP_CAUSE_NAT_MISSING_STATE: - SCTPDBG(SCTP_DEBUG_INPUT2, "Received missing state abort flags:%x\n", + SCTPDBG(SCTP_DEBUG_INPUT2, "Received missing state abort flags: %x\n", ch->chunk_flags); if (sctp_handle_nat_missing_state(stcb, net)) { return (0); @@ -1231,12 +1226,18 @@ sctp_handle_error(struct sctp_chunkhdr *ch, * We only act if we have echoed a cookie and are * waiting. */ - if (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED) { - int *p; + if ((cause_length >= sizeof(struct sctp_error_stale_cookie)) && + (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + struct sctp_error_stale_cookie *stale_cookie; - p = (int *)((caddr_t)phdr + sizeof(*phdr)); - /* Save the time doubled */ - asoc->cookie_preserve_req = ntohl(*p) << 1; + stale_cookie = (struct sctp_error_stale_cookie *)cause; + asoc->cookie_preserve_req = ntohl(stale_cookie->stale_time); + /* Double it to be more robust on RTX */ + if (asoc->cookie_preserve_req <= UINT32_MAX / 2) { + asoc->cookie_preserve_req *= 2; + } else { + asoc->cookie_preserve_req = UINT32_MAX; + } asoc->stale_cookie_count++; if (asoc->stale_cookie_count > asoc->max_init_times) { @@ -1279,10 +1280,21 @@ sctp_handle_error(struct sctp_chunkhdr *ch, */ break; case SCTP_CAUSE_UNRECOG_CHUNK: - sctp_process_unrecog_chunk(stcb, phdr, net); + if (cause_length >= sizeof(struct sctp_error_unrecognized_chunk)) { + struct sctp_error_unrecognized_chunk *unrec_chunk; + + unrec_chunk = (struct sctp_error_unrecognized_chunk *)cause; + sctp_process_unrecog_chunk(stcb, unrec_chunk->ch.chunk_type, net); + } break; case SCTP_CAUSE_UNRECOG_PARAM: - sctp_process_unrecog_param(stcb, phdr); + /* XXX: We only consider the first parameter */ + if (cause_length >= sizeof(struct sctp_error_cause) + sizeof(struct sctp_paramhdr)) { + struct sctp_paramhdr *unrec_parameter; + + unrec_parameter = (struct sctp_paramhdr *)(cause + 1); + sctp_process_unrecog_param(stcb, ntohs(unrec_parameter->param_type)); + } break; case SCTP_CAUSE_COOKIE_IN_SHUTDOWN: /* @@ -1299,8 +1311,8 @@ sctp_handle_error(struct sctp_chunkhdr *ch, * We should NOT get these here, but in a * ASCONF-ACK. */ - SCTPDBG(SCTP_DEBUG_INPUT2, "Peer sends ASCONF errors in a Operational Error?<%d>?\n", - error_type); + SCTPDBG(SCTP_DEBUG_INPUT2, "Peer sends ASCONF errors in a error cause with code %u.\n", + cause_code); break; case SCTP_CAUSE_OUT_OF_RESC: /* @@ -1312,15 +1324,19 @@ sctp_handle_error(struct sctp_chunkhdr *ch, */ break; default: - SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_handle_error: unknown error type = 0x%xh\n", - error_type); + SCTPDBG(SCTP_DEBUG_INPUT1, "sctp_handle_error: unknown code 0x%x\n", + cause_code); break; } - adjust = SCTP_SIZE32(error_len); - chklen -= adjust; - phdr = (struct sctp_paramhdr *)((caddr_t)phdr + adjust); + adjust = SCTP_SIZE32(cause_length); + if (remaining_length >= adjust) { + remaining_length -= adjust; + } else { + remaining_length = 0; + } + cause = (struct sctp_error_cause *)((caddr_t)cause + adjust); } - sctp_ulp_notify(SCTP_NOTIFY_REMOTE_ERROR, stcb, error, ch, SCTP_SO_NOT_LOCKED); + sctp_ulp_notify(SCTP_NOTIFY_REMOTE_ERROR, stcb, code, ch, SCTP_SO_NOT_LOCKED); return (0); } @@ -5072,7 +5088,7 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, case SCTP_OPERATION_ERROR: SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_OP_ERR\n"); if ((stcb != NULL) && (netp != NULL) && (*netp != NULL) && - sctp_handle_error(ch, stcb, *netp) < 0) { + sctp_handle_error(ch, stcb, *netp, contiguous) < 0) { *offset = length; return (NULL); } From edb01d11f89618f0bfb1db67682effb1dd9fa781 Mon Sep 17 00:00:00 2001 From: Gordon Tetlow Date: Wed, 15 Nov 2017 22:30:21 +0000 Subject: [PATCH 14/92] Properly bzero kldstat structure to prevent kernel information leak. Submitted by: kib Reported by: TJ Corley Security: CVE-2017-1088 --- sys/compat/freebsd32/freebsd32_misc.c | 31 ++++++++++++++++----------- sys/kern/kern_linker.c | 12 ++++++----- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index d9e0b9225a96..8ef33e5631d8 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -3331,8 +3331,8 @@ freebsd32_copyout_strings(struct image_params *imgp) int freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap) { - struct kld_file_stat stat; - struct kld32_file_stat stat32; + struct kld_file_stat *stat; + struct kld32_file_stat *stat32; int error, version; if ((error = copyin(&uap->stat->version, &version, sizeof(version))) @@ -3342,17 +3342,22 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap) version != sizeof(struct kld32_file_stat)) return (EINVAL); - error = kern_kldstat(td, uap->fileid, &stat); - if (error != 0) - return (error); - - bcopy(&stat.name[0], &stat32.name[0], sizeof(stat.name)); - CP(stat, stat32, refs); - CP(stat, stat32, id); - PTROUT_CP(stat, stat32, address); - CP(stat, stat32, size); - bcopy(&stat.pathname[0], &stat32.pathname[0], sizeof(stat.pathname)); - return (copyout(&stat32, uap->stat, version)); + stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO); + stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO); + error = kern_kldstat(td, uap->fileid, stat); + if (error == 0) { + bcopy(&stat->name[0], &stat32->name[0], sizeof(stat->name)); + CP(*stat, *stat32, refs); + CP(*stat, *stat32, id); + PTROUT_CP(*stat, *stat32, address); + CP(*stat, *stat32, size); + bcopy(&stat->pathname[0], &stat32->pathname[0], + sizeof(stat->pathname)); + error = copyout(stat32, uap->stat, version); + } + free(stat, M_TEMP); + free(stat32, M_TEMP); + return (error); } int diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 49914bb9bd52..e6ea73190e8f 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -1229,7 +1229,7 @@ sys_kldnext(struct thread *td, struct kldnext_args *uap) int sys_kldstat(struct thread *td, struct kldstat_args *uap) { - struct kld_file_stat stat; + struct kld_file_stat *stat; int error, version; /* @@ -1242,10 +1242,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *uap) version != sizeof(struct kld_file_stat)) return (EINVAL); - error = kern_kldstat(td, uap->fileid, &stat); - if (error != 0) - return (error); - return (copyout(&stat, uap->stat, version)); + stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO); + error = kern_kldstat(td, uap->fileid, stat); + if (error == 0) + error = copyout(stat, uap->stat, version); + free(stat, M_TEMP); + return (error); } int From f95f6841c8a6160d05a83d68e8a33e85cb63d700 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Wed, 15 Nov 2017 22:42:20 +0000 Subject: [PATCH 15/92] ipsec: Use the same keysize values for HMAC as prior to r324017 The HMAC construction natively permits any key size between 0 and the input block length. Before r324017, the auth_hash 'keysize' member was the hash output length, which was used by ipsec for key sizes. (Non-ipsec consumers need the ability to use other keysizes, hence, r324017.) The ipsec SADB code blindly uses the auth_hash 'keysize' member for both minimum and maximum key size, which is wrong (from an HMAC perspective). For now, just switch it to 'hashsize', which matches the existing expectations. Instead it should probably use the range [0, keysize]. But there may be other broken code in ipsec that rejects hashes with too small a minimum key size. Reported by: olivier@ Reviewed by: olivier, no objection from ae Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12770 --- sys/netipsec/key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 3c320cec116f..6a2d416a936b 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -6263,7 +6263,7 @@ key_getsizes_ah(const struct auth_hash *ah, int alg, u_int16_t* min, u_int16_t* max) { - *min = *max = ah->keysize; + *min = *max = ah->hashsize; if (ah->keysize == 0) { /* * Transform takes arbitrary key size but algorithm From 8c61c6bbdaa2198cb1c8d7c0b3c0812291275178 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Wed, 15 Nov 2017 23:48:02 +0000 Subject: [PATCH 16/92] cxgbe(4): Combine all _10g and _1g tunables and drop the suffix from their names. The finer-grained knobs weren't practically useful. Sponsored by: Chelsio Communications --- share/man/man4/cxgbe.4 | 37 ++--- share/man/man4/cxgbev.4 | 22 +-- sys/dev/cxgbe/adapter.h | 12 +- sys/dev/cxgbe/t4_main.c | 321 +++++++++++++--------------------------- sys/dev/cxgbe/t4_vf.c | 117 +++++---------- 5 files changed, 159 insertions(+), 350 deletions(-) diff --git a/share/man/man4/cxgbe.4 b/share/man/man4/cxgbe.4 index b0d7d8843b8d..761eb391e06a 100644 --- a/share/man/man4/cxgbe.4 +++ b/share/man/man4/cxgbe.4 @@ -172,37 +172,22 @@ types. A negative value for such a tunable instructs the driver to create up to that many queues if there are enough CPU cores available. .Bl -tag -width indent -.It Va hw.cxgbe.ntxq10g -Number of tx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.ntxq +Number of NIC tx queues used for a port. The default is 16 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq10g -Number of rx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nrxq +Number of NIC rx queues used for a port. The default is 8 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.ntxq1g -Number of tx queues used for a 1Gb port. -The default is 4 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq1g -Number of rx queues used for a 1Gb port. -The default is 2 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldtxq10g -Number of TOE tx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nofldtxq +Number of TOE tx queues used for a port. The default is 8 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldrxq10g -Number of TOE rx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nofldrxq +Number of TOE rx queues used for a port. The default is 2 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldtxq1g -Number of TOE tx queues used for a 1Gb port. -The default is 2 or the -number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldrxq1g -Number of TOE rx queues used for a 1Gb port. -The default is 1. .It Va hw.cxgbe.num_vis Number of virtual interfaces (VIs) created for each port. Each virtual interface creates a separate network interface. @@ -213,8 +198,7 @@ name from the table above. Additional virtual interfaces use a single pair of queues for rx and tx as well an additional pair of queues for TOE rx and tx. The default is 1. -.It Va hw.cxgbe.holdoff_timer_idx_10G -.It Va hw.cxgbe.holdoff_timer_idx_1G +.It Va hw.cxgbe.holdoff_timer_idx .It Va hw.cxgbe.holdoff_timer_idx_ofld Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 @@ -224,8 +208,7 @@ holdoff_timer_idx_ofld applies to queues used for TOE rx. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the dev..X.holdoff_tmr_idx and dev..X.holdoff_tmr_idx_ofld sysctls. -.It Va hw.cxgbe.holdoff_pktc_idx_10G -.It Va hw.cxgbe.holdoff_pktc_idx_1G +.It Va hw.cxgbe.holdoff_pktc_idx .It Va hw.cxgbe.holdoff_pktc_idx_ofld Packet-count index value used to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default, diff --git a/share/man/man4/cxgbev.4 b/share/man/man4/cxgbev.4 index 9dc3421eaea3..b2fcac6c632b 100644 --- a/share/man/man4/cxgbev.4 +++ b/share/man/man4/cxgbev.4 @@ -172,24 +172,15 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.cxgbe.ntxq10g -Number of tx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.ntxq +Number of tx queues used for a port. The default is 16 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq10g -Number of rx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nrxq +Number of rx queues used for a port. The default is 8 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.ntxq1g -Number of tx queues used for a 1Gb port. -The default is 4 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq1g -Number of rx queues used for a 1Gb port. -The default is 2 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.holdoff_timer_idx_10G -.It Va hw.cxgbe.holdoff_timer_idx_1G +.It Va hw.cxgbe.holdoff_timer_idx Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a @@ -197,8 +188,7 @@ value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the dev..X.holdoff_tmr_idx sysctl. -.It Va hw.cxgbe.holdoff_pktc_idx_10G -.It Va hw.cxgbe.holdoff_pktc_idx_1G +.It Va hw.cxgbe.holdoff_pktc_idx Packet-count index value used to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 5e1e701ed8c7..e76334aa43c9 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1114,15 +1114,11 @@ t4_use_ldst(struct adapter *sc) } /* t4_main.c */ -extern int t4_ntxq10g; -extern int t4_nrxq10g; -extern int t4_ntxq1g; -extern int t4_nrxq1g; +extern int t4_ntxq; +extern int t4_nrxq; extern int t4_intr_types; -extern int t4_tmr_idx_10g; -extern int t4_pktc_idx_10g; -extern int t4_tmr_idx_1g; -extern int t4_pktc_idx_1g; +extern int t4_tmr_idx; +extern int t4_pktc_idx; extern unsigned int t4_qsize_rxq; extern unsigned int t4_qsize_txq; extern device_method_t cxgbe_methods[]; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 9471be400348..9efbba949d97 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -241,23 +241,17 @@ SLIST_HEAD(, uld_info) t4_uld_list; */ /* - * Number of queues for tx and rx, 10G and 1G, NIC and offload. + * Number of queues for tx and rx, NIC and offload. */ -#define NTXQ_10G 16 -int t4_ntxq10g = -NTXQ_10G; -TUNABLE_INT("hw.cxgbe.ntxq10g", &t4_ntxq10g); +#define NTXQ 16 +int t4_ntxq = -NTXQ; +TUNABLE_INT("hw.cxgbe.ntxq", &t4_ntxq); +TUNABLE_INT("hw.cxgbe.ntxq10g", &t4_ntxq); /* Old name, undocumented */ -#define NRXQ_10G 8 -int t4_nrxq10g = -NRXQ_10G; -TUNABLE_INT("hw.cxgbe.nrxq10g", &t4_nrxq10g); - -#define NTXQ_1G 4 -int t4_ntxq1g = -NTXQ_1G; -TUNABLE_INT("hw.cxgbe.ntxq1g", &t4_ntxq1g); - -#define NRXQ_1G 2 -int t4_nrxq1g = -NRXQ_1G; -TUNABLE_INT("hw.cxgbe.nrxq1g", &t4_nrxq1g); +#define NRXQ 8 +int t4_nrxq = -NRXQ; +TUNABLE_INT("hw.cxgbe.nrxq", &t4_nrxq); +TUNABLE_INT("hw.cxgbe.nrxq10g", &t4_nrxq); /* Old name, undocumented */ #define NTXQ_VI 1 static int t4_ntxq_vi = -NTXQ_VI; @@ -271,21 +265,13 @@ static int t4_rsrv_noflowq = 0; TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq); #ifdef TCP_OFFLOAD -#define NOFLDTXQ_10G 8 -static int t4_nofldtxq10g = -NOFLDTXQ_10G; -TUNABLE_INT("hw.cxgbe.nofldtxq10g", &t4_nofldtxq10g); +#define NOFLDTXQ 8 +static int t4_nofldtxq = -NOFLDTXQ; +TUNABLE_INT("hw.cxgbe.nofldtxq", &t4_nofldtxq); -#define NOFLDRXQ_10G 2 -static int t4_nofldrxq10g = -NOFLDRXQ_10G; -TUNABLE_INT("hw.cxgbe.nofldrxq10g", &t4_nofldrxq10g); - -#define NOFLDTXQ_1G 2 -static int t4_nofldtxq1g = -NOFLDTXQ_1G; -TUNABLE_INT("hw.cxgbe.nofldtxq1g", &t4_nofldtxq1g); - -#define NOFLDRXQ_1G 1 -static int t4_nofldrxq1g = -NOFLDRXQ_1G; -TUNABLE_INT("hw.cxgbe.nofldrxq1g", &t4_nofldrxq1g); +#define NOFLDRXQ 2 +static int t4_nofldrxq = -NOFLDRXQ; +TUNABLE_INT("hw.cxgbe.nofldrxq", &t4_nofldrxq); #define NOFLDTXQ_VI 1 static int t4_nofldtxq_vi = -NOFLDTXQ_VI; @@ -360,23 +346,15 @@ TUNABLE_INT("hw.cxgbe.nnmrxq_vi", &t4_nnmrxq_vi); #endif /* - * Holdoff parameters for 10G and 1G ports. + * Holdoff parameters for ports. */ -#define TMR_IDX_10G 1 -int t4_tmr_idx_10g = TMR_IDX_10G; -TUNABLE_INT("hw.cxgbe.holdoff_timer_idx_10G", &t4_tmr_idx_10g); +#define TMR_IDX 1 +int t4_tmr_idx = TMR_IDX; +TUNABLE_INT("hw.cxgbe.holdoff_timer_idx", &t4_tmr_idx); -#define PKTC_IDX_10G (-1) -int t4_pktc_idx_10g = PKTC_IDX_10G; -TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_10G", &t4_pktc_idx_10g); - -#define TMR_IDX_1G 1 -int t4_tmr_idx_1g = TMR_IDX_1G; -TUNABLE_INT("hw.cxgbe.holdoff_timer_idx_1G", &t4_tmr_idx_1g); - -#define PKTC_IDX_1G (-1) -int t4_pktc_idx_1g = PKTC_IDX_1G; -TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx_1G", &t4_pktc_idx_1g); +#define PKTC_IDX (-1) +int t4_pktc_idx = PKTC_IDX; +TUNABLE_INT("hw.cxgbe.holdoff_pktc_idx", &t4_pktc_idx); /* * Size (# of entries) of each tx and rx queue. @@ -489,17 +467,12 @@ static int vi_mac_funcs[] = { struct intrs_and_queues { uint16_t intr_type; /* INTx, MSI, or MSI-X */ uint16_t nirq; /* Total # of vectors */ - uint16_t intr_flags_10g;/* Interrupt flags for each 10G port */ - uint16_t intr_flags_1g; /* Interrupt flags for each 1G port */ - uint16_t ntxq10g; /* # of NIC txq's for each 10G port */ - uint16_t nrxq10g; /* # of NIC rxq's for each 10G port */ - uint16_t ntxq1g; /* # of NIC txq's for each 1G port */ - uint16_t nrxq1g; /* # of NIC rxq's for each 1G port */ + uint16_t intr_flags; /* Interrupt flags for each port */ + uint16_t ntxq; /* # of NIC txq's for each port */ + uint16_t nrxq; /* # of NIC rxq's for each port */ uint16_t rsrv_noflowq; /* Flag whether to reserve queue 0 */ - uint16_t nofldtxq10g; /* # of TOE txq's for each 10G port */ - uint16_t nofldrxq10g; /* # of TOE rxq's for each 10G port */ - uint16_t nofldtxq1g; /* # of TOE txq's for each 1G port */ - uint16_t nofldrxq1g; /* # of TOE rxq's for each 1G port */ + uint16_t nofldtxq; /* # of TOE txq's for each port */ + uint16_t nofldrxq; /* # of TOE rxq's for each port */ /* The vcxgbe/vcxl interfaces use these and not the ones above. */ uint16_t ntxq_vi; /* # of NIC txq's */ @@ -532,7 +505,7 @@ static int fwmtype_to_hwmtype(int); static int validate_mt_off_len(struct adapter *, int, uint32_t, int, uint32_t *); static int fixup_devlog_params(struct adapter *); -static int cfg_itype_and_nqueues(struct adapter *, int, int, int, +static int cfg_itype_and_nqueues(struct adapter *, int, int, struct intrs_and_queues *); static int prep_firmware(struct adapter *); static int partition_resources(struct adapter *, const struct firmware *, @@ -857,7 +830,7 @@ static int t4_attach(device_t dev) { struct adapter *sc; - int rc = 0, i, j, n10g, n1g, rqidx, tqidx; + int rc = 0, i, j, rqidx, tqidx, nports; struct make_dev_args mda; struct intrs_and_queues iaq; struct sge *s; @@ -1011,11 +984,8 @@ t4_attach(device_t dev) /* * First pass over all the ports - allocate VIs and initialize some - * basic parameters like mac address, port type, etc. We also figure - * out whether a port is 10G or 1G and use that information when - * calculating how many interrupts to attempt to allocate. + * basic parameters like mac address, port type, etc. */ - n10g = n1g = 0; for_each_port(sc, i) { struct port_info *pi; @@ -1051,12 +1021,6 @@ t4_attach(device_t dev) mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); sc->chan_map[pi->tx_chan] = i; - if (port_top_speed(pi) >= 10) { - n10g++; - } else { - n1g++; - } - /* All VIs on this port share this media. */ ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change, cxgbe_media_status); @@ -1075,7 +1039,8 @@ t4_attach(device_t dev) /* * Interrupt type, # of interrupts, # of rx/tx queues, etc. */ - rc = cfg_itype_and_nqueues(sc, n10g, n1g, num_vis, &iaq); + nports = sc->params.nports; + rc = cfg_itype_and_nqueues(sc, nports, num_vis, &iaq); if (rc != 0) goto done; /* error message displayed already */ if (iaq.nrxq_vi + iaq.nofldrxq_vi + iaq.nnmrxq_vi == 0) @@ -1085,24 +1050,22 @@ t4_attach(device_t dev) sc->intr_count = iaq.nirq; s = &sc->sge; - s->nrxq = n10g * iaq.nrxq10g + n1g * iaq.nrxq1g; - s->ntxq = n10g * iaq.ntxq10g + n1g * iaq.ntxq1g; + s->nrxq = nports * iaq.nrxq; + s->ntxq = nports * iaq.ntxq; if (num_vis > 1) { - s->nrxq += (n10g + n1g) * (num_vis - 1) * iaq.nrxq_vi; - s->ntxq += (n10g + n1g) * (num_vis - 1) * iaq.ntxq_vi; + s->nrxq += nports * (num_vis - 1) * iaq.nrxq_vi; + s->ntxq += nports * (num_vis - 1) * iaq.ntxq_vi; } s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ - s->neq += sc->params.nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ + s->neq += nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ #ifdef TCP_OFFLOAD if (is_offload(sc)) { - s->nofldrxq = n10g * iaq.nofldrxq10g + n1g * iaq.nofldrxq1g; - s->nofldtxq = n10g * iaq.nofldtxq10g + n1g * iaq.nofldtxq1g; + s->nofldrxq = nports * iaq.nofldrxq; + s->nofldtxq = nports * iaq.nofldtxq; if (num_vis > 1) { - s->nofldrxq += (n10g + n1g) * (num_vis - 1) * - iaq.nofldrxq_vi; - s->nofldtxq += (n10g + n1g) * (num_vis - 1) * - iaq.nofldtxq_vi; + s->nofldrxq += nports * (num_vis - 1) * iaq.nofldrxq_vi; + s->nofldtxq += nports * (num_vis - 1) * iaq.nofldtxq_vi; } s->neq += s->nofldtxq + s->nofldrxq; s->niq += s->nofldrxq; @@ -1115,8 +1078,8 @@ t4_attach(device_t dev) #endif #ifdef DEV_NETMAP if (num_vis > 1) { - s->nnmrxq = (n10g + n1g) * (num_vis - 1) * iaq.nnmrxq_vi; - s->nnmtxq = (n10g + n1g) * (num_vis - 1) * iaq.nnmtxq_vi; + s->nnmrxq = nports * (num_vis - 1) * iaq.nnmrxq_vi; + s->nnmtxq = nports * (num_vis - 1) * iaq.nnmtxq_vi; } s->neq += s->nnmtxq + s->nnmrxq; s->niq += s->nnmrxq; @@ -1127,7 +1090,7 @@ t4_attach(device_t dev) M_CXGBE, M_ZERO | M_WAITOK); #endif - s->ctrlq = malloc(sc->params.nports * sizeof(struct sge_wrq), M_CXGBE, + s->ctrlq = malloc(nports * sizeof(struct sge_wrq), M_CXGBE, M_ZERO | M_WAITOK); s->rxq = malloc(s->nrxq * sizeof(struct sge_rxq), M_CXGBE, M_ZERO | M_WAITOK); @@ -1170,19 +1133,12 @@ t4_attach(device_t dev) vi->first_rxq = rqidx; vi->first_txq = tqidx; - if (port_top_speed(pi) >= 10) { - vi->tmr_idx = t4_tmr_idx_10g; - vi->pktc_idx = t4_pktc_idx_10g; - vi->flags |= iaq.intr_flags_10g & INTR_RXQ; - vi->nrxq = j == 0 ? iaq.nrxq10g : iaq.nrxq_vi; - vi->ntxq = j == 0 ? iaq.ntxq10g : iaq.ntxq_vi; - } else { - vi->tmr_idx = t4_tmr_idx_1g; - vi->pktc_idx = t4_pktc_idx_1g; - vi->flags |= iaq.intr_flags_1g & INTR_RXQ; - vi->nrxq = j == 0 ? iaq.nrxq1g : iaq.nrxq_vi; - vi->ntxq = j == 0 ? iaq.ntxq1g : iaq.ntxq_vi; - } + vi->tmr_idx = t4_tmr_idx; + vi->pktc_idx = t4_pktc_idx; + vi->flags |= iaq.intr_flags & INTR_RXQ; + vi->nrxq = j == 0 ? iaq.nrxq : iaq.nrxq_vi; + vi->ntxq = j == 0 ? iaq.ntxq : iaq.ntxq_vi; + rqidx += vi->nrxq; tqidx += vi->ntxq; @@ -1196,19 +1152,10 @@ t4_attach(device_t dev) vi->ofld_pktc_idx = t4_pktc_idx_ofld; vi->first_ofld_rxq = ofld_rqidx; vi->first_ofld_txq = ofld_tqidx; - if (port_top_speed(pi) >= 10) { - vi->flags |= iaq.intr_flags_10g & INTR_OFLD_RXQ; - vi->nofldrxq = j == 0 ? iaq.nofldrxq10g : - iaq.nofldrxq_vi; - vi->nofldtxq = j == 0 ? iaq.nofldtxq10g : - iaq.nofldtxq_vi; - } else { - vi->flags |= iaq.intr_flags_1g & INTR_OFLD_RXQ; - vi->nofldrxq = j == 0 ? iaq.nofldrxq1g : - iaq.nofldrxq_vi; - vi->nofldtxq = j == 0 ? iaq.nofldtxq1g : - iaq.nofldtxq_vi; - } + vi->flags |= iaq.intr_flags & INTR_OFLD_RXQ; + vi->nofldrxq = j == 0 ? iaq.nofldrxq : iaq.nofldrxq_vi; + vi->nofldtxq = j == 0 ? iaq.nofldtxq : iaq.nofldtxq_vi; + ofld_rqidx += vi->nofldrxq; ofld_tqidx += vi->nofldtxq; #endif @@ -2715,28 +2662,25 @@ fixup_devlog_params(struct adapter *sc) } static int -cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, int num_vis, +cfg_itype_and_nqueues(struct adapter *sc, int nports, int num_vis, struct intrs_and_queues *iaq) { - int rc, itype, navail, nrxq10g, nrxq1g, n; - int nofldrxq10g = 0, nofldrxq1g = 0; + int rc, itype, navail, nrxq, n; + int nofldrxq = 0; + + MPASS(nports > 0); bzero(iaq, sizeof(*iaq)); - - iaq->ntxq10g = t4_ntxq10g; - iaq->ntxq1g = t4_ntxq1g; + iaq->ntxq = t4_ntxq; iaq->ntxq_vi = t4_ntxq_vi; - iaq->nrxq10g = nrxq10g = t4_nrxq10g; - iaq->nrxq1g = nrxq1g = t4_nrxq1g; + iaq->nrxq = nrxq = t4_nrxq; iaq->nrxq_vi = t4_nrxq_vi; iaq->rsrv_noflowq = t4_rsrv_noflowq; #ifdef TCP_OFFLOAD if (is_offload(sc)) { - iaq->nofldtxq10g = t4_nofldtxq10g; - iaq->nofldtxq1g = t4_nofldtxq1g; + iaq->nofldtxq = t4_nofldtxq; iaq->nofldtxq_vi = t4_nofldtxq_vi; - iaq->nofldrxq10g = nofldrxq10g = t4_nofldrxq10g; - iaq->nofldrxq1g = nofldrxq1g = t4_nofldrxq1g; + iaq->nofldrxq = nofldrxq = t4_nofldrxq; iaq->nofldrxq_vi = t4_nofldrxq_vi; } #endif @@ -2761,8 +2705,7 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, int num_vis, continue; iaq->intr_type = itype; - iaq->intr_flags_10g = 0; - iaq->intr_flags_1g = 0; + iaq->intr_flags = 0; /* * Best option: an interrupt vector for errors, one for the @@ -2772,15 +2715,13 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, int num_vis, * because only one set of queues is active at a time. */ iaq->nirq = T4_EXTRA_INTR; - iaq->nirq += n10g * (nrxq10g + nofldrxq10g); - iaq->nirq += n1g * (nrxq1g + nofldrxq1g); - iaq->nirq += (n10g + n1g) * (num_vis - 1) * + iaq->nirq += nports * (nrxq + nofldrxq); + iaq->nirq += nports * (num_vis - 1) * max(iaq->nrxq_vi, iaq->nnmrxq_vi); /* See comment above. */ - iaq->nirq += (n10g + n1g) * (num_vis - 1) * iaq->nofldrxq_vi; + iaq->nirq += nports * (num_vis - 1) * iaq->nofldrxq_vi; if (iaq->nirq <= navail && (itype != INTR_MSI || powerof2(iaq->nirq))) { - iaq->intr_flags_10g = INTR_ALL; - iaq->intr_flags_1g = INTR_ALL; + iaq->intr_flags = INTR_ALL; goto allocate; } @@ -2788,13 +2729,11 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, int num_vis, if (num_vis > 1) { device_printf(sc->dev, "virtual interfaces disabled " "because num_vis=%u with current settings " - "(nrxq10g=%u, nrxq1g=%u, nofldrxq10g=%u, " - "nofldrxq1g=%u, nrxq_vi=%u nofldrxq_vi=%u, " + "(nrxq=%u, nofldrxq=%u, nrxq_vi=%u nofldrxq_vi=%u, " "nnmrxq_vi=%u) would need %u interrupts but " - "only %u are available.\n", num_vis, nrxq10g, - nrxq1g, nofldrxq10g, nofldrxq1g, iaq->nrxq_vi, - iaq->nofldrxq_vi, iaq->nnmrxq_vi, iaq->nirq, - navail); + "only %u are available.\n", num_vis, nrxq, + nofldrxq, iaq->nrxq_vi, iaq->nofldrxq_vi, + iaq->nnmrxq_vi, iaq->nirq, navail); num_vis = 1; iaq->ntxq_vi = iaq->nrxq_vi = 0; iaq->nofldtxq_vi = iaq->nofldrxq_vi = 0; @@ -2809,19 +2748,12 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, int num_vis, * will forward their interrupts to those that do. */ iaq->nirq = T4_EXTRA_INTR; - if (nrxq10g >= nofldrxq10g) { - iaq->intr_flags_10g = INTR_RXQ; - iaq->nirq += n10g * nrxq10g; + if (nrxq >= nofldrxq) { + iaq->intr_flags = INTR_RXQ; + iaq->nirq += nports * nrxq; } else { - iaq->intr_flags_10g = INTR_OFLD_RXQ; - iaq->nirq += n10g * nofldrxq10g; - } - if (nrxq1g >= nofldrxq1g) { - iaq->intr_flags_1g = INTR_RXQ; - iaq->nirq += n1g * nrxq1g; - } else { - iaq->intr_flags_1g = INTR_OFLD_RXQ; - iaq->nirq += n1g * nofldrxq1g; + iaq->intr_flags = INTR_OFLD_RXQ; + iaq->nirq += nports * nofldrxq; } if (iaq->nirq <= navail && (itype != INTR_MSI || powerof2(iaq->nirq))) @@ -2834,45 +2766,24 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, int num_vis, * fit what's available to us. */ iaq->nirq = T4_EXTRA_INTR; - iaq->nirq += n10g + n1g; + iaq->nirq += nports; if (iaq->nirq <= navail) { int leftover = navail - iaq->nirq; + int target = max(nrxq, nofldrxq); - if (n10g > 0) { - int target = max(nrxq10g, nofldrxq10g); + iaq->intr_flags = nrxq >= nofldrxq ? + INTR_RXQ : INTR_OFLD_RXQ; - iaq->intr_flags_10g = nrxq10g >= nofldrxq10g ? - INTR_RXQ : INTR_OFLD_RXQ; - - n = 1; - while (n < target && leftover >= n10g) { - leftover -= n10g; - iaq->nirq += n10g; - n++; - } - iaq->nrxq10g = min(n, nrxq10g); -#ifdef TCP_OFFLOAD - iaq->nofldrxq10g = min(n, nofldrxq10g); -#endif + n = 1; + while (n < target && leftover >= nports) { + leftover -= nports; + iaq->nirq += nports; + n++; } - - if (n1g > 0) { - int target = max(nrxq1g, nofldrxq1g); - - iaq->intr_flags_1g = nrxq1g >= nofldrxq1g ? - INTR_RXQ : INTR_OFLD_RXQ; - - n = 1; - while (n < target && leftover >= n1g) { - leftover -= n1g; - iaq->nirq += n1g; - n++; - } - iaq->nrxq1g = min(n, nrxq1g); + iaq->nrxq = min(n, nrxq); #ifdef TCP_OFFLOAD - iaq->nofldrxq1g = min(n, nofldrxq1g); + iaq->nofldrxq = min(n, nofldrxq); #endif - } if (itype != INTR_MSI || powerof2(iaq->nirq)) goto allocate; @@ -2881,11 +2792,11 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, int num_vis, /* * Least desirable option: one interrupt vector for everything. */ - iaq->nirq = iaq->nrxq10g = iaq->nrxq1g = 1; - iaq->intr_flags_10g = iaq->intr_flags_1g = 0; + iaq->nirq = iaq->nrxq = 1; + iaq->intr_flags = 0; #ifdef TCP_OFFLOAD if (is_offload(sc)) - iaq->nofldrxq10g = iaq->nofldrxq1g = 1; + iaq->nofldrxq = 1; #endif allocate: navail = iaq->nirq; @@ -9941,50 +9852,30 @@ tweak_tunables(void) { int nc = mp_ncpus; /* our snapshot of the number of CPUs */ - if (t4_ntxq10g < 1) { + if (t4_ntxq < 1) { #ifdef RSS - t4_ntxq10g = rss_getnumbuckets(); + t4_ntxq = rss_getnumbuckets(); #else - calculate_nqueues(&t4_ntxq10g, nc, NTXQ_10G); -#endif - } - - if (t4_ntxq1g < 1) { -#ifdef RSS - /* XXX: way too many for 1GbE? */ - t4_ntxq1g = rss_getnumbuckets(); -#else - calculate_nqueues(&t4_ntxq1g, nc, NTXQ_1G); + calculate_nqueues(&t4_ntxq, nc, NTXQ); #endif } calculate_nqueues(&t4_ntxq_vi, nc, NTXQ_VI); - if (t4_nrxq10g < 1) { + if (t4_nrxq < 1) { #ifdef RSS - t4_nrxq10g = rss_getnumbuckets(); + t4_nrxq = rss_getnumbuckets(); #else - calculate_nqueues(&t4_nrxq10g, nc, NRXQ_10G); -#endif - } - - if (t4_nrxq1g < 1) { -#ifdef RSS - /* XXX: way too many for 1GbE? */ - t4_nrxq1g = rss_getnumbuckets(); -#else - calculate_nqueues(&t4_nrxq1g, nc, NRXQ_1G); + calculate_nqueues(&t4_nrxq, nc, NRXQ); #endif } calculate_nqueues(&t4_nrxq_vi, nc, NRXQ_VI); #ifdef TCP_OFFLOAD - calculate_nqueues(&t4_nofldtxq10g, nc, NOFLDTXQ_10G); - calculate_nqueues(&t4_nofldtxq1g, nc, NOFLDTXQ_1G); + calculate_nqueues(&t4_nofldtxq, nc, NOFLDTXQ); calculate_nqueues(&t4_nofldtxq_vi, nc, NOFLDTXQ_VI); - calculate_nqueues(&t4_nofldrxq10g, nc, NOFLDRXQ_10G); - calculate_nqueues(&t4_nofldrxq1g, nc, NOFLDRXQ_1G); + calculate_nqueues(&t4_nofldrxq, nc, NOFLDRXQ); calculate_nqueues(&t4_nofldrxq_vi, nc, NOFLDRXQ_VI); if (t4_toecaps_allowed == -1) @@ -10022,17 +9913,11 @@ tweak_tunables(void) calculate_nqueues(&t4_nnmrxq_vi, nc, NNMRXQ_VI); #endif - if (t4_tmr_idx_10g < 0 || t4_tmr_idx_10g >= SGE_NTIMERS) - t4_tmr_idx_10g = TMR_IDX_10G; + if (t4_tmr_idx < 0 || t4_tmr_idx >= SGE_NTIMERS) + t4_tmr_idx = TMR_IDX; - if (t4_pktc_idx_10g < -1 || t4_pktc_idx_10g >= SGE_NCOUNTERS) - t4_pktc_idx_10g = PKTC_IDX_10G; - - if (t4_tmr_idx_1g < 0 || t4_tmr_idx_1g >= SGE_NTIMERS) - t4_tmr_idx_1g = TMR_IDX_1G; - - if (t4_pktc_idx_1g < -1 || t4_pktc_idx_1g >= SGE_NCOUNTERS) - t4_pktc_idx_1g = PKTC_IDX_1G; + if (t4_pktc_idx < -1 || t4_pktc_idx >= SGE_NCOUNTERS) + t4_pktc_idx = PKTC_IDX; if (t4_qsize_txq < 128) t4_qsize_txq = 128; diff --git a/sys/dev/cxgbe/t4_vf.c b/sys/dev/cxgbe/t4_vf.c index d6e399a91c0d..e18bcf04d092 100644 --- a/sys/dev/cxgbe/t4_vf.c +++ b/sys/dev/cxgbe/t4_vf.c @@ -62,12 +62,9 @@ __FBSDID("$FreeBSD$"); struct intrs_and_queues { uint16_t intr_type; /* MSI, or MSI-X */ uint16_t nirq; /* Total # of vectors */ - uint16_t intr_flags_10g;/* Interrupt flags for each 10G port */ - uint16_t intr_flags_1g; /* Interrupt flags for each 1G port */ - uint16_t ntxq10g; /* # of NIC txq's for each 10G port */ - uint16_t nrxq10g; /* # of NIC rxq's for each 10G port */ - uint16_t ntxq1g; /* # of NIC txq's for each 1G port */ - uint16_t nrxq1g; /* # of NIC rxq's for each 1G port */ + uint16_t intr_flags; /* Interrupt flags for each port */ + uint16_t ntxq; /* # of NIC txq's for each port */ + uint16_t nrxq; /* # of NIC rxq's for each port */ }; struct { @@ -306,12 +303,10 @@ set_params__post_init(struct adapter *sc) #undef FW_PARAM_DEV static int -cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, - struct intrs_and_queues *iaq) +cfg_itype_and_nqueues(struct adapter *sc, struct intrs_and_queues *iaq) { struct vf_resources *vfres; - int nrxq10g, nrxq1g, nrxq; - int ntxq10g, ntxq1g, ntxq; + int nrxq, ntxq, nports; int itype, iq_avail, navail, rc; /* @@ -319,6 +314,7 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, * we can allocate enough interrupts for our layout. */ vfres = &sc->params.vfres; + nports = sc->params.nports; bzero(iaq, sizeof(*iaq)); for (itype = INTR_MSIX; itype != 0; itype >>= 1) { @@ -334,8 +330,7 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, continue; iaq->intr_type = itype; - iaq->intr_flags_10g = 0; - iaq->intr_flags_1g = 0; + iaq->intr_flags = 0; /* * XXX: The Linux driver reserves an Ingress Queue for @@ -358,10 +353,10 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, * limit on ingress queues. */ iq_avail = vfres->niqflint - iaq->nirq; - if (iq_avail < n10g + n1g) { + if (iq_avail < nports) { device_printf(sc->dev, "Not enough ingress queues (%d) for %d ports\n", - vfres->niqflint, n10g + n1g); + vfres->niqflint, nports); return (ENXIO); } @@ -371,26 +366,17 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, * port, then don't bother, we will just forward all * interrupts to one interrupt in that case. */ - if (iaq->nirq + n10g + n1g <= navail) { + if (iaq->nirq + nports <= navail) { if (iq_avail > navail - iaq->nirq) iq_avail = navail - iaq->nirq; } - nrxq10g = t4_nrxq10g; - nrxq1g = t4_nrxq1g; - nrxq = n10g * nrxq10g + n1g * nrxq1g; - if (nrxq > iq_avail && nrxq1g > 1) { - /* Too many ingress queues. Try just 1 for 1G. */ - nrxq1g = 1; - nrxq = n10g * nrxq10g + n1g * nrxq1g; - } + nrxq = nports * t4_nrxq; if (nrxq > iq_avail) { /* - * Still too many ingress queues. Use what we - * can for each 10G port. + * Too many ingress queues. Use what we can. */ - nrxq10g = (iq_avail - n1g) / n10g; - nrxq = n10g * nrxq10g + n1g * nrxq1g; + nrxq = (iq_avail / nports) * nports; } KASSERT(nrxq <= iq_avail, ("too many ingress queues")); @@ -398,45 +384,34 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, * Next, determine the upper bound on txqs from the limit * on ETH queues. */ - if (vfres->nethctrl < n10g + n1g) { + if (vfres->nethctrl < nports) { device_printf(sc->dev, "Not enough ETH queues (%d) for %d ports\n", - vfres->nethctrl, n10g + n1g); + vfres->nethctrl, nports); return (ENXIO); } - ntxq10g = t4_ntxq10g; - ntxq1g = t4_ntxq1g; - ntxq = n10g * ntxq10g + n1g * ntxq1g; - if (ntxq > vfres->nethctrl) { - /* Too many ETH queues. Try just 1 for 1G. */ - ntxq1g = 1; - ntxq = n10g * ntxq10g + n1g * ntxq1g; - } + ntxq = nports * t4_ntxq; if (ntxq > vfres->nethctrl) { /* - * Still too many ETH queues. Use what we - * can for each 10G port. + * Too many ETH queues. Use what we can. */ - ntxq10g = (vfres->nethctrl - n1g) / n10g; - ntxq = n10g * ntxq10g + n1g * ntxq1g; + ntxq = (vfres->nethctrl / nports) * nports; } KASSERT(ntxq <= vfres->nethctrl, ("too many ETH queues")); /* * Finally, ensure we have enough egress queues. */ - if (vfres->neq < (n10g + n1g) * 2) { + if (vfres->neq < nports * 2) { device_printf(sc->dev, "Not enough egress queues (%d) for %d ports\n", - vfres->neq, n10g + n1g); + vfres->neq, nports); return (ENXIO); } if (nrxq + ntxq > vfres->neq) { /* Just punt and use 1 for everything. */ - nrxq1g = ntxq1g = nrxq10g = ntxq10g = 1; - nrxq = n10g * nrxq10g + n1g * nrxq1g; - ntxq = n10g * ntxq10g + n1g * ntxq1g; + nrxq = ntxq = nports; } KASSERT(nrxq <= iq_avail, ("too many ingress queues")); KASSERT(ntxq <= vfres->nethctrl, ("too many ETH queues")); @@ -447,10 +422,8 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, * have to be a power of 2 as well. */ iaq->nirq += nrxq; - iaq->ntxq10g = ntxq10g; - iaq->ntxq1g = ntxq1g; - iaq->nrxq10g = nrxq10g; - iaq->nrxq1g = nrxq1g; + iaq->ntxq = ntxq; + iaq->nrxq = nrxq; if (iaq->nirq <= navail && (itype != INTR_MSI || powerof2(iaq->nirq))) { navail = iaq->nirq; @@ -465,8 +438,7 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, return (rc); } if (navail == iaq->nirq) { - iaq->intr_flags_10g = INTR_RXQ; - iaq->intr_flags_1g = INTR_RXQ; + iaq->intr_flags = INTR_RXQ; return (0); } pci_release_msi(sc->dev); @@ -483,8 +455,7 @@ cfg_itype_and_nqueues(struct adapter *sc, int n10g, int n1g, device_printf(sc->dev, "failed to allocate vectors:%d, type=%d, req=%d, rcvd=%d\n", itype, rc, iaq->nirq, navail); - iaq->intr_flags_10g = 0; - iaq->intr_flags_1g = 0; + iaq->intr_flags = 0; return (rc); } @@ -500,7 +471,7 @@ static int t4vf_attach(device_t dev) { struct adapter *sc; - int rc = 0, i, j, n10g, n1g, rqidx, tqidx; + int rc = 0, i, j, rqidx, tqidx; struct make_dev_args mda; struct intrs_and_queues iaq; struct sge *s; @@ -634,11 +605,8 @@ t4vf_attach(device_t dev) /* * First pass over all the ports - allocate VIs and initialize some - * basic parameters like mac address, port type, etc. We also figure - * out whether a port is 10G or 1G and use that information when - * calculating how many interrupts to attempt to allocate. + * basic parameters like mac address, port type, etc. */ - n10g = n1g = 0; for_each_port(sc, i) { struct port_info *pi; @@ -673,12 +641,6 @@ t4vf_attach(device_t dev) mtx_init(&pi->pi_lock, pi->lockname, 0, MTX_DEF); sc->chan_map[pi->tx_chan] = i; - if (port_top_speed(pi) >= 10) { - n10g++; - } else { - n1g++; - } - pi->dev = device_add_child(dev, sc->names->vf_ifnet_name, -1); if (pi->dev == NULL) { device_printf(dev, @@ -693,7 +655,7 @@ t4vf_attach(device_t dev) /* * Interrupt type, # of interrupts, # of rx/tx queues, etc. */ - rc = cfg_itype_and_nqueues(sc, n10g, n1g, &iaq); + rc = cfg_itype_and_nqueues(sc, &iaq); if (rc != 0) goto done; /* error message displayed already */ @@ -701,8 +663,8 @@ t4vf_attach(device_t dev) sc->intr_count = iaq.nirq; s = &sc->sge; - s->nrxq = n10g * iaq.nrxq10g + n1g * iaq.nrxq1g; - s->ntxq = n10g * iaq.ntxq10g + n1g * iaq.ntxq1g; + s->nrxq = sc->params.nports * iaq.nrxq; + s->ntxq = sc->params.nports * iaq.ntxq; s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ s->neq += sc->params.nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ s->niq = s->nrxq + 1; /* 1 extra for firmware event queue */ @@ -738,19 +700,12 @@ t4vf_attach(device_t dev) vi->first_rxq = rqidx; vi->first_txq = tqidx; - if (port_top_speed(pi) >= 10) { - vi->tmr_idx = t4_tmr_idx_10g; - vi->pktc_idx = t4_pktc_idx_10g; - vi->flags |= iaq.intr_flags_10g & INTR_RXQ; - vi->nrxq = j == 0 ? iaq.nrxq10g : 1; - vi->ntxq = j == 0 ? iaq.ntxq10g : 1; - } else { - vi->tmr_idx = t4_tmr_idx_1g; - vi->pktc_idx = t4_pktc_idx_1g; - vi->flags |= iaq.intr_flags_1g & INTR_RXQ; - vi->nrxq = j == 0 ? iaq.nrxq1g : 1; - vi->ntxq = j == 0 ? iaq.ntxq1g : 1; - } + vi->tmr_idx = t4_tmr_idx; + vi->pktc_idx = t4_pktc_idx; + vi->flags |= iaq.intr_flags & INTR_RXQ; + vi->nrxq = j == 0 ? iaq.nrxq: 1; + vi->ntxq = j == 0 ? iaq.ntxq: 1; + rqidx += vi->nrxq; tqidx += vi->ntxq; From 098150fb90c8401fe0dace77da5be8f894483921 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Wed, 15 Nov 2017 23:51:17 +0000 Subject: [PATCH 17/92] Fix some formatting issues, bump .Dd to today's date, don't use contractions, and make igor almost happy with this (two issues are false positives, and I'm not sure a synopsis makes sense). Sponsored by: Netflix --- share/man/man7/arch.7 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index bb586caf92f8..bff5980e0483 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2017 +.Dd November 15, 2017 .Dt ARCH 7 .Os .Sh NAME @@ -68,7 +68,7 @@ and .Vt ptrdiff_t should be avoided. .Pp -On some architectures, e.g. +On some architectures, e.g., .Dv sparc64 , .Dv powerpc and AIM variants of @@ -367,7 +367,7 @@ It is often the same as just as one CPU architecture can be implemented by many different hardware platforms, one hardware platform may support multiple CPU architecture family members, though with different binaries. -For example, +For example, .Dv MACHINE of i386 supported the IBM-AT hardware platform while the .Dv MACHINE @@ -393,12 +393,12 @@ integers (endian). It may also encode a variation in the size of the integer or pointer. It may also encode a ISA revision. It may also encode hard versus soft floating point ABI and usage. -It may also encode a variant ABI when there other factors don't +It may also encode a variant ABI when there other factors do not uniquely define the ABI (eg, MIPS' n32 ABI). It, along with .Dv MACHINE, define the ABI used by the system. For example, the MIPS CPU processor family supports 9 different -combinations encoding pointer size, endian and hard vs soft float (for +combinations encoding pointer size, endian and hard versus soft float (for 8 combinations) as well as N32 (which only ever had one variation of all these). Generally, the plain CPU name specifies the most common (or at least @@ -429,15 +429,18 @@ framework). to build. It is used to optimize the build for a specific CPU / core that the binaries run on. -Generally, this doesn't change the ABI, though it can be a fine line +Generally, this does not change the ABI, though it can be a fine line between optimization for specific cases. -.It Dv TARGET Used to set Dv MACHINE in the top level Makefile for cross building. +.It Dv TARGET Used to set +.Dv MACHINE +in the top level Makefile for cross building. Unused outside of that scope. It is not passed down to the rest of the build. -Makefiles outside of the top level shouldn't use it at all (though +Makefiles outside of the top level should not use it at all (though some have their own private copy for hysterical raisons). .It Dv TARGET_ARCH Used to set -.Dv MACHINE_ARCH by the top level Makefile for cross building. +.Dv MACHINE_ARCH +by the top level Makefile for cross building. Like .Dv TARGET , it is unused outside of that scope. .El From 320bd864aa7571e86bd6b3f1c8b64f63fd215aec Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 16 Nov 2017 00:19:44 +0000 Subject: [PATCH 18/92] Use better wording: change there to the and define to defines. Also fix a run-a-way macro invocation of Dv. Noticed by: matteo@ --- share/man/man7/arch.7 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index bff5980e0483..7655cef8dee4 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -393,10 +393,11 @@ integers (endian). It may also encode a variation in the size of the integer or pointer. It may also encode a ISA revision. It may also encode hard versus soft floating point ABI and usage. -It may also encode a variant ABI when there other factors do not -uniquely define the ABI (eg, MIPS' n32 ABI). +It may also encode a variant ABI when the other factors do not +uniquely define the ABI (e.g., MIPS' n32 ABI). It, along with -.Dv MACHINE, define the ABI used by the system. +.Dv MACHINE , +defines the ABI used by the system. For example, the MIPS CPU processor family supports 9 different combinations encoding pointer size, endian and hard versus soft float (for 8 combinations) as well as N32 (which only ever had one variation of From d406c47d7182270794b3821dbd0f5640e9c69ae5 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Thu, 16 Nov 2017 01:33:53 +0000 Subject: [PATCH 19/92] cxgbe(4): Sanitize t4_num_vis during MOD_LOAD like all other t4_* tunables. Add num_vis to the intrs_and_queues structure as it affects the number of interrupts requested and queues created. In future cfg_itype_and_nqueues might lower it incrementally instead of going straight to 1 when enough interrupts aren't available. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 62 ++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 9efbba949d97..7861b6a8a016 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -466,6 +466,7 @@ static int vi_mac_funcs[] = { struct intrs_and_queues { uint16_t intr_type; /* INTx, MSI, or MSI-X */ + uint16_t num_vis; /* number of VIs for each port */ uint16_t nirq; /* Total # of vectors */ uint16_t intr_flags; /* Interrupt flags for each port */ uint16_t ntxq; /* # of NIC txq's for each port */ @@ -505,8 +506,7 @@ static int fwmtype_to_hwmtype(int); static int validate_mt_off_len(struct adapter *, int, uint32_t, int, uint32_t *); static int fixup_devlog_params(struct adapter *); -static int cfg_itype_and_nqueues(struct adapter *, int, int, - struct intrs_and_queues *); +static int cfg_itype_and_nqueues(struct adapter *, struct intrs_and_queues *); static int prep_firmware(struct adapter *); static int partition_resources(struct adapter *, const struct firmware *, const char *); @@ -964,24 +964,6 @@ t4_attach(device_t dev) if (rc != 0) goto done; /* error message displayed already */ - /* - * Number of VIs to create per-port. The first VI is the "main" regular - * VI for the port. The rest are additional virtual interfaces on the - * same physical port. Note that the main VI does not have native - * netmap support but the extra VIs do. - * - * Limit the number of VIs per port to the number of available - * MAC addresses per port. - */ - if (t4_num_vis >= 1) - num_vis = t4_num_vis; - else - num_vis = 1; - if (num_vis > nitems(vi_mac_funcs)) { - num_vis = nitems(vi_mac_funcs); - device_printf(dev, "Number of VIs limited to %d\n", num_vis); - } - /* * First pass over all the ports - allocate VIs and initialize some * basic parameters like mac address, port type, etc. @@ -999,7 +981,7 @@ t4_attach(device_t dev) * XXX: vi[0] is special so we can't delay this allocation until * pi->nvi's final value is known. */ - pi->vi = malloc(sizeof(struct vi_info) * num_vis, M_CXGBE, + pi->vi = malloc(sizeof(struct vi_info) * t4_num_vis, M_CXGBE, M_ZERO | M_WAITOK); /* @@ -1040,12 +1022,11 @@ t4_attach(device_t dev) * Interrupt type, # of interrupts, # of rx/tx queues, etc. */ nports = sc->params.nports; - rc = cfg_itype_and_nqueues(sc, nports, num_vis, &iaq); + rc = cfg_itype_and_nqueues(sc, &iaq); if (rc != 0) goto done; /* error message displayed already */ - if (iaq.nrxq_vi + iaq.nofldrxq_vi + iaq.nnmrxq_vi == 0) - num_vis = 1; + num_vis = iaq.num_vis; sc->intr_type = iaq.intr_type; sc->intr_count = iaq.nirq; @@ -2662,15 +2643,16 @@ fixup_devlog_params(struct adapter *sc) } static int -cfg_itype_and_nqueues(struct adapter *sc, int nports, int num_vis, - struct intrs_and_queues *iaq) +cfg_itype_and_nqueues(struct adapter *sc, struct intrs_and_queues *iaq) { - int rc, itype, navail, nrxq, n; + int rc, itype, navail, nrxq, nports, n; int nofldrxq = 0; + nports = sc->params.nports; MPASS(nports > 0); bzero(iaq, sizeof(*iaq)); + iaq->num_vis = t4_num_vis; iaq->ntxq = t4_ntxq; iaq->ntxq_vi = t4_ntxq_vi; iaq->nrxq = nrxq = t4_nrxq; @@ -2716,9 +2698,9 @@ cfg_itype_and_nqueues(struct adapter *sc, int nports, int num_vis, */ iaq->nirq = T4_EXTRA_INTR; iaq->nirq += nports * (nrxq + nofldrxq); - iaq->nirq += nports * (num_vis - 1) * + iaq->nirq += nports * (iaq->num_vis - 1) * max(iaq->nrxq_vi, iaq->nnmrxq_vi); /* See comment above. */ - iaq->nirq += nports * (num_vis - 1) * iaq->nofldrxq_vi; + iaq->nirq += nports * (iaq->num_vis - 1) * iaq->nofldrxq_vi; if (iaq->nirq <= navail && (itype != INTR_MSI || powerof2(iaq->nirq))) { iaq->intr_flags = INTR_ALL; @@ -2726,15 +2708,15 @@ cfg_itype_and_nqueues(struct adapter *sc, int nports, int num_vis, } /* Disable the VIs (and netmap) if there aren't enough intrs */ - if (num_vis > 1) { + if (iaq->num_vis > 1) { device_printf(sc->dev, "virtual interfaces disabled " "because num_vis=%u with current settings " "(nrxq=%u, nofldrxq=%u, nrxq_vi=%u nofldrxq_vi=%u, " "nnmrxq_vi=%u) would need %u interrupts but " - "only %u are available.\n", num_vis, nrxq, + "only %u are available.\n", iaq->num_vis, nrxq, nofldrxq, iaq->nrxq_vi, iaq->nofldrxq_vi, iaq->nnmrxq_vi, iaq->nirq, navail); - num_vis = 1; + iaq->num_vis = 1; iaq->ntxq_vi = iaq->nrxq_vi = 0; iaq->nofldtxq_vi = iaq->nofldrxq_vi = 0; iaq->nnmtxq_vi = iaq->nnmrxq_vi = 0; @@ -9928,6 +9910,22 @@ tweak_tunables(void) t4_qsize_rxq++; t4_intr_types &= INTR_MSIX | INTR_MSI | INTR_INTX; + + /* + * Number of VIs to create per-port. The first VI is the "main" regular + * VI for the port. The rest are additional virtual interfaces on the + * same physical port. Note that the main VI does not have native + * netmap support but the extra VIs do. + * + * Limit the number of VIs per port to the number of available + * MAC addresses per port. + */ + if (t4_num_vis < 1) + t4_num_vis = 1; + if (t4_num_vis > nitems(vi_mac_funcs)) { + t4_num_vis = nitems(vi_mac_funcs); + printf("cxgbe: number of VIs limited to %d\n", t4_num_vis); + } } #ifdef DDB From d3d5e96893604f7de179d6073079e1919c6b6333 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Thu, 16 Nov 2017 02:42:37 +0000 Subject: [PATCH 20/92] cxgbe(4): Remove rsrv_noflowq from intrs_and_queues structure as it does not influence or get affected by the number of interrupts or queues. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 7861b6a8a016..d377ef7013ee 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -471,7 +471,6 @@ struct intrs_and_queues { uint16_t intr_flags; /* Interrupt flags for each port */ uint16_t ntxq; /* # of NIC txq's for each port */ uint16_t nrxq; /* # of NIC rxq's for each port */ - uint16_t rsrv_noflowq; /* Flag whether to reserve queue 0 */ uint16_t nofldtxq; /* # of TOE txq's for each port */ uint16_t nofldrxq; /* # of TOE rxq's for each port */ @@ -1124,7 +1123,7 @@ t4_attach(device_t dev) tqidx += vi->ntxq; if (j == 0 && vi->ntxq > 1) - vi->rsrv_noflowq = iaq.rsrv_noflowq ? 1 : 0; + vi->rsrv_noflowq = t4_rsrv_noflowq ? 1 : 0; else vi->rsrv_noflowq = 0; @@ -2657,7 +2656,6 @@ cfg_itype_and_nqueues(struct adapter *sc, struct intrs_and_queues *iaq) iaq->ntxq_vi = t4_ntxq_vi; iaq->nrxq = nrxq = t4_nrxq; iaq->nrxq_vi = t4_nrxq_vi; - iaq->rsrv_noflowq = t4_rsrv_noflowq; #ifdef TCP_OFFLOAD if (is_offload(sc)) { iaq->nofldtxq = t4_nofldtxq; From ad1633b34b3043f9527d5af2eb833f3043bf1c2d Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 16 Nov 2017 07:14:29 +0000 Subject: [PATCH 21/92] Take r313504 into account when recomputing the string table length. When we encounter a USDT probe in a weak symbol, we emit an alias for the probe function symbol. Such aliases are named differently from the aliases we emit for probes in local functions, so make sure to take that difference into account when resizing the output object file's string table. Otherwise, we underrun the string table buffer. PR: 223680 --- .../opensolaris/lib/libdtrace/common/dt_link.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c index e5d30f0e037d..0184ec23a3ed 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c @@ -1416,8 +1416,15 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp) "expected %s to be of type function", s)); } - len = snprintf(NULL, 0, dt_symfmt, dt_symprefix, - objkey, s) + 1; + /* + * Aliases of weak symbols don't get a uniquifier. + */ + if (GELF_ST_BIND(fsym.st_info) == STB_WEAK) + len = snprintf(NULL, 0, dt_weaksymfmt, + dt_symprefix, s) + 1; + else + len = snprintf(NULL, 0, dt_symfmt, dt_symprefix, + objkey, s) + 1; if ((p = dt_alloc(dtp, len)) == NULL) { dt_strtab_destroy(strtab); goto err; From e9a2e17d1b3f42960b7e4e049bb3a5a56479bf43 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 16 Nov 2017 07:25:12 +0000 Subject: [PATCH 22/92] Avoid holding the process in uread() and uwrite(). In general, higher-level code will atomically verify that the process is not exiting and hold the process. In one case, we were using uwrite() to copy a probed instruction to a per-thread scratch space block, but copyout() can be used for this purpose instead; this change effectively reverts r227291. MFC after: 1 week --- sys/cddl/compat/opensolaris/kern/opensolaris_proc.c | 4 ---- sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c b/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c index 652fa8928589..63db17199fb4 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_proc.c @@ -35,9 +35,7 @@ uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) { ssize_t n; - PHOLD(p); n = proc_readmem(curthread, p, uaddr, kaddr, len); - PRELE(p); if (n != len) return (ENOMEM); return (0); @@ -48,9 +46,7 @@ uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) { ssize_t n; - PHOLD(p); n = proc_writemem(curthread, p, uaddr, kaddr, len); - PRELE(p); if (n != len) return (ENOMEM); return (0); diff --git a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c index d6655a0b3c55..0364aaf55094 100644 --- a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c +++ b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c @@ -1715,11 +1715,7 @@ fasttrap_pid_probe(struct reg *rp) ASSERT(i <= sizeof (scratch)); -#ifdef illumos if (fasttrap_copyout(scratch, (char *)addr, i)) { -#else - if (uwrite(p, scratch, i, addr)) { -#endif fasttrap_sigtrap(p, curthread, pc); new_pc = pc; break; From 16f92ad234a0e49146dee6c784d1676c82fa5845 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Thu, 16 Nov 2017 10:15:17 +0000 Subject: [PATCH 23/92] Add some 4k quirks for Samsung pm863a SSDs Submitted by: Nikita Kozlov MFC after: 3 days Sponsored by: blade Differential Revision: https://reviews.freebsd.org/D13093 --- sys/cam/ata/ata_da.c | 8 ++++++++ sys/cam/scsi/scsi_da.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 22c5f8b3b74b..c70694092c2d 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -694,6 +694,14 @@ static struct ada_quirk_entry ada_quirk_table[] = { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG MZ7*", "*" }, /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN }, + { + /* + * Same as for SAMSUNG MZ7* but enable the quirks for SSD + * starting with MZ7* too + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "MZ7*", "*" }, + /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN + }, { /* * Samsung PM851 Series SSDs Dell OEM diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 061ea9d93398..084d94c45858 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -1309,6 +1309,14 @@ static struct da_quirk_entry da_quirk_table[] = { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG MZ7*", "*" }, /*quirks*/DA_Q_4K }, + { + /* + * Same as for SAMSUNG MZ7* but enable the quirks for SSD + * starting with MZ7* too + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "MZ7*", "*" }, + /*quirks*/DA_Q_4K + }, { /* * SuperTalent TeraDrive CT SSDs From 4e421792ec80df7a5fa82e97dcc3575c3ec6740a Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 16 Nov 2017 14:27:02 +0000 Subject: [PATCH 24/92] Remove i386 XBOX support. It is for console presented at 2001 and featuring Pentium III processor. Even if any of them are still alive and run FreeBSD, we do not have any sign of life from their users. While removing another dozens of #ifdefs from the i386 sources reduces the aversion from looking at the code and improves the platform vitality. Reviewed by: cem, pfg, rink (XBOX support author) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D13016 --- sys/conf/files.i386 | 4 - sys/conf/options | 3 - sys/i386/conf/NOTES | 17 - sys/i386/conf/XBOX | 87 ----- sys/i386/i386/machdep.c | 42 --- sys/i386/i386/pmap.c | 11 - sys/i386/i386/vm_machdep.c | 13 - sys/i386/include/xbox.h | 50 --- sys/i386/pci/pci_cfgreg.c | 39 --- sys/i386/xbox/pic16l.s | 202 ------------ sys/i386/xbox/xbox.c | 63 ---- sys/i386/xbox/xboxfb.c | 655 ------------------------------------- sys/isa/syscons_isa.c | 19 -- sys/x86/x86/cpu_machdep.c | 1 - 14 files changed, 1206 deletions(-) delete mode 100644 sys/i386/conf/XBOX delete mode 100644 sys/i386/include/xbox.h delete mode 100644 sys/i386/xbox/pic16l.s delete mode 100644 sys/i386/xbox/xbox.c delete mode 100644 sys/i386/xbox/xboxfb.c diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index bfb4bd3deb08..32e6aa426b4b 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -549,10 +549,6 @@ libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard libkern/x86/crc32_sse42.c standard -i386/xbox/xbox.c optional xbox -i386/xbox/xboxfb.c optional xboxfb -dev/fb/boot_font.c optional xboxfb -i386/xbox/pic16l.s optional xbox # # x86 real mode BIOS support, required by dpms/pci/vesa # diff --git a/sys/conf/options b/sys/conf/options index 224d06792b94..b0cd0629aca5 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -892,9 +892,6 @@ HWPMC_DEBUG opt_global.h HWPMC_HOOKS HWPMC_MIPS_BACKTRACE opt_hwpmc_hooks.h -# XBOX options for FreeBSD/i386, but some files are MI -XBOX opt_xbox.h - # Interrupt filtering INTR_FILTER diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 20a1c7db3789..b98111053e1b 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -221,23 +221,6 @@ options NPX_DEBUG # enable npx debugging # options PERFMON -# -# XBOX causes the kernel to be bootable on the Microsoft XBox console system. -# The resulting kernel will auto-detect whether it is being booted on a XBox, -# so kernels compiled with this option will also work on an ordinary PC. -# This option require I686_CPU. -# -# xboxfb includes support for the XBox frame buffer device. It is fully USB- -# keyboard aware, and will only be used if an xbox is detected. This option -# (obviously) requires XBOX support in your kernel. -# -# NOTE: xboxfb currently conflicts with syscons(4); if you have an XBOX and -# include both in your kernel; you will not get any video output. Ordinary -# PC's do not suffer from this. -# -options XBOX -device xboxfb - ##################################################################### # NETWORKING OPTIONS diff --git a/sys/i386/conf/XBOX b/sys/i386/conf/XBOX deleted file mode 100644 index b3817a83d27d..000000000000 --- a/sys/i386/conf/XBOX +++ /dev/null @@ -1,87 +0,0 @@ -# -# XBOX -- kernel for an XBOX -# -# $FreeBSD$ -cpu I686_CPU # Celeron -ident XBOX - -makeoptions MODULES_OVERRIDE="" - -options KDB -options DDB - -options XBOX # kernel is for XBOX -device xboxfb # frame buffer support (REQUIRED!) -device sc # syscons -device fb - -# no support yet for root device name fetching -options ROOTDEVNAME=\"ufs:ada0s1a\" -#options ROOTDEVNAME=\"cd9660:acd0\" - -options SCHED_4BSD # 4BSD scheduler -options INET # InterNETworking -options INET6 # IPv6 communications protocols -options FFS # Berkeley Fast Filesystem -options SOFTUPDATES # Enable FFS soft updates support -#options UFS_ACL # Support for access control lists -#options UFS_DIRHASH # Improve performance on big directories -#options MD_ROOT # MD is a potential root device -options NFSCL # Network Filesystem Client -#options NFSD # Network Filesystem Server -#options NFSLOCKD # Network Lock Manager -#options NFS_ROOT # NFS usable as /, requires NFSCL -#options MSDOSFS # MSDOS Filesystem -options CD9660 # ISO 9660 Filesystem -#options PROCFS # Process filesystem (requires PSEUDOFS) -#options PSEUDOFS # Pseudo-filesystem framework -#options COMPAT_FREEBSD4 # Compatible with FreeBSD4 -#options KTRACE # ktrace(1) support -#options SYSVSHM # SYSV-style shared memory -#options SYSVMSG # SYSV-style message queues -#options SYSVSEM # SYSV-style semaphores -#options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -#options KBD_INSTALL_CDEV # install a CDEV entry in /dev -# Xbox has a non-standard default timer frequency -options TIMER_FREQ=1125000 # Gives ~733.34MHz CPU - -#device apic # I/O APIC - -device pci - -# ATA and ATAPI devices -device ata - -# ATA/SCSI peripherals -device scbus # SCSI bus (required for ATA/SCSI) -device cd # CD -device da # Direct Access (disks) -device pass # Passthrough device (direct ATA/SCSI access) - -# Pseudo devices. -device loop # Network loopback -device random # Entropy device -device ether # Ethernet support -#device tun # Packet tunnel. -#device md # Memory "disks" -#device gif # IPv6 and IPv4 tunneling - -# The `bpf' device enables the Berkeley Packet Filter. -# Be aware of the administrative consequences of enabling this! -# Note that 'bpf' is required for DHCP. -device bpf # Berkeley packet filter - -# USB support -options USB_DEBUG # enable debug msgs -#device uhci # UHCI PCI->USB interface -device ohci # OHCI PCI->USB interface -device usb # USB Bus (required) -device ukbd # Keyboard -device umass # Disks/Mass storage - Requires scbus and da - -device miibus - -device sound -device snd_ich # nForce audio - -device nfe # nVidia nForce MCP on-board Ethernet Networking diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index b6bea45111c9..4ea9a1583b10 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include "opt_mp_watchdog.h" #include "opt_perfmon.h" #include "opt_platform.h" -#include "opt_xbox.h" #include #include @@ -148,13 +147,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef XBOX -#include - -int arch_i386_is_xbox = 0; -uint32_t arch_i386_xbox_memsize = 0; -#endif - /* Sanity check for __curthread() */ CTASSERT(offsetof(struct pcpu, pc_curthread) == 0); @@ -1780,18 +1772,6 @@ getmemsize(int first) caddr_t kmdp; has_smap = 0; -#ifdef XBOX - if (arch_i386_is_xbox) { - /* - * We queried the memory size before, so chop off 4MB for - * the framebuffer and inform the OS of this. - */ - physmap[0] = 0; - physmap[1] = (arch_i386_xbox_memsize * 1024 * 1024) - XBOX_FB_SIZE; - physmap_idx = 0; - goto physmap_done; - } -#endif bzero(&vmf, sizeof(vmf)); bzero(physmap, sizeof(physmap)); basemem = 0; @@ -2300,28 +2280,6 @@ init386(int first) r_idt.rd_base = (int) idt; lidt(&r_idt); -#ifdef XBOX - /* - * The following code queries the PCI ID of 0:0:0. For the XBOX, - * This should be 0x10de / 0x02a5. - * - * This is exactly what Linux does. - */ - outl(0xcf8, 0x80000000); - if (inl(0xcfc) == 0x02a510de) { - arch_i386_is_xbox = 1; - pic16l_setled(XBOX_LED_GREEN); - - /* - * We are an XBOX, but we may have either 64MB or 128MB of - * memory. The PCI host bridge should be programmed for this, - * so we just query it. - */ - outl(0xcf8, 0x80000084); - arch_i386_xbox_memsize = (inl(0xcfc) == 0x7FFFFFF) ? 128 : 64; - } -#endif /* XBOX */ - /* * Initialize the clock before the console so that console * initialization can use DELAY(). diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 7106648e0170..d0dbf5162c16 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -101,7 +101,6 @@ __FBSDID("$FreeBSD$"); #include "opt_pmap.h" #include "opt_smp.h" #include "opt_vm.h" -#include "opt_xbox.h" #include #include @@ -149,10 +148,6 @@ __FBSDID("$FreeBSD$"); #include #endif -#ifdef XBOX -#include -#endif - #ifndef PMAP_SHPGPERPROC #define PMAP_SHPGPERPROC 200 #endif @@ -501,12 +496,6 @@ pmap_bootstrap(vm_paddr_t firstaddr) * physical memory region that is used by the ACPI wakeup code. This * mapping must not have PG_G set. */ -#ifdef XBOX - /* FIXME: This is gross, but needed for the XBOX. Since we are in such - * an early stadium, we cannot yet neatly map video memory ... :-( - * Better fixes are very welcome! */ - if (!arch_i386_is_xbox) -#endif for (i = 1; i < NKPT; i++) PTD[i] = 0; diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 562cdfdd756c..40a84db91818 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include "opt_npx.h" #include "opt_reset.h" #include "opt_cpu.h" -#include "opt_xbox.h" #include #include @@ -91,10 +90,6 @@ __FBSDID("$FreeBSD$"); #include -#ifdef XBOX -#include -#endif - #ifndef NSFBUFS #define NSFBUFS (512 + maxusers * 16) #endif @@ -600,14 +595,6 @@ cpu_reset_proxy() void cpu_reset() { -#ifdef XBOX - if (arch_i386_is_xbox) { - /* Kick the PIC16L, it can reboot the box */ - pic16l_reboot(); - for (;;); - } -#endif - #ifdef SMP cpuset_t map; u_int cnt; diff --git a/sys/i386/include/xbox.h b/sys/i386/include/xbox.h deleted file mode 100644 index 50822f1e5e1e..000000000000 --- a/sys/i386/include/xbox.h +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * Copyright (c) 2005 Rink Springer - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ -#ifndef _MACHINE_XBOX_H_ -#define _MACHINE_XBOX_H_ - -#define XBOX_LED_GREEN 0x0f -#define XBOX_LED_RED 0xf0 -#define XBOX_LED_FLASHRED 0xa0 -#define XBOX_LED_FLASHGREEN 0x03 - -#define XBOX_RAM_SIZE (arch_i386_xbox_memsize * 1024 * 1024) -#define XBOX_FB_SIZE (0x130000) -#define XBOX_FB_START (0xf0000000 | (XBOX_RAM_SIZE - XBOX_FB_SIZE)) -#define XBOX_FB_START_PTR (0xFD600800) - -extern int arch_i386_is_xbox; -extern uint32_t arch_i386_xbox_memsize; /* Megabytes */ - -void pic16l_setbyte(int addr, int reg, int data); -void pic16l_setled(int val); -void pic16l_reboot(void); -void pic16l_poweroff(void); - -#endif /* !_MACHINE_XBOX_H_ */ diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index 288bcb9dd8fd..6e2501152eec 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -30,8 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_xbox.h" - #include #include #include @@ -52,10 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef XBOX -#include -#endif - #define PRVERB(a) do { \ if (bootverbose) \ printf a ; \ @@ -253,39 +247,6 @@ pci_cfgenable(unsigned bus, unsigned slot, unsigned func, int reg, int bytes) { int dataport = 0; -#ifdef XBOX - if (arch_i386_is_xbox) { - /* - * The Xbox MCPX chipset is a derivative of the nForce 1 - * chipset. It almost has the same bus layout; some devices - * cannot be used, because they have been removed. - */ - - /* - * Devices 00:00.1 and 00:00.2 used to be memory controllers on - * the nForce chipset, but on the Xbox, using them will lockup - * the chipset. - */ - if (bus == 0 && slot == 0 && (func == 1 || func == 2)) - return dataport; - - /* - * Bus 1 only contains a VGA controller at 01:00.0. When you try - * to probe beyond that device, you only get garbage, which - * could cause lockups. - */ - if (bus == 1 && (slot != 0 || func != 0)) - return dataport; - - /* - * Bus 2 used to contain the AGP controller, but the Xbox MCPX - * doesn't have one. Probing it can cause lockups. - */ - if (bus >= 2) - return dataport; - } -#endif - if (bus <= PCI_BUSMAX && slot < devmax && func <= PCI_FUNCMAX diff --git a/sys/i386/xbox/pic16l.s b/sys/i386/xbox/pic16l.s deleted file mode 100644 index 612c306e5942..000000000000 --- a/sys/i386/xbox/pic16l.s +++ /dev/null @@ -1,202 +0,0 @@ -/*- - * Copyright (c) 2005 Rink Springer - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ -#include - -.text - -/* - * send a command to the PIC16L - * - * void pic16l_setbyte (int addr, int reg, int data) - * - */ -ENTRY(pic16l_setbyte) - push %ebp - mov %esp,%ebp - - push %ebx - - movw $0xc000,%dx - -1: xor %eax,%eax - inw %dx,%ax - shr $0x0b,%eax - and $0x01,%eax - test %eax,%eax - jne 1b - - mov $50,%ecx -2: movw $0xc004,%dx - movl 0x8(%ebp),%eax - outb %al,%dx - movw $0xc008,%dx - movl 0xc(%ebp),%eax - outb %al,%dx - movw $0xc006,%dx - movl 0x10(%ebp),%eax - outw %ax,%dx - - movw $0xc000,%dx - inw %dx,%ax - outw %ax,%dx - - movw $0xc002,%dx - movb $0x1a,%al - outb %al,%dx - - movw $0xc000,%dx -3: - inb %dx,%al - movb %al,%bl - orb $0x36,%al - jz 3b - - orb $0x10,%bl - jnz 5f - -4: - push %ecx - xor %ecx,%ecx -l: loop l - pop %ecx - - dec %ecx - jz 5f - jmp 2b -5: - - pop %ebx - - leave - ret - -/* - * instructs the pic16l to reboot the xbox - * - * void pic16l_reboot(); - * - */ -ENTRY(pic16l_reboot) - pushl $0x01 - pushl $0x02 - pushl $0x20 - call pic16l_setbyte - addl $12,%esp - ret - -/* - * instructs the pic16l to power-off the xbox - * - * void pic16l_poweroff(); - * - */ -ENTRY(pic16l_poweroff) - pushl $0x80 - pushl $0x02 - pushl $0x20 - call pic16l_setbyte - addl $12,%esp - ret - -pic16l_ledhlp: - movw $0xc000,%dx -1: xor %eax,%eax - inw %dx,%ax - shr $0x0b,%eax - and $0x01,%eax - test %eax,%eax - jne 1b - - mov $400,%ecx - -2: - movw $0xc004,%dx - movb $0x20,%al - outb %al,%dx - - movw $0xc008,%dx - movb %bh,%al - outb %al,%dx - - movw $0xc006,%dx - movb %bl,%al - outb %al,%dx - - movw $0xc000,%dx - inw %dx,%ax - outw %ax,%dx - - movw $0xc002,%dx - movb $0x1a,%al - outb %al,%dx - - movw $0xc000,%dx -3: - inb %dx,%al - movb %al,%bl - orb $0x36,%al - jz 3b - - orb $0x10,%bl - jz 4f - - ret - -4: - push %ecx - xor %ecx,%ecx -l2: loop l2 - pop %ecx - dec %ecx - jz 5f - jmp 2b -5: - ret - -/* - * changes the front led - * - * void pic16l_setled (int val); - */ -ENTRY(pic16l_setled) - push %ebp - mov %esp,%ebp - - push %ebx - - movl 0x8(%ebp),%ebx - orl $0x800,%ebx - call pic16l_ledhlp - movl $0x701,%ebx - call pic16l_ledhlp - - pop %ebx - - leave - ret diff --git a/sys/i386/xbox/xbox.c b/sys/i386/xbox/xbox.c deleted file mode 100644 index d92180ca1537..000000000000 --- a/sys/i386/xbox/xbox.c +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * Copyright (c) 2005 Rink Springer - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef I686_CPU -#error You must have a I686_CPU in your kernel if you want to make an XBOX-compatible kernel -#endif - -static void -xbox_poweroff(void* junk, int howto) -{ - if (!(howto & RB_POWEROFF)) - return; - - pic16l_poweroff(); -} - -static void -xbox_init(void) -{ - - if (!arch_i386_is_xbox) - return; - - /* register our poweroff function */ - EVENTHANDLER_REGISTER (shutdown_final, xbox_poweroff, NULL, - SHUTDOWN_PRI_LAST); -} - -SYSINIT(xbox, SI_SUB_DRIVERS, SI_ORDER_FIRST, xbox_init, NULL); diff --git a/sys/i386/xbox/xboxfb.c b/sys/i386/xbox/xboxfb.c deleted file mode 100644 index cc014bc5d6ec..000000000000 --- a/sys/i386/xbox/xboxfb.c +++ /dev/null @@ -1,655 +0,0 @@ -/*- - * Copyright (c) 2005, 2006 Rink Springer - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * This is the syscon(4)-ized version of the Xbox Frame Buffer driver. It - * supports about all features required, such as mouse support. - * - * A lot of functions that are not useful to us have not been implemented. - * It appears that some functions are never called, but these implementations - * are here nevertheless. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct xboxfb_softc { - video_adapter_t sc_va; - - /* screen height (pixels) */ - uint32_t sc_height; - - /* screen width (pixels) */ - uint32_t sc_width; - - /* pointer to the actual XBOX video memory */ - char* sc_framebuffer; - - /* pointer to the font used */ - const struct gfb_font* sc_font; -}; - -#define SCREEN_WIDTH 640 -#define SCREEN_HEIGHT 480 - -#define XBOXFB_DRIVER_NAME "xboxsc" - -extern const struct gfb_font bold8x16; - -static vi_probe_t xboxfb_probe; -static vi_init_t xboxfb_init; -static vi_get_info_t xboxfb_get_info; -static vi_query_mode_t xboxfb_query_mode; -static vi_set_mode_t xboxfb_set_mode; -static vi_save_font_t xboxfb_save_font; -static vi_load_font_t xboxfb_load_font; -static vi_show_font_t xboxfb_show_font; -static vi_save_palette_t xboxfb_save_palette; -static vi_load_palette_t xboxfb_load_palette; -static vi_set_border_t xboxfb_set_border; -static vi_save_state_t xboxfb_save_state; -static vi_load_state_t xboxfb_load_state; -static vi_set_win_org_t xboxfb_set_win_org; -static vi_read_hw_cursor_t xboxfb_read_hw_cursor; -static vi_set_hw_cursor_t xboxfb_set_hw_cursor; -static vi_set_hw_cursor_shape_t xboxfb_set_hw_cursor_shape; -static vi_blank_display_t xboxfb_blank_display; -static vi_mmap_t xboxfb_mmap; -static vi_ioctl_t xboxfb_ioctl; -static vi_clear_t xboxfb_clear; -static vi_fill_rect_t xboxfb_fill_rect; -static vi_bitblt_t xboxfb_bitblt; -static vi_diag_t xboxfb_diag; -static vi_save_cursor_palette_t xboxfb_save_cursor_palette; -static vi_load_cursor_palette_t xboxfb_load_cursor_palette; -static vi_copy_t xboxfb_copy; -static vi_putp_t xboxfb_putp; -static vi_putc_t xboxfb_putc; -static vi_puts_t xboxfb_puts; -static vi_putm_t xboxfb_putm; - -static video_switch_t xboxvidsw = { - .probe = xboxfb_probe, - .init = xboxfb_init, - .get_info = xboxfb_get_info, - .query_mode = xboxfb_query_mode, - .set_mode = xboxfb_set_mode, - .save_font = xboxfb_save_font, - .load_font = xboxfb_load_font, - .show_font = xboxfb_show_font, - .save_palette = xboxfb_save_palette, - .load_palette = xboxfb_load_palette, - .set_border = xboxfb_set_border, - .save_state = xboxfb_save_state, - .load_state = xboxfb_load_state, - .set_win_org = xboxfb_set_win_org, - .read_hw_cursor = xboxfb_read_hw_cursor, - .set_hw_cursor = xboxfb_set_hw_cursor, - .set_hw_cursor_shape = xboxfb_set_hw_cursor_shape, - .blank_display = xboxfb_blank_display, - .mmap = xboxfb_mmap, - .ioctl = xboxfb_ioctl, - .clear = xboxfb_clear, - .fill_rect = xboxfb_fill_rect, - .bitblt = xboxfb_bitblt, - NULL, - NULL, - .diag = xboxfb_diag, - .save_cursor_palette = xboxfb_save_cursor_palette, - .load_cursor_palette = xboxfb_load_cursor_palette, - .copy = xboxfb_copy, - .putp = xboxfb_putp, - .putc = xboxfb_putc, - .puts = xboxfb_puts, - .putm = xboxfb_putm -}; - -static int xboxfb_configure(int flags); -VIDEO_DRIVER(xboxsc, xboxvidsw, xboxfb_configure); - -static vr_init_t xbr_init; -static vr_clear_t xbr_clear; -static vr_draw_border_t xbr_draw_border; -static vr_draw_t xbr_draw; -static vr_set_cursor_t xbr_set_cursor; -static vr_draw_cursor_t xbr_draw_cursor; -static vr_blink_cursor_t xbr_blink_cursor; -static vr_set_mouse_t xbr_set_mouse; -static vr_draw_mouse_t xbr_draw_mouse; - -/* - * We use our own renderer; this is because we must emulate a hardware - * cursor. - */ -static sc_rndr_sw_t xboxrend = { - xbr_init, - xbr_clear, - xbr_draw_border, - xbr_draw, - xbr_set_cursor, - xbr_draw_cursor, - xbr_blink_cursor, - xbr_set_mouse, - xbr_draw_mouse -}; -RENDERER(xboxsc, 0, xboxrend, gfb_set); - -static struct xboxfb_softc xboxfb_sc; - -/* color mappings, from dev/fb/creator.c */ -static const uint32_t cmap[] = { - 0x00000000, /* black */ - 0x000000ff, /* blue */ - 0x0000ff00, /* green */ - 0x0000c0c0, /* cyan */ - 0x00ff0000, /* red */ - 0x00c000c0, /* magenta */ - 0x00c0c000, /* brown */ - 0x00c0c0c0, /* light grey */ - 0x00808080, /* dark grey */ - 0x008080ff, /* light blue */ - 0x0080ff80, /* light green */ - 0x0080ffff, /* light cyan */ - 0x00ff8080, /* light red */ - 0x00ff80ff, /* light magenta */ - 0x00ffff80, /* yellow */ - 0x00ffffff /* white */ -}; - -/* mouse pointer from dev/syscons/scgfbrndr.c */ -static u_char mouse_pointer[16] = { - 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68, - 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00 -}; - -static int -xboxfb_init(int unit, video_adapter_t* adp, int flags) -{ - struct xboxfb_softc* sc = &xboxfb_sc; - video_info_t* vi; - int i; - int* iptr; - - vi = &adp->va_info; - - vid_init_struct (adp, XBOXFB_DRIVER_NAME, -1, unit); - sc->sc_height = SCREEN_HEIGHT; - sc->sc_width = SCREEN_WIDTH; - sc->sc_font = &bold8x16; - if (!(adp->va_flags & V_ADP_INITIALIZED)) { - /* - * We must make a mapping from video framebuffer memory - * to real. This is very crude: we map the entire - * videomemory to PAGE_SIZE! Since our kernel lives at - * it's relocated address range (0xc0xxxxxx), it won't - * care. - * - * We use address PAGE_SIZE and up so we can still trap - * NULL pointers. Once the real init is called, the - * mapping will be done via the OS and stored in a more - * sensible location ... but since we're not fully - * initialized, this is our only way to go :-( - */ - for (i = 0; i < (XBOX_FB_SIZE / PAGE_SIZE); i++) { - pmap_kenter (((i + 1) * PAGE_SIZE), XBOX_FB_START + (i * PAGE_SIZE)); - } - pmap_kenter ((i + 1) * PAGE_SIZE, XBOX_FB_START_PTR - XBOX_FB_START_PTR % PAGE_SIZE); - sc->sc_framebuffer = (char*)PAGE_SIZE; - - /* ensure the framebuffer is where we want it to be */ - *(uint32_t*)((i + 1) * PAGE_SIZE + XBOX_FB_START_PTR % PAGE_SIZE) = XBOX_FB_START; - - /* clear the screen */ - iptr = (uint32_t*)sc->sc_framebuffer; - for (i = 0; i < sc->sc_height * sc->sc_width; i++) - *iptr++ = cmap[0]; - - /* don't ever do this again! */ - adp->va_flags |= V_ADP_INITIALIZED; - } - - vi->vi_mode = M_TEXT_80x25; - vi->vi_cwidth = sc->sc_font->width; - vi->vi_cheight = sc->sc_font->height; - vi->vi_height = (sc->sc_height / vi->vi_cheight); - vi->vi_width = (sc->sc_width / vi->vi_cwidth); - vi->vi_flags = V_INFO_COLOR | V_INFO_LINEAR; - vi->vi_mem_model = V_INFO_MM_DIRECT; - - adp->va_flags |= V_ADP_COLOR; - - if (vid_register(adp) < 0) - return (ENXIO); - - adp->va_flags |= V_ADP_REGISTERED; - - return 0; -} - -static int -xboxfb_probe(int unit, video_adapter_t** adp, void* arg, int flags) -{ - return 0; -} - -static int -xboxfb_configure(int flags) -{ - struct xboxfb_softc* sc = &xboxfb_sc; - - /* Don't init the framebuffer on non-XBOX-es */ - if (!arch_i386_is_xbox) - return 0; - - /* - * If we do only a probe, we are in such an early boot stadium - * that we cannot yet do a 'clean' initialization. - */ - if (flags & VIO_PROBE_ONLY) { - xboxfb_init(0, &sc->sc_va, 0); - return 1; - } - - /* Do a clean mapping of the framebuffer memory */ - sc->sc_framebuffer = pmap_mapdev (XBOX_FB_START, XBOX_FB_SIZE); - return 1; -} - -static void -sc_identify(driver_t* driver, device_t parent) -{ - BUS_ADD_CHILD(parent, INT_MAX, SC_DRIVER_NAME, 0); -} - -static int -sc_probe(device_t dev) -{ - device_set_desc(dev, "XBox System console"); - return (sc_probe_unit(device_get_unit(dev), device_get_flags(dev) | SC_AUTODETECT_KBD)); -} - -static int sc_attach(device_t dev) -{ - return (sc_attach_unit(device_get_unit(dev), device_get_flags(dev) | SC_AUTODETECT_KBD)); -} - -static device_method_t sc_methods[] = { - /* Device interface */ - DEVMETHOD(device_identify, sc_identify), - DEVMETHOD(device_probe, sc_probe), - DEVMETHOD(device_attach, sc_attach), - { 0, 0 } -}; - -static driver_t xboxfb_sc_driver = { - SC_DRIVER_NAME, - sc_methods, - sizeof(sc_softc_t) -}; - -static devclass_t sc_devclass; - -DRIVER_MODULE(sc, legacy, xboxfb_sc_driver, sc_devclass, 0, 0); - -static void -xbr_init(scr_stat* scp) -{ -} - -static void -xbr_clear(scr_stat* scp, int c, int attr) -{ -} - -static void -xbr_draw_border(scr_stat* scp, int color) -{ -} - -static void -xbr_draw(scr_stat* scp, int from, int count, int flip) -{ - video_adapter_t* adp = scp->sc->adp; - int i, c, a; - - if (!flip) { - /* Normal printing */ - vidd_puts(adp, from, (uint16_t*)sc_vtb_pointer(&scp->vtb, from), count); - } else { - /* This is for selections and such: invert the color attribute */ - for (i = count; i-- > 0; ++from) { - c = sc_vtb_getc(&scp->vtb, from); - a = sc_vtb_geta(&scp->vtb, from) >> 8; - vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4)); - } - } -} - -static void -xbr_set_cursor(scr_stat* scp, int base, int height, int blink) -{ -} - -static void -xbr_draw_cursor(scr_stat* scp, int at, int blink, int on, int flip) -{ - struct xboxfb_softc* sc = &xboxfb_sc; - video_adapter_t* adp = scp->sc->adp; - uint32_t* ptri = (uint32_t*)sc->sc_framebuffer; - int row, col, i, j; - - if (scp->curs_attr.height <= 0) - return; - - /* calculate the coordinates in the video buffer */ - row = (at / adp->va_info.vi_width) * adp->va_info.vi_cheight; - col = (at % adp->va_info.vi_width) * adp->va_info.vi_cwidth; - ptri += (row * sc->sc_width) + col; - - /* our cursor consists of simply inverting the char under it */ - for (i = 0; i < adp->va_info.vi_cheight; i++) { - for (j = 0; j < adp->va_info.vi_cwidth; j++) { - *ptri++ ^= 0x00FFFFFF; - } - ptri += (sc->sc_width - adp->va_info.vi_cwidth); - } -} - -static void -xbr_blink_cursor(scr_stat* scp, int at, int flip) -{ -} - -static void -xbr_set_mouse(scr_stat* scp) -{ -} - -static void -xbr_draw_mouse(scr_stat* scp, int x, int y, int on) -{ - vidd_putm(scp->sc->adp, x, y, mouse_pointer, 0xffffffff, 16, 8); - -} - -static int -xboxfb_get_info(video_adapter_t *adp, int mode, video_info_t *info) -{ - bcopy(&adp->va_info, info, sizeof(*info)); - return (0); -} - -static int -xboxfb_query_mode(video_adapter_t *adp, video_info_t *info) -{ - return (ENODEV); -} - -static int -xboxfb_set_mode(video_adapter_t *adp, int mode) -{ - return (0); -} - -static int -xboxfb_save_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - return (ENODEV); -} - -static int -xboxfb_load_font(video_adapter_t *adp, int page, int size, int width, - u_char *data, int c, int count) -{ - return (ENODEV); -} - -static int -xboxfb_show_font(video_adapter_t *adp, int page) -{ - return (ENODEV); -} - -static int -xboxfb_save_palette(video_adapter_t *adp, u_char *palette) -{ - return (ENODEV); -} - -static int -xboxfb_load_palette(video_adapter_t *adp, u_char *palette) -{ - return (ENODEV); -} - -static int -xboxfb_set_border(video_adapter_t *adp, int border) -{ - return (0); -} - -static int -xboxfb_save_state(video_adapter_t *adp, void *p, size_t size) -{ - return (ENODEV); -} - -static int -xboxfb_load_state(video_adapter_t *adp, void *p) -{ - return (ENODEV); -} - -static int -xboxfb_set_win_org(video_adapter_t *adp, off_t offset) -{ - return (ENODEV); -} - -static int -xboxfb_read_hw_cursor(video_adapter_t *adp, int *col, int *row) -{ - *col = 0; - *row = 0; - return (0); -} - -static int -xboxfb_set_hw_cursor(video_adapter_t *adp, int col, int row) -{ - return (ENODEV); -} - -static int -xboxfb_set_hw_cursor_shape(video_adapter_t *adp, int base, int height, - int celsize, int blink) -{ - return (ENODEV); -} - -static int -xboxfb_blank_display(video_adapter_t *adp, int mode) -{ - return (0); -} - -static int -xboxfb_mmap(video_adapter_t *adp, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot, vm_memattr_t *memattr) -{ - return (EINVAL); -} - -static int -xboxfb_ioctl(video_adapter_t *adp, u_long cmd, caddr_t data) -{ - return (fb_commonioctl(adp, cmd, data)); -} - -static int -xboxfb_clear(video_adapter_t *adp) -{ - return (0); -} - -static int -xboxfb_fill_rect(video_adapter_t *adp, int val, int x, int y, int cx, int cy) -{ - return (0); -} - -static int -xboxfb_bitblt(video_adapter_t *adp, ...) -{ - return (ENODEV); -} - -static int -xboxfb_diag(video_adapter_t *adp, int level) -{ - video_info_t info; - - fb_dump_adp_info(adp->va_name, adp, level); - xboxfb_get_info(adp, 0, &info); - fb_dump_mode_info(adp->va_name, adp, &info, level); - return (0); -} - -static int -xboxfb_save_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - return (ENODEV); -} - -static int -xboxfb_load_cursor_palette(video_adapter_t *adp, u_char *palette) -{ - return (ENODEV); -} - -static int -xboxfb_copy(video_adapter_t *adp, vm_offset_t src, vm_offset_t dst, int n) -{ - return (ENODEV); -} - -static int -xboxfb_putp(video_adapter_t *adp, vm_offset_t off, u_int32_t p, u_int32_t a, - int size, int bpp, int bit_ltor, int byte_ltor) -{ - return (ENODEV); -} - -static int -xboxfb_putc(video_adapter_t *adp, vm_offset_t off, u_int8_t c, u_int8_t a) -{ - int row, col; - int i, j; - struct xboxfb_softc* sc = &xboxfb_sc; - uint32_t* ptri = (uint32_t*)sc->sc_framebuffer; - const uint8_t* fontdata; - uint32_t clr; - uint8_t mask; - - /* calculate the position in the frame buffer */ - row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight; - col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth; - fontdata = &sc->sc_font->data[c * adp->va_info.vi_cheight]; - ptri += (row * sc->sc_width) + col; - - /* Place the character on the screen, pixel by pixel */ - for (j = 0; j < adp->va_info.vi_cheight; j++) { - mask = 0x80; - for (i = 0; i < adp->va_info.vi_cwidth; i++) { - clr = (*fontdata & mask) ? cmap[a & 0xf] : cmap[(a >> 4) & 0xf]; - *ptri++ = clr; - mask >>= 1; - } - ptri += (sc->sc_width - adp->va_info.vi_cwidth); - fontdata++; - } - return (0); -} - -static int -xboxfb_puts(video_adapter_t *adp, vm_offset_t off, u_int16_t *s, int len) -{ - int i; - - for (i = 0; i < len; i++) { - vidd_putc(adp, off + i, s[i] & 0xff, (s[i] & 0xff00) >> 8); - } - return (0); -} - -static int -xboxfb_putm(video_adapter_t *adp, int x, int y, u_int8_t *pixel_image, - u_int32_t pixel_mask, int size, int width) -{ - struct xboxfb_softc* sc = &xboxfb_sc; - uint32_t* ptri = (uint32_t*)sc->sc_framebuffer; - int i, j; - - if (x < 0 || y < 0 || x + width > sc->sc_width || y + (2 * size) > sc->sc_height) - return 0; - - ptri += (y * sc->sc_width) + x; - - /* plot the mousecursor wherever the user wants it */ - for (j = 0; j < size; j++) { - for (i = width; i > 0; i--) { - if (pixel_image[j] & (1 << i)) - *ptri = cmap[0xf]; - ptri++; - } - ptri += (sc->sc_width - width); - } - return (0); -} diff --git a/sys/isa/syscons_isa.c b/sys/isa/syscons_isa.c index a5b07035b6b4..b915e63569bb 100644 --- a/sys/isa/syscons_isa.c +++ b/sys/isa/syscons_isa.c @@ -60,12 +60,6 @@ __FBSDID("$FreeBSD$"); #include -#include "opt_xbox.h" - -#ifdef XBOX -#include -#endif - static devclass_t sc_devclass; static sc_softc_t main_softc; @@ -158,19 +152,6 @@ sc_get_cons_priority(int *unit, int *flags) const char *at; int f, u; -#ifdef XBOX - /* - * The XBox Loader does not support hints, which makes our initial - * console probe fail. Therefore, if an XBox is found, we hardcode the - * existence of the console, as it is always there anyway. - */ - if (arch_i386_is_xbox) { - *unit = 0; - *flags = SC_KERNEL_CONSOLE; - return (CN_INTERNAL); - } -#endif - *unit = -1; for (u = 0; u < 16; u++) { if (resource_disabled(SC_DRIVER_NAME, u)) diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c index ed4471038a34..de0d1b7372d9 100644 --- a/sys/x86/x86/cpu_machdep.c +++ b/sys/x86/x86/cpu_machdep.c @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" #ifdef __i386__ #include "opt_apic.h" -#include "opt_xbox.h" #endif #include From 989880017221c6e69b95a21ac779881632bd2048 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 16 Nov 2017 14:37:18 +0000 Subject: [PATCH 25/92] Remove xlint(1). xlint is currently a fossil. We have much more useful and alive tools to do now what xlint did twenty years ago. I did not cleared some stuff which makes lint operational, in sys/x86/include and sys/sys, but I might do it as followup. The x86/include/ucontext.h and _types.h hacks made to please lint was the main reason for my initial proposal to classify xlint as obsolete and to remove it. Also I do not intend to clear sccs ids. Reviewed by: bapt, brooks, emaste, jhb, pfg Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D13015 --- ObsoleteFiles.inc | 9 + etc/mtree/BSD.usr.dist | 2 - share/man/man7/hier.7 | 4 - share/man/man9/style.9 | 5 +- targets/pseudo/hosttools/Makefile.depend.host | 1 - targets/pseudo/userland/Makefile.depend | 4 - usr.bin/Makefile | 3 - usr.bin/xlint/Makefile | 12 - usr.bin/xlint/Makefile.inc | 15 - usr.bin/xlint/arch/aarch64/targparam.h | 50 - usr.bin/xlint/arch/amd64/targparam.h | 53 - usr.bin/xlint/arch/arm/targparam.h | 63 - usr.bin/xlint/arch/i386/targparam.h | 53 - usr.bin/xlint/arch/m68000/targparam.h | 53 - usr.bin/xlint/arch/m68k/targparam.h | 53 - usr.bin/xlint/arch/mips/targparam.h | 53 - usr.bin/xlint/arch/ns32k/targparam.h | 53 - usr.bin/xlint/arch/powerpc/targparam.h | 55 - usr.bin/xlint/arch/powerpc64/targparam.h | 55 - usr.bin/xlint/arch/riscv/targparam.h | 53 - usr.bin/xlint/arch/sh3/targparam.h | 53 - usr.bin/xlint/arch/sparc/targparam.h | 53 - usr.bin/xlint/arch/sparc64/targparam.h | 55 - usr.bin/xlint/arch/vax/targparam.h | 53 - usr.bin/xlint/arch/x86_64/targparam.h | 53 - usr.bin/xlint/common/emit.c | 234 - usr.bin/xlint/common/externs.h | 66 - usr.bin/xlint/common/ilp32.h | 59 - usr.bin/xlint/common/inittyp.c | 133 - usr.bin/xlint/common/lint.h | 128 - usr.bin/xlint/common/lp64.h | 59 - usr.bin/xlint/common/mem.c | 93 - usr.bin/xlint/common/param.h | 81 - usr.bin/xlint/lint1/Makefile | 21 - usr.bin/xlint/lint1/Makefile.depend | 20 - usr.bin/xlint/lint1/cgram.y | 1893 -------- usr.bin/xlint/lint1/decl.c | 3052 ------------- usr.bin/xlint/lint1/emit.c | 243 - usr.bin/xlint/lint1/emit1.c | 601 --- usr.bin/xlint/lint1/err.c | 552 --- usr.bin/xlint/lint1/externs1.h | 292 -- usr.bin/xlint/lint1/func.c | 1288 ------ usr.bin/xlint/lint1/init.c | 656 --- usr.bin/xlint/lint1/lint.h | 120 - usr.bin/xlint/lint1/lint1.h | 424 -- usr.bin/xlint/lint1/main1.c | 230 - usr.bin/xlint/lint1/makeman | 80 - usr.bin/xlint/lint1/mem1.c | 365 -- usr.bin/xlint/lint1/op.h | 120 - usr.bin/xlint/lint1/param.h | 143 - usr.bin/xlint/lint1/scan.l | 1531 ------- usr.bin/xlint/lint1/tree.c | 4040 ----------------- usr.bin/xlint/lint2/Makefile | 14 - usr.bin/xlint/lint2/Makefile.depend | 17 - usr.bin/xlint/lint2/chk.c | 1350 ------ usr.bin/xlint/lint2/emit2.c | 300 -- usr.bin/xlint/lint2/externs2.h | 93 - usr.bin/xlint/lint2/hash.c | 166 - usr.bin/xlint/lint2/lint2.h | 188 - usr.bin/xlint/lint2/main2.c | 191 - usr.bin/xlint/lint2/mem2.c | 97 - usr.bin/xlint/lint2/msg.c | 138 - usr.bin/xlint/lint2/read.c | 1245 ----- usr.bin/xlint/llib/Makefile | 30 - usr.bin/xlint/llib/Makefile.depend | 14 - usr.bin/xlint/llib/llib-lposix | 314 -- usr.bin/xlint/llib/llib-lstdc | 254 -- usr.bin/xlint/xlint/Makefile | 15 - usr.bin/xlint/xlint/Makefile.depend | 17 - usr.bin/xlint/xlint/lint.1 | 627 --- usr.bin/xlint/xlint/pathnames.h | 45 - usr.bin/xlint/xlint/xlint.c | 883 ---- 72 files changed, 10 insertions(+), 23428 deletions(-) delete mode 100644 usr.bin/xlint/Makefile delete mode 100644 usr.bin/xlint/Makefile.inc delete mode 100644 usr.bin/xlint/arch/aarch64/targparam.h delete mode 100644 usr.bin/xlint/arch/amd64/targparam.h delete mode 100644 usr.bin/xlint/arch/arm/targparam.h delete mode 100644 usr.bin/xlint/arch/i386/targparam.h delete mode 100644 usr.bin/xlint/arch/m68000/targparam.h delete mode 100644 usr.bin/xlint/arch/m68k/targparam.h delete mode 100644 usr.bin/xlint/arch/mips/targparam.h delete mode 100644 usr.bin/xlint/arch/ns32k/targparam.h delete mode 100644 usr.bin/xlint/arch/powerpc/targparam.h delete mode 100644 usr.bin/xlint/arch/powerpc64/targparam.h delete mode 100644 usr.bin/xlint/arch/riscv/targparam.h delete mode 100644 usr.bin/xlint/arch/sh3/targparam.h delete mode 100644 usr.bin/xlint/arch/sparc/targparam.h delete mode 100644 usr.bin/xlint/arch/sparc64/targparam.h delete mode 100644 usr.bin/xlint/arch/vax/targparam.h delete mode 100644 usr.bin/xlint/arch/x86_64/targparam.h delete mode 100644 usr.bin/xlint/common/emit.c delete mode 100644 usr.bin/xlint/common/externs.h delete mode 100644 usr.bin/xlint/common/ilp32.h delete mode 100644 usr.bin/xlint/common/inittyp.c delete mode 100644 usr.bin/xlint/common/lint.h delete mode 100644 usr.bin/xlint/common/lp64.h delete mode 100644 usr.bin/xlint/common/mem.c delete mode 100644 usr.bin/xlint/common/param.h delete mode 100644 usr.bin/xlint/lint1/Makefile delete mode 100644 usr.bin/xlint/lint1/Makefile.depend delete mode 100644 usr.bin/xlint/lint1/cgram.y delete mode 100644 usr.bin/xlint/lint1/decl.c delete mode 100644 usr.bin/xlint/lint1/emit.c delete mode 100644 usr.bin/xlint/lint1/emit1.c delete mode 100644 usr.bin/xlint/lint1/err.c delete mode 100644 usr.bin/xlint/lint1/externs1.h delete mode 100644 usr.bin/xlint/lint1/func.c delete mode 100644 usr.bin/xlint/lint1/init.c delete mode 100644 usr.bin/xlint/lint1/lint.h delete mode 100644 usr.bin/xlint/lint1/lint1.h delete mode 100644 usr.bin/xlint/lint1/main1.c delete mode 100644 usr.bin/xlint/lint1/makeman delete mode 100644 usr.bin/xlint/lint1/mem1.c delete mode 100644 usr.bin/xlint/lint1/op.h delete mode 100644 usr.bin/xlint/lint1/param.h delete mode 100644 usr.bin/xlint/lint1/scan.l delete mode 100644 usr.bin/xlint/lint1/tree.c delete mode 100644 usr.bin/xlint/lint2/Makefile delete mode 100644 usr.bin/xlint/lint2/Makefile.depend delete mode 100644 usr.bin/xlint/lint2/chk.c delete mode 100644 usr.bin/xlint/lint2/emit2.c delete mode 100644 usr.bin/xlint/lint2/externs2.h delete mode 100644 usr.bin/xlint/lint2/hash.c delete mode 100644 usr.bin/xlint/lint2/lint2.h delete mode 100644 usr.bin/xlint/lint2/main2.c delete mode 100644 usr.bin/xlint/lint2/mem2.c delete mode 100644 usr.bin/xlint/lint2/msg.c delete mode 100644 usr.bin/xlint/lint2/read.c delete mode 100644 usr.bin/xlint/llib/Makefile delete mode 100644 usr.bin/xlint/llib/Makefile.depend delete mode 100644 usr.bin/xlint/llib/llib-lposix delete mode 100644 usr.bin/xlint/llib/llib-lstdc delete mode 100644 usr.bin/xlint/xlint/Makefile delete mode 100644 usr.bin/xlint/xlint/Makefile.depend delete mode 100644 usr.bin/xlint/xlint/lint.1 delete mode 100644 usr.bin/xlint/xlint/pathnames.h delete mode 100644 usr.bin/xlint/xlint/xlint.c diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index e4f42a0d3388..54267ad3aaef 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,15 @@ # xargs -n1 | sort | uniq -d; # done +# 20171116: lint(1) removal +OLD_FILES+=usr/bin/lint +OLD_FILES+=usr/libexec/lint1 +OLD_FILES+=usr/libexec/lint2 +OLD_FILES+=usr/libdata/lint/llib-lposix.ln +OLD_FILES+=usr/libdata/lint/llib-lstdc.ln +OLD_FILES+=usr/share/man/man1/lint.1.gz +OLD_FILES+=usr/share/man/man7/lint.7.gz +OLD_DIRS+=usr/libdata/lint # 20171114: Removal of all fortune datfiles other than freebsd-tips OLD_FILES+=usr/share/games/fortune/fortunes OLD_FILES+=usr/share/games/fortune/fortunes.dat diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 8108454737e1..29d8ea62f419 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -56,8 +56,6 @@ .. ldscripts .. - lint - .. pkgconfig .. .. diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index b0634ec18b6c..47e816294568 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -364,10 +364,6 @@ configuration data linker scripts; see .Xr ld 1 -.It Pa lint/ -various prebuilt lint libraries; -see -.Xr lint 1 .El .Pp .It Pa libexec/ diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index 005a356771a3..bdd120456ffe 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -867,14 +867,11 @@ KNF compliant in the repository must not diverge from compliance. .Pp Whenever possible, code should be run through a code checker -(e.g., -.Xr lint 1 -or +(e.g., various static analyzers or .Nm cc Fl Wall ) and produce minimal warnings. .Sh SEE ALSO .Xr indent 1 , -.Xr lint 1 , .Xr err 3 , .Xr warn 3 , .Xr style.Makefile 5 diff --git a/targets/pseudo/hosttools/Makefile.depend.host b/targets/pseudo/hosttools/Makefile.depend.host index 12948cdde9a4..1def9574156b 100644 --- a/targets/pseudo/hosttools/Makefile.depend.host +++ b/targets/pseudo/hosttools/Makefile.depend.host @@ -15,7 +15,6 @@ DIRDEPS = \ usr.bin/mkcsmapper_static \ usr.bin/mkesdb_static \ usr.bin/xinstall \ - usr.bin/xlint/xlint \ usr.bin/yacc \ usr.sbin/config \ usr.sbin/crunch/crunchgen \ diff --git a/targets/pseudo/userland/Makefile.depend b/targets/pseudo/userland/Makefile.depend index 2e33b1705198..2a5d79670e0c 100644 --- a/targets/pseudo/userland/Makefile.depend +++ b/targets/pseudo/userland/Makefile.depend @@ -416,10 +416,6 @@ DIRDEPS+= \ usr.bin/write \ usr.bin/xargs \ usr.bin/xinstall \ - usr.bin/xlint/lint1 \ - usr.bin/xlint/lint2 \ - usr.bin/xlint/llib \ - usr.bin/xlint/xlint \ usr.bin/xo \ usr.bin/xstr \ usr.bin/xz \ diff --git a/usr.bin/Makefile b/usr.bin/Makefile index cad3d5c2bd4d..453a0de31e2d 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -278,9 +278,6 @@ SUBDIR.${MK_TOOLCHAIN}+= rpcgen SUBDIR.${MK_TOOLCHAIN}+= unifdef SUBDIR.${MK_TOOLCHAIN}+= size SUBDIR.${MK_TOOLCHAIN}+= strings -.if ${MACHINE_ARCH} != "aarch64" # ARM64TODO xlint does not build -SUBDIR.${MK_TOOLCHAIN}+= xlint -.endif SUBDIR.${MK_TOOLCHAIN}+= xstr SUBDIR.${MK_TOOLCHAIN}+= yacc SUBDIR.${MK_VI}+= vi diff --git a/usr.bin/xlint/Makefile b/usr.bin/xlint/Makefile deleted file mode 100644 index 68264f4a7f75..000000000000 --- a/usr.bin/xlint/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# $NetBSD: Makefile,v 1.2 1995/07/03 21:23:45 cgd Exp $ -# $FreeBSD$ - -.if ${LINT} == "lint" -_llib= llib -.else -_llib= -.endif - -SUBDIR= lint1 lint2 xlint ${_llib} - -.include diff --git a/usr.bin/xlint/Makefile.inc b/usr.bin/xlint/Makefile.inc deleted file mode 100644 index 2bd511c91f26..000000000000 --- a/usr.bin/xlint/Makefile.inc +++ /dev/null @@ -1,15 +0,0 @@ -# $NetBSD: Makefile.inc,v 1.8 2002/02/04 00:18:32 thorpej Exp $ -# $FreeBSD$ - -WARNS?= 0 - -.PATH: ${.CURDIR}/../common - -.if exists(${.CURDIR}/../arch/${MACHINE_ARCH}) -CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH} -.else -CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_CPUARCH} -.endif -CFLAGS+= -I${.CURDIR}/../common - -OBJECT_FMT= ELF diff --git a/usr.bin/xlint/arch/aarch64/targparam.h b/usr.bin/xlint/arch/aarch64/targparam.h deleted file mode 100644 index fa034505d2de..000000000000 --- a/usr.bin/xlint/arch/aarch64/targparam.h +++ /dev/null @@ -1,50 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2014/08/10 05:47:38 matt Exp $ */ - -/*- - * Copyright (c) 2014 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Matt Thomas of 3am Software Foundry. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ -#include "lp64.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (16 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/amd64/targparam.h b/usr.bin/xlint/arch/amd64/targparam.h deleted file mode 100644 index 8d57fbd3b65d..000000000000 --- a/usr.bin/xlint/arch/amd64/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:55:00 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "lp64.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (16 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/arm/targparam.h b/usr.bin/xlint/arch/arm/targparam.h deleted file mode 100644 index d1d6f94d9b2e..000000000000 --- a/usr.bin/xlint/arch/arm/targparam.h +++ /dev/null @@ -1,63 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:19 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#if defined(TARGET_OBJFMT_ELF) -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 -#else -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 -#endif - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (8 * CHAR_BIT) - -#if defined(TARGET_OBJFMT_ELF) -/* XXX ARM ELF ABI says packed enums -- variable size! */ -#define ENUM_SIZE (4 * CHAR_BIT) -#else -#define ENUM_SIZE (4 * CHAR_BIT) -#endif diff --git a/usr.bin/xlint/arch/i386/targparam.h b/usr.bin/xlint/arch/i386/targparam.h deleted file mode 100644 index 86dfb19f3185..000000000000 --- a/usr.bin/xlint/arch/i386/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:19 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (12 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/m68000/targparam.h b/usr.bin/xlint/arch/m68000/targparam.h deleted file mode 100644 index f79777d4724d..000000000000 --- a/usr.bin/xlint/arch/m68000/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD$ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (8 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/m68k/targparam.h b/usr.bin/xlint/arch/m68k/targparam.h deleted file mode 100644 index 86dfb19f3185..000000000000 --- a/usr.bin/xlint/arch/m68k/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:19 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (12 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/mips/targparam.h b/usr.bin/xlint/arch/mips/targparam.h deleted file mode 100644 index 7b6e056a5fa7..000000000000 --- a/usr.bin/xlint/arch/mips/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:19 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (8 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/ns32k/targparam.h b/usr.bin/xlint/arch/ns32k/targparam.h deleted file mode 100644 index f6b3308b9cca..000000000000 --- a/usr.bin/xlint/arch/ns32k/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:20 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (12 * CHAR_BIT) /* XXX double-check */ - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/powerpc/targparam.h b/usr.bin/xlint/arch/powerpc/targparam.h deleted file mode 100644 index 554f9b3942de..000000000000 --- a/usr.bin/xlint/arch/powerpc/targparam.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:20 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (8 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/powerpc64/targparam.h b/usr.bin/xlint/arch/powerpc64/targparam.h deleted file mode 100644 index 09bfd3e2b3ca..000000000000 --- a/usr.bin/xlint/arch/powerpc64/targparam.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:20 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "lp64.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (8 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/riscv/targparam.h b/usr.bin/xlint/arch/riscv/targparam.h deleted file mode 100644 index 8d57fbd3b65d..000000000000 --- a/usr.bin/xlint/arch/riscv/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.2 2002/01/30 06:55:00 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "lp64.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (16 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/sh3/targparam.h b/usr.bin/xlint/arch/sh3/targparam.h deleted file mode 100644 index d49eb7643888..000000000000 --- a/usr.bin/xlint/arch/sh3/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:20 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (8 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/sparc/targparam.h b/usr.bin/xlint/arch/sparc/targparam.h deleted file mode 100644 index c0eabbd00c8c..000000000000 --- a/usr.bin/xlint/arch/sparc/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:21 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (8 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/sparc64/targparam.h b/usr.bin/xlint/arch/sparc64/targparam.h deleted file mode 100644 index df151f2344ec..000000000000 --- a/usr.bin/xlint/arch/sparc64/targparam.h +++ /dev/null @@ -1,55 +0,0 @@ -/* $NetBSD: targparam.h,v 1.3 2002/01/31 23:31:34 he Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "lp64.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (16 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/vax/targparam.h b/usr.bin/xlint/arch/vax/targparam.h deleted file mode 100644 index 261369d6fb75..000000000000 --- a/usr.bin/xlint/arch/vax/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:22 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "ilp32.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (8 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/arch/x86_64/targparam.h b/usr.bin/xlint/arch/x86_64/targparam.h deleted file mode 100644 index 6cfedcb139cb..000000000000 --- a/usr.bin/xlint/arch/x86_64/targparam.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: targparam.h,v 1.1 2002/01/18 20:39:22 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Machine-dependent target parameters for lint1. - */ - -#include "lp64.h" - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. Note this MUST be - * kept in sync with the compiler! - */ - -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 - -#define FLOAT_SIZE (4 * CHAR_BIT) -#define DOUBLE_SIZE (8 * CHAR_BIT) -#define LDOUBLE_SIZE (16 * CHAR_BIT) - -#define ENUM_SIZE (4 * CHAR_BIT) diff --git a/usr.bin/xlint/common/emit.c b/usr.bin/xlint/common/emit.c deleted file mode 100644 index 94134334a7fe..000000000000 --- a/usr.bin/xlint/common/emit.c +++ /dev/null @@ -1,234 +0,0 @@ -/* $NetBSD: emit.c,v 1.2 2002/01/21 19:49:51 tv Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: emit.c,v 1.2 2002/01/21 19:49:51 tv Exp $"); -#endif - -#include -#include -#include - -#include "lint.h" - -/* name and handle of output file */ -static const char *loname; -static FILE *lout; - -/* output buffer data */ -ob_t ob; - -static void outxbuf(void); - - -/* - * initialize output - */ -void -outopen(const char *name) -{ - - loname = name; - - /* Open output file */ - if ((lout = fopen(name, "w")) == NULL) - err(1, "cannot open '%s'", name); - - /* Create output buffer */ - ob.o_len = 1024; - ob.o_end = (ob.o_buf = ob.o_nxt = xmalloc(ob.o_len)) + ob.o_len; -} - -/* - * flush output buffer and close file - */ -void -outclose(void) -{ - - outclr(); - if (fclose(lout) == EOF) - err(1, "cannot close '%s'", loname); -} - -/* - * resize output buffer - */ -static void -outxbuf(void) -{ - ptrdiff_t coffs; - - coffs = ob.o_nxt - ob.o_buf; - ob.o_len *= 2; - ob.o_end = (ob.o_buf = xrealloc(ob.o_buf, ob.o_len)) + ob.o_len; - ob.o_nxt = ob.o_buf + coffs; -} - -/* - * reset output buffer - * if it is not empty, it is flushed - */ -void -outclr(void) -{ - size_t sz; - - if (ob.o_buf != ob.o_nxt) { - outchar('\n'); - sz = ob.o_nxt - ob.o_buf; - if (sz > ob.o_len) - errx(1, "internal error: outclr() 1"); - if (fwrite(ob.o_buf, sz, 1, lout) != 1) - err(1, "cannot write to %s", loname); - ob.o_nxt = ob.o_buf; - } -} - -/* - * write a character to the output buffer - */ -void -outchar(int c) -{ - - if (ob.o_nxt == ob.o_end) - outxbuf(); - *ob.o_nxt++ = (char)c; -} - -/* - * write a character to the output buffer, qouted if necessary - */ -void -outqchar(int c) -{ - - if (isprint(c) && c != '\\' && c != '"' && c != '\'') { - outchar(c); - } else { - outchar('\\'); - switch (c) { - case '\\': - outchar('\\'); - break; - case '"': - outchar('"'); - break; - case '\'': - outchar('\''); - break; - case '\b': - outchar('b'); - break; - case '\t': - outchar('t'); - break; - case '\n': - outchar('n'); - break; - case '\f': - outchar('f'); - break; - case '\r': - outchar('r'); - break; - case '\v': - outchar('v'); - break; - case '\a': - outchar('a'); - break; - default: - outchar((((u_int)c >> 6) & 07) + '0'); - outchar((((u_int)c >> 3) & 07) + '0'); - outchar((c & 07) + '0'); - break; - } - } -} - -/* - * write a strint to the output buffer - * the string must not contain any characters which - * should be quoted - */ -void -outstrg(const char *s) -{ - - while (*s != '\0') { - if (ob.o_nxt == ob.o_end) - outxbuf(); - *ob.o_nxt++ = *s++; - } -} - -/* - * write an integer value to toe output buffer - */ -void -outint(int i) -{ - - if ((ob.o_end - ob.o_nxt) < 3 * sizeof (int)) - outxbuf(); - ob.o_nxt += sprintf(ob.o_nxt, "%d", i); -} - -/* - * write the name of a symbol to the output buffer - * the name is preceded by its length - */ -void -outname(const char *name) -{ - - if (name == NULL) - errx(1, "internal error: outname() 1"); - outint((int)strlen(name)); - outstrg(name); -} - -/* - * write the name of the .c source - */ -void -outsrc(const char *name) -{ - - outclr(); - outchar('S'); - outstrg(name); -} diff --git a/usr.bin/xlint/common/externs.h b/usr.bin/xlint/common/externs.h deleted file mode 100644 index 8c454b40bc1b..000000000000 --- a/usr.bin/xlint/common/externs.h +++ /dev/null @@ -1,66 +0,0 @@ -/* $NetBSD: externs.h,v 1.1 2002/01/18 20:39:23 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * main[12].c - */ -extern int pflag; - -/* - * inittyp.c - */ -extern void inittyp(void); - -/* - * mem.c - */ -extern void *xmalloc(size_t); -extern void *xcalloc(size_t, size_t); -extern void *xrealloc(void *, size_t); -extern char *xstrdup(const char *); -extern void nomem(void); - -/* - * emit.c - */ -extern ob_t ob; - -extern void outopen(const char *); -extern void outclose(void); -extern void outclr(void); -extern void outchar(int); -extern void outqchar(int); -extern void outstrg(const char *); -extern void outint(int); -extern void outname(const char *); -extern void outsrc(const char *); diff --git a/usr.bin/xlint/common/ilp32.h b/usr.bin/xlint/common/ilp32.h deleted file mode 100644 index 5eb5f03dde72..000000000000 --- a/usr.bin/xlint/common/ilp32.h +++ /dev/null @@ -1,59 +0,0 @@ -/* $NetBSD: ilp32.h,v 1.1 2002/01/18 20:39:23 thorpej Exp $ */ - -/* - * Copyright (c) 2001 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Type sizes for IPL32 platforms (int, long, pointer: 32-bit) - */ - -#define CHAR_SIZE (CHAR_BIT) -#define SHORT_SIZE (2 * CHAR_BIT) -#define INT_SIZE (4 * CHAR_BIT) -#define LONG_SIZE (4 * CHAR_BIT) -#define QUAD_SIZE (8 * CHAR_BIT) -#define PTR_SIZE (4 * CHAR_BIT) - -#define TARG_INT_MAX ((int32_t) (((uint32_t) -1) >> 1)) -#define TARG_INT_MIN ((-TARG_INT_MAX) - 1) -#define TARG_UINT_MAX ((uint32_t) -1) - -#define TARG_LONG_MAX TARG_INT_MAX -#define TARG_LONG_MIN TARG_INT_MIN -#define TARG_ULONG_MAX TARG_UINT_MAX - -#define TARG_QUAD_MAX ((int64_t) (((uint64_t) -1) >> 1)) -#define TARG_QUAD_MIN ((-TARG_QUAD_MAX) - 1) -#define TARG_UQUAD_MAX ((uint64_t) -1) diff --git a/usr.bin/xlint/common/inittyp.c b/usr.bin/xlint/common/inittyp.c deleted file mode 100644 index b0958bffb2e9..000000000000 --- a/usr.bin/xlint/common/inittyp.c +++ /dev/null @@ -1,133 +0,0 @@ -/* $NetBSD: inittyp.c,v 1.3 2002/01/30 06:55:02 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: inittyp.c,v 1.3 2002/01/30 06:55:02 thorpej Exp $"); -#endif - -#include -#include -#include - -#include "lint.h" - -/* various type information */ -ttab_t ttab[NTSPEC]; - -void -inittyp(void) -{ - int i; - static const struct { - tspec_t it_tspec; - ttab_t it_ttab; - } ittab[NTSPEC] = { - { SIGNED, { 0, 0, - SIGNED, UNSIGN, - 0, 0, 0, 0, 0, "signed" } }, - { UNSIGN, { 0, 0, - SIGNED, UNSIGN, - 0, 0, 0, 0, 0, "unsigned" } }, - { CHAR, { CHAR_SIZE, CHAR_BIT, - SCHAR, UCHAR, - 1, 0, 0, 1, 1, "char" } }, - { SCHAR, { CHAR_SIZE, CHAR_BIT, - SCHAR, UCHAR, - 1, 0, 0, 1, 1, "signed char" } }, - { UCHAR, { CHAR_SIZE, CHAR_BIT, - SCHAR, UCHAR, - 1, 1, 0, 1, 1, "unsigned char" } }, - { SHORT, { SHORT_SIZE, 2 * CHAR_BIT, - SHORT, USHORT, - 1, 0, 0, 1, 1, "short" } }, - { USHORT, { SHORT_SIZE, 2 * CHAR_BIT, - SHORT, USHORT, - 1, 1, 0, 1, 1, "unsigned short" } }, - { INT, { INT_SIZE, 3 * CHAR_BIT, - INT, UINT, - 1, 0, 0, 1, 1, "int" } }, - { UINT, { INT_SIZE, 3 * CHAR_BIT, - INT, UINT, - 1, 1, 0, 1, 1, "unsigned int" } }, - { LONG, { LONG_SIZE, 4 * CHAR_BIT, - LONG, ULONG, - 1, 0, 0, 1, 1, "long" } }, - { ULONG, { LONG_SIZE, 4 * CHAR_BIT, - LONG, ULONG, - 1, 1, 0, 1, 1, "unsigned long" } }, - { QUAD, { QUAD_SIZE, 8 * CHAR_BIT, - QUAD, UQUAD, - 1, 0, 0, 1, 1, "long long" } }, - { UQUAD, { QUAD_SIZE, 8 * CHAR_BIT, - QUAD, UQUAD, - 1, 1, 0, 1, 1, "unsigned long long" } }, - { FLOAT, { FLOAT_SIZE, 4 * CHAR_BIT, - FLOAT, FLOAT, - 0, 0, 1, 1, 1, "float" } }, - { DOUBLE, { DOUBLE_SIZE, 8 * CHAR_BIT, - DOUBLE, DOUBLE, - 0, 0, 1, 1, 1, "double" } }, - { LDOUBLE, { LDOUBLE_SIZE, 10 * CHAR_BIT, - LDOUBLE, LDOUBLE, - 0, 0, 1, 1, 1, "long double" } }, - { VOID, { -1, -1, - VOID, VOID, - 0, 0, 0, 0, 0, "void" } }, - { STRUCT, { -1, -1, - STRUCT, STRUCT, - 0, 0, 0, 0, 0, "struct" } }, - { UNION, { -1, -1, - UNION, UNION, - 0, 0, 0, 0, 0, "union" } }, - { ENUM, { ENUM_SIZE, 3 * CHAR_BIT, - ENUM, ENUM, - 1, 0, 0, 1, 1, "enum" } }, - { PTR, { PTR_SIZE, 4 * CHAR_BIT, - PTR, PTR, - 0, 1, 0, 0, 1, "pointer" } }, - { ARRAY, { -1, -1, - ARRAY, ARRAY, - 0, 0, 0, 0, 0, "array" } }, - { FUNC, { -1, -1, - FUNC, FUNC, - 0, 0, 0, 0, 0, "function" } }, - }; - - for (i = 0; i < sizeof (ittab) / sizeof (ittab[0]); i++) - STRUCT_ASSIGN(ttab[ittab[i].it_tspec], ittab[i].it_ttab); - if (!pflag) { - for (i = 0; i < NTSPEC; i++) - ttab[i].tt_psz = ttab[i].tt_sz; - } -} diff --git a/usr.bin/xlint/common/lint.h b/usr.bin/xlint/common/lint.h deleted file mode 100644 index 231d2d6be490..000000000000 --- a/usr.bin/xlint/common/lint.h +++ /dev/null @@ -1,128 +0,0 @@ -/* $NetBSD: lint.h,v 1.7 2003/10/27 00:12:44 lukem Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#if HAVE_CONFIG_H -#include "config.h" -#else -#define HAVE_DECL_SYS_SIGNAME 1 -#endif - -#include -#include -#include -#include -#include - -#include "param.h" - -/* - * Type specifiers, used in type structures (type_t) and otherwere. - */ -typedef enum { - NOTSPEC = 0, - SIGNED, /* keyword "signed", only used in the parser */ - UNSIGN, /* keyword "unsigned", only used in the parser */ - CHAR, /* char */ - SCHAR, /* signed char */ - UCHAR, /* unsigned char */ - SHORT, /* (signed) short */ - USHORT, /* unsigned short */ - INT, /* (signed) int */ - UINT, /* unsigned int */ - LONG, /* (signed) long */ - ULONG, /* unsigned long */ - QUAD, /* (signed) long long */ - UQUAD, /* unsigned long long */ - FLOAT, /* float */ - DOUBLE, /* double or, with tflag, long float */ - LDOUBLE, /* long double */ - VOID, /* void */ - STRUCT, /* structure tag */ - UNION, /* union tag */ - ENUM, /* enum tag */ - PTR, /* pointer */ - ARRAY, /* array */ - FUNC, /* function */ - NTSPEC -} tspec_t; - -/* - * size of types, name and classification - */ -typedef struct { - int tt_sz; /* size in bits */ - int tt_psz; /* size, different from tt_sz - if pflag is set */ - tspec_t tt_styp; /* signed counterpart */ - tspec_t tt_utyp; /* unsigned counterpart */ - u_int tt_isityp : 1; /* 1 if integer type */ - u_int tt_isutyp : 1; /* 1 if unsigned integer type */ - u_int tt_isftyp : 1; /* 1 if floating point type */ - u_int tt_isatyp : 1; /* 1 if arithmetic type */ - u_int tt_issclt : 1; /* 1 if scalar type */ - const char *tt_name; /* Bezeichnung des Typs */ -} ttab_t; - -#define size(t) (ttab[t].tt_sz) -#define psize(t) (ttab[t].tt_psz) -#define styp(t) (ttab[t].tt_styp) -#define utyp(t) (ttab[t].tt_utyp) -#define isityp(t) (ttab[t].tt_isityp) -#define isutyp(t) (ttab[t].tt_isutyp) -#define isftyp(t) (ttab[t].tt_isftyp) -#define isatyp(t) (ttab[t].tt_isatyp) -#define issclt(t) (ttab[t].tt_issclt) - -extern ttab_t ttab[]; - - -typedef enum { - NODECL, /* until now not declared */ - DECL, /* declared */ - TDEF, /* tentative defined */ - DEF /* defined */ -} def_t; - -/* - * Following structure contains some data used for the output buffer. - */ -typedef struct ob { - char *o_buf; /* buffer */ - char *o_end; /* first byte after buffer */ - size_t o_len; /* length of buffer */ - char *o_nxt; /* next free byte in buffer */ -} ob_t; - -#include "externs.h" diff --git a/usr.bin/xlint/common/lp64.h b/usr.bin/xlint/common/lp64.h deleted file mode 100644 index cd88700872bc..000000000000 --- a/usr.bin/xlint/common/lp64.h +++ /dev/null @@ -1,59 +0,0 @@ -/* $NetBSD: lp64.h,v 1.1 2002/01/18 20:39:23 thorpej Exp $ */ - -/* - * Copyright (c) 2001 Wasabi Systems, Inc. - * All rights reserved. - * - * Written by Jason R. Thorpe for Wasabi Systems, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the NetBSD Project by - * Wasabi Systems, Inc. - * 4. The name of Wasabi Systems, Inc. may not be used to endorse - * or promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Type sizes for LP64 platforms (long, pointer: 64-bit) - */ - -#define CHAR_SIZE (CHAR_BIT) -#define SHORT_SIZE (2 * CHAR_BIT) -#define INT_SIZE (4 * CHAR_BIT) -#define LONG_SIZE (8 * CHAR_BIT) -#define QUAD_SIZE (8 * CHAR_BIT) -#define PTR_SIZE (8 * CHAR_BIT) - -#define TARG_INT_MAX ((int32_t) (((uint32_t) -1) >> 1)) -#define TARG_INT_MIN ((-TARG_INT_MAX) - 1) -#define TARG_UINT_MAX ((uint32_t) -1) - -#define TARG_QUAD_MAX ((int64_t) (((uint64_t) -1) >> 1)) -#define TARG_QUAD_MIN ((-TARG_QUAD_MAX) - 1) -#define TARG_UQUAD_MAX ((uint64_t) -1) - -#define TARG_LONG_MAX TARG_QUAD_MAX -#define TARG_LONG_MIN TARG_QUAD_MIN -#define TARG_ULONG_MAX TARG_UQUAD_MAX diff --git a/usr.bin/xlint/common/mem.c b/usr.bin/xlint/common/mem.c deleted file mode 100644 index 8802da1879b0..000000000000 --- a/usr.bin/xlint/common/mem.c +++ /dev/null @@ -1,93 +0,0 @@ -/* $NetBSD: mem.c,v 1.4 2003/10/16 06:35:26 itojun Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: mem.c,v 1.4 2003/10/16 06:35:26 itojun Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include - -#include "lint.h" - -void * -xmalloc(size_t s) -{ - void *p; - - if ((p = malloc(s)) == NULL) - nomem(); - return (p); -} - -void * -xcalloc(size_t n, size_t s) -{ - void *p; - - if ((p = calloc(n, s)) == NULL) - nomem(); - return (p); -} - -void * -xrealloc(void *p, size_t s) -{ - void *n; - - if ((n = realloc(p, s)) == NULL) { - free(p); - nomem(); - } - p = n; - return (p); -} - -char * -xstrdup(const char *s) -{ - char *s2; - - if ((s2 = strdup(s)) == NULL) - nomem(); - return (s2); -} - -void -nomem(void) -{ - - errx(1, "virtual memory exhausted"); -} diff --git a/usr.bin/xlint/common/param.h b/usr.bin/xlint/common/param.h deleted file mode 100644 index 5a28ce461b52..000000000000 --- a/usr.bin/xlint/common/param.h +++ /dev/null @@ -1,81 +0,0 @@ -/* $NetBSD: param.h,v 1.2 2002/02/05 03:04:26 thorpej Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Minimun size of string buffer. If this is not enough, the buffer - * is enlarged in steps of STRBLEN bytes. - */ -#define STRBLEN 256 - -/* - * This defines the size of memory blocks which are used to allocate - * memory in larger chunks. - */ -#define MBLKSIZ ((size_t)0x4000) - -/* - * Sizes of hash tables - * Should be a prime. Possible primes are - * 307, 401, 503, 601, 701, 809, 907, 1009, 1103, 1201, 1301, 1409, 1511. - * - * HSHSIZ1 symbol table 1st pass - * HSHSIZ2 symbol table 2nd pass - * THSHSIZ2 type table 2nd pass - */ -#define HSHSIZ1 503 -#define HSHSIZ2 1009 -#define THSHSIZ2 1009 - -/* - * Pull in target-specific parameters. - */ -#include "targparam.h" - -/* - * Make sure this matches wchar_t. - */ -#define WCHAR INT - -/* - * And the sparc64 long double code generation is broken. - */ -#if !defined(__sparc64__) -typedef long double ldbl_t; -#else -typedef double ldbl_t; -#endif - -/* - * Some traditional compilers are not able to assign structures. - */ -#define STRUCT_ASSIGN(dest, src) (dest) = (src) diff --git a/usr.bin/xlint/lint1/Makefile b/usr.bin/xlint/lint1/Makefile deleted file mode 100644 index 6792ba085f6d..000000000000 --- a/usr.bin/xlint/lint1/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# $NetBSD: Makefile,v 1.3 1995/07/04 01:53:05 cgd Exp $ -# $FreeBSD$ - -PROG= lint1 -SRCS= cgram.y scan.l mem1.c mem.c err.c main1.c decl.c tree.c func.c \ - init.c emit.c emit1.c inittyp.c -MAN= lint.7 -CLEANFILES= lint.7 - -LIBADD= l m -CFLAGS+= -I. -I${.CURDIR} -LINTFLAGS=-aehpz - -BINDIR= ${LIBEXECDIR} - -.PATH: ${.CURDIR}/../common - -lint.7: makeman - sh ${.CURDIR}/makeman ${DESTDIR}${BINDIR}/${PROG} -m >${.TARGET} - -.include diff --git a/usr.bin/xlint/lint1/Makefile.depend b/usr.bin/xlint/lint1/Makefile.depend deleted file mode 100644 index 8f4224119cdd..000000000000 --- a/usr.bin/xlint/lint1/Makefile.depend +++ /dev/null @@ -1,20 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - lib/msun \ - usr.bin/lex/lib \ - usr.bin/yacc.host \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/xlint/lint1/cgram.y b/usr.bin/xlint/lint1/cgram.y deleted file mode 100644 index 71d38f4f00bb..000000000000 --- a/usr.bin/xlint/lint1/cgram.y +++ /dev/null @@ -1,1893 +0,0 @@ -%{ -/* $NetBSD: cgram.y,v 1.40 2008/04/25 17:18:24 christos Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.40 2008/04/25 17:18:24 christos Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include - -#include "lint1.h" - -/* - * Contains the level of current declaration. 0 is extern. - * Used for symbol table entries. - */ -int blklev; - -/* - * level for memory allocation. Normaly the same as blklev. - * An exeption is the declaration of arguments in prototypes. Memory - * for these can't be freed after the declaration, but symbols must - * be removed from the symbol table after the declaration. - */ -int mblklev; - -/* - * Save the no-warns state and restore it to avoid the problem where - * if (expr) { stmt } / * NOLINT * / stmt; - */ -static int onowarn = -1; - -static int toicon(tnode_t *, int); -static void idecl(sym_t *, int, sbuf_t *); -static void ignuptorp(void); - -#ifdef DEBUG -static inline void CLRWFLGS(void); -static inline void CLRWFLGS(void) -{ - printf("%s, %d: clear flags %s %d\n", curr_pos.p_file, - curr_pos.p_line, __FILE__, __LINE__); - clrwflgs(); - onowarn = -1; -} - -static inline void SAVE(void); -static inline void SAVE(void) -{ - if (onowarn != -1) - abort(); - printf("%s, %d: save flags %s %d = %d\n", curr_pos.p_file, - curr_pos.p_line, __FILE__, __LINE__, nowarn); - onowarn = nowarn; -} - -static inline void RESTORE(void); -static inline void RESTORE(void) -{ - if (onowarn != -1) { - nowarn = onowarn; - printf("%s, %d: restore flags %s %d = %d\n", curr_pos.p_file, - curr_pos.p_line, __FILE__, __LINE__, nowarn); - onowarn = -1; - } else - CLRWFLGS(); -} -#else -#define CLRWFLGS() clrwflgs(), onowarn = -1 -#define SAVE() onowarn = nowarn -#define RESTORE() (void)(onowarn == -1 ? (clrwflgs(), 0) : (nowarn = onowarn)) -#endif -%} - -%expect 1 - -%union { - int y_int; - val_t *y_val; - sbuf_t *y_sb; - sym_t *y_sym; - op_t y_op; - scl_t y_scl; - tspec_t y_tspec; - tqual_t y_tqual; - type_t *y_type; - tnode_t *y_tnode; - range_t y_range; - strg_t *y_strg; - pqinf_t *y_pqinf; -}; - -%token T_LBRACE T_RBRACE T_LBRACK T_RBRACK T_LPARN T_RPARN -%token T_STROP -%token T_UNOP -%token T_INCDEC -%token T_SIZEOF -%token T_MULT -%token T_DIVOP -%token T_ADDOP -%token T_SHFTOP -%token T_RELOP -%token T_EQOP -%token T_AND -%token T_XOR -%token T_OR -%token T_LOGAND -%token T_LOGOR -%token T_QUEST -%token T_COLON -%token T_ASSIGN -%token T_OPASS -%token T_COMMA -%token T_SEMI -%token T_ELLIPSE - -/* storage classes (extern, static, auto, register and typedef) */ -%token T_SCLASS - -/* types (char, int, short, long, unsigned, signed, float, double, void) */ -%token T_TYPE - -/* qualifiers (const, volatile) */ -%token T_QUAL - -/* struct or union */ -%token T_SOU - -/* enum */ -%token T_ENUM - -/* remaining keywords */ -%token T_CASE -%token T_DEFAULT -%token T_IF -%token T_ELSE -%token T_SWITCH -%token T_DO -%token T_WHILE -%token T_FOR -%token T_GOTO -%token T_CONTINUE -%token T_BREAK -%token T_RETURN -%token T_ASM -%token T_SYMBOLRENAME - -%left T_COMMA -%right T_ASSIGN T_OPASS -%right T_QUEST T_COLON -%left T_LOGOR -%left T_LOGAND -%left T_OR -%left T_XOR -%left T_AND -%left T_EQOP -%left T_RELOP -%left T_SHFTOP -%left T_ADDOP -%left T_MULT T_DIVOP -%right T_UNOP T_INCDEC T_SIZEOF -%left T_LPARN T_LBRACK T_STROP - -%token T_NAME -%token T_TYPENAME -%token T_CON -%token T_STRING - -%type func_decl -%type notype_decl -%type type_decl -%type typespec -%type clrtyp_typespec -%type notype_typespec -%type struct_spec -%type enum_spec -%type struct_tag -%type enum_tag -%type struct -%type struct_declaration -%type identifier -%type member_declaration_list_with_rbrace -%type member_declaration_list -%type member_declaration -%type notype_member_decls -%type type_member_decls -%type notype_member_decl -%type type_member_decl -%type constant -%type enum_declaration -%type enums_with_opt_comma -%type enums -%type enumerator -%type ename -%type notype_direct_decl -%type type_direct_decl -%type pointer -%type asterisk -%type param_decl -%type param_list -%type abs_decl_param_list -%type direct_param_decl -%type notype_param_decl -%type direct_notype_param_decl -%type type_qualifier_list -%type type_qualifier -%type identifier_list -%type abs_decl -%type direct_abs_decl -%type vararg_parameter_type_list -%type parameter_type_list -%type parameter_declaration -%type expr -%type expr_stmnt_val -%type expr_stmnt_list -%type term -%type func_arg_list -%type point_or_arrow -%type type_name -%type abstract_declaration -%type do_while_expr -%type opt_expr -%type string -%type string2 -%type opt_asm_or_symbolrename -%type range -%type lorange - - -%% - -program: - /* empty */ { - if (sflag) { - /* empty translation unit */ - error(272); - } else if (!tflag) { - /* empty translation unit */ - warning(272); - } - } - | translation_unit - ; - -translation_unit: - ext_decl - | translation_unit ext_decl - ; - -ext_decl: - asm_stmnt - | func_def { - glclup(0); - CLRWFLGS(); - } - | data_def { - glclup(0); - CLRWFLGS(); - } - ; - -data_def: - T_SEMI { - if (sflag) { - /* syntax error: empty declaration */ - error(0); - } else if (!tflag) { - /* syntax error: empty declaration */ - warning(0); - } - } - | clrtyp deftyp notype_init_decls T_SEMI { - if (sflag) { - /* old style declaration; add "int" */ - error(1); - } else if (!tflag) { - /* old style declaration; add "int" */ - warning(1); - } - } - | declmods deftyp T_SEMI { - if (dcs->d_scl == TYPEDEF) { - /* typedef declares no type name */ - warning(72); - } else { - /* empty declaration */ - warning(2); - } - } - | declmods deftyp notype_init_decls T_SEMI - | declspecs deftyp T_SEMI { - if (dcs->d_scl == TYPEDEF) { - /* typedef declares no type name */ - warning(72); - } else if (!dcs->d_nedecl) { - /* empty declaration */ - warning(2); - } - } - | declspecs deftyp type_init_decls T_SEMI - | error T_SEMI { - globclup(); - } - | error T_RBRACE { - globclup(); - } - ; - -func_def: - func_decl { - if ($1->s_type->t_tspec != FUNC) { - /* syntax error */ - error(249); - YYERROR; - } - if ($1->s_type->t_typedef) { - /* ()-less function definition */ - error(64); - YYERROR; - } - funcdef($1); - blklev++; - pushdecl(ARG); - } opt_arg_declaration_list { - popdecl(); - blklev--; - cluparg(); - pushctrl(0); - } comp_stmnt { - funcend(); - popctrl(0); - } - ; - -func_decl: - clrtyp deftyp notype_decl { - $$ = $3; - } - | declmods deftyp notype_decl { - $$ = $3; - } - | declspecs deftyp type_decl { - $$ = $3; - } - ; - -opt_arg_declaration_list: - /* empty */ - | arg_declaration_list - ; - -arg_declaration_list: - arg_declaration - | arg_declaration_list arg_declaration - /* XXX or better "arg_declaration error" ? */ - | error - ; - -/* - * "arg_declaration" is separated from "declaration" because it - * needs other error handling. - */ - -arg_declaration: - declmods deftyp T_SEMI { - /* empty declaration */ - warning(2); - } - | declmods deftyp notype_init_decls T_SEMI - | declspecs deftyp T_SEMI { - if (!dcs->d_nedecl) { - /* empty declaration */ - warning(2); - } else { - tspec_t ts = dcs->d_type->t_tspec; - /* %s declared in argument declaration list */ - warning(3, ts == STRUCT ? "struct" : - (ts == UNION ? "union" : "enum")); - } - } - | declspecs deftyp type_init_decls T_SEMI { - if (dcs->d_nedecl) { - tspec_t ts = dcs->d_type->t_tspec; - /* %s declared in argument declaration list */ - warning(3, ts == STRUCT ? "struct" : - (ts == UNION ? "union" : "enum")); - } - } - | declmods error - | declspecs error - ; - -declaration: - declmods deftyp T_SEMI { - if (dcs->d_scl == TYPEDEF) { - /* typedef declares no type name */ - warning(72); - } else { - /* empty declaration */ - warning(2); - } - } - | declmods deftyp notype_init_decls T_SEMI - | declspecs deftyp T_SEMI { - if (dcs->d_scl == TYPEDEF) { - /* typedef declares no type name */ - warning(72); - } else if (!dcs->d_nedecl) { - /* empty declaration */ - warning(2); - } - } - | declspecs deftyp type_init_decls T_SEMI - | error T_SEMI - ; - -clrtyp: - { - clrtyp(); - } - ; - -deftyp: - /* empty */ { - deftyp(); - } - ; - -declspecs: - clrtyp_typespec { - addtype($1); - } - | declmods typespec { - addtype($2); - } - | declspecs declmod - | declspecs notype_typespec { - addtype($2); - } - ; - -declmods: - clrtyp T_QUAL { - addqual($2); - } - | clrtyp T_SCLASS { - addscl($2); - } - | declmods declmod - ; - -declmod: - T_QUAL { - addqual($1); - } - | T_SCLASS { - addscl($1); - } - ; - -clrtyp_typespec: - clrtyp notype_typespec { - $$ = $2; - } - | T_TYPENAME clrtyp { - $$ = getsym($1)->s_type; - } - ; - -typespec: - notype_typespec { - $$ = $1; - } - | T_TYPENAME { - $$ = getsym($1)->s_type; - } - ; - -notype_typespec: - T_TYPE { - $$ = gettyp($1); - } - | struct_spec { - popdecl(); - $$ = $1; - } - | enum_spec { - popdecl(); - $$ = $1; - } - ; - -struct_spec: - struct struct_tag { - /* - * STDC requires that "struct a;" always introduces - * a new tag if "a" is not declared at current level - * - * yychar is valid because otherwise the parser would - * not been able to deceide if he must shift or reduce - */ - $$ = mktag($2, $1, 0, yychar == T_SEMI); - } - | struct struct_tag { - dcs->d_tagtyp = mktag($2, $1, 1, 0); - } struct_declaration { - $$ = compltag(dcs->d_tagtyp, $4); - } - | struct { - dcs->d_tagtyp = mktag(NULL, $1, 1, 0); - } struct_declaration { - $$ = compltag(dcs->d_tagtyp, $3); - } - | struct error { - symtyp = FVFT; - $$ = gettyp(INT); - } - ; - -struct: - T_SOU { - symtyp = FTAG; - pushdecl($1 == STRUCT ? MOS : MOU); - dcs->d_offset = 0; - dcs->d_stralign = CHAR_BIT; - $$ = $1; - } - ; - -struct_tag: - identifier { - $$ = getsym($1); - } - ; - -struct_declaration: - struct_decl_lbrace member_declaration_list_with_rbrace { - $$ = $2; - } - ; - -struct_decl_lbrace: - T_LBRACE { - symtyp = FVFT; - } - ; - -member_declaration_list_with_rbrace: - member_declaration_list T_SEMI T_RBRACE { - $$ = $1; - } - | member_declaration_list T_RBRACE { - if (sflag) { - /* syntax req. ";" after last struct/union member */ - error(66); - } else { - /* syntax req. ";" after last struct/union member */ - warning(66); - } - $$ = $1; - } - | T_RBRACE { - $$ = NULL; - } - ; - -member_declaration_list: - member_declaration { - $$ = $1; - } - | member_declaration_list T_SEMI member_declaration { - $$ = lnklst($1, $3); - } - ; - -member_declaration: - noclass_declmods deftyp { - /* too late, i know, but getsym() compensates it */ - symtyp = FMOS; - } notype_member_decls { - symtyp = FVFT; - $$ = $4; - } - | noclass_declspecs deftyp { - symtyp = FMOS; - } type_member_decls { - symtyp = FVFT; - $$ = $4; - } - | noclass_declmods deftyp { - /* struct or union member must be named */ - warning(49); - $$ = NULL; - } - | noclass_declspecs deftyp { - /* struct or union member must be named */ - warning(49); - $$ = NULL; - } - | error { - symtyp = FVFT; - $$ = NULL; - } - ; - -noclass_declspecs: - clrtyp_typespec { - addtype($1); - } - | noclass_declmods typespec { - addtype($2); - } - | noclass_declspecs T_QUAL { - addqual($2); - } - | noclass_declspecs notype_typespec { - addtype($2); - } - ; - -noclass_declmods: - clrtyp T_QUAL { - addqual($2); - } - | noclass_declmods T_QUAL { - addqual($2); - } - ; - -notype_member_decls: - notype_member_decl { - $$ = decl1str($1); - } - | notype_member_decls { - symtyp = FMOS; - } T_COMMA type_member_decl { - $$ = lnklst($1, decl1str($4)); - } - ; - -type_member_decls: - type_member_decl { - $$ = decl1str($1); - } - | type_member_decls { - symtyp = FMOS; - } T_COMMA type_member_decl { - $$ = lnklst($1, decl1str($4)); - } - ; - -notype_member_decl: - notype_decl { - $$ = $1; - } - | notype_decl T_COLON constant { - $$ = bitfield($1, toicon($3, 1)); - } - | { - symtyp = FVFT; - } T_COLON constant { - $$ = bitfield(NULL, toicon($3, 1)); - } - ; - -type_member_decl: - type_decl { - $$ = $1; - } - | type_decl T_COLON constant { - $$ = bitfield($1, toicon($3, 1)); - } - | { - symtyp = FVFT; - } T_COLON constant { - $$ = bitfield(NULL, toicon($3, 1)); - } - ; - -enum_spec: - enum enum_tag { - $$ = mktag($2, ENUM, 0, 0); - } - | enum enum_tag { - dcs->d_tagtyp = mktag($2, ENUM, 1, 0); - } enum_declaration { - $$ = compltag(dcs->d_tagtyp, $4); - } - | enum { - dcs->d_tagtyp = mktag(NULL, ENUM, 1, 0); - } enum_declaration { - $$ = compltag(dcs->d_tagtyp, $3); - } - | enum error { - symtyp = FVFT; - $$ = gettyp(INT); - } - ; - -enum: - T_ENUM { - symtyp = FTAG; - pushdecl(ENUMCON); - } - ; - -enum_tag: - identifier { - $$ = getsym($1); - } - ; - -enum_declaration: - enum_decl_lbrace enums_with_opt_comma T_RBRACE { - $$ = $2; - } - ; - -enum_decl_lbrace: - T_LBRACE { - symtyp = FVFT; - enumval = 0; - } - ; - -enums_with_opt_comma: - enums { - $$ = $1; - } - | enums T_COMMA { - if (sflag) { - /* trailing "," prohibited in enum declaration */ - error(54); - } else { - /* trailing "," prohibited in enum declaration */ - (void)gnuism(54); - } - $$ = $1; - } - ; - -enums: - enumerator { - $$ = $1; - } - | enums T_COMMA enumerator { - $$ = lnklst($1, $3); - } - | error { - $$ = NULL; - } - ; - -enumerator: - ename { - $$ = ename($1, enumval, 1); - } - | ename T_ASSIGN constant { - $$ = ename($1, toicon($3, 1), 0); - } - ; - -ename: - identifier { - $$ = getsym($1); - } - ; - - -notype_init_decls: - notype_init_decl - | notype_init_decls T_COMMA type_init_decl - ; - -type_init_decls: - type_init_decl - | type_init_decls T_COMMA type_init_decl - ; - -notype_init_decl: - notype_decl opt_asm_or_symbolrename { - idecl($1, 0, $2); - chksz($1); - } - | notype_decl opt_asm_or_symbolrename { - idecl($1, 1, $2); - } T_ASSIGN initializer { - chksz($1); - } - ; - -type_init_decl: - type_decl opt_asm_or_symbolrename { - idecl($1, 0, $2); - chksz($1); - } - | type_decl opt_asm_or_symbolrename { - idecl($1, 1, $2); - } T_ASSIGN initializer { - chksz($1); - } - ; - -notype_decl: - notype_direct_decl { - $$ = $1; - } - | pointer notype_direct_decl { - $$ = addptr($2, $1); - } - ; - -notype_direct_decl: - T_NAME { - $$ = dname(getsym($1)); - } - | T_LPARN type_decl T_RPARN { - $$ = $2; - } - | notype_direct_decl T_LBRACK T_RBRACK { - $$ = addarray($1, 0, 0); - } - | notype_direct_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3, 0)); - } - | notype_direct_decl param_list { - $$ = addfunc($1, $2); - popdecl(); - blklev--; - } - ; - -type_decl: - type_direct_decl { - $$ = $1; - } - | pointer type_direct_decl { - $$ = addptr($2, $1); - } - ; - -type_direct_decl: - identifier { - $$ = dname(getsym($1)); - } - | T_LPARN type_decl T_RPARN { - $$ = $2; - } - | type_direct_decl T_LBRACK T_RBRACK { - $$ = addarray($1, 0, 0); - } - | type_direct_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3, 0)); - } - | type_direct_decl param_list { - $$ = addfunc($1, $2); - popdecl(); - blklev--; - } - ; - -/* - * param_decl and notype_param_decl exist to avoid a conflict in - * argument lists. A typename enclosed in parens should always be - * treated as a typename, not an argument. - * "typedef int a; f(int (a));" is "typedef int a; f(int foo(a));" - * not "typedef int a; f(int a);" - */ -param_decl: - direct_param_decl { - $$ = $1; - } - | pointer direct_param_decl { - $$ = addptr($2, $1); - } - ; - -direct_param_decl: - identifier { - $$ = dname(getsym($1)); - } - | T_LPARN notype_param_decl T_RPARN { - $$ = $2; - } - | direct_param_decl T_LBRACK T_RBRACK { - $$ = addarray($1, 0, 0); - } - | direct_param_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3, 0)); - } - | direct_param_decl param_list { - $$ = addfunc($1, $2); - popdecl(); - blklev--; - } - ; - -notype_param_decl: - direct_notype_param_decl { - $$ = $1; - } - | pointer direct_notype_param_decl { - $$ = addptr($2, $1); - } - ; - -direct_notype_param_decl: - T_NAME { - $$ = dname(getsym($1)); - } - | T_LPARN notype_param_decl T_RPARN { - $$ = $2; - } - | direct_notype_param_decl T_LBRACK T_RBRACK { - $$ = addarray($1, 0, 0); - } - | direct_notype_param_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3, 0)); - } - | direct_notype_param_decl param_list { - $$ = addfunc($1, $2); - popdecl(); - blklev--; - } - ; - -pointer: - asterisk { - $$ = $1; - } - | asterisk type_qualifier_list { - $$ = mergepq($1, $2); - } - | asterisk pointer { - $$ = mergepq($1, $2); - } - | asterisk type_qualifier_list pointer { - $$ = mergepq(mergepq($1, $2), $3); - } - ; - -asterisk: - T_MULT { - $$ = xcalloc(1, sizeof (pqinf_t)); - $$->p_pcnt = 1; - } - ; - -type_qualifier_list: - type_qualifier { - $$ = $1; - } - | type_qualifier_list type_qualifier { - $$ = mergepq($1, $2); - } - ; - -type_qualifier: - T_QUAL { - $$ = xcalloc(1, sizeof (pqinf_t)); - if ($1 == CONST) { - $$->p_const = 1; - } else { - $$->p_volatile = 1; - } - } - ; - -param_list: - id_list_lparn identifier_list T_RPARN { - $$ = $2; - } - | abs_decl_param_list { - $$ = $1; - } - ; - -id_list_lparn: - T_LPARN { - blklev++; - pushdecl(PARG); - } - ; - -identifier_list: - T_NAME { - $$ = iname(getsym($1)); - } - | identifier_list T_COMMA T_NAME { - $$ = lnklst($1, iname(getsym($3))); - } - | identifier_list error { - $$ = $1; - } - ; - -abs_decl_param_list: - abs_decl_lparn T_RPARN { - $$ = NULL; - } - | abs_decl_lparn vararg_parameter_type_list T_RPARN { - dcs->d_proto = 1; - $$ = $2; - } - | abs_decl_lparn error T_RPARN { - $$ = NULL; - } - ; - -abs_decl_lparn: - T_LPARN { - blklev++; - pushdecl(PARG); - } - ; - -vararg_parameter_type_list: - parameter_type_list { - $$ = $1; - } - | parameter_type_list T_COMMA T_ELLIPSE { - dcs->d_vararg = 1; - $$ = $1; - } - | T_ELLIPSE { - if (sflag) { - /* ANSI C requires formal parameter before "..." */ - error(84); - } else if (!tflag) { - /* ANSI C requires formal parameter before "..." */ - warning(84); - } - dcs->d_vararg = 1; - $$ = NULL; - } - ; - -parameter_type_list: - parameter_declaration { - $$ = $1; - } - | parameter_type_list T_COMMA parameter_declaration { - $$ = lnklst($1, $3); - } - ; - -parameter_declaration: - declmods deftyp { - $$ = decl1arg(aname(), 0); - } - | declspecs deftyp { - $$ = decl1arg(aname(), 0); - } - | declmods deftyp notype_param_decl { - $$ = decl1arg($3, 0); - } - /* - * param_decl is needed because of following conflict: - * "typedef int a; f(int (a));" could be parsed as - * "function with argument a of type int", or - * "function with an abstract argument of type function". - * This grammar realizes the second case. - */ - | declspecs deftyp param_decl { - $$ = decl1arg($3, 0); - } - | declmods deftyp abs_decl { - $$ = decl1arg($3, 0); - } - | declspecs deftyp abs_decl { - $$ = decl1arg($3, 0); - } - ; - -opt_asm_or_symbolrename: /* expect only one */ - /* empty */ { - $$ = NULL; - } - | T_ASM T_LPARN T_STRING T_RPARN { - freeyyv(&$3, T_STRING); - $$ = NULL; - } - | T_SYMBOLRENAME T_LPARN T_NAME T_RPARN { - $$ = $3; - } - ; - -initializer: - init_expr - ; - -init_expr: - expr %prec T_COMMA { - mkinit($1); - } - | init_by_name init_expr %prec T_COMMA - | init_lbrace init_expr_list init_rbrace - | init_lbrace init_expr_list T_COMMA init_rbrace - | error - ; - -init_expr_list: - init_expr %prec T_COMMA - | init_expr_list T_COMMA init_expr - ; - -lorange: - constant T_ELLIPSE { - $$.lo = toicon($1, 1); - } - ; -range: - constant { - $$.lo = toicon($1, 1); - $$.hi = $$.lo + 1; - } - | lorange constant { - $$.lo = $1.lo; - $$.hi = toicon($2, 1); - } - ; - -init_by_name: - T_LBRACK range T_RBRACK T_ASSIGN { - if (!Sflag) - warning(321); - } - | point identifier T_ASSIGN { - if (!Sflag) - warning(313); - memberpush($2); - } - | identifier T_COLON { - gnuism(315); - memberpush($1); - } - ; - -init_lbrace: - T_LBRACE { - initlbr(); - } - ; - -init_rbrace: - T_RBRACE { - initrbr(); - } - ; - -type_name: - { - pushdecl(ABSTRACT); - } abstract_declaration { - popdecl(); - $$ = $2->s_type; - } - ; - -abstract_declaration: - noclass_declmods deftyp { - $$ = decl1abs(aname()); - } - | noclass_declspecs deftyp { - $$ = decl1abs(aname()); - } - | noclass_declmods deftyp abs_decl { - $$ = decl1abs($3); - } - | noclass_declspecs deftyp abs_decl { - $$ = decl1abs($3); - } - ; - -abs_decl: - pointer { - $$ = addptr(aname(), $1); - } - | direct_abs_decl { - $$ = $1; - } - | pointer direct_abs_decl { - $$ = addptr($2, $1); - } - ; - -direct_abs_decl: - T_LPARN abs_decl T_RPARN { - $$ = $2; - } - | T_LBRACK T_RBRACK { - $$ = addarray(aname(), 0, 0); - } - | T_LBRACK constant T_RBRACK { - $$ = addarray(aname(), 1, toicon($2, 0)); - } - | direct_abs_decl T_LBRACK T_RBRACK { - $$ = addarray($1, 0, 0); - } - | direct_abs_decl T_LBRACK constant T_RBRACK { - $$ = addarray($1, 1, toicon($3, 0)); - } - | abs_decl_param_list { - $$ = addfunc(aname(), $1); - popdecl(); - blklev--; - } - | direct_abs_decl abs_decl_param_list { - $$ = addfunc($1, $2); - popdecl(); - blklev--; - } - ; - -non_expr_stmnt: - labeled_stmnt - | comp_stmnt - | selection_stmnt - | iteration_stmnt - | jump_stmnt { - ftflg = 0; - } - | asm_stmnt - -stmnt: - expr_stmnt - | non_expr_stmnt - ; - -labeled_stmnt: - label stmnt - ; - -label: - identifier T_COLON { - symtyp = FLAB; - label(T_NAME, getsym($1), NULL); - } - | T_CASE constant T_COLON { - label(T_CASE, NULL, $2); - ftflg = 1; - } - | T_CASE constant T_ELLIPSE constant T_COLON { - /* XXX: We don't fill all cases */ - label(T_CASE, NULL, $2); - ftflg = 1; - } - | T_DEFAULT T_COLON { - label(T_DEFAULT, NULL, NULL); - ftflg = 1; - } - ; - -comp_stmnt: - comp_stmnt_lbrace declaration_list opt_stmnt_list comp_stmnt_rbrace - | comp_stmnt_lbrace opt_stmnt_list comp_stmnt_rbrace - ; - -comp_stmnt_lbrace: - T_LBRACE { - blklev++; - mblklev++; - pushdecl(AUTO); - } - ; - -comp_stmnt_rbrace: - T_RBRACE { - popdecl(); - freeblk(); - mblklev--; - blklev--; - ftflg = 0; - } - ; - -opt_stmnt_list: - /* empty */ - | stmnt_list - ; - -stmnt_list: - stmnt - | stmnt_list stmnt { - RESTORE(); - } - | stmnt_list error T_SEMI - ; - -expr_stmnt: - expr T_SEMI { - expr($1, 0, 0, 1); - ftflg = 0; - } - | T_SEMI { - ftflg = 0; - } - ; - -/* - * The following two productions are used to implement - * ({ [[decl-list] stmt-list] }). - * XXX: This is not well tested. - */ -expr_stmnt_val: - expr T_SEMI { - /* XXX: We should really do that only on the last name */ - if ($1->tn_op == NAME) - $1->tn_sym->s_used = 1; - $$ = $1; - expr($1, 0, 0, 0); - ftflg = 0; - } - | non_expr_stmnt { - $$ = getnode(); - $$->tn_type = gettyp(VOID); - } - ; - -expr_stmnt_list: - expr_stmnt_val - | expr_stmnt_list expr_stmnt_val { - $$ = $2; - } - | expr_stmnt_list expr_stmnt_val - ; - -selection_stmnt: - if_without_else { - SAVE(); - if2(); - if3(0); - } - | if_without_else T_ELSE { - SAVE(); - if2(); - } stmnt { - CLRWFLGS(); - if3(1); - } - | if_without_else T_ELSE error { - CLRWFLGS(); - if3(0); - } - | switch_expr stmnt { - CLRWFLGS(); - switch2(); - } - | switch_expr error { - CLRWFLGS(); - switch2(); - } - ; - -if_without_else: - if_expr stmnt - | if_expr error - ; - -if_expr: - T_IF T_LPARN expr T_RPARN { - if1($3); - CLRWFLGS(); - } - ; - -switch_expr: - T_SWITCH T_LPARN expr T_RPARN { - switch1($3); - CLRWFLGS(); - } - ; - -do_stmnt: - do stmnt { - CLRWFLGS(); - } - ; - -iteration_stmnt: - while_expr stmnt { - CLRWFLGS(); - while2(); - } - | while_expr error { - CLRWFLGS(); - while2(); - } - | do_stmnt do_while_expr { - do2($2); - ftflg = 0; - } - | do error { - CLRWFLGS(); - do2(NULL); - } - | for_exprs stmnt { - CLRWFLGS(); - for2(); - } - | for_exprs error { - CLRWFLGS(); - for2(); - } - ; - -while_expr: - T_WHILE T_LPARN expr T_RPARN { - while1($3); - CLRWFLGS(); - } - ; - -do: - T_DO { - do1(); - } - ; - -do_while_expr: - T_WHILE T_LPARN expr T_RPARN T_SEMI { - $$ = $3; - } - ; - -for_exprs: - T_FOR T_LPARN opt_expr T_SEMI opt_expr T_SEMI opt_expr T_RPARN { - for1($3, $5, $7); - CLRWFLGS(); - } - ; - -opt_expr: - /* empty */ { - $$ = NULL; - } - | expr { - $$ = $1; - } - ; - -jump_stmnt: - goto identifier T_SEMI { - dogoto(getsym($2)); - } - | goto error T_SEMI { - symtyp = FVFT; - } - | T_CONTINUE T_SEMI { - docont(); - } - | T_BREAK T_SEMI { - dobreak(); - } - | T_RETURN T_SEMI { - doreturn(NULL); - } - | T_RETURN expr T_SEMI { - doreturn($2); - } - ; - -goto: - T_GOTO { - symtyp = FLAB; - } - ; - -asm_stmnt: - T_ASM T_LPARN read_until_rparn T_SEMI { - setasm(); - } - | T_ASM T_QUAL T_LPARN read_until_rparn T_SEMI { - setasm(); - } - | T_ASM error - ; - -read_until_rparn: - /* empty */ { - ignuptorp(); - } - ; - -declaration_list: - declaration { - CLRWFLGS(); - } - | declaration_list declaration { - CLRWFLGS(); - } - ; - -constant: - expr %prec T_COMMA { - $$ = $1; - } - ; - -expr: - expr T_MULT expr { - $$ = build(MULT, $1, $3); - } - | expr T_DIVOP expr { - $$ = build($2, $1, $3); - } - | expr T_ADDOP expr { - $$ = build($2, $1, $3); - } - | expr T_SHFTOP expr { - $$ = build($2, $1, $3); - } - | expr T_RELOP expr { - $$ = build($2, $1, $3); - } - | expr T_EQOP expr { - $$ = build($2, $1, $3); - } - | expr T_AND expr { - $$ = build(AND, $1, $3); - } - | expr T_XOR expr { - $$ = build(XOR, $1, $3); - } - | expr T_OR expr { - $$ = build(OR, $1, $3); - } - | expr T_LOGAND expr { - $$ = build(LOGAND, $1, $3); - } - | expr T_LOGOR expr { - $$ = build(LOGOR, $1, $3); - } - | expr T_QUEST expr T_COLON expr { - $$ = build(QUEST, $1, build(COLON, $3, $5)); - } - | expr T_ASSIGN expr { - $$ = build(ASSIGN, $1, $3); - } - | expr T_OPASS expr { - $$ = build($2, $1, $3); - } - | expr T_COMMA expr { - $$ = build(COMMA, $1, $3); - } - | term { - $$ = $1; - } - ; - -term: - T_NAME { - /* XXX really necessary? */ - if (yychar < 0) - yychar = yylex(); - $$ = getnnode(getsym($1), yychar); - } - | string { - $$ = getsnode($1); - } - | T_CON { - $$ = getcnode(gettyp($1->v_tspec), $1); - } - | T_LPARN expr T_RPARN { - if ($2 != NULL) - $2->tn_parn = 1; - $$ = $2; - } - | T_LPARN comp_stmnt_lbrace declaration_list expr_stmnt_list { - blklev--; - mblklev--; - initsym = mktempsym(duptyp($4->tn_type)); - mblklev++; - blklev++; - gnuism(320); - } comp_stmnt_rbrace T_RPARN { - $$ = getnnode(initsym, 0); - } - | T_LPARN comp_stmnt_lbrace expr_stmnt_list { - blklev--; - mblklev--; - initsym = mktempsym($3->tn_type); - mblklev++; - blklev++; - gnuism(320); - } comp_stmnt_rbrace T_RPARN { - $$ = getnnode(initsym, 0); - } - | term T_INCDEC { - $$ = build($2 == INC ? INCAFT : DECAFT, $1, NULL); - } - | T_INCDEC term { - $$ = build($1 == INC ? INCBEF : DECBEF, $2, NULL); - } - | T_MULT term { - $$ = build(STAR, $2, NULL); - } - | T_AND term { - $$ = build(AMPER, $2, NULL); - } - | T_UNOP term { - $$ = build($1, $2, NULL); - } - | T_ADDOP term { - if (tflag && $1 == PLUS) { - /* unary + is illegal in traditional C */ - warning(100); - } - $$ = build($1 == PLUS ? UPLUS : UMINUS, $2, NULL); - } - | term T_LBRACK expr T_RBRACK { - $$ = build(STAR, build(PLUS, $1, $3), NULL); - } - | term T_LPARN T_RPARN { - $$ = funccall($1, NULL); - } - | term T_LPARN func_arg_list T_RPARN { - $$ = funccall($1, $3); - } - | term point_or_arrow T_NAME { - if ($1 != NULL) { - sym_t *msym; - /* XXX strmemb should be integrated in build() */ - if ($2 == ARROW) { - /* must to this before strmemb is called */ - $1 = cconv($1); - } - msym = strmemb($1, $2, getsym($3)); - $$ = build($2, $1, getnnode(msym, 0)); - } else { - $$ = NULL; - } - } - | T_SIZEOF term %prec T_SIZEOF { - if (($$ = $2 == NULL ? NULL : bldszof($2->tn_type)) != NULL) - chkmisc($2, 0, 0, 0, 0, 0, 1); - } - | T_SIZEOF T_LPARN type_name T_RPARN %prec T_SIZEOF { - $$ = bldszof($3); - } - | T_LPARN type_name T_RPARN term %prec T_UNOP { - $$ = cast($4, $2); - } - | T_LPARN type_name T_RPARN %prec T_UNOP { - sym_t *tmp = mktempsym($2); - idecl(tmp, 1, NULL); - } init_lbrace init_expr_list init_rbrace { - if (!Sflag) - gnuism(319); - $$ = getnnode(initsym, 0); - } - ; - -string: - T_STRING { - $$ = $1; - } - | T_STRING string2 { - $$ = catstrg($1, $2); - } - ; - -string2: - T_STRING { - if (tflag) { - /* concatenated strings are illegal in traditional C */ - warning(219); - } - $$ = $1; - } - | string2 T_STRING { - $$ = catstrg($1, $2); - } - ; - -func_arg_list: - expr %prec T_COMMA { - $$ = funcarg(NULL, $1); - } - | func_arg_list T_COMMA expr { - $$ = funcarg($1, $3); - } - ; - -point_or_arrow: - T_STROP { - symtyp = FMOS; - $$ = $1; - } - ; - -point: - T_STROP { - if ($1 != POINT) - error(249); - } - ; - -identifier: - T_NAME { - $$ = $1; - } - | T_TYPENAME { - $$ = $1; - } - ; - -%% - -/* ARGSUSED */ -int -yyerror(char *msg) -{ - error(249); - if (++sytxerr >= 5) - norecover(); - return (0); -} - -static __inline int uq_gt(uint64_t, uint64_t); -static __inline int -uq_gt(uint64_t a, uint64_t b) -{ - - return (a > b); -} - -static __inline int q_gt(int64_t, int64_t); -static __inline int -q_gt(int64_t a, int64_t b) -{ - - return (a > b); -} - -#define q_lt(a, b) q_gt(b, a) - -/* - * Gets a node for a constant and returns the value of this constant - * as integer. - * Is the node not constant or too large for int or of type float, - * a warning will be printed. - * - * toicon() should be used only inside declarations. If it is used in - * expressions, it frees the memory used for the expression. - */ -static int -toicon(tnode_t *tn, int required) -{ - int i; - tspec_t t; - val_t *v; - - v = constant(tn, required); - - /* - * Abstract declarations are used inside expression. To free - * the memory would be a fatal error. - */ - if (dcs->d_ctx != ABSTRACT) - tfreeblk(); - - if ((t = v->v_tspec) == FLOAT || t == DOUBLE || t == LDOUBLE) { - i = (int)v->v_ldbl; - /* integral constant expression expected */ - error(55); - } else { - i = (int)v->v_quad; - if (isutyp(t)) { - if (uq_gt((uint64_t)v->v_quad, - (uint64_t)INT_MAX)) { - /* integral constant too large */ - warning(56); - } - } else { - if (q_gt(v->v_quad, (int64_t)INT_MAX) || - q_lt(v->v_quad, (int64_t)INT_MIN)) { - /* integral constant too large */ - warning(56); - } - } - } - free(v); - return (i); -} - -static void -idecl(sym_t *decl, int initflg, sbuf_t *rename) -{ - char *s; - - initerr = 0; - initsym = decl; - - switch (dcs->d_ctx) { - case EXTERN: - if (rename != NULL) { - if (decl->s_rename != NULL) - LERROR("idecl()"); - - s = getlblk(1, rename->sb_len + 1); - (void)memcpy(s, rename->sb_name, rename->sb_len + 1); - decl->s_rename = s; - freeyyv(&rename, T_NAME); - } - decl1ext(decl, initflg); - break; - case ARG: - if (rename != NULL) { - /* symbol renaming can't be used on function arguments */ - error(310); - freeyyv(&rename, T_NAME); - break; - } - (void)decl1arg(decl, initflg); - break; - case AUTO: - if (rename != NULL) { - /* symbol renaming can't be used on automatic variables */ - error(311); - freeyyv(&rename, T_NAME); - break; - } - decl1loc(decl, initflg); - break; - default: - LERROR("idecl()"); - } - - if (initflg && !initerr) - prepinit(); -} - -/* - * Discard all input tokens up to and including the next - * unmatched right paren - */ -static void -ignuptorp(void) -{ - int level; - - if (yychar < 0) - yychar = yylex(); - freeyyv(&yylval, yychar); - - level = 1; - while (yychar != T_RPARN || --level > 0) { - if (yychar == T_LPARN) { - level++; - } else if (yychar <= 0) { - break; - } - freeyyv(&yylval, yychar = yylex()); - } - - yyclearin; -} diff --git a/usr.bin/xlint/lint1/decl.c b/usr.bin/xlint/lint1/decl.c deleted file mode 100644 index 829e0e98480e..000000000000 --- a/usr.bin/xlint/lint1/decl.c +++ /dev/null @@ -1,3052 +0,0 @@ -/* $NetBSD: decl.c,v 1.33 2004/06/20 22:20:16 jmc Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.33 2004/06/20 22:20:16 jmc Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include - -#include "lint1.h" - -const char *unnamed = ""; - -/* shared type structures for arithmtic types and void */ -static type_t *typetab; - -/* value of next enumerator during declaration of enum types */ -int enumval; - -/* - * pointer to top element of a stack which contains informations local - * to nested declarations - */ -dinfo_t *dcs; - -static type_t *tdeferr(type_t *, tspec_t); -static void settdsym(type_t *, sym_t *); -static tspec_t mrgtspec(tspec_t, tspec_t); -static void align(int, int); -static sym_t *newtag(sym_t *, scl_t, int, int); -static int eqargs(type_t *, type_t *, int *); -static int mnoarg(type_t *, int *); -static int chkosdef(sym_t *, sym_t *); -static int chkptdecl(sym_t *, sym_t *); -static sym_t *nsfunc(sym_t *, sym_t *); -static void osfunc(sym_t *, sym_t *); -static void ledecl(sym_t *); -static int chkinit(sym_t *); -static void chkausg(int, sym_t *); -static void chkvusg(int, sym_t *); -static void chklusg(sym_t *); -static void chktusg(sym_t *); -static void chkglvar(sym_t *); -static void glchksz(sym_t *); - -/* - * initializes all global vars used in declarations - */ -void -initdecl(void) -{ - int i; - - /* declaration stack */ - if ((dcs = calloc(1, sizeof (dinfo_t))) == NULL) - nomem(); - dcs->d_ctx = EXTERN; - dcs->d_ldlsym = &dcs->d_dlsyms; - - /* type information and classification */ - inittyp(); - - /* shared type structures */ - if ((typetab = calloc(NTSPEC, sizeof (type_t))) == NULL) - nomem(); - for (i = 0; i < NTSPEC; i++) - typetab[i].t_tspec = NOTSPEC; - typetab[CHAR].t_tspec = CHAR; - typetab[SCHAR].t_tspec = SCHAR; - typetab[UCHAR].t_tspec = UCHAR; - typetab[SHORT].t_tspec = SHORT; - typetab[USHORT].t_tspec = USHORT; - typetab[INT].t_tspec = INT; - typetab[UINT].t_tspec = UINT; - typetab[LONG].t_tspec = LONG; - typetab[ULONG].t_tspec = ULONG; - typetab[QUAD].t_tspec = QUAD; - typetab[UQUAD].t_tspec = UQUAD; - typetab[FLOAT].t_tspec = FLOAT; - typetab[DOUBLE].t_tspec = DOUBLE; - typetab[LDOUBLE].t_tspec = LDOUBLE; - typetab[VOID].t_tspec = VOID; - /* - * Next two are not real types. They are only used by the parser - * to return keywords "signed" and "unsigned" - */ - typetab[SIGNED].t_tspec = SIGNED; - typetab[UNSIGN].t_tspec = UNSIGN; -} - -/* - * Returns a shared type structure vor arithmetic types and void. - * - * It's important to duplicate this structure (using duptyp() or tdupdyp()) - * if it is to be modified (adding qualifiers or anything else). - */ -type_t * -gettyp(tspec_t t) -{ - - return (&typetab[t]); -} - -type_t * -duptyp(const type_t *tp) -{ - type_t *ntp; - - ntp = getblk(sizeof (type_t)); - STRUCT_ASSIGN(*ntp, *tp); - return (ntp); -} - -/* - * Use tduptyp() instead of duptyp() inside expressions (if the - * allocated memory should be freed after the expr). - */ -type_t * -tduptyp(const type_t *tp) -{ - type_t *ntp; - - ntp = tgetblk(sizeof (type_t)); - STRUCT_ASSIGN(*ntp, *tp); - return (ntp); -} - -/* - * Returns 1 if the argument is void or an incomplete array, - * struct, union or enum type. - */ -int -incompl(type_t *tp) -{ - tspec_t t; - - if ((t = tp->t_tspec) == VOID) { - return (1); - } else if (t == ARRAY) { - return (tp->t_aincompl); - } else if (t == STRUCT || t == UNION) { - return (tp->t_str->sincompl); - } else if (t == ENUM) { - return (tp->t_enum->eincompl); - } - return (0); -} - -/* - * Set the flag for (in)complete array, struct, union or enum - * types. - */ -void -setcompl(type_t *tp, int ic) -{ - tspec_t t; - - if ((t = tp->t_tspec) == ARRAY) { - tp->t_aincompl = ic; - } else if (t == STRUCT || t == UNION) { - tp->t_str->sincompl = ic; - } else { - if (t != ENUM) - LERROR("setcompl()"); - tp->t_enum->eincompl = ic; - } -} - -/* - * Remember the storage class of the current declaration in dcs->d_scl - * (the top element of the declaration stack) and detect multiple - * storage classes. - */ -void -addscl(scl_t sc) -{ - - if (sc == INLINE) { - if (dcs->d_inline) - /* duplicate '%s' */ - warning(10, "inline"); - dcs->d_inline = 1; - return; - } - if (dcs->d_type != NULL || dcs->d_atyp != NOTSPEC || - dcs->d_smod != NOTSPEC || dcs->d_lmod != NOTSPEC) { - /* storage class after type is obsolescent */ - warning(83); - } - if (dcs->d_scl == NOSCL) { - dcs->d_scl = sc; - } else { - /* - * multiple storage classes. An error will be reported in - * deftyp(). - */ - dcs->d_mscl = 1; - } -} - -/* - * Remember the type, modifier or typedef name returned by the parser - * in *dcs (top element of decl stack). This information is used in - * deftyp() to build the type used for all declarators in this - * declaration. - * - * Is tp->t_typedef 1, the type comes from a previously defined typename. - * Otherwise it comes from a type specifier (int, long, ...) or a - * struct/union/enum tag. - */ -void -addtype(type_t *tp) -{ - tspec_t t; - - if (tp->t_typedef) { - if (dcs->d_type != NULL || dcs->d_atyp != NOTSPEC || - dcs->d_lmod != NOTSPEC || dcs->d_smod != NOTSPEC) { - /* - * something like "typedef int a; int a b;" - * This should not happen with current grammar. - */ - LERROR("addtype()"); - } - dcs->d_type = tp; - return; - } - - t = tp->t_tspec; - - if (t == STRUCT || t == UNION || t == ENUM) { - /* - * something like "int struct a ..." - * struct/union/enum with anything else is not allowed - */ - if (dcs->d_type != NULL || dcs->d_atyp != NOTSPEC || - dcs->d_lmod != NOTSPEC || dcs->d_smod != NOTSPEC) { - /* - * remember that an error must be reported in - * deftyp(). - */ - dcs->d_terr = 1; - dcs->d_atyp = dcs->d_lmod = dcs->d_smod = NOTSPEC; - } - dcs->d_type = tp; - return; - } - - if (dcs->d_type != NULL && !dcs->d_type->t_typedef) { - /* - * something like "struct a int" - * struct/union/enum with anything else is not allowed - */ - dcs->d_terr = 1; - return; - } - - if (t == LONG && dcs->d_lmod == LONG) { - /* "long long" or "long ... long" */ - t = QUAD; - dcs->d_lmod = NOTSPEC; - if (!quadflg) - /* %s C does not support 'long long' */ - (void)c99ism(265, tflag ? "traditional" : "c89"); - } - - if (dcs->d_type != NULL && dcs->d_type->t_typedef) { - /* something like "typedef int a; a long ..." */ - dcs->d_type = tdeferr(dcs->d_type, t); - return; - } - - /* now it can be only a combination of arithmetic types and void */ - if (t == SIGNED || t == UNSIGN) { - /* remember specifiers "signed" and "unsigned" in dcs->d_smod */ - if (dcs->d_smod != NOTSPEC) - /* - * more than one "signed" and/or "unsigned"; print - * an error in deftyp() - */ - dcs->d_terr = 1; - dcs->d_smod = t; - } else if (t == SHORT || t == LONG || t == QUAD) { - /* - * remember specifiers "short", "long" and "long long" in - * dcs->d_lmod - */ - if (dcs->d_lmod != NOTSPEC) - /* more than one, print error in deftyp() */ - dcs->d_terr = 1; - dcs->d_lmod = t; - } else { - /* - * remember specifiers "void", "char", "int", "float" or - * "double" int dcs->d_atyp - */ - if (dcs->d_atyp != NOTSPEC) - /* more than one, print error in deftyp() */ - dcs->d_terr = 1; - dcs->d_atyp = t; - } -} - -/* - * called if a list of declaration specifiers contains a typedef name - * and other specifiers (except struct, union, enum, typedef name) - */ -static type_t * -tdeferr(type_t *td, tspec_t t) -{ - tspec_t t2; - - t2 = td->t_tspec; - - switch (t) { - case SIGNED: - case UNSIGN: - if (t2 == CHAR || t2 == SHORT || t2 == INT || t2 == LONG || - t2 == QUAD) { - if (!tflag) - /* modifying typedef with ... */ - warning(5, ttab[t].tt_name); - td = duptyp(gettyp(mrgtspec(t2, t))); - td->t_typedef = 1; - return (td); - } - break; - case SHORT: - if (t2 == INT || t2 == UINT) { - /* modifying typedef with ... */ - warning(5, "short"); - td = duptyp(gettyp(t2 == INT ? SHORT : USHORT)); - td->t_typedef = 1; - return (td); - } - break; - case LONG: - if (t2 == INT || t2 == UINT || t2 == LONG || t2 == ULONG || - t2 == FLOAT || t2 == DOUBLE) { - /* modifying typedef with ... */ - warning(5, "long"); - if (t2 == INT) { - td = gettyp(LONG); - } else if (t2 == UINT) { - td = gettyp(ULONG); - } else if (t2 == LONG) { - td = gettyp(QUAD); - } else if (t2 == ULONG) { - td = gettyp(UQUAD); - } else if (t2 == FLOAT) { - td = gettyp(DOUBLE); - } else if (t2 == DOUBLE) { - td = gettyp(LDOUBLE); - } - td = duptyp(td); - td->t_typedef = 1; - return (td); - } - break; - /* LINTED (enumeration values not handled in switch) */ - case NOTSPEC: - case USHORT: - case UCHAR: - case SCHAR: - case CHAR: - case FUNC: - case ARRAY: - case PTR: - case ENUM: - case UNION: - case STRUCT: - case VOID: - case LDOUBLE: - case DOUBLE: - case FLOAT: - case UQUAD: - case QUAD: - case ULONG: - case UINT: - case INT: - break; - } - - /* Anything other is not accepted. */ - - dcs->d_terr = 1; - return (td); -} - -/* - * Remember the symbol of a typedef name (2nd arg) in a struct, union - * or enum tag if the typedef name is the first defined for this tag. - * - * If the tag is unnamed, the typdef name is used for identification - * of this tag in lint2. Although its possible that more than one typedef - * name is defined for one tag, the first name defined should be unique - * if the tag is unnamed. - */ -static void -settdsym(type_t *tp, sym_t *sym) -{ - tspec_t t; - - if ((t = tp->t_tspec) == STRUCT || t == UNION) { - if (tp->t_str->stdef == NULL) - tp->t_str->stdef = sym; - } else if (t == ENUM) { - if (tp->t_enum->etdef == NULL) - tp->t_enum->etdef = sym; - } -} - -/* - * Remember a qualifier which is part of the declaration specifiers - * (and not the declarator) in the top element of the declaration stack. - * Also detect multiple qualifiers of the same kind. - - * The remembered qualifier is used by deftyp() to construct the type - * for all declarators. - */ -void -addqual(tqual_t q) -{ - - if (q == CONST) { - if (dcs->d_const) { - /* duplicate "%s" */ - warning(10, "const"); - } - dcs->d_const = 1; - } else { - if (q != VOLATILE) - LERROR("addqual()"); - if (dcs->d_volatile) { - /* duplicate "%s" */ - warning(10, "volatile"); - } - dcs->d_volatile = 1; - } -} - -/* - * Go to the next declaration level (structs, nested structs, blocks, - * argument declaration lists ...) - */ -void -pushdecl(scl_t sc) -{ - dinfo_t *di; - - if (dflag) - (void)printf("pushdecl(%d)\n", (int)sc); - - /* put a new element on the declaration stack */ - if ((di = calloc(1, sizeof (dinfo_t))) == NULL) - nomem(); - di->d_nxt = dcs; - dcs = di; - di->d_ctx = sc; - di->d_ldlsym = &di->d_dlsyms; -} - -/* - * Go back to previous declaration level - */ -void -popdecl(void) -{ - dinfo_t *di; - - if (dflag) - (void)printf("popdecl(%d)\n", (int)dcs->d_ctx); - - if (dcs->d_nxt == NULL) - LERROR("popdecl()"); - di = dcs; - dcs = di->d_nxt; - switch (di->d_ctx) { - case EXTERN: - /* there is nothing after external declarations */ - LERROR("popdecl()"); - /* NOTREACHED */ - case MOS: - case MOU: - case ENUMCON: - /* - * Symbols declared in (nested) structs or enums are - * part of the next level (they are removed from the - * symbol table if the symbols of the outher level are - * removed) - */ - if ((*dcs->d_ldlsym = di->d_dlsyms) != NULL) - dcs->d_ldlsym = di->d_ldlsym; - break; - case ARG: - /* - * All symbols in dcs->d_dlsyms are introduced in old style - * argument declarations (it's not clean, but possible). - * They are appended to the list of symbols declared in - * an old style argument identifier list or a new style - * parameter type list. - */ - if (di->d_dlsyms != NULL) { - *di->d_ldlsym = dcs->d_fpsyms; - dcs->d_fpsyms = di->d_dlsyms; - } - break; - case ABSTRACT: - /* - * casts and sizeof - * Append all symbols declared in the abstract declaration - * to the list of symbols declared in the surrounding decl. - * or block. - * XXX I'm not sure whether they should be removed from the - * symbol table now or later. - */ - if ((*dcs->d_ldlsym = di->d_dlsyms) != NULL) - dcs->d_ldlsym = di->d_ldlsym; - break; - case AUTO: - /* check usage of local vars */ - chkusage(di); - /* FALLTHROUGH */ - case PARG: - /* usage of arguments will be checked by funcend() */ - rmsyms(di->d_dlsyms); - break; - default: - LERROR("popdecl()"); - } - free(di); -} - -/* - * Set flag d_asm in all declaration stack elements up to the - * outermost one. - * - * This is used to mark compound statements which have, possibly in - * nested compound statements, asm statements. For these compound - * statements no warnings about unused or unitialized variables are - * printed. - * - * There is no need to clear d_asm in dinfo structs with context AUTO, - * because these structs are freed at the end of the compound statement. - * But it must be cleard in the outermost dinfo struct, which has - * context EXTERN. This could be done in clrtyp() and would work for - * C, but not for C++ (due to mixed statements and declarations). Thus - * we clear it in glclup(), which is used to do some cleanup after - * global declarations/definitions. - */ -void -setasm(void) -{ - dinfo_t *di; - - for (di = dcs; di != NULL; di = di->d_nxt) - di->d_asm = 1; -} - -/* - * Clean all elements of the top element of declaration stack which - * will be used by the next declaration - */ -void -clrtyp(void) -{ - - dcs->d_atyp = dcs->d_smod = dcs->d_lmod = NOTSPEC; - dcs->d_scl = NOSCL; - dcs->d_type = NULL; - dcs->d_const = dcs->d_volatile = 0; - dcs->d_inline = 0; - dcs->d_mscl = dcs->d_terr = 0; - dcs->d_nedecl = 0; - dcs->d_notyp = 0; -} - -/* - * Create a type structure from the informations gathered in - * the declaration stack. - * Complain about storage classes which are not possible in current - * context. - */ -void -deftyp(void) -{ - tspec_t t, s, l; - type_t *tp; - scl_t scl; - - t = dcs->d_atyp; /* CHAR, INT, FLOAT, DOUBLE, VOID */ - s = dcs->d_smod; /* SIGNED, UNSIGNED */ - l = dcs->d_lmod; /* SHORT, LONG, QUAD */ - tp = dcs->d_type; - scl = dcs->d_scl; - - if (t == NOTSPEC && s == NOTSPEC && l == NOTSPEC && tp == NULL) - dcs->d_notyp = 1; - - if (tp != NULL && (t != NOTSPEC || s != NOTSPEC || l != NOTSPEC)) { - /* should never happen */ - LERROR("deftyp()"); - } - - if (tp == NULL) { - switch (t) { - case NOTSPEC: - t = INT; - /* FALLTHROUGH */ - case INT: - if (s == NOTSPEC) - s = SIGNED; - break; - case CHAR: - if (l != NOTSPEC) { - dcs->d_terr = 1; - l = NOTSPEC; - } - break; - case FLOAT: - if (l == LONG) { - l = NOTSPEC; - t = DOUBLE; - if (!tflag) - /* use 'double' instead of ... */ - warning(6); - } - break; - case DOUBLE: - if (l == LONG) { - l = NOTSPEC; - t = LDOUBLE; - if (tflag) - /* 'long double' is illegal in ... */ - warning(266); - } - break; - case VOID: - break; - default: - LERROR("deftyp()"); - } - if (t != INT && t != CHAR && (s != NOTSPEC || l != NOTSPEC)) { - dcs->d_terr = 1; - l = s = NOTSPEC; - } - if (l != NOTSPEC) - t = l; - dcs->d_type = gettyp(mrgtspec(t, s)); - } - - if (dcs->d_mscl) { - /* only one storage class allowed */ - error(7); - } - if (dcs->d_terr) { - /* illegal type combination */ - error(4); - } - - if (dcs->d_ctx == EXTERN) { - if (scl == REG || scl == AUTO) { - /* illegal storage class */ - error(8); - scl = NOSCL; - } - } else if (dcs->d_ctx == ARG || dcs->d_ctx == PARG) { - if (scl != NOSCL && scl != REG) { - /* only "register" valid ... */ - error(9); - scl = NOSCL; - } - } - - dcs->d_scl = scl; - - if (dcs->d_const && dcs->d_type->t_const) { - if (!dcs->d_type->t_typedef) - LERROR("deftyp()"); - /* typedef already qualified with "%s" */ - warning(68, "const"); - } - if (dcs->d_volatile && dcs->d_type->t_volatile) { - if (!dcs->d_type->t_typedef) - LERROR("deftyp()"); - /* typedef already qualified with "%s" */ - warning(68, "volatile"); - } - - if (dcs->d_const || dcs->d_volatile) { - dcs->d_type = duptyp(dcs->d_type); - dcs->d_type->t_const |= dcs->d_const; - dcs->d_type->t_volatile |= dcs->d_volatile; - } -} - -/* - * Merge type specifiers (char, ..., long long, signed, unsigned). - */ -static tspec_t -mrgtspec(tspec_t t, tspec_t s) -{ - - if (s == SIGNED || s == UNSIGN) { - if (t == CHAR) { - t = s == SIGNED ? SCHAR : UCHAR; - } else if (t == SHORT) { - t = s == SIGNED ? SHORT : USHORT; - } else if (t == INT) { - t = s == SIGNED ? INT : UINT; - } else if (t == LONG) { - t = s == SIGNED ? LONG : ULONG; - } else if (t == QUAD) { - t = s == SIGNED ? QUAD : UQUAD; - } - } - - return (t); -} - -/* - * Return the length of a type in bit. - * - * Printing a message if the outhermost dimension of an array is 0 must - * be done by the caller. All other problems are reported by length() - * if name is not NULL. - */ -int -length(type_t *tp, const char *name) -{ - int elem, elsz; - - elem = 1; - while (tp && tp->t_tspec == ARRAY) { - elem *= tp->t_dim; - tp = tp->t_subt; - } - if (tp == NULL) - return -1; - - switch (tp->t_tspec) { - case FUNC: - /* compiler takes size of function */ - LERROR("%s", msgs[12]); - /* NOTREACHED */ - case STRUCT: - case UNION: - if (incompl(tp) && name != NULL) { - /* incomplete structure or union %s: %s */ - error(31, tp->t_str->stag->s_name, name); - } - elsz = tp->t_str->size; - break; - case ENUM: - if (incompl(tp) && name != NULL) { - /* incomplete enum type: %s */ - warning(13, name); - } - /* FALLTHROUGH */ - default: - elsz = size(tp->t_tspec); - if (elsz <= 0) - LERROR("length()"); - break; - } - return (elem * elsz); -} - -/* - * Get the alignment of the given type in bits. - */ -int -getbound(type_t *tp) -{ - int a; - tspec_t t; - - while (tp && tp->t_tspec == ARRAY) - tp = tp->t_subt; - - if (tp == NULL) - return -1; - - if ((t = tp->t_tspec) == STRUCT || t == UNION) { - a = tp->t_str->align; - } else if (t == FUNC) { - /* compiler takes alignment of function */ - error(14); - a = LINT_ALIGN(1) * CHAR_BIT; - } else { - if ((a = size(t)) == 0) { - a = CHAR_BIT; - } else if (a > LINT_ALIGN(1) * CHAR_BIT) { - a = LINT_ALIGN(1) * CHAR_BIT; - } - } - if (a < CHAR_BIT || a > LINT_ALIGN(1) * CHAR_BIT) - LERROR("getbound()"); - return (a); -} - -/* - * Concatenate two lists of symbols by s_nxt. Used by declarations of - * struct/union/enum elements and parameters. - */ -sym_t * -lnklst(sym_t *l1, sym_t *l2) -{ - sym_t *l; - - if ((l = l1) == NULL) - return (l2); - while (l1->s_nxt != NULL) - l1 = l1->s_nxt; - l1->s_nxt = l2; - return (l); -} - -/* - * Check if the type of the given symbol is valid and print an error - * message if it is not. - * - * Invalid types are: - * - arrays of incomlete types or functions - * - functions returning arrays or functions - * - void types other than type of function or pointer - */ -void -chktyp(sym_t *sym) -{ - tspec_t to, t; - type_t **tpp, *tp; - - tpp = &sym->s_type; - to = NOTSPEC; - while ((tp = *tpp) != NULL) { - t = tp->t_tspec; - /* - * If this is the type of an old style function definition, - * a better warning is printed in funcdef(). - */ - if (t == FUNC && !tp->t_proto && - !(to == NOTSPEC && sym->s_osdef)) { - if (sflag && hflag) - /* function declaration is not a prototype */ - warning(287); - } - if (to == FUNC) { - if (t == FUNC || t == ARRAY) { - /* function returns illegal type */ - error(15); - if (t == FUNC) { - *tpp = incref(*tpp, PTR); - } else { - *tpp = incref((*tpp)->t_subt, PTR); - } - return; - } else if (tp->t_const || tp->t_volatile) { - if (sflag) { /* XXX oder better !tflag ? */ - /* function cannot return const... */ - warning(228); - } - } - } if (to == ARRAY) { - if (t == FUNC) { - /* array of function is illegal */ - error(16); - *tpp = gettyp(INT); - return; - } else if (t == ARRAY && tp->t_dim == 0) { - /* null dimension */ - error(17); - return; - } else if (t == VOID) { - /* illegal use of void */ - error(18); - *tpp = gettyp(INT); -#if 0 /* errors are produced by length() */ - } else if (incompl(tp)) { - /* array of incomplete type */ - if (sflag) { - error(301); - } else { - warning(301); - } -#endif - } - } else if (to == NOTSPEC && t == VOID) { - if (dcs->d_ctx == PARG) { - if (sym->s_scl != ABSTRACT) { - if (sym->s_name == unnamed) - LERROR("chktyp()"); - /* void param cannot have name: %s */ - error(61, sym->s_name); - *tpp = gettyp(INT); - } - } else if (dcs->d_ctx == ABSTRACT) { - /* ok */ - } else if (sym->s_scl != TYPEDEF) { - /* void type for %s */ - error(19, sym->s_name); - *tpp = gettyp(INT); - } - } - if (t == VOID && to != PTR) { - if (tp->t_const || tp->t_volatile) { - /* inappropriate qualifiers with "void" */ - warning(69); - tp->t_const = tp->t_volatile = 0; - } - } - tpp = &tp->t_subt; - to = t; - } -} - -/* - * Process the declarator of a struct/union element. - */ -sym_t * -decl1str(sym_t *dsym) -{ - type_t *tp; - tspec_t t; - int sz, len; - int o = 0; /* Appease gcc */ - scl_t sc; - - if ((sc = dsym->s_scl) != MOS && sc != MOU) - LERROR("decl1str()"); - - if (dcs->d_rdcsym != NULL) { - if ((sc = dcs->d_rdcsym->s_scl) != MOS && sc != MOU) - /* should be ensured by storesym() */ - LERROR("decl1str()"); - if (dsym->s_styp == dcs->d_rdcsym->s_styp) { - /* duplicate member name: %s */ - error(33, dsym->s_name); - rmsym(dcs->d_rdcsym); - } - } - - chktyp(dsym); - - t = (tp = dsym->s_type)->t_tspec; - - if (dsym->s_field) { - /* - * bit field - * - * only unsigned and signed int are portable bit-field types - * (at least in ANSI C, in traditional C only unsigned int) - */ - if (t == CHAR || t == UCHAR || t == SCHAR || - t == SHORT || t == USHORT || t == ENUM) { - if (bitfieldtype_ok == 0) { - if (sflag) { - char buf[64]; - /* - * bit-field type '%s' invalid in - * ANSI C - */ - warning(273, - tyname(buf, sizeof(buf), tp)); - } else if (pflag) { - /* nonportable bit-field type */ - warning(34); - } - } - } else if (t == INT && dcs->d_smod == NOTSPEC) { - if (pflag && bitfieldtype_ok == 0) { - /* nonportable bit-field type */ - warning(34); - } - } else if (t != INT && t != UINT) { - /* - * Non-integer types are always illegal for - * bitfields, regardless of BITFIELDTYPE. - * Integer types not dealt with above are - * okay only if BITFIELDTYPE is in effect. - */ - if (bitfieldtype_ok == 0 || isityp(t) == 0) { - /* illegal bit-field type */ - error(35); - sz = tp->t_flen; - dsym->s_type = tp = duptyp(gettyp(t = INT)); - if ((tp->t_flen = sz) > size(t)) - tp->t_flen = size(t); - } - } - if ((len = tp->t_flen) < 0 || len > size(t)) { - /* illegal bit-field size */ - error(36); - tp->t_flen = size(t); - } else if (len == 0 && dsym->s_name != unnamed) { - /* zero size bit-field */ - error(37); - tp->t_flen = size(t); - } - if (dsym->s_scl == MOU) { - /* illegal use of bit-field */ - error(41); - dsym->s_type->t_isfield = 0; - dsym->s_field = 0; - } - } else if (t == FUNC) { - /* function illegal in structure or union */ - error(38); - dsym->s_type = tp = incref(tp, t = PTR); - } - - /* - * bit-fields of length 0 are not warned about because length() - * does not return the length of the bit-field but the length - * of the type the bit-field is packed in (its ok) - */ - if ((sz = length(dsym->s_type, dsym->s_name)) == 0) { - if (t == ARRAY && dsym->s_type->t_dim == 0) { - /* illegal zero sized structure member: %s */ - c99ism(39, dsym->s_name); - } - } - - if (dcs->d_ctx == MOU) { - o = dcs->d_offset; - dcs->d_offset = 0; - } - if (dsym->s_field) { - align(getbound(tp), tp->t_flen); - dsym->s_value.v_quad = (dcs->d_offset / size(t)) * size(t); - tp->t_foffs = dcs->d_offset - (int)dsym->s_value.v_quad; - dcs->d_offset += tp->t_flen; - } else { - align(getbound(tp), 0); - dsym->s_value.v_quad = dcs->d_offset; - dcs->d_offset += sz; - } - if (dcs->d_ctx == MOU) { - if (o > dcs->d_offset) - dcs->d_offset = o; - } - - chkfdef(dsym, 0); - - /* - * Clear the BITFIELDTYPE indicator after processing each - * structure element. - */ - bitfieldtype_ok = 0; - - return (dsym); -} - -/* - * Aligns next structure element as required. - * - * al contains the required alignment, len the length of a bit-field. - */ -static void -align(int al, int len) -{ - int no; - - /* - * The alignment of the current element becomes the alignment of - * the struct/union if it is larger than the current alignment - * of the struct/union. - */ - if (al > dcs->d_stralign) - dcs->d_stralign = al; - - no = roundup2(dcs->d_offset, al); - if (len == 0 || dcs->d_offset + len > no) - dcs->d_offset = no; -} - -/* - * Remember the width of the field in its type structure. - */ -sym_t * -bitfield(sym_t *dsym, int len) -{ - - if (dsym == NULL) { - dsym = getblk(sizeof (sym_t)); - dsym->s_name = unnamed; - dsym->s_kind = FMOS; - dsym->s_scl = MOS; - dsym->s_type = gettyp(UINT); - dsym->s_blklev = -1; - } - dsym->s_type = duptyp(dsym->s_type); - dsym->s_type->t_isfield = 1; - dsym->s_type->t_flen = len; - dsym->s_field = 1; - return (dsym); -} - -/* - * Collect informations about a sequence of asterisks and qualifiers - * in a list of type pqinf_t. - * Qualifiers refer always to the left asterisk. The rightmost asterisk - * will be at the top of the list. - */ -pqinf_t * -mergepq(pqinf_t *p1, pqinf_t *p2) -{ - pqinf_t *p; - - if (p2->p_pcnt != 0) { - /* left '*' at the end of the list */ - for (p = p2; p->p_nxt != NULL; p = p->p_nxt) - continue; - p->p_nxt = p1; - return (p2); - } else { - if (p2->p_const) { - if (p1->p_const) { - /* duplicate %s */ - warning(10, "const"); - } - p1->p_const = 1; - } - if (p2->p_volatile) { - if (p1->p_volatile) { - /* duplicate %s */ - warning(10, "volatile"); - } - p1->p_volatile = 1; - } - free(p2); - return (p1); - } -} - -/* - * Followint 3 functions extend the type of a declarator with - * pointer, function and array types. - * - * The current type is the type built by deftyp() (dcs->d_type) and - * pointer, function and array types already added for this - * declarator. The new type extension is inserted between both. - */ -sym_t * -addptr(sym_t *decl, pqinf_t *pi) -{ - type_t **tpp, *tp; - pqinf_t *npi; - - tpp = &decl->s_type; - while (*tpp && *tpp != dcs->d_type) - tpp = &(*tpp)->t_subt; - if (*tpp == NULL) - return decl; - - while (pi != NULL) { - *tpp = tp = getblk(sizeof (type_t)); - tp->t_tspec = PTR; - tp->t_const = pi->p_const; - tp->t_volatile = pi->p_volatile; - *(tpp = &tp->t_subt) = dcs->d_type; - npi = pi->p_nxt; - free(pi); - pi = npi; - } - return (decl); -} - -/* - * If a dimension was specified, dim is 1, otherwise 0 - * n is the specified dimension - */ -sym_t * -addarray(sym_t *decl, int dim, int n) -{ - type_t **tpp, *tp; - - tpp = &decl->s_type; - while (*tpp && *tpp != dcs->d_type) - tpp = &(*tpp)->t_subt; - if (*tpp == NULL) - return decl; - - *tpp = tp = getblk(sizeof (type_t)); - tp->t_tspec = ARRAY; - tp->t_subt = dcs->d_type; - tp->t_dim = n; - - if (n < 0) { - /* negative array dimension */ - error(20, n); - n = 0; - } else if (n == 0 && dim) { - /* zero array dimension */ - c99ism(322, dim); - } else if (n == 0 && !dim) { - /* is incomplete type */ - setcompl(tp, 1); - } - - return (decl); -} - -sym_t * -addfunc(sym_t *decl, sym_t *args) -{ - type_t **tpp, *tp; - - if (dcs->d_proto) { - if (tflag) - /* function prototypes are illegal in traditional C */ - warning(270); - args = nsfunc(decl, args); - } else { - osfunc(decl, args); - } - - /* - * The symbols are removed from the symbol table by popdecl() after - * addfunc(). To be able to restore them if this is a function - * definition, a pointer to the list of all symbols is stored in - * dcs->d_nxt->d_fpsyms. Also a list of the arguments (concatenated - * by s_nxt) is stored in dcs->d_nxt->d_fargs. - * (dcs->d_nxt must be used because *dcs is the declaration stack - * element created for the list of params and is removed after - * addfunc()) - */ - if (dcs->d_nxt->d_ctx == EXTERN && - decl->s_type == dcs->d_nxt->d_type) { - dcs->d_nxt->d_fpsyms = dcs->d_dlsyms; - dcs->d_nxt->d_fargs = args; - } - - tpp = &decl->s_type; - while (*tpp && *tpp != dcs->d_nxt->d_type) - tpp = &(*tpp)->t_subt; - if (*tpp == NULL) - return decl; - - *tpp = tp = getblk(sizeof (type_t)); - tp->t_tspec = FUNC; - tp->t_subt = dcs->d_nxt->d_type; - if ((tp->t_proto = dcs->d_proto) != 0) - tp->t_args = args; - tp->t_vararg = dcs->d_vararg; - - return (decl); -} - -/* - * Called for new style function declarations. - */ -/* ARGSUSED */ -static sym_t * -nsfunc(sym_t *decl, sym_t *args) -{ - sym_t *arg, *sym; - scl_t sc; - int n; - - /* - * Declarations of structs/unions/enums in param lists are legal, - * but senseless. - */ - for (sym = dcs->d_dlsyms; sym != NULL; sym = sym->s_dlnxt) { - sc = sym->s_scl; - if (sc == STRTAG || sc == UNIONTAG || sc == ENUMTAG) { - /* dubious tag declaration: %s %s */ - warning(85, scltoa(sc), sym->s_name); - } - } - - n = 1; - for (arg = args; arg != NULL; arg = arg->s_nxt) { - if (arg->s_type->t_tspec == VOID) { - if (n > 1 || arg->s_nxt != NULL) { - /* "void" must be sole parameter */ - error(60); - arg->s_type = gettyp(INT); - } - } - n++; - } - - /* return NULL if first param is VOID */ - return (args != NULL && args->s_type->t_tspec != VOID ? args : NULL); -} - -/* - * Called for old style function declarations. - */ -static void -osfunc(sym_t *decl, sym_t *args) -{ - - /* - * Remember list of params only if this is really seams to be - * a function definition. - */ - if (dcs->d_nxt->d_ctx == EXTERN && - decl->s_type == dcs->d_nxt->d_type) { - /* - * We assume that this becomes a function definition. If - * we are wrong, its corrected in chkfdef(). - */ - if (args != NULL) { - decl->s_osdef = 1; - decl->s_args = args; - } - } else { - if (args != NULL) - /* function prototype parameters must have types */ - warning(62); - } -} - -/* - * Lists of Identifiers in functions declarations are allowed only if - * its also a function definition. If this is not the case, print a - * error message. - */ -void -chkfdef(sym_t *sym, int msg) -{ - - if (sym->s_osdef) { - if (msg) { - /* incomplete or misplaced function definition */ - error(22); - } - sym->s_osdef = 0; - sym->s_args = NULL; - } -} - -/* - * Process the name in a declarator. - * If the symbol does already exists, a new one is created. - * The symbol becomes one of the storage classes EXTERN, STATIC, AUTO or - * TYPEDEF. - * s_def and s_reg are valid after dname(). - */ -sym_t * -dname(sym_t *sym) -{ - scl_t sc = NOSCL; - - if (sym->s_scl == NOSCL) { - dcs->d_rdcsym = NULL; - } else if (sym->s_defarg) { - sym->s_defarg = 0; - dcs->d_rdcsym = NULL; - } else { - dcs->d_rdcsym = sym; - sym = pushdown(sym); - } - - switch (dcs->d_ctx) { - case MOS: - case MOU: - /* Parent setzen */ - sym->s_styp = dcs->d_tagtyp->t_str; - sym->s_def = DEF; - sym->s_value.v_tspec = INT; - sc = dcs->d_ctx; - break; - case EXTERN: - /* - * static and external symbols without "extern" are - * considered to be tentative defined, external - * symbols with "extern" are declared, and typedef names - * are defined. Tentative defined and declared symbols - * may become defined if an initializer is present or - * this is a function definition. - */ - if ((sc = dcs->d_scl) == NOSCL) { - sc = EXTERN; - sym->s_def = TDEF; - } else if (sc == STATIC) { - sym->s_def = TDEF; - } else if (sc == TYPEDEF) { - sym->s_def = DEF; - } else if (sc == EXTERN) { - sym->s_def = DECL; - } else { - LERROR("dname()"); - } - break; - case PARG: - sym->s_arg = 1; - /* FALLTHROUGH */ - case ARG: - if ((sc = dcs->d_scl) == NOSCL) { - sc = AUTO; - } else if (sc == REG) { - sym->s_reg = 1; - sc = AUTO; - } else { - LERROR("dname()"); - } - sym->s_def = DEF; - break; - case AUTO: - if ((sc = dcs->d_scl) == NOSCL) { - /* - * XXX somewhat ugly because we dont know whether - * this is AUTO or EXTERN (functions). If we are - * wrong it must be corrected in decl1loc(), where - * we have the necessary type information. - */ - sc = AUTO; - sym->s_def = DEF; - } else if (sc == AUTO || sc == STATIC || sc == TYPEDEF) { - sym->s_def = DEF; - } else if (sc == REG) { - sym->s_reg = 1; - sc = AUTO; - sym->s_def = DEF; - } else if (sc == EXTERN) { - sym->s_def = DECL; - } else { - LERROR("dname()"); - } - break; - default: - LERROR("dname()"); - } - sym->s_scl = sc; - - sym->s_type = dcs->d_type; - - dcs->d_fpsyms = NULL; - - return (sym); -} - -/* - * Process a name in the list of formal params in an old style function - * definition. - */ -sym_t * -iname(sym_t *sym) -{ - - if (sym->s_scl != NOSCL) { - if (blklev == sym->s_blklev) { - /* redeclaration of formal parameter %s */ - error(21, sym->s_name); - if (!sym->s_defarg) - LERROR("iname()"); - } - sym = pushdown(sym); - } - sym->s_type = gettyp(INT); - sym->s_scl = AUTO; - sym->s_def = DEF; - sym->s_defarg = sym->s_arg = 1; - return (sym); -} - -/* - * Create the type of a tag. - * - * tag points to the symbol table entry of the tag - * kind is the kind of the tag (STRUCT/UNION/ENUM) - * decl is 1 if the type of the tag will be completed in this declaration - * (the following token is T_LBRACE) - * semi is 1 if the following token is T_SEMI - */ -type_t * -mktag(sym_t *tag, tspec_t kind, int decl, int semi) -{ - scl_t scl = NOSCL; - type_t *tp; - - if (kind == STRUCT) { - scl = STRTAG; - } else if (kind == UNION) { - scl = UNIONTAG; - } else if (kind == ENUM) { - scl = ENUMTAG; - } else { - LERROR("mktag()"); - } - - if (tag != NULL) { - if (tag->s_scl != NOSCL) { - tag = newtag(tag, scl, decl, semi); - } else { - /* a new tag, no empty declaration */ - dcs->d_nxt->d_nedecl = 1; - if (scl == ENUMTAG && !decl) { - if (!tflag && (sflag || pflag)) - /* forward reference to enum type */ - warning(42); - } - } - if (tag->s_scl == NOSCL) { - tag->s_scl = scl; - tag->s_type = tp = getblk(sizeof (type_t)); - } else { - tp = tag->s_type; - } - } else { - tag = getblk(sizeof (sym_t)); - tag->s_name = unnamed; - UNIQUE_CURR_POS(tag->s_dpos); - tag->s_kind = FTAG; - tag->s_scl = scl; - tag->s_blklev = -1; - tag->s_type = tp = getblk(sizeof (type_t)); - dcs->d_nxt->d_nedecl = 1; - } - - if (tp->t_tspec == NOTSPEC) { - tp->t_tspec = kind; - if (kind != ENUM) { - tp->t_str = getblk(sizeof (str_t)); - tp->t_str->align = CHAR_BIT; - tp->t_str->stag = tag; - } else { - tp->t_isenum = 1; - tp->t_enum = getblk(sizeof (enum_t)); - tp->t_enum->etag = tag; - } - /* is incomplete type */ - setcompl(tp, 1); - } - - return (tp); -} - -/* - * Checks all possible cases of tag redeclarations. - * decl is 1 if T_LBRACE follows - * semi is 1 if T_SEMI follows - */ -static sym_t * -newtag(sym_t *tag, scl_t scl, int decl, int semi) -{ - - if (tag->s_blklev < blklev) { - if (semi) { - /* "struct a;" */ - if (!tflag) { - if (!sflag) - /* decl. introduces new type ... */ - warning(44, scltoa(scl), tag->s_name); - tag = pushdown(tag); - } else if (tag->s_scl != scl) { - /* base type is really "%s %s" */ - warning(45, scltoa(tag->s_scl), tag->s_name); - } - dcs->d_nxt->d_nedecl = 1; - } else if (decl) { - /* "struct a { ... } " */ - if (hflag) - /* redefinition hides earlier one: %s */ - warning(43, tag->s_name); - tag = pushdown(tag); - dcs->d_nxt->d_nedecl = 1; - } else if (tag->s_scl != scl) { - /* base type is really "%s %s" */ - warning(45, scltoa(tag->s_scl), tag->s_name); - /* declaration introduces new type in ANSI C: %s %s */ - if (!sflag) - warning(44, scltoa(scl), tag->s_name); - tag = pushdown(tag); - dcs->d_nxt->d_nedecl = 1; - } - } else { - if (tag->s_scl != scl) { - /* (%s) tag redeclared */ - error(46, scltoa(tag->s_scl)); - prevdecl(-1, tag); - tag = pushdown(tag); - dcs->d_nxt->d_nedecl = 1; - } else if (decl && !incompl(tag->s_type)) { - /* (%s) tag redeclared */ - error(46, scltoa(tag->s_scl)); - prevdecl(-1, tag); - tag = pushdown(tag); - dcs->d_nxt->d_nedecl = 1; - } else if (semi || decl) { - dcs->d_nxt->d_nedecl = 1; - } - } - return (tag); -} - -const char * -scltoa(scl_t sc) -{ - const char *s; - - switch (sc) { - case EXTERN: s = "extern"; break; - case STATIC: s = "static"; break; - case AUTO: s = "auto"; break; - case REG: s = "register"; break; - case TYPEDEF: s = "typedef"; break; - case STRTAG: s = "struct"; break; - case UNIONTAG: s = "union"; break; - case ENUMTAG: s = "enum"; break; - default: LERROR("tagttoa()"); - } - return (s); -} - -/* - * Completes the type of a tag in a struct/union/enum declaration. - * tp points to the type of the, tag, fmem to the list of members/enums. - */ -type_t * -compltag(type_t *tp, sym_t *fmem) -{ - tspec_t t; - str_t *sp; - int n; - sym_t *mem; - - /* from now a complete type */ - setcompl(tp, 0); - - if ((t = tp->t_tspec) != ENUM) { - align(dcs->d_stralign, 0); - sp = tp->t_str; - sp->align = dcs->d_stralign; - sp->size = dcs->d_offset; - sp->memb = fmem; - if (sp->size == 0) { - /* zero sized %s */ - (void)c99ism(47, ttab[t].tt_name); - } else { - n = 0; - for (mem = fmem; mem != NULL; mem = mem->s_nxt) { - if (mem->s_name != unnamed) - n++; - } - if (n == 0) { - /* %s has no named members */ - warning(65, - t == STRUCT ? "structure" : "union"); - } - } - } else { - tp->t_enum->elem = fmem; - } - return (tp); -} - -/* - * Processes the name of an enumerator in en enum declaration. - * - * sym points to the enumerator - * val is the value of the enumerator - * impl is 1 if the value of the enumerator was not explicit specified. - */ -sym_t * -ename(sym_t *sym, int val, int impl) -{ - - if (sym->s_scl) { - if (sym->s_blklev == blklev) { - /* no hflag, because this is illegal!!! */ - if (sym->s_arg) { - /* enumeration constant hides parameter: %s */ - warning(57, sym->s_name); - } else { - /* redeclaration of %s */ - error(27, sym->s_name); - /* - * inside blocks it should not too complicated - * to find the position of the previous - * declaration - */ - if (blklev == 0) - prevdecl(-1, sym); - } - } else { - if (hflag) - /* redefinition hides earlier one: %s */ - warning(43, sym->s_name); - } - sym = pushdown(sym); - } - sym->s_scl = ENUMCON; - sym->s_type = dcs->d_tagtyp; - sym->s_value.v_tspec = INT; - sym->s_value.v_quad = val; - if (impl && val - 1 == INT_MAX) { - /* overflow in enumeration values: %s */ - warning(48, sym->s_name); - } - enumval = val + 1; - return (sym); -} - -/* - * Process a single external declarator. - */ -void -decl1ext(sym_t *dsym, int initflg) -{ - int warn, rval, redec; - sym_t *rdsym; - - chkfdef(dsym, 1); - - chktyp(dsym); - - if (initflg && !(initerr = chkinit(dsym))) - dsym->s_def = DEF; - - /* - * Declarations of functions are marked as "tentative" in dname(). - * This is wrong because there are no tentative function - * definitions. - */ - if (dsym->s_type->t_tspec == FUNC && dsym->s_def == TDEF) - dsym->s_def = DECL; - - if (dcs->d_inline) { - if (dsym->s_type->t_tspec == FUNC) { - dsym->s_inline = 1; - } else { - /* variable declared inline: %s */ - warning(268, dsym->s_name); - } - } - - /* Write the declaration into the output file */ - if (plibflg && llibflg && - dsym->s_type->t_tspec == FUNC && dsym->s_type->t_proto) { - /* - * With both LINTLIBRARY and PROTOLIB the prototype is - * written as a function definition to the output file. - */ - rval = dsym->s_type->t_subt->t_tspec != VOID; - outfdef(dsym, &dsym->s_dpos, rval, 0, NULL); - } else { - outsym(dsym, dsym->s_scl, dsym->s_def); - } - - if ((rdsym = dcs->d_rdcsym) != NULL) { - - /* - * If the old symbol stems from an old style function definition - * we have remembered the params in rdsmy->s_args and compare - * them with the params of the prototype. - */ - if (rdsym->s_osdef && dsym->s_type->t_proto) { - redec = chkosdef(rdsym, dsym); - } else { - redec = 0; - } - - if (!redec && !isredec(dsym, (warn = 0, &warn))) { - - if (warn) { - /* redeclaration of %s */ - (*(sflag ? error : warning))(27, dsym->s_name); - prevdecl(-1, rdsym); - } - - /* - * Overtake the remembered params if the new symbol - * is not a prototype. - */ - if (rdsym->s_osdef && !dsym->s_type->t_proto) { - dsym->s_osdef = rdsym->s_osdef; - dsym->s_args = rdsym->s_args; - STRUCT_ASSIGN(dsym->s_dpos, rdsym->s_dpos); - } - - /* - * Remember the position of the declaration if the - * old symbol was a prototype and the new is not. - * Also remember the position if the old symbol - * was defined and the new is not. - */ - if (rdsym->s_type->t_proto && !dsym->s_type->t_proto) { - STRUCT_ASSIGN(dsym->s_dpos, rdsym->s_dpos); - } else if (rdsym->s_def == DEF && dsym->s_def != DEF) { - STRUCT_ASSIGN(dsym->s_dpos, rdsym->s_dpos); - } - - /* - * Copy informations about usage of the name into - * the new symbol. - */ - cpuinfo(dsym, rdsym); - - /* Once a name is defined, it remains defined. */ - if (rdsym->s_def == DEF) - dsym->s_def = DEF; - - /* once a function is inline, it remains inline */ - if (rdsym->s_inline) - dsym->s_inline = 1; - - compltyp(dsym, rdsym); - - } - - rmsym(rdsym); - } - - if (dsym->s_scl == TYPEDEF) { - dsym->s_type = duptyp(dsym->s_type); - dsym->s_type->t_typedef = 1; - settdsym(dsym->s_type, dsym); - } - -} - -/* - * Copies informations about usage into a new symbol table entry of - * the same symbol. - */ -void -cpuinfo(sym_t *sym, sym_t *rdsym) -{ - - sym->s_spos = rdsym->s_spos; - sym->s_upos = rdsym->s_upos; - sym->s_set = rdsym->s_set; - sym->s_used = rdsym->s_used; -} - -/* - * Prints an error and returns 1 if a symbol is redeclared/redefined. - * Otherwise returns 0 and, in some cases of minor problems, prints - * a warning. - */ -int -isredec(sym_t *dsym, int *warn) -{ - sym_t *rsym; - - if ((rsym = dcs->d_rdcsym)->s_scl == ENUMCON) { - /* redeclaration of %s */ - error(27, dsym->s_name); - prevdecl(-1, rsym); - return (1); - } - if (rsym->s_scl == TYPEDEF) { - /* typedef redeclared: %s */ - error(89, dsym->s_name); - prevdecl(-1, rsym); - return (1); - } - if (dsym->s_scl == TYPEDEF) { - /* redeclaration of %s */ - error(27, dsym->s_name); - prevdecl(-1, rsym); - return (1); - } - if (rsym->s_def == DEF && dsym->s_def == DEF) { - /* redefinition of %s */ - error(28, dsym->s_name); - prevdecl(-1, rsym); - return(1); - } - if (!eqtype(rsym->s_type, dsym->s_type, 0, 0, warn)) { - /* redeclaration of %s */ - error(27, dsym->s_name); - prevdecl(-1, rsym); - return(1); - } - if (rsym->s_scl == EXTERN && dsym->s_scl == EXTERN) - return(0); - if (rsym->s_scl == STATIC && dsym->s_scl == STATIC) - return(0); - if (rsym->s_scl == STATIC && dsym->s_def == DECL) - return(0); - if (rsym->s_scl == EXTERN && rsym->s_def == DEF) { - /* - * All cases except "int a = 1; static int a;" are caught - * above with or without a warning - */ - /* redeclaration of %s */ - error(27, dsym->s_name); - prevdecl(-1, rsym); - return(1); - } - if (rsym->s_scl == EXTERN) { - /* previously declared extern, becomes static: %s */ - warning(29, dsym->s_name); - prevdecl(-1, rsym); - return(0); - } - /* - * Now its on of: - * "static a; int a;", "static a; int a = 1;", "static a = 1; int a;" - */ - /* redeclaration of %s; ANSI C requires "static" */ - if (sflag) { - warning(30, dsym->s_name); - prevdecl(-1, rsym); - } - dsym->s_scl = STATIC; - return (0); -} - -/* - * Checks if two types are compatible. Returns 0 if not, otherwise 1. - * - * ignqual ignore qualifiers of type; used for function params - * promot promote left type; used for comparison of params of - * old style function definitions with params of prototypes. - * *warn set to 1 if an old style function declaration is not - * compatible with a prototype - */ -int -eqtype(type_t *tp1, type_t *tp2, int ignqual, int promot, int *warn) -{ - tspec_t t; - - while (tp1 != NULL && tp2 != NULL) { - - t = tp1->t_tspec; - if (promot) { - if (t == FLOAT) { - t = DOUBLE; - } else if (t == CHAR || t == SCHAR) { - t = INT; - } else if (t == UCHAR) { - t = tflag ? UINT : INT; - } else if (t == SHORT) { - t = INT; - } else if (t == USHORT) { - /* CONSTCOND */ - t = INT_MAX < USHRT_MAX || tflag ? UINT : INT; - } - } - - if (t != tp2->t_tspec) - return (0); - - if (tp1->t_const != tp2->t_const && !ignqual && !tflag) - return (0); - - if (tp1->t_volatile != tp2->t_volatile && !ignqual && !tflag) - return (0); - - if (t == STRUCT || t == UNION) - return (tp1->t_str == tp2->t_str); - - if (t == ARRAY && tp1->t_dim != tp2->t_dim) { - if (tp1->t_dim != 0 && tp2->t_dim != 0) - return (0); - } - - /* dont check prototypes for traditional */ - if (t == FUNC && !tflag) { - if (tp1->t_proto && tp2->t_proto) { - if (!eqargs(tp1, tp2, warn)) - return (0); - } else if (tp1->t_proto) { - if (!mnoarg(tp1, warn)) - return (0); - } else if (tp2->t_proto) { - if (!mnoarg(tp2, warn)) - return (0); - } - } - - tp1 = tp1->t_subt; - tp2 = tp2->t_subt; - ignqual = promot = 0; - - } - - return (tp1 == tp2); -} - -/* - * Compares the parameter types of two prototypes. - */ -static int -eqargs(type_t *tp1, type_t *tp2, int *warn) -{ - sym_t *a1, *a2; - - if (tp1->t_vararg != tp2->t_vararg) - return (0); - - a1 = tp1->t_args; - a2 = tp2->t_args; - - while (a1 != NULL && a2 != NULL) { - - if (eqtype(a1->s_type, a2->s_type, 1, 0, warn) == 0) - return (0); - - a1 = a1->s_nxt; - a2 = a2->s_nxt; - - } - - return (a1 == a2); -} - -/* - * mnoarg() (matches functions with no argument type information) - * returns 1 if all parameters of a prototype are compatible with - * and old style function declaration. - * This is the case if following conditions are met: - * 1. the prototype must have a fixed number of parameters - * 2. no parameter is of type float - * 3. no parameter is converted to another type if integer promotion - * is applied on it - */ -static int -mnoarg(type_t *tp, int *warn) -{ - sym_t *arg; - tspec_t t; - - if (tp->t_vararg) { - if (warn != NULL) - *warn = 1; - } - for (arg = tp->t_args; arg != NULL; arg = arg->s_nxt) { - if ((t = arg->s_type->t_tspec) == FLOAT || - t == CHAR || t == SCHAR || t == UCHAR || - t == SHORT || t == USHORT) { - if (warn != NULL) - *warn = 1; - } - } - return (1); -} - -/* - * Compares a prototype declaration with the remembered arguments of - * a previous old style function definition. - */ -static int -chkosdef(sym_t *rdsym, sym_t *dsym) -{ - sym_t *args, *pargs, *arg, *parg; - int narg, nparg, n; - int warn, msg; - - args = rdsym->s_args; - pargs = dsym->s_type->t_args; - - msg = 0; - - narg = nparg = 0; - for (arg = args; arg != NULL; arg = arg->s_nxt) - narg++; - for (parg = pargs; parg != NULL; parg = parg->s_nxt) - nparg++; - if (narg != nparg) { - /* prototype does not match old-style definition */ - error(63); - msg = 1; - goto end; - } - - arg = args; - parg = pargs; - n = 1; - while (narg--) { - warn = 0; - /* - * If it does not match due to promotion and sflag is - * not set we print only a warning. - */ - if (!eqtype(arg->s_type, parg->s_type, 1, 1, &warn) || warn) { - /* prototype does not match old-style def., arg #%d */ - error(299, n); - msg = 1; - } - arg = arg->s_nxt; - parg = parg->s_nxt; - n++; - } - - end: - if (msg) - /* old style definition */ - prevdecl(300, rdsym); - - return (msg); -} - -/* - * Completes a type by copying the dimension and prototype information - * from a second compatible type. - * - * Following lines are legal: - * "typedef a[]; a b; a b[10]; a c; a c[20];" - * "typedef ft(); ft f; f(int); ft g; g(long);" - * This means that, if a type is completed, the type structure must - * be duplicated. - */ -void -compltyp(sym_t *dsym, sym_t *ssym) -{ - type_t **dstp, *src; - type_t *dst; - - dstp = &dsym->s_type; - src = ssym->s_type; - - while ((dst = *dstp) != NULL) { - if (src == NULL || dst->t_tspec != src->t_tspec) - LERROR("compltyp()"); - if (dst->t_tspec == ARRAY) { - if (dst->t_dim == 0 && src->t_dim != 0) { - *dstp = dst = duptyp(dst); - dst->t_dim = src->t_dim; - /* now a complete type */ - setcompl(dst, 0); - } - } else if (dst->t_tspec == FUNC) { - if (!dst->t_proto && src->t_proto) { - *dstp = dst = duptyp(dst); - dst->t_proto = 1; - dst->t_args = src->t_args; - } - } - dstp = &dst->t_subt; - src = src->t_subt; - } -} - -/* - * Completes the declaration of a single argument. - */ -sym_t * -decl1arg(sym_t *sym, int initflg) -{ - tspec_t t; - - chkfdef(sym, 1); - - chktyp(sym); - - if (dcs->d_rdcsym != NULL && dcs->d_rdcsym->s_blklev == blklev) { - /* redeclaration of formal parameter %s */ - error(237, sym->s_name); - rmsym(dcs->d_rdcsym); - sym->s_arg = 1; - } - - if (!sym->s_arg) { - /* declared argument %s is missing */ - error(53, sym->s_name); - sym->s_arg = 1; - } - - if (initflg) { - /* cannot initialize parameter: %s */ - error(52, sym->s_name); - initerr = 1; - } - - if ((t = sym->s_type->t_tspec) == ARRAY) { - sym->s_type = incref(sym->s_type->t_subt, PTR); - } else if (t == FUNC) { - if (tflag) - /* a function is declared as an argument: %s */ - warning(50, sym->s_name); - sym->s_type = incref(sym->s_type, PTR); - } else if (t == FLOAT) { - if (tflag) - sym->s_type = gettyp(DOUBLE); - } - - if (dcs->d_inline) - /* argument declared inline: %s */ - warning(269, sym->s_name); - - /* - * Arguments must have complete types. lengths() prints the needed - * error messages (null dimension is impossible because arrays are - * converted to pointers). - */ - if (sym->s_type->t_tspec != VOID) - (void)length(sym->s_type, sym->s_name); - - setsflg(sym); - - return (sym); -} - -/* - * Does some checks for lint directives which apply to functions. - * Processes arguments in old style function definitions which default - * to int. - * Checks compatibility of old style function definition with previous - * prototype. - */ -void -cluparg(void) -{ - sym_t *args, *arg, *pargs, *parg; - int narg, nparg, n, msg; - tspec_t t; - - args = funcsym->s_args; - pargs = funcsym->s_type->t_args; - - /* check for illegal combinations of lint directives */ - if (prflstrg != -1 && scflstrg != -1) { - /* can't be used together: ** PRINTFLIKE ** ** SCANFLIKE ** */ - warning(289); - prflstrg = scflstrg = -1; - } - if (nvararg != -1 && (prflstrg != -1 || scflstrg != -1)) { - /* dubious use of ** VARARGS ** with ** %s ** */ - warning(288, prflstrg != -1 ? "PRINTFLIKE" : "SCANFLIKE"); - nvararg = -1; - } - - /* - * check if the argument of a lint directive is compatible with the - * number of arguments. - */ - narg = 0; - for (arg = dcs->d_fargs; arg != NULL; arg = arg->s_nxt) - narg++; - if (nargusg > narg) { - /* argument number mismatch with directive: ** %s ** */ - warning(283, "ARGSUSED"); - nargusg = 0; - } - if (nvararg > narg) { - /* argument number mismatch with directive: ** %s ** */ - warning(283, "VARARGS"); - nvararg = 0; - } - if (prflstrg > narg) { - /* argument number mismatch with directive: ** %s ** */ - warning(283, "PRINTFLIKE"); - prflstrg = -1; - } else if (prflstrg == 0) { - prflstrg = -1; - } - if (scflstrg > narg) { - /* argument number mismatch with directive: ** %s ** */ - warning(283, "SCANFLIKE"); - scflstrg = -1; - } else if (scflstrg == 0) { - scflstrg = -1; - } - if (prflstrg != -1 || scflstrg != -1) { - narg = prflstrg != -1 ? prflstrg : scflstrg; - arg = dcs->d_fargs; - for (n = 1; n < narg; n++) - arg = arg->s_nxt; - if (arg->s_type->t_tspec != PTR || - ((t = arg->s_type->t_subt->t_tspec) != CHAR && - t != UCHAR && t != SCHAR)) { - /* arg. %d must be 'char *' for PRINTFLIKE/SCANFLIKE */ - warning(293, narg); - prflstrg = scflstrg = -1; - } - } - - /* - * print a warning for each argument of an old style function - * definition which defaults to int - */ - for (arg = args; arg != NULL; arg = arg->s_nxt) { - if (arg->s_defarg) { - /* argument type defaults to int: %s */ - warning(32, arg->s_name); - arg->s_defarg = 0; - setsflg(arg); - } - } - - /* - * If this is an old style function definition and a prototyp - * exists, compare the types of arguments. - */ - if (funcsym->s_osdef && funcsym->s_type->t_proto) { - /* - * If the number of arguments does not macht, we need not - * continue. - */ - narg = nparg = 0; - msg = 0; - for (parg = pargs; parg != NULL; parg = parg->s_nxt) - nparg++; - for (arg = args; arg != NULL; arg = arg->s_nxt) - narg++; - if (narg != nparg) { - /* parameter mismatch: %d declared, %d defined */ - error(51, nparg, narg); - msg = 1; - } else { - parg = pargs; - arg = args; - while (narg--) { - msg |= chkptdecl(arg, parg); - parg = parg->s_nxt; - arg = arg->s_nxt; - } - } - if (msg) - /* prototype declaration */ - prevdecl(285, dcs->d_rdcsym); - - /* from now the prototype is valid */ - funcsym->s_osdef = 0; - funcsym->s_args = NULL; - - } - -} - -/* - * Checks compatibility of an old style function definition with a previous - * prototype declaration. - * Returns 1 if the position of the previous declaration should be reported. - */ -static int -chkptdecl(sym_t *arg, sym_t *parg) -{ - type_t *tp, *ptp; - int warn, msg; - - tp = arg->s_type; - ptp = parg->s_type; - - msg = 0; - warn = 0; - - if (!eqtype(tp, ptp, 1, 1, &warn)) { - if (eqtype(tp, ptp, 1, 0, &warn)) { - /* type does not match prototype: %s */ - msg = gnuism(58, arg->s_name); - } else { - /* type does not match prototype: %s */ - error(58, arg->s_name); - msg = 1; - } - } else if (warn) { - /* type does not match prototype: %s */ - (*(sflag ? error : warning))(58, arg->s_name); - msg = 1; - } - - return (msg); -} - -/* - * Completes a single local declaration/definition. - */ -void -decl1loc(sym_t *dsym, int initflg) -{ - - /* Correct a mistake done in dname(). */ - if (dsym->s_type->t_tspec == FUNC) { - dsym->s_def = DECL; - if (dcs->d_scl == NOSCL) - dsym->s_scl = EXTERN; - } - - if (dsym->s_type->t_tspec == FUNC) { - if (dsym->s_scl == STATIC) { - /* dubious static function at block level: %s */ - warning(93, dsym->s_name); - dsym->s_scl = EXTERN; - } else if (dsym->s_scl != EXTERN && dsym->s_scl != TYPEDEF) { - /* function has illegal storage class: %s */ - error(94, dsym->s_name); - dsym->s_scl = EXTERN; - } - } - - /* - * functions may be declared inline at local scope, although - * this has no effect for a later definition of the same - * function. - * XXX it should have an effect if tflag is set. this would - * also be the way gcc behaves. - */ - if (dcs->d_inline) { - if (dsym->s_type->t_tspec == FUNC) { - dsym->s_inline = 1; - } else { - /* variable declared inline: %s */ - warning(268, dsym->s_name); - } - } - - chkfdef(dsym, 1); - - chktyp(dsym); - - if (dcs->d_rdcsym != NULL && dsym->s_scl == EXTERN) - ledecl(dsym); - - if (dsym->s_scl == EXTERN) { - /* - * XXX wenn die statische Variable auf Ebene 0 erst - * spaeter definiert wird, haben wir die Brille auf. - */ - if (dsym->s_xsym == NULL) { - outsym(dsym, EXTERN, dsym->s_def); - } else { - outsym(dsym, dsym->s_xsym->s_scl, dsym->s_def); - } - } - - if (dcs->d_rdcsym != NULL) { - - if (dcs->d_rdcsym->s_blklev == 0) { - - switch (dsym->s_scl) { - case AUTO: - /* automatic hides external declaration: %s */ - if (hflag) - warning(86, dsym->s_name); - break; - case STATIC: - /* static hides external declaration: %s */ - if (hflag) - warning(87, dsym->s_name); - break; - case TYPEDEF: - /* typedef hides external declaration: %s */ - if (hflag) - warning(88, dsym->s_name); - break; - case EXTERN: - /* - * Warnings and errors are printed in ledecl() - */ - break; - default: - LERROR("decl1loc()"); - } - - } else if (dcs->d_rdcsym->s_blklev == blklev) { - - /* no hflag, because its illegal! */ - if (dcs->d_rdcsym->s_arg) { - /* - * if !tflag, a "redeclaration of %s" error - * is produced below - */ - if (tflag) { - if (hflag) - /* decl. hides parameter: %s */ - warning(91, dsym->s_name); - rmsym(dcs->d_rdcsym); - } - } - - } else if (dcs->d_rdcsym->s_blklev < blklev) { - - if (hflag) - /* declaration hides earlier one: %s */ - warning(95, dsym->s_name); - - } - - if (dcs->d_rdcsym->s_blklev == blklev) { - - /* redeclaration of %s */ - error(27, dsym->s_name); - rmsym(dcs->d_rdcsym); - - } - - } - - if (initflg && !(initerr = chkinit(dsym))) { - dsym->s_def = DEF; - setsflg(dsym); - } - - if (dsym->s_scl == TYPEDEF) { - dsym->s_type = duptyp(dsym->s_type); - dsym->s_type->t_typedef = 1; - settdsym(dsym->s_type, dsym); - } - - /* - * Before we can check the size we must wait for an initialisation - * which may follow. - */ -} - -/* - * Processes (re)declarations of external Symbols inside blocks. - */ -static void -ledecl(sym_t *dsym) -{ - int eqt, warn; - sym_t *esym; - - /* look for a symbol with the same name */ - esym = dcs->d_rdcsym; - while (esym != NULL && esym->s_blklev != 0) { - while ((esym = esym->s_link) != NULL) { - if (esym->s_kind != FVFT) - continue; - if (strcmp(dsym->s_name, esym->s_name) == 0) - break; - } - } - if (esym == NULL) - return; - if (esym->s_scl != EXTERN && esym->s_scl != STATIC) { - /* gcc accepts this without a warning, pcc prints an error. */ - /* redeclaration of %s */ - warning(27, dsym->s_name); - prevdecl(-1, esym); - return; - } - - warn = 0; - eqt = eqtype(esym->s_type, dsym->s_type, 0, 0, &warn); - - if (!eqt || warn) { - if (esym->s_scl == EXTERN) { - /* inconsistent redeclaration of extern: %s */ - warning(90, dsym->s_name); - prevdecl(-1, esym); - } else { - /* inconsistent redeclaration of static: %s */ - warning(92, dsym->s_name); - prevdecl(-1, esym); - } - } - - if (eqt) { - /* - * Remember the external symbol so we can update usage - * information at the end of the block. - */ - dsym->s_xsym = esym; - } -} - -/* - * Print an error or a warning if the symbol can't be initialized due - * to type/storage class. Return value is 1 if an error has been - * detected. - */ -static int -chkinit(sym_t *sym) -{ - int err; - - err = 0; - - if (sym->s_type->t_tspec == FUNC) { - /* cannot initialize function: %s */ - error(24, sym->s_name); - err = 1; - } else if (sym->s_scl == TYPEDEF) { - /* cannot initialize typedef: %s */ - error(25, sym->s_name); - err = 1; - } else if (sym->s_scl == EXTERN && sym->s_def == DECL) { - /* cannot initialize "extern" declaration: %s */ - if (dcs->d_ctx == EXTERN) { - warning(26, sym->s_name); - } else { - error(26, sym->s_name); - err = 1; - } - } - - return (err); -} - -/* - * Create a symbol for an abstract declaration. - */ -sym_t * -aname(void) -{ - sym_t *sym; - - if (dcs->d_ctx != ABSTRACT && dcs->d_ctx != PARG) - LERROR("aname()"); - - sym = getblk(sizeof (sym_t)); - - sym->s_name = unnamed; - sym->s_def = DEF; - sym->s_scl = ABSTRACT; - sym->s_blklev = -1; - - if (dcs->d_ctx == PARG) - sym->s_arg = 1; - - sym->s_type = dcs->d_type; - dcs->d_rdcsym = NULL; - dcs->d_vararg = 0; - - return (sym); -} - -/* - * Removes anything which has nothing to do on global level. - */ -void -globclup(void) -{ - - while (dcs->d_nxt != NULL) - popdecl(); - - cleanup(); - blklev = 0; - mblklev = 0; - - /* - * remove all information about pending lint directives without - * warnings. - */ - glclup(1); -} - -/* - * Process an abstract type declaration - */ -sym_t * -decl1abs(sym_t *sym) -{ - - chkfdef(sym, 1); - chktyp(sym); - return (sym); -} - -/* - * Checks size after declarations of variables and their initialisation. - */ -void -chksz(sym_t *dsym) -{ - - /* - * check size only for symbols which are defined and no function and - * not typedef name - */ - if (dsym->s_def != DEF) - return; - if (dsym->s_scl == TYPEDEF) - return; - if (dsym->s_type->t_tspec == FUNC) - return; - - if (length(dsym->s_type, dsym->s_name) == 0 && - dsym->s_type->t_tspec == ARRAY && dsym->s_type->t_dim == 0) { - /* empty array declaration: %s */ - if (tflag) { - warning(190, dsym->s_name); - } else { - error(190, dsym->s_name); - } - } -} - -/* - * Mark an object as set if it is not already - */ -void -setsflg(sym_t *sym) -{ - - if (!sym->s_set) { - sym->s_set = 1; - UNIQUE_CURR_POS(sym->s_spos); - } -} - -/* - * Mark an object as used if it is not already - */ -void -setuflg(sym_t *sym, int fcall, int szof) -{ - - if (!sym->s_used) { - sym->s_used = 1; - UNIQUE_CURR_POS(sym->s_upos); - } - /* - * for function calls another record is written - * - * XXX Should symbols used in sizeof() treated as used or not? - * Probably not, because there is no sense to declare an - * external variable only to get their size. - */ - if (!fcall && !szof && sym->s_kind == FVFT && sym->s_scl == EXTERN) - outusg(sym); -} - -/* - * Prints warnings for a list of variables and labels (concatenated - * with s_dlnxt) if these are not used or only set. - */ -void -chkusage(dinfo_t *di) -{ - sym_t *sym; - int mknowarn; - - /* for this warnings LINTED has no effect */ - mknowarn = nowarn; - nowarn = 0; - - for (sym = di->d_dlsyms; sym != NULL; sym = sym->s_dlnxt) - chkusg1(di->d_asm, sym); - - nowarn = mknowarn; -} - -/* - * Prints a warning for a single variable or label if it is not used or - * only set. - */ -void -chkusg1(int novar, sym_t *sym) -{ - pos_t cpos; - - if (sym->s_blklev == -1) - return; - - STRUCT_ASSIGN(cpos, curr_pos); - - if (sym->s_kind == FVFT) { - if (sym->s_arg) { - chkausg(novar, sym); - } else { - chkvusg(novar, sym); - } - } else if (sym->s_kind == FLAB) { - chklusg(sym); - } else if (sym->s_kind == FTAG) { - chktusg(sym); - } - - STRUCT_ASSIGN(curr_pos, cpos); -} - -static void -chkausg(int novar, sym_t *arg) -{ - - if (!arg->s_set) - LERROR("chkausg()"); - - if (novar) - return; - - if (!arg->s_used && vflag) { - STRUCT_ASSIGN(curr_pos, arg->s_dpos); - /* argument %s unused in function %s */ - warning(231, arg->s_name, funcsym->s_name); - } -} - -static void -chkvusg(int novar, sym_t *sym) -{ - scl_t sc; - sym_t *xsym; - - if (blklev == 0 || sym->s_blklev == 0) - LERROR("chkvusg()"); - - /* errors in expressions easily cause lots of these warnings */ - if (nerr != 0) - return; - - /* - * XXX Only variables are checkd, although types should - * probably also be checked - */ - if ((sc = sym->s_scl) != EXTERN && sc != STATIC && - sc != AUTO && sc != REG) { - return; - } - - if (novar) - return; - - if (sc == EXTERN) { - if (!sym->s_used && !sym->s_set) { - STRUCT_ASSIGN(curr_pos, sym->s_dpos); - /* %s unused in function %s */ - warning(192, sym->s_name, funcsym->s_name); - } - } else { - if (sym->s_set && !sym->s_used) { - STRUCT_ASSIGN(curr_pos, sym->s_spos); - /* %s set but not used in function %s */ - warning(191, sym->s_name, funcsym->s_name); - } else if (!sym->s_used) { - STRUCT_ASSIGN(curr_pos, sym->s_dpos); - /* %s unused in function %s */ - warning(192, sym->s_name, funcsym->s_name); - } - } - - if (sc == EXTERN) { - /* - * information about usage is taken over into the symbol - * tabel entry at level 0 if the symbol was locally declared - * as an external symbol. - * - * XXX This is wrong for symbols declared static at level 0 - * if the usage information stems from sizeof(). This is - * because symbols at level 0 only used in sizeof() are - * considered to not be used. - */ - if ((xsym = sym->s_xsym) != NULL) { - if (sym->s_used && !xsym->s_used) { - xsym->s_used = 1; - STRUCT_ASSIGN(xsym->s_upos, sym->s_upos); - } - if (sym->s_set && !xsym->s_set) { - xsym->s_set = 1; - STRUCT_ASSIGN(xsym->s_spos, sym->s_spos); - } - } - } -} - -static void -chklusg(sym_t *lab) -{ - - if (blklev != 1 || lab->s_blklev != 1) - LERROR("chklusg()"); - - if (lab->s_set && !lab->s_used) { - STRUCT_ASSIGN(curr_pos, lab->s_spos); - /* label %s unused in function %s */ - warning(192, lab->s_name, funcsym->s_name); - } else if (!lab->s_set) { - STRUCT_ASSIGN(curr_pos, lab->s_upos); - /* undefined label %s */ - warning(23, lab->s_name); - } -} - -static void -chktusg(sym_t *sym) -{ - - if (!incompl(sym->s_type)) - return; - - /* complain always about incomplete tags declared inside blocks */ - if (!zflag || dcs->d_ctx != EXTERN) - return; - - STRUCT_ASSIGN(curr_pos, sym->s_dpos); - switch (sym->s_type->t_tspec) { - case STRUCT: - /* struct %s never defined */ - warning(233, sym->s_name); - break; - case UNION: - /* union %s never defined */ - warning(234, sym->s_name); - break; - case ENUM: - /* enum %s never defined */ - warning(235, sym->s_name); - break; - default: - LERROR("chktusg()"); - } -} - -/* - * Called after the entire translation unit has been parsed. - * Changes tentative definitions in definitions. - * Performs some tests on global Symbols. Detected Problems are: - * - defined variables of incomplete type - * - constant variables which are not initialized - * - static symbols which are never used - */ -void -chkglsyms(void) -{ - sym_t *sym; - pos_t cpos; - - if (blklev != 0 || dcs->d_nxt != NULL) - norecover(); - - STRUCT_ASSIGN(cpos, curr_pos); - - for (sym = dcs->d_dlsyms; sym != NULL; sym = sym->s_dlnxt) { - if (sym->s_blklev == -1) - continue; - if (sym->s_kind == FVFT) { - chkglvar(sym); - } else if (sym->s_kind == FTAG) { - chktusg(sym); - } else { - if (sym->s_kind != FMOS) - LERROR("chkglsyms()"); - } - } - - STRUCT_ASSIGN(curr_pos, cpos); -} - -static void -chkglvar(sym_t *sym) -{ - - if (sym->s_scl == TYPEDEF || sym->s_scl == ENUMCON) - return; - - if (sym->s_scl != EXTERN && sym->s_scl != STATIC) - LERROR("chkglvar()"); - - glchksz(sym); - - if (sym->s_scl == STATIC) { - if (sym->s_type->t_tspec == FUNC) { - if (sym->s_used && sym->s_def != DEF) { - STRUCT_ASSIGN(curr_pos, sym->s_upos); - /* static func. called but not def.. */ - error(225, sym->s_name); - } - } - if (!sym->s_used) { - STRUCT_ASSIGN(curr_pos, sym->s_dpos); - if (sym->s_type->t_tspec == FUNC) { - if (sym->s_def == DEF) { - if (!sym->s_inline) - /* static function %s unused */ - warning(236, sym->s_name); - } else { - /* static function %s decl. but ... */ - warning(290, sym->s_name); - } - } else if (!sym->s_set) { - /* static variable %s unused */ - warning(226, sym->s_name); - } else { - /* static variable %s set but not used */ - warning(307, sym->s_name); - } - } - if (!tflag && sym->s_def == TDEF && sym->s_type->t_const) { - STRUCT_ASSIGN(curr_pos, sym->s_dpos); - /* const object %s should have initializer */ - warning(227, sym->s_name); - } - } -} - -static void -glchksz(sym_t *sym) -{ - - if (sym->s_def == TDEF) { - if (sym->s_type->t_tspec == FUNC) - /* - * this can happen if a syntax error occurred - * after a function declaration - */ - return; - STRUCT_ASSIGN(curr_pos, sym->s_dpos); - if (length(sym->s_type, sym->s_name) == 0 && - sym->s_type->t_tspec == ARRAY && sym->s_type->t_dim == 0) { - /* empty array declaration: %s */ - if (tflag || (sym->s_scl == EXTERN && !sflag)) { - warning(190, sym->s_name); - } else { - error(190, sym->s_name); - } - } - } -} - -/* - * Prints information about location of previous definition/declaration. - */ -void -prevdecl(int msg, sym_t *psym) -{ - pos_t cpos; - - if (!rflag) - return; - - STRUCT_ASSIGN(cpos, curr_pos); - STRUCT_ASSIGN(curr_pos, psym->s_dpos); - if (msg != -1) { - message(msg, psym->s_name); - } else if (psym->s_def == DEF || psym->s_def == TDEF) { - /* previous definition of %s */ - message(261, psym->s_name); - } else { - /* previous declaration of %s */ - message(260, psym->s_name); - } - STRUCT_ASSIGN(curr_pos, cpos); -} diff --git a/usr.bin/xlint/lint1/emit.c b/usr.bin/xlint/lint1/emit.c deleted file mode 100644 index a770e5a8fbed..000000000000 --- a/usr.bin/xlint/lint1/emit.c +++ /dev/null @@ -1,243 +0,0 @@ -/* $NetBSD: emit.c,v 1.2 1995/07/03 21:24:00 cgd Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef lint -static char rcsid[] = "$NetBSD: emit.c,v 1.2 1995/07/03 21:24:00 cgd Exp $"; -#endif - -#include -#include -#include -#include - -#include "lint.h" - -/* name and handle of output file */ -static const char *loname; -static FILE *lout; - -/* output buffer data */ -ob_t ob; - -static void outxbuf(void); - - -/* - * initialize output - */ -void -outopen(name) - const char *name; -{ - loname = name; - - /* Ausgabedatei oeffnen */ - if ((lout = fopen(name, "w")) == NULL) - err(1, "cannot open '%s'", name); - - /* Ausgabepuffer anlegen */ - ob.o_len = 1024; - ob.o_end = (ob.o_buf = ob.o_nxt = xmalloc(ob.o_len)) + ob.o_len; -} - -/* - * flush output buffer and close file - */ -void -outclose() -{ - outclr(); - if (fclose(lout) == EOF) - err(1, "cannot close '%s'", loname); -} - -/* - * resize output buffer - */ -static void -outxbuf() -{ - ptrdiff_t coffs; - - coffs = ob.o_nxt - ob.o_buf; - ob.o_len *= 2; - ob.o_end = (ob.o_buf = xrealloc(ob.o_buf, ob.o_len)) + ob.o_len; - ob.o_nxt = ob.o_buf + coffs; -} - -/* - * reset output buffer - * if it is not empty, it is flushed - */ -void -outclr() -{ - size_t sz; - - if (ob.o_buf != ob.o_nxt) { - outchar('\n'); - sz = ob.o_nxt - ob.o_buf; - if (sz > ob.o_len) - errx(1, "internal error: outclr() 1"); - if (fwrite(ob.o_buf, sz, 1, lout) != 1) - err(1, "cannot write to %s", loname); - ob.o_nxt = ob.o_buf; - } -} - -/* - * write a character to the output buffer - */ -void -outchar(c) - int c; -{ - if (ob.o_nxt == ob.o_end) - outxbuf(); - *ob.o_nxt++ = (char)c; -} - -/* - * write a character to the output buffer, qouted if necessary - */ -void -outqchar(c) - int c; -{ - if (isprint(c) && c != '\\' && c != '"' && c != '\'') { - outchar(c); - } else { - outchar('\\'); - switch (c) { - case '\\': - outchar('\\'); - break; - case '"': - outchar('"'); - break; - case '\'': - outchar('\''); - break; - case '\b': - outchar('b'); - break; - case '\t': - outchar('t'); - break; - case '\n': - outchar('n'); - break; - case '\f': - outchar('f'); - break; - case '\r': - outchar('r'); - break; -#ifdef __STDC__ - case '\v': -#else - case '\013': -#endif - outchar('v'); - break; -#ifdef __STDC__ - case '\a': -#else - case '\007': -#endif - outchar('a'); - break; - default: - outchar((((u_int)c >> 6) & 07) + '0'); - outchar((((u_int)c >> 3) & 07) + '0'); - outchar((c & 07) + '0'); - break; - } - } -} - -/* - * write a strint to the output buffer - * the string must not contain any characters which - * should be quoted - */ -void -outstrg(s) - const char *s; -{ - while (*s != '\0') { - if (ob.o_nxt == ob.o_end) - outxbuf(); - *ob.o_nxt++ = *s++; - } -} - -/* - * write an integer value to toe output buffer - */ -void -outint(i) - int i; -{ - if ((ob.o_end - ob.o_nxt) < 3 * sizeof (int)) - outxbuf(); - ob.o_nxt += sprintf(ob.o_nxt, "%d", i); -} - -/* - * write the name of a symbol to the output buffer - * the name is preceded by its length - */ -void -outname(name) - const char *name; -{ - if (name == NULL) - errx(1, "internal error: outname() 1"); - outint((int)strlen(name)); - outstrg(name); -} - -/* - * write the name of the .c source - */ -void -outsrc(name) - const char *name; -{ - outclr(); - outchar('S'); - outstrg(name); -} diff --git a/usr.bin/xlint/lint1/emit1.c b/usr.bin/xlint/lint1/emit1.c deleted file mode 100644 index 4d198d626d7b..000000000000 --- a/usr.bin/xlint/lint1/emit1.c +++ /dev/null @@ -1,601 +0,0 @@ -/* $NetBSD: emit1.c,v 1.14 2004/06/20 22:20:16 jmc Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: emit1.c,v 1.14 2004/06/20 22:20:16 jmc Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include - -#include "lint1.h" - -static void outtt(sym_t *, sym_t *); -static void outfstrg(strg_t *); - -/* - * Write type into the output buffer. - * The type is written as a sequence of substrings, each of which describes a - * node of type type_t - * a node is coded as follows: - * char C - * signed char s C - * unsigned char u C - * short S - * unsigned short u S - * int I - * unsigned int u I - * long L - * unsigned long u L - * long long Q - * unsigned long long u Q - * float s D - * double D - * long double l D - * void V - * * P - * [n] A n - * () F - * (void) F 0 - * (n arguments) F n arg1 arg2 ... argn - * (n arguments, ...) F n arg1 arg2 ... argn-1 E - * (a, b, c, ...) f n arg1 arg2 ... - * enum tag e T tag_or_typename - * struct tag s T tag_or_typename - * union tag u T tag_or_typename - * - * tag_or_typename 0 no tag or type name - * 1 n tag Tag - * 2 n typename only type name - * - * spaces are only for better readability - * additionally it is possible to prepend the characters 'c' (for const) - * and 'v' (for volatile) - */ -void -outtype(type_t *tp) -{ - int t, s, na; - sym_t *arg; - tspec_t ts; - - while (tp != NULL) { - if ((ts = tp->t_tspec) == INT && tp->t_isenum) - ts = ENUM; - switch (ts) { - case CHAR: t = 'C'; s = '\0'; break; - case SCHAR: t = 'C'; s = 's'; break; - case UCHAR: t = 'C'; s = 'u'; break; - case SHORT: t = 'S'; s = '\0'; break; - case USHORT: t = 'S'; s = 'u'; break; - case INT: t = 'I'; s = '\0'; break; - case UINT: t = 'I'; s = 'u'; break; - case LONG: t = 'L'; s = '\0'; break; - case ULONG: t = 'L'; s = 'u'; break; - case QUAD: t = 'Q'; s = '\0'; break; - case UQUAD: t = 'Q'; s = 'u'; break; - case FLOAT: t = 'D'; s = 's'; break; - case DOUBLE: t = 'D'; s = '\0'; break; - case LDOUBLE: t = 'D'; s = 'l'; break; - case VOID: t = 'V'; s = '\0'; break; - case PTR: t = 'P'; s = '\0'; break; - case ARRAY: t = 'A'; s = '\0'; break; - case FUNC: t = 'F'; s = '\0'; break; - case ENUM: t = 'T'; s = 'e'; break; - case STRUCT: t = 'T'; s = 's'; break; - case UNION: t = 'T'; s = 'u'; break; - default: - LERROR("outtyp()"); - } - if (tp->t_const) - outchar('c'); - if (tp->t_volatile) - outchar('v'); - if (s != '\0') - outchar(s); - outchar(t); - if (ts == ARRAY) { - outint(tp->t_dim); - } else if (ts == ENUM) { - outtt(tp->t_enum->etag, tp->t_enum->etdef); - } else if (ts == STRUCT || ts == UNION) { - outtt(tp->t_str->stag, tp->t_str->stdef); - } else if (ts == FUNC && tp->t_proto) { - na = 0; - for (arg = tp->t_args; arg != NULL; arg = arg->s_nxt) - na++; - if (tp->t_vararg) - na++; - outint(na); - for (arg = tp->t_args; arg != NULL; arg = arg->s_nxt) - outtype(arg->s_type); - if (tp->t_vararg) - outchar('E'); - } - tp = tp->t_subt; - } -} - -/* - * type to string - * used for debugging output - * - * it uses its own output buffer for conversion - */ -const char * -ttos(type_t *tp) -{ - static ob_t tob; - ob_t tmp; - - if (tob.o_buf == NULL) { - tob.o_len = 64; - tob.o_buf = tob.o_nxt = xmalloc(tob.o_len); - tob.o_end = tob.o_buf + tob.o_len; - } - - tmp = ob; - ob = tob; - ob.o_nxt = ob.o_buf; - outtype(tp); - outchar('\0'); - tob = ob; - ob = tmp; - - return (tob.o_buf); -} - -/* - * write the name of a tag or typename - * - * if the tag is named, the name of the - * tag is written, otherwise, if a typename exists which - * refers to this tag, this typename is written - */ -static void -outtt(sym_t *tag, sym_t *tdef) -{ - - /* - * 0 is no longer used. - */ - if (tag->s_name != unnamed) { - outint(1); - outname(tag->s_name); - } else if (tdef != NULL) { - outint(2); - outname(tdef->s_name); - } else { - outint(3); - outint(tag->s_dpos.p_line); - outchar('.'); - outint(getfnid(tag->s_dpos.p_file)); - outchar('.'); - outint(tag->s_dpos.p_uniq); - } -} - -/* - * write information about a global declared/defined symbol - * with storage class extern - * - * informations about function definitions are written in outfdef(), - * not here - */ -void -outsym(sym_t *sym, scl_t sc, def_t def) -{ - - /* - * Static function declarations must also be written to the output - * file. Compatibility of function declarations (for both static - * and extern functions) must be checked in lint2. Lint1 can't do - * this, especially not, if functions are declared at block level - * before their first declaration at level 0. - */ - if (sc != EXTERN && !(sc == STATIC && sym->s_type->t_tspec == FUNC)) - return; - - /* reset buffer */ - outclr(); - - /* - * line number of .c source, 'd' for declaration, Id of current - * source (.c or .h), and line in current source. - */ - outint(csrc_pos.p_line); - outchar('d'); - outint(getfnid(sym->s_dpos.p_file)); - outchar('.'); - outint(sym->s_dpos.p_line); - - /* flags */ - - switch (def) { - case DEF: - /* defined */ - outchar('d'); - break; - case TDEF: - /* tentative defined */ - outchar('t'); - break; - case DECL: - /* declared */ - outchar('e'); - break; - default: - LERROR("outsym()"); - } - if (llibflg && def != DECL) { - /* - * mark it as used so we get no warnings from lint2 about - * unused symbols in libraries. - */ - outchar('u'); - } - - if (sc == STATIC) - outchar('s'); - - /* name of the symbol */ - outname(sym->s_name); - - /* renamed name of symbol, if necessary */ - if (sym->s_rename) { - outchar('r'); - outname(sym->s_rename); - } - - /* type of the symbol */ - outtype(sym->s_type); -} - -/* - * write information about function definition - * - * this is also done for static functions so we are able to check if - * they are called with proper argument types - */ -void -outfdef(sym_t *fsym, pos_t *posp, int rval, int osdef, sym_t *args) -{ - int narg; - sym_t *arg; - - /* reset the buffer */ - outclr(); - - /* - * line number of .c source, 'd' for declaration, Id of current - * source (.c or .h), and line in current source - * - * we are already at the end of the function. If we are in the - * .c source, posp->p_line is correct, otherwise csrc_pos.p_line - * (for functions defined in header files). - */ - if (posp->p_file == csrc_pos.p_file) { - outint(posp->p_line); - } else { - outint(csrc_pos.p_line); - } - outchar('d'); - outint(getfnid(posp->p_file)); - outchar('.'); - outint(posp->p_line); - - /* flags */ - - /* both SCANFLIKE and PRINTFLIKE imply VARARGS */ - if (prflstrg != -1) { - nvararg = prflstrg; - } else if (scflstrg != -1) { - nvararg = scflstrg; - } - - if (nvararg != -1) { - outchar('v'); - outint(nvararg); - } - if (scflstrg != -1) { - outchar('S'); - outint(scflstrg); - } - if (prflstrg != -1) { - outchar('P'); - outint(prflstrg); - } - nvararg = prflstrg = scflstrg = -1; - - outchar('d'); - - if (rval) - /* has return value */ - outchar('r'); - - if (llibflg) - /* - * mark it as used so lint2 does not complain about - * unused symbols in libraries - */ - outchar('u'); - - if (osdef) - /* old style function definition */ - outchar('o'); - - if (fsym->s_scl == STATIC) - outchar('s'); - - /* name of function */ - outname(fsym->s_name); - - /* renamed name of function, if necessary */ - if (fsym->s_rename) { - outchar('r'); - outname(fsym->s_rename); - } - - /* argument types and return value */ - if (osdef) { - narg = 0; - for (arg = args; arg != NULL; arg = arg->s_nxt) - narg++; - outchar('f'); - outint(narg); - for (arg = args; arg != NULL; arg = arg->s_nxt) - outtype(arg->s_type); - outtype(fsym->s_type->t_subt); - } else { - outtype(fsym->s_type); - } -} - -/* - * write out all information necessary for lint2 to check function - * calls - * - * rvused is set if the return value is used (asigned to a variable) - * rvdisc is set if the return value is not used and not ignored - * (casted to void) - */ -void -outcall(tnode_t *tn, int rvused, int rvdisc) -{ - tnode_t *args, *arg; - int narg, n, i; - int64_t q; - tspec_t t; - - /* reset buffer */ - outclr(); - - /* - * line number of .c source, 'c' for function call, Id of current - * source (.c or .h), and line in current source - */ - outint(csrc_pos.p_line); - outchar('c'); - outint(getfnid(curr_pos.p_file)); - outchar('.'); - outint(curr_pos.p_line); - - /* - * flags; 'u' and 'i' must be last to make sure a letter - * is between the numeric argument of a flag and the name of - * the function - */ - narg = 0; - args = tn->tn_right; - for (arg = args; arg != NULL; arg = arg->tn_right) - narg++; - /* informations about arguments */ - for (n = 1; n <= narg; n++) { - /* the last argument is the top one in the tree */ - for (i = narg, arg = args; i > n; i--, arg = arg->tn_right) - continue; - arg = arg->tn_left; - if (arg->tn_op == CON) { - if (isityp(t = arg->tn_type->t_tspec)) { - /* - * XXX it would probably be better to - * explizitly test the sign - */ - if ((q = arg->tn_val->v_quad) == 0) { - /* zero constant */ - outchar('z'); - } else if (msb(q, t, 0) == 0) { - /* positive if casted to signed */ - outchar('p'); - } else { - /* negative if casted to signed */ - outchar('n'); - } - outint(n); - } - } else if (arg->tn_op == AMPER && - arg->tn_left->tn_op == STRING && - arg->tn_left->tn_strg->st_tspec == CHAR) { - /* constant string, write all format specifiers */ - outchar('s'); - outint(n); - outfstrg(arg->tn_left->tn_strg); - } - - } - /* return value discarded/used/ignored */ - outchar(rvdisc ? 'd' : (rvused ? 'u' : 'i')); - - /* name of the called function */ - outname(tn->tn_left->tn_left->tn_sym->s_name); - - /* types of arguments */ - outchar('f'); - outint(narg); - for (n = 1; n <= narg; n++) { - /* the last argument is the top one in the tree */ - for (i = narg, arg = args; i > n; i--, arg = arg->tn_right) - continue; - outtype(arg->tn_left->tn_type); - } - /* expected type of return value */ - outtype(tn->tn_type); -} - -/* - * extracts potential format specifiers for printf() and scanf() and - * writes them, enclosed in "" and qouted if necessary, to the output buffer - */ -static void -outfstrg(strg_t *strg) -{ - int c, oc, first; - u_char *cp; - - if (strg->st_tspec != CHAR) - LERROR("outfstrg()"); - - cp = strg->st_cp; - - outchar('"'); - - c = *cp++; - - while (c != '\0') { - - if (c != '%') { - c = *cp++; - continue; - } - - outqchar('%'); - c = *cp++; - - /* flags for printf and scanf and *-fieldwidth for printf */ - while (c != '\0' && (c == '-' || c == '+' || c == ' ' || - c == '#' || c == '0' || c == '*')) { - outqchar(c); - c = *cp++; - } - - /* numeric field width */ - while (c != '\0' && isdigit(c)) { - outqchar(c); - c = *cp++; - } - - /* precision for printf */ - if (c == '.') { - outqchar(c); - if ((c = *cp++) == '*') { - outqchar(c); - c = *cp++; - } else { - while (c != '\0' && isdigit(c)) { - outqchar(c); - c = *cp++; - } - } - } - - /* h, l, L and q flags fpr printf and scanf */ - if (c == 'h' || c == 'l' || c == 'L' || c == 'q') { - outqchar(c); - c = *cp++; - } - - /* - * The last character. It is always written so we can detect - * invalid format specifiers. - */ - if (c != '\0') { - outqchar(c); - oc = c; - c = *cp++; - /* - * handle [ for scanf. [-] means that a minus sign - * was found at an undefined position. - */ - if (oc == '[') { - if (c == '^') - c = *cp++; - if (c == ']') - c = *cp++; - first = 1; - while (c != '\0' && c != ']') { - if (c == '-') { - if (!first && *cp != ']') - outqchar(c); - } - first = 0; - c = *cp++; - } - if (c == ']') { - outqchar(c); - c = *cp++; - } - } - } - - } - - outchar('"'); -} - -/* - * writes a record if sym was used - */ -void -outusg(sym_t *sym) -{ - /* reset buffer */ - outclr(); - - /* - * line number of .c source, 'u' for used, Id of current - * source (.c or .h), and line in current source - */ - outint(csrc_pos.p_line); - outchar('u'); - outint(getfnid(curr_pos.p_file)); - outchar('.'); - outint(curr_pos.p_line); - - /* necessary to delimit both numbers */ - outchar('x'); - - /* Den Namen des Symbols ausgeben */ - outname(sym->s_name); -} diff --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c deleted file mode 100644 index e05305e4f8c2..000000000000 --- a/usr.bin/xlint/lint1/err.c +++ /dev/null @@ -1,552 +0,0 @@ -/* $NetBSD: err.c,v 1.40 2009/04/15 01:20:57 christos Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: err.c,v 1.40 2009/04/15 01:20:57 christos Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include - -#include "lint1.h" - -/* number of errors found */ -int nerr; - -/* number of syntax errors */ -int sytxerr; - - -static const char *lbasename(const char *); -static void verror(int, va_list); -static void vwarning(int, va_list); - - -const char *msgs[] = { - "syntax error: empty declaration", /* 0 */ - "old style declaration; add int", /* 1 */ - "empty declaration", /* 2 */ - "%s declared in argument declaration list", /* 3 */ - "illegal type combination", /* 4 */ - "modifying typedef with '%s'; only qualifiers allowed", /* 5 */ - "use 'double' instead of 'long float'", /* 6 */ - "only one storage class allowed", /* 7 */ - "illegal storage class", /* 8 */ - "only register valid as formal parameter storage class", /* 9 */ - "duplicate '%s'", /* 10 */ - "bit-field initializer out of range", /* 11 */ - "compiler takes size of function", /* 12 */ - "incomplete enum type: %s", /* 13 */ - "compiler takes alignment of function", /* 14 */ - "function returns illegal type", /* 15 */ - "array of function is illegal", /* 16 */ - "null dimension", /* 17 */ - "illegal use of 'void'", /* 18 */ - "void type for %s", /* 19 */ - "negative array dimension (%d)", /* 20 */ - "redeclaration of formal parameter %s", /* 21 */ - "incomplete or misplaced function definition", /* 22 */ - "undefined label %s", /* 23 */ - "cannot initialize function: %s", /* 24 */ - "cannot initialize typedef: %s", /* 25 */ - "cannot initialize extern declaration: %s", /* 26 */ - "redeclaration of %s", /* 27 */ - "redefinition of %s", /* 28 */ - "previously declared extern, becomes static: %s", /* 29 */ - "redeclaration of %s; ANSI C requires static", /* 30 */ - "incomplete structure or union %s: %s", /* 31 */ - "argument type defaults to 'int': %s", /* 32 */ - "duplicate member name: %s", /* 33 */ - "nonportable bit-field type", /* 34 */ - "illegal bit-field type", /* 35 */ - "illegal bit-field size", /* 36 */ - "zero size bit-field", /* 37 */ - "function illegal in structure or union", /* 38 */ - "zero sized array in struct is a C99 extension: %s", /* 39 */ - "unknown size: %s", /* 40 */ - "illegal use of bit-field", /* 41 */ - "forward reference to enum type", /* 42 */ - "redefinition hides earlier one: %s", /* 43 */ - "declaration introduces new type in ANSI C: %s %s", /* 44 */ - "base type is really '%s %s'", /* 45 */ - "(%s) tag redeclared", /* 46 */ - "zero sized %s is a C9X feature", /* 47 */ - "overflow in enumeration values: %s", /* 48 */ - "struct or union member must be named", /* 49 */ - "a function is declared as an argument: %s", /* 50 */ - "parameter mismatch: %d declared, %d defined", /* 51 */ - "cannot initialize parameter: %s", /* 52 */ - "declared argument %s is missing", /* 53 */ - "trailing ',' prohibited in enum declaration", /* 54 */ - "integral constant expression expected", /* 55 */ - "integral constant too large", /* 56 */ - "enumeration constant hides parameter: %s", /* 57 */ - "type does not match prototype: %s", /* 58 */ - "formal parameter lacks name: param #%d", /* 59 */ - "void must be sole parameter", /* 60 */ - "void parameter cannot have name: %s", /* 61 */ - "function prototype parameters must have types", /* 62 */ - "prototype does not match old-style definition", /* 63 */ - "()-less function definition", /* 64 */ - "%s has no named members", /* 65 */ - "syntax requires ';' after last struct/union member", /* 66 */ - "cannot return incomplete type", /* 67 */ - "typedef already qualified with '%s'", /* 68 */ - "inappropriate qualifiers with 'void'", /* 69 */ - "%soperand of '%s' is unsigned in ANSI C", /* 70 */ - "too many characters in character constant", /* 71 */ - "typedef declares no type name", /* 72 */ - "empty character constant", /* 73 */ - "no hex digits follow \\x", /* 74 */ - "overflow in hex escape", /* 75 */ - "character escape does not fit in character", /* 76 */ - "bad octal digit %c", /* 77 */ - "nonportable character escape", /* 78 */ - "dubious escape \\%c", /* 79 */ - "dubious escape \\%o", /* 80 */ - "\\a undefined in traditional C", /* 81 */ - "\\x undefined in traditional C", /* 82 */ - "storage class after type is obsolescent", /* 83 */ - "ANSI C requires formal parameter before '...'", /* 84 */ - "dubious tag declaration: %s %s", /* 85 */ - "automatic hides external declaration: %s", /* 86 */ - "static hides external declaration: %s", /* 87 */ - "typedef hides external declaration: %s", /* 88 */ - "typedef redeclared: %s", /* 89 */ - "inconsistent redeclaration of extern: %s", /* 90 */ - "declaration hides parameter: %s", /* 91 */ - "inconsistent redeclaration of static: %s", /* 92 */ - "dubious static function at block level: %s", /* 93 */ - "function has illegal storage class: %s", /* 94 */ - "declaration hides earlier one: %s", /* 95 */ - "cannot dereference non-pointer type", /* 96 */ - "suffix U is illegal in traditional C", /* 97 */ - "suffixes F and L are illegal in traditional C", /* 98 */ - "%s undefined", /* 99 */ - "unary + is illegal in traditional C", /* 100 */ - "undefined struct/union member: %s", /* 101 */ - "illegal member use: %s", /* 102 */ - "left operand of '.' must be struct/union object", /* 103 */ - "left operand of '->' must be pointer to struct/union", /* 104 */ - "non-unique member requires struct/union %s", /* 105 */ - "left operand of '->' must be pointer", /* 106 */ - "operands of '%s' have incompatible types", /* 107 */ - "operand of '%s' has incompatible type", /* 108 */ - "void type illegal in expression", /* 109 */ - "pointer to function is not allowed here", /* 110 */ - "unacceptable operand of '%s'", /* 111 */ - "cannot take address of bit-field", /* 112 */ - "cannot take address of register %s", /* 113 */ - "%soperand of '%s' must be lvalue", /* 114 */ - "%soperand of '%s' must be modifiable lvalue", /* 115 */ - "illegal pointer subtraction", /* 116 */ - "bitwise operation on signed value possibly nonportable", /* 117 */ - "semantics of '%s' change in ANSI C; use explicit cast", /* 118 */ - "conversion of '%s' to '%s' is out of range", /* 119 */ - "bitwise operation on signed value nonportable", /* 120 */ - "negative shift", /* 121 */ - "shift greater than size of object", /* 122 */ - "illegal combination of pointer and integer, op %s", /* 123 */ - "illegal pointer combination, op %s", /* 124 */ - "ANSI C forbids ordered comparisons of pointers to functions",/* 125 */ - "incompatible types in conditional", /* 126 */ - "'&' before array or function: ignored", /* 127 */ - "operands have incompatible pointer types, op %s", /* 128 */ - "expression has null effect", /* 129 */ - "enum type mismatch, op %s", /* 130 */ - "conversion to '%s' may sign-extend incorrectly", /* 131 */ - "conversion from '%s' to '%s' may lose accuracy", /* 132 */ - "conversion of pointer to '%s' loses bits", /* 133 */ - "conversion of pointer to '%s' may lose bits", /* 134 */ - "possible pointer alignment problem", /* 135 */ - "cannot do pointer arithmetic on operand of unknown size", /* 136 */ - "use of incomplete enum type, op %s", /* 137 */ - "unknown operand size, op %s", /* 138 */ - "division by 0", /* 139 */ - "modulus by 0", /* 140 */ - "integer overflow detected, op %s", /* 141 */ - "floating point overflow detected, op %s", /* 142 */ - "cannot take size of incomplete type", /* 143 */ - "cannot take size of function", /* 144 */ - "cannot take size of bit-field", /* 145 */ - "cannot take size of void", /* 146 */ - "invalid cast expression", /* 147 */ - "improper cast of void expression", /* 148 */ - "illegal function", /* 149 */ - "argument mismatch: %d arg%s passed, %d expected", /* 150 */ - "void expressions may not be arguments, arg #%d", /* 151 */ - "argument cannot have unknown size, arg #%d", /* 152 */ - "argument has incompatible pointer type, arg #%d", /* 153 */ - "illegal combination of pointer and integer, arg #%d", /* 154 */ - "argument is incompatible with prototype, arg #%d", /* 155 */ - "enum type mismatch, arg #%d", /* 156 */ - "ANSI C treats constant as unsigned", /* 157 */ - "%s may be used before set", /* 158 */ - "assignment in conditional context", /* 159 */ - "operator '==' found where '=' was expected", /* 160 */ - "constant in conditional context", /* 161 */ - "comparison of %s with %s, op %s", /* 162 */ - "a cast does not yield an lvalue", /* 163 */ - "assignment of negative constant to unsigned type", /* 164 */ - "constant truncated by assignment", /* 165 */ - "precision lost in bit-field assignment", /* 166 */ - "array subscript cannot be negative: %ld", /* 167 */ - "array subscript cannot be > %d: %ld", /* 168 */ - "precedence confusion possible: parenthesize!", /* 169 */ - "first operand must have scalar type, op ? :", /* 170 */ - "assignment type mismatch", /* 171 */ - "too many struct/union initializers", /* 172 */ - "too many array initializers", /* 173 */ - "too many initializers", /* 174 */ - "initialisation of an incomplete type", /* 175 */ - "invalid initializer type %s", /* 176 */ - "non-constant initializer", /* 177 */ - "initializer does not fit", /* 178 */ - "cannot initialize struct/union with no named member", /* 179 */ - "bit-field initializer does not fit", /* 180 */ - "{}-enclosed initializer required", /* 181 */ - "incompatible pointer types", /* 182 */ - "illegal combination of pointer and integer", /* 183 */ - "illegal pointer combination", /* 184 */ - "initialisation type mismatch", /* 185 */ - "bit-field initialisation is illegal in traditional C", /* 186 */ - "non-null byte ignored in string initializer", /* 187 */ - "no automatic aggregate initialization in traditional C", /* 188 */ - "assignment of struct/union illegal in traditional C", /* 189 */ - "empty array declaration: %s", /* 190 */ - "%s set but not used in function %s", /* 191 */ - "%s unused in function %s", /* 192 */ - "statement not reached", /* 193 */ - "label %s redefined", /* 194 */ - "case not in switch", /* 195 */ - "case label affected by conversion", /* 196 */ - "non-constant case expression", /* 197 */ - "non-integral case expression", /* 198 */ - "duplicate case in switch: %ld", /* 199 */ - "duplicate case in switch: %lu", /* 200 */ - "default outside switch", /* 201 */ - "duplicate default in switch", /* 202 */ - "case label must be of type `int' in traditional C", /* 203 */ - "controlling expressions must have scalar type", /* 204 */ - "switch expression must have integral type", /* 205 */ - "enumeration value(s) not handled in switch", /* 206 */ - "loop not entered at top", /* 207 */ - "break outside loop or switch", /* 208 */ - "continue outside loop", /* 209 */ - "enum type mismatch in initialisation", /* 210 */ - "return value type mismatch", /* 211 */ - "cannot return incomplete type", /* 212 */ - "void function %s cannot return value", /* 213 */ - "function %s expects to return value", /* 214 */ - "function implicitly declared to return int", /* 215 */ - "function %s has return (e); and return;", /* 216 */ - "function %s falls off bottom without returning value", /* 217 */ - "ANSI C treats constant as unsigned, op %s", /* 218 */ - "concatenated strings are illegal in traditional C", /* 219 */ - "fallthrough on case statement", /* 220 */ - "initialisation of unsigned with negative constant", /* 221 */ - "conversion of negative constant to unsigned type", /* 222 */ - "end-of-loop code not reached", /* 223 */ - "cannot recover from previous errors", /* 224 */ - "static function called but not defined: %s()", /* 225 */ - "static variable %s unused", /* 226 */ - "const object %s should have initializer", /* 227 */ - "function cannot return const or volatile object", /* 228 */ - "questionable conversion of function pointer", /* 229 */ - "nonportable character comparison, op %s", /* 230 */ - "argument %s unused in function %s", /* 231 */ - "label %s unused in function %s", /* 232 */ - "struct %s never defined", /* 233 */ - "union %s never defined", /* 234 */ - "enum %s never defined", /* 235 */ - "static function %s unused", /* 236 */ - "redeclaration of formal parameter %s", /* 237 */ - "initialisation of union is illegal in traditional C", /* 238 */ - "constant argument to NOT", /* 239 */ - "assignment of different structures", /* 240 */ - "dubious operation on enum, op %s", /* 241 */ - "combination of '%s' and '%s', op %s", /* 242 */ - "dubious comparison of enums, op %s", /* 243 */ - "illegal structure pointer combination", /* 244 */ - "illegal structure pointer combination, op %s", /* 245 */ - "dubious conversion of enum to '%s'", /* 246 */ - "pointer casts may be troublesome", /* 247 */ - "floating-point constant out of range", /* 248 */ - "syntax error", /* 249 */ - "unknown character \\%o", /* 250 */ - "malformed integer constant", /* 251 */ - "integer constant out of range", /* 252 */ - "unterminated character constant", /* 253 */ - "newline in string or char constant", /* 254 */ - "undefined or invalid # directive", /* 255 */ - "unterminated comment", /* 256 */ - "extra characters in lint comment", /* 257 */ - "unterminated string constant", /* 258 */ - "conversion to '%s' due to prototype, arg #%d", /* 259 */ - "previous declaration of %s", /* 260 */ - "previous definition of %s", /* 261 */ - "\\\" inside character constants undefined in traditional C", /* 262 */ - "\\? undefined in traditional C", /* 263 */ - "\\v undefined in traditional C", /* 264 */ - "%s C does not support 'long long'", /* 265 */ - "'long double' is illegal in traditional C", /* 266 */ - "shift equal to size of object", /* 267 */ - "variable declared inline: %s", /* 268 */ - "argument declared inline: %s", /* 269 */ - "function prototypes are illegal in traditional C", /* 270 */ - "switch expression must be of type `int' in traditional C", /* 271 */ - "empty translation unit", /* 272 */ - "bit-field type '%s' invalid in ANSI C", /* 273 */ - "ANSI C forbids comparison of %s with %s", /* 274 */ - "cast discards 'const' from pointer target type", /* 275 */ - "", /* 276 */ - "initialisation of '%s' with '%s'", /* 277 */ - "combination of '%s' and '%s', arg #%d", /* 278 */ - "combination of '%s' and '%s' in return", /* 279 */ - "must be outside function: /* %s */", /* 280 */ - "duplicate use of /* %s */", /* 281 */ - "must precede function definition: /* %s */", /* 282 */ - "argument number mismatch with directive: /* %s */", /* 283 */ - "fallthrough on default statement", /* 284 */ - "prototype declaration", /* 285 */ - "function definition is not a prototype", /* 286 */ - "function declaration is not a prototype", /* 287 */ - "dubious use of /* VARARGS */ with /* %s */", /* 288 */ - "can't be used together: /* PRINTFLIKE */ /* SCANFLIKE */", /* 289 */ - "static function %s declared but not defined", /* 290 */ - "invalid multibyte character", /* 291 */ - "cannot concatenate wide and regular string literals", /* 292 */ - "argument %d must be 'char *' for PRINTFLIKE/SCANFLIKE", /* 293 */ - "multi-character character constant", /* 294 */ - "conversion of '%s' to '%s' is out of range, arg #%d", /* 295 */ - "conversion of negative constant to unsigned type, arg #%d", /* 296 */ - "conversion to '%s' may sign-extend incorrectly, arg #%d", /* 297 */ - "conversion from '%s' to '%s' may lose accuracy, arg #%d", /* 298 */ - "prototype does not match old style definition, arg #%d", /* 299 */ - "old style definition", /* 300 */ - "array of incomplete type", /* 301 */ - "%s returns pointer to automatic object", /* 302 */ - "ANSI C forbids conversion of %s to %s", /* 303 */ - "ANSI C forbids conversion of %s to %s, arg #%d", /* 304 */ - "ANSI C forbids conversion of %s to %s, op %s", /* 305 */ - "constant truncated by conversion, op %s", /* 306 */ - "static variable %s set but not used", /* 307 */ - "", /* 308 */ - "extra bits set to 0 in conversion of '%s' to '%s', op %s", /* 309 */ - "symbol renaming can't be used on function arguments", /* 310 */ - "symbol renaming can't be used on automatic variables", /* 311 */ - "%s C does not support // comments", /* 312 */ - "struct or union member name in initializer is a C9X feature",/* 313 */ - "%s is not a structure or a union", /* 314 */ - "GCC style struct or union member name in initializer", /* 315 */ - "__FUNCTION__ is a GCC extension", /* 316 */ - "__func__ is a C9X feature", /* 317 */ - "variable array dimension is a C99/GCC extension", /* 318 */ - "compound literals are a C9X/GCC extension", /* 319 */ - "({ }) is a GCC extension", /* 320 */ - "array initializer with designators is a C9X feature", /* 321 */ - "zero sized array is a C99 extension", /* 322 */ -}; - -/* - * print a list of the messages with their ids - */ -void -msglist(void) -{ - size_t i; - - for (i = 0; i < sizeof(msgs) / sizeof(msgs[0]); i++) - printf("%zu\t%s\n", i, msgs[i]); -} - -/* - * If Fflag is not set lbasename() returns a pointer to the last - * component of the path, otherwise it returns the argument. - */ -static const char * -lbasename(const char *path) -{ - const char *cp, *cp1, *cp2; - - if (Fflag) - return (path); - - cp = cp1 = cp2 = path; - while (*cp != '\0') { - if (*cp++ == '/') { - cp2 = cp1; - cp1 = cp; - } - } - return (*cp1 == '\0' ? cp2 : cp1); -} - -static void -verror( int n, va_list ap) -{ - const char *fn; - - if (ERR_ISSET(n, &msgset)) - return; - - fn = lbasename(curr_pos.p_file); - (void)printf("%s(%d): ", fn, curr_pos.p_line); - (void)vprintf(msgs[n], ap); - (void)printf(" [%d]\n", n); - nerr++; -} - -static void -vwarning( int n, va_list ap) -{ - const char *fn; - - if (ERR_ISSET(n, &msgset)) - return; - - if (nowarn) - /* this warning is suppressed by a LINTED comment */ - return; - - fn = lbasename(curr_pos.p_file); - (void)printf("%s(%d): warning: ", fn, curr_pos.p_line); - (void)vprintf(msgs[n], ap); - (void)printf(" [%d]\n", n); - if (wflag) - nerr++; -} - -void -error(int n, ...) -{ - va_list ap; - - va_start(ap, n); - verror(n, ap); - va_end(ap); -} - -void -lerror(const char *file, int line, const char *msg, ...) -{ - va_list ap; - const char *fn; - - va_start(ap, msg); - fn = lbasename(curr_pos.p_file); - (void)fprintf(stderr, "%s(%d): lint error: %s, %d", fn, curr_pos.p_line, - file, line); - (void)vfprintf(stderr, msg, ap); - (void)fprintf(stderr, "\n"); - va_end(ap); - exit(1); -} - -void -warning(int n, ...) -{ - va_list ap; - - va_start(ap, n); - vwarning(n, ap); - va_end(ap); -} - -void -message(int n, ...) -{ - va_list ap; - const char *fn; - - if (ERR_ISSET(n, &msgset)) - return; - - va_start(ap, n); - fn = lbasename(curr_pos.p_file); - (void)printf("%s(%d): ", fn, curr_pos.p_line); - (void)vprintf(msgs[n], ap); - (void)printf(" [%d]\n", n); - va_end(ap); -} - -/* - * XXX I think the logic is possibly somewhat screwed up here. The - * question is, how do we want to interpret the -s and -S flags going - * forward? We need to answer that and then we can fix this to be - * "right"... [perry, 2 Nov 2002] -*/ -int -c99ism(int n, ...) -{ - va_list ap; - int msg; - - va_start(ap, n); - if (sflag && !(Sflag || gflag)) { - verror(n, ap); - msg = 1; - } else if (!sflag && (Sflag || gflag)) { - msg = 0; - } else { - vwarning(n, ap); - msg = 1; - } - va_end(ap); - - return (msg); -} - -int -gnuism(int n, ...) -{ - va_list ap; - int msg; - - va_start(ap, n); - if (sflag && !gflag) { - verror(n, ap); - msg = 1; - } else if (!sflag && gflag) { - msg = 0; - } else { - vwarning(n, ap); - msg = 1; - } - va_end(ap); - - return (msg); -} diff --git a/usr.bin/xlint/lint1/externs1.h b/usr.bin/xlint/lint1/externs1.h deleted file mode 100644 index cf40a5d9199c..000000000000 --- a/usr.bin/xlint/lint1/externs1.h +++ /dev/null @@ -1,292 +0,0 @@ -/* $NetBSD: externs1.h,v 1.20 2002/11/02 20:09:27 perry Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * main.c - */ -extern int aflag; -extern int bflag; -extern int cflag; -extern int dflag; -extern int eflag; -extern int Fflag; -extern int gflag; -extern int hflag; -extern int rflag; -extern int sflag; -extern int tflag; -extern int uflag; -extern int vflag; -extern int yflag; -extern int wflag; -extern int zflag; -extern int Sflag; - -extern void norecover(void); - -/* - * cgram.y - */ -extern int blklev; -extern int mblklev; -extern int yydebug; - -extern int yyerror(char *); -extern int yyparse(void); - -/* - * scan.l - */ -extern pos_t curr_pos; -extern pos_t csrc_pos; -extern symt_t symtyp; -extern FILE *yyin; -extern uint64_t qbmasks[], qlmasks[], qumasks[]; - -extern void initscan(void); -extern int sign(int64_t, tspec_t, int); -extern int msb(int64_t, tspec_t, int); -extern int64_t xsign(int64_t, tspec_t, int); -extern void clrwflgs(void); -extern sym_t *getsym(sbuf_t *); -extern void cleanup(void); -extern sym_t *pushdown(sym_t *); -extern sym_t *mktempsym(type_t *); -extern void rmsym(sym_t *); -extern void rmsyms(sym_t *); -extern void inssym(int, sym_t *); -extern void freeyyv(void *, int); -extern int yylex(void); - -/* - * mem1.c - */ -extern const char *fnalloc(const char *); -extern const char *fnnalloc(const char *, size_t); -extern int getfnid(const char *); - -extern void initmem(void); - -extern void *getblk(size_t); -extern void *getlblk(int, size_t); -extern void freeblk(void); -extern void freelblk(int); - -extern void *tgetblk(size_t); -extern tnode_t *getnode(void); -extern void tfreeblk(void); -extern struct mbl *tsave(void); -extern void trestor(struct mbl *); - -/* - * err.c - */ -extern int nerr; -extern int sytxerr; -extern const char *msgs[]; - -extern void msglist(void); -extern void error(int, ...); -extern void warning(int, ...); -extern void message(int, ...); -extern int gnuism(int, ...); -extern int c99ism(int, ...); -extern void lerror(const char *, int, const char *, ...) - __attribute__((__noreturn__,__format__(__printf__, 3, 4))); - -/* - * decl.c - */ -extern dinfo_t *dcs; -extern const char *unnamed; -extern int enumval; - -extern void initdecl(void); -extern type_t *gettyp(tspec_t); -extern type_t *duptyp(const type_t *); -extern type_t *tduptyp(const type_t *); -extern int incompl(type_t *); -extern void setcompl(type_t *, int); -extern void addscl(scl_t); -extern void addtype(type_t *); -extern void addqual(tqual_t); -extern void pushdecl(scl_t); -extern void popdecl(void); -extern void setasm(void); -extern void clrtyp(void); -extern void deftyp(void); -extern int length(type_t *, const char *); -extern int getbound(type_t *); -extern sym_t *lnklst(sym_t *, sym_t *); -extern void chktyp(sym_t *); -extern sym_t *decl1str(sym_t *); -extern sym_t *bitfield(sym_t *, int); -extern pqinf_t *mergepq(pqinf_t *, pqinf_t *); -extern sym_t *addptr(sym_t *, pqinf_t *); -extern sym_t *addarray(sym_t *, int, int); -extern sym_t *addfunc(sym_t *, sym_t *); -extern void chkfdef(sym_t *, int); -extern sym_t *dname(sym_t *); -extern sym_t *iname(sym_t *); -extern type_t *mktag(sym_t *, tspec_t, int, int); -extern const char *scltoa(scl_t); -extern type_t *compltag(type_t *, sym_t *); -extern sym_t *ename(sym_t *, int, int); -extern void decl1ext(sym_t *, int); -extern void cpuinfo(sym_t *, sym_t *); -extern int isredec(sym_t *, int *); -extern int eqtype(type_t *, type_t *, int, int, int *); -extern void compltyp(sym_t *, sym_t *); -extern sym_t *decl1arg(sym_t *, int); -extern void cluparg(void); -extern void decl1loc(sym_t *, int); -extern sym_t *aname(void); -extern void globclup(void); -extern sym_t *decl1abs(sym_t *); -extern void chksz(sym_t *); -extern void setsflg(sym_t *); -extern void setuflg(sym_t *, int, int); -extern void chkusage(dinfo_t *); -extern void chkusg1(int, sym_t *); -extern void chkglsyms(void); -extern void prevdecl(int, sym_t *); - -/* - * tree.c - */ -extern void initmtab(void); -extern type_t *incref(type_t *, tspec_t); -extern type_t *tincref(type_t *, tspec_t); -extern tnode_t *getcnode(type_t *, val_t *); -extern tnode_t *getnnode(sym_t *, int); -extern tnode_t *getsnode(strg_t *); -extern sym_t *strmemb(tnode_t *, op_t, sym_t *); -extern tnode_t *build(op_t, tnode_t *, tnode_t *); -extern tnode_t *cconv(tnode_t *); -extern int typeok(op_t, int, tnode_t *, tnode_t *); -extern tnode_t *promote(op_t, int, tnode_t *); -extern tnode_t *convert(op_t, int, type_t *, tnode_t *); -extern void cvtcon(op_t, int, type_t *, val_t *, val_t *); -extern const char *tyname(char *, size_t, type_t *); -extern const char *basictyname(tspec_t); -extern tnode_t *bldszof(type_t *); -extern tnode_t *cast(tnode_t *, type_t *); -extern tnode_t *funcarg(tnode_t *, tnode_t *); -extern tnode_t *funccall(tnode_t *, tnode_t *); -extern val_t *constant(tnode_t *, int); -extern void expr(tnode_t *, int, int, int); -extern void chkmisc(tnode_t *, int, int, int, int, int, int); -extern int conaddr(tnode_t *, sym_t **, ptrdiff_t *); -extern strg_t *catstrg(strg_t *, strg_t *); - -/* - * func.c - */ -extern sym_t *funcsym; -extern int reached; -extern int rchflg; -extern int ftflg; -extern int nargusg; -extern pos_t aupos; -extern int nvararg; -extern pos_t vapos; -extern int prflstrg; -extern pos_t prflpos; -extern int scflstrg; -extern pos_t scflpos; -extern int ccflg; -extern int llibflg; -extern int nowarn; -extern int bitfieldtype_ok; -extern int plibflg; -extern int quadflg; - -extern void pushctrl(int); -extern void popctrl(int); -extern void chkreach(void); -extern void funcdef(sym_t *); -extern void funcend(void); -extern void label(int, sym_t *, tnode_t *); -extern void if1(tnode_t *); -extern void if2(void); -extern void if3(int); -extern void switch1(tnode_t *); -extern void switch2(void); -extern void while1(tnode_t *); -extern void while2(void); -extern void do1(void); -extern void do2(tnode_t *); -extern void for1(tnode_t *, tnode_t *, tnode_t *); -extern void for2(void); -extern void dogoto(sym_t *); -extern void docont(void); -extern void dobreak(void); -extern void doreturn(tnode_t *); -extern void glclup(int); -extern void argsused(int); -extern void constcond(int); -extern void fallthru(int); -extern void notreach(int); -extern void lintlib(int); -extern void linted(int); -extern void varargs(int); -extern void printflike(int); -extern void scanflike(int); -extern void protolib(int); -extern void longlong(int); -extern void bitfieldtype(int); - -/* - * init.c - */ -extern int initerr; -extern sym_t *initsym; -extern int startinit; - -extern void prepinit(void); -extern void initrbr(void); -extern void initlbr(void); -extern void mkinit(tnode_t *); -extern void memberpush(sbuf_t *); - -/* - * emit.c - */ -extern void outtype(type_t *); -extern const char *ttos(type_t *); -extern void outsym(sym_t *, scl_t, def_t); -extern void outfdef(sym_t *, pos_t *, int, int, sym_t *); -extern void outcall(tnode_t *, int, int); -extern void outusg(sym_t *); diff --git a/usr.bin/xlint/lint1/func.c b/usr.bin/xlint/lint1/func.c deleted file mode 100644 index e5a0490c5a3a..000000000000 --- a/usr.bin/xlint/lint1/func.c +++ /dev/null @@ -1,1288 +0,0 @@ -/* $NetBSD: func.c,v 1.22 2005/09/24 15:30:35 perry Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: func.c,v 1.16 2002/01/03 04:25:15 thorpej Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include - -#include "lint1.h" -#include "cgram.h" - -/* - * Contains a pointer to the symbol table entry of the current function - * definition. - */ -sym_t *funcsym; - -/* Is set as long as a statement can be reached. Must be set at level 0. */ -int reached = 1; - -/* - * Is set as long as NOTREACHED is in effect. - * Is reset everywhere where reached can become 0. - */ -int rchflg; - -/* - * In conjunction with reached controls printing of "fallthrough on ..." - * warnings. - * Reset by each statement and set by FALLTHROUGH, switch (switch1()) - * and case (label()). - * - * Control statements if, for, while and switch do not reset ftflg because - * this must be done by the controlled statement. At least for if this is - * important because ** FALLTHROUGH ** after "if (expr) stmnt" is evaluated - * before the following token, which causes reduction of above, is read. - * This means that ** FALLTHROUGH ** after "if ..." would always be ignored. - */ -int ftflg; - -/* Top element of stack for control statements */ -cstk_t *cstk; - -/* - * Number of arguments which will be checked for usage in following - * function definition. -1 stands for all arguments. - * - * The position of the last ARGSUSED comment is stored in aupos. - */ -int nargusg = -1; -pos_t aupos; - -/* - * Number of arguments of the following function definition whose types - * shall be checked by lint2. -1 stands for all arguments. - * - * The position of the last VARARGS comment is stored in vapos. - */ -int nvararg = -1; -pos_t vapos; - -/* - * Both prflstr and scflstrg contain the number of the argument which - * shall be used to check the types of remaining arguments (for PRINTFLIKE - * and SCANFLIKE). - * - * prflpos and scflpos are the positions of the last PRINTFLIKE or - * SCANFLIKE comment. - */ -int prflstrg = -1; -int scflstrg = -1; -pos_t prflpos; -pos_t scflpos; - -/* - * Are both plibflg and llibflg set, prototypes are written as function - * definitions to the output file. - */ -int plibflg; - -/* - * Nonzero means that no warnings about constants in conditional - * context are printed. - */ -int ccflg; - -/* - * llibflg is set if a lint library shall be created. The effect of - * llibflg is that all defined symbols are treated as used. - * (The LINTLIBRARY comment also resets vflag.) - */ -int llibflg; - -/* - * Nonzero if warnings are suppressed by a LINTED directive - */ -int nowarn; - -/* - * Nonzero if bitfield type errors are suppressed by a BITFIELDTYPE - * directive. - */ -int bitfieldtype_ok; - -/* - * Nonzero if complaints about use of "long long" are suppressed in - * the next statement or declaration. - */ -int quadflg; - -/* - * Puts a new element at the top of the stack used for control statements. - */ -void -pushctrl(int env) -{ - cstk_t *ci; - - if ((ci = calloc(1, sizeof (cstk_t))) == NULL) - nomem(); - ci->c_env = env; - ci->c_nxt = cstk; - cstk = ci; -} - -/* - * Removes the top element of the stack used for control statements. - */ -void -popctrl(int env) -{ - cstk_t *ci; - clst_t *cl; - - if (cstk == NULL || cstk->c_env != env) - LERROR("popctrl()"); - - cstk = (ci = cstk)->c_nxt; - - while ((cl = ci->c_clst) != NULL) { - ci->c_clst = cl->cl_nxt; - free(cl); - } - - if (ci->c_swtype != NULL) - free(ci->c_swtype); - - free(ci); -} - -/* - * Prints a warning if a statement cannot be reached. - */ -void -chkreach(void) -{ - if (!reached && !rchflg) { - /* statement not reached */ - warning(193); - reached = 1; - } -} - -/* - * Called after a function declaration which introduces a function definition - * and before an (optional) old style argument declaration list. - * - * Puts all symbols declared in the Prototype or in an old style argument - * list back to the symbol table. - * - * Does the usual checking of storage class, type (return value), - * redeclaration etc.. - */ -void -funcdef(sym_t *fsym) -{ - int n, warn; - sym_t *arg, *sym, *rdsym; - - funcsym = fsym; - - /* - * Put all symbols declared in the argument list back to the - * symbol table. - */ - for (sym = dcs->d_fpsyms; sym != NULL; sym = sym->s_dlnxt) { - if (sym->s_blklev != -1) { - if (sym->s_blklev != 1) - LERROR("funcdef()"); - inssym(1, sym); - } - } - - /* - * In osfunc() we did not know whether it is an old style function - * definition or only an old style declaration, if there are no - * arguments inside the argument list ("f()"). - */ - if (!fsym->s_type->t_proto && fsym->s_args == NULL) - fsym->s_osdef = 1; - - chktyp(fsym); - - /* - * chktyp() checks for almost all possible errors, but not for - * incomplete return values (these are allowed in declarations) - */ - if (fsym->s_type->t_subt->t_tspec != VOID && - incompl(fsym->s_type->t_subt)) { - /* cannot return incomplete type */ - error(67); - } - - fsym->s_def = DEF; - - if (fsym->s_scl == TYPEDEF) { - fsym->s_scl = EXTERN; - /* illegal storage class */ - error(8); - } - - if (dcs->d_inline) - fsym->s_inline = 1; - - /* - * Arguments in new style function declarations need a name. - * (void is already removed from the list of arguments) - */ - n = 1; - for (arg = fsym->s_type->t_args; arg != NULL; arg = arg->s_nxt) { - if (arg->s_scl == ABSTRACT) { - if (arg->s_name != unnamed) - LERROR("funcdef()"); - /* formal parameter lacks name: param #%d */ - error(59, n); - } else { - if (arg->s_name == unnamed) - LERROR("funcdef()"); - } - n++; - } - - /* - * We must also remember the position. s_dpos is overwritten - * if this is an old style definition and we had already a - * prototype. - */ - STRUCT_ASSIGN(dcs->d_fdpos, fsym->s_dpos); - - if ((rdsym = dcs->d_rdcsym) != NULL) { - - if (!isredec(fsym, (warn = 0, &warn))) { - - /* - * Print nothing if the newly defined function - * is defined in old style. A better warning will - * be printed in cluparg(). - */ - if (warn && !fsym->s_osdef) { - /* redeclaration of %s */ - (*(sflag ? error : warning))(27, fsym->s_name); - prevdecl(-1, rdsym); - } - - /* copy usage information */ - cpuinfo(fsym, rdsym); - - /* - * If the old symbol was a prototype and the new - * one is none, overtake the position of the - * declaration of the prototype. - */ - if (fsym->s_osdef && rdsym->s_type->t_proto) - STRUCT_ASSIGN(fsym->s_dpos, rdsym->s_dpos); - - /* complete the type */ - compltyp(fsym, rdsym); - - /* once a function is inline it remains inline */ - if (rdsym->s_inline) - fsym->s_inline = 1; - - } - - /* remove the old symbol from the symbol table */ - rmsym(rdsym); - - } - - if (fsym->s_osdef && !fsym->s_type->t_proto) { - if (sflag && hflag && strcmp(fsym->s_name, "main") != 0) - /* function definition is not a prototype */ - warning(286); - } - - if (dcs->d_notyp) - /* return value is implicitly declared to be int */ - fsym->s_rimpl = 1; - - reached = 1; -} - -/* - * Called at the end of a function definition. - */ -void -funcend(void) -{ - sym_t *arg; - int n; - - if (reached) { - cstk->c_noretval = 1; - if (funcsym->s_type->t_subt->t_tspec != VOID && - !funcsym->s_rimpl) { - /* func. %s falls off bottom without returning value */ - warning(217, funcsym->s_name); - } - } - - /* - * This warning is printed only if the return value was implicitly - * declared to be int. Otherwise the wrong return statement - * has already printed a warning. - */ - if (cstk->c_noretval && cstk->c_retval && funcsym->s_rimpl) - /* function %s has return (e); and return; */ - warning(216, funcsym->s_name); - - /* Print warnings for unused arguments */ - arg = dcs->d_fargs; - n = 0; - while (arg != NULL && (nargusg == -1 || n < nargusg)) { - chkusg1(dcs->d_asm, arg); - arg = arg->s_nxt; - n++; - } - nargusg = -1; - - /* - * write the information about the function definition to the - * output file - * inline functions explicitly declared extern are written as - * declarations only. - */ - if (dcs->d_scl == EXTERN && funcsym->s_inline) { - outsym(funcsym, funcsym->s_scl, DECL); - } else { - outfdef(funcsym, &dcs->d_fdpos, cstk->c_retval, - funcsym->s_osdef, dcs->d_fargs); - } - - /* - * remove all symbols declared during argument declaration from - * the symbol table - */ - if (dcs->d_nxt != NULL || dcs->d_ctx != EXTERN) - LERROR("funcend()"); - rmsyms(dcs->d_fpsyms); - - /* must be set on level 0 */ - reached = 1; -} - -/* - * Process a label. - * - * typ type of the label (T_NAME, T_DEFAULT or T_CASE). - * sym symbol table entry of label if typ == T_NAME - * tn expression if typ == T_CASE - */ -void -label(int typ, sym_t *sym, tnode_t *tn) -{ - cstk_t *ci; - clst_t *cl; - val_t *v; - val_t nv; - tspec_t t; - - switch (typ) { - - case T_NAME: - if (sym->s_set) { - /* label %s redefined */ - error(194, sym->s_name); - } else { - setsflg(sym); - } - break; - - case T_CASE: - - /* find the stack entry for the innermost switch statement */ - for (ci = cstk; ci != NULL && !ci->c_switch; ci = ci->c_nxt) - continue; - - if (ci == NULL) { - /* case not in switch */ - error(195); - tn = NULL; - } else if (tn != NULL && tn->tn_op != CON) { - /* non-constant case expression */ - error(197); - tn = NULL; - } else if (tn != NULL && !isityp(tn->tn_type->t_tspec)) { - /* non-integral case expression */ - error(198); - tn = NULL; - } - - if (tn != NULL) { - - if (ci->c_swtype == NULL) - LERROR("label()"); - - if (reached && !ftflg) { - if (hflag) - /* fallthrough on case statement */ - warning(220); - } - - t = tn->tn_type->t_tspec; - if (t == LONG || t == ULONG || - t == QUAD || t == UQUAD) { - if (tflag) - /* case label must be of type ... */ - warning(203); - } - - /* - * get the value of the expression and convert it - * to the type of the switch expression - */ - v = constant(tn, 1); - (void) memset(&nv, 0, sizeof nv); - cvtcon(CASE, 0, ci->c_swtype, &nv, v); - free(v); - - /* look if we had this value already */ - for (cl = ci->c_clst; cl != NULL; cl = cl->cl_nxt) { - if (cl->cl_val.v_quad == nv.v_quad) - break; - } - if (cl != NULL && isutyp(nv.v_tspec)) { - /* duplicate case in switch, %lu */ - error(200, (u_long)nv.v_quad); - } else if (cl != NULL) { - /* duplicate case in switch, %ld */ - error(199, (long)nv.v_quad); - } else { - /* - * append the value to the list of - * case values - */ - cl = xcalloc(1, sizeof (clst_t)); - STRUCT_ASSIGN(cl->cl_val, nv); - cl->cl_nxt = ci->c_clst; - ci->c_clst = cl; - } - } - tfreeblk(); - break; - - case T_DEFAULT: - - /* find the stack entry for the innermost switch statement */ - for (ci = cstk; ci != NULL && !ci->c_switch; ci = ci->c_nxt) - continue; - - if (ci == NULL) { - /* default outside switch */ - error(201); - } else if (ci->c_default) { - /* duplicate default in switch */ - error(202); - } else { - if (reached && !ftflg) { - if (hflag) - /* fallthrough on default statement */ - warning(284); - } - ci->c_default = 1; - } - break; - } - reached = 1; -} - -/* - * T_IF T_LPARN expr T_RPARN - */ -void -if1(tnode_t *tn) -{ - - if (tn != NULL) - tn = cconv(tn); - if (tn != NULL) - tn = promote(NOOP, 0, tn); - expr(tn, 0, 1, 1); - pushctrl(T_IF); -} - -/* - * if_without_else - * if_without_else T_ELSE - */ -void -if2(void) -{ - - cstk->c_rchif = reached ? 1 : 0; - reached = 1; -} - -/* - * if_without_else - * if_without_else T_ELSE stmnt - */ -void -if3(int els) -{ - - if (els) { - reached |= cstk->c_rchif; - } else { - reached = 1; - } - popctrl(T_IF); -} - -/* - * T_SWITCH T_LPARN expr T_RPARN - */ -void -switch1(tnode_t *tn) -{ - tspec_t t; - type_t *tp; - - if (tn != NULL) - tn = cconv(tn); - if (tn != NULL) - tn = promote(NOOP, 0, tn); - if (tn != NULL && !isityp(tn->tn_type->t_tspec)) { - /* switch expression must have integral type */ - error(205); - tn = NULL; - } - if (tn != NULL && tflag) { - t = tn->tn_type->t_tspec; - if (t == LONG || t == ULONG || t == QUAD || t == UQUAD) { - /* switch expr. must be of type `int' in trad. C */ - warning(271); - } - } - - /* - * Remember the type of the expression. Because its possible - * that (*tp) is allocated on tree memory the type must be - * duplicated. This is not too complicated because it is - * only an integer type. - */ - if ((tp = calloc(1, sizeof (type_t))) == NULL) - nomem(); - if (tn != NULL) { - tp->t_tspec = tn->tn_type->t_tspec; - if ((tp->t_isenum = tn->tn_type->t_isenum) != 0) - tp->t_enum = tn->tn_type->t_enum; - } else { - tp->t_tspec = INT; - } - - expr(tn, 1, 0, 1); - - pushctrl(T_SWITCH); - cstk->c_switch = 1; - cstk->c_swtype = tp; - - reached = rchflg = 0; - ftflg = 1; -} - -/* - * switch_expr stmnt - */ -void -switch2(void) -{ - int nenum = 0, nclab = 0; - sym_t *esym; - clst_t *cl; - - if (cstk->c_swtype == NULL) - LERROR("switch2()"); - - /* - * If the switch expression was of type enumeration, count the case - * labels and the number of enumerators. If both counts are not - * equal print a warning. - */ - if (cstk->c_swtype->t_isenum) { - nenum = nclab = 0; - if (cstk->c_swtype->t_enum == NULL) - LERROR("switch2()"); - for (esym = cstk->c_swtype->t_enum->elem; - esym != NULL; esym = esym->s_nxt) { - nenum++; - } - for (cl = cstk->c_clst; cl != NULL; cl = cl->cl_nxt) - nclab++; - if (hflag && eflag && nenum != nclab && !cstk->c_default) { - /* enumeration value(s) not handled in switch */ - warning(206); - } - } - - if (cstk->c_break) { - /* - * end of switch always reached (c_break is only set if the - * break statement can be reached). - */ - reached = 1; - } else if (!cstk->c_default && - (!hflag || !cstk->c_swtype->t_isenum || nenum != nclab)) { - /* - * there are possible values which are not handled in - * switch - */ - reached = 1; - } /* - * otherwise the end of the switch expression is reached - * if the end of the last statement inside it is reached. - */ - - popctrl(T_SWITCH); -} - -/* - * T_WHILE T_LPARN expr T_RPARN - */ -void -while1(tnode_t *tn) -{ - - if (!reached) { - /* loop not entered at top */ - warning(207); - reached = 1; - } - - if (tn != NULL) - tn = cconv(tn); - if (tn != NULL) - tn = promote(NOOP, 0, tn); - if (tn != NULL && !issclt(tn->tn_type->t_tspec)) { - /* controlling expressions must have scalar type */ - error(204); - tn = NULL; - } - - pushctrl(T_WHILE); - cstk->c_loop = 1; - if (tn != NULL && tn->tn_op == CON) { - if (isityp(tn->tn_type->t_tspec)) { - cstk->c_infinite = tn->tn_val->v_quad != 0; - } else { - cstk->c_infinite = tn->tn_val->v_ldbl != 0.0; - } - } - - expr(tn, 0, 1, 1); -} - -/* - * while_expr stmnt - * while_expr error - */ -void -while2(void) -{ - - /* - * The end of the loop can be reached if it is no endless loop - * or there was a break statement which was reached. - */ - reached = !cstk->c_infinite || cstk->c_break; - rchflg = 0; - - popctrl(T_WHILE); -} - -/* - * T_DO - */ -void -do1(void) -{ - - if (!reached) { - /* loop not entered at top */ - warning(207); - reached = 1; - } - - pushctrl(T_DO); - cstk->c_loop = 1; -} - -/* - * do stmnt do_while_expr - * do error - */ -void -do2(tnode_t *tn) -{ - - /* - * If there was a continue statement the expression controlling the - * loop is reached. - */ - if (cstk->c_cont) - reached = 1; - - if (tn != NULL) - tn = cconv(tn); - if (tn != NULL) - tn = promote(NOOP, 0, tn); - if (tn != NULL && !issclt(tn->tn_type->t_tspec)) { - /* controlling expressions must have scalar type */ - error(204); - tn = NULL; - } - - if (tn != NULL && tn->tn_op == CON) { - if (isityp(tn->tn_type->t_tspec)) { - cstk->c_infinite = tn->tn_val->v_quad != 0; - } else { - cstk->c_infinite = tn->tn_val->v_ldbl != 0.0; - } - } - - expr(tn, 0, 1, 1); - - /* - * The end of the loop is only reached if it is no endless loop - * or there was a break statement which could be reached. - */ - reached = !cstk->c_infinite || cstk->c_break; - rchflg = 0; - - popctrl(T_DO); -} - -/* - * T_FOR T_LPARN opt_expr T_SEMI opt_expr T_SEMI opt_expr T_RPARN - */ -void -for1(tnode_t *tn1, tnode_t *tn2, tnode_t *tn3) -{ - - /* - * If there is no initialisation expression it is possible that - * it is intended not to enter the loop at top. - */ - if (tn1 != NULL && !reached) { - /* loop not entered at top */ - warning(207); - reached = 1; - } - - pushctrl(T_FOR); - cstk->c_loop = 1; - - /* - * Store the tree memory for the reinitialisation expression. - * Also remember this expression itself. We must check it at - * the end of the loop to get "used but not set" warnings correct. - */ - cstk->c_fexprm = tsave(); - cstk->c_f3expr = tn3; - STRUCT_ASSIGN(cstk->c_fpos, curr_pos); - STRUCT_ASSIGN(cstk->c_cfpos, csrc_pos); - - if (tn1 != NULL) - expr(tn1, 0, 0, 1); - - if (tn2 != NULL) - tn2 = cconv(tn2); - if (tn2 != NULL) - tn2 = promote(NOOP, 0, tn2); - if (tn2 != NULL && !issclt(tn2->tn_type->t_tspec)) { - /* controlling expressions must have scalar type */ - error(204); - tn2 = NULL; - } - if (tn2 != NULL) - expr(tn2, 0, 1, 1); - - if (tn2 == NULL) { - cstk->c_infinite = 1; - } else if (tn2->tn_op == CON) { - if (isityp(tn2->tn_type->t_tspec)) { - cstk->c_infinite = tn2->tn_val->v_quad != 0; - } else { - cstk->c_infinite = tn2->tn_val->v_ldbl != 0.0; - } - } - - /* Checking the reinitialisation expression is done in for2() */ - - reached = 1; -} - -/* - * for_exprs stmnt - * for_exprs error - */ -void -for2(void) -{ - pos_t cpos, cspos; - tnode_t *tn3; - - if (cstk->c_cont) - reached = 1; - - STRUCT_ASSIGN(cpos, curr_pos); - STRUCT_ASSIGN(cspos, csrc_pos); - - /* Restore the tree memory for the reinitialisation expression */ - trestor(cstk->c_fexprm); - tn3 = cstk->c_f3expr; - STRUCT_ASSIGN(curr_pos, cstk->c_fpos); - STRUCT_ASSIGN(csrc_pos, cstk->c_cfpos); - - /* simply "statement not reached" would be confusing */ - if (!reached && !rchflg) { - /* end-of-loop code not reached */ - warning(223); - reached = 1; - } - - if (tn3 != NULL) { - expr(tn3, 0, 0, 1); - } else { - tfreeblk(); - } - - STRUCT_ASSIGN(curr_pos, cpos); - STRUCT_ASSIGN(csrc_pos, cspos); - - /* An endless loop without break will never terminate */ - reached = cstk->c_break || !cstk->c_infinite; - rchflg = 0; - - popctrl(T_FOR); -} - -/* - * T_GOTO identifier T_SEMI - * T_GOTO error T_SEMI - */ -void -dogoto(sym_t *lab) -{ - - setuflg(lab, 0, 0); - - chkreach(); - - reached = rchflg = 0; -} - -/* - * T_BREAK T_SEMI - */ -void -dobreak(void) -{ - cstk_t *ci; - - ci = cstk; - while (ci != NULL && !ci->c_loop && !ci->c_switch) - ci = ci->c_nxt; - - if (ci == NULL) { - /* break outside loop or switch */ - error(208); - } else { - if (reached) - ci->c_break = 1; - } - - if (bflag) - chkreach(); - - reached = rchflg = 0; -} - -/* - * T_CONTINUE T_SEMI - */ -void -docont(void) -{ - cstk_t *ci; - - for (ci = cstk; ci != NULL && !ci->c_loop; ci = ci->c_nxt) - continue; - - if (ci == NULL) { - /* continue outside loop */ - error(209); - } else { - ci->c_cont = 1; - } - - chkreach(); - - reached = rchflg = 0; -} - -/* - * T_RETURN T_SEMI - * T_RETURN expr T_SEMI - */ -void -doreturn(tnode_t *tn) -{ - tnode_t *ln, *rn; - cstk_t *ci; - op_t op; - - for (ci = cstk; ci->c_nxt != NULL; ci = ci->c_nxt) - continue; - - if (tn != NULL) { - ci->c_retval = 1; - } else { - ci->c_noretval = 1; - } - - if (tn != NULL && funcsym->s_type->t_subt->t_tspec == VOID) { - /* void function %s cannot return value */ - error(213, funcsym->s_name); - tfreeblk(); - tn = NULL; - } else if (tn == NULL && funcsym->s_type->t_subt->t_tspec != VOID) { - /* - * Assume that the function has a return value only if it - * is explicitly declared. - */ - if (!funcsym->s_rimpl) - /* function %s expects to return value */ - warning(214, funcsym->s_name); - } - - if (tn != NULL) { - - /* Create a temporary node for the left side */ - ln = tgetblk(sizeof (tnode_t)); - ln->tn_op = NAME; - ln->tn_type = tduptyp(funcsym->s_type->t_subt); - ln->tn_type->t_const = 0; - ln->tn_lvalue = 1; - ln->tn_sym = funcsym; /* better than nothing */ - - tn = build(RETURN, ln, tn); - - if (tn != NULL) { - rn = tn->tn_right; - while ((op = rn->tn_op) == CVT || op == PLUS) - rn = rn->tn_left; - if (rn->tn_op == AMPER && rn->tn_left->tn_op == NAME && - rn->tn_left->tn_sym->s_scl == AUTO) { - /* %s returns pointer to automatic object */ - warning(302, funcsym->s_name); - } - } - - expr(tn, 1, 0, 1); - - } else { - - chkreach(); - - } - - reached = rchflg = 0; -} - -/* - * Do some cleanup after a global declaration or definition. - * Especially remove informations about unused lint comments. - */ -void -glclup(int silent) -{ - pos_t cpos; - - STRUCT_ASSIGN(cpos, curr_pos); - - if (nargusg != -1) { - if (!silent) { - STRUCT_ASSIGN(curr_pos, aupos); - /* must precede function definition: %s */ - warning(282, "ARGSUSED"); - } - nargusg = -1; - } - if (nvararg != -1) { - if (!silent) { - STRUCT_ASSIGN(curr_pos, vapos); - /* must precede function definition: %s */ - warning(282, "VARARGS"); - } - nvararg = -1; - } - if (prflstrg != -1) { - if (!silent) { - STRUCT_ASSIGN(curr_pos, prflpos); - /* must precede function definition: %s */ - warning(282, "PRINTFLIKE"); - } - prflstrg = -1; - } - if (scflstrg != -1) { - if (!silent) { - STRUCT_ASSIGN(curr_pos, scflpos); - /* must precede function definition: %s */ - warning(282, "SCANFLIKE"); - } - scflstrg = -1; - } - - STRUCT_ASSIGN(curr_pos, cpos); - - dcs->d_asm = 0; -} - -/* - * ARGSUSED comment - * - * Only the first n arguments of the following function are checked - * for usage. A missing argument is taken to be 0. - */ -void -argsused(int n) -{ - - if (n == -1) - n = 0; - - if (dcs->d_ctx != EXTERN) { - /* must be outside function: ** %s ** */ - warning(280, "ARGSUSED"); - return; - } - if (nargusg != -1) { - /* duplicate use of ** %s ** */ - warning(281, "ARGSUSED"); - } - nargusg = n; - STRUCT_ASSIGN(aupos, curr_pos); -} - -/* - * VARARGS comment - * - * Makes that lint2 checks only the first n arguments for compatibility - * to the function definition. A missing argument is taken to be 0. - */ -void -varargs(int n) -{ - - if (n == -1) - n = 0; - - if (dcs->d_ctx != EXTERN) { - /* must be outside function: ** %s ** */ - warning(280, "VARARGS"); - return; - } - if (nvararg != -1) { - /* duplicate use of ** %s ** */ - warning(281, "VARARGS"); - } - nvararg = n; - STRUCT_ASSIGN(vapos, curr_pos); -} - -/* - * PRINTFLIKE comment - * - * Check all arguments until the (n-1)-th as usual. The n-th argument is - * used the check the types of remaining arguments. - */ -void -printflike(int n) -{ - - if (n == -1) - n = 0; - - if (dcs->d_ctx != EXTERN) { - /* must be outside function: ** %s ** */ - warning(280, "PRINTFLIKE"); - return; - } - if (prflstrg != -1) { - /* duplicate use of ** %s ** */ - warning(281, "PRINTFLIKE"); - } - prflstrg = n; - STRUCT_ASSIGN(prflpos, curr_pos); -} - -/* - * SCANFLIKE comment - * - * Check all arguments until the (n-1)-th as usual. The n-th argument is - * used the check the types of remaining arguments. - */ -void -scanflike(int n) -{ - - if (n == -1) - n = 0; - - if (dcs->d_ctx != EXTERN) { - /* must be outside function: ** %s ** */ - warning(280, "SCANFLIKE"); - return; - } - if (scflstrg != -1) { - /* duplicate use of ** %s ** */ - warning(281, "SCANFLIKE"); - } - scflstrg = n; - STRUCT_ASSIGN(scflpos, curr_pos); -} - -/* - * Set the linenumber for a CONSTCOND comment. At this and the following - * line no warnings about constants in conditional contexts are printed. - */ -/* ARGSUSED */ -void -constcond(int n) -{ - - ccflg = 1; -} - -/* - * Suppress printing of "fallthrough on ..." warnings until next - * statement. - */ -/* ARGSUSED */ -void -fallthru(int n) -{ - - ftflg = 1; -} - -/* - * Stop warnings about statements which cannot be reached. Also tells lint - * that the following statements cannot be reached (e.g. after exit()). - */ -/* ARGSUSED */ -void -notreach(int n) -{ - - reached = 0; - rchflg = 1; -} - -/* ARGSUSED */ -void -lintlib(int n) -{ - - if (dcs->d_ctx != EXTERN) { - /* must be outside function: ** %s ** */ - warning(280, "LINTLIBRARY"); - return; - } - llibflg = 1; - vflag = 0; -} - -/* - * Suppress most warnings at the current and the following line. - */ -/* ARGSUSED */ -void -linted(int n) -{ - -#ifdef DEBUG - printf("%s, %d: nowarn = 1\n", curr_pos.p_file, curr_pos.p_line); -#endif - nowarn = 1; -} - -/* - * Suppress bitfield type errors on the current line. - */ -/* ARGSUSED */ -void -bitfieldtype(int n) -{ - -#ifdef DEBUG - printf("%s, %d: bitfieldtype_ok = 1\n", curr_pos.p_file, - curr_pos.p_line); -#endif - bitfieldtype_ok = 1; -} - -/* - * PROTOTLIB in conjunction with LINTLIBRARY can be used to handle - * prototypes like function definitions. This is done if the argument - * to PROTOLIB is nonzero. Otherwise prototypes are handled normaly. - */ -void -protolib(int n) -{ - - if (dcs->d_ctx != EXTERN) { - /* must be outside function: ** %s ** */ - warning(280, "PROTOLIB"); - return; - } - plibflg = n == 0 ? 0 : 1; -} - -/* - * Set quadflg to nonzero which means that the next statement/declaration - * may use "long long" without an error or warning. - */ -/* ARGSUSED */ -void -longlong(int n) -{ - - quadflg = 1; -} diff --git a/usr.bin/xlint/lint1/init.c b/usr.bin/xlint/lint1/init.c deleted file mode 100644 index 9ac7a323a5fc..000000000000 --- a/usr.bin/xlint/lint1/init.c +++ /dev/null @@ -1,656 +0,0 @@ -/* $NetBSD: init.c,v 1.10 2002/01/31 19:36:54 tv Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.10 2002/01/31 19:36:54 tv Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include - -#include "lint1.h" - -/* - * initerr is set as soon as a fatal error occurred in an initialisation. - * The effect is that the rest of the initialisation is ignored (parsed - * by yacc, expression trees built, but no initialisation takes place). - */ -int initerr; - -/* Pointer to the symbol which is to be initialized. */ -sym_t *initsym; - -/* Points to the top element of the initialisation stack. */ -istk_t *initstk; - -typedef struct namlist { - const char *n_name; - struct namlist *n_prev; - struct namlist *n_next; -} namlist_t; - -/* Points to a c9x named member; */ -namlist_t *namedmem = NULL; - - -static void popi2(void); -static void popinit(int); -static void pushinit(void); -static void testinit(void); -static void nextinit(int); -static int strginit(tnode_t *); -static void memberpop(void); - -#ifndef DEBUG -#define DPRINTF(a) -#else -#define DPRINTF(a) printf a -#endif - -void -memberpush(sb) - sbuf_t *sb; -{ - namlist_t *nam = xcalloc(1, sizeof (namlist_t)); - nam->n_name = sb->sb_name; - DPRINTF(("memberpush = %s\n", nam->n_name)); - if (namedmem == NULL) { - nam->n_prev = nam->n_next = nam; - namedmem = nam; - } else { - namedmem->n_prev->n_next = nam; - nam->n_prev = namedmem->n_prev; - nam->n_next = namedmem; - namedmem->n_prev = nam; - } -#if 0 - nam->n_next = namedmem; - namedmem = nam; -#endif -} - -static void -memberpop() -{ - DPRINTF(("memberpop = %s\n", namedmem->n_name)); - if (namedmem->n_next == namedmem) { - free(namedmem); - namedmem = NULL; - } else { - namlist_t *nam = namedmem; - namedmem = namedmem->n_next; - free(nam); - } -#if 0 - namedmem = namedmem->n_next; - free(nam); -#endif -} - - -/* - * Initialize the initialisation stack by putting an entry for the variable - * which is to be initialized on it. - */ -void -prepinit(void) -{ - istk_t *istk; - - if (initerr) - return; - - /* free memory used in last initialisation */ - while ((istk = initstk) != NULL) { - initstk = istk->i_nxt; - free(istk); - } - - /* - * If the type which is to be initialized is an incomplete type, - * it must be duplicated. - */ - if (initsym->s_type->t_tspec == ARRAY && incompl(initsym->s_type)) - initsym->s_type = duptyp(initsym->s_type); - - istk = initstk = xcalloc(1, sizeof (istk_t)); - istk->i_subt = initsym->s_type; - istk->i_cnt = 1; - -} - -static void -popi2(void) -{ -#ifdef DEBUG - char buf[64]; -#endif - istk_t *istk; - sym_t *m; - - initstk = (istk = initstk)->i_nxt; - if (initstk == NULL) - LERROR("popi2()"); - free(istk); - - istk = initstk; - - istk->i_cnt--; - if (istk->i_cnt < 0) - LERROR("popi2()"); - - DPRINTF(("popi2(): %d %s\n", istk->i_cnt, - namedmem ? namedmem->n_name : "*null*")); - if (istk->i_cnt >= 0 && namedmem != NULL) { - DPRINTF(("popi2(): %d %s %s\n", istk->i_cnt, - tyname(buf, sizeof(buf), istk->i_type), namedmem->n_name)); - for (m = istk->i_type->t_str->memb; m != NULL; m = m->s_nxt) { - if (m->s_field && m->s_name == unnamed) - continue; - if (strcmp(m->s_name, namedmem->n_name) == 0) { - istk->i_subt = m->s_type; - istk->i_cnt++; - memberpop(); - return; - } - } - error(101, namedmem->n_name); - memberpop(); - istk->i_namedmem = 1; - return; - } - /* - * If the removed element was a structure member, we must go - * to the next structure member. - */ - if (istk->i_cnt > 0 && istk->i_type->t_tspec == STRUCT && - !istk->i_namedmem) { - do { - m = istk->i_mem = istk->i_mem->s_nxt; - if (m == NULL) - LERROR("popi2()"); - } while (m->s_field && m->s_name == unnamed); - istk->i_subt = m->s_type; - } -} - -static void -popinit(int brace) -{ - DPRINTF(("popinit(%d)\n", brace)); - - if (brace) { - /* - * Take all entries, including the first which requires - * a closing brace, from the stack. - */ - do { - brace = initstk->i_brace; - popi2(); - } while (!brace); - } else { - /* - * Take all entries which cannot be used for further - * initializers from the stack, but do this only if - * they do not require a closing brace. - */ - while (!initstk->i_brace && - initstk->i_cnt == 0 && !initstk->i_nolimit) { - popi2(); - } - } -} - -static void -pushinit(void) -{ -#ifdef DEBUG - char buf[64]; -#endif - istk_t *istk; - int cnt; - sym_t *m; - - istk = initstk; - - /* Extend an incomplete array type by one element */ - if (istk->i_cnt == 0) { - DPRINTF(("pushinit(extend) %s\n", tyname(buf, sizeof(buf), - istk->i_type))); - /* - * Inside of other aggregate types must not be an incomplete - * type. - */ - if (istk->i_nxt->i_nxt != NULL) - LERROR("pushinit()"); - istk->i_cnt = 1; - if (istk->i_type->t_tspec != ARRAY) - LERROR("pushinit()"); - istk->i_type->t_dim++; - /* from now its a complete type */ - setcompl(istk->i_type, 0); - } - - if (istk->i_cnt <= 0) - LERROR("pushinit()"); - if (istk->i_type != NULL && issclt(istk->i_type->t_tspec)) - LERROR("pushinit() 4"); - - initstk = xcalloc(1, sizeof (istk_t)); - initstk->i_nxt = istk; - initstk->i_type = istk->i_subt; - if (initstk->i_type->t_tspec == FUNC) - LERROR("pushinit()"); - -again: - istk = initstk; - - DPRINTF(("pushinit(%s)\n", tyname(buf, sizeof(buf), istk->i_type))); - switch (istk->i_type->t_tspec) { - case ARRAY: - if (namedmem) { - DPRINTF(("pushinit ARRAY %s\n", namedmem->n_name)); - free(istk); - initstk = initstk->i_nxt; - goto again; - } - if (incompl(istk->i_type) && istk->i_nxt->i_nxt != NULL) { - /* initialisation of an incomplete type */ - error(175); - initerr = 1; - return; - } - istk->i_subt = istk->i_type->t_subt; - istk->i_nolimit = incompl(istk->i_type); - istk->i_cnt = istk->i_type->t_dim; - DPRINTF(("elements array %s[%d] %s\n", - tyname(buf, sizeof(buf), istk->i_subt), istk->i_cnt, - namedmem ? namedmem->n_name : "*none*")); - break; - case UNION: - if (tflag) - /* initialisation of union is illegal in trad. C */ - warning(238); - /* FALLTHROUGH */ - case STRUCT: - if (incompl(istk->i_type)) { - /* initialisation of an incomplete type */ - error(175); - initerr = 1; - return; - } - cnt = 0; - DPRINTF(("2. member lookup %s %s\n", - tyname(buf, sizeof(buf), istk->i_type), - namedmem ? namedmem->n_name : "*none*")); - for (m = istk->i_type->t_str->memb; m != NULL; m = m->s_nxt) { - if (m->s_field && m->s_name == unnamed) - continue; - if (namedmem != NULL) { - DPRINTF(("pushinit():[member:%s, looking:%s]\n", - m->s_name, namedmem->n_name)); - if (strcmp(m->s_name, namedmem->n_name) == 0) { - cnt++; - break; - } else - continue; - } - if (++cnt == 1) { - istk->i_mem = m; - istk->i_subt = m->s_type; - } - } - if (namedmem != NULL) { - istk->i_namedmem = 1; - if (m == NULL) { - error(101, namedmem->n_name); - initerr = 1; - } else { - istk->i_mem = m; - istk->i_subt = m->s_type; - } - memberpop(); - cnt = istk->i_type->t_tspec == STRUCT ? 2 : 1; - } - if (cnt == 0) { - /* cannot init. struct/union with no named member */ - error(179); - initerr = 1; - return; - } - istk->i_cnt = istk->i_type->t_tspec == STRUCT ? cnt : 1; - break; - default: - if (namedmem) { - DPRINTF(("pushinit(): pop\n")); - free(istk); - initstk = initstk->i_nxt; - goto again; - } - istk->i_cnt = 1; - break; - } -} - -static void -testinit(void) -{ - istk_t *istk; - - istk = initstk; - - /* - * If a closing brace is expected we have at least one initializer - * too much. - */ - if (istk->i_cnt == 0 && !istk->i_nolimit && !istk->i_namedmem) { - switch (istk->i_type->t_tspec) { - case ARRAY: - /* too many array initializers */ - error(173); - break; - case STRUCT: - case UNION: - /* too many struct/union initializers */ - error(172); - break; - default: - /* too many initializers */ - error(174); - break; - } - initerr = 1; - } -} - -static void -nextinit(int brace) -{ - char buf[64]; - - DPRINTF(("nextinit(%d)\n", brace)); - if (!brace) { - if (initstk->i_type == NULL && - !issclt(initstk->i_subt->t_tspec)) { - /* {}-enclosed initializer required */ - error(181); - } - /* - * Make sure an entry with a scalar type is at the top - * of the stack. - */ - if (!initerr) - testinit(); - while (!initerr && (initstk->i_type == NULL || - !issclt(initstk->i_type->t_tspec))) { - if (!initerr) - pushinit(); - } - } else { - if (initstk->i_type != NULL && - issclt(initstk->i_type->t_tspec)) { - /* invalid initializer */ - error(176); - initerr = 1; - } - if (!initerr) - testinit(); - if (!initerr) - pushinit(); - if (!initerr) - initstk->i_brace = 1; - } -} - -void -initlbr(void) -{ - - if (initerr) - return; - - if ((initsym->s_scl == AUTO || initsym->s_scl == REG) && - initstk->i_nxt == NULL) { - if (tflag && !issclt(initstk->i_subt->t_tspec)) - /* no automatic aggregate initialization in trad. C*/ - warning(188); - } - - /* - * Remove all entries which cannot be used for further initializers - * and do not expect a closing brace. - */ - popinit(0); - - nextinit(1); -} - -void -initrbr(void) -{ - - if (initerr) - return; - - popinit(1); -} - -void -mkinit(tnode_t *tn) -{ - ptrdiff_t offs; - sym_t *sym; - tspec_t lt, rt; - tnode_t *ln; - struct mbl *tmem; - scl_t sc; -#ifdef DEBUG - char buf[64]; -#endif - - DPRINTF(("mkinit(%s)\n", tyname(buf, sizeof(buf), tn->tn_type))); - if (initerr || tn == NULL) - goto end; - - sc = initsym->s_scl; - - /* - * Do not test for automatic aggregate initialisation. If the - * initializer starts with a brace we have the warning already. - * If not, an error will be printed that the initializer must - * be enclosed by braces. - */ - - /* - * Local initialisation of non-array-types with only one expression - * without braces is done by ASSIGN - */ - if ((sc == AUTO || sc == REG) && - initsym->s_type->t_tspec != ARRAY && initstk->i_nxt == NULL) { - ln = getnnode(initsym, 0); - ln->tn_type = tduptyp(ln->tn_type); - ln->tn_type->t_const = 0; - tn = build(ASSIGN, ln, tn); - expr(tn, 0, 0, 1); - goto end; - } - - /* - * Remove all entries which cannot be used for further initializers - * and do not require a closing brace. - */ - popinit(0); - - /* Initialisations by strings are done in strginit(). */ - if (strginit(tn)) - goto end; - - nextinit(0); - if (initerr || tn == NULL) - goto end; - - initstk->i_cnt--; - DPRINTF(("mkinit() cnt=%d tn=%p\n", initstk->i_cnt, tn)); - /* Create a temporary node for the left side. */ - ln = tgetblk(sizeof (tnode_t)); - ln->tn_op = NAME; - ln->tn_type = tduptyp(initstk->i_type); - ln->tn_type->t_const = 0; - ln->tn_lvalue = 1; - ln->tn_sym = initsym; /* better than nothing */ - - tn = cconv(tn); - - lt = ln->tn_type->t_tspec; - rt = tn->tn_type->t_tspec; - - if (!issclt(lt)) - LERROR("mkinit()"); - - if (!typeok(INIT, 0, ln, tn)) - goto end; - - /* - * Store the tree memory. This is necessary because otherwise - * expr() would free it. - */ - tmem = tsave(); - expr(tn, 1, 0, 1); - trestor(tmem); - - if (isityp(lt) && ln->tn_type->t_isfield && !isityp(rt)) { - /* - * Bit-fields can be initialized in trad. C only by integer - * constants. - */ - if (tflag) - /* bit-field initialisation is illegal in trad. C */ - warning(186); - } - - if (lt != rt || (initstk->i_type->t_isfield && tn->tn_op == CON)) - tn = convert(INIT, 0, initstk->i_type, tn); - - if (tn != NULL && tn->tn_op != CON) { - sym = NULL; - offs = 0; - if (conaddr(tn, &sym, &offs) == -1) { - if (sc == AUTO || sc == REG) { - /* non-constant initializer */ - (void)gnuism(177); - } else { - /* non-constant initializer */ - error(177); - } - } - } - - end: - /* - * We only free the block, if we are not a compound declaration - * We know that the only symbols that start with a digit are the - * ones we allocate with mktempsym() for compound declarations - */ - if (!isdigit((unsigned char)initsym->s_name[0])) - tfreeblk(); -} - - -static int -strginit(tnode_t *tn) -{ - tspec_t t; - istk_t *istk; - int len; - strg_t *strg; - - if (tn->tn_op != STRING) - return (0); - - istk = initstk; - strg = tn->tn_strg; - - /* - * Check if we have an array type which can be initialized by - * the string. - */ - if (istk->i_subt != NULL && istk->i_subt->t_tspec == ARRAY) { - t = istk->i_subt->t_subt->t_tspec; - if (!((strg->st_tspec == CHAR && - (t == CHAR || t == UCHAR || t == SCHAR)) || - (strg->st_tspec == WCHAR && t == WCHAR))) { - return (0); - } - /* Put the array at top of stack */ - pushinit(); - istk = initstk; - } else if (istk->i_type != NULL && istk->i_type->t_tspec == ARRAY) { - t = istk->i_type->t_subt->t_tspec; - if (!((strg->st_tspec == CHAR && - (t == CHAR || t == UCHAR || t == SCHAR)) || - (strg->st_tspec == WCHAR && t == WCHAR))) { - return (0); - } - /* - * If the array is already partly initialized, we are - * wrong here. - */ - if (istk->i_cnt != istk->i_type->t_dim) - return (0); - } else { - return (0); - } - - /* Get length without trailing NUL character. */ - len = strg->st_len; - - if (istk->i_nolimit) { - istk->i_nolimit = 0; - istk->i_type->t_dim = len + 1; - /* from now complete type */ - setcompl(istk->i_type, 0); - } else { - if (istk->i_type->t_dim < len) { - /* non-null byte ignored in string initializer */ - warning(187); - } - } - - /* In every case the array is initialized completely. */ - istk->i_cnt = 0; - - return (1); -} diff --git a/usr.bin/xlint/lint1/lint.h b/usr.bin/xlint/lint1/lint.h deleted file mode 100644 index 7888b4cf4421..000000000000 --- a/usr.bin/xlint/lint1/lint.h +++ /dev/null @@ -1,120 +0,0 @@ -/* $NetBSD: lint.h,v 1.2 1995/07/03 21:24:18 cgd Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include -#include -#include - -#include "param.h" - -/* - * Type specifiers, used in type structures (type_t) and otherwere. - */ -typedef enum { - NOTSPEC, - SIGNED, /* keyword "signed", only used in the parser */ - UNSIGN, /* keyword "unsigned", only used in the parser */ - CHAR, /* char */ - SCHAR, /* signed char */ - UCHAR, /* unsigned char */ - SHORT, /* (signed) short */ - USHORT, /* unsigned short */ - INT, /* (signed) int */ - UINT, /* unsigned int */ - LONG, /* (signed) long */ - ULONG, /* unsigned long */ - QUAD, /* (signed) long long */ - UQUAD, /* unsigned long long */ - FLOAT, /* float */ - DOUBLE, /* double or, with tflag, long float */ - LDOUBLE, /* long double */ - VOID, /* void */ - STRUCT, /* structure tag */ - UNION, /* union tag */ - ENUM, /* enum tag */ - PTR, /* pointer */ - ARRAY, /* array */ - FUNC /* function */ -#define NTSPEC ((int)FUNC + 1) -} tspec_t; - -/* - * size of types, name and classification - */ -typedef struct { - int tt_sz; /* size in bits */ - int tt_psz; /* size, different from tt_sz - if pflag is set */ - tspec_t tt_styp; /* signed counterpart */ - tspec_t tt_utyp; /* unsigned counterpart */ - u_int tt_isityp : 1; /* 1 if integer type */ - u_int tt_isutyp : 1; /* 1 if unsigned integer type */ - u_int tt_isftyp : 1; /* 1 if floating point type */ - u_int tt_isatyp : 1; /* 1 if arithmetic type */ - u_int tt_issclt : 1; /* 1 if scalar type */ - char *tt_name; /* type name */ -} ttab_t; - -#define size(t) (ttab[t].tt_sz) -#define psize(t) (ttab[t].tt_psz) -#define styp(t) (ttab[t].tt_styp) -#define utyp(t) (ttab[t].tt_utyp) -#define isityp(t) (ttab[t].tt_isityp) -#define isutyp(t) (ttab[t].tt_isutyp) -#define isftyp(t) (ttab[t].tt_isftyp) -#define isatyp(t) (ttab[t].tt_isatyp) -#define issclt(t) (ttab[t].tt_issclt) - -extern ttab_t ttab[]; - - -typedef enum { - NODECL, /* until now not declared */ - DECL, /* declared */ - TDEF, /* tentative defined */ - DEF /* defined */ -} def_t; - -/* - * Following structure contains some data used for the output buffer. - */ -typedef struct ob { - char *o_buf; /* buffer */ - char *o_end; /* first byte after buffer */ - size_t o_len; /* length of buffer */ - char *o_nxt; /* next free byte in buffer */ -} ob_t; - -#include "externs.h" diff --git a/usr.bin/xlint/lint1/lint1.h b/usr.bin/xlint/lint1/lint1.h deleted file mode 100644 index da40d3aaf198..000000000000 --- a/usr.bin/xlint/lint1/lint1.h +++ /dev/null @@ -1,424 +0,0 @@ -/* $NetBSD: lint1.h,v 1.16 2002/10/21 22:44:08 christos Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#include -__FBSDID("$FreeBSD$"); - -#include "lint.h" -#include "op.h" - -/* XXX - works for most systems, but the whole ALIGN thing needs to go away */ -#ifndef LINT_ALIGN -#define LINT_ALIGN(x) (((x) + 15) & ~15) -#endif - -/* - * Describes the position of a declaration or anything else. - */ -typedef struct { - int p_line; - const char *p_file; - int p_uniq; /* uniquifier */ -} pos_t; - -/* Copies curr_pos, keeping things unique. */ -#define UNIQUE_CURR_POS(pos) \ - do { \ - STRUCT_ASSIGN((pos), curr_pos); \ - curr_pos.p_uniq++; \ - if (curr_pos.p_file == csrc_pos.p_file) \ - csrc_pos.p_uniq++; \ - } while (0) - -/* - * Strings cannot be referenced to simply by a pointer to its first - * char. This is because strings can contain NUL characters other than the - * trailing NUL. - * - * Strings are stored with a trailing NUL. - */ -typedef struct strg { - tspec_t st_tspec; /* CHAR or WCHAR */ - size_t st_len; /* length without trailing NUL */ - union { - u_char *_st_cp; - wchar_t *_st_wcp; - } st_u; -} strg_t; - -#define st_cp st_u._st_cp -#define st_wcp st_u._st_wcp - -/* - * qualifiers (only for lex/yacc interface) - */ -typedef enum { - CONST, VOLATILE -} tqual_t; - -/* - * Integer and floating point values are stored in this structure - */ -typedef struct { - tspec_t v_tspec; - int v_ansiu; /* set if an integer constant is - unsigned in ANSI C */ - union { - int64_t _v_quad; /* integers */ - ldbl_t _v_ldbl; /* floats */ - } v_u; -} val_t; - -#define v_quad v_u._v_quad -#define v_ldbl v_u._v_ldbl - -/* - * Structures of type str_t uniqely identify structures. This can't - * be done in structures of type type_t, because these are copied - * if they must be modified. So it would not be possible to check - * if two structures are identical by comparing the pointers to - * the type structures. - * - * The typename is used if the structure is unnamed to identify - * the structure type in pass 2. - */ -typedef struct { - u_int size; /* size in bit */ - u_int align : 15; /* alignment in bit */ - u_int sincompl : 1; /* set if incomplete type */ - struct sym *memb; /* list of members */ - struct sym *stag; /* symbol table entry of tag */ - struct sym *stdef; /* symbol table entry of first typename */ -} str_t; - -/* - * same as above for enums - */ -typedef struct { - u_int eincompl : 1; /* incomplete enum type */ - struct sym *elem; /* list of enumerators */ - struct sym *etag; /* symbol table entry of tag */ - struct sym *etdef; /* symbol table entry of first typename */ -} enum_t; - -/* - * Types are represented by concatenation of structures of type type_t - * via t_subt. - */ -typedef struct type { - tspec_t t_tspec; /* type specifier */ - u_int t_aincompl : 1; /* incomplete array type */ - u_int t_const : 1; /* const modifier */ - u_int t_volatile : 1; /* volatile modifier */ - u_int t_proto : 1; /* function prototype (t_args valid) */ - u_int t_vararg : 1; /* prototype with ... */ - u_int t_typedef : 1; /* type defined with typedef */ - u_int t_isfield : 1; /* type is bitfield */ - u_int t_isenum : 1; /* type is (or was) enum (t_enum valid) */ - union { - int _t_dim; /* dimension */ - str_t *_t_str; /* struct/union tag */ - enum_t *_t_enum; /* enum tag */ - struct sym *_t_args; /* arguments (if t_proto) */ - } t_u; - struct { - u_int _t_flen : 8; /* length of bit-field */ - u_int _t_foffs : 24; /* offset of bit-field */ - } t_b; - struct type *t_subt; /* element type (arrays), return value - (functions), or type pointer points to */ -} type_t; - -#define t_dim t_u._t_dim -#define t_str t_u._t_str -#define t_field t_u._t_field -#define t_enum t_u._t_enum -#define t_args t_u._t_args -#define t_flen t_b._t_flen -#define t_foffs t_b._t_foffs - -/* - * types of symbols - */ -typedef enum { - FVFT, /* variables, functions, type names, enums */ - FMOS, /* members of structs or unions */ - FTAG, /* tags */ - FLAB /* labels */ -} symt_t; - -/* - * storage classes - */ -typedef enum { - NOSCL, - EXTERN, /* external symbols (indep. of decl_t) */ - STATIC, /* static symbols (local and global) */ - AUTO, /* automatic symbols (except register) */ - REG, /* register */ - TYPEDEF, /* typedef */ - STRTAG, - UNIONTAG, - ENUMTAG, - MOS, /* member of struct */ - MOU, /* member of union */ - ENUMCON, /* enumerator */ - ABSTRACT, /* abstract symbol (sizeof, casts, unnamed argument) */ - ARG, /* argument */ - PARG, /* used in declaration stack during prototype - declaration */ - INLINE /* only used by the parser */ -} scl_t; - -/* - * symbol table entry - */ -typedef struct sym { - const char *s_name; /* name */ - const char *s_rename; /* renamed symbol's given name */ - pos_t s_dpos; /* position of last (prototype)definition, - prototypedeclaration, no-prototype-def., - tentative definition or declaration, - in this order */ - pos_t s_spos; /* position of first initialisation */ - pos_t s_upos; /* position of first use */ - symt_t s_kind; /* type of symbol */ - u_int s_keyw : 1; /* keyword */ - u_int s_field : 1; /* bit-field */ - u_int s_set : 1; /* variable set, label defined */ - u_int s_used : 1; /* variable/label used */ - u_int s_arg : 1; /* symbol is function argument */ - u_int s_reg : 1; /* symbol is register variable */ - u_int s_defarg : 1; /* undefined symbol in old style function - definition */ - u_int s_rimpl : 1; /* return value of function implicit decl. */ - u_int s_osdef : 1; /* symbol stems from old style function def. */ - u_int s_inline : 1; /* true if this is an inline function */ - struct sym *s_xsym; /* for local declared external symbols pointer - to external symbol with same name */ - def_t s_def; /* declared, tentative defined, defined */ - scl_t s_scl; /* storage class */ - int s_blklev; /* level of declaration, -1 if not in symbol - table */ - type_t *s_type; /* type */ - val_t s_value; /* value (if enumcon) */ - union { - str_t *_s_st; /* tag, if it is a struct/union member */ - enum_t *_s_et; /* tag, if it is an enumerator */ - tspec_t _s_tsp; /* type (only for keywords) */ - tqual_t _s_tqu; /* qualifier (only for keywords) */ - struct sym *_s_args; /* arguments in old style function - definitions */ - } u; - struct sym *s_link; /* next symbol with same hash value */ - struct sym **s_rlink; /* pointer to s_link of prev. symbol */ - struct sym *s_nxt; /* next struct/union member, enumerator, - argument */ - struct sym *s_dlnxt; /* next symbol declared on same level */ -} sym_t; - -#define s_styp u._s_st -#define s_etyp u._s_et -#define s_tspec u._s_tsp -#define s_tqual u._s_tqu -#define s_args u._s_args - -/* - * Used to keep some informations about symbols before they are entered - * into the symbol table. - */ -typedef struct sbuf { - const char *sb_name; /* name of symbol */ - size_t sb_len; /* length (without '\0') */ - int sb_hash; /* hash value */ - sym_t *sb_sym; /* symbol table entry */ - struct sbuf *sb_nxt; /* for freelist */ -} sbuf_t; - - -/* - * tree node - */ -typedef struct tnode { - op_t tn_op; /* operator */ - type_t *tn_type; /* type */ - u_int tn_lvalue : 1; /* node is lvalue */ - u_int tn_cast : 1; /* if tn_op == CVT its an explicit cast */ - u_int tn_parn : 1; /* node parenthesized */ - union { - struct { - struct tnode *_tn_left; /* (left) operand */ - struct tnode *_tn_right; /* right operand */ - } tn_s; - sym_t *_tn_sym; /* symbol if op == NAME */ - val_t *_tn_val; /* value if op == CON */ - strg_t *_tn_strg; /* string if op == STRING */ - } tn_u; -} tnode_t; - -#define tn_left tn_u.tn_s._tn_left -#define tn_right tn_u.tn_s._tn_right -#define tn_sym tn_u._tn_sym -#define tn_val tn_u._tn_val -#define tn_strg tn_u._tn_strg - -/* - * For nested declarations a stack exists, which holds all information - * needed for the current level. dcs points to the top element of this - * stack. - * - * ctx describes the context of the current declaration. Its value is - * one of - * EXTERN global declarations - * MOS oder MOU declarations of struct or union members - * ENUMCON declarations of enums - * ARG declaration of arguments in old style function definitions - * PARG declaration of arguments in function prototypes - * AUTO declaration of local symbols - * ABSTRACT abstract declarations (sizeof, casts) - * - */ -typedef struct dinfo { - tspec_t d_atyp; /* VOID, CHAR, INT, FLOAT or DOUBLE */ - tspec_t d_smod; /* SIGNED or UNSIGN */ - tspec_t d_lmod; /* SHORT, LONG or QUAD */ - scl_t d_scl; /* storage class */ - type_t *d_type; /* after deftyp() pointer to the type used - for all declarators */ - sym_t *d_rdcsym; /* redeclared symbol */ - int d_offset; /* offset of next structure member */ - int d_stralign; /* alignment required for current structure */ - scl_t d_ctx; /* context of declaration */ - u_int d_const : 1; /* const in declaration specifiers */ - u_int d_volatile : 1; /* volatile in declaration specifiers */ - u_int d_inline : 1; /* inline in declaration specifiers */ - u_int d_mscl : 1; /* multiple storage classes */ - u_int d_terr : 1; /* invalid type combination */ - u_int d_nedecl : 1; /* 1 if at least a tag is declared */ - u_int d_vararg : 1; /* ... in current function decl. */ - u_int d_proto : 1; /* current funct. decl. is prototype */ - u_int d_notyp : 1; /* set if no type specifier was present */ - u_int d_asm : 1; /* set if d_ctx == AUTO and asm() present */ - type_t *d_tagtyp; /* tag during member declaration */ - sym_t *d_fargs; /* list of arguments during function def. */ - pos_t d_fdpos; /* position of function definition */ - sym_t *d_dlsyms; /* first symbol declared at this level */ - sym_t **d_ldlsym; /* points to s_dlnxt in last symbol decl. - at this level */ - sym_t *d_fpsyms; /* symbols defined in prototype */ - struct dinfo *d_nxt; /* next level */ -} dinfo_t; - -/* - * Type of stack which is used for initialisation of aggregate types. - */ -typedef struct istk { - type_t *i_type; /* type of initialisation */ - type_t *i_subt; /* type of next level */ - u_int i_brace : 1; /* need } for pop */ - u_int i_nolimit : 1; /* incomplete array type */ - u_int i_namedmem : 1; /* has c9x named members */ - sym_t *i_mem; /* next structure member */ - int i_cnt; /* # of remaining elements */ - struct istk *i_nxt; /* previous level */ -} istk_t; - -/* - * Used to collect information about pointers and qualifiers in - * declarators. - */ -typedef struct pqinf { - int p_pcnt; /* number of asterisks */ - u_int p_const : 1; - u_int p_volatile : 1; - struct pqinf *p_nxt; -} pqinf_t; - -/* - * Case values are stored in a list of type clst_t. - */ -typedef struct clst { - val_t cl_val; - struct clst *cl_nxt; -} clst_t; - -/* - * Used to keep informations about nested control statements. - */ -typedef struct cstk { - int c_env; /* type of statement (T_IF, ...) */ - u_int c_loop : 1; /* continue && break are valid */ - u_int c_switch : 1; /* case && break are valid */ - u_int c_break : 1; /* loop/switch has break */ - u_int c_cont : 1; /* loop has continue */ - u_int c_default : 1; /* switch has default */ - u_int c_infinite : 1; /* break condition always false - (for (;;), while (1)) */ - u_int c_rchif : 1; /* end of if-branch reached */ - u_int c_noretval : 1; /* had "return;" */ - u_int c_retval : 1; /* had "return (e);" */ - type_t *c_swtype; /* type of switch expression */ - clst_t *c_clst; /* list of case values */ - struct mbl *c_fexprm; /* saved memory for end of loop - expression in for() */ - tnode_t *c_f3expr; /* end of loop expr in for() */ - pos_t c_fpos; /* position of end of loop expr */ - pos_t c_cfpos; /* same for csrc_pos */ - struct cstk *c_nxt; /* outer control statement */ -} cstk_t; - -typedef struct { - size_t lo; - size_t hi; -} range_t; - -#include "externs1.h" - -#define ERR_SETSIZE 1024 -#define __NERRBITS (sizeof(unsigned int)) - -typedef struct err_set { - unsigned int errs_bits[(ERR_SETSIZE + __NERRBITS-1) / __NERRBITS]; -} err_set; - -#define ERR_SET(n, p) \ - ((p)->errs_bits[(n)/__NERRBITS] |= (1 << ((n) % __NERRBITS))) -#define ERR_CLR(n, p) \ - ((p)->errs_bits[(n)/__NERRBITS] &= ~(1 << ((n) % __NERRBITS))) -#define ERR_ISSET(n, p) \ - ((p)->errs_bits[(n)/__NERRBITS] & (1 << ((n) % __NERRBITS))) -#define ERR_ZERO(p) (void)memset((p), 0, sizeof(*(p))) - -#define LERROR(fmt, args...) lerror(__FILE__, __LINE__, fmt, ##args) - -extern err_set msgset; diff --git a/usr.bin/xlint/lint1/main1.c b/usr.bin/xlint/lint1/main1.c deleted file mode 100644 index 59f6c7f99b40..000000000000 --- a/usr.bin/xlint/lint1/main1.c +++ /dev/null @@ -1,230 +0,0 @@ -/* $NetBSD: main1.c,v 1.17 2006/11/08 18:31:15 christos Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: main1.c,v 1.17 2006/11/08 18:31:15 christos Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "lint1.h" - -/* set yydebug to 1*/ -int yflag; - -/* - * Print warnings if an assignment of an integertype to another integertype - * causes an implicit narrowing conversion. If aflag is 1, these warnings - * are printed only if the source type is at least as wide as long. If aflag - * is greater than 1, they are always printed. - */ -int aflag; - -/* Print a warning if a break statement cannot be reached. */ -int bflag; - -/* Print warnings for pointer casts. */ -int cflag; - -/* Print various debug information. */ -int dflag; - -/* Perform stricter checking of enum types and operations on enum types. */ -int eflag; - -/* Print complete pathnames, not only the basename. */ -int Fflag; - -/* Enable some extensions of gcc */ -int gflag; - -/* Treat warnings as errors */ -int wflag; - -/* - * Apply a number of heuristic tests to attempt to intuit bugs, improve - * style, and reduce waste. - */ -int hflag; - -/* Attempt to check portability to other dialects of C. */ -int pflag; - -/* - * In case of redeclarations/redefinitions print the location of the - * previous declaration/definition. - */ -int rflag; - -/* Strict ANSI C mode. */ -int sflag; - -/* Traditional C mode. */ -int tflag; - -/* Enable C9X extensions */ -int Sflag; -/* - * Complain about functions and external variables used and not defined, - * or defined and not used. - */ -int uflag = 1; - -/* Complain about unused function arguments. */ -int vflag = 1; - -/* Complain about structures which are never defined. */ -int zflag = 1; - -err_set msgset; - -static void usage(void); - -int main(int, char *[]); - -int -main(int argc, char *argv[]) -{ - int c; - char *ptr; - - ERR_ZERO(&msgset); - while ((c = getopt(argc, argv, "abcdeghmprstuvwyzFSX:")) != -1) { - switch (c) { - case 'a': aflag++; break; - case 'b': bflag = 1; break; - case 'c': cflag = 1; break; - case 'd': dflag = 1; break; - case 'e': eflag = 1; break; - case 'F': Fflag = 1; break; - case 'g': gflag = 1; break; - case 'h': hflag = 1; break; - case 'p': pflag = 1; break; - case 'r': rflag = 1; break; - case 's': sflag = 1; break; - case 'S': Sflag = 1; break; - case 't': tflag = 1; break; - case 'u': uflag = 0; break; - case 'w': wflag = 1; break; - case 'v': vflag = 0; break; - case 'y': yflag = 1; break; - case 'z': zflag = 0; break; - - case 'm': - msglist(); - return(0); - - case 'X': - for (ptr = strtok(optarg, ","); ptr; - ptr = strtok(NULL, ",")) { - char *eptr; - long msg; - - errno = 0; - msg = strtol(ptr, &eptr, 0); - if ((msg == LONG_MIN || msg == LONG_MAX) && - errno == ERANGE) - err(1, "invalid error message id '%s'", - ptr); - if (*eptr || ptr == eptr || msg < 0 || - msg >= ERR_SETSIZE) - errx(1, "invalid error message id '%s'", - ptr); - ERR_SET(msg, &msgset); - } - break; - case '?': - default: - usage(); - break; - } - } - argc -= optind; - argv += optind; - - if (argc != 2) - usage(); - - /* open the input file */ - if ((yyin = fopen(argv[0], "r")) == NULL) - err(1, "cannot open '%s'", argv[0]); - - /* initialize output */ - outopen(argv[1]); - - if (yflag) - yydebug = 1; - - initmem(); - initdecl(); - initscan(); - initmtab(); - - yyparse(); - - /* Following warnings cannot be suppressed by LINTED */ - nowarn = 0; -#ifdef DEBUG - printf("%s, %d: nowarn = 0\n", curr_pos.p_file, curr_pos.p_line); -#endif - chkglsyms(); - - outclose(); - - return (nerr != 0); -} - -static void -usage(void) -{ - (void)fprintf(stderr, - "usage: lint1 [-abcdeghmprstuvwyzFS] [-X [,]... src dest\n"); - exit(1); -} - -void -norecover(void) -{ - /* cannot recover from previous errors */ - error(224); - exit(1); -} diff --git a/usr.bin/xlint/lint1/makeman b/usr.bin/xlint/lint1/makeman deleted file mode 100644 index 922fe5a13ea0..000000000000 --- a/usr.bin/xlint/lint1/makeman +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# $NetBSD$ -# -# Copyright (c) 2000 The NetBSD Foundation, Inc. -# All rights reserved. -# -# This code is derived from software contributed to The NetBSD Foundation -# by Christos Zoulas. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. - - -cat << \__EOF -.\" $NetBSD$ -.\" -.\" Copyright (c) 2000 The NetBSD Foundation, Inc. -.\" All rights reserved. -.\" -.\" This code is derived from software contributed to The NetBSD Foundation -.\" by Christos Zoulas. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -.\" POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd July 5, 2000 -.Dt LINT 7 -.Os -.Sh NAME -.Nm lint -.Nd Lint error message list -.Sh DESCRIPTION -The following is a list of message IDs and messages produced by -.Xr lint 1 . -It is intended to be used with -.Fl X -flag of -.Xr lint 1 . -.Bl -column -offset indent "XXXX" -__EOF -"$@" | sed -e 's/\\/\\e/g' -e "s/'/\\'/" -echo ".El" diff --git a/usr.bin/xlint/lint1/mem1.c b/usr.bin/xlint/lint1/mem1.c deleted file mode 100644 index 3edc6db10fbc..000000000000 --- a/usr.bin/xlint/lint1/mem1.c +++ /dev/null @@ -1,365 +0,0 @@ -/* $NetBSD: mem1.c,v 1.7 2002/01/31 19:36:54 tv Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: mem1.c,v 1.7 2002/01/31 19:36:54 tv Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include - -#include "lint1.h" - -/* - * Filenames allocated by fnalloc() and fnnalloc() are shared. - */ -typedef struct fn { - char *fn_name; - size_t fn_len; - int fn_id; - struct fn *fn_nxt; -} fn_t; - -static fn_t *fnames; - -static fn_t *srchfn(const char *, size_t); - -/* - * Look for a Filename of length l. - */ -static fn_t * -srchfn(const char *s, size_t len) -{ - fn_t *fn; - - for (fn = fnames; fn != NULL; fn = fn->fn_nxt) { - if (fn->fn_len == len && memcmp(fn->fn_name, s, len) == 0) - break; - } - return (fn); -} - -/* - * Return a shared string for filename s. - */ -const char * -fnalloc(const char *s) -{ - - return (s != NULL ? fnnalloc(s, strlen(s)) : NULL); -} - -const char * -fnnalloc(const char *s, size_t len) -{ - fn_t *fn; - - static int nxt_id = 0; - - if (s == NULL) - return (NULL); - - if ((fn = srchfn(s, len)) == NULL) { - if ((fn = malloc(sizeof (fn_t))) == NULL) - nomem(); - /* Do not used strdup() because string is not NUL-terminated.*/ - if ((fn->fn_name = malloc(len + 1)) == NULL) - nomem(); - (void)memcpy(fn->fn_name, s, len); - fn->fn_name[len] = '\0'; - fn->fn_len = len; - fn->fn_id = nxt_id++; - fn->fn_nxt = fnames; - fnames = fn; - /* Write id of this filename to the output file. */ - outclr(); - outint(fn->fn_id); - outchar('s'); - outstrg(fn->fn_name); - } - return (fn->fn_name); -} - -/* - * Get id of a filename. - */ -int -getfnid(const char *s) -{ - fn_t *fn; - - if (s == NULL || (fn = srchfn(s, strlen(s))) == NULL) - return (-1); - return (fn->fn_id); -} - -/* - * Memory for declarations and other things which must be available - * until the end of a block (or the end of the translation unit) - * are associated with the level (mblklev) of the block (or with 0). - * Because these memory is allocated in large blocks associated with - * a given level it can be freed easily at the end of a block. - */ -#define ML_INC ((size_t)32) /* Increment for length of *mblks */ - -typedef struct mbl { - void *blk; /* beginning of memory block */ - void *ffree; /* first free byte */ - size_t nfree; /* # of free bytes */ - size_t size; /* total size of memory block */ - struct mbl *nxt; /* next block */ -} mbl_t; - -/* - * Array of pointers to lists of memory blocks. mblklev is used as - * index into this array. - */ -static mbl_t **mblks; - -/* number of elements in *mblks */ -static size_t nmblks; - -/* free list for memory blocks */ -static mbl_t *frmblks; - -/* length of new allocated memory blocks */ -static size_t mblklen; - -static void *xgetblk(mbl_t **, size_t); -static void xfreeblk(mbl_t **); -static mbl_t *xnewblk(void); - -static mbl_t * -xnewblk(void) -{ - mbl_t *mb; - int prot, flags; - - if ((mb = malloc(sizeof (mbl_t))) == NULL) - nomem(); - - /* use mmap instead of malloc to avoid malloc's size overhead */ - - prot = PROT_READ | PROT_WRITE; - flags = MAP_ANON | MAP_PRIVATE; - mb->blk = mmap(NULL, mblklen, prot, flags, -1, (off_t)0); - if (mb->blk == (void *)MAP_FAILED) - err(1, "can't map memory"); - - mb->size = mblklen; - - return (mb); -} - -/* - * Allocate new memory. If the first block of the list has not enough - * free space, or there is no first block, get a new block. The new - * block is taken from the free list or, if there is no block on the - * free list, is allocated using xnewblk(). If a new block is allocated - * it is initialized with zero. Blocks taken from the free list are - * zero'd in xfreeblk(). - */ -static void * -xgetblk(mbl_t **mbp, size_t s) -{ - mbl_t *mb; - void *p; - size_t t = 0; - - s = LINT_ALIGN(s); - if ((mb = *mbp) == NULL || mb->nfree < s) { - if ((mb = frmblks) == NULL) { - if (s > mblklen) { - t = mblklen; - mblklen = s; - } - mb = xnewblk(); - if (t) - mblklen = t; - (void)memset(mb->blk, 0, mb->size); - } else { - frmblks = mb->nxt; - } - mb->ffree = mb->blk; - mb->nfree = mb->size; - mb->nxt = *mbp; - *mbp = mb; - } - p = mb->ffree; - mb->ffree = (char *)mb->ffree + s; - mb->nfree -= s; - return (p); -} - -/* - * Move all blocks from list *fmbp to free list. For each block, set all - * used memory to zero. - */ -static void -xfreeblk(mbl_t **fmbp) -{ - mbl_t *mb; - - while ((mb = *fmbp) != NULL) { - *fmbp = mb->nxt; - mb->nxt = frmblks; - frmblks = mb; - (void)memset(mb->blk, 0, mb->size - mb->nfree); - } -} - -void -initmem(void) -{ - int pgsz; - - pgsz = getpagesize(); - mblklen = ((MBLKSIZ + pgsz - 1) / pgsz) * pgsz; - - if ((mblks = calloc(nmblks = ML_INC, sizeof (mbl_t *))) == NULL) - nomem(); -} - - -/* - * Allocate memory associated with level l. - */ -void * -getlblk(int l, size_t s) -{ - - while (l >= nmblks) { - if ((mblks = realloc(mblks, (nmblks + ML_INC) * - sizeof (mbl_t *))) == NULL) - nomem(); - (void)memset(&mblks[nmblks], 0, ML_INC * sizeof (mbl_t *)); - nmblks += ML_INC; - } - return (xgetblk(&mblks[l], s)); -} - -void * -getblk(size_t s) -{ - - return (getlblk(mblklev, s)); -} - -/* - * Free all memory associated with level l. - */ -void -freelblk(int l) -{ - - xfreeblk(&mblks[l]); -} - -void -freeblk(void) -{ - - freelblk(mblklev); -} - -/* - * tgetblk() returns memory which is associated with the current - * expression. - */ -static mbl_t *tmblk; - -void * -tgetblk(size_t s) -{ - - return (xgetblk(&tmblk, s)); -} - -/* - * Get memory for a new tree node. - */ -tnode_t * -getnode(void) -{ - - return (tgetblk(sizeof (tnode_t))); -} - -/* - * Free all memory which is allocated by the current expression. - */ -void -tfreeblk(void) -{ - - xfreeblk(&tmblk); -} - -/* - * Save the memory which is used by the current expression. This memory - * is not freed by the next tfreeblk() call. The pointer returned can be - * used to restore the memory. - */ -mbl_t * -tsave(void) -{ - mbl_t *tmem; - - tmem = tmblk; - tmblk = NULL; - return (tmem); -} - -/* - * Free all memory used for the current expression and the memory used - * be a previous expression and saved by tsave(). The next call to - * tfreeblk() frees the restored memory. - */ -void -trestor(mbl_t *tmem) -{ - - tfreeblk(); - if (tmblk != NULL) { - free(tmblk->blk); - free(tmblk); - } - tmblk = tmem; -} diff --git a/usr.bin/xlint/lint1/op.h b/usr.bin/xlint/lint1/op.h deleted file mode 100644 index 042195a539e8..000000000000 --- a/usr.bin/xlint/lint1/op.h +++ /dev/null @@ -1,120 +0,0 @@ -/* $NetBSD: op.h,v 1.2 1995/07/03 21:24:27 cgd Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Various information about operators - */ -typedef struct { - u_int m_binary : 1; /* binary op. */ - u_int m_logop : 1; /* logical op., result is int */ - u_int m_rqint : 1; /* operands must have integer type */ - u_int m_rqsclt : 1; /* operands must have scalar type */ - u_int m_rqatyp : 1; /* operands must have arithmetic type */ - u_int m_fold : 1; /* operands should be folded */ - u_int m_vctx : 1; /* value context for left operand */ - u_int m_tctx : 1; /* test context for left operand */ - u_int m_balance : 1; /* op. requires balancing */ - u_int m_sideeff : 1; /* op. has side effect */ - u_int m_tlansiu : 1; /* warning if left op. is unsign. in ANSI C */ - u_int m_transiu : 1; /* warning if right op. is unsign. in ANSI C */ - u_int m_tpconf : 1; /* test possible precedence confusion */ - u_int m_comp : 1; /* op. performs comparison */ - u_int m_enumop : 1; /* valid operation on enums */ - u_int m_badeop : 1; /* dubious operation on enums */ - u_int m_eqwarn : 1; /* warning if on operand stems from == */ - const char *m_name; /* name of op. */ -} mod_t; - -typedef enum { - NOOP = 0, - ARROW, - POINT, - NOT, - COMPL, - INC, - DEC, - INCBEF, - DECBEF, - INCAFT, - DECAFT, - UPLUS, - UMINUS, - STAR, - AMPER, - MULT, - DIV, - MOD, - PLUS, - MINUS, - SHL, - SHR, - LT, - LE, - GT, - GE, - EQ, - NE, - AND, - XOR, - OR, - LOGAND, - LOGOR, - QUEST, - COLON, - ASSIGN, - MULASS, - DIVASS, - MODASS, - ADDASS, - SUBASS, - SHLASS, - SHRASS, - ANDASS, - XORASS, - ORASS, - NAME, - CON, - STRING, - FSEL, - CALL, - COMMA, - CVT, - ICALL, - LOAD, - PUSH, - RETURN, - INIT, /* pseudo op, not used in trees */ - CASE, /* pseudo op, not used in trees */ - FARG /* pseudo op, not used in trees */ -#define NOPS ((int)FARG + 1) -} op_t; diff --git a/usr.bin/xlint/lint1/param.h b/usr.bin/xlint/lint1/param.h deleted file mode 100644 index 5e4282d07ec9..000000000000 --- a/usr.bin/xlint/lint1/param.h +++ /dev/null @@ -1,143 +0,0 @@ -/* $NetBSD: param.h,v 1.4 1995/07/23 18:14:41 ragge Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* - * Minimun size of string buffer. If this is not enough, the buffer - * is enlarged in steps of STRBLEN bytes. - */ -#define STRBLEN 256 - -/* - * This defines the size of memory blocks which are used to allocate - * memory in larger chunks. - */ -#define MBLKSIZ ((size_t)0x4000) - -/* - * Sizes of hash tables - * Should be a prime. Possible primes are - * 307, 401, 503, 601, 701, 809, 907, 1009, 1103, 1201, 1301, 1409, 1511. - * - * HSHSIZ1 symbol table 1st pass - * HSHSIZ2 symbol table 2nd pass - * THSHSIZ2 type table 2nd pass - */ -#define HSHSIZ1 503 -#define HSHSIZ2 1009 -#define THSHSIZ2 1009 - -/* - * Should be set to 1 if the difference of two pointers is of type long - * or the value of sizeof is of type unsigned long. - */ -#if __amd64__ -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 -#elif __alpha__ -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 -#elif __i386__ -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 -#elif __m68k__ -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 -#elif __ns32k__ -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 -#elif __powerpc__ -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 -#elif __riscv -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 -#elif __sparc__ -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 -#elif __sparc64__ -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 -#elif __vax__ -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 -#elif __arm__ -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 -#elif __mips__ -#define PTRDIFF_IS_LONG 0 -#define SIZEOF_IS_ULONG 0 -#elif __aarch64__ -#define PTRDIFF_IS_LONG 1 -#define SIZEOF_IS_ULONG 1 -#else -#error unknown machine type -#endif - -/* - * Make sure this matches wchar_t. - */ -#define WCHAR SHORT - -#ifndef __GNUC__ -#ifndef lint -#ifndef QUAD_MAX /* necessary for mkdep */ -#define QUAD_MAX LONG_MAX -#define QUAD_MIN LONG_MIN -#define UQUAD_MAX ULONG_MAX -#endif -typedef long quad_t; -typedef u_long u_quad_t; -#endif -#endif - - -/* - * long double only in ANSI C. - */ -#ifdef __STDC__ -typedef long double ldbl_t; -#else -typedef double ldbl_t; -#endif - -/* - * Some traditional compilers are not able to assign structures. - */ -#ifdef __STDC__ -#define STRUCT_ASSIGN(dest, src) (dest) = (src) -#else -#define STRUCT_ASSIGN(dest, src) (void)memcpy(&(dest), &(src), \ - sizeof (dest)); -#endif diff --git a/usr.bin/xlint/lint1/scan.l b/usr.bin/xlint/lint1/scan.l deleted file mode 100644 index 004cfa61b87e..000000000000 --- a/usr.bin/xlint/lint1/scan.l +++ /dev/null @@ -1,1531 +0,0 @@ -%{ -/* $NetBSD: scan.l,v 1.37 2007/02/06 00:08:31 he Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: scan.l,v 1.37 2007/02/06 00:08:31 he Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "lint1.h" -#include "cgram.h" - -#define CHAR_MASK (~(~0 << CHAR_BIT)) - -/* Current position (its also updated when an included file is parsed) */ -pos_t curr_pos = { 1, "", 0 }; - -/* - * Current position in C source (not updated when an included file is - * parsed). - */ -pos_t csrc_pos = { 1, "", 0 }; - -static void incline(void); -static void badchar(int); -static sbuf_t *allocsb(void); -static void freesb(sbuf_t *); -static int inpc(void); -static int hash(const char *); -static sym_t *search(sbuf_t *); -static int name(void); -static int keyw(sym_t *); -static int icon(int); -static int fcon(void); -static int operator(int, op_t); -static int ccon(void); -static int wccon(void); -static int getescc(int); -static void directive(void); -static void comment(void); -static void slashslashcomment(void); -static int string(void); -static int wcstrg(void); - -%} - -%option nounput - -L [_A-Za-z] -D [0-9] -NZD [1-9] -OD [0-7] -HD [0-9A-Fa-f] -EX ([eE][+-]?[0-9]+) - -%% - -{L}({L}|{D})* return (name()); -0{OD}*[lLuU]* return (icon(8)); -{NZD}{D}*[lLuU]* return (icon(10)); -0[xX]{HD}+[lLuU]* return (icon(16)); -{D}+\.{D}*{EX}?[fFlL]? | -{D}+{EX}[fFlL]? | -0[xX]{HD}+p{HD}+[fFlL]? | -\.{D}+{EX}?[fFlL]? return (fcon()); -"=" return (operator(T_ASSIGN, ASSIGN)); -"*=" return (operator(T_OPASS, MULASS)); -"/=" return (operator(T_OPASS, DIVASS)); -"%=" return (operator(T_OPASS, MODASS)); -"+=" return (operator(T_OPASS, ADDASS)); -"-=" return (operator(T_OPASS, SUBASS)); -"<<=" return (operator(T_OPASS, SHLASS)); -">>=" return (operator(T_OPASS, SHRASS)); -"&=" return (operator(T_OPASS, ANDASS)); -"^=" return (operator(T_OPASS, XORASS)); -"|=" return (operator(T_OPASS, ORASS)); -"||" return (operator(T_LOGOR, LOGOR)); -"&&" return (operator(T_LOGAND, LOGAND)); -"|" return (operator(T_OR, OR)); -"&" return (operator(T_AND, AND)); -"^" return (operator(T_XOR, XOR)); -"==" return (operator(T_EQOP, EQ)); -"!=" return (operator(T_EQOP, NE)); -"<" return (operator(T_RELOP, LT)); -">" return (operator(T_RELOP, GT)); -"<=" return (operator(T_RELOP, LE)); -">=" return (operator(T_RELOP, GE)); -"<<" return (operator(T_SHFTOP, SHL)); -">>" return (operator(T_SHFTOP, SHR)); -"++" return (operator(T_INCDEC, INC)); -"--" return (operator(T_INCDEC, DEC)); -"->" return (operator(T_STROP, ARROW)); -"." return (operator(T_STROP, POINT)); -"+" return (operator(T_ADDOP, PLUS)); -"-" return (operator(T_ADDOP, MINUS)); -"*" return (operator(T_MULT, MULT)); -"/" return (operator(T_DIVOP, DIV)); -"%" return (operator(T_DIVOP, MOD)); -"!" return (operator(T_UNOP, NOT)); -"~" return (operator(T_UNOP, COMPL)); -"\"" return (string()); -"L\"" return (wcstrg()); -";" return (T_SEMI); -"{" return (T_LBRACE); -"}" return (T_RBRACE); -"," return (T_COMMA); -":" return (T_COLON); -"?" return (T_QUEST); -"[" return (T_LBRACK); -"]" return (T_RBRACK); -"(" return (T_LPARN); -")" return (T_RPARN); -"..." return (T_ELLIPSE); -"'" return (ccon()); -"L'" return (wccon()); -^#.*$ directive(); -\n incline(); -\t|" "|\f|\v ; -"/*" comment(); -"//" slashslashcomment(); -. badchar(yytext[0]); - -%% - -static void -incline(void) -{ - curr_pos.p_line++; - curr_pos.p_uniq = 0; - if (curr_pos.p_file == csrc_pos.p_file) { - csrc_pos.p_line++; - csrc_pos.p_uniq = 0; - } -} - -static void -badchar(int c) -{ - - /* unknown character \%o */ - error(250, c); -} - -/* - * Keywords. - * During initialisation they are written to the symbol table. - */ -static struct kwtab { - const char *kw_name; /* keyword */ - int kw_token; /* token returned by yylex() */ - scl_t kw_scl; /* storage class if kw_token T_SCLASS */ - tspec_t kw_tspec; /* type spec. if kw_token T_TYPE or T_SOU */ - tqual_t kw_tqual; /* type qual. fi kw_token T_QUAL */ - u_int kw_c89; /* c89 keyword */ - u_int kw_c99; /* c99 keyword */ - u_int kw_gcc; /* GCC keyword */ -} kwtab[] = { - { "asm", T_ASM, 0, 0, 0, 0, 0, 1 }, - { "__asm", T_ASM, 0, 0, 0, 0, 0, 0 }, - { "__asm__", T_ASM, 0, 0, 0, 0, 0, 0 }, - { "auto", T_SCLASS, AUTO, 0, 0, 0, 0, 0 }, - { "break", T_BREAK, 0, 0, 0, 0, 0, 0 }, - { "case", T_CASE, 0, 0, 0, 0, 0, 0 }, - { "char", T_TYPE, 0, CHAR, 0, 0, 0, 0 }, - { "const", T_QUAL, 0, 0, CONST, 1, 0, 0 }, - { "__const__", T_QUAL, 0, 0, CONST, 0, 0, 0 }, - { "__const", T_QUAL, 0, 0, CONST, 0, 0, 0 }, - { "continue", T_CONTINUE, 0, 0, 0, 0, 0, 0 }, - { "default", T_DEFAULT, 0, 0, 0, 0, 0, 0 }, - { "do", T_DO, 0, 0, 0, 0, 0, 0 }, - { "double", T_TYPE, 0, DOUBLE, 0, 0, 0, 0 }, - { "else", T_ELSE, 0, 0, 0, 0, 0, 0 }, - { "enum", T_ENUM, 0, 0, 0, 0, 0, 0 }, - { "extern", T_SCLASS, EXTERN, 0, 0, 0, 0, 0 }, - { "float", T_TYPE, 0, FLOAT, 0, 0, 0, 0 }, - { "for", T_FOR, 0, 0, 0, 0, 0, 0 }, - { "goto", T_GOTO, 0, 0, 0, 0, 0, 0 }, - { "if", T_IF, 0, 0, 0, 0, 0, 0 }, - { "inline", T_SCLASS, INLINE, 0, 0, 0, 1, 0 }, - { "__inline__", T_SCLASS, INLINE, 0, 0, 0, 0, 0 }, - { "__inline", T_SCLASS, INLINE, 0, 0, 0, 0, 0 }, - { "int", T_TYPE, 0, INT, 0, 0, 0, 0 }, - { "__symbolrename", T_SYMBOLRENAME, 0, 0, 0, 0, 0, 0 }, - { "long", T_TYPE, 0, LONG, 0, 0, 0, 0 }, - { "register", T_SCLASS, REG, 0, 0, 0, 0, 0 }, - { "return", T_RETURN, 0, 0, 0, 0, 0, 0 }, - { "short", T_TYPE, 0, SHORT, 0, 0, 0, 0 }, - { "signed", T_TYPE, 0, SIGNED, 0, 1, 0, 0 }, - { "__signed__", T_TYPE, 0, SIGNED, 0, 0, 0, 0 }, - { "__signed", T_TYPE, 0, SIGNED, 0, 0, 0, 0 }, - { "sizeof", T_SIZEOF, 0, 0, 0, 0, 0, 0 }, - { "static", T_SCLASS, STATIC, 0, 0, 0, 0, 0 }, - { "struct", T_SOU, 0, STRUCT, 0, 0, 0, 0 }, - { "switch", T_SWITCH, 0, 0, 0, 0, 0, 0 }, - { "typedef", T_SCLASS, TYPEDEF, 0, 0, 0, 0, 0 }, - { "union", T_SOU, 0, UNION, 0, 0, 0, 0 }, - { "unsigned", T_TYPE, 0, UNSIGN, 0, 0, 0, 0 }, - { "void", T_TYPE, 0, VOID, 0, 0, 0, 0 }, - { "volatile", T_QUAL, 0, 0, VOLATILE, 1, 0, 0 }, - { "__volatile__", T_QUAL, 0, 0, VOLATILE, 0, 0, 0 }, - { "__volatile", T_QUAL, 0, 0, VOLATILE, 0, 0, 0 }, - { "while", T_WHILE, 0, 0, 0, 0, 0, 0 }, - { NULL, 0, 0, 0, 0, 0, 0, 0 } -}; - -/* Symbol table */ -static sym_t *symtab[HSHSIZ1]; - -/* bit i of the entry with index i is set */ -uint64_t qbmasks[sizeof(uint64_t) * CHAR_BIT]; - -/* least significant i bits are set in the entry with index i */ -uint64_t qlmasks[sizeof(uint64_t) * CHAR_BIT + 1]; - -/* least significant i bits are not set in the entry with index i */ -uint64_t qumasks[sizeof(uint64_t) * CHAR_BIT + 1]; - -/* free list for sbuf structures */ -static sbuf_t *sbfrlst; - -/* type of next expected symbol */ -symt_t symtyp; - - -/* - * All keywords are written to the symbol table. This saves us looking - * in an extra table for each name we found. - */ -void -initscan(void) -{ - struct kwtab *kw; - sym_t *sym; - int h, i; - uint64_t uq; - - for (kw = kwtab; kw->kw_name != NULL; kw++) { - if ((kw->kw_c89 || kw->kw_c99) && tflag) - continue; - if (kw->kw_c99 && !(Sflag || gflag)) - continue; - if (kw->kw_gcc && !gflag) - continue; - sym = getblk(sizeof (sym_t)); - sym->s_name = kw->kw_name; - sym->s_keyw = 1; - sym->s_value.v_quad = kw->kw_token; - if (kw->kw_token == T_TYPE || kw->kw_token == T_SOU) { - sym->s_tspec = kw->kw_tspec; - } else if (kw->kw_token == T_SCLASS) { - sym->s_scl = kw->kw_scl; - } else if (kw->kw_token == T_QUAL) { - sym->s_tqual = kw->kw_tqual; - } - h = hash(sym->s_name); - if ((sym->s_link = symtab[h]) != NULL) - symtab[h]->s_rlink = &sym->s_link; - (symtab[h] = sym)->s_rlink = &symtab[h]; - } - - /* initialize bit-masks for quads */ - for (i = 0; i < sizeof (uint64_t) * CHAR_BIT; i++) { - qbmasks[i] = (uint64_t)1 << i; - uq = ~(uint64_t)0 << i; - qumasks[i] = uq; - qlmasks[i] = ~uq; - } - qumasks[i] = 0; - qlmasks[i] = ~(uint64_t)0; -} - -/* - * Get a free sbuf structure, if possible from the free list - */ -static sbuf_t * -allocsb(void) -{ - sbuf_t *sb; - - if ((sb = sbfrlst) != NULL) { - sbfrlst = sb->sb_nxt; - } else { - if ((sb = malloc(sizeof (sbuf_t))) == NULL) - nomem(); - } - (void)memset(sb, 0, sizeof (*sb)); - return (sb); -} - -/* - * Put a sbuf structure to the free list - */ -static void -freesb(sbuf_t *sb) -{ - - sb->sb_nxt = sbfrlst; - sbfrlst = sb; -} - -/* - * Read a character and ensure that it is positive (except EOF). - * Increment line count(s) if necessary. - */ -static int -inpc(void) -{ - int c; - - if ((c = input()) != EOF && (c &= CHAR_MASK) == '\n') - incline(); - return (c); -} - -static int -hash(const char *s) -{ - u_int v; - const u_char *us; - - v = 0; - for (us = (const u_char *)s; *us != '\0'; us++) { - v = (v << sizeof (v)) + *us; - v ^= v >> (sizeof (v) * CHAR_BIT - sizeof (v)); - } - return (v % HSHSIZ1); -} - -/* - * Lex has found a letter followed by zero or more letters or digits. - * It looks for a symbol in the symbol table with the same name. This - * symbol must either be a keyword or a symbol of the type required by - * symtyp (label, member, tag, ...). - * - * If it is a keyword, the token is returned. In some cases it is described - * more deeply by data written to yylval. - * - * If it is a symbol, T_NAME is returned and the pointer to a sbuf struct - * is stored in yylval. This struct contains the name of the symbol, it's - * length and hash value. If there is already a symbol of the same name - * and type in the symbol table, the sbuf struct also contains a pointer - * to the symbol table entry. - */ -static int -name(void) -{ - char *s; - sbuf_t *sb; - sym_t *sym; - int tok; - - sb = allocsb(); - sb->sb_name = yytext; - sb->sb_len = yyleng; - sb->sb_hash = hash(yytext); - - if ((sym = search(sb)) != NULL && sym->s_keyw) { - freesb(sb); - return (keyw(sym)); - } - - sb->sb_sym = sym; - - if (sym != NULL) { - if (blklev < sym->s_blklev) - LERROR("name()"); - sb->sb_name = sym->s_name; - sb->sb_len = strlen(sym->s_name); - tok = sym->s_scl == TYPEDEF ? T_TYPENAME : T_NAME; - } else { - s = getblk(yyleng + 1); - (void)memcpy(s, yytext, yyleng + 1); - sb->sb_name = s; - sb->sb_len = yyleng; - tok = T_NAME; - } - - yylval.y_sb = sb; - return (tok); -} - -static sym_t * -search(sbuf_t *sb) -{ - sym_t *sym; - - for (sym = symtab[sb->sb_hash]; sym != NULL; sym = sym->s_link) { - if (strcmp(sym->s_name, sb->sb_name) == 0) { - if (sym->s_keyw || sym->s_kind == symtyp) - return (sym); - } - } - - return (NULL); -} - -static int -keyw(sym_t *sym) -{ - int t; - - if ((t = (int)sym->s_value.v_quad) == T_SCLASS) { - yylval.y_scl = sym->s_scl; - } else if (t == T_TYPE || t == T_SOU) { - yylval.y_tspec = sym->s_tspec; - } else if (t == T_QUAL) { - yylval.y_tqual = sym->s_tqual; - } - return (t); -} - -/* - * Convert a string representing an integer into internal representation. - * The value is returned in yylval. icon() (and yylex()) returns T_CON. - */ -static int -icon(int base) -{ - int l_suffix, u_suffix; - int len; - const char *cp; - char c, *eptr; - tspec_t typ; - u_long ul = 0; - uint64_t uq = 0; - int ansiu; - static tspec_t contypes[2][3] = { - { INT, LONG, QUAD }, - { UINT, ULONG, UQUAD } - }; - - cp = yytext; - len = yyleng; - - /* skip 0x */ - if (base == 16) { - cp += 2; - len -= 2; - } - - /* read suffixes */ - l_suffix = u_suffix = 0; - for ( ; ; ) { - if ((c = cp[len - 1]) == 'l' || c == 'L') { - l_suffix++; - } else if (c == 'u' || c == 'U') { - u_suffix++; - } else { - break; - } - len--; - } - if (l_suffix > 2 || u_suffix > 1) { - /* malformed integer constant */ - warning(251); - if (l_suffix > 2) - l_suffix = 2; - if (u_suffix > 1) - u_suffix = 1; - } - if (tflag && u_suffix != 0) { - /* suffix U is illegal in traditional C */ - warning(97); - } - typ = contypes[u_suffix][l_suffix]; - - errno = 0; - if (l_suffix < 2) { - ul = strtoul(cp, &eptr, base); - } else { - uq = strtouq(cp, &eptr, base); - } - if (eptr != cp + len) - LERROR("icon()"); - if (errno != 0) - /* integer constant out of range */ - warning(252); - - /* - * If the value is too big for the current type, we must choose - * another type. - */ - ansiu = 0; - switch (typ) { - case INT: - if (ul <= INT_MAX) { - /* ok */ - } else if (ul <= (unsigned)UINT_MAX && base != 10) { - typ = UINT; -#if INT_MAX != LONG_MAX - } else if (ul <= LONG_MAX) { - typ = LONG; -#endif - } else { - typ = ULONG; - } - if (typ == UINT || typ == ULONG) { - if (tflag) { - typ = LONG; - } else if (!sflag) { - /* - * Remember that the constant is unsigned - * only in ANSI C - */ - ansiu = 1; - } - } - break; - case UINT: - if (ul > (u_int)UINT_MAX) - typ = ULONG; - break; - case LONG: - if (ul > LONG_MAX && !tflag) { - typ = ULONG; - if (!sflag) - ansiu = 1; - } - break; - case QUAD: - if (uq > QUAD_MAX && !tflag) { - typ = UQUAD; - if (!sflag) - ansiu = 1; - } - break; - /* LINTED (enumeration values not handled in switch) */ - case STRUCT: - case VOID: - case LDOUBLE: - case FUNC: - case ARRAY: - case PTR: - case ENUM: - case UNION: - case SIGNED: - case NOTSPEC: - case DOUBLE: - case FLOAT: - case UQUAD: - case ULONG: - case USHORT: - case SHORT: - case UCHAR: - case SCHAR: - case CHAR: - case UNSIGN: - break; - } - - if (typ != QUAD && typ != UQUAD) { - if (isutyp(typ)) { - uq = ul; - } else { - uq = (int64_t)(long)ul; - } - } - - uq = (uint64_t)xsign((int64_t)uq, typ, -1); - - if ((yylval.y_val = calloc(1, sizeof(val_t))) == NULL) - nomem(); - yylval.y_val->v_tspec = typ; - yylval.y_val->v_ansiu = ansiu; - yylval.y_val->v_quad = (int64_t)uq; - - return (T_CON); -} - -/* - * Returns 1 if t is a signed type and the value is negative. - * - * len is the number of significant bits. If len is -1, len is set - * to the width of type t. - */ -int -sign(int64_t q, tspec_t t, int len) -{ - - if (t == PTR || isutyp(t)) - return (0); - return (msb(q, t, len)); -} - -int -msb(int64_t q, tspec_t t, int len) -{ - - if (len <= 0) - len = size(t); - return ((q & qbmasks[len - 1]) != 0); -} - -/* - * Extends the sign of q. - */ -int64_t -xsign(int64_t q, tspec_t t, int len) -{ - - if (len <= 0) - len = size(t); - - if (t == PTR || isutyp(t) || !sign(q, t, len)) { - q &= qlmasks[len]; - } else { - q |= qumasks[len]; - } - return (q); -} - -/* - * Convert a string representing a floating point value into its interal - * representation. Type and value are returned in yylval. fcon() - * (and yylex()) returns T_CON. - * XXX Currently it is not possible to convert constants of type - * long double which are greater than DBL_MAX. - */ -static int -fcon(void) -{ - const char *cp; - int len; - tspec_t typ; - char c, *eptr; - double d; - float f = 0; - - cp = yytext; - len = yyleng; - - if ((c = cp[len - 1]) == 'f' || c == 'F') { - typ = FLOAT; - len--; - } else if (c == 'l' || c == 'L') { - typ = LDOUBLE; - len--; - } else { - typ = DOUBLE; - } - - if (tflag && typ != DOUBLE) { - /* suffixes F and L are illegal in traditional C */ - warning(98); - } - - errno = 0; - d = strtod(cp, &eptr); - if (eptr != cp + len) { - switch (*eptr) { - /* - * XXX: non-native non-current strtod() may not handle hex - * floats, ignore the rest if we find traces of hex float - * syntax... - */ - case 'p': - case 'P': - case 'x': - case 'X': - d = 0; - errno = 0; - break; - default: - LERROR("fcon()"); - } - } - if (errno != 0) - /* floating-point constant out of range */ - warning(248); - - if (typ == FLOAT) { - f = (float)d; - if (!finite(f)) { - /* floating-point constant out of range */ - warning(248); - f = f > 0 ? FLT_MAX : -FLT_MAX; - } - } - - if ((yylval.y_val = calloc(1, sizeof (val_t))) == NULL) - nomem(); - yylval.y_val->v_tspec = typ; - if (typ == FLOAT) { - yylval.y_val->v_ldbl = f; - } else { - yylval.y_val->v_ldbl = d; - } - - return (T_CON); -} - -static int -operator(int t, op_t o) -{ - - yylval.y_op = o; - return (t); -} - -/* - * Called if lex found a leading \'. - */ -static int -ccon(void) -{ - int n, val, c; - char cv; - - n = 0; - val = 0; - while ((c = getescc('\'')) >= 0) { - val = (val << CHAR_BIT) + c; - n++; - } - if (c == -2) { - /* unterminated character constant */ - error(253); - } else { - if (n > sizeof (int) || (n > 1 && (pflag || hflag))) { - /* too many characters in character constant */ - error(71); - } else if (n > 1) { - /* multi-character character constant */ - warning(294); - } else if (n == 0) { - /* empty character constant */ - error(73); - } - } - if (n == 1) { - cv = (char)val; - val = cv; - } - - yylval.y_val = xcalloc(1, sizeof (val_t)); - yylval.y_val->v_tspec = INT; - yylval.y_val->v_quad = val; - - return (T_CON); -} - -/* - * Called if lex found a leading L\' - */ -static int -wccon(void) -{ - static char buf[MB_LEN_MAX + 1]; - int i, c; - wchar_t wc; - - i = 0; - while ((c = getescc('\'')) >= 0) { - if (i < MB_CUR_MAX) - buf[i] = (char)c; - i++; - } - - wc = 0; - - if (c == -2) { - /* unterminated character constant */ - error(253); - } else if (c == 0) { - /* empty character constant */ - error(73); - } else { - if (i > MB_CUR_MAX) { - i = MB_CUR_MAX; - /* too many characters in character constant */ - error(71); - } else { - buf[i] = '\0'; - (void)mbtowc(NULL, NULL, 0); - if (mbtowc(&wc, buf, MB_CUR_MAX) < 0) - /* invalid multibyte character */ - error(291); - } - } - - if ((yylval.y_val = calloc(1, sizeof (val_t))) == NULL) - nomem(); - yylval.y_val->v_tspec = WCHAR; - yylval.y_val->v_quad = wc; - - return (T_CON); -} - -/* - * Read a character which is part of a character constant or of a string - * and handle escapes. - * - * The Argument is the character which delimits the character constant or - * string. - * - * Returns -1 if the end of the character constant or string is reached, - * -2 if the EOF is reached, and the character otherwise. - */ -static int -getescc(int d) -{ - static int pbc = -1; - int n, c, v; - - if (pbc == -1) { - c = inpc(); - } else { - c = pbc; - pbc = -1; - } - if (c == d) - return (-1); - switch (c) { - case '\n': - if (tflag) { - /* newline in string or char constant */ - error(254); - return (-2); - } - return (c); - case EOF: - return (-2); - case '\\': - switch (c = inpc()) { - case '"': - if (tflag && d == '\'') - /* \" inside character constant undef. ... */ - warning(262); - return ('"'); - case '\'': - return ('\''); - case '?': - if (tflag) - /* \? undefined in traditional C */ - warning(263); - return ('?'); - case '\\': - return ('\\'); - case 'a': - if (tflag) - /* \a undefined in traditional C */ - warning(81); - return ('\a'); - case 'b': - return ('\b'); - case 'f': - return ('\f'); - case 'n': - return ('\n'); - case 'r': - return ('\r'); - case 't': - return ('\t'); - case 'v': - if (tflag) - /* \v undefined in traditional C */ - warning(264); - return ('\v'); - case '8': case '9': - /* bad octal digit %c */ - warning(77, c); - /* FALLTHROUGH */ - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - n = 3; - v = 0; - do { - v = (v << 3) + (c - '0'); - c = inpc(); - } while (--n && isdigit(c) && (tflag || c <= '7')); - if (tflag && n > 0 && isdigit(c)) - /* bad octal digit %c */ - warning(77, c); - pbc = c; - if (v > UCHAR_MAX) { - /* character escape does not fit in char. */ - warning(76); - v &= CHAR_MASK; - } - return (v); - case 'x': - if (tflag) - /* \x undefined in traditional C */ - warning(82); - v = 0; - n = 0; - while ((c = inpc()) >= 0 && isxdigit(c)) { - c = isdigit(c) ? - c - '0' : toupper(c) - 'A' + 10; - v = (v << 4) + c; - if (n >= 0) { - if ((v & ~CHAR_MASK) != 0) { - /* overflow in hex escape */ - warning(75); - n = -1; - } else { - n++; - } - } - } - pbc = c; - if (n == 0) { - /* no hex digits follow \x */ - error(74); - } if (n == -1) { - v &= CHAR_MASK; - } - return (v); - case '\n': - return (getescc(d)); - case EOF: - return (-2); - default: - if (isprint(c)) { - /* dubious escape \%c */ - warning(79, c); - } else { - /* dubious escape \%o */ - warning(80, c); - } - } - } - return (c); -} - -/* - * Called for preprocessor directives. Currently implemented are: - * # lineno - * # lineno "filename" - */ -static void -directive(void) -{ - const char *cp, *fn; - char c, *eptr; - size_t fnl; - long ln; - static int first = 1; - - /* Go to first non-whitespace after # */ - for (cp = yytext + 1; (c = *cp) == ' ' || c == '\t'; cp++) - continue; - - if (!isdigit((unsigned char)c)) { - error: - /* undefined or invalid # directive */ - warning(255); - return; - } - ln = strtol(--cp, &eptr, 10); - if (cp == eptr) - goto error; - if ((c = *(cp = eptr)) != ' ' && c != '\t' && c != '\0') - goto error; - while ((c = *cp++) == ' ' || c == '\t') - continue; - if (c != '\0') { - if (c != '"') - goto error; - fn = cp; - while ((c = *cp) != '"' && c != '\0') - cp++; - if (c != '"') - goto error; - if ((fnl = cp++ - fn) > PATH_MAX) - goto error; - while ((c = *cp++) == ' ' || c == '\t') - continue; -#if 0 - if (c != '\0') - warning("extra character(s) after directive"); -#endif - - /* empty string means stdin */ - if (fnl == 0) { - fn = "{standard input}"; - fnl = 16; /* strlen (fn) */ - } - curr_pos.p_file = fnnalloc(fn, fnl); - /* - * If this is the first directive, the name is the name - * of the C source file as specified at the command line. - * It is written to the output file. - */ - if (first) { - csrc_pos.p_file = curr_pos.p_file; - outsrc(curr_pos.p_file); - first = 0; - } - } - curr_pos.p_line = (int)ln - 1; - curr_pos.p_uniq = 0; - if (curr_pos.p_file == csrc_pos.p_file) { - csrc_pos.p_line = (int)ln - 1; - csrc_pos.p_uniq = 0; - } -} - -/* - * Handle lint comments. Following comments are currently understood: - * ARGSUSEDn - * BITFIELDTYPE - * CONSTCOND CONSTANTCOND CONSTANTCONDITION - * FALLTHRU FALLTHROUGH - * LINTLIBRARY - * LINTED NOSTRICT - * LONGLONG - * NOTREACHED - * PRINTFLIKEn - * PROTOLIB - * SCANFLIKEn - * VARARGSn - * If one of this comments is recognized, the arguments, if any, are - * parsed and a function which handles this comment is called. - */ -static void -comment(void) -{ - int c, lc; - static struct { - const char *keywd; - int arg; - void (*func)(int); - } keywtab[] = { - { "ARGSUSED", 1, argsused }, - { "BITFIELDTYPE", 0, bitfieldtype }, - { "CONSTCOND", 0, constcond }, - { "CONSTANTCOND", 0, constcond }, - { "CONSTANTCONDITION", 0, constcond }, - { "FALLTHRU", 0, fallthru }, - { "FALLTHROUGH", 0, fallthru }, - { "LINTLIBRARY", 0, lintlib }, - { "LINTED", 0, linted }, - { "LONGLONG", 0, longlong }, - { "NOSTRICT", 0, linted }, - { "NOTREACHED", 0, notreach }, - { "PRINTFLIKE", 1, printflike }, - { "PROTOLIB", 1, protolib }, - { "SCANFLIKE", 1, scanflike }, - { "VARARGS", 1, varargs }, - }; - char keywd[32]; - char arg[32]; - int l, i, a; - int eoc; - - eoc = 0; - - /* Skip white spaces after the start of the comment */ - while ((c = inpc()) != EOF && isspace(c)) - continue; - - /* Read the potential keyword to keywd */ - l = 0; - while (c != EOF && isupper(c) && l < sizeof (keywd) - 1) { - keywd[l++] = (char)c; - c = inpc(); - } - keywd[l] = '\0'; - - /* look for the keyword */ - for (i = 0; i < sizeof (keywtab) / sizeof (keywtab[0]); i++) { - if (strcmp(keywtab[i].keywd, keywd) == 0) - break; - } - if (i == sizeof (keywtab) / sizeof (keywtab[0])) - goto skip_rest; - - /* skip white spaces after the keyword */ - while (c != EOF && isspace(c)) - c = inpc(); - - /* read the argument, if the keyword accepts one and there is one */ - l = 0; - if (keywtab[i].arg) { - while (c != EOF && isdigit(c) && l < sizeof (arg) - 1) { - arg[l++] = (char)c; - c = inpc(); - } - } - arg[l] = '\0'; - a = l != 0 ? atoi(arg) : -1; - - /* skip white spaces after the argument */ - while (c != EOF && isspace(c)) - c = inpc(); - - if (c != '*' || (c = inpc()) != '/') { - if (keywtab[i].func != linted) - /* extra characters in lint comment */ - warning(257); - } else { - /* - * remember that we have already found the end of the - * comment - */ - eoc = 1; - } - - if (keywtab[i].func != NULL) - (*keywtab[i].func)(a); - - skip_rest: - while (!eoc) { - lc = c; - if ((c = inpc()) == EOF) { - /* unterminated comment */ - error(256); - break; - } - if (lc == '*' && c == '/') - eoc = 1; - } -} - -/* - * Handle // style comments - */ -static void -slashslashcomment(void) -{ - int c; - - if (!Sflag && !gflag) - /* // comments only supported in C99 */ - (void)gnuism(312, tflag ? "traditional" : "ANSI"); - - while ((c = inpc()) != EOF && c != '\n') - continue; -} - -/* - * Clear flags for lint comments LINTED, LONGLONG and CONSTCOND. - * clrwflgs() is called after function definitions and global and - * local declarations and definitions. It is also called between - * the controlling expression and the body of control statements - * (if, switch, for, while). - */ -void -clrwflgs(void) -{ - - nowarn = 0; - quadflg = 0; - ccflg = 0; -} - -/* - * Strings are stored in a dynamically alloceted buffer and passed - * in yylval.y_xstrg to the parser. The parser or the routines called - * by the parser are responsible for freeing this buffer. - */ -static int -string(void) -{ - u_char *s; - int c; - size_t len, max; - strg_t *strg; - - if ((s = malloc(max = 64)) == NULL) - nomem(); - - len = 0; - while ((c = getescc('"')) >= 0) { - /* +1 to reserve space for a trailing NUL character */ - if (len + 1 == max) - if ((s = realloc(s, max *= 2)) == NULL) - nomem(); - s[len++] = (char)c; - } - s[len] = '\0'; - if (c == -2) - /* unterminated string constant */ - error(258); - - if ((strg = calloc(1, sizeof (strg_t))) == NULL) - nomem(); - strg->st_tspec = CHAR; - strg->st_len = len; - strg->st_cp = s; - - yylval.y_strg = strg; - return (T_STRING); -} - -static int -wcstrg(void) -{ - char *s; - int c, i, n, wi; - size_t len, max, wlen; - wchar_t *ws; - strg_t *strg; - - if ((s = malloc(max = 64)) == NULL) - nomem(); - len = 0; - while ((c = getescc('"')) >= 0) { - /* +1 to save space for a trailing NUL character */ - if (len + 1 >= max) - if ((s = realloc(s, max *= 2)) == NULL) - nomem(); - s[len++] = (char)c; - } - s[len] = '\0'; - if (c == -2) - /* unterminated string constant */ - error(258); - - /* get length of wide character string */ - (void)mblen(NULL, 0); - for (i = 0, wlen = 0; i < len; i += n, wlen++) { - if ((n = mblen(&s[i], MB_CUR_MAX)) == -1) { - /* invalid multibyte character */ - error(291); - break; - } - if (n == 0) - n = 1; - } - - if ((ws = malloc((wlen + 1) * sizeof (wchar_t))) == NULL) - nomem(); - - /* convert from multibyte to wide char */ - (void)mbtowc(NULL, NULL, 0); - for (i = 0, wi = 0; i < len; i += n, wi++) { - if ((n = mbtowc(&ws[wi], &s[i], MB_CUR_MAX)) == -1) - break; - if (n == 0) - n = 1; - } - ws[wi] = 0; - free(s); - - if ((strg = calloc(1, sizeof (strg_t))) == NULL) - nomem(); - strg->st_tspec = WCHAR; - strg->st_len = wlen; - strg->st_wcp = ws; - - yylval.y_strg = strg; - return (T_STRING); -} - -/* - * As noted above the scanner does not create new symbol table entries - * for symbols it cannot find in the symbol table. This is to avoid - * putting undeclared symbols into the symbol table if a syntax error - * occurs. - * - * getsym() is called as soon as it is probably ok to put the symbol to - * the symbol table. This does not mean that it is not possible that - * symbols are put to the symbol table which are than not completely - * declared due to syntax errors. To avoid too many problems in this - * case symbols get type int in getsym(). - * - * XXX calls to getsym() should be delayed until decl1*() is called - */ -sym_t * -getsym(sbuf_t *sb) -{ - dinfo_t *di; - char *s; - sym_t *sym; - - sym = sb->sb_sym; - - /* - * During member declaration it is possible that name() looked - * for symbols of type FVFT, although it should have looked for - * symbols of type FTAG. Same can happen for labels. Both cases - * are compensated here. - */ - if (symtyp == FMOS || symtyp == FLAB) { - if (sym == NULL || sym->s_kind == FVFT) - sym = search(sb); - } - - if (sym != NULL) { - if (sym->s_kind != symtyp) - LERROR("storesym()"); - symtyp = FVFT; - freesb(sb); - return (sym); - } - - /* create a new symbol table entry */ - - /* labels must always be allocated at level 1 (outhermost block) */ - if (symtyp == FLAB) { - sym = getlblk(1, sizeof (sym_t)); - s = getlblk(1, sb->sb_len + 1); - (void)memcpy(s, sb->sb_name, sb->sb_len + 1); - sym->s_name = s; - sym->s_blklev = 1; - di = dcs; - while (di->d_nxt != NULL && di->d_nxt->d_nxt != NULL) - di = di->d_nxt; - if (di->d_ctx != AUTO) - LERROR("storesym()"); - } else { - sym = getblk(sizeof (sym_t)); - sym->s_name = sb->sb_name; - sym->s_blklev = blklev; - di = dcs; - } - - UNIQUE_CURR_POS(sym->s_dpos); - if ((sym->s_kind = symtyp) != FLAB) - sym->s_type = gettyp(INT); - - symtyp = FVFT; - - if ((sym->s_link = symtab[sb->sb_hash]) != NULL) - symtab[sb->sb_hash]->s_rlink = &sym->s_link; - (symtab[sb->sb_hash] = sym)->s_rlink = &symtab[sb->sb_hash]; - - *di->d_ldlsym = sym; - di->d_ldlsym = &sym->s_dlnxt; - - freesb(sb); - return (sym); -} - -/* - * Construct a temporary symbol. The symbol starts with a digit, so that - * it is illegal. - */ -sym_t * -mktempsym(type_t *t) -{ - static int n = 0; - int h; - char *s = getlblk(blklev, 64); - sym_t *sym = getblk(sizeof (sym_t)); - - (void)snprintf(s, 64, "%.8d_tmp", n++); - h = hash(s); - - sym->s_name = s; - sym->s_type = t; - sym->s_blklev = blklev; - sym->s_scl = AUTO; - sym->s_kind = FVFT; - sym->s_used = 1; - sym->s_set = 1; - - if ((sym->s_link = symtab[h]) != NULL) - symtab[h]->s_rlink = &sym->s_link; - (symtab[h] = sym)->s_rlink = &symtab[h]; - - *dcs->d_ldlsym = sym; - dcs->d_ldlsym = &sym->s_dlnxt; - - return sym; -} - -/* - * Remove a symbol forever from the symbol table. s_blklev - * is set to -1 to avoid that the symbol will later be put - * back to the symbol table. - */ -void -rmsym(sym_t *sym) -{ - - if ((*sym->s_rlink = sym->s_link) != NULL) - sym->s_link->s_rlink = sym->s_rlink; - sym->s_blklev = -1; - sym->s_link = NULL; -} - -/* - * Remove a list of symbols declared at one level from the symbol - * table. - */ -void -rmsyms(sym_t *syms) -{ - sym_t *sym; - - for (sym = syms; sym != NULL; sym = sym->s_dlnxt) { - if (sym->s_blklev != -1) { - if ((*sym->s_rlink = sym->s_link) != NULL) - sym->s_link->s_rlink = sym->s_rlink; - sym->s_link = NULL; - sym->s_rlink = NULL; - } - } -} - -/* - * Put a symbol into the symbol table - */ -void -inssym(int bl, sym_t *sym) -{ - int h; - - h = hash(sym->s_name); - if ((sym->s_link = symtab[h]) != NULL) - symtab[h]->s_rlink = &sym->s_link; - (symtab[h] = sym)->s_rlink = &symtab[h]; - sym->s_blklev = bl; - if (sym->s_link != NULL && sym->s_blklev < sym->s_link->s_blklev) - LERROR("inssym()"); -} - -/* - * Called at level 0 after syntax errors - * Removes all symbols which are not declared at level 0 from the - * symbol table. Also frees all memory which is not associated with - * level 0. - */ -void -cleanup(void) -{ - sym_t *sym, *nsym; - int i; - - for (i = 0; i < HSHSIZ1; i++) { - for (sym = symtab[i]; sym != NULL; sym = nsym) { - nsym = sym->s_link; - if (sym->s_blklev >= 1) { - if ((*sym->s_rlink = nsym) != NULL) - nsym->s_rlink = sym->s_rlink; - } - } - } - - for (i = mblklev; i > 0; i--) - freelblk(i); -} - -/* - * Create a new symbol with the name of an existing symbol. - */ -sym_t * -pushdown(sym_t *sym) -{ - int h; - sym_t *nsym; - - h = hash(sym->s_name); - nsym = getblk(sizeof (sym_t)); - if (sym->s_blklev > blklev) - LERROR("pushdown()"); - nsym->s_name = sym->s_name; - UNIQUE_CURR_POS(nsym->s_dpos); - nsym->s_kind = sym->s_kind; - nsym->s_blklev = blklev; - - if ((nsym->s_link = symtab[h]) != NULL) - symtab[h]->s_rlink = &nsym->s_link; - (symtab[h] = nsym)->s_rlink = &symtab[h]; - - *dcs->d_ldlsym = nsym; - dcs->d_ldlsym = &nsym->s_dlnxt; - - return (nsym); -} - -/* - * Free any dynamically allocated memory referenced by - * the value stack or yylval. - * The type of information in yylval is described by tok. - */ -void -freeyyv(void *sp, int tok) -{ - if (tok == T_NAME || tok == T_TYPENAME) { - sbuf_t *sb = *(sbuf_t **)sp; - freesb(sb); - } else if (tok == T_CON) { - val_t *val = *(val_t **)sp; - free(val); - } else if (tok == T_STRING) { - strg_t *strg = *(strg_t **)sp; - if (strg->st_tspec == CHAR) { - free(strg->st_cp); - } else if (strg->st_tspec == WCHAR) { - free(strg->st_wcp); - } else { - LERROR("fryylv()"); - } - free(strg); - } -} diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c deleted file mode 100644 index 931c77e6d9a6..000000000000 --- a/usr.bin/xlint/lint1/tree.c +++ /dev/null @@ -1,4040 +0,0 @@ -/* $NetBSD: tree.c,v 1.45 2008/03/04 02:41:46 christos Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.45 2008/03/04 02:41:46 christos Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include - -#include "lint1.h" -#include "cgram.h" - -/* Various flags for each operator. */ -static mod_t modtab[NOPS]; - -static tnode_t *getinode(tspec_t, int64_t); -static void ptrcmpok(op_t, tnode_t *, tnode_t *); -static int asgntypok(op_t, int, tnode_t *, tnode_t *); -static void chkbeop(op_t, tnode_t *, tnode_t *); -static void chkeop2(op_t, int, tnode_t *, tnode_t *); -static void chkeop1(op_t, int, tnode_t *, tnode_t *); -static tnode_t *mktnode(op_t, type_t *, tnode_t *, tnode_t *); -static void balance(op_t, tnode_t **, tnode_t **); -static void incompat(op_t, tspec_t, tspec_t); -static void illptrc(mod_t *, type_t *, type_t *); -static void mrgqual(type_t **, type_t *, type_t *); -static int conmemb(type_t *); -static void ptconv(int, tspec_t, tspec_t, type_t *, tnode_t *); -static void iiconv(op_t, int, tspec_t, tspec_t, type_t *, tnode_t *); -static void piconv(op_t, tspec_t, type_t *, tnode_t *); -static void ppconv(op_t, tnode_t *, type_t *); -static tnode_t *bldstr(op_t, tnode_t *, tnode_t *); -static tnode_t *bldincdec(op_t, tnode_t *); -static tnode_t *bldamper(tnode_t *, int); -static tnode_t *bldplmi(op_t, tnode_t *, tnode_t *); -static tnode_t *bldshft(op_t, tnode_t *, tnode_t *); -static tnode_t *bldcol(tnode_t *, tnode_t *); -static tnode_t *bldasgn(op_t, tnode_t *, tnode_t *); -static tnode_t *plength(type_t *); -static tnode_t *fold(tnode_t *); -static tnode_t *foldtst(tnode_t *); -static tnode_t *foldflt(tnode_t *); -static tnode_t *chkfarg(type_t *, tnode_t *); -static tnode_t *parg(int, type_t *, tnode_t *); -static void nulleff(tnode_t *); -static void displexpr(tnode_t *, int); -static void chkaidx(tnode_t *, int); -static void chkcomp(op_t, tnode_t *, tnode_t *); -static void precconf(tnode_t *); - -/* - * Initialize mods of operators. - */ -void -initmtab(void) -{ - static struct { - op_t op; - mod_t m; - } imods[] = { - { ARROW, { 1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0, - "->" } }, - { POINT, { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - "." } }, - { NOT, { 0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0, - "!" } }, - { COMPL, { 0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,1,1, - "~" } }, - { INCBEF, { 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0, - "prefix++" } }, - { DECBEF, { 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0, - "prefix--" } }, - { INCAFT, { 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0, - "postfix++" } }, - { DECAFT, { 0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0, - "postfix--" } }, - { UPLUS, { 0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1, - "unary +" } }, - { UMINUS, { 0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,1,1, - "unary -" } }, - { STAR, { 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0, - "unary *" } }, - { AMPER, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - "unary &" } }, - { MULT, { 1,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,1, - "*" } }, - { DIV, { 1,0,0,0,1,1,1,0,1,0,1,1,0,0,0,1,1, - "/" } }, - { MOD, { 1,0,1,0,0,1,1,0,1,0,1,1,0,0,0,1,1, - "%" } }, - { PLUS, { 1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0, - "+" } }, - { MINUS, { 1,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0, - "-" } }, - { SHL, { 1,0,1,0,0,1,1,0,0,0,0,0,1,0,0,1,1, - "<<" } }, - { SHR, { 1,0,1,0,0,1,1,0,0,0,1,0,1,0,0,1,1, - ">>" } }, - { LT, { 1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1, - "<" } }, - { LE, { 1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1, - "<=" } }, - { GT, { 1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1, - ">" } }, - { GE, { 1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1, - ">=" } }, - { EQ, { 1,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0,1, - "==" } }, - { NE, { 1,1,0,1,0,1,1,0,1,0,0,0,0,1,1,0,1, - "!=" } }, - { AND, { 1,0,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0, - "&" } }, - { XOR, { 1,0,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0, - "^" } }, - { OR, { 1,0,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0, - "|" } }, - { LOGAND, { 1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0, - "&&" } }, - { LOGOR, { 1,1,0,1,0,1,0,1,0,0,0,0,1,0,0,1,0, - "||" } }, - { QUEST, { 1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0, - "?" } }, - { COLON, { 1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0, - ":" } }, - { ASSIGN, { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0, - "=" } }, - { MULASS, { 1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0, - "*=" } }, - { DIVASS, { 1,0,0,0,1,0,0,0,0,1,0,1,0,0,0,1,0, - "/=" } }, - { MODASS, { 1,0,1,0,0,0,0,0,0,1,0,1,0,0,0,1,0, - "%=" } }, - { ADDASS, { 1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0, - "+=" } }, - { SUBASS, { 1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0, - "-=" } }, - { SHLASS, { 1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0, - "<<=" } }, - { SHRASS, { 1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0, - ">>=" } }, - { ANDASS, { 1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0, - "&=" } }, - { XORASS, { 1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0, - "^=" } }, - { ORASS, { 1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0, - "|=" } }, - { NAME, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - "NAME" } }, - { CON, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - "CON" } }, - { STRING, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - "STRING" } }, - { FSEL, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - "FSEL" } }, - { CALL, { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, - "CALL" } }, - { COMMA, { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, - "," } }, - { CVT, { 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0, - "CVT" } }, - { ICALL, { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, - "ICALL" } }, - { LOAD, { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - "LOAD" } }, - { PUSH, { 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0, - "PUSH" } }, - { RETURN, { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0, - "RETURN" } }, - { INIT, { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, - "INIT" } }, - { FARG, { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0, - "FARG" } }, - { NOOP } - }; - int i; - - for (i = 0; imods[i].op != NOOP; i++) - STRUCT_ASSIGN(modtab[imods[i].op], imods[i].m); -} - -/* - * Increase degree of reference. - * This is most often used to change type "T" in type "pointer to T". - */ -type_t * -incref(type_t *tp, tspec_t t) -{ - type_t *tp2; - - tp2 = getblk(sizeof (type_t)); - tp2->t_tspec = t; - tp2->t_subt = tp; - return (tp2); -} - -/* - * same for use in expressions - */ -type_t * -tincref(type_t *tp, tspec_t t) -{ - type_t *tp2; - - tp2 = tgetblk(sizeof (type_t)); - tp2->t_tspec = t; - tp2->t_subt = tp; - return (tp2); -} - -/* - * Create a node for a constant. - */ -tnode_t * -getcnode(type_t *tp, val_t *v) -{ - tnode_t *n; - - n = getnode(); - n->tn_op = CON; - n->tn_type = tp; - n->tn_val = tgetblk(sizeof (val_t)); - n->tn_val->v_tspec = tp->t_tspec; - n->tn_val->v_ansiu = v->v_ansiu; - n->tn_val->v_u = v->v_u; - free(v); - return (n); -} - -/* - * Create a node for an integer constant. - */ -static tnode_t * -getinode(tspec_t t, int64_t q) -{ - tnode_t *n; - - n = getnode(); - n->tn_op = CON; - n->tn_type = gettyp(t); - n->tn_val = tgetblk(sizeof (val_t)); - n->tn_val->v_tspec = t; - n->tn_val->v_quad = q; - return (n); -} - -/* - * Create a node for a name (symbol table entry). - * ntok is the token which follows the name. - */ -tnode_t * -getnnode(sym_t *sym, int ntok) -{ - tnode_t *n; - - if (sym->s_scl == NOSCL) { - sym->s_scl = EXTERN; - sym->s_def = DECL; - if (ntok == T_LPARN) { - if (sflag) { - /* function implicitly declared to ... */ - warning(215); - } - /* - * XXX if tflag is set the symbol should be - * exported to level 0 - */ - sym->s_type = incref(sym->s_type, FUNC); - } else { - if (!blklev) { - /* %s undefined */ - error(99, sym->s_name); - } else { - int fixtype; - if (strcmp(sym->s_name, "__FUNCTION__") == 0) { - gnuism(316); - fixtype = 1; - } else if (strcmp(sym->s_name, "__func__") == 0) { - if (!Sflag) - warning(317); - fixtype = 1; - } else { - error(99, sym->s_name); - fixtype = 0; - } - if (fixtype) { - sym->s_type = incref(gettyp(CHAR), PTR); - sym->s_type->t_const = 1; - } - } - } - } - - if (sym->s_kind != FVFT && sym->s_kind != FMOS) - LERROR("getnnode()"); - - n = getnode(); - n->tn_type = sym->s_type; - if (sym->s_scl != ENUMCON) { - n->tn_op = NAME; - n->tn_sym = sym; - if (sym->s_kind == FVFT && sym->s_type->t_tspec != FUNC) - n->tn_lvalue = 1; - } else { - n->tn_op = CON; - n->tn_val = tgetblk(sizeof (val_t)); - *n->tn_val = sym->s_value; - } - - return (n); -} - -/* - * Create a node for a string. - */ -tnode_t * -getsnode(strg_t *strg) -{ - size_t len; - tnode_t *n; - - len = strg->st_len; - - n = getnode(); - - n->tn_op = STRING; - n->tn_type = tincref(gettyp(strg->st_tspec), ARRAY); - n->tn_type->t_dim = len + 1; - n->tn_lvalue = 1; - - n->tn_strg = tgetblk(sizeof (strg_t)); - n->tn_strg->st_tspec = strg->st_tspec; - n->tn_strg->st_len = len; - - if (strg->st_tspec == CHAR) { - n->tn_strg->st_cp = tgetblk(len + 1); - (void)memcpy(n->tn_strg->st_cp, strg->st_cp, len + 1); - free(strg->st_cp); - } else { - n->tn_strg->st_wcp = tgetblk((len + 1) * sizeof (wchar_t)); - (void)memcpy(n->tn_strg->st_wcp, strg->st_wcp, - (len + 1) * sizeof (wchar_t)); - free(strg->st_wcp); - } - free(strg); - - return (n); -} - -/* - * Returns a symbol which has the same name as the msym argument and is a - * member of the struct or union specified by the tn argument. - */ -sym_t * -strmemb(tnode_t *tn, op_t op, sym_t *msym) -{ - str_t *str; - type_t *tp; - sym_t *sym, *csym; - int eq; - tspec_t t; - - /* - * Remove the member if it was unknown until now (Which means - * that no defined struct or union has a member with the same name). - */ - if (msym->s_scl == NOSCL) { - /* undefined struct/union member: %s */ - fprintf(stderr, "3. %s\n", msym->s_name); - error(101, msym->s_name); - rmsym(msym); - msym->s_kind = FMOS; - msym->s_scl = MOS; - msym->s_styp = tgetblk(sizeof (str_t)); - msym->s_styp->stag = tgetblk(sizeof (sym_t)); - msym->s_styp->stag->s_name = unnamed; - msym->s_value.v_tspec = INT; - return (msym); - } - - /* Set str to the tag of which msym is expected to be a member. */ - str = NULL; - t = (tp = tn->tn_type)->t_tspec; - if (op == POINT) { - if (t == STRUCT || t == UNION) - str = tp->t_str; - } else if (op == ARROW && t == PTR) { - t = (tp = tp->t_subt)->t_tspec; - if (t == STRUCT || t == UNION) - str = tp->t_str; - } - - /* - * If this struct/union has a member with the name of msym, return - * return this it. - */ - if (str != NULL) { - for (sym = msym; sym != NULL; sym = sym->s_link) { - if (sym->s_scl != MOS && sym->s_scl != MOU) - continue; - if (sym->s_styp != str) - continue; - if (strcmp(sym->s_name, msym->s_name) != 0) - continue; - return (sym); - } - } - - /* - * Set eq to 0 if there are struct/union members with the same name - * and different types and/or offsets. - */ - eq = 1; - for (csym = msym; csym != NULL; csym = csym->s_link) { - if (csym->s_scl != MOS && csym->s_scl != MOU) - continue; - if (strcmp(msym->s_name, csym->s_name) != 0) - continue; - for (sym = csym->s_link ; sym != NULL; sym = sym->s_link) { - int w; - - if (sym->s_scl != MOS && sym->s_scl != MOU) - continue; - if (strcmp(csym->s_name, sym->s_name) != 0) - continue; - if (csym->s_value.v_quad != sym->s_value.v_quad) { - eq = 0; - break; - } - w = 0; - eq = eqtype(csym->s_type, sym->s_type, 0, 0, &w) && !w; - if (!eq) - break; - if (csym->s_field != sym->s_field) { - eq = 0; - break; - } - if (csym->s_field) { - type_t *tp1, *tp2; - - tp1 = csym->s_type; - tp2 = sym->s_type; - if (tp1->t_flen != tp2->t_flen) { - eq = 0; - break; - } - if (tp1->t_foffs != tp2->t_foffs) { - eq = 0; - break; - } - } - } - if (!eq) - break; - } - - /* - * Now handle the case in which the left operand refers really - * to a struct/union, but the right operand is not member of it. - */ - if (str != NULL) { - /* illegal member use: %s */ - if (eq && tflag) { - warning(102, msym->s_name); - } else { - error(102, msym->s_name); - } - return (msym); - } - - /* - * Now the left operand of ARROW does not point to a struct/union - * or the left operand of POINT is no struct/union. - */ - if (eq) { - if (op == POINT) { - /* left operand of "." must be struct/union object */ - if (tflag) { - warning(103); - } else { - error(103); - } - } else { - /* left operand of "->" must be pointer to ... */ - if (tflag && tn->tn_type->t_tspec == PTR) { - warning(104); - } else { - error(104); - } - } - } else { - if (tflag) { - /* non-unique member requires struct/union %s */ - error(105, op == POINT ? "object" : "pointer"); - } else { - /* unacceptable operand of %s */ - error(111, modtab[op].m_name); - } - } - - return (msym); -} - -/* - * Create a tree node. Called for most operands except function calls, - * sizeof and casts. - * - * op operator - * ln left operand - * rn if not NULL, right operand - */ -tnode_t * -build(op_t op, tnode_t *ln, tnode_t *rn) -{ - mod_t *mp; - tnode_t *ntn; - type_t *rtp; - - mp = &modtab[op]; - - /* If there was an error in one of the operands, return. */ - if (ln == NULL || (mp->m_binary && rn == NULL)) - return (NULL); - - /* - * Apply class conversions to the left operand, but only if its - * value is needed or it is compared with null. - */ - if (mp->m_vctx || mp->m_tctx) - ln = cconv(ln); - /* - * The right operand is almost always in a test or value context, - * except if it is a struct or union member. - */ - if (mp->m_binary && op != ARROW && op != POINT) - rn = cconv(rn); - - /* - * Print some warnings for comparisons of unsigned values with - * constants lower than or equal to null. This must be done - * before promote() because otherwise unsigned char and unsigned - * short would be promoted to int. Also types are tested to be - * CHAR, which would also become int. - */ - if (mp->m_comp) - chkcomp(op, ln, rn); - - /* - * Promote the left operand if it is in a test or value context - */ - if (mp->m_vctx || mp->m_tctx) - ln = promote(op, 0, ln); - /* - * Promote the right operand, but only if it is no struct or - * union member, or if it is not to be assigned to the left operand - */ - if (mp->m_binary && op != ARROW && op != POINT && - op != ASSIGN && op != RETURN) { - rn = promote(op, 0, rn); - } - - /* - * If the result of the operation is different for signed or - * unsigned operands and one of the operands is signed only in - * ANSI C, print a warning. - */ - if (mp->m_tlansiu && ln->tn_op == CON && ln->tn_val->v_ansiu) { - /* ANSI C treats constant as unsigned, op %s */ - warning(218, mp->m_name); - ln->tn_val->v_ansiu = 0; - } - if (mp->m_transiu && rn->tn_op == CON && rn->tn_val->v_ansiu) { - /* ANSI C treats constant as unsigned, op %s */ - warning(218, mp->m_name); - rn->tn_val->v_ansiu = 0; - } - - /* Make sure both operands are of the same type */ - if (mp->m_balance || (tflag && (op == SHL || op == SHR))) - balance(op, &ln, &rn); - - /* - * Check types for compatibility with the operation and mutual - * compatibility. Return if there are serious problems. - */ - if (!typeok(op, 0, ln, rn)) - return (NULL); - - /* And now create the node. */ - switch (op) { - case POINT: - case ARROW: - ntn = bldstr(op, ln, rn); - break; - case INCAFT: - case DECAFT: - case INCBEF: - case DECBEF: - ntn = bldincdec(op, ln); - break; - case AMPER: - ntn = bldamper(ln, 0); - break; - case STAR: - ntn = mktnode(STAR, ln->tn_type->t_subt, ln, NULL); - break; - case PLUS: - case MINUS: - ntn = bldplmi(op, ln, rn); - break; - case SHL: - case SHR: - ntn = bldshft(op, ln, rn); - break; - case COLON: - ntn = bldcol(ln, rn); - break; - case ASSIGN: - case MULASS: - case DIVASS: - case MODASS: - case ADDASS: - case SUBASS: - case SHLASS: - case SHRASS: - case ANDASS: - case XORASS: - case ORASS: - case RETURN: - ntn = bldasgn(op, ln, rn); - break; - case COMMA: - case QUEST: - ntn = mktnode(op, rn->tn_type, ln, rn); - break; - default: - rtp = mp->m_logop ? gettyp(INT) : ln->tn_type; - if (!mp->m_binary && rn != NULL) - LERROR("build()"); - ntn = mktnode(op, rtp, ln, rn); - break; - } - - /* Return if an error occurred. */ - if (ntn == NULL) - return (NULL); - - /* Print a warning if precedence confusion is possible */ - if (mp->m_tpconf) - precconf(ntn); - - /* - * Print a warning if one of the operands is in a context where - * it is compared with null and if this operand is a constant. - */ - if (mp->m_tctx) { - if (ln->tn_op == CON || - ((mp->m_binary && op != QUEST) && rn->tn_op == CON)) { - if (hflag && !ccflg) - /* constant in conditional context */ - warning(161); - } - } - - /* Fold if the operator requires it */ - if (mp->m_fold) { - if (ln->tn_op == CON && (!mp->m_binary || rn->tn_op == CON)) { - if (mp->m_tctx) { - ntn = foldtst(ntn); - } else if (isftyp(ntn->tn_type->t_tspec)) { - ntn = foldflt(ntn); - } else { - ntn = fold(ntn); - } - } else if (op == QUEST && ln->tn_op == CON) { - ntn = ln->tn_val->v_quad ? rn->tn_left : rn->tn_right; - } - } - - return (ntn); -} - -/* - * Perform class conversions. - * - * Arrays of type T are converted into pointers to type T. - * Functions are converted to pointers to functions. - * Lvalues are converted to rvalues. - */ -tnode_t * -cconv(tnode_t *tn) -{ - type_t *tp; - - /* - * Array-lvalue (array of type T) is converted into rvalue - * (pointer to type T) - */ - if (tn->tn_type->t_tspec == ARRAY) { - if (!tn->tn_lvalue) { - /* operand of '%s' must be lvalue */ - /* XXX print correct operator */ - (void)gnuism(114, "", modtab[AMPER].m_name); - } - tn = mktnode(AMPER, tincref(tn->tn_type->t_subt, PTR), - tn, NULL); - } - - /* - * Expression of type function (function with return value of type T) - * in rvalue-expression (pointer to function with return value - * of type T) - */ - if (tn->tn_type->t_tspec == FUNC) - tn = bldamper(tn, 1); - - /* lvalue to rvalue */ - if (tn->tn_lvalue) { - tp = tduptyp(tn->tn_type); - tp->t_const = tp->t_volatile = 0; - tn = mktnode(LOAD, tp, tn, NULL); - } - - return (tn); -} - -/* - * Perform most type checks. First the types are checked using - * information from modtab[]. After that it is done by hand for - * more complicated operators and type combinations. - * - * If the types are ok, typeok() returns 1, otherwise 0. - */ -int -typeok(op_t op, int arg, tnode_t *ln, tnode_t *rn) -{ - mod_t *mp; - tspec_t lt, rt = NOTSPEC, lst = NOTSPEC, rst = NOTSPEC, olt = NOTSPEC, - ort = NOTSPEC; - type_t *ltp, *rtp = NULL, *lstp = NULL, *rstp = NULL; - tnode_t *tn; - - mp = &modtab[op]; - - if ((ltp = ln->tn_type) == NULL) - LERROR("typeok()"); - - if ((lt = ltp->t_tspec) == PTR) - lst = (lstp = ltp->t_subt)->t_tspec; - if (mp->m_binary) { - if ((rtp = rn->tn_type) == NULL) - LERROR("typeok()"); - if ((rt = rtp->t_tspec) == PTR) - rst = (rstp = rtp->t_subt)->t_tspec; - } - - if (mp->m_rqint) { - /* integer types required */ - if (!isityp(lt) || (mp->m_binary && !isityp(rt))) { - incompat(op, lt, rt); - return (0); - } - } else if (mp->m_rqsclt) { - /* scalar types required */ - if (!issclt(lt) || (mp->m_binary && !issclt(rt))) { - incompat(op, lt, rt); - return (0); - } - } else if (mp->m_rqatyp) { - /* arithmetic types required */ - if (!isatyp(lt) || (mp->m_binary && !isatyp(rt))) { - incompat(op, lt, rt); - return (0); - } - } - - if (op == SHL || op == SHR || op == SHLASS || op == SHRASS) { - /* - * For these operations we need the types before promotion - * and balancing. - */ - for (tn=ln; tn->tn_op==CVT && !tn->tn_cast; tn=tn->tn_left) - continue; - olt = tn->tn_type->t_tspec; - for (tn=rn; tn->tn_op==CVT && !tn->tn_cast; tn=tn->tn_left) - continue; - ort = tn->tn_type->t_tspec; - } - - switch (op) { - case POINT: - /* - * Most errors required by ANSI C are reported in strmemb(). - * Here we only must check for totally wrong things. - */ - if (lt == FUNC || lt == VOID || ltp->t_isfield || - ((lt != STRUCT && lt != UNION) && !ln->tn_lvalue)) { - /* Without tflag we already got an error */ - if (tflag) - /* unacceptable operand of %s */ - error(111, mp->m_name); - return (0); - } - /* Now we have an object we can create a pointer to */ - break; - case ARROW: - if (lt != PTR && !(tflag && isityp(lt))) { - /* Without tflag we got already an error */ - if (tflag) - /* unacceptable operand of %s */ - error(111, mp->m_name); - return (0); - } - break; - case INCAFT: - case DECAFT: - case INCBEF: - case DECBEF: - /* operands have scalar types (checked above) */ - if (!ln->tn_lvalue) { - if (ln->tn_op == CVT && ln->tn_cast && - ln->tn_left->tn_op == LOAD) { - /* a cast does not yield an lvalue */ - error(163); - } - /* operand of %s must be lvalue */ - error(114, "", mp->m_name); - return (0); - } else if (ltp->t_const) { - /* operand of %s must be modifiable lvalue */ - if (!tflag) - warning(115, "", mp->m_name); - } - break; - case AMPER: - if (lt == ARRAY || lt == FUNC) { - /* ok, a warning comes later (in bldamper()) */ - } else if (!ln->tn_lvalue) { - if (ln->tn_op == CVT && ln->tn_cast && - ln->tn_left->tn_op == LOAD) { - /* a cast does not yield an lvalue */ - error(163); - } - /* %soperand of %s must be lvalue */ - error(114, "", mp->m_name); - return (0); - } else if (issclt(lt)) { - if (ltp->t_isfield) { - /* cannot take address of bit-field */ - error(112); - return (0); - } - } else if (lt != STRUCT && lt != UNION) { - /* unacceptable operand of %s */ - error(111, mp->m_name); - return (0); - } - if (ln->tn_op == NAME && ln->tn_sym->s_reg) { - /* cannot take address of register %s */ - error(113, ln->tn_sym->s_name); - return (0); - } - break; - case STAR: - /* until now there were no type checks for this operator */ - if (lt != PTR) { - /* cannot dereference non-pointer type */ - error(96); - return (0); - } - break; - case PLUS: - /* operands have scalar types (checked above) */ - if ((lt == PTR && !isityp(rt)) || (rt == PTR && !isityp(lt))) { - incompat(op, lt, rt); - return (0); - } - break; - case MINUS: - /* operands have scalar types (checked above) */ - if (lt == PTR && (!isityp(rt) && rt != PTR)) { - incompat(op, lt, rt); - return (0); - } else if (rt == PTR && lt != PTR) { - incompat(op, lt, rt); - return (0); - } - if (lt == PTR && rt == PTR) { - if (!eqtype(lstp, rstp, 1, 0, NULL)) { - /* illegal pointer subtraction */ - error(116); - } - } - break; - case SHR: - /* operands have integer types (checked above) */ - if (pflag && !isutyp(lt)) { - /* - * The left operand is signed. This means that - * the operation is (possibly) nonportable. - */ - /* bitwise operation on signed value nonportable */ - if (ln->tn_op != CON) { - /* possibly nonportable */ - warning(117); - } else if (ln->tn_val->v_quad < 0) { - warning(120); - } - } else if (!tflag && !sflag && !isutyp(olt) && isutyp(ort)) { - /* - * The left operand would become unsigned in - * traditional C. - */ - if (hflag && - (ln->tn_op != CON || ln->tn_val->v_quad < 0)) { - /* semantics of %s change in ANSI C; use ... */ - warning(118, mp->m_name); - } - } else if (!tflag && !sflag && !isutyp(olt) && !isutyp(ort) && - psize(lt) < psize(rt)) { - /* - * In traditional C the left operand would be extended, - * possibly with 1, and then shifted. - */ - if (hflag && - (ln->tn_op != CON || ln->tn_val->v_quad < 0)) { - /* semantics of %s change in ANSI C; use ... */ - warning(118, mp->m_name); - } - } - goto shift; - case SHL: - /* - * ANSI C does not perform balancing for shift operations, - * but traditional C does. If the width of the right operand - * is greather than the width of the left operand, than in - * traditional C the left operand would be extendet to the - * width of the right operand. For SHL this may result in - * different results. - */ - if (psize(lt) < psize(rt)) { - /* - * XXX If both operands are constant make sure - * that there is really a differencs between - * ANSI C and traditional C. - */ - if (hflag) - /* semantics of %s change in ANSI C; use ... */ - warning(118, mp->m_name); - } - shift: - if (rn->tn_op == CON) { - if (!isutyp(rt) && rn->tn_val->v_quad < 0) { - /* negative shift */ - warning(121); - } else if ((uint64_t)rn->tn_val->v_quad == size(lt)) { - /* shift equal to size fo object */ - warning(267); - } else if ((uint64_t)rn->tn_val->v_quad > size(lt)) { - /* shift greater than size of object */ - warning(122); - } - } - break; - case EQ: - case NE: - /* - * Accept some things which are allowed with EQ and NE, - * but not with ordered comparisons. - */ - if (lt == PTR && ((rt == PTR && rst == VOID) || isityp(rt))) { - if (rn->tn_op == CON && rn->tn_val->v_quad == 0) - break; - } - if (rt == PTR && ((lt == PTR && lst == VOID) || isityp(lt))) { - if (ln->tn_op == CON && ln->tn_val->v_quad == 0) - break; - } - /* FALLTHROUGH */ - case LT: - case GT: - case LE: - case GE: - if ((lt == PTR || rt == PTR) && lt != rt) { - if (isityp(lt) || isityp(rt)) { - /* illegal comb. of pointer and int., op %s */ - warning(123, mp->m_name); - } else { - incompat(op, lt, rt); - return (0); - } - } else if (lt == PTR && rt == PTR) { - ptrcmpok(op, ln, rn); - } - break; - case QUEST: - if (!issclt(lt)) { - /* first operand must have scalar type, op ? : */ - error(170); - return (0); - } - while (rn->tn_op == CVT) - rn = rn->tn_left; - if (rn->tn_op != COLON) - LERROR("typeok()"); - break; - case COLON: - - if (isatyp(lt) && isatyp(rt)) - break; - - if (lt == STRUCT && rt == STRUCT && ltp->t_str == rtp->t_str) - break; - if (lt == UNION && rt == UNION && ltp->t_str == rtp->t_str) - break; - - /* combination of any pointer and 0, 0L or (void *)0 is ok */ - if (lt == PTR && ((rt == PTR && rst == VOID) || isityp(rt))) { - if (rn->tn_op == CON && rn->tn_val->v_quad == 0) - break; - } - if (rt == PTR && ((lt == PTR && lst == VOID) || isityp(lt))) { - if (ln->tn_op == CON && ln->tn_val->v_quad == 0) - break; - } - - if ((lt == PTR && isityp(rt)) || (isityp(lt) && rt == PTR)) { - /* illegal comb. of ptr. and int., op %s */ - warning(123, mp->m_name); - break; - } - - if (lt == VOID || rt == VOID) { - if (lt != VOID || rt != VOID) - /* incompatible types in conditional */ - warning(126); - break; - } - - if (lt == PTR && rt == PTR && ((lst == VOID && rst == FUNC) || - (lst == FUNC && rst == VOID))) { - /* (void *)0 handled above */ - if (sflag) - /* ANSI C forbids conv. of %s to %s, op %s */ - warning(305, "function pointer", "'void *'", - mp->m_name); - break; - } - - if (rt == PTR && lt == PTR) { - if (!eqtype(lstp, rstp, 1, 0, NULL)) - illptrc(mp, ltp, rtp); - break; - } - - /* incompatible types in conditional */ - error(126); - return (0); - - case ASSIGN: - case INIT: - case FARG: - case RETURN: - if (!asgntypok(op, arg, ln, rn)) - return (0); - goto assign; - case MULASS: - case DIVASS: - case MODASS: - goto assign; - case ADDASS: - case SUBASS: - /* operands have scalar types (checked above) */ - if ((lt == PTR && !isityp(rt)) || rt == PTR) { - incompat(op, lt, rt); - return (0); - } - goto assign; - case SHLASS: - goto assign; - case SHRASS: - if (pflag && !isutyp(lt) && !(tflag && isutyp(rt))) { - /* bitwise operation on s.v. possibly nonportabel */ - warning(117); - } - goto assign; - case ANDASS: - case XORASS: - case ORASS: - goto assign; - assign: - if (!ln->tn_lvalue) { - if (ln->tn_op == CVT && ln->tn_cast && - ln->tn_left->tn_op == LOAD) { - /* a cast does not yield an lvalue */ - error(163); - } - /* %soperand of %s must be lvalue */ - error(114, "left ", mp->m_name); - return (0); - } else if (ltp->t_const || ((lt == STRUCT || lt == UNION) && - conmemb(ltp))) { - /* %soperand of %s must be modifiable lvalue */ - if (!tflag) - warning(115, "left ", mp->m_name); - } - break; - case COMMA: - if (!modtab[ln->tn_op].m_sideeff) - nulleff(ln); - break; - /* LINTED (enumeration values not handled in switch) */ - case CON: - case CASE: - case PUSH: - case LOAD: - case ICALL: - case CVT: - case CALL: - case FSEL: - case STRING: - case NAME: - case LOGOR: - case LOGAND: - case OR: - case XOR: - case AND: - case MOD: - case DIV: - case MULT: - case UMINUS: - case UPLUS: - case DEC: - case INC: - case COMPL: - case NOT: - case NOOP: - break; - } - - if (mp->m_badeop && - (ltp->t_isenum || (mp->m_binary && rtp->t_isenum))) { - chkbeop(op, ln, rn); - } else if (mp->m_enumop && (ltp->t_isenum && rtp && rtp->t_isenum)) { - chkeop2(op, arg, ln, rn); - } else if (mp->m_enumop && (ltp->t_isenum || (rtp &&rtp->t_isenum))) { - chkeop1(op, arg, ln, rn); - } - - return (1); -} - -static void -ptrcmpok(op_t op, tnode_t *ln, tnode_t *rn) -{ - type_t *ltp, *rtp; - tspec_t lt, rt; - const char *lts, *rts; - - lt = (ltp = ln->tn_type)->t_subt->t_tspec; - rt = (rtp = rn->tn_type)->t_subt->t_tspec; - - if (lt == VOID || rt == VOID) { - if (sflag && (lt == FUNC || rt == FUNC)) { - /* (void *)0 already handled in typeok() */ - *(lt == FUNC ? <s : &rts) = "function pointer"; - *(lt == VOID ? <s : &rts) = "'void *'"; - /* ANSI C forbids comparison of %s with %s */ - warning(274, lts, rts); - } - return; - } - - if (!eqtype(ltp->t_subt, rtp->t_subt, 1, 0, NULL)) { - illptrc(&modtab[op], ltp, rtp); - return; - } - - if (lt == FUNC && rt == FUNC) { - if (sflag && op != EQ && op != NE) - /* ANSI C forbids ordered comp. of func ptr */ - warning(125); - } -} - -/* - * Checks type compatibility for ASSIGN, INIT, FARG and RETURN - * and prints warnings/errors if necessary. - * If the types are (almost) compatible, 1 is returned, otherwise 0. - */ -static int -asgntypok(op_t op, int arg, tnode_t *ln, tnode_t *rn) -{ - tspec_t lt, rt, lst = NOTSPEC, rst = NOTSPEC; - type_t *ltp, *rtp, *lstp = NULL, *rstp = NULL; - mod_t *mp; - const char *lts, *rts; - - if ((lt = (ltp = ln->tn_type)->t_tspec) == PTR) - lst = (lstp = ltp->t_subt)->t_tspec; - if ((rt = (rtp = rn->tn_type)->t_tspec) == PTR) - rst = (rstp = rtp->t_subt)->t_tspec; - mp = &modtab[op]; - - if (isatyp(lt) && isatyp(rt)) - return (1); - - if ((lt == STRUCT || lt == UNION) && (rt == STRUCT || rt == UNION)) - /* both are struct or union */ - return (ltp->t_str == rtp->t_str); - - /* 0, 0L and (void *)0 may be assigned to any pointer */ - if (lt == PTR && ((rt == PTR && rst == VOID) || isityp(rt))) { - if (rn->tn_op == CON && rn->tn_val->v_quad == 0) - return (1); - } - - if (lt == PTR && rt == PTR && (lst == VOID || rst == VOID)) { - /* two pointers, at least one pointer to void */ - if (sflag && (lst == FUNC || rst == FUNC)) { - /* comb. of ptr to func and ptr to void */ - *(lst == FUNC ? <s : &rts) = "function pointer"; - *(lst == VOID ? <s : &rts) = "'void *'"; - switch (op) { - case INIT: - case RETURN: - /* ANSI C forbids conversion of %s to %s */ - warning(303, rts, lts); - break; - case FARG: - /* ANSI C forbids conv. of %s to %s, arg #%d */ - warning(304, rts, lts, arg); - break; - default: - /* ANSI C forbids conv. of %s to %s, op %s */ - warning(305, rts, lts, mp->m_name); - break; - } - } - } - - if (lt == PTR && rt == PTR && (lst == VOID || rst == VOID || - eqtype(lstp, rstp, 1, 0, NULL))) { - /* compatible pointer types (qualifiers ignored) */ - if (!tflag && - ((!lstp->t_const && rstp->t_const) || - (!lstp->t_volatile && rstp->t_volatile))) { - /* left side has not all qualifiers of right */ - switch (op) { - case INIT: - case RETURN: - /* incompatible pointer types */ - warning(182); - break; - case FARG: - /* argument has incompat. ptr. type, arg #%d */ - warning(153, arg); - break; - default: - /* operands have incompat. ptr. types, op %s */ - warning(128, mp->m_name); - break; - } - } - return (1); - } - - if ((lt == PTR && isityp(rt)) || (isityp(lt) && rt == PTR)) { - switch (op) { - case INIT: - case RETURN: - /* illegal combination of pointer and integer */ - warning(183); - break; - case FARG: - /* illegal comb. of ptr. and int., arg #%d */ - warning(154, arg); - break; - default: - /* illegal comb. of ptr. and int., op %s */ - warning(123, mp->m_name); - break; - } - return (1); - } - - if (lt == PTR && rt == PTR) { - switch (op) { - case INIT: - case RETURN: - illptrc(NULL, ltp, rtp); - break; - case FARG: - /* argument has incompatible pointer type, arg #%d */ - warning(153, arg); - break; - default: - illptrc(mp, ltp, rtp); - break; - } - return (1); - } - - switch (op) { - case INIT: - /* initialisation type mismatch */ - error(185); - break; - case RETURN: - /* return value type mismatch */ - error(211); - break; - case FARG: - /* argument is incompatible with prototype, arg #%d */ - warning(155, arg); - break; - default: - incompat(op, lt, rt); - break; - } - - return (0); -} - -/* - * Prints a warning if an operator, which should be senseless for an - * enum type, is applied to an enum type. - */ -static void -chkbeop(op_t op, tnode_t *ln, tnode_t *rn) -{ - mod_t *mp; - - if (!eflag) - return; - - mp = &modtab[op]; - - if (!(ln->tn_type->t_isenum || - (mp->m_binary && rn->tn_type->t_isenum))) { - return; - } - - /* - * Enum as offset to a pointer is an exception (otherwise enums - * could not be used as array indizes). - */ - if (op == PLUS && - ((ln->tn_type->t_isenum && rn->tn_type->t_tspec == PTR) || - (rn->tn_type->t_isenum && ln->tn_type->t_tspec == PTR))) { - return; - } - - /* dubious operation on enum, op %s */ - warning(241, mp->m_name); - -} - -/* - * Prints a warning if an operator is applied to two different enum types. - */ -static void -chkeop2(op_t op, int arg, tnode_t *ln, tnode_t *rn) -{ - mod_t *mp; - - mp = &modtab[op]; - - if (ln->tn_type->t_enum != rn->tn_type->t_enum) { - switch (op) { - case INIT: - /* enum type mismatch in initialisation */ - warning(210); - break; - case FARG: - /* enum type mismatch, arg #%d */ - warning(156, arg); - break; - case RETURN: - /* return value type mismatch */ - warning(211); - break; - default: - /* enum type mismatch, op %s */ - warning(130, mp->m_name); - break; - } -#if 0 - } else if (mp->m_comp && op != EQ && op != NE) { - if (eflag) - /* dubious comparisons of enums */ - warning(243, mp->m_name); -#endif - } -} - -/* - * Prints a warning if an operator has both enum end other integer - * types. - */ -static void -chkeop1(op_t op, int arg, tnode_t *ln, tnode_t *rn) -{ - char lbuf[64], rbuf[64]; - - if (!eflag) - return; - - switch (op) { - case INIT: - /* - * Initializations with 0 should be allowed. Otherwise, - * we should complain about all uninitialized enums, - * consequently. - */ - if (!rn->tn_type->t_isenum && rn->tn_op == CON && - isityp(rn->tn_type->t_tspec) && rn->tn_val->v_quad == 0) { - return; - } - /* initialisation of '%s' with '%s' */ - warning(277, tyname(lbuf, sizeof(lbuf), ln->tn_type), - tyname(rbuf, sizeof(rbuf), rn->tn_type)); - break; - case FARG: - /* combination of '%s' and '%s', arg #%d */ - warning(278, tyname(lbuf, sizeof(lbuf), ln->tn_type), - tyname(rbuf, sizeof(rbuf), rn->tn_type), arg); - break; - case RETURN: - /* combination of '%s' and '%s' in return */ - warning(279, tyname(lbuf, sizeof(lbuf), ln->tn_type), - tyname(rbuf, sizeof(rbuf), rn->tn_type)); - break; - default: - /* combination of '%s' and %s, op %s */ - warning(242, tyname(lbuf, sizeof(lbuf), ln->tn_type), - tyname(rbuf, sizeof(rbuf), rn->tn_type), - modtab[op].m_name); - break; - } -} - -/* - * Build and initialize a new node. - */ -static tnode_t * -mktnode(op_t op, type_t *type, tnode_t *ln, tnode_t *rn) -{ - tnode_t *ntn; - tspec_t t; - - ntn = getnode(); - - ntn->tn_op = op; - ntn->tn_type = type; - ntn->tn_left = ln; - ntn->tn_right = rn; - - if (op == STAR || op == FSEL) { - if (ln->tn_type->t_tspec == PTR) { - t = ln->tn_type->t_subt->t_tspec; - if (t != FUNC && t != VOID) - ntn->tn_lvalue = 1; - } else { - LERROR("mktnode()"); - } - } - - return (ntn); -} - -/* - * Performs usual conversion of operands to (unsigned) int. - * - * If tflag is set or the operand is a function argument with no - * type information (no prototype or variable # of args), convert - * float to double. - */ -tnode_t * -promote(op_t op, int farg, tnode_t *tn) -{ - tspec_t t; - type_t *ntp; - int len; - - t = tn->tn_type->t_tspec; - - if (!isatyp(t)) - return (tn); - - if (!tflag) { - /* - * ANSI C requires that the result is always of type INT - * if INT can represent all possible values of the previous - * type. - */ - if (tn->tn_type->t_isfield) { - len = tn->tn_type->t_flen; - if (size(INT) > len) { - t = INT; - } else { - if (size(INT) != len) - LERROR("promote()"); - if (isutyp(t)) { - t = UINT; - } else { - t = INT; - } - } - } else if (t == CHAR || t == UCHAR || t == SCHAR) { - t = (size(CHAR) < size(INT) || t != UCHAR) ? - INT : UINT; - } else if (t == SHORT || t == USHORT) { - t = (size(SHORT) < size(INT) || t == SHORT) ? - INT : UINT; - } else if (t == ENUM) { - t = INT; - } else if (farg && t == FLOAT) { - t = DOUBLE; - } - } else { - /* - * In traditional C, keep unsigned and promote FLOAT - * to DOUBLE. - */ - if (t == UCHAR || t == USHORT) { - t = UINT; - } else if (t == CHAR || t == SCHAR || t == SHORT) { - t = INT; - } else if (t == FLOAT) { - t = DOUBLE; - } else if (t == ENUM) { - t = INT; - } - } - - if (t != tn->tn_type->t_tspec) { - ntp = tduptyp(tn->tn_type); - ntp->t_tspec = t; - /* - * Keep t_isenum so we are later able to check compatibility - * of enum types. - */ - tn = convert(op, 0, ntp, tn); - } - - return (tn); -} - -/* - * Insert conversions which are necessary to give both operands the same - * type. This is done in different ways for traditional C and ANSI C. - */ -static void -balance(op_t op, tnode_t **lnp, tnode_t **rnp) -{ - tspec_t lt, rt, t; - int i, u; - type_t *ntp; - static tspec_t tl[] = { - LDOUBLE, DOUBLE, FLOAT, UQUAD, QUAD, ULONG, LONG, UINT, INT, - }; - - lt = (*lnp)->tn_type->t_tspec; - rt = (*rnp)->tn_type->t_tspec; - - if (!isatyp(lt) || !isatyp(rt)) - return; - - if (!tflag) { - if (lt == rt) { - t = lt; - } else if (lt == LDOUBLE || rt == LDOUBLE) { - t = LDOUBLE; - } else if (lt == DOUBLE || rt == DOUBLE) { - t = DOUBLE; - } else if (lt == FLOAT || rt == FLOAT) { - t = FLOAT; - } else { - /* - * If type A has more bits than type B it should - * be able to hold all possible values of type B. - */ - if (size(lt) > size(rt)) { - t = lt; - } else if (size(lt) < size(rt)) { - t = rt; - } else { - for (i = 3; tl[i] != INT; i++) { - if (tl[i] == lt || tl[i] == rt) - break; - } - if ((isutyp(lt) || isutyp(rt)) && - !isutyp(tl[i])) { - i--; - } - t = tl[i]; - } - } - } else { - /* Keep unsigned in traditional C */ - u = isutyp(lt) || isutyp(rt); - for (i = 0; tl[i] != INT; i++) { - if (lt == tl[i] || rt == tl[i]) - break; - } - t = tl[i]; - if (u && isityp(t) && !isutyp(t)) - t = utyp(t); - } - - if (t != lt) { - ntp = tduptyp((*lnp)->tn_type); - ntp->t_tspec = t; - *lnp = convert(op, 0, ntp, *lnp); - } - if (t != rt) { - ntp = tduptyp((*rnp)->tn_type); - ntp->t_tspec = t; - *rnp = convert(op, 0, ntp, *rnp); - } -} - -/* - * Insert a conversion operator, which converts the type of the node - * to another given type. - * If op is FARG, arg is the number of the argument (used for warnings). - */ -tnode_t * -convert(op_t op, int arg, type_t *tp, tnode_t *tn) -{ - tnode_t *ntn; - tspec_t nt, ot, ost = NOTSPEC; - - if (tn->tn_lvalue) - LERROR("convert()"); - - nt = tp->t_tspec; - if ((ot = tn->tn_type->t_tspec) == PTR) - ost = tn->tn_type->t_subt->t_tspec; - - if (!tflag && !sflag && op == FARG) - ptconv(arg, nt, ot, tp, tn); - if (isityp(nt) && isityp(ot)) { - iiconv(op, arg, nt, ot, tp, tn); - } else if (nt == PTR && ((ot == PTR && ost == VOID) || isityp(ot)) && - tn->tn_op == CON && tn->tn_val->v_quad == 0) { - /* 0, 0L and (void *)0 may be assigned to any pointer. */ - } else if (isityp(nt) && ot == PTR) { - piconv(op, nt, tp, tn); - } else if (nt == PTR && ot == PTR) { - ppconv(op, tn, tp); - } - - ntn = getnode(); - ntn->tn_op = CVT; - ntn->tn_type = tp; - ntn->tn_cast = op == CVT; - if (tn->tn_op != CON || nt == VOID) { - ntn->tn_left = tn; - } else { - ntn->tn_op = CON; - ntn->tn_val = tgetblk(sizeof (val_t)); - cvtcon(op, arg, ntn->tn_type, ntn->tn_val, tn->tn_val); - } - - return (ntn); -} - -/* - * Print a warning if a prototype causes a type conversion that is - * different from what would happen to the same argument in the - * absence of a prototype. - * - * Errors/Warnings about illegal type combinations are already printed - * in asgntypok(). - */ -static void -ptconv(int arg, tspec_t nt, tspec_t ot, type_t *tp, tnode_t *tn) -{ - tnode_t *ptn; - char buf[64]; - - if (!isatyp(nt) || !isatyp(ot)) - return; - - /* - * If the type of the formal parameter is char/short, a warning - * would be useless, because functions declared the old style - * can't expect char/short arguments. - */ - if (nt == CHAR || nt == UCHAR || nt == SHORT || nt == USHORT) - return; - - /* get default promotion */ - ptn = promote(NOOP, 1, tn); - ot = ptn->tn_type->t_tspec; - - /* return if types are the same with and without prototype */ - if (nt == ot || (nt == ENUM && ot == INT)) - return; - - if (isftyp(nt) != isftyp(ot) || psize(nt) != psize(ot)) { - /* representation and/or width change */ - if (!isityp(ot) || psize(ot) > psize(INT)) { - /* conversion to '%s' due to prototype, arg #%d */ - warning(259, tyname(buf, sizeof(buf), tp), arg); - } - } else if (hflag) { - /* - * they differ in sign or base type (char, short, int, - * long, long long, float, double, long double) - * - * if they differ only in sign and the argument is a constant - * and the msb of the argument is not set, print no warning - */ - if (ptn->tn_op == CON && isityp(nt) && styp(nt) == styp(ot) && - msb(ptn->tn_val->v_quad, ot, -1) == 0) { - /* ok */ - } else { - /* conversion to '%s' due to prototype, arg #%d */ - warning(259, tyname(buf, sizeof(buf), tp), arg); - } - } -} - -/* - * Print warnings for conversions of integer types which may cause - * problems. - */ -/* ARGSUSED */ -static void -iiconv(op_t op, int arg, tspec_t nt, tspec_t ot, type_t *tp, tnode_t *tn) -{ - char lbuf[64], rbuf[64]; - if (tn->tn_op == CON) - return; - - if (op == CVT) - return; - -#if 0 - if (psize(nt) > psize(ot) && isutyp(nt) != isutyp(ot)) { - /* conversion to %s may sign-extend incorrectly (, arg #%d) */ - if (aflag && pflag) { - if (op == FARG) { - warning(297, tyname(lbuf, sizeof(lbuf), tp), - arg); - } else { - warning(131, tyname(lbuf, sizeof(lbuf), tp)); - } - } - } -#endif - - if (psize(nt) < psize(ot) && - (ot == LONG || ot == ULONG || ot == QUAD || ot == UQUAD || - aflag > 1)) { - /* conversion from '%s' may lose accuracy */ - if (aflag) { - if (op == FARG) { - warning(298, - tyname(rbuf, sizeof(rbuf), tn->tn_type), - tyname(lbuf, sizeof(lbuf), tp), - arg); - } else { - warning(132, - tyname(rbuf, sizeof(rbuf), tn->tn_type), - tyname(lbuf, sizeof(lbuf), tp)); - } - } - } -} - -/* - * Print warnings for dubious conversions of pointer to integer. - */ -static void -piconv(op_t op, tspec_t nt, type_t *tp, tnode_t *tn) -{ - char buf[64]; - - if (tn->tn_op == CON) - return; - - if (op != CVT) { - /* We already got an error. */ - return; - } - - if (psize(nt) < psize(PTR)) { - if (pflag && size(nt) >= size(PTR)) { - /* conv. of pointer to %s may lose bits */ - warning(134, tyname(buf, sizeof(buf), tp)); - } else { - /* conv. of pointer to %s loses bits */ - warning(133, tyname(buf, sizeof(buf), tp)); - } - } -} - -/* - * Print warnings for questionable pointer conversions. - */ -static void -ppconv(op_t op, tnode_t *tn, type_t *tp) -{ - tspec_t nt, ot; - const char *nts, *ots; - - /* - * We already got an error (pointers of different types - * without a cast) or we will not get a warning. - */ - if (op != CVT) - return; - - nt = tp->t_subt->t_tspec; - ot = tn->tn_type->t_subt->t_tspec; - - if (nt == VOID || ot == VOID) { - if (sflag && (nt == FUNC || ot == FUNC)) { - /* (void *)0 already handled in convert() */ - *(nt == FUNC ? &nts : &ots) = "function pointer"; - *(nt == VOID ? &nts : &ots) = "'void *'"; - /* ANSI C forbids conversion of %s to %s */ - warning(303, ots, nts); - } - return; - } else if (nt == FUNC && ot == FUNC) { - return; - } else if (nt == FUNC || ot == FUNC) { - /* questionable conversion of function pointer */ - warning(229); - return; - } - - if (getbound(tp->t_subt) > getbound(tn->tn_type->t_subt)) { - if (hflag) - /* possible pointer alignment problem */ - warning(135); - } - if (((nt == STRUCT || nt == UNION) && - tp->t_subt->t_str != tn->tn_type->t_subt->t_str) || - psize(nt) != psize(ot)) { - if (cflag) { - /* pointer casts may be troublesome */ - warning(247); - } - } -} - -/* - * Converts a typed constant in a constant of another type. - * - * op operator which requires conversion - * arg if op is FARG, # of argument - * tp type to which convert the constant - * nv new constant - * v old constant - */ -void -cvtcon(op_t op, int arg, type_t *tp, val_t *nv, val_t *v) -{ - char lbuf[64], rbuf[64]; - tspec_t ot, nt; - ldbl_t max = 0.0, min = 0.0; - int sz, rchk; - int64_t xmask, xmsk1; - int osz, nsz; - - ot = v->v_tspec; - nt = nv->v_tspec = tp->t_tspec; - rchk = 0; - - if (ot == FLOAT || ot == DOUBLE || ot == LDOUBLE) { - switch (nt) { - case CHAR: - max = CHAR_MAX; min = CHAR_MIN; break; - case UCHAR: - max = UCHAR_MAX; min = 0; break; - case SCHAR: - max = SCHAR_MAX; min = SCHAR_MIN; break; - case SHORT: - max = SHRT_MAX; min = SHRT_MIN; break; - case USHORT: - max = USHRT_MAX; min = 0; break; - case ENUM: - case INT: - max = INT_MAX; min = INT_MIN; break; - case UINT: - max = (u_int)UINT_MAX; min = 0; break; - case LONG: - max = LONG_MAX; min = LONG_MIN; break; - case ULONG: - max = (u_long)ULONG_MAX; min = 0; break; - case QUAD: - max = QUAD_MAX; min = QUAD_MIN; break; - case UQUAD: - max = (uint64_t)UQUAD_MAX; min = 0; break; - case FLOAT: - max = FLT_MAX; min = -FLT_MAX; break; - case DOUBLE: - max = DBL_MAX; min = -DBL_MAX; break; - case PTR: - /* Already got an error because of float --> ptr */ - case LDOUBLE: - max = LDBL_MAX; min = -LDBL_MAX; break; - default: - LERROR("cvtcon()"); - } - if (v->v_ldbl > max || v->v_ldbl < min) { - if (nt == LDOUBLE) - LERROR("cvtcon()"); - if (op == FARG) { - /* conv. of %s to %s is out of rng., arg #%d */ - warning(295, tyname(lbuf, sizeof(lbuf), - gettyp(ot)), tyname(rbuf, sizeof(rbuf), tp), - arg); - } else { - /* conversion of %s to %s is out of range */ - warning(119, tyname(lbuf, sizeof(lbuf), - gettyp(ot)), - tyname(rbuf, sizeof(rbuf), tp)); - } - v->v_ldbl = v->v_ldbl > 0 ? max : min; - } - if (nt == FLOAT) { - nv->v_ldbl = (float)v->v_ldbl; - } else if (nt == DOUBLE) { - nv->v_ldbl = (double)v->v_ldbl; - } else if (nt == LDOUBLE) { - nv->v_ldbl = v->v_ldbl; - } else { - nv->v_quad = (nt == PTR || isutyp(nt)) ? - (uint64_t)v->v_ldbl : (int64_t)v->v_ldbl; - } - } else { - if (nt == FLOAT) { - nv->v_ldbl = (ot == PTR || isutyp(ot)) ? - (float)(uint64_t)v->v_quad : (float)v->v_quad; - } else if (nt == DOUBLE) { - nv->v_ldbl = (ot == PTR || isutyp(ot)) ? - (double)(uint64_t)v->v_quad : (double)v->v_quad; - } else if (nt == LDOUBLE) { - nv->v_ldbl = (ot == PTR || isutyp(ot)) ? - (ldbl_t)(uint64_t)v->v_quad : (ldbl_t)v->v_quad; - } else { - rchk = 1; /* Check for lost precision. */ - nv->v_quad = v->v_quad; - } - } - - if (v->v_ansiu && isftyp(nt)) { - /* ANSI C treats constant as unsigned */ - warning(157); - v->v_ansiu = 0; - } else if (v->v_ansiu && (isityp(nt) && !isutyp(nt) && - psize(nt) > psize(ot))) { - /* ANSI C treats constant as unsigned */ - warning(157); - v->v_ansiu = 0; - } - - if (nt != FLOAT && nt != DOUBLE && nt != LDOUBLE) { - sz = tp->t_isfield ? tp->t_flen : size(nt); - nv->v_quad = xsign(nv->v_quad, nt, sz); - } - - if (rchk && op != CVT) { - osz = size(ot); - nsz = tp->t_isfield ? tp->t_flen : size(nt); - xmask = qlmasks[nsz] ^ qlmasks[osz]; - xmsk1 = qlmasks[nsz] ^ qlmasks[osz - 1]; - /* - * For bitwise operations we are not interested in the - * value, but in the bits itself. - */ - if (op == ORASS || op == OR || op == XOR) { - /* - * Print a warning if bits which were set are - * lost due to the conversion. - * This can happen with operator ORASS only. - */ - if (nsz < osz && (v->v_quad & xmask) != 0) { - /* constant truncated by conv., op %s */ - warning(306, modtab[op].m_name); - } - } else if (op == ANDASS || op == AND) { - /* - * Print a warning if additional bits are not all 1 - * and the most significant bit of the old value is 1, - * or if at least one (but not all) removed bit was 0. - */ - if (nsz > osz && - (nv->v_quad & qbmasks[osz - 1]) != 0 && - (nv->v_quad & xmask) != xmask) { - /* - * extra bits set to 0 in conversion - * of '%s' to '%s', op %s - */ - warning(309, tyname(lbuf, sizeof(lbuf), - gettyp(ot)), tyname(rbuf, sizeof(rbuf), tp), - modtab[op].m_name); - } else if (nsz < osz && - (v->v_quad & xmask) != xmask && - (v->v_quad & xmask) != 0) { - /* const. truncated by conv., op %s */ - warning(306, modtab[op].m_name); - } - } else if ((nt != PTR && isutyp(nt)) && - (ot != PTR && !isutyp(ot)) && v->v_quad < 0) { - if (op == ASSIGN) { - /* assignment of negative constant to ... */ - warning(164); - } else if (op == INIT) { - /* initialisation of unsigned with neg. ... */ - warning(221); - } else if (op == FARG) { - /* conversion of neg. const. to ..., arg #%d */ - warning(296, arg); - } else if (modtab[op].m_comp) { - /* we get this warning already in chkcomp() */ - } else { - /* conversion of negative constant to ... */ - warning(222); - } - } else if (nv->v_quad != v->v_quad && nsz <= osz && - (v->v_quad & xmask) != 0 && - (isutyp(ot) || (v->v_quad & xmsk1) != xmsk1)) { - /* - * Loss of significant bit(s). All truncated bits - * of unsigned types or all truncated bits plus the - * msb of the target for signed types are considered - * to be significant bits. Loss of significant bits - * means that at least on of the bits was set in an - * unsigned type or that at least one, but not all of - * the bits was set in a signed type. - * Loss of significant bits means that it is not - * possible, also not with necessary casts, to convert - * back to the original type. An example for a - * necessary cast is: - * char c; int i; c = 128; - * i = c; ** yields -128 ** - * i = (unsigned char)c; ** yields 128 ** - */ - if (op == ASSIGN && tp->t_isfield) { - /* precision lost in bit-field assignment */ - warning(166); - } else if (op == ASSIGN) { - /* constant truncated by assignment */ - warning(165); - } else if (op == INIT && tp->t_isfield) { - /* bit-field initializer does not fit */ - warning(180); - } else if (op == INIT) { - /* initializer does not fit */ - warning(178); - } else if (op == CASE) { - /* case label affected by conversion */ - warning(196); - } else if (op == FARG) { - /* conv. of %s to %s is out of rng., arg #%d */ - warning(295, tyname(lbuf, sizeof(lbuf), - gettyp(ot)), tyname(rbuf, sizeof(rbuf), tp), - arg); - } else { - /* conversion of %s to %s is out of range */ - warning(119, tyname(lbuf, sizeof(lbuf), - gettyp(ot)), - tyname(rbuf, sizeof(rbuf), tp)); - } - } else if (nv->v_quad != v->v_quad) { - if (op == ASSIGN && tp->t_isfield) { - /* precision lost in bit-field assignment */ - warning(166); - } else if (op == INIT && tp->t_isfield) { - /* bit-field initializer out of range */ - warning(11); - } else if (op == CASE) { - /* case label affected by conversion */ - warning(196); - } else if (op == FARG) { - /* conv. of %s to %s is out of rng., arg #%d */ - warning(295, tyname(lbuf, sizeof(lbuf), - gettyp(ot)), tyname(rbuf, sizeof(rbuf), tp), - arg); - } else { - /* conversion of %s to %s is out of range */ - warning(119, tyname(lbuf, sizeof(lbuf), - gettyp(ot)), - tyname(rbuf, sizeof(rbuf), tp)); - } - } - } -} - -/* - * Called if incompatible types were detected. - * Prints an appropriate warning. - */ -static void -incompat(op_t op, tspec_t lt, tspec_t rt) -{ - mod_t *mp; - - mp = &modtab[op]; - - if (lt == VOID || (mp->m_binary && rt == VOID)) { - /* void type illegal in expression */ - error(109); - } else if (op == ASSIGN) { - if ((lt == STRUCT || lt == UNION) && - (rt == STRUCT || rt == UNION)) { - /* assignment of different structures */ - error(240); - } else { - /* assignment type mismatch */ - error(171); - } - } else if (mp->m_binary) { - /* operands of %s have incompatible types */ - error(107, mp->m_name); - } else { - /* operand of %s has incompatible type */ - error(108, mp->m_name); - } -} - -/* - * Called if incompatible pointer types are detected. - * Print an appropriate warning. - */ -static void -illptrc(mod_t *mp, type_t *ltp, type_t *rtp) -{ - tspec_t lt, rt; - - if (ltp->t_tspec != PTR || rtp->t_tspec != PTR) - LERROR("illptrc()"); - - lt = ltp->t_subt->t_tspec; - rt = rtp->t_subt->t_tspec; - - if ((lt == STRUCT || lt == UNION) && (rt == STRUCT || rt == UNION)) { - if (mp == NULL) { - /* illegal structure pointer combination */ - warning(244); - } else { - /* illegal structure pointer combination, op %s */ - warning(245, mp->m_name); - } - } else { - if (mp == NULL) { - /* illegal pointer combination */ - warning(184); - } else { - /* illegal pointer combination, op %s */ - warning(124, mp->m_name); - } - } -} - -/* - * Make sure type (*tpp)->t_subt has at least the qualifiers - * of tp1->t_subt and tp2->t_subt. - */ -static void -mrgqual(type_t **tpp, type_t *tp1, type_t *tp2) -{ - - if ((*tpp)->t_tspec != PTR || - tp1->t_tspec != PTR || tp2->t_tspec != PTR) { - LERROR("mrgqual()"); - } - - if ((*tpp)->t_subt->t_const == - (tp1->t_subt->t_const | tp2->t_subt->t_const) && - (*tpp)->t_subt->t_volatile == - (tp1->t_subt->t_volatile | tp2->t_subt->t_volatile)) { - return; - } - - *tpp = tduptyp(*tpp); - (*tpp)->t_subt = tduptyp((*tpp)->t_subt); - (*tpp)->t_subt->t_const = - tp1->t_subt->t_const | tp2->t_subt->t_const; - (*tpp)->t_subt->t_volatile = - tp1->t_subt->t_volatile | tp2->t_subt->t_volatile; -} - -/* - * Returns 1 if the given structure or union has a constant member - * (maybe recursively). - */ -static int -conmemb(type_t *tp) -{ - sym_t *m; - tspec_t t; - - if ((t = tp->t_tspec) != STRUCT && t != UNION) - LERROR("conmemb()"); - for (m = tp->t_str->memb; m != NULL; m = m->s_nxt) { - tp = m->s_type; - if (tp->t_const) - return (1); - if ((t = tp->t_tspec) == STRUCT || t == UNION) { - if (conmemb(m->s_type)) - return (1); - } - } - return (0); -} - -const char * -basictyname(tspec_t t) -{ - switch (t) { - case CHAR: return "char"; - case UCHAR: return "unsigned char"; - case SCHAR: return "signed char"; - case SHORT: return "short"; - case USHORT: return "unsigned short"; - case INT: return "int"; - case UINT: return "unsigned int"; - case LONG: return "long"; - case ULONG: return "unsigned long"; - case QUAD: return "long long"; - case UQUAD: return "unsigned long long"; - case FLOAT: return "float"; - case DOUBLE: return "double"; - case LDOUBLE: return "long double"; - case PTR: return "pointer"; - case ENUM: return "enum"; - case STRUCT: return "struct"; - case UNION: return "union"; - case FUNC: return "function"; - case ARRAY: return "array"; - default: - LERROR("basictyname()"); - return NULL; - } -} - -const char * -tyname(char *buf, size_t bufsiz, type_t *tp) -{ - tspec_t t; - const char *s; - char lbuf[64]; - - if ((t = tp->t_tspec) == INT && tp->t_isenum) - t = ENUM; - - s = basictyname(t); - - - switch (t) { - case CHAR: - case UCHAR: - case SCHAR: - case SHORT: - case USHORT: - case INT: - case UINT: - case LONG: - case ULONG: - case QUAD: - case UQUAD: - case FLOAT: - case DOUBLE: - case LDOUBLE: - case FUNC: - (void)snprintf(buf, bufsiz, "%s", s); - break; - case PTR: - (void)snprintf(buf, bufsiz, "%s to %s", s, - tyname(lbuf, sizeof(lbuf), tp->t_subt)); - break; - case ENUM: - (void)snprintf(buf, bufsiz, "%s %s", s, - tp->t_enum->etag->s_name); - break; - case STRUCT: - case UNION: - (void)snprintf(buf, bufsiz, "%s %s", s, - tp->t_str->stag->s_name); - break; - case ARRAY: - (void)snprintf(buf, bufsiz, "%s of %s[%d]", s, - tyname(lbuf, sizeof(lbuf), tp->t_subt), tp->t_dim); - break; - default: - LERROR("tyname()"); - } - return (buf); -} - -/* - * Create a new node for one of the operators POINT and ARROW. - */ -static tnode_t * -bldstr(op_t op, tnode_t *ln, tnode_t *rn) -{ - tnode_t *ntn, *ctn; - int nolval; - - if (rn->tn_op != NAME) - LERROR("bldstr()"); - if (rn->tn_sym->s_value.v_tspec != INT) - LERROR("bldstr()"); - if (rn->tn_sym->s_scl != MOS && rn->tn_sym->s_scl != MOU) - LERROR("bldstr()"); - - /* - * Remember if the left operand is an lvalue (structure members - * are lvalues if and only if the structure itself is an lvalue). - */ - nolval = op == POINT && !ln->tn_lvalue; - - if (op == POINT) { - ln = bldamper(ln, 1); - } else if (ln->tn_type->t_tspec != PTR) { - if (!tflag || !isityp(ln->tn_type->t_tspec)) - LERROR("bldstr()"); - ln = convert(NOOP, 0, tincref(gettyp(VOID), PTR), ln); - } - -#if PTRDIFF_IS_LONG - ctn = getinode(LONG, rn->tn_sym->s_value.v_quad / CHAR_BIT); -#else - ctn = getinode(INT, rn->tn_sym->s_value.v_quad / CHAR_BIT); -#endif - - ntn = mktnode(PLUS, tincref(rn->tn_type, PTR), ln, ctn); - if (ln->tn_op == CON) - ntn = fold(ntn); - - if (rn->tn_type->t_isfield) { - ntn = mktnode(FSEL, ntn->tn_type->t_subt, ntn, NULL); - } else { - ntn = mktnode(STAR, ntn->tn_type->t_subt, ntn, NULL); - } - - if (nolval) - ntn->tn_lvalue = 0; - - return (ntn); -} - -/* - * Create a node for INCAFT, INCBEF, DECAFT and DECBEF. - */ -static tnode_t * -bldincdec(op_t op, tnode_t *ln) -{ - tnode_t *cn, *ntn; - - if (ln == NULL) - LERROR("bldincdec()"); - - if (ln->tn_type->t_tspec == PTR) { - cn = plength(ln->tn_type); - } else { - cn = getinode(INT, (int64_t)1); - } - ntn = mktnode(op, ln->tn_type, ln, cn); - - return (ntn); -} - -/* - * Create a tree node for the & operator - */ -static tnode_t * -bldamper(tnode_t *tn, int noign) -{ - tnode_t *ntn; - tspec_t t; - - if (!noign && ((t = tn->tn_type->t_tspec) == ARRAY || t == FUNC)) { - /* & before array or function: ignored */ - if (tflag) - warning(127); - return (tn); - } - - /* eliminate &* */ - if (tn->tn_op == STAR && - tn->tn_left->tn_type->t_tspec == PTR && - tn->tn_left->tn_type->t_subt == tn->tn_type) { - return (tn->tn_left); - } - - ntn = mktnode(AMPER, tincref(tn->tn_type, PTR), tn, NULL); - - return (ntn); -} - -/* - * Create a node for operators PLUS and MINUS. - */ -static tnode_t * -bldplmi(op_t op, tnode_t *ln, tnode_t *rn) -{ - tnode_t *ntn, *ctn; - type_t *tp; - - /* If pointer and integer, then pointer to the lhs. */ - if (rn->tn_type->t_tspec == PTR && isityp(ln->tn_type->t_tspec)) { - ntn = ln; - ln = rn; - rn = ntn; - } - - if (ln->tn_type->t_tspec == PTR && rn->tn_type->t_tspec != PTR) { - - if (!isityp(rn->tn_type->t_tspec)) - LERROR("bldplmi()"); - - ctn = plength(ln->tn_type); - if (rn->tn_type->t_tspec != ctn->tn_type->t_tspec) - rn = convert(NOOP, 0, ctn->tn_type, rn); - rn = mktnode(MULT, rn->tn_type, rn, ctn); - if (rn->tn_left->tn_op == CON) - rn = fold(rn); - ntn = mktnode(op, ln->tn_type, ln, rn); - - } else if (rn->tn_type->t_tspec == PTR) { - - if (ln->tn_type->t_tspec != PTR || op != MINUS) - LERROR("bldplmi()"); -#if PTRDIFF_IS_LONG - tp = gettyp(LONG); -#else - tp = gettyp(INT); -#endif - ntn = mktnode(op, tp, ln, rn); - if (ln->tn_op == CON && rn->tn_op == CON) - ntn = fold(ntn); - ctn = plength(ln->tn_type); - balance(NOOP, &ntn, &ctn); - ntn = mktnode(DIV, tp, ntn, ctn); - - } else { - - ntn = mktnode(op, ln->tn_type, ln, rn); - - } - return (ntn); -} - -/* - * Create a node for operators SHL and SHR. - */ -static tnode_t * -bldshft(op_t op, tnode_t *ln, tnode_t *rn) -{ - tspec_t t; - tnode_t *ntn; - - if ((t = rn->tn_type->t_tspec) != INT && t != UINT) - rn = convert(CVT, 0, gettyp(INT), rn); - ntn = mktnode(op, ln->tn_type, ln, rn); - return (ntn); -} - -/* - * Create a node for COLON. - */ -static tnode_t * -bldcol(tnode_t *ln, tnode_t *rn) -{ - tspec_t lt, rt, pdt; - type_t *rtp; - tnode_t *ntn; - - lt = ln->tn_type->t_tspec; - rt = rn->tn_type->t_tspec; -#if PTRDIFF_IS_LONG - pdt = LONG; -#else - pdt = INT; -#endif - - /* - * Arithmetic types are balanced, all other type combinations - * still need to be handled. - */ - if (isatyp(lt) && isatyp(rt)) { - rtp = ln->tn_type; - } else if (lt == VOID || rt == VOID) { - rtp = gettyp(VOID); - } else if (lt == STRUCT || lt == UNION) { - /* Both types must be identical. */ - if (rt != STRUCT && rt != UNION) - LERROR("bldcol()"); - if (ln->tn_type->t_str != rn->tn_type->t_str) - LERROR("bldcol()"); - if (incompl(ln->tn_type)) { - /* unknown operand size, op %s */ - error(138, modtab[COLON].m_name); - return (NULL); - } - rtp = ln->tn_type; - } else if (lt == PTR && isityp(rt)) { - if (rt != pdt) { - rn = convert(NOOP, 0, gettyp(pdt), rn); - rt = pdt; - } - rtp = ln->tn_type; - } else if (rt == PTR && isityp(lt)) { - if (lt != pdt) { - ln = convert(NOOP, 0, gettyp(pdt), ln); - lt = pdt; - } - rtp = rn->tn_type; - } else if (lt == PTR && ln->tn_type->t_subt->t_tspec == VOID) { - if (rt != PTR) - LERROR("bldcol()"); - rtp = ln->tn_type; - mrgqual(&rtp, ln->tn_type, rn->tn_type); - } else if (rt == PTR && rn->tn_type->t_subt->t_tspec == VOID) { - if (lt != PTR) - LERROR("bldcol()"); - rtp = rn->tn_type; - mrgqual(&rtp, ln->tn_type, rn->tn_type); - } else { - if (lt != PTR || rt != PTR) - LERROR("bldcol()"); - /* - * XXX For now we simply take the left type. This is - * probably wrong, if one type contains a function prototype - * and the other one, at the same place, only an old style - * declaration. - */ - rtp = ln->tn_type; - mrgqual(&rtp, ln->tn_type, rn->tn_type); - } - - ntn = mktnode(COLON, rtp, ln, rn); - - return (ntn); -} - -/* - * Create a node for an assignment operator (both = and op= ). - */ -static tnode_t * -bldasgn(op_t op, tnode_t *ln, tnode_t *rn) -{ - tspec_t lt, rt; - tnode_t *ntn, *ctn; - - if (ln == NULL || rn == NULL) - LERROR("bldasgn()"); - - lt = ln->tn_type->t_tspec; - rt = rn->tn_type->t_tspec; - - if ((op == ADDASS || op == SUBASS) && lt == PTR) { - if (!isityp(rt)) - LERROR("bldasgn()"); - ctn = plength(ln->tn_type); - if (rn->tn_type->t_tspec != ctn->tn_type->t_tspec) - rn = convert(NOOP, 0, ctn->tn_type, rn); - rn = mktnode(MULT, rn->tn_type, rn, ctn); - if (rn->tn_left->tn_op == CON) - rn = fold(rn); - } - - if ((op == ASSIGN || op == RETURN) && (lt == STRUCT || rt == STRUCT)) { - if (rt != lt || ln->tn_type->t_str != rn->tn_type->t_str) - LERROR("bldasgn()"); - if (incompl(ln->tn_type)) { - if (op == RETURN) { - /* cannot return incomplete type */ - error(212); - } else { - /* unknown operand size, op %s */ - error(138, modtab[op].m_name); - } - return (NULL); - } - } - - if (op == SHLASS) { - if (psize(lt) < psize(rt)) { - if (hflag) - /* semantics of %s change in ANSI C; use ... */ - warning(118, "<<="); - } - } else if (op != SHRASS) { - if (op == ASSIGN || lt != PTR) { - if (lt != rt || - (ln->tn_type->t_isfield && rn->tn_op == CON)) { - rn = convert(op, 0, ln->tn_type, rn); - rt = lt; - } - } - } - - ntn = mktnode(op, ln->tn_type, ln, rn); - - return (ntn); -} - -/* - * Get length of type tp->t_subt. - */ -static tnode_t * -plength(type_t *tp) -{ - int elem, elsz; - tspec_t st; - - if (tp->t_tspec != PTR) - LERROR("plength()"); - tp = tp->t_subt; - - elem = 1; - elsz = 0; - - while (tp->t_tspec == ARRAY) { - elem *= tp->t_dim; - tp = tp->t_subt; - } - - switch (tp->t_tspec) { - case FUNC: - /* pointer to function is not allowed here */ - error(110); - break; - case VOID: - /* cannot do pointer arithmetic on operand of ... */ - (void)gnuism(136); - break; - case STRUCT: - case UNION: - if ((elsz = tp->t_str->size) == 0) - /* cannot do pointer arithmetic on operand of ... */ - error(136); - break; - case ENUM: - if (incompl(tp)) { - /* cannot do pointer arithmetic on operand of ... */ - warning(136); - } - /* FALLTHROUGH */ - default: - if ((elsz = size(tp->t_tspec)) == 0) { - /* cannot do pointer arithmetic on operand of ... */ - error(136); - } else if (elsz == -1) { - LERROR("plength()"); - } - break; - } - - if (elem == 0 && elsz != 0) { - /* cannot do pointer arithmetic on operand of ... */ - error(136); - } - - if (elsz == 0) - elsz = CHAR_BIT; - -#if PTRDIFF_IS_LONG - st = LONG; -#else - st = INT; -#endif - - return (getinode(st, (int64_t)(elem * elsz / CHAR_BIT))); -} - -/* - * XXX - * Note: There appear to be a number of bugs in detecting overflow in - * this function. An audit and a set of proper regression tests are needed. - * --Perry Metzger, Nov. 16, 2001 - */ -/* - * Do only as much as necessary to compute constant expressions. - * Called only if the operator allows folding and (both) operands - * are constants. - */ -static tnode_t * -fold(tnode_t *tn) -{ - val_t *v; - tspec_t t; - int utyp, ovfl; - int64_t sl, sr = 0, q = 0, mask; - uint64_t ul, ur = 0; - tnode_t *cn; - - if ((v = calloc(1, sizeof (val_t))) == NULL) - nomem(); - v->v_tspec = t = tn->tn_type->t_tspec; - - utyp = t == PTR || isutyp(t); - ul = sl = tn->tn_left->tn_val->v_quad; - if (modtab[tn->tn_op].m_binary) - ur = sr = tn->tn_right->tn_val->v_quad; - - mask = qlmasks[size(t)]; - ovfl = 0; - - switch (tn->tn_op) { - case UPLUS: - q = sl; - break; - case UMINUS: - q = -sl; - if (msb(q, t, -1) == msb(sl, t, -1)) - ovfl = 1; - break; - case COMPL: - q = ~sl; - break; - case MULT: - if (utyp) { - q = ul * ur; - if (q != (q & mask)) - ovfl = 1; - else if ((ul != 0) && ((q / ul) != ur)) - ovfl = 1; - } else { - q = sl * sr; - if (msb(q, t, -1) != (msb(sl, t, -1) ^ msb(sr, t, -1))) - ovfl = 1; - } - break; - case DIV: - if (sr == 0) { - /* division by 0 */ - error(139); - q = utyp ? UQUAD_MAX : QUAD_MAX; - } else { - q = utyp ? ul / ur : sl / sr; - } - break; - case MOD: - if (sr == 0) { - /* modulus by 0 */ - error(140); - q = 0; - } else { - q = utyp ? ul % ur : sl % sr; - } - break; - case PLUS: - q = utyp ? ul + ur : sl + sr; - if (msb(sl, t, -1) != 0 && msb(sr, t, -1) != 0) { - if (msb(q, t, -1) == 0) - ovfl = 1; - } else if (msb(sl, t, -1) == 0 && msb(sr, t, -1) == 0) { - if (msb(q, t, -1) != 0) - ovfl = 1; - } - break; - case MINUS: - q = utyp ? ul - ur : sl - sr; - if (msb(sl, t, -1) != 0 && msb(sr, t, -1) == 0) { - if (msb(q, t, -1) == 0) - ovfl = 1; - } else if (msb(sl, t, -1) == 0 && msb(sr, t, -1) != 0) { - if (msb(q, t, -1) != 0) - ovfl = 1; - } - break; - case SHL: - q = utyp ? ul << sr : sl << sr; - break; - case SHR: - /* - * The sign must be explicitly extended because - * shifts of signed values are implementation dependent. - */ - q = ul >> sr; - q = xsign(q, t, size(t) - (int)sr); - break; - case LT: - q = utyp ? ul < ur : sl < sr; - break; - case LE: - q = utyp ? ul <= ur : sl <= sr; - break; - case GE: - q = utyp ? ul >= ur : sl >= sr; - break; - case GT: - q = utyp ? ul > ur : sl > sr; - break; - case EQ: - q = utyp ? ul == ur : sl == sr; - break; - case NE: - q = utyp ? ul != ur : sl != sr; - break; - case AND: - q = utyp ? ul & ur : sl & sr; - break; - case XOR: - q = utyp ? ul ^ ur : sl ^ sr; - break; - case OR: - q = utyp ? ul | ur : sl | sr; - break; - default: - LERROR("fold()"); - } - - /* XXX does not work for quads. */ - if (ovfl || ((q | mask) != ~(uint64_t)0 && (q & ~mask) != 0)) { - if (hflag) - /* integer overflow detected, op %s */ - warning(141, modtab[tn->tn_op].m_name); - } - - v->v_quad = xsign(q, t, -1); - - cn = getcnode(tn->tn_type, v); - - return (cn); -} - -/* - * Same for operators whose operands are compared with 0 (test context). - */ -static tnode_t * -foldtst(tnode_t *tn) -{ - int l, r = 0; - val_t *v; - - if ((v = calloc(1, sizeof (val_t))) == NULL) - nomem(); - v->v_tspec = tn->tn_type->t_tspec; - if (tn->tn_type->t_tspec != INT) - LERROR("foldtst()"); - - if (isftyp(tn->tn_left->tn_type->t_tspec)) { - l = tn->tn_left->tn_val->v_ldbl != 0.0; - } else { - l = tn->tn_left->tn_val->v_quad != 0; - } - - if (modtab[tn->tn_op].m_binary) { - if (isftyp(tn->tn_right->tn_type->t_tspec)) { - r = tn->tn_right->tn_val->v_ldbl != 0.0; - } else { - r = tn->tn_right->tn_val->v_quad != 0; - } - } - - switch (tn->tn_op) { - case NOT: - if (hflag) - /* constant argument to NOT */ - warning(239); - v->v_quad = !l; - break; - case LOGAND: - v->v_quad = l && r; - break; - case LOGOR: - v->v_quad = l || r; - break; - default: - LERROR("foldtst()"); - } - - return (getcnode(tn->tn_type, v)); -} - -/* - * Same for operands with floating point type. - */ -static tnode_t * -foldflt(tnode_t *tn) -{ - val_t *v; - tspec_t t; - ldbl_t l, r = 0; - - if ((v = calloc(1, sizeof (val_t))) == NULL) - nomem(); - v->v_tspec = t = tn->tn_type->t_tspec; - - if (!isftyp(t)) - LERROR("foldflt()"); - - if (t != tn->tn_left->tn_type->t_tspec) - LERROR("foldflt()"); - if (modtab[tn->tn_op].m_binary && t != tn->tn_right->tn_type->t_tspec) - LERROR("foldflt()"); - - l = tn->tn_left->tn_val->v_ldbl; - if (modtab[tn->tn_op].m_binary) - r = tn->tn_right->tn_val->v_ldbl; - - switch (tn->tn_op) { - case UPLUS: - v->v_ldbl = l; - break; - case UMINUS: - v->v_ldbl = -l; - break; - case MULT: - v->v_ldbl = l * r; - break; - case DIV: - if (r == 0.0) { - /* division by 0 */ - error(139); - if (t == FLOAT) { - v->v_ldbl = l < 0 ? -FLT_MAX : FLT_MAX; - } else if (t == DOUBLE) { - v->v_ldbl = l < 0 ? -DBL_MAX : DBL_MAX; - } else { - v->v_ldbl = l < 0 ? -LDBL_MAX : LDBL_MAX; - } - } else { - v->v_ldbl = l / r; - } - break; - case PLUS: - v->v_ldbl = l + r; - break; - case MINUS: - v->v_ldbl = l - r; - break; - case LT: - v->v_quad = l < r; - break; - case LE: - v->v_quad = l <= r; - break; - case GE: - v->v_quad = l >= r; - break; - case GT: - v->v_quad = l > r; - break; - case EQ: - v->v_quad = l == r; - break; - case NE: - v->v_quad = l != r; - break; - default: - LERROR("foldflt()"); - } - - if (isnan((double)v->v_ldbl)) - LERROR("foldflt()"); - if (!finite((double)v->v_ldbl) || - (t == FLOAT && - (v->v_ldbl > FLT_MAX || v->v_ldbl < -FLT_MAX)) || - (t == DOUBLE && - (v->v_ldbl > DBL_MAX || v->v_ldbl < -DBL_MAX))) { - /* floating point overflow detected, op %s */ - warning(142, modtab[tn->tn_op].m_name); - if (t == FLOAT) { - v->v_ldbl = v->v_ldbl < 0 ? -FLT_MAX : FLT_MAX; - } else if (t == DOUBLE) { - v->v_ldbl = v->v_ldbl < 0 ? -DBL_MAX : DBL_MAX; - } else { - v->v_ldbl = v->v_ldbl < 0 ? -LDBL_MAX: LDBL_MAX; - } - } - - return (getcnode(tn->tn_type, v)); -} - -/* - * Create a constant node for sizeof. - */ -tnode_t * -bldszof(type_t *tp) -{ - int elem, elsz; - tspec_t st; - - elem = 1; - while (tp->t_tspec == ARRAY) { - elem *= tp->t_dim; - tp = tp->t_subt; - } - if (elem == 0) { - /* cannot take size of incomplete type */ - error(143); - elem = 1; - } - switch (tp->t_tspec) { - case FUNC: - /* cannot take size of function */ - error(144); - elsz = 1; - break; - case STRUCT: - case UNION: - if (incompl(tp)) { - /* cannot take size of incomplete type */ - error(143); - elsz = 1; - } else { - elsz = tp->t_str->size; - } - break; - case ENUM: - if (incompl(tp)) { - /* cannot take size of incomplete type */ - warning(143); - } - /* FALLTHROUGH */ - default: - if (tp->t_isfield) { - /* cannot take size of bit-field */ - error(145); - } - if (tp->t_tspec == VOID) { - /* cannot take size of void */ - error(146); - elsz = 1; - } else { - elsz = size(tp->t_tspec); - if (elsz <= 0) - LERROR("bldszof()"); - } - break; - } - -#if SIZEOF_IS_ULONG - st = ULONG; -#else - st = UINT; -#endif - - return (getinode(st, (int64_t)(elem * elsz / CHAR_BIT))); -} - -/* - * Type casts. - */ -tnode_t * -cast(tnode_t *tn, type_t *tp) -{ - tspec_t nt, ot; - - if (tn == NULL) - return (NULL); - - tn = cconv(tn); - - nt = tp->t_tspec; - ot = tn->tn_type->t_tspec; - - if (nt == VOID) { - /* - * XXX ANSI C requires scalar types or void (Plauger&Brodie). - * But this seams really questionable. - */ - } else if (nt == STRUCT || nt == UNION || nt == ARRAY || nt == FUNC) { - /* invalid cast expression */ - error(147); - return (NULL); - } else if (ot == STRUCT || ot == UNION) { - /* invalid cast expression */ - error(147); - return (NULL); - } else if (ot == VOID) { - /* improper cast of void expression */ - error(148); - return (NULL); - } else if (isityp(nt) && issclt(ot)) { - /* ok */ - } else if (isftyp(nt) && isatyp(ot)) { - /* ok */ - } else if (nt == PTR && isityp(ot)) { - /* ok */ - } else if (nt == PTR && ot == PTR) { - if (!tp->t_subt->t_const && tn->tn_type->t_subt->t_const) { - if (hflag) - /* cast discards 'const' from ... */ - warning(275); - } - } else { - /* invalid cast expression */ - error(147); - return (NULL); - } - - tn = convert(CVT, 0, tp, tn); - tn->tn_cast = 1; - - return (tn); -} - -/* - * Create the node for a function argument. - * All necessary conversions and type checks are done in funccall(), because - * in funcarg() we have no information about expected argument types. - */ -tnode_t * -funcarg(tnode_t *args, tnode_t *arg) -{ - tnode_t *ntn; - - /* - * If there was a serious error in the expression for the argument, - * create a dummy argument so the positions of the remaining arguments - * will not change. - */ - if (arg == NULL) - arg = getinode(INT, (int64_t)0); - - ntn = mktnode(PUSH, arg->tn_type, arg, args); - - return (ntn); -} - -/* - * Create the node for a function call. Also check types of - * function arguments and insert conversions, if necessary. - */ -tnode_t * -funccall(tnode_t *func, tnode_t *args) -{ - tnode_t *ntn; - op_t fcop; - - if (func == NULL) - return (NULL); - - if (func->tn_op == NAME && func->tn_type->t_tspec == FUNC) { - fcop = CALL; - } else { - fcop = ICALL; - } - - /* - * after cconv() func will always be a pointer to a function - * if it is a valid function designator. - */ - func = cconv(func); - - if (func->tn_type->t_tspec != PTR || - func->tn_type->t_subt->t_tspec != FUNC) { - /* illegal function */ - error(149); - return (NULL); - } - - args = chkfarg(func->tn_type->t_subt, args); - - ntn = mktnode(fcop, func->tn_type->t_subt->t_subt, func, args); - - return (ntn); -} - -/* - * Check types of all function arguments and insert conversions, - * if necessary. - */ -static tnode_t * -chkfarg(type_t *ftp, tnode_t *args) -{ - tnode_t *arg; - sym_t *asym; - tspec_t at; - int narg, npar, n, i; - - /* get # of args in the prototype */ - npar = 0; - for (asym = ftp->t_args; asym != NULL; asym = asym->s_nxt) - npar++; - - /* get # of args in function call */ - narg = 0; - for (arg = args; arg != NULL; arg = arg->tn_right) - narg++; - - asym = ftp->t_args; - if (ftp->t_proto && npar != narg && !(ftp->t_vararg && npar < narg)) { - /* argument mismatch: %d arg%s passed, %d expected */ - error(150, narg, narg > 1 ? "s" : "", npar); - asym = NULL; - } - - for (n = 1; n <= narg; n++) { - - /* - * The rightmost argument is at the top of the argument - * subtree. - */ - for (i = narg, arg = args; i > n; i--, arg = arg->tn_right) - continue; - - /* some things which are always not allowd */ - if ((at = arg->tn_left->tn_type->t_tspec) == VOID) { - /* void expressions may not be arguments, arg #%d */ - error(151, n); - return (NULL); - } else if ((at == STRUCT || at == UNION) && - incompl(arg->tn_left->tn_type)) { - /* argument cannot have unknown size, arg #%d */ - error(152, n); - return (NULL); - } else if (isityp(at) && arg->tn_left->tn_type->t_isenum && - incompl(arg->tn_left->tn_type)) { - /* argument cannot have unknown size, arg #%d */ - warning(152, n); - } - - /* class conversions (arg in value context) */ - arg->tn_left = cconv(arg->tn_left); - - if (asym != NULL) { - arg->tn_left = parg(n, asym->s_type, arg->tn_left); - } else { - arg->tn_left = promote(NOOP, 1, arg->tn_left); - } - arg->tn_type = arg->tn_left->tn_type; - - if (asym != NULL) - asym = asym->s_nxt; - } - - return (args); -} - -/* - * Compare the type of an argument with the corresponding type of a - * prototype parameter. If it is a valid combination, but both types - * are not the same, insert a conversion to convert the argument into - * the type of the parameter. - */ -static tnode_t * -parg( int n, /* pos of arg */ - type_t *tp, /* expected type (from prototype) */ - tnode_t *tn) /* argument */ -{ - tnode_t *ln; - int warn; - - if ((ln = calloc(1, sizeof (tnode_t))) == NULL) - nomem(); - ln->tn_type = tduptyp(tp); - ln->tn_type->t_const = 0; - ln->tn_lvalue = 1; - if (typeok(FARG, n, ln, tn)) { - if (!eqtype(tp, tn->tn_type, 1, 0, (warn = 0, &warn)) || warn) - tn = convert(FARG, n, tp, tn); - } - free(ln); - return (tn); -} - -/* - * Return the value of an integral constant expression. - * If the expression is not constant or its type is not an integer - * type, an error message is printed. - */ -val_t * -constant(tnode_t *tn, int required) -{ - val_t *v; - - if (tn != NULL) - tn = cconv(tn); - if (tn != NULL) - tn = promote(NOOP, 0, tn); - - if ((v = calloc(1, sizeof (val_t))) == NULL) - nomem(); - - if (tn == NULL) { - if (nerr == 0) - LERROR("constant()"); - v->v_tspec = INT; - v->v_quad = 1; - return (v); - } - - v->v_tspec = tn->tn_type->t_tspec; - - if (tn->tn_op == CON) { - if (tn->tn_type->t_tspec != tn->tn_val->v_tspec) - LERROR("constant()"); - if (isityp(tn->tn_val->v_tspec)) { - v->v_ansiu = tn->tn_val->v_ansiu; - v->v_quad = tn->tn_val->v_quad; - return (v); - } - v->v_quad = tn->tn_val->v_ldbl; - } else { - v->v_quad = 1; - } - - /* integral constant expression expected */ - if (required) - error(55); - else - c99ism(318); - - if (!isityp(v->v_tspec)) - v->v_tspec = INT; - - return (v); -} - -/* - * Perform some tests on expressions which can't be done in build() and - * functions called by build(). These tests must be done here because - * we need some information about the context in which the operations - * are performed. - * After all tests are performed, expr() frees the memory which is used - * for the expression. - */ -void -expr(tnode_t *tn, int vctx, int tctx, int freeblk) -{ - - if (tn == NULL && nerr == 0) - LERROR("expr()"); - - if (tn == NULL) { - tfreeblk(); - return; - } - - /* expr() is also called in global initialisations */ - if (dcs->d_ctx != EXTERN) - chkreach(); - - chkmisc(tn, vctx, tctx, !tctx, 0, 0, 0); - if (tn->tn_op == ASSIGN) { - if (hflag && tctx) - /* assignment in conditional context */ - warning(159); - } else if (tn->tn_op == CON) { - if (hflag && tctx && !ccflg) - /* constant in conditional context */ - warning(161); - } - if (!modtab[tn->tn_op].m_sideeff) { - /* - * for left operands of COMMA this warning is already - * printed - */ - if (tn->tn_op != COMMA && !vctx && !tctx) - nulleff(tn); - } - if (dflag) - displexpr(tn, 0); - - /* free the tree memory */ - if (freeblk) - tfreeblk(); -} - -static void -nulleff(tnode_t *tn) -{ - - if (!hflag) - return; - - while (!modtab[tn->tn_op].m_sideeff) { - if (tn->tn_op == CVT && tn->tn_type->t_tspec == VOID) { - tn = tn->tn_left; - } else if (tn->tn_op == LOGAND || tn->tn_op == LOGOR) { - /* - * && and || have a side effect if the right operand - * has a side effect. - */ - tn = tn->tn_right; - } else if (tn->tn_op == QUEST) { - /* - * ? has a side effect if at least one of its right - * operands has a side effect - */ - tn = tn->tn_right; - } else if (tn->tn_op == COLON || tn->tn_op == COMMA) { - /* - * : has a side effect if at least one of its operands - * has a side effect - */ - if (modtab[tn->tn_left->tn_op].m_sideeff) { - tn = tn->tn_left; - } else if (modtab[tn->tn_right->tn_op].m_sideeff) { - tn = tn->tn_right; - } else { - break; - } - } else { - break; - } - } - if (!modtab[tn->tn_op].m_sideeff) - /* expression has null effect */ - warning(129); -} - -/* - * Dump an expression to stdout - * only used for debugging - */ -static void -displexpr(tnode_t *tn, int offs) -{ - uint64_t uq; - - if (tn == NULL) { - (void)printf("%*s%s\n", offs, "", "NULL"); - return; - } - (void)printf("%*sop %s ", offs, "", modtab[tn->tn_op].m_name); - - if (tn->tn_op == NAME) { - (void)printf("%s: %s ", - tn->tn_sym->s_name, scltoa(tn->tn_sym->s_scl)); - } else if (tn->tn_op == CON && isftyp(tn->tn_type->t_tspec)) { - (void)printf("%#g ", (double)tn->tn_val->v_ldbl); - } else if (tn->tn_op == CON && isityp(tn->tn_type->t_tspec)) { - uq = tn->tn_val->v_quad; - (void)printf("0x %08lx %08lx ", (long)(uq >> 32) & 0xffffffffl, - (long)uq & 0xffffffffl); - } else if (tn->tn_op == CON) { - if (tn->tn_type->t_tspec != PTR) - LERROR("displexpr()"); - (void)printf("0x%0*lx ", (int)(sizeof (void *) * CHAR_BIT / 4), - (u_long)tn->tn_val->v_quad); - } else if (tn->tn_op == STRING) { - if (tn->tn_strg->st_tspec == CHAR) { - (void)printf("\"%s\"", tn->tn_strg->st_cp); - } else { - char *s; - size_t n; - n = MB_CUR_MAX * (tn->tn_strg->st_len + 1); - if ((s = malloc(n)) == NULL) - nomem(); - (void)wcstombs(s, tn->tn_strg->st_wcp, n); - (void)printf("L\"%s\"", s); - free(s); - } - (void)printf(" "); - } else if (tn->tn_op == FSEL) { - (void)printf("o=%d, l=%d ", tn->tn_type->t_foffs, - tn->tn_type->t_flen); - } - (void)printf("%s\n", ttos(tn->tn_type)); - if (tn->tn_op == NAME || tn->tn_op == CON || tn->tn_op == STRING) - return; - displexpr(tn->tn_left, offs + 2); - if (modtab[tn->tn_op].m_binary || - (tn->tn_op == PUSH && tn->tn_right != NULL)) { - displexpr(tn->tn_right, offs + 2); - } -} - -/* - * Called by expr() to recursively perform some tests. - */ -/* ARGSUSED */ -void -chkmisc(tnode_t *tn, int vctx, int tctx, int eqwarn, int fcall, int rvdisc, - int szof) -{ - tnode_t *ln, *rn; - mod_t *mp; - int nrvdisc, cvctx, ctctx; - op_t op; - scl_t sc; - dinfo_t *di; - - if (tn == NULL) - return; - - ln = tn->tn_left; - rn = tn->tn_right; - mp = &modtab[op = tn->tn_op]; - - switch (op) { - case AMPER: - if (ln->tn_op == NAME && (reached || rchflg)) { - if (!szof) - setsflg(ln->tn_sym); - setuflg(ln->tn_sym, fcall, szof); - } - if (ln->tn_op == STAR && ln->tn_left->tn_op == PLUS) - /* check the range of array indices */ - chkaidx(ln->tn_left, 1); - break; - case LOAD: - if (ln->tn_op == STAR && ln->tn_left->tn_op == PLUS) - /* check the range of array indices */ - chkaidx(ln->tn_left, 0); - /* FALLTHROUGH */ - case PUSH: - case INCBEF: - case DECBEF: - case INCAFT: - case DECAFT: - case ADDASS: - case SUBASS: - case MULASS: - case DIVASS: - case MODASS: - case ANDASS: - case ORASS: - case XORASS: - case SHLASS: - case SHRASS: - if (ln->tn_op == NAME && (reached || rchflg)) { - sc = ln->tn_sym->s_scl; - /* - * Look if there was an asm statement in one of the - * compound statements we are in. If not, we don't - * print a warning. - */ - for (di = dcs; di != NULL; di = di->d_nxt) { - if (di->d_asm) - break; - } - if (sc != EXTERN && sc != STATIC && - !ln->tn_sym->s_set && !szof && di == NULL) { - /* %s may be used before set */ - warning(158, ln->tn_sym->s_name); - setsflg(ln->tn_sym); - } - setuflg(ln->tn_sym, 0, 0); - } - break; - case ASSIGN: - if (ln->tn_op == NAME && !szof && (reached || rchflg)) { - setsflg(ln->tn_sym); - if (ln->tn_sym->s_scl == EXTERN) - outusg(ln->tn_sym); - } - if (ln->tn_op == STAR && ln->tn_left->tn_op == PLUS) - /* check the range of array indices */ - chkaidx(ln->tn_left, 0); - break; - case CALL: - if (ln->tn_op != AMPER || ln->tn_left->tn_op != NAME) - LERROR("chkmisc()"); - if (!szof) - outcall(tn, vctx || tctx, rvdisc); - break; - case EQ: - /* equality operator "==" found where "=" was exp. */ - if (hflag && eqwarn) - warning(160); - break; - case CON: - case NAME: - case STRING: - return; - /* LINTED (enumeration values not handled in switch) */ - case OR: - case XOR: - case NE: - case GE: - case GT: - case LE: - case LT: - case SHR: - case SHL: - case MINUS: - case PLUS: - case MOD: - case DIV: - case MULT: - case STAR: - case UMINUS: - case UPLUS: - case DEC: - case INC: - case COMPL: - case NOT: - case POINT: - case ARROW: - case NOOP: - case AND: - case FARG: - case CASE: - case INIT: - case RETURN: - case ICALL: - case CVT: - case COMMA: - case FSEL: - case COLON: - case QUEST: - case LOGOR: - case LOGAND: - break; - } - - cvctx = mp->m_vctx; - ctctx = mp->m_tctx; - /* - * values of operands of ':' are not used if the type of at least - * one of the operands (for gcc compatibility) is void - * XXX test/value context of QUEST should probably be used as - * context for both operands of COLON - */ - if (op == COLON && tn->tn_type->t_tspec == VOID) - cvctx = ctctx = 0; - nrvdisc = op == CVT && tn->tn_type->t_tspec == VOID; - chkmisc(ln, cvctx, ctctx, mp->m_eqwarn, op == CALL, nrvdisc, szof); - - switch (op) { - case PUSH: - if (rn != NULL) - chkmisc(rn, 0, 0, mp->m_eqwarn, 0, 0, szof); - break; - case LOGAND: - case LOGOR: - chkmisc(rn, 0, 1, mp->m_eqwarn, 0, 0, szof); - break; - case COLON: - chkmisc(rn, cvctx, ctctx, mp->m_eqwarn, 0, 0, szof); - break; - case COMMA: - chkmisc(rn, vctx, tctx, mp->m_eqwarn, 0, 0, szof); - break; - default: - if (mp->m_binary) - chkmisc(rn, 1, 0, mp->m_eqwarn, 0, 0, szof); - break; - } - -} - -/* - * Checks the range of array indices, if possible. - * amper is set if only the address of the element is used. This - * means that the index is allowed to refer to the first element - * after the array. - */ -static void -chkaidx(tnode_t *tn, int amper) -{ - int dim; - tnode_t *ln, *rn; - int elsz; - int64_t con; - - ln = tn->tn_left; - rn = tn->tn_right; - - /* We can only check constant indices. */ - if (rn->tn_op != CON) - return; - - /* Return if the left node does not stem from an array. */ - if (ln->tn_op != AMPER) - return; - if (ln->tn_left->tn_op != STRING && ln->tn_left->tn_op != NAME) - return; - if (ln->tn_left->tn_type->t_tspec != ARRAY) - return; - - /* - * For incomplete array types, we can print a warning only if - * the index is negative. - */ - if (incompl(ln->tn_left->tn_type) && rn->tn_val->v_quad >= 0) - return; - - /* Get the size of one array element */ - if ((elsz = length(ln->tn_type->t_subt, NULL)) == 0) - return; - elsz /= CHAR_BIT; - - /* Change the unit of the index from bytes to element size. */ - if (isutyp(rn->tn_type->t_tspec)) { - con = (uint64_t)rn->tn_val->v_quad / elsz; - } else { - con = rn->tn_val->v_quad / elsz; - } - - dim = ln->tn_left->tn_type->t_dim + (amper ? 1 : 0); - - if (!isutyp(rn->tn_type->t_tspec) && con < 0) { - /* array subscript cannot be negative: %ld */ - warning(167, (long)con); - } else if (dim > 0 && (uint64_t)con >= dim) { - /* array subscript cannot be > %d: %ld */ - warning(168, dim - 1, (long)con); - } -} - -/* - * Check for ordered comparisons of unsigned values with 0. - */ -static void -chkcomp(op_t op, tnode_t *ln, tnode_t *rn) -{ - char buf[64]; - tspec_t lt, rt; - mod_t *mp; - - lt = ln->tn_type->t_tspec; - rt = rn->tn_type->t_tspec; - mp = &modtab[op]; - - if (ln->tn_op != CON && rn->tn_op != CON) - return; - - if (!isityp(lt) || !isityp(rt)) - return; - - if ((hflag || pflag) && lt == CHAR && rn->tn_op == CON && - (rn->tn_val->v_quad < 0 || - rn->tn_val->v_quad > ~(~0 << (CHAR_BIT - 1)))) { - /* nonportable character comparison, op %s */ - warning(230, mp->m_name); - return; - } - if ((hflag || pflag) && rt == CHAR && ln->tn_op == CON && - (ln->tn_val->v_quad < 0 || - ln->tn_val->v_quad > ~(~0 << (CHAR_BIT - 1)))) { - /* nonportable character comparison, op %s */ - warning(230, mp->m_name); - return; - } - if (isutyp(lt) && !isutyp(rt) && - rn->tn_op == CON && rn->tn_val->v_quad <= 0) { - if (rn->tn_val->v_quad < 0) { - /* comparison of %s with %s, op %s */ - warning(162, tyname(buf, sizeof(buf), ln->tn_type), - "negative constant", mp->m_name); - } else if (op == LT || op == GE || (hflag && op == LE)) { - /* comparison of %s with %s, op %s */ - warning(162, tyname(buf, sizeof(buf), ln->tn_type), - "0", mp->m_name); - } - return; - } - if (isutyp(rt) && !isutyp(lt) && - ln->tn_op == CON && ln->tn_val->v_quad <= 0) { - if (ln->tn_val->v_quad < 0) { - /* comparison of %s with %s, op %s */ - warning(162, "negative constant", - tyname(buf, sizeof(buf), rn->tn_type), mp->m_name); - } else if (op == GT || op == LE || (hflag && op == GE)) { - /* comparison of %s with %s, op %s */ - warning(162, "0", tyname(buf, sizeof(buf), rn->tn_type), - mp->m_name); - } - return; - } -} - -/* - * Takes an expression and returns 0 if this expression can be used - * for static initialisation, otherwise -1. - * - * Constant initialisation expressions must be constant or an address - * of a static object with an optional offset. In the first case, - * the result is returned in *offsp. In the second case, the static - * object is returned in *symp and the offset in *offsp. - * - * The expression can consist of PLUS, MINUS, AMPER, NAME, STRING and - * CON. Type conversions are allowed if they do not change binary - * representation (including width). - */ -int -conaddr(tnode_t *tn, sym_t **symp, ptrdiff_t *offsp) -{ - sym_t *sym; - ptrdiff_t offs1, offs2; - tspec_t t, ot; - - switch (tn->tn_op) { - case MINUS: - if (tn->tn_right->tn_op == CVT) - return conaddr(tn->tn_right, symp, offsp); - else if (tn->tn_right->tn_op != CON) - return (-1); - /* FALLTHROUGH */ - case PLUS: - offs1 = offs2 = 0; - if (tn->tn_left->tn_op == CON) { - offs1 = (ptrdiff_t)tn->tn_left->tn_val->v_quad; - if (conaddr(tn->tn_right, &sym, &offs2) == -1) - return (-1); - } else if (tn->tn_right->tn_op == CON) { - offs2 = (ptrdiff_t)tn->tn_right->tn_val->v_quad; - if (tn->tn_op == MINUS) - offs2 = -offs2; - if (conaddr(tn->tn_left, &sym, &offs1) == -1) - return (-1); - } else { - return (-1); - } - *symp = sym; - *offsp = offs1 + offs2; - break; - case AMPER: - if (tn->tn_left->tn_op == NAME) { - *symp = tn->tn_left->tn_sym; - *offsp = 0; - } else if (tn->tn_left->tn_op == STRING) { - /* - * If this would be the front end of a compiler we - * would return a label instead of 0. - */ - *offsp = 0; - } - break; - case CVT: - t = tn->tn_type->t_tspec; - ot = tn->tn_left->tn_type->t_tspec; - if ((!isityp(t) && t != PTR) || (!isityp(ot) && ot != PTR)) - return (-1); - else if (psize(t) != psize(ot)) { - return (-1); - } - if (conaddr(tn->tn_left, symp, offsp) == -1) - return (-1); - break; - default: - return (-1); - } - return (0); -} - -/* - * Concatenate two string constants. - */ -strg_t * -catstrg(strg_t *strg1, strg_t *strg2) -{ - size_t len1, len2, len; - - if (strg1->st_tspec != strg2->st_tspec) { - /* cannot concatenate wide and regular string literals */ - error(292); - return (strg1); - } - - len = (len1 = strg1->st_len) + (len2 = strg2->st_len); - - if (strg1->st_tspec == CHAR) { - if ((strg1->st_cp = realloc(strg1->st_cp, len + 1)) == NULL) - nomem(); - (void)memcpy(strg1->st_cp + len1, strg2->st_cp, len2 + 1); - free(strg2->st_cp); - } else { - if ((strg1->st_wcp = realloc(strg1->st_wcp, (len + 1) * - sizeof (wchar_t))) == NULL) - nomem(); - (void)memcpy(strg1->st_wcp + len1, strg2->st_wcp, - (len2 + 1) * sizeof (wchar_t)); - free(strg2->st_wcp); - } - strg1->st_len = len; - free(strg2); - - return (strg1); -} - -/* - * Print a warning if the given node has operands which should be - * parenthesized. - * - * XXX Does not work if an operand is a constant expression. Constant - * expressions are already folded. - */ -static void -precconf(tnode_t *tn) -{ - tnode_t *ln, *rn; - op_t lop, rop = NOOP; - int lparn, rparn = 0; - mod_t *mp; - int warn; - - if (!hflag) - return; - - mp = &modtab[tn->tn_op]; - - lparn = 0; - for (ln = tn->tn_left; ln->tn_op == CVT; ln = ln->tn_left) - lparn |= ln->tn_parn; - lparn |= ln->tn_parn; - lop = ln->tn_op; - - if (mp->m_binary) { - rparn = 0; - for (rn = tn->tn_right; tn->tn_op == CVT; rn = rn->tn_left) - rparn |= rn->tn_parn; - rparn |= rn->tn_parn; - rop = rn->tn_op; - } - - warn = 0; - - switch (tn->tn_op) { - case SHL: - case SHR: - if (!lparn && (lop == PLUS || lop == MINUS)) { - warn = 1; - } else if (!rparn && (rop == PLUS || rop == MINUS)) { - warn = 1; - } - break; - case LOGOR: - if (!lparn && lop == LOGAND) { - warn = 1; - } else if (!rparn && rop == LOGAND) { - warn = 1; - } - break; - case AND: - case XOR: - case OR: - if (!lparn && lop != tn->tn_op) { - if (lop == PLUS || lop == MINUS) { - warn = 1; - } else if (lop == AND || lop == XOR) { - warn = 1; - } - } - if (!warn && !rparn && rop != tn->tn_op) { - if (rop == PLUS || rop == MINUS) { - warn = 1; - } else if (rop == AND || rop == XOR) { - warn = 1; - } - } - break; - /* LINTED (enumeration values not handled in switch) */ - case DECAFT: - case XORASS: - case SHLASS: - case NOOP: - case ARROW: - case ORASS: - case POINT: - case NAME: - case NOT: - case COMPL: - case CON: - case INC: - case STRING: - case DEC: - case INCBEF: - case DECBEF: - case INCAFT: - case FSEL: - case CALL: - case COMMA: - case CVT: - case ICALL: - case LOAD: - case PUSH: - case RETURN: - case INIT: - case CASE: - case FARG: - case SUBASS: - case ADDASS: - case MODASS: - case DIVASS: - case MULASS: - case ASSIGN: - case COLON: - case QUEST: - case LOGAND: - case NE: - case EQ: - case GE: - case GT: - case LE: - case LT: - case MINUS: - case PLUS: - case MOD: - case DIV: - case MULT: - case AMPER: - case STAR: - case UMINUS: - case SHRASS: - case UPLUS: - case ANDASS: - break; - } - - if (warn) { - /* precedence confusion possible: parenthesize! */ - warning(169); - } - -} diff --git a/usr.bin/xlint/lint2/Makefile b/usr.bin/xlint/lint2/Makefile deleted file mode 100644 index ad14d2abf293..000000000000 --- a/usr.bin/xlint/lint2/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -# $NetBSD: Makefile,v 1.2 1995/07/03 21:24:39 cgd Exp $ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../lint1 - -PROG= lint2 -SRCS= main2.c hash.c read.c mem.c mem2.c chk.c msg.c emit.c emit2.c inittyp.c -MAN= -CFLAGS+=-I${.CURDIR}/../lint1 -LINTFLAGS=-abehrz - -BINDIR= ${LIBEXECDIR} - -.include diff --git a/usr.bin/xlint/lint2/Makefile.depend b/usr.bin/xlint/lint2/Makefile.depend deleted file mode 100644 index 6cfaab1c3644..000000000000 --- a/usr.bin/xlint/lint2/Makefile.depend +++ /dev/null @@ -1,17 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/xlint/lint2/chk.c b/usr.bin/xlint/lint2/chk.c deleted file mode 100644 index 4bdd5b7507f9..000000000000 --- a/usr.bin/xlint/lint2/chk.c +++ /dev/null @@ -1,1350 +0,0 @@ -/* $NetBSD: chk.c,v 1.15 2002/01/21 19:49:52 tv Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: chk.c,v 1.15 2002/01/21 19:49:52 tv Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include - -#include "lint2.h" - -static void chkund(hte_t *); -static void chkdnu(hte_t *); -static void chkdnud(hte_t *); -static void chkmd(hte_t *); -static void chkvtui(hte_t *, sym_t *, sym_t *); -static void chkvtdi(hte_t *, sym_t *, sym_t *); -static void chkfaui(hte_t *, sym_t *, sym_t *); -static void chkau(hte_t *, int, sym_t *, sym_t *, pos_t *, - fcall_t *, fcall_t *, type_t *, type_t *); -static void chkrvu(hte_t *, sym_t *); -static void chkadecl(hte_t *, sym_t *, sym_t *); -static void printflike(hte_t *,fcall_t *, int, const char *, type_t **); -static void scanflike(hte_t *, fcall_t *, int, const char *, type_t **); -static void badfmt(hte_t *, fcall_t *); -static void inconarg(hte_t *, fcall_t *, int); -static void tofewarg(hte_t *, fcall_t *); -static void tomanyarg(hte_t *, fcall_t *); -static int eqtype(type_t *, type_t *, int, int, int, int *); -static int eqargs(type_t *, type_t *, int *); -static int mnoarg(type_t *, int *); - - -/* - * If there is a symbol named "main", mark it as used. - */ -void -mainused(void) -{ - hte_t *hte; - - if ((hte = hsearch("main", 0)) != NULL) - hte->h_used = 1; -} - -/* - * Performs all tests for a single name - */ -void -chkname(hte_t *hte) -{ - sym_t *sym, *def, *pdecl, *decl; - - if (uflag) { - chkund(hte); - chkdnu(hte); - if (xflag) - chkdnud(hte); - } - chkmd(hte); - - /* Get definition, prototype declaration and declaration */ - def = pdecl = decl = NULL; - for (sym = hte->h_syms; sym != NULL; sym = sym->s_nxt) { - if (def == NULL && (sym->s_def == DEF || sym->s_def == TDEF)) - def = sym; - if (pdecl == NULL && sym->s_def == DECL && - TP(sym->s_type)->t_tspec == FUNC && - TP(sym->s_type)->t_proto) { - pdecl = sym; - } - if (decl == NULL && sym->s_def == DECL) - decl = sym; - } - - /* A prototype is better than an old style declaration. */ - if (pdecl != NULL) - decl = pdecl; - - chkvtui(hte, def, decl); - - chkvtdi(hte, def, decl); - - chkfaui(hte, def, decl); - - chkrvu(hte, def); - - chkadecl(hte, def, decl); -} - -/* - * Print a warning if the name has been used, but not defined. - */ -static void -chkund(hte_t *hte) -{ - fcall_t *fcall; - usym_t *usym; - - if (!hte->h_used || hte->h_def) - return; - - if ((fcall = hte->h_calls) != NULL) { - /* %s used( %s ), but not defined */ - msg(0, hte->h_name, mkpos(&fcall->f_pos)); - } else if ((usym = hte->h_usyms) != NULL) { - /* %s used( %s ), but not defined */ - msg(0, hte->h_name, mkpos(&usym->u_pos)); - } -} - -/* - * Print a warning if the name has been defined, but never used. - */ -static void -chkdnu(hte_t *hte) -{ - sym_t *sym; - - if (!hte->h_def || hte->h_used) - return; - - for (sym = hte->h_syms; sym != NULL; sym = sym->s_nxt) { - if (sym->s_def == DEF || sym->s_def == TDEF) { - /* %s defined( %s ), but never used */ - msg(1, hte->h_name, mkpos(&sym->s_pos)); - break; - } - } -} - -/* - * Print a warning if the variable has been declared, but is not used - * or defined. - */ -static void -chkdnud(hte_t *hte) -{ - sym_t *sym; - - if (hte->h_syms == NULL || hte->h_used || hte->h_def) - return; - - sym = hte->h_syms; - if (TP(sym->s_type)->t_tspec == FUNC) - return; - - if (sym->s_def != DECL) - errx(1, "internal error: chkdnud() 1"); - /* %s declared( %s ), but never used or defined */ - msg(2, hte->h_name, mkpos(&sym->s_pos)); -} - -/* - * Print a warning if there is more than one definition for - * this name. - */ -static void -chkmd(hte_t *hte) -{ - sym_t *sym, *def1; - char *pos1; - - if (!hte->h_def) - return; - - def1 = NULL; - for (sym = hte->h_syms; sym != NULL; sym = sym->s_nxt) { - /* - * ANSI C allows tentative definitions of the same name in - * only one compilation unit. - */ - if (sym->s_def != DEF && (!sflag || sym->s_def != TDEF)) - continue; - if (def1 == NULL) { - def1 = sym; - continue; - } - pos1 = xstrdup(mkpos(&def1->s_pos)); - /* %s multiply defined\t%s :: %s */ - msg(3, hte->h_name, pos1, mkpos(&sym->s_pos)); - free(pos1); - } -} - -/* - * Print a warning if the return value assumed for a function call - * differs from the return value of the function definition or - * function declaration. - * - * If no definition/declaration can be found, the assumed return values - * are always int. So there is no need to compare with another function - * call as it's done for function arguments. - */ -static void -chkvtui(hte_t *hte, sym_t *def, sym_t *decl) -{ - fcall_t *call; - char *pos1; - type_t *tp1, *tp2; - /* LINTED (automatic hides external declaration: warn) */ - int warn, eq; - tspec_t t1; - - if (hte->h_calls == NULL) - return; - - if (def == NULL) - def = decl; - if (def == NULL) - return; - - t1 = (tp1 = TP(def->s_type)->t_subt)->t_tspec; - for (call = hte->h_calls; call != NULL; call = call->f_nxt) { - tp2 = TP(call->f_type)->t_subt; - eq = eqtype(tp1, tp2, 1, 0, 0, (warn = 0, &warn)); - if (!call->f_rused) { - /* no return value used */ - if ((t1 == STRUCT || t1 == UNION) && !eq) { - /* - * If a function returns a struct or union it - * must be declared to return a struct or - * union, also if the return value is ignored. - * This is necessary because the caller must - * allocate stack space for the return value. - * If it does not, the return value would over- - * write other data. - * XXX Following massage may be confusing - * because it appears also if the return value - * was declared inconsistently. But this - * behaviour matches pcc based lint, so it is - * accepted for now. - */ - pos1 = xstrdup(mkpos(&def->s_pos)); - /* %s value must be decl. before use %s :: %s */ - msg(17, hte->h_name, - pos1, mkpos(&call->f_pos)); - free(pos1); - } - continue; - } - if (!eq || (sflag && warn)) { - pos1 = xstrdup(mkpos(&def->s_pos)); - /* %s value used inconsistenty\t%s :: %s */ - msg(4, hte->h_name, pos1, mkpos(&call->f_pos)); - free(pos1); - } - } -} - -/* - * Print a warning if a definition/declaration does not match another - * definition/declaration of the same name. For functions, only the - * types of return values are tested. - */ -static void -chkvtdi(hte_t *hte, sym_t *def, sym_t *decl) -{ - sym_t *sym; - type_t *tp1, *tp2; - /* LINTED (automatic hides external declaration: warn) */ - int eq, warn; - char *pos1; - - if (def == NULL) - def = decl; - if (def == NULL) - return; - - tp1 = TP(def->s_type); - for (sym = hte->h_syms; sym != NULL; sym = sym->s_nxt) { - if (sym == def) - continue; - tp2 = TP(sym->s_type); - warn = 0; - if (tp1->t_tspec == FUNC && tp2->t_tspec == FUNC) { - eq = eqtype(tp1->t_subt, tp2->t_subt, 1, 0, 0, &warn); - } else { - eq = eqtype(tp1, tp2, 0, 0, 0, &warn); - } - if (!eq || (sflag && warn)) { - pos1 = xstrdup(mkpos(&def->s_pos)); - /* %s value declared inconsistently\t%s :: %s */ - msg(5, hte->h_name, pos1, mkpos(&sym->s_pos)); - free(pos1); - } - } -} - -/* - * Print a warning if a function is called with arguments which does - * not match the function definition, declaration or another call - * of the same function. - */ -static void -chkfaui(hte_t *hte, sym_t *def, sym_t *decl) -{ - type_t *tp1, *tp2, **ap1, **ap2; - pos_t *pos1p = NULL; - fcall_t *calls, *call, *call1; - int n, as; - char *pos1; - arginf_t *ai; - - if ((calls = hte->h_calls) == NULL) - return; - - /* - * If we find a function definition, we use this for comparison, - * otherwise the first prototype we can find. If there is no - * definition or prototype declaration, the first function call - * is used. - */ - tp1 = NULL; - call1 = NULL; - if (def != NULL) { - if ((tp1 = TP(def->s_type))->t_tspec != FUNC) - return; - pos1p = &def->s_pos; - } else if (decl != NULL && TP(decl->s_type)->t_proto) { - if ((tp1 = TP(decl->s_type))->t_tspec != FUNC) - return; - pos1p = &decl->s_pos; - } - if (tp1 == NULL) { - call1 = calls; - calls = calls->f_nxt; - if ((tp1 = TP(call1->f_type))->t_tspec != FUNC) - return; - pos1p = &call1->f_pos; - } - - n = 1; - for (call = calls; call != NULL; call = call->f_nxt) { - if ((tp2 = TP(call->f_type))->t_tspec != FUNC) - continue; - ap1 = tp1->t_args; - ap2 = tp2->t_args; - n = 0; - while (*ap1 != NULL && *ap2 != NULL) { - if (def != NULL && def->s_va && n >= def->s_nva) - break; - n++; - chkau(hte, n, def, decl, pos1p, call1, call, - *ap1, *ap2); - ap1++; - ap2++; - } - if (*ap1 == *ap2) { - /* equal # of arguments */ - } else if (def != NULL && def->s_va && n >= def->s_nva) { - /* - * function definition with VARARGS; The # of - * arguments of the call must be at least as large - * as the parameter of VARARGS. - */ - } else if (*ap2 != NULL && tp1->t_proto && tp1->t_vararg) { - /* - * prototype with ... and function call with - * at least the same # of arguments as declared - * in the prototype. - */ - } else { - pos1 = xstrdup(mkpos(pos1p)); - /* %s: variable # of args\t%s :: %s */ - msg(7, hte->h_name, pos1, mkpos(&call->f_pos)); - free(pos1); - continue; - } - - /* perform SCANFLIKE/PRINTFLIKE tests */ - if (def == NULL || (!def->s_prfl && !def->s_scfl)) - continue; - as = def->s_prfl ? def->s_nprfl : def->s_nscfl; - for (ai = call->f_args; ai != NULL; ai = ai->a_nxt) { - if (ai->a_num == as) - break; - } - if (ai == NULL || !ai->a_fmt) - continue; - if (def->s_prfl) { - printflike(hte, call, n, ai->a_fstrg, ap2); - } else { - scanflike(hte, call, n, ai->a_fstrg, ap2); - } - } -} - -/* - * Check a single argument in a function call. - * - * hte a pointer to the hash table entry of the function - * n the number of the argument (1..) - * def the function definition or NULL - * decl prototype declaration, old style declaration or NULL - * pos1p position of definition, declaration of first call - * call1 first call, if both def and decl are old style def/decl - * call checked call - * arg1 currently checked argument of def/decl/call1 - * arg2 currently checked argument of call - * - */ -static void -chkau(hte_t *hte, int n, sym_t *def, sym_t *decl, pos_t *pos1p, - fcall_t *call1, fcall_t *call, type_t *arg1, type_t *arg2) -{ - /* LINTED (automatic hides external declaration: warn) */ - int promote, asgn, warn; - tspec_t t1, t2; - arginf_t *ai, *ai1; - char *pos1; - - /* - * If a function definition is available (def != NULL), we compare the - * function call (call) with the definition. Otherwise, if a function - * definition is available and it is not an old style definition - * (decl != NULL && TP(decl->s_type)->t_proto), we compare the call - * with this declaration. Otherwise we compare it with the first - * call we have found (call1). - */ - - /* arg1 must be promoted if it stems from an old style definition */ - promote = def != NULL && def->s_osdef; - - /* - * If we compare with a definition or declaration, we must perform - * the same checks for qualifiers in indirected types as in - * assignments. - */ - asgn = def != NULL || (decl != NULL && TP(decl->s_type)->t_proto); - - warn = 0; - if (eqtype(arg1, arg2, 1, promote, asgn, &warn) && (!sflag || !warn)) - return; - - /* - * Other lint implementations print warnings as soon as the type - * of an argument does not match exactly the expected type. The - * result are lots of warnings which are really not necessary. - * We print a warning only if - * (0) at least one type is not an integer type and types differ - * (1) hflag is set and types differ - * (2) types differ, except in signedness - * If the argument is an integer constant whose msb is not set, - * signedness is ignored (e.g. 0 matches both signed and unsigned - * int). This is with and without hflag. - * If the argument is an integer constant with value 0 and the - * expected argument is of type pointer and the width of the - * integer constant is the same as the width of the pointer, - * no warning is printed. - */ - t1 = arg1->t_tspec; - t2 = arg2->t_tspec; - if (isityp(t1) && isityp(t2) && !arg1->t_isenum && !arg2->t_isenum) { - if (promote) { - /* - * XXX Here is a problem: Although it is possible to - * pass an int where a char/short it expected, there - * may be loss in significant digits. We should first - * check for const arguments if they can be converted - * into the original parameter type. - */ - if (t1 == FLOAT) { - t1 = DOUBLE; - } else if (t1 == CHAR || t1 == SCHAR) { - t1 = INT; - } else if (t1 == UCHAR) { - t1 = tflag ? UINT : INT; - } else if (t1 == SHORT) { - t1 = INT; - } else if (t1 == USHORT) { - /* CONSTCOND */ - t1 = INT_MAX < USHRT_MAX || tflag ? UINT : INT; - } - } - - if (styp(t1) == styp(t2)) { - - /* - * types differ only in signedness; get information - * about arguments - */ - - /* - * treat a definition like a call with variable - * arguments - */ - ai1 = call1 != NULL ? call1->f_args : NULL; - - /* - * if two calls are compared, ai1 is set to the - * information for the n-th argument, if this was - * a constant, otherwise to NULL - */ - for ( ; ai1 != NULL; ai1 = ai1->a_nxt) { - if (ai1->a_num == n) - break; - } - /* - * ai is set to the information of the n-th arg - * of the (second) call, if this was a constant, - * otherwise to NULL - */ - for (ai = call->f_args; ai != NULL; ai = ai->a_nxt) { - if (ai->a_num == n) - break; - } - - if (ai1 == NULL && ai == NULL) { - /* no constant at all */ - if (!hflag) - return; - } else if (ai1 == NULL || ai == NULL) { - /* one constant */ - if (ai == NULL) - ai = ai1; - if (ai->a_zero || ai->a_pcon) - /* same value in signed and unsigned */ - return; - /* value (not representation) differently */ - } else { - /* - * two constants, one signed, one unsigned; - * if the msb of one of the constants is set, - * the argument is used inconsistently. - */ - if (!ai1->a_ncon && !ai->a_ncon) - return; - } - } - - } else if (t1 == PTR && isityp(t2)) { - for (ai = call->f_args; ai != NULL; ai = ai->a_nxt) { - if (ai->a_num == n) - break; - } - /* - * Vendor implementations of lint (e.g. HP-UX, Digital UNIX) - * don't care about the size of the integer argument, - * only whether or not it is zero. We do the same. - */ - if (ai != NULL && ai->a_zero) - return; - } - - pos1 = xstrdup(mkpos(pos1p)); - /* %s, arg %d used inconsistently\t%s :: %s */ - msg(6, hte->h_name, n, pos1, mkpos(&call->f_pos)); - free(pos1); -} - -/* - * Compare the types in the NULL-terminated array ap with the format - * string fmt. - */ -static void -printflike(hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap) -{ - const char *fp; - int fc; - int fwidth, prec, left, sign, space, alt, zero; - tspec_t sz, t1, t2 = NOTSPEC; - type_t *tp; - - fp = fmt; - fc = *fp++; - - for ( ; ; ) { - if (fc == '\0') { - if (*ap != NULL) - tomanyarg(hte, call); - break; - } - if (fc != '%') { - badfmt(hte, call); - break; - } - fc = *fp++; - fwidth = prec = left = sign = space = alt = zero = 0; - sz = NOTSPEC; - - /* Flags */ - for ( ; ; ) { - if (fc == '-') { - if (left) - break; - left = 1; - } else if (fc == '+') { - if (sign) - break; - sign = 1; - } else if (fc == ' ') { - if (space) - break; - space = 1; - } else if (fc == '#') { - if (alt) - break; - alt = 1; - } else if (fc == '0') { - if (zero) - break; - zero = 1; - } else { - break; - } - fc = *fp++; - } - - /* field width */ - if (isdigit(fc)) { - fwidth = 1; - do { fc = *fp++; } while (isdigit(fc)) ; - } else if (fc == '*') { - fwidth = 1; - fc = *fp++; - if ((tp = *ap++) == NULL) { - tofewarg(hte, call); - break; - } - n++; - if ((t1 = tp->t_tspec) != INT && (hflag || t1 != UINT)) - inconarg(hte, call, n); - } - - /* precision */ - if (fc == '.') { - fc = *fp++; - prec = 1; - if (isdigit(fc)) { - do { fc = *fp++; } while (isdigit(fc)); - } else if (fc == '*') { - fc = *fp++; - if ((tp = *ap++) == NULL) { - tofewarg(hte, call); - break; - } - n++; - if (tp->t_tspec != INT) - inconarg(hte, call, n); - } else { - badfmt(hte, call); - break; - } - } - - if (fc == 'h') { - sz = SHORT; - } else if (fc == 'l') { - sz = LONG; - } else if (fc == 'q') { - sz = QUAD; - } else if (fc == 'L') { - sz = LDOUBLE; - } - if (sz != NOTSPEC) - fc = *fp++; - - if (fc == '%') { - if (sz != NOTSPEC || left || sign || space || - alt || zero || prec || fwidth) { - badfmt(hte, call); - } - fc = *fp++; - continue; - } - - if (fc == '\0') { - badfmt(hte, call); - break; - } - - if ((tp = *ap++) == NULL) { - tofewarg(hte, call); - break; - } - n++; - if ((t1 = tp->t_tspec) == PTR) - t2 = tp->t_subt->t_tspec; - - if (fc == 'd' || fc == 'i') { - if (alt || sz == LDOUBLE) { - badfmt(hte, call); - break; - } - int_conv: - if (sz == LONG) { - if (t1 != LONG && (hflag || t1 != ULONG)) - inconarg(hte, call, n); - } else if (sz == QUAD) { - if (t1 != QUAD && (hflag || t1 != UQUAD)) - inconarg(hte, call, n); - } else { - /* - * SHORT is always promoted to INT, USHORT - * to INT or UINT. - */ - if (t1 != INT && (hflag || t1 != UINT)) - inconarg(hte, call, n); - } - } else if (fc == 'o' || fc == 'u' || fc == 'x' || fc == 'X') { - if ((alt && fc == 'u') || sz == LDOUBLE) - badfmt(hte, call); - uint_conv: - if (sz == LONG) { - if (t1 != ULONG && (hflag || t1 != LONG)) - inconarg(hte, call, n); - } else if (sz == QUAD) { - if (t1 != UQUAD && (hflag || t1 != QUAD)) - inconarg(hte, call, n); - } else if (sz == SHORT) { - /* USHORT was promoted to INT or UINT */ - if (t1 != UINT && t1 != INT) - inconarg(hte, call, n); - } else { - if (t1 != UINT && (hflag || t1 != INT)) - inconarg(hte, call, n); - } - } else if (fc == 'D' || fc == 'O' || fc == 'U') { - if ((alt && fc != 'O') || sz != NOTSPEC || !tflag) - badfmt(hte, call); - sz = LONG; - if (fc == 'D') { - goto int_conv; - } else { - goto uint_conv; - } - } else if (fc == 'f' || fc == 'e' || fc == 'E' || - fc == 'g' || fc == 'G') { - if (sz == NOTSPEC) - sz = DOUBLE; - if (sz != DOUBLE && sz != LDOUBLE) - badfmt(hte, call); - if (t1 != sz) - inconarg(hte, call, n); - } else if (fc == 'c') { - if (sz != NOTSPEC || alt || zero) - badfmt(hte, call); - if (t1 != INT) - inconarg(hte, call, n); - } else if (fc == 's') { - if (sz != NOTSPEC || alt || zero) - badfmt(hte, call); - if (t1 != PTR || - (t2 != CHAR && t2 != UCHAR && t2 != SCHAR)) { - inconarg(hte, call, n); - } - } else if (fc == 'p') { - if (fwidth || prec || sz != NOTSPEC || alt || zero) - badfmt(hte, call); - if (t1 != PTR || (hflag && t2 != VOID)) - inconarg(hte, call, n); - } else if (fc == 'n') { - if (fwidth || prec || alt || zero || sz == LDOUBLE) - badfmt(hte, call); - if (t1 != PTR) { - inconarg(hte, call, n); - } else if (sz == LONG) { - if (t2 != LONG && t2 != ULONG) - inconarg(hte, call, n); - } else if (sz == SHORT) { - if (t2 != SHORT && t2 != USHORT) - inconarg(hte, call, n); - } else { - if (t2 != INT && t2 != UINT) - inconarg(hte, call, n); - } - } else { - badfmt(hte, call); - break; - } - - fc = *fp++; - } -} - -/* - * Compare the types in the NULL-terminated array ap with the format - * string fmt. - */ -static void -scanflike(hte_t *hte, fcall_t *call, int n, const char *fmt, type_t **ap) -{ - const char *fp; - int fc; - int noasgn, fwidth; - tspec_t sz, t1 = NOTSPEC, t2 = NOTSPEC; - type_t *tp = NULL; - - fp = fmt; - fc = *fp++; - - for ( ; ; ) { - if (fc == '\0') { - if (*ap != NULL) - tomanyarg(hte, call); - break; - } - if (fc != '%') { - badfmt(hte, call); - break; - } - fc = *fp++; - - noasgn = fwidth = 0; - sz = NOTSPEC; - - if (fc == '*') { - noasgn = 1; - fc = *fp++; - } - - if (isdigit(fc)) { - fwidth = 1; - do { fc = *fp++; } while (isdigit(fc)); - } - - if (fc == 'h') { - sz = SHORT; - } else if (fc == 'l') { - sz = LONG; - } else if (fc == 'q') { - sz = QUAD; - } else if (fc == 'L') { - sz = LDOUBLE; - } - if (sz != NOTSPEC) - fc = *fp++; - - if (fc == '%') { - if (sz != NOTSPEC || noasgn || fwidth) - badfmt(hte, call); - fc = *fp++; - continue; - } - - if (!noasgn) { - if ((tp = *ap++) == NULL) { - tofewarg(hte, call); - break; - } - n++; - if ((t1 = tp->t_tspec) == PTR) - t2 = tp->t_subt->t_tspec; - } - - if (fc == 'd' || fc == 'i' || fc == 'n') { - if (sz == LDOUBLE) - badfmt(hte, call); - if (sz != SHORT && sz != LONG && sz != QUAD) - sz = INT; - conv: - if (!noasgn) { - if (t1 != PTR) { - inconarg(hte, call, n); - } else if (t2 != styp(sz)) { - inconarg(hte, call, n); - } else if (hflag && t2 != sz) { - inconarg(hte, call, n); - } else if (tp->t_subt->t_const) { - inconarg(hte, call, n); - } - } - } else if (fc == 'o' || fc == 'u' || fc == 'x') { - if (sz == LDOUBLE) - badfmt(hte, call); - if (sz == SHORT) { - sz = USHORT; - } else if (sz == LONG) { - sz = ULONG; - } else if (sz == QUAD) { - sz = UQUAD; - } else { - sz = UINT; - } - goto conv; - } else if (fc == 'D') { - if (sz != NOTSPEC || !tflag) - badfmt(hte, call); - sz = LONG; - goto conv; - } else if (fc == 'O') { - if (sz != NOTSPEC || !tflag) - badfmt(hte, call); - sz = ULONG; - goto conv; - } else if (fc == 'X') { - /* - * XXX valid in ANSI C, but in NetBSD's libc imple- - * mented as "lx". Thats why it should be avoided. - */ - if (sz != NOTSPEC || !tflag) - badfmt(hte, call); - sz = ULONG; - goto conv; - } else if (fc == 'E') { - /* - * XXX valid in ANSI C, but in NetBSD's libc imple- - * mented as "lf". Thats why it should be avoided. - */ - if (sz != NOTSPEC || !tflag) - badfmt(hte, call); - sz = DOUBLE; - goto conv; - } else if (fc == 'F') { - /* XXX only for backward compatibility */ - if (sz != NOTSPEC || !tflag) - badfmt(hte, call); - sz = DOUBLE; - goto conv; - } else if (fc == 'G') { - /* - * XXX valid in ANSI C, but in NetBSD's libc not - * implemented - */ - if (sz != NOTSPEC && sz != LONG && sz != LDOUBLE) - badfmt(hte, call); - goto fconv; - } else if (fc == 'e' || fc == 'f' || fc == 'g') { - fconv: - if (sz == NOTSPEC) { - sz = FLOAT; - } else if (sz == LONG) { - sz = DOUBLE; - } else if (sz != LDOUBLE) { - badfmt(hte, call); - sz = FLOAT; - } - goto conv; - } else if (fc == 's' || fc == '[' || fc == 'c') { - if (sz != NOTSPEC) - badfmt(hte, call); - if (fc == '[') { - if ((fc = *fp++) == '-') { - badfmt(hte, call); - fc = *fp++; - } - if (fc != ']') { - badfmt(hte, call); - if (fc == '\0') - break; - } - } - if (!noasgn) { - if (t1 != PTR) { - inconarg(hte, call, n); - } else if (t2 != CHAR && t2 != UCHAR && - t2 != SCHAR) { - inconarg(hte, call, n); - } - } - } else if (fc == 'p') { - if (sz != NOTSPEC) - badfmt(hte, call); - if (!noasgn) { - if (t1 != PTR || t2 != PTR) { - inconarg(hte, call, n); - } else if (tp->t_subt->t_subt->t_tspec!=VOID) { - if (hflag) - inconarg(hte, call, n); - } - } - } else { - badfmt(hte, call); - break; - } - - fc = *fp++; - } -} - -static void -badfmt(hte_t *hte, fcall_t *call) -{ - - /* %s: malformed format string\t%s */ - msg(13, hte->h_name, mkpos(&call->f_pos)); -} - -static void -inconarg(hte_t *hte, fcall_t *call, int n) -{ - - /* %s, arg %d inconsistent with format\t%s(%d) */ - msg(14, hte->h_name, n, mkpos(&call->f_pos)); -} - -static void -tofewarg(hte_t *hte, fcall_t *call) -{ - - /* %s: too few args for format \t%s */ - msg(15, hte->h_name, mkpos(&call->f_pos)); -} - -static void -tomanyarg(hte_t *hte, fcall_t *call) -{ - - /* %s: too many args for format \t%s */ - msg(16, hte->h_name, mkpos(&call->f_pos)); -} - - -/* - * Print warnings for return values which are used, but not returned, - * or return values which are always or sometimes ignored. - */ -static void -chkrvu(hte_t *hte, sym_t *def) -{ - fcall_t *call; - int used, ignored; - - if (def == NULL) - /* don't know wheter or not the functions returns a value */ - return; - - if (hte->h_calls == NULL) - return; - - if (def->s_rval) { - /* function has return value */ - used = ignored = 0; - for (call = hte->h_calls; call != NULL; call = call->f_nxt) { - used |= call->f_rused || call->f_rdisc; - ignored |= !call->f_rused && !call->f_rdisc; - } - /* - * XXX as soon as we are able to disable single warnings - * the following dependencies from hflag should be removed. - * but for now I do'nt want to be botherd by this warnings - * which are almost always useless. - */ - if (!used && ignored) { - if (hflag) - /* %s returns value which is always ignored */ - msg(8, hte->h_name); - } else if (used && ignored) { - if (hflag) - /* %s returns value which is sometimes ign. */ - msg(9, hte->h_name); - } - } else { - /* function has no return value */ - for (call = hte->h_calls; call != NULL; call = call->f_nxt) { - if (call->f_rused) - /* %s value is used( %s ), but none ret. */ - msg(10, hte->h_name, mkpos(&call->f_pos)); - } - } -} - -/* - * Print warnings for inconsistent argument declarations. - */ -static void -chkadecl(hte_t *hte, sym_t *def, sym_t *decl) -{ - /* LINTED (automatic hides external declaration: warn) */ - int osdef, eq, warn, n; - sym_t *sym1, *sym; - type_t **ap1, **ap2, *tp1, *tp2; - char *pos1; - const char *pos2; - - osdef = 0; - if (def != NULL) { - osdef = def->s_osdef; - sym1 = def; - } else if (decl != NULL && TP(decl->s_type)->t_proto) { - sym1 = decl; - } else { - return; - } - if (TP(sym1->s_type)->t_tspec != FUNC) - return; - - /* - * XXX Prototypes should also be compared with old style function - * declarations. - */ - - for (sym = hte->h_syms; sym != NULL; sym = sym->s_nxt) { - if (sym == sym1 || !TP(sym->s_type)->t_proto) - continue; - ap1 = TP(sym1->s_type)->t_args; - ap2 = TP(sym->s_type)->t_args; - n = 0; - while (*ap1 != NULL && *ap2 != NULL) { - warn = 0; - eq = eqtype(*ap1, *ap2, 1, osdef, 0, &warn); - if (!eq || warn) { - pos1 = xstrdup(mkpos(&sym1->s_pos)); - pos2 = mkpos(&sym->s_pos); - /* %s, arg %d declared inconsistently ... */ - msg(11, hte->h_name, n + 1, pos1, pos2); - free(pos1); - } - n++; - ap1++; - ap2++; - } - if (*ap1 == *ap2) { - tp1 = TP(sym1->s_type); - tp2 = TP(sym->s_type); - if (tp1->t_vararg == tp2->t_vararg) - continue; - if (tp2->t_vararg && - sym1->s_va && sym1->s_nva == n && !sflag) { - continue; - } - } - /* %s: variable # of args declared\t%s :: %s */ - pos1 = xstrdup(mkpos(&sym1->s_pos)); - msg(12, hte->h_name, pos1, mkpos(&sym->s_pos)); - free(pos1); - } -} - - -/* - * Check compatibility of two types. Returns 1 if types are compatible, - * otherwise 0. - * - * ignqual if set, ignore qualifiers of outhermost type; used for - * function arguments - * promote if set, promote left type before comparison; used for - * comparisons of arguments with parameters of old style - * definitions - * asgn left indirected type must have at least the same qualifiers - * like right indirected type (for assignments and function - * arguments) - * *warn set to 1 if an old style declaration was compared with - * an incompatible prototype declaration - */ -static int -eqtype(type_t *tp1, type_t *tp2, int ignqual, int promot, int asgn, int *warn) -{ - tspec_t t, to; - int indir; - - to = NOTSPEC; - indir = 0; - - while (tp1 != NULL && tp2 != NULL) { - - t = tp1->t_tspec; - if (promot) { - if (t == FLOAT) { - t = DOUBLE; - } else if (t == CHAR || t == SCHAR) { - t = INT; - } else if (t == UCHAR) { - t = tflag ? UINT : INT; - } else if (t == SHORT) { - t = INT; - } else if (t == USHORT) { - /* CONSTCOND */ - t = INT_MAX < USHRT_MAX || tflag ? UINT : INT; - } - } - - if (asgn && to == PTR) { - if (indir == 1 && (t == VOID || tp2->t_tspec == VOID)) - return (1); - } - - if (t != tp2->t_tspec) { - /* - * Give pointer to types which differ only in - * signedness a chance if not sflag and not hflag. - */ - if (sflag || hflag || to != PTR) - return (0); - if (styp(t) != styp(tp2->t_tspec)) - return (0); - } - - if (tp1->t_isenum && tp2->t_isenum) { - if (tp1->t_istag && tp2->t_istag) { - return (tp1->t_tag == tp2->t_tag); - } else if (tp1->t_istynam && tp2->t_istynam) { - return (tp1->t_tynam == tp2->t_tynam); - } else if (tp1->t_isuniqpos && tp2->t_isuniqpos) { - return (tp1->t_uniqpos.p_line == - tp2->t_uniqpos.p_line && - tp1->t_uniqpos.p_file == - tp2->t_uniqpos.p_file && - tp1->t_uniqpos.p_uniq == - tp2->t_uniqpos.p_uniq); - } else { - return (0); - } - } - - /* - * XXX Handle combinations of enum and int if eflag is set. - * But note: enum and 0 should be allowed. - */ - - if (asgn && indir == 1) { - if (!tp1->t_const && tp2->t_const) - return (0); - if (!tp1->t_volatile && tp2->t_volatile) - return (0); - } else if (!ignqual && !tflag) { - if (tp1->t_const != tp2->t_const) - return (0); - if (tp1->t_const != tp2->t_const) - return (0); - } - - if (t == STRUCT || t == UNION) { - if (tp1->t_istag && tp2->t_istag) { - return (tp1->t_tag == tp2->t_tag); - } else if (tp1->t_istynam && tp2->t_istynam) { - return (tp1->t_tynam == tp2->t_tynam); - } else if (tp1->t_isuniqpos && tp2->t_isuniqpos) { - return (tp1->t_uniqpos.p_line == - tp2->t_uniqpos.p_line && - tp1->t_uniqpos.p_file == - tp2->t_uniqpos.p_file && - tp1->t_uniqpos.p_uniq == - tp2->t_uniqpos.p_uniq); - } else { - return (0); - } - } - - if (t == ARRAY && tp1->t_dim != tp2->t_dim) { - if (tp1->t_dim != 0 && tp2->t_dim != 0) - return (0); - } - - if (t == FUNC) { - if (tp1->t_proto && tp2->t_proto) { - if (!eqargs(tp1, tp2, warn)) - return (0); - } else if (tp1->t_proto) { - if (!mnoarg(tp1, warn)) - return (0); - } else if (tp2->t_proto) { - if (!mnoarg(tp2, warn)) - return (0); - } - } - - tp1 = tp1->t_subt; - tp2 = tp2->t_subt; - ignqual = promot = 0; - to = t; - indir++; - - } - - return (tp1 == tp2); -} - -/* - * Compares arguments of two prototypes - */ -static int -eqargs(type_t *tp1, type_t *tp2, int *warn) -{ - type_t **a1, **a2; - - if (tp1->t_vararg != tp2->t_vararg) - return (0); - - a1 = tp1->t_args; - a2 = tp2->t_args; - - while (*a1 != NULL && *a2 != NULL) { - - if (eqtype(*a1, *a2, 1, 0, 0, warn) == 0) - return (0); - - a1++; - a2++; - - } - - return (*a1 == *a2); -} - -/* - * mnoarg() (matches functions with no argument type information) - * returns 1 if all parameters of a prototype are compatible with - * and old style function declaration. - * This is the case if following conditions are met: - * 1. the prototype must have a fixed number of parameters - * 2. no parameter is of type float - * 3. no parameter is converted to another type if integer promotion - * is applied on it - */ -static int -mnoarg(type_t *tp, int *warn) -{ - type_t **arg; - tspec_t t; - - if (tp->t_vararg && warn != NULL) - *warn = 1; - for (arg = tp->t_args; *arg != NULL; arg++) { - if ((t = (*arg)->t_tspec) == FLOAT) - return (0); - if (t == CHAR || t == SCHAR || t == UCHAR) - return (0); - if (t == SHORT || t == USHORT) - return (0); - } - return (1); -} diff --git a/usr.bin/xlint/lint2/emit2.c b/usr.bin/xlint/lint2/emit2.c deleted file mode 100644 index 16c963203d5a..000000000000 --- a/usr.bin/xlint/lint2/emit2.c +++ /dev/null @@ -1,300 +0,0 @@ -/* $NetBSD: emit2.c,v 1.8 2002/01/21 19:49:52 tv Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: emit2.c,v 1.8 2002/01/21 19:49:52 tv Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include - -#include "lint2.h" - -static void outtype(type_t *); -static void outdef(hte_t *, sym_t *); -static void dumpname(hte_t *); -static void outfiles(void); - -/* - * Write type into the output buffer. - */ -static void -outtype(type_t *tp) -{ - int t, s, na; - tspec_t ts; - type_t **ap; - - while (tp != NULL) { - if ((ts = tp->t_tspec) == INT && tp->t_isenum) - ts = ENUM; - switch (ts) { - case CHAR: t = 'C'; s = '\0'; break; - case SCHAR: t = 'C'; s = 's'; break; - case UCHAR: t = 'C'; s = 'u'; break; - case SHORT: t = 'S'; s = '\0'; break; - case USHORT: t = 'S'; s = 'u'; break; - case INT: t = 'I'; s = '\0'; break; - case UINT: t = 'I'; s = 'u'; break; - case LONG: t = 'L'; s = '\0'; break; - case ULONG: t = 'L'; s = 'u'; break; - case QUAD: t = 'Q'; s = '\0'; break; - case UQUAD: t = 'Q'; s = 'u'; break; - case FLOAT: t = 'D'; s = 's'; break; - case DOUBLE: t = 'D'; s = '\0'; break; - case LDOUBLE: t = 'D'; s = 'l'; break; - case VOID: t = 'V'; s = '\0'; break; - case PTR: t = 'P'; s = '\0'; break; - case ARRAY: t = 'A'; s = '\0'; break; - case ENUM: t = 'T'; s = 'e'; break; - case STRUCT: t = 'T'; s = 's'; break; - case UNION: t = 'T'; s = 'u'; break; - case FUNC: - if (tp->t_args != NULL && !tp->t_proto) { - t = 'f'; - } else { - t = 'F'; - } - s = '\0'; - break; - default: - errx(1, "internal error: outtype() 1"); - } - if (tp->t_const) - outchar('c'); - if (tp->t_volatile) - outchar('v'); - if (s != '\0') - outchar(s); - outchar(t); - if (ts == ARRAY) { - outint(tp->t_dim); - } else if (ts == ENUM || ts == STRUCT || ts == UNION) { - if (tp->t_istag) { - outint(1); - outname(tp->t_tag->h_name); - } else if (tp->t_istynam) { - outint(2); - outname(tp->t_tynam->h_name); - } else if (tp->t_isuniqpos) { - outint(3); - outint(tp->t_uniqpos.p_line); - outchar('.'); - outint(tp->t_uniqpos.p_file); - outchar('.'); - outint(tp->t_uniqpos.p_uniq); - } else - errx(1, "internal error: outtype() 2"); - } else if (ts == FUNC && tp->t_args != NULL) { - na = 0; - for (ap = tp->t_args; *ap != NULL; ap++) - na++; - if (tp->t_vararg) - na++; - outint(na); - for (ap = tp->t_args; *ap != NULL; ap++) - outtype(*ap); - if (tp->t_vararg) - outchar('E'); - } - tp = tp->t_subt; - } -} - -/* - * Write a definition. - */ -static void -outdef(hte_t *hte, sym_t *sym) -{ - - /* reset output buffer */ - outclr(); - - /* line number in C source file */ - outint(0); - - /* this is a definition */ - outchar('d'); - - /* index of file where symbol was defined and line number of def. */ - outint(0); - outchar('.'); - outint(0); - - /* flags */ - if (sym->s_va) { - outchar('v'); /* varargs */ - outint(sym->s_nva); - } - if (sym->s_scfl) { - outchar('S'); /* scanflike */ - outint(sym->s_nscfl); - } - if (sym->s_prfl) { - outchar('P'); /* printflike */ - outint(sym->s_nprfl); - } - /* definition or tentative definition */ - outchar(sym->s_def == DEF ? 'd' : 't'); - if (TP(sym->s_type)->t_tspec == FUNC) { - if (sym->s_rval) - outchar('r'); /* fkt. has return value */ - if (sym->s_osdef) - outchar('o'); /* old style definition */ - } - outchar('u'); /* used (no warning if not used) */ - - /* name */ - outname(hte->h_name); - - /* type */ - outtype(TP(sym->s_type)); -} - -/* - * Write the first definition of a name into the lint library. - */ -static void -dumpname(hte_t *hte) -{ - sym_t *sym, *def; - - /* static and undefined symbols are not written */ - if (hte->h_static || !hte->h_def) - return; - - /* - * If there is a definition, write it. Otherwise write a tentative - * definition. This is necessary because more than one tentative - * definition is allowed (except with sflag). - */ - def = NULL; - for (sym = hte->h_syms; sym != NULL; sym = sym->s_nxt) { - if (sym->s_def == DEF) { - def = sym; - break; - } - if (sym->s_def == TDEF && def == NULL) - def = sym; - } - if (def == NULL) - errx(1, "internal error: dumpname() %s", hte->h_name); - - outdef(hte, def); -} - -/* - * Write a new lint library. - */ -void -outlib(const char *name) -{ - /* Open of output file and initialisation of the output buffer */ - outopen(name); - - /* write name of lint library */ - outsrc(name); - - /* name of lint lib has index 0 */ - outclr(); - outint(0); - outchar('s'); - outstrg(name); - - /* - * print the names of all files references by unnamed - * struct/union/enum declarations. - */ - outfiles(); - - /* write all definitions with external linkage */ - forall(dumpname); - - /* close the output */ - outclose(); -} - -/* - * Write out the name of a file referenced by a type. - */ -struct outflist { - short ofl_num; - struct outflist *ofl_next; -}; -static struct outflist *outflist; - -int -addoutfile(short num) -{ - struct outflist *ofl, **pofl; - int i; - - ofl = outflist; - pofl = &outflist; - i = 1; /* library is 0 */ - - while (ofl != NULL) { - if (ofl->ofl_num == num) - break; - - pofl = &ofl->ofl_next; - ofl = ofl->ofl_next; - i++; - } - - if (ofl == NULL) { - ofl = *pofl = xmalloc(sizeof (struct outflist)); - ofl->ofl_num = num; - ofl->ofl_next = NULL; - } - return (i); -} - -static void -outfiles(void) -{ - struct outflist *ofl; - int i; - - for (ofl = outflist, i = 1; ofl != NULL; ofl = ofl->ofl_next, i++) { - /* reset output buffer */ - outclr(); - - outint(i); - outchar('s'); - outstrg(fnames[ofl->ofl_num]); - } -} diff --git a/usr.bin/xlint/lint2/externs2.h b/usr.bin/xlint/lint2/externs2.h deleted file mode 100644 index 3b6f03a58a89..000000000000 --- a/usr.bin/xlint/lint2/externs2.h +++ /dev/null @@ -1,93 +0,0 @@ -/* $NetBSD: externs2.h,v 1.7 2001/05/28 12:40:38 lukem Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * main.c - */ -extern int xflag; -extern int uflag; -extern int Cflag; -extern const char *libname; -extern int sflag; -extern int tflag; -extern int Hflag; -extern int hflag; -extern int Fflag; - - -/* - * hash.c - */ -extern void _inithash(hte_t ***); -extern hte_t *_hsearch(hte_t **, const char *, int); -extern void _forall(hte_t **, void (*)(hte_t *)); -extern void _destroyhash(hte_t **); - -#define inithash() _inithash(NULL); -#define hsearch(a, b) _hsearch(NULL, (a), (b)) -#define forall(a) _forall(NULL, (a)) - -/* - * read.c - */ -extern const char **fnames; -extern type_t **tlst; - -extern void readfile(const char *); -extern void mkstatic(hte_t *); - -/* - * mem2.c - */ -extern void initmem(void); -extern void *xalloc(size_t); - -/* - * chk.c - */ -extern void inittyp(void); -extern void mainused(void); -extern void chkname(hte_t *); - -/* - * msg.c - */ -extern void msg(int, ...); -extern const char *mkpos(pos_t *); - -/* - * emit2.c - */ -extern void outlib(const char *); -extern int addoutfile(short); diff --git a/usr.bin/xlint/lint2/hash.c b/usr.bin/xlint/lint2/hash.c deleted file mode 100644 index a215aba8ce0c..000000000000 --- a/usr.bin/xlint/lint2/hash.c +++ /dev/null @@ -1,166 +0,0 @@ -/* $NetBSD: hash.c,v 1.7 2002/01/21 19:49:52 tv Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: hash.c,v 1.7 2002/01/21 19:49:52 tv Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -/* - * XXX Really need a generalized hash table package - */ - -#include -#include -#include -#include -#include - -#include "lint2.h" - -/* pointer to hash table, initialized in inithash() */ -static hte_t **htab; - -static int hash(const char *); - -/* - * Initialize hash table. - */ -void -_inithash(hte_t ***tablep) -{ - - if (tablep == NULL) - tablep = &htab; - - *tablep = xcalloc(HSHSIZ2, sizeof (hte_t *)); -} - -/* - * Compute hash value from a string. - */ -static int -hash(const char *s) -{ - u_int v; - const u_char *us; - - v = 0; - for (us = (const u_char *)s; *us != '\0'; us++) { - v = (v << sizeof (v)) + *us; - v ^= v >> (sizeof (v) * CHAR_BIT - sizeof (v)); - } - return (v % HSHSIZ2); -} - -/* - * Look for a hash table entry. If no hash table entry for the - * given name exists and mknew is set, create a new one. - */ -hte_t * -_hsearch(hte_t **table, const char *s, int mknew) -{ - int h; - hte_t *hte; - - if (table == NULL) - table = htab; - - h = hash(s); - for (hte = table[h]; hte != NULL; hte = hte->h_link) { - if (strcmp(hte->h_name, s) == 0) - break; - } - - if (hte != NULL || !mknew) - return (hte); - - /* create a new hte */ - hte = xmalloc(sizeof (hte_t)); - hte->h_name = xstrdup(s); - hte->h_used = 0; - hte->h_def = 0; - hte->h_static = 0; - hte->h_syms = NULL; - hte->h_lsym = &hte->h_syms; - hte->h_calls = NULL; - hte->h_lcall = &hte->h_calls; - hte->h_usyms = NULL; - hte->h_lusym = &hte->h_usyms; - hte->h_link = table[h]; - hte->h_hte = NULL; - table[h] = hte; - - return (hte); -} - -/* - * Call function f for each name in the hash table. - */ -void -_forall(hte_t **table, void (*f)(hte_t *)) -{ - int i; - hte_t *hte; - - if (table == NULL) - table = htab; - - for (i = 0; i < HSHSIZ2; i++) { - for (hte = table[i]; hte != NULL; hte = hte->h_link) - (*f)(hte); - } -} - -/* - * Free all contents of the hash table that this module allocated. - */ -void -_destroyhash(hte_t **table) -{ - int i; - hte_t *hte, *nexthte; - - if (table == NULL) - err(1, "_destroyhash called on main hash table"); - - for (i = 0; i < HSHSIZ2; i++) { - for (hte = table[i]; hte != NULL; hte = nexthte) { - free((void *)hte->h_name); - nexthte = hte->h_link; - free(hte); - } - } - free(table); -} diff --git a/usr.bin/xlint/lint2/lint2.h b/usr.bin/xlint/lint2/lint2.h deleted file mode 100644 index 75f9dc9358d0..000000000000 --- a/usr.bin/xlint/lint2/lint2.h +++ /dev/null @@ -1,188 +0,0 @@ -/* $NetBSD: lint2.h,v 1.5 2000/06/14 06:49:23 cgd Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "lint.h" - -/* - * Types are described by structures of type type_t. - */ -typedef struct type { - tspec_t t_tspec; /* type specifier */ - u_int t_const : 1; /* constant */ - u_int t_volatile : 1; /* volatile */ - u_int t_vararg : 1; /* function has variable number of arguments */ - u_int t_isenum : 1; /* enum type */ - u_int t_proto : 1; /* this is a prototype */ - u_int t_istag : 1; /* tag with _t_tag valid */ - u_int t_istynam : 1; /* tag with _t_tynam valid */ - u_int t_isuniqpos : 1; /* tag with _t_uniqpos valid */ - union { - int _t_dim; /* if the type is an ARRAY than this - is the dimension of the array. */ - struct hte *_t_tag; /* hash table entry of tag if - t_isenum, STRUCT or UNION */ - struct hte *_t_tynam; /* hash table entry of typename if - t_isenum, STRUCT or UNION */ - struct { - int p_line; - short p_file; - int p_uniq; - } _t_uniqpos; /* unique position, for untagged - untyped STRUCTs, UNIONS, and ENUMs, - if t_isuniqpos */ - struct type **_t_args; /* list of argument types if this - is a prototype */ - } t_u; - struct type *t_subt; /* indirected type (array element, pointed to - type, type of return value) */ -} type_t; - -#define t_dim t_u._t_dim -#define t_tag t_u._t_tag -#define t_tynam t_u._t_tynam -#define t_uniqpos t_u._t_uniqpos -#define t_args t_u._t_args - -/* - * argument information - * - * Such a structure is created for each argument of a function call - * which is an integer constant or a constant string. - */ -typedef struct arginf { - int a_num; /* # of argument (1..) */ - u_int a_zero : 1; /* argument is 0 */ - u_int a_pcon : 1; /* msb of argument is not set */ - u_int a_ncon : 1; /* msb of argument is set */ - u_int a_fmt : 1; /* a_fstrg points to format string */ - char *a_fstrg; /* format string */ - struct arginf *a_nxt; /* information for next const. argument */ -} arginf_t; - -/* - * Keeps information about position in source file. - */ -typedef struct { - u_short p_src; /* index of name of translation unit - (the name which was specified at the - command line) */ - u_short p_line; /* line number in p_src */ - u_short p_isrc; /* index of (included) file */ - u_short p_iline; /* line number in p_iline */ -} pos_t; - -/* - * Used for definitions and declarations - * - * To save memory, variable sized structures are used. If - * all s_va, s_prfl and s_scfl are not set, the memory allocated - * for a symbol is only large enough to keep the first member of - * struct sym, s_s. - */ -typedef struct sym { - struct { - pos_t s_pos; /* pos of def./decl. */ -#ifndef lint - u_int s_def : 3; /* DECL, TDEF or DEF */ -#else - def_t s_def; -#endif - u_int s_rval : 1; /* function has return value */ - u_int s_osdef : 1; /* old style function definition */ - u_int s_static : 1; /* symbol is static */ - u_int s_va : 1; /* check only first s_nva arguments */ - u_int s_prfl : 1; /* printflike */ - u_int s_scfl : 1; /* scanflike */ - u_short s_type; /* type */ - struct sym *s_nxt; /* next symbol with same name */ - } s_s; - short s_nva; - short s_nprfl; - short s_nscfl; -} sym_t; - -#define s_pos s_s.s_pos -#define s_rval s_s.s_rval -#define s_osdef s_s.s_osdef -#define s_static s_s.s_static -#define s_def s_s.s_def -#define s_va s_s.s_va -#define s_prfl s_s.s_prfl -#define s_scfl s_s.s_scfl -#define s_type s_s.s_type -#define s_nxt s_s.s_nxt - -/* - * Used to store informations about function calls. - */ -typedef struct fcall { - pos_t f_pos; /* position of call */ - u_int f_rused : 1; /* return value used */ - u_int f_rdisc : 1; /* return value discarded (casted to void) */ - u_short f_type; /* types of expected return value and args */ - arginf_t *f_args; /* information about constant arguments */ - struct fcall *f_nxt; /* next call of same function */ -} fcall_t; - -/* - * Used to store information about usage of symbols other - * than for function calls. - */ -typedef struct usym { - pos_t u_pos; /* position */ - struct usym *u_nxt; /* next usage */ -} usym_t; - -/* - * hash table entry - */ -typedef struct hte { - const char *h_name; /* name */ - u_int h_used : 1; /* symbol is used */ - u_int h_def : 1; /* symbol is defined */ - u_int h_static : 1; /* static symbol */ - sym_t *h_syms; /* declarations and definitions */ - sym_t **h_lsym; /* points to s_nxt of last decl./def. */ - fcall_t *h_calls; /* function calls */ - fcall_t **h_lcall; /* points to f_nxt of last call */ - usym_t *h_usyms; /* usage info */ - usym_t **h_lusym; /* points to u_nxt of last usage info */ - struct hte *h_link; /* next hte with same hash function */ - struct hte *h_hte; /* pointer to other htes (for renames */ -} hte_t; - -/* maps type indices into pointers to type structs */ -#define TP(idx) (tlst[idx]) - -#include "externs2.h" diff --git a/usr.bin/xlint/lint2/main2.c b/usr.bin/xlint/lint2/main2.c deleted file mode 100644 index a05ddf4cb74b..000000000000 --- a/usr.bin/xlint/lint2/main2.c +++ /dev/null @@ -1,191 +0,0 @@ -/* $NetBSD: main2.c,v 1.5 2001/11/21 19:14:26 wiz Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: main2.c,v 1.5 2001/11/21 19:14:26 wiz Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include - -#include "lint2.h" - -/* warnings for symbols which are declared but not defined or used */ -int xflag; - -/* - * warnings for symbols which are used and not defined or defined - * and not used - */ -int uflag = 1; - -/* Create a lint library in the current directory with name libname. */ -int Cflag; -const char *libname; - -int pflag; - -/* - * warnings for (tentative) definitions of the same name in more than - * one translation unit - */ -int sflag; - -int tflag; - -/* - * If a complaint stems from an included file, print the name of the included - * file instead of the name spezified at the command line followed by '?' - */ -int Hflag; - -int hflag; - -/* Print full path names, not only the last component */ -int Fflag; - -/* - * List of libraries (from -l flag). These libraries are read after all - * other input files has been read and, for Cflag, after the new lint library - * has been written. - */ -const char **libs; - -static void usage(void); - -int main(int, char *[]); - -int -main(int argc, char *argv[]) -{ - int c, i; - size_t len; - char *lname; - - libs = xcalloc(1, sizeof (char *)); - - opterr = 0; - while ((c = getopt(argc, argv, "hpstxuC:HFl:")) != -1) { - switch (c) { - case 's': - sflag = 1; - break; - case 't': - tflag = 1; - break; - case 'u': - uflag = 0; - break; - case 'x': - xflag = 1; - break; - case 'p': - pflag = 1; - break; - case 'C': - len = strlen(optarg); - lname = xmalloc(len + 10); - (void)sprintf(lname, "llib-l%s.ln", optarg); - libname = lname; - Cflag = 1; - uflag = 0; - break; - case 'H': - Hflag = 1; - break; - case 'h': - hflag = 1; - break; - case 'F': - Fflag = 1; - break; - case 'l': - for (i = 0; libs[i] != NULL; i++) - continue; - libs = xrealloc(libs, (i + 2) * sizeof (char *)); - libs[i] = xstrdup(optarg); - libs[i + 1] = NULL; - break; - case '?': - usage(); - } - } - - argc -= optind; - argv += optind; - - if (argc == 0) - usage(); - - initmem(); - - /* initialize hash table */ - inithash(); - - inittyp(); - - for (i = 0; i < argc; i++) - readfile(argv[i]); - - /* write the lint library */ - if (Cflag) { - forall(mkstatic); - outlib(libname); - } - - /* read additional libraries */ - for (i = 0; libs[i] != NULL; i++) - readfile(libs[i]); - - forall(mkstatic); - - mainused(); - - /* perform all tests */ - forall(chkname); - - exit(0); - /* NOTREACHED */ -} - -static void -usage(void) -{ - (void)fprintf(stderr, - "usage: lint2 -hpstxuHF -Clib -l lib ... src1 ...\n"); - exit(1); -} diff --git a/usr.bin/xlint/lint2/mem2.c b/usr.bin/xlint/lint2/mem2.c deleted file mode 100644 index 48e759ea2126..000000000000 --- a/usr.bin/xlint/lint2/mem2.c +++ /dev/null @@ -1,97 +0,0 @@ -/* $NetBSD: mem2.c,v 1.6 2002/01/21 19:49:52 tv Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: mem2.c,v 1.6 2002/01/21 19:49:52 tv Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include - -#include "lint2.h" - -/* length of new allocated memory blocks */ -static size_t mblklen; - -/* offset of next free byte in mbuf */ -static size_t nxtfree; - -/* current buffer to server memory requests from */ -static void *mbuf; - -void -initmem(void) -{ - int pgsz; - - pgsz = getpagesize(); - mblklen = ((MBLKSIZ + pgsz - 1) / pgsz) * pgsz; - - nxtfree = mblklen; -} - -/* - * Allocate memory in large chunks to avoid space and time overhead of - * malloc(). This is possible because memory allocated by xalloc() - * need never to be freed. - */ -void * -xalloc(size_t sz) -{ - void *ptr; - int prot, flags; - - /* Align to at least 8 bytes. */ - sz = (sz + 7) & ~7L; - if (nxtfree + sz > mblklen) { - /* use mmap() instead of malloc() to avoid malloc overhead. */ - prot = PROT_READ | PROT_WRITE; - flags = MAP_ANON | MAP_PRIVATE; - mbuf = mmap(NULL, mblklen, prot, flags, -1, (off_t)0); - if (mbuf == (void *)MAP_FAILED) - err(1, "can't map memory"); - (void)memset(mbuf, 0, mblklen); - nxtfree = 0; - } - - ptr = (char *)mbuf + nxtfree; - nxtfree += sz; - - return (ptr); -} diff --git a/usr.bin/xlint/lint2/msg.c b/usr.bin/xlint/lint2/msg.c deleted file mode 100644 index b7855adb4029..000000000000 --- a/usr.bin/xlint/lint2/msg.c +++ /dev/null @@ -1,138 +0,0 @@ -/* $NetBSD: msg.c,v 1.6 2002/01/21 19:49:52 tv Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -__FBSDID("$FreeBSD$"); -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: msg.c,v 1.6 2002/01/21 19:49:52 tv Exp $"); -#endif - -#include -#include -#include - -#include "lint2.h" - -static const char *msgs[] = { - "%s used( %s ), but not defined", /* 0 */ - "%s defined( %s ), but never used", /* 1 */ - "%s declared( %s ), but never used or defined", /* 2 */ - "%s multiply defined \t%s :: %s", /* 3 */ - "%s value used inconsistently \t%s :: %s", /* 4 */ - "%s value declared inconsistently \t%s :: %s", /* 5 */ - "%s, arg %d used inconsistently \t%s :: %s", /* 6 */ - "%s: variable # of args \t%s :: %s", /* 7 */ - "%s returns value which is always ignored", /* 8 */ - "%s returns value which is sometimes ignored", /* 9 */ - "%s value is used( %s ), but none returned", /* 10 */ - "%s, arg %d declared inconsistently \t%s :: %s", /* 11 */ - "%s: variable # of args declared \t%s :: %s", /* 12 */ - "%s: malformed format string \t%s", /* 13 */ - "%s, arg %d inconsistent with format \t%s", /* 14 */ - "%s: too few args for format \t%s", /* 15 */ - "%s: too many args for format \t%s", /* 16 */ - "%s function value must be declared before use \t%s :: %s",/* 17 */ - "%s renamed multiple times \t%s :: %s", /* 18 */ -}; - -static const char *lbasename(const char *); - -void -msg(int n, ...) -{ - va_list ap; - - va_start(ap, n); - - (void)vprintf(msgs[n], ap); - (void)printf("\n"); - - va_end(ap); -} - -/* - * Return a pointer to the last component of a path. - */ -static const char * -lbasename(const char *path) -{ - const char *cp, *cp1, *cp2; - - if (Fflag) - return (path); - - cp = cp1 = cp2 = path; - while (*cp != '\0') { - if (*cp++ == '/') { - cp2 = cp1; - cp1 = cp; - } - } - return (*cp1 == '\0' ? cp2 : cp1); -} - -/* - * Create a string which describes a position in a source file. - */ -const char * -mkpos(pos_t *posp) -{ - size_t len; - const char *fn; - static char *buf; - static size_t blen = 0; - int qm, src, line; - - if (Hflag && posp->p_src != posp->p_isrc) { - src = posp->p_isrc; - line = posp->p_iline; - } else { - src = posp->p_src; - line = posp->p_line; - } - qm = !Hflag && posp->p_src != posp->p_isrc; - - len = strlen(fn = lbasename(fnames[src])); - len += 3 * sizeof (u_short) + 4; - - if (len > blen) - buf = xrealloc(buf, blen = len); - if (line != 0) { - (void)sprintf(buf, "%s%s(%d)", - fn, qm ? "?" : "", line); - } else { - (void)sprintf(buf, "%s", fn); - } - - return (buf); -} diff --git a/usr.bin/xlint/lint2/read.c b/usr.bin/xlint/lint2/read.c deleted file mode 100644 index 2a01ebb03978..000000000000 --- a/usr.bin/xlint/lint2/read.c +++ /dev/null @@ -1,1245 +0,0 @@ -/* $NetBSD: read.c,v 1.19 2007/09/28 21:53:50 uwe Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: read.c,v 1.19 2007/09/28 21:53:50 uwe Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include - -#include "lint2.h" - - -/* index of current (included) source file */ -static int srcfile; - -/* - * The array pointed to by inpfns maps the file name indices of input files - * to the file name indices used in lint2 - */ -static short *inpfns; -static size_t ninpfns; - -/* - * The array pointed to by *fnames maps file name indizes to file names. - * Indices of type short are used instead of pointers to save memory. - */ -const char **fnames; -static size_t nfnames; - -/* - * Types are shared (to save memory for the types itself) and accessed - * via indices (to save memory for references to types (indices are short)). - * To share types, an equal type must be located fast. This is done by a - * hash table. Access by indices is done via an array of pointers to the - * types. - */ -typedef struct thtab { - const char *th_name; - u_short th_idx; - struct thtab *th_nxt; -} thtab_t; -static thtab_t **thtab; /* hash table */ -type_t **tlst; /* array for indexed access */ -static size_t tlstlen; /* length of tlst */ - -static hte_t **renametab; - -/* index of current C source file (as spezified at the command line) */ -static int csrcfile; - - -#define inperr() inperror(__FILE__, __LINE__) -static void inperror(const char *, size_t); -static void setsrc(const char *); -static void setfnid(int, const char *); -static void funccall(pos_t *, const char *); -static void decldef(pos_t *, const char *); -static void usedsym(pos_t *, const char *); -static u_short inptype(const char *, const char **); -static int gettlen(const char *, const char **); -static u_short findtype(const char *, size_t, int); -static u_short storetyp(type_t *, const char *, size_t, int); -static int thash(const char *, size_t); -static char *inpqstrg(const char *, const char **); -static const char *inpname(const char *, const char **); -static int getfnidx(const char *); - -void -readfile(const char *name) -{ - FILE *inp; - size_t len; - const char *cp; - char *line, *eptr, rt = '\0'; - int cline, isrc, iline; - pos_t pos; - - if (inpfns == NULL) - if ((inpfns = calloc(ninpfns = 128, sizeof (short))) == NULL) - nomem(); - if (fnames == NULL) - if ((fnames = calloc(nfnames = 256, sizeof (char *))) == NULL) - nomem(); - if (tlstlen == 0) - if ((tlst = calloc(tlstlen = 256, sizeof (type_t *))) == NULL) - nomem(); - if (thtab == NULL) - if ((thtab = calloc(THSHSIZ2, sizeof (thtab_t))) == NULL) - nomem(); - - _inithash(&renametab); - - srcfile = getfnidx(name); - - if ((inp = fopen(name, "r")) == NULL) - err(1, "cannot open %s", name); - - while ((line = fgetln(inp, &len)) != NULL) { - - if (len == 0 || line[len - 1] != '\n') - inperr(); - line[len - 1] = '\0'; - cp = line; - - /* line number in csrcfile */ - cline = (int)strtol(cp, &eptr, 10); - if (cp == eptr) { - cline = -1; - } else { - cp = eptr; - } - - /* record type */ - if (*cp != '\0') { - rt = *cp++; - } else { - inperr(); - } - - if (rt == 'S') { - setsrc(cp); - continue; - } else if (rt == 's') { - setfnid(cline, cp); - continue; - } - - /* - * Index of (included) source file. If this index is - * different from csrcfile, it refers to an included - * file. - */ - isrc = (int)strtol(cp, &eptr, 10); - if (cp == eptr) - inperr(); - cp = eptr; - isrc = inpfns[isrc]; - - /* line number in isrc */ - if (*cp++ != '.') - inperr(); - iline = (int)strtol(cp, &eptr, 10); - if (cp == eptr) - inperr(); - cp = eptr; - - pos.p_src = (u_short)csrcfile; - pos.p_line = (u_short)cline; - pos.p_isrc = (u_short)isrc; - pos.p_iline = (u_short)iline; - - /* process rest of this record */ - switch (rt) { - case 'c': - funccall(&pos, cp); - break; - case 'd': - decldef(&pos, cp); - break; - case 'u': - usedsym(&pos, cp); - break; - default: - inperr(); - } - - } - - _destroyhash(renametab); - - if (ferror(inp)) - err(1, "read error on %s", name); - - (void)fclose(inp); -} - - -static void -inperror(const char *file, size_t line) -{ - - errx(1, "%s,%zd: input file error: %s", file, line, fnames[srcfile]); -} - -/* - * Set the name of the C source file of the .ln file which is - * currently read. - */ -static void -setsrc(const char *cp) -{ - - csrcfile = getfnidx(cp); -} - -/* - * setfnid() gets as input an index as used in an input file and the - * associated file name. If necessary, it creates a new lint2 file - * name index for this file name and creates the mapping of the index - * as used in the input file to the index used in lint2. - */ -static void -setfnid(int fid, const char *cp) -{ - - if (fid == -1) - inperr(); - - if (fid >= ninpfns) { - if ((inpfns = realloc(inpfns, (ninpfns * 2) * sizeof (short))) - == NULL) - nomem(); - (void)memset(inpfns + ninpfns, 0, ninpfns * sizeof (short)); - ninpfns *= 2; - } - /* - * Should always be true because indices written in the output - * file by lint1 are always the previous index + 1. - */ - if (fid >= ninpfns) - errx(1, "internal error: setfnid()"); - inpfns[fid] = (u_short)getfnidx(cp); -} - -/* - * Process a function call record (c-record). - */ -static void -funccall(pos_t *posp, const char *cp) -{ - arginf_t *ai, **lai; - char c, *eptr; - int rused, rdisc; - hte_t *hte; - fcall_t *fcall; - const char *name; - - fcall = xalloc(sizeof (fcall_t)); - STRUCT_ASSIGN(fcall->f_pos, *posp); - - /* read flags */ - rused = rdisc = 0; - lai = &fcall->f_args; - while ((c = *cp) == 'u' || c == 'i' || c == 'd' || - c == 'z' || c == 'p' || c == 'n' || c == 's') { - cp++; - switch (c) { - case 'u': - if (rused || rdisc) - inperr(); - rused = 1; - break; - case 'i': - if (rused || rdisc) - inperr(); - break; - case 'd': - if (rused || rdisc) - inperr(); - rdisc = 1; - break; - case 'z': - case 'p': - case 'n': - case 's': - ai = xalloc(sizeof (arginf_t)); - ai->a_num = (int)strtol(cp, &eptr, 10); - if (cp == eptr) - inperr(); - cp = eptr; - if (c == 'z') { - ai->a_pcon = ai->a_zero = 1; - } else if (c == 'p') { - ai->a_pcon = 1; - } else if (c == 'n') { - ai->a_ncon = 1; - } else { - ai->a_fmt = 1; - ai->a_fstrg = inpqstrg(cp, &cp); - } - *lai = ai; - lai = &ai->a_nxt; - break; - } - } - fcall->f_rused = rused; - fcall->f_rdisc = rdisc; - - /* read name of function */ - name = inpname(cp, &cp); - - /* first look it up in the renaming table, then in the normal table */ - hte = _hsearch(renametab, name, 0); - if (hte != NULL) - hte = hte->h_hte; - else - hte = hsearch(name, 1); - hte->h_used = 1; - - fcall->f_type = inptype(cp, &cp); - - *hte->h_lcall = fcall; - hte->h_lcall = &fcall->f_nxt; - - if (*cp != '\0') - inperr(); -} - -/* - * Process a declaration or definition (d-record). - */ -static void -decldef(pos_t *posp, const char *cp) -{ - sym_t *symp, sym; - char c, *ep, *pos1; - int used, renamed; - hte_t *hte, *renamehte = NULL; - const char *name, *rename; - - (void)memset(&sym, 0, sizeof (sym)); - STRUCT_ASSIGN(sym.s_pos, *posp); - sym.s_def = NODECL; - - used = 0; - - while (strchr("tdeurosvPS", (c = *cp)) != NULL) { - cp++; - switch (c) { - case 't': - if (sym.s_def != NODECL) - inperr(); - sym.s_def = TDEF; - break; - case 'd': - if (sym.s_def != NODECL) - inperr(); - sym.s_def = DEF; - break; - case 'e': - if (sym.s_def != NODECL) - inperr(); - sym.s_def = DECL; - break; - case 'u': - if (used) - inperr(); - used = 1; - break; - case 'r': - if (sym.s_rval) - inperr(); - sym.s_rval = 1; - break; - case 'o': - if (sym.s_osdef) - inperr(); - sym.s_osdef = 1; - break; - case 's': - if (sym.s_static) - inperr(); - sym.s_static = 1; - break; - case 'v': - if (sym.s_va) - inperr(); - sym.s_va = 1; - sym.s_nva = (short)strtol(cp, &ep, 10); - if (cp == ep) - inperr(); - cp = ep; - break; - case 'P': - if (sym.s_prfl) - inperr(); - sym.s_prfl = 1; - sym.s_nprfl = (short)strtol(cp, &ep, 10); - if (cp == ep) - inperr(); - cp = ep; - break; - case 'S': - if (sym.s_scfl) - inperr(); - sym.s_scfl = 1; - sym.s_nscfl = (short)strtol(cp, &ep, 10); - if (cp == ep) - inperr(); - cp = ep; - break; - } - } - - /* read symbol name, doing renaming if necessary */ - name = inpname(cp, &cp); - renamed = 0; - if (*cp == 'r') { - cp++; - name = xstrdup(name); - rename = inpname(cp, &cp); - - /* enter it and see if it's already been renamed */ - renamehte = _hsearch(renametab, name, 1); - if (renamehte->h_hte == NULL) { - hte = hsearch(rename, 1); - renamehte->h_hte = hte; - renamed = 1; - } else if (strcmp((hte = renamehte->h_hte)->h_name, rename)) { - pos1 = xstrdup(mkpos(&renamehte->h_syms->s_pos)); - /* %s renamed multiple times\t%s :: %s */ - msg(18, name, pos1, mkpos(&sym.s_pos)); - free(pos1); - } - free((char *)name); - } else { - /* it might be a previously-done rename */ - hte = _hsearch(renametab, name, 0); - if (hte != NULL) - hte = hte->h_hte; - else - hte = hsearch(name, 1); - } - hte->h_used |= used; - if (sym.s_def == DEF || sym.s_def == TDEF) - hte->h_def = 1; - - sym.s_type = inptype(cp, &cp); - - /* - * Allocate memory for this symbol only if it was not already - * declared or tentatively defined at the same location with - * the same type. Works only for symbols with external linkage, - * because static symbols, tentatively defined at the same location - * but in different translation units are really different symbols. - */ - for (symp = hte->h_syms; symp != NULL; symp = symp->s_nxt) { - if (symp->s_pos.p_isrc == sym.s_pos.p_isrc && - symp->s_pos.p_iline == sym.s_pos.p_iline && - symp->s_type == sym.s_type && - ((symp->s_def == DECL && sym.s_def == DECL) || - (!sflag && symp->s_def == TDEF && sym.s_def == TDEF)) && - !symp->s_static && !sym.s_static) { - break; - } - } - - if (symp == NULL) { - /* allocsym reserviert keinen Platz fuer s_nva */ - if (sym.s_va || sym.s_prfl || sym.s_scfl) { - symp = xalloc(sizeof (sym_t)); - STRUCT_ASSIGN(*symp, sym); - } else { - symp = xalloc(sizeof (symp->s_s)); - STRUCT_ASSIGN(symp->s_s, sym.s_s); - } - *hte->h_lsym = symp; - hte->h_lsym = &symp->s_nxt; - - /* XXX hack so we can remember where a symbol was renamed */ - if (renamed) - renamehte->h_syms = symp; - } - - if (*cp != '\0') - inperr(); -} - -/* - * Read an u-record (emitted by lint1 if a symbol was used). - */ -static void -usedsym(pos_t *posp, const char *cp) -{ - usym_t *usym; - hte_t *hte; - const char *name; - - usym = xalloc(sizeof (usym_t)); - STRUCT_ASSIGN(usym->u_pos, *posp); - - /* needed as delimiter between two numbers */ - if (*cp++ != 'x') - inperr(); - - name = inpname(cp, &cp); - hte = _hsearch(renametab, name, 0); - if (hte != NULL) - hte = hte->h_hte; - else - hte = hsearch(name, 1); - hte->h_used = 1; - - *hte->h_lusym = usym; - hte->h_lusym = &usym->u_nxt; -} - -/* - * Read a type and return the index of this type. - */ -static u_short -inptype(const char *cp, const char **epp) -{ - char c, s, *eptr; - const char *ep; - type_t *tp; - int narg, i, osdef = 0; - size_t tlen; - u_short tidx, sidx; - int h; - - /* If we have this type already, return it's index. */ - tlen = gettlen(cp, &ep); - h = thash(cp, tlen); - if ((tidx = findtype(cp, tlen, h)) != 0) { - *epp = ep; - return (tidx); - } - - /* No, we must create a new type. */ - tp = xalloc(sizeof (type_t)); - - tidx = storetyp(tp, cp, tlen, h); - - c = *cp++; - - while (c == 'c' || c == 'v') { - if (c == 'c') { - tp->t_const = 1; - } else { - tp->t_volatile = 1; - } - c = *cp++; - } - - if (c == 's' || c == 'u' || c == 'l' || c == 'e') { - s = c; - c = *cp++; - } else { - s = '\0'; - } - - switch (c) { - case 'C': - tp->t_tspec = s == 's' ? SCHAR : (s == 'u' ? UCHAR : CHAR); - break; - case 'S': - tp->t_tspec = s == 'u' ? USHORT : SHORT; - break; - case 'I': - tp->t_tspec = s == 'u' ? UINT : INT; - break; - case 'L': - tp->t_tspec = s == 'u' ? ULONG : LONG; - break; - case 'Q': - tp->t_tspec = s == 'u' ? UQUAD : QUAD; - break; - case 'D': - tp->t_tspec = s == 's' ? FLOAT : (s == 'l' ? LDOUBLE : DOUBLE); - break; - case 'V': - tp->t_tspec = VOID; - break; - case 'P': - tp->t_tspec = PTR; - break; - case 'A': - tp->t_tspec = ARRAY; - break; - case 'F': - case 'f': - osdef = c == 'f'; - tp->t_tspec = FUNC; - break; - case 'T': - tp->t_tspec = s == 'e' ? ENUM : (s == 's' ? STRUCT : UNION); - break; - } - - switch (tp->t_tspec) { - case ARRAY: - tp->t_dim = (int)strtol(cp, &eptr, 10); - cp = eptr; - sidx = inptype(cp, &cp); /* force seq. point! (ditto below) */ - tp->t_subt = TP(sidx); - break; - case PTR: - sidx = inptype(cp, &cp); - tp->t_subt = TP(sidx); - break; - case FUNC: - c = *cp; - if (isdigit((u_char)c)) { - if (!osdef) - tp->t_proto = 1; - narg = (int)strtol(cp, &eptr, 10); - cp = eptr; - if ((tp->t_args = calloc((size_t)(narg + 1), - sizeof (type_t *))) == NULL) - nomem(); - for (i = 0; i < narg; i++) { - if (i == narg - 1 && *cp == 'E') { - tp->t_vararg = 1; - cp++; - } else { - sidx = inptype(cp, &cp); - tp->t_args[i] = TP(sidx); - } - } - } - sidx = inptype(cp, &cp); - tp->t_subt = TP(sidx); - break; - case ENUM: - tp->t_tspec = INT; - tp->t_isenum = 1; - /* FALLTHROUGH */ - case STRUCT: - case UNION: - switch (*cp++) { - case '1': - tp->t_istag = 1; - tp->t_tag = hsearch(inpname(cp, &cp), 1); - break; - case '2': - tp->t_istynam = 1; - tp->t_tynam = hsearch(inpname(cp, &cp), 1); - break; - case '3': - tp->t_isuniqpos = 1; - tp->t_uniqpos.p_line = strtol(cp, &eptr, 10); - cp = eptr; - cp++; - /* xlate to 'global' file name. */ - tp->t_uniqpos.p_file = - addoutfile(inpfns[strtol(cp, &eptr, 10)]); - cp = eptr; - cp++; - tp->t_uniqpos.p_uniq = strtol(cp, &eptr, 10); - cp = eptr; - break; - } - break; - case LONG: - case VOID: - case LDOUBLE: - case DOUBLE: - case FLOAT: - case UQUAD: - case QUAD: - case ULONG: - case UINT: - case INT: - case USHORT: - case SHORT: - case UCHAR: - case SCHAR: - case CHAR: - case UNSIGN: - case SIGNED: - case NOTSPEC: - break; - } - - *epp = cp; - return (tidx); -} - -/* - * Get the length of a type string. - */ -static int -gettlen(const char *cp, const char **epp) -{ - const char *cp1; - char c, s, *eptr; - tspec_t t; - int narg, i, cm, vm; - - cp1 = cp; - - c = *cp++; - - cm = vm = 0; - - while (c == 'c' || c == 'v') { - if (c == 'c') { - if (cm) - inperr(); - cm = 1; - } else { - if (vm) - inperr(); - vm = 1; - } - c = *cp++; - } - - if (c == 's' || c == 'u' || c == 'l' || c == 'e') { - s = c; - c = *cp++; - } else { - s = '\0'; - } - - t = NOTSPEC; - - switch (c) { - case 'C': - if (s == 's') { - t = SCHAR; - } else if (s == 'u') { - t = UCHAR; - } else if (s == '\0') { - t = CHAR; - } - break; - case 'S': - if (s == 'u') { - t = USHORT; - } else if (s == '\0') { - t = SHORT; - } - break; - case 'I': - if (s == 'u') { - t = UINT; - } else if (s == '\0') { - t = INT; - } - break; - case 'L': - if (s == 'u') { - t = ULONG; - } else if (s == '\0') { - t = LONG; - } - break; - case 'Q': - if (s == 'u') { - t = UQUAD; - } else if (s == '\0') { - t = QUAD; - } - break; - case 'D': - if (s == 's') { - t = FLOAT; - } else if (s == 'l') { - t = LDOUBLE; - } else if (s == '\0') { - t = DOUBLE; - } - break; - case 'V': - if (s == '\0') - t = VOID; - break; - case 'P': - if (s == '\0') - t = PTR; - break; - case 'A': - if (s == '\0') - t = ARRAY; - break; - case 'F': - case 'f': - if (s == '\0') - t = FUNC; - break; - case 'T': - if (s == 'e') { - t = ENUM; - } else if (s == 's') { - t = STRUCT; - } else if (s == 'u') { - t = UNION; - } - break; - default: - inperr(); - } - - if (t == NOTSPEC) - inperr(); - - switch (t) { - case ARRAY: - (void)strtol(cp, &eptr, 10); - if (cp == eptr) - inperr(); - cp = eptr; - (void)gettlen(cp, &cp); - break; - case PTR: - (void)gettlen(cp, &cp); - break; - case FUNC: - c = *cp; - if (isdigit((u_char)c)) { - narg = (int)strtol(cp, &eptr, 10); - cp = eptr; - for (i = 0; i < narg; i++) { - if (i == narg - 1 && *cp == 'E') { - cp++; - } else { - (void)gettlen(cp, &cp); - } - } - } - (void)gettlen(cp, &cp); - break; - case ENUM: - case STRUCT: - case UNION: - switch (*cp++) { - case '1': - (void)inpname(cp, &cp); - break; - case '2': - (void)inpname(cp, &cp); - break; - case '3': - /* unique position: line.file.uniquifier */ - (void)strtol(cp, &eptr, 10); - if (cp == eptr) - inperr(); - cp = eptr; - if (*cp++ != '.') - inperr(); - (void)strtol(cp, &eptr, 10); - if (cp == eptr) - inperr(); - cp = eptr; - if (*cp++ != '.') - inperr(); - (void)strtol(cp, &eptr, 10); - if (cp == eptr) - inperr(); - cp = eptr; - break; - default: - inperr(); - } - break; - case FLOAT: - case USHORT: - case SHORT: - case UCHAR: - case SCHAR: - case CHAR: - case UNSIGN: - case SIGNED: - case NOTSPEC: - case INT: - case UINT: - case DOUBLE: - case LDOUBLE: - case VOID: - case ULONG: - case QUAD: - case UQUAD: - case LONG: - break; - } - - *epp = cp; - return (cp - cp1); -} - -/* - * Search a type by its type string. - */ -static u_short -findtype(const char *cp, size_t len, int h) -{ - thtab_t *thte; - - for (thte = thtab[h]; thte != NULL; thte = thte->th_nxt) { - if (strncmp(thte->th_name, cp, len) != 0) - continue; - if (thte->th_name[len] == '\0') - return (thte->th_idx); - } - - return (0); -} - -/* - * Store a type and it's type string so we can later share this type - * if we read the same type string from the input file. - */ -static u_short -storetyp(type_t *tp, const char *cp, size_t len, int h) -{ - static u_int tidx = 1; /* 0 is reserved */ - thtab_t *thte; - char *name; - - if (tidx >= USHRT_MAX) - errx(1, "sorry, too many types"); - - if (tidx == tlstlen - 1) { - if ((tlst = realloc(tlst, (tlstlen * 2) * sizeof (type_t *))) - == NULL) - nomem(); - (void)memset(tlst + tlstlen, 0, tlstlen * sizeof (type_t *)); - tlstlen *= 2; - } - - tlst[tidx] = tp; - - /* create a hash table entry */ - name = xalloc(len + 1); - (void)memcpy(name, cp, len); - name[len] = '\0'; - - thte = xalloc(sizeof (thtab_t)); - thte->th_name = name; - thte->th_idx = tidx; - thte->th_nxt = thtab[h]; - thtab[h] = thte; - - return ((u_short)tidx++); -} - -/* - * Hash function for types - */ -static int -thash(const char *s, size_t len) -{ - u_int v; - - v = 0; - while (len-- != 0) { - v = (v << sizeof (v)) + (u_char)*s++; - v ^= v >> (sizeof (v) * CHAR_BIT - sizeof (v)); - } - return (v % THSHSIZ2); -} - -/* - * Read a string enclosed by "". This string may contain quoted chars. - */ -static char * -inpqstrg(const char *src, const char **epp) -{ - char *strg, *dst; - size_t slen; - int c; - int v; - - if ((dst = strg = malloc(slen = 32)) == NULL) - nomem(); - - if ((c = *src++) != '"') - inperr(); - if ((c = *src++) == '\0') - inperr(); - - while (c != '"') { - if (c == '\\') { - if ((c = *src++) == '\0') - inperr(); - switch (c) { - case 'n': - c = '\n'; - break; - case 't': - c = '\t'; - break; - case 'v': - c = '\v'; - break; - case 'b': - c = '\b'; - break; - case 'r': - c = '\r'; - break; - case 'f': - c = '\f'; - break; - case 'a': - c = '\a'; - break; - case '\\': - c = '\\'; - break; - case '"': - c = '"'; - break; - case '\'': - c = '\''; - break; - case '0': case '1': case '2': case '3': - v = (c - '0') << 6; - if ((c = *src++) < '0' || c > '7') - inperr(); - v |= (c - '0') << 3; - if ((c = *src++) < '0' || c > '7') - inperr(); - v |= c - '0'; - c = (u_char)v; - break; - default: - inperr(); - } - } - /* keep space for trailing '\0' */ - if (dst - strg == slen - 1) { - if ((strg = realloc(strg, slen * 2)) == NULL) - nomem(); - dst = strg + (slen - 1); - slen *= 2; - } - *dst++ = (char)c; - if ((c = *src++) == '\0') - inperr(); - } - *dst = '\0'; - - *epp = src; - return (strg); -} - -/* - * Read the name of a symbol in static memory. - */ -static const char * -inpname(const char *cp, const char **epp) -{ - static char *buf; - static size_t blen = 0; - size_t len, i; - char *eptr, c; - - len = (int)strtol(cp, &eptr, 10); - if (cp == eptr) - inperr(); - cp = eptr; - if (len + 1 > blen) - if ((buf = realloc(buf, blen = len + 1)) == NULL) - nomem(); - for (i = 0; i < len; i++) { - c = *cp++; - if (!isalnum((unsigned char)c) && c != '_') - inperr(); - buf[i] = c; - } - buf[i] = '\0'; - - *epp = cp; - return (buf); -} - -/* - * Return the index of a file name. If the name cannot be found, create - * a new entry and return the index of the newly created entry. - */ -static int -getfnidx(const char *fn) -{ - int i; - - /* 0 ist reserved */ - for (i = 1; fnames[i] != NULL; i++) { - if (strcmp(fnames[i], fn) == 0) - break; - } - if (fnames[i] != NULL) - return (i); - - if (i == nfnames - 1) { - if ((fnames = realloc(fnames, (nfnames * 2) * sizeof (char *))) - == NULL) - nomem(); - (void)memset(fnames + nfnames, 0, nfnames * sizeof (char *)); - nfnames *= 2; - } - - if ((fnames[i] = strdup(fn)) == NULL) - nomem(); - return (i); -} - -/* - * Separate symbols with static and external linkage. - */ -void -mkstatic(hte_t *hte) -{ - sym_t *sym1, **symp, *sym; - fcall_t **callp, *call; - usym_t **usymp, *usym; - hte_t *nhte; - int ofnd; - - /* Look for first static definition */ - for (sym1 = hte->h_syms; sym1 != NULL; sym1 = sym1->s_nxt) { - if (sym1->s_static) - break; - } - if (sym1 == NULL) - return; - - /* Do nothing if this name is used only in one translation unit. */ - ofnd = 0; - for (sym = hte->h_syms; sym != NULL && !ofnd; sym = sym->s_nxt) { - if (sym->s_pos.p_src != sym1->s_pos.p_src) - ofnd = 1; - } - for (call = hte->h_calls; call != NULL && !ofnd; call = call->f_nxt) { - if (call->f_pos.p_src != sym1->s_pos.p_src) - ofnd = 1; - } - for (usym = hte->h_usyms; usym != NULL && !ofnd; usym = usym->u_nxt) { - if (usym->u_pos.p_src != sym1->s_pos.p_src) - ofnd = 1; - } - if (!ofnd) { - hte->h_used = 1; - /* errors about undef. static symbols are printed in lint1 */ - hte->h_def = 1; - hte->h_static = 1; - return; - } - - /* - * Create a new hash table entry - * - * XXX this entry should be put at the beginning of the list to - * avoid to process the same symbol twice. - */ - for (nhte = hte; nhte->h_link != NULL; nhte = nhte->h_link) - continue; - nhte->h_link = xmalloc(sizeof (hte_t)); - nhte = nhte->h_link; - nhte->h_name = hte->h_name; - nhte->h_used = 1; - nhte->h_def = 1; /* error in lint1 */ - nhte->h_static = 1; - nhte->h_syms = NULL; - nhte->h_lsym = &nhte->h_syms; - nhte->h_calls = NULL; - nhte->h_lcall = &nhte->h_calls; - nhte->h_usyms = NULL; - nhte->h_lusym = &nhte->h_usyms; - nhte->h_link = NULL; - nhte->h_hte = NULL; - - /* - * move all symbols used in this translation unit into the new - * hash table entry. - */ - for (symp = &hte->h_syms; (sym = *symp) != NULL; ) { - if (sym->s_pos.p_src == sym1->s_pos.p_src) { - sym->s_static = 1; - (*symp) = sym->s_nxt; - if (hte->h_lsym == &sym->s_nxt) - hte->h_lsym = symp; - sym->s_nxt = NULL; - *nhte->h_lsym = sym; - nhte->h_lsym = &sym->s_nxt; - } else { - symp = &sym->s_nxt; - } - } - for (callp = &hte->h_calls; (call = *callp) != NULL; ) { - if (call->f_pos.p_src == sym1->s_pos.p_src) { - (*callp) = call->f_nxt; - if (hte->h_lcall == &call->f_nxt) - hte->h_lcall = callp; - call->f_nxt = NULL; - *nhte->h_lcall = call; - nhte->h_lcall = &call->f_nxt; - } else { - callp = &call->f_nxt; - } - } - for (usymp = &hte->h_usyms; (usym = *usymp) != NULL; ) { - if (usym->u_pos.p_src == sym1->s_pos.p_src) { - (*usymp) = usym->u_nxt; - if (hte->h_lusym == &usym->u_nxt) - hte->h_lusym = usymp; - usym->u_nxt = NULL; - *nhte->h_lusym = usym; - nhte->h_lusym = &usym->u_nxt; - } else { - usymp = &usym->u_nxt; - } - } - - /* h_def must be recalculated for old hte */ - hte->h_def = nhte->h_def = 0; - for (sym = hte->h_syms; sym != NULL; sym = sym->s_nxt) { - if (sym->s_def == DEF || sym->s_def == TDEF) { - hte->h_def = 1; - break; - } - } - - mkstatic(hte); -} diff --git a/usr.bin/xlint/llib/Makefile b/usr.bin/xlint/llib/Makefile deleted file mode 100644 index df79a752936b..000000000000 --- a/usr.bin/xlint/llib/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# $NetBSD: Makefile,v 1.7 2000/06/14 20:22:19 matt Exp $ -# $FreeBSD$ - -LIBS= llib-lposix.ln llib-lstdc.ln - -FILES= ${LIBS} -FILESDIR= ${LINTLIBDIR} - -CLEANFILES+= ${LIBS} - -llib-lposix.ln: llib-lposix - ${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC} - -llib-lstdc.ln: llib-lstdc - ${LINT} ${LINTFLAGS} -Cstdc ${.ALLSRC} - -.include - -.if !empty(STAGE_INCLUDEDIR) -LINTFLAGS+= -I${STAGE_INCLUDEDIR} -.else -.if ${CFLAGS:M--sysroot=*} != "" -_sysroot?= ${CFLAGS:M--sysroot=*:[1]:C,^--sysroot=,,} -.elif ${CC:M--sysroot=*} != "" -_sysroot?= ${CC:M--sysroot=*:[1]:C,^--sysroot=,,} -.endif -.if !empty(_sysroot) -LINTFLAGS+= -I${_sysroot}/usr/include -.endif -.endif diff --git a/usr.bin/xlint/llib/Makefile.depend b/usr.bin/xlint/llib/Makefile.depend deleted file mode 100644 index 19a39798ee4e..000000000000 --- a/usr.bin/xlint/llib/Makefile.depend +++ /dev/null @@ -1,14 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - include \ - lib/msun \ - usr.bin/xlint/xlint.host \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/xlint/llib/llib-lposix b/usr.bin/xlint/llib/llib-lposix deleted file mode 100644 index b3f9ca93d0d3..000000000000 --- a/usr.bin/xlint/llib/llib-lposix +++ /dev/null @@ -1,314 +0,0 @@ -/* $NetBSD: llib-lposix,v 1.2 1995/07/03 21:25:09 cgd Exp $ */ -/* $FreeBSD$ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* LINTLIBRARY */ - -#define _POSIX_SOURCE - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* PROTOLIB1 */ - - -void (abort)(void); -int (abs)(int j); -int (access)(const char *path, int amode); -double (acos)(double x); -unsigned (alarm)(unsigned seconds); -char *(asctime)(const struct tm *timeptr); -double (asin)(double x); -void (__assert)(const char *expression, const char *func, int line, - const char *file); -double (atan)(double x); -double (atan2)(double y, double x); -int (atexit)(void (*func)(void)); -double (atof)(const char *nptr); -int (atoi)(const char *nptr); -long (atol)(const char *nptr); -void *(bsearch)(const void *key, const void *base, size_t nmemb, - size_t size, int (*compar)(const void *, const void *)); -void *(calloc)(size_t nmemb, size_t size); -double (ceil)(double x); -speed_t (cfgetispeed)(const struct termios *p); -speed_t (cfgetospeed)(const struct termios *p); -int (cfsetispeed)(struct termios *p, speed_t speed); -int (cfsetospeed)(struct termios *p, speed_t speed); -int (chdir)(const char *path); -int (chmod)(const char *path, mode_t mode); -int (chown)(const char *path, uid_t owner, gid_t group); -void (clearerr)(FILE *stream); -clock_t (clock)(void); -int (close)(int fildes); -int (closedir)(DIR *dirp); -double (cos)(double x); -double (cosh)(double x); -int (creat)(const char *path, mode_t mode); -char *(ctermid)(char *s); -char *(ctime)(const time_t *timer); -char *(cuserid)(char *s); -double (difftime)(time_t time1, time_t time0); -div_t (div)(int numer, int denom); -int (dup)(int fildes); -int (dup2)(int fildes, int fildes2); -int (errno); -int (execl)(const char *path, const char *arg, ...); -int (execle)(const char *path, const char *arg, ...); -int (execlp)(const char *file, const char *arg, ...); -int (execv)(const char *path, char *const argv[]); -int (execve)(const char *path, char *const argv[], char *const *envp); -int (execvp)(const char *file, char *const argv[]); -void (exit)(int status); -void (_exit)(int status); -double (exp)(double x); -double (fabs)(double x); -int (fclose)(FILE *stream); -int (fcntl)(int fildes, int cmd, ...); -FILE *(fdopen)(int fildes, const char *type); -int (feof)(FILE *stream); -int (ferror)(FILE *stream); -int (fflush)(FILE *stream); -int (fgetc)(FILE *stream); -int (fgetpos)(FILE *stream, fpos_t *pos); -char *(fgets)(char *s, int n, FILE *stream); -int (fileno)(FILE *stream); -double (floor)(double x); -double (fmod)(double x, double y); -FILE *(fopen)(const char *filename, const char *mode); -pid_t (fork)(void); -long (fpathconf)(int fildes, int name); -/* PRINTFLIKE2 */ -int (fprintf)(FILE *stream, const char *format, ...); -int (fputc)(int c, FILE *stream); -int (fputs)(const char *s, FILE *stream); -size_t (fread)(void *ptr, size_t size, size_t nmemb, FILE *stream); -void (free)(void *ptr); -FILE *(freopen)(const char *filename, const char *mode, FILE *stream); -double (frepx)(double value, int *exp); -/* SCANFLIKE2 */ -int (fscanf)(FILE *stream, const char *format, ...); -int (fseek)(FILE *stream, long int offset, int whence); -int (fsetpos)(FILE *stream, const fpos_t *pos); -int (fstat)(int fildes, struct stat *buf); -long (ftell)(FILE *stream); -size_t (fwrite)(const void *ptr, size_t size, size_t nmemb, FILE *stream); -int (getc)(FILE *stream); -int (getchar)(void); -char *(getcwd)(char *buf, size_t size); -gid_t (getegid)(void); -char *(getenv)(const char *name); -uid_t (geteuid)(void); -gid_t (getgid)(void); -struct group *(getgrgid)(gid_t gid); -struct group *(getgrnam)(const char *name); -int (getgroups)(int gidsetsize, gid_t grouplist[]); -char *(getlogin)(void); -pid_t (getpgrp)(void); -pid_t (getpid)(void); -pid_t (getppid)(void); -struct passwd *(getpwnam)(const char *name); -struct passwd *(getpwuid)(uid_t uid); -char *(gets)(char *s); -uid_t (getuid)(void); -struct tm *(gmtime)(const time_t *timer); -int (isalnum)(int c); -int (isalpha)(int c); -int (isatty)(int fildes); -int (iscntrl)(int c); -int (isdigit)(int c); -int (isgraph)(int c); -int (islower)(int c); -int (isprint)(int c); -int (ispunct)(int c); -int (isspace)(int c); -int (isupper)(int c); -int (isxdigit)(int c); -int (kill)(pid_t pid, int sig); -long (labs)(long j); -double (ldexp)(double x, int exp); -ldiv_t (ldiv)(long numer, long denom); -int (link)(const char *existing, const char *new); -struct lconv *(localeconv)(void); -struct tm *(localtime)(const time_t *timer); -double (log)(double x); -double (log10)(double x); -void (longjmp)(jmp_buf env, int val); -off_t (lseek)(int fildes, off_t offset, int whence); -void *(malloc)(size_t size); -int (mblen)(const char *s, size_t n); -size_t (mbstowcs)(wchar_t *pwcs, const char *s, size_t n); -int (mbtowc)(wchar_t *pwc, const char *s, size_t n); -void *(memchr)(const void *s, int c, size_t n); -int (memcmp)(const void *s1, const void *s2, size_t n); -void *(memcpy)(void *s1, const void *s2, size_t n); -void *(memmove)(void *s1, const void *s2, size_t n); -void *(memset)(void *s, int c, size_t n); -int (mkdir)(const char *path, mode_t mode); -int (mkfifo)(const char *path, mode_t mode); -time_t (mktime)(struct tm *timeptr); -double (modf)(double value, double *iptr); -int (open)(const char *path, int oflag, ...); -DIR *(opendir)(const char *dirname); -long (pathconf)(const char *path, int name); -int (pause)(void); -void (perror)(const char *s); -int (pipe)(int fildes[2]); -double (pow)(double x, double y); -/* PRINTFLIKE1 */ -int (printf)(const char *format, ...); -int (putc)(int c, FILE *stream); -int (putchar)(int c); -int (puts)(const char *s); -void (qsort)(void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); -int (raise)(int sig); -int (rand)(void); -ssize_t (read)(int fildes, void *buf, size_t nbyte); -struct dirent *(readdir)(DIR *dirp); -void *(realloc)(void *ptr, size_t size); -int (remove)(const char *filename); -int (rename)(const char *old, const char *new); -void (rewind)(FILE *stream); -void (rewinddir)(DIR *dirp); -int (rmdir)(const char *path); -/* SCANFLIKE1 */ -int (scanf)(const char *format, ...); -void (setbuf)(FILE *stream, char *buf); -int (setgid)(gid_t gid); -int (setjmp)(jmp_buf env); -char *(setlocale)(int category, const char *locale); -int (setpgid)(pid_t pid, pid_t pgid); -pid_t (setsid)(void); -int (setuid)(uid_t uid); -int (setvbuf)(FILE *stream, char *buf, int mode, size_t size); -int (sigaction)(int sig, const struct sigaction *act, - struct sigaction *oact); -int (sigaddset)(sigset_t *set, int signo); -int (sigdelset)(sigset_t *set, int signo); -int (sigemptyset)(sigset_t *set); -int (sigfillset)(sigset_t *set); -int (sigismember)(const sigset_t *set, int signo); -void (siglongjmp)(sigjmp_buf env, int val); -void (*(signal)(int sig, void (*func)(int)))(int); -int (sigpending)(sigset_t *set); -int (sigprocmask)(int how, const sigset_t *set, sigset_t *oset); -int (sigsetjmp)(sigjmp_buf env, int savemask); -int (sigsuspend)(const sigset_t *sigmask); -double (sin)(double x); -double (sinh)(double x); -unsigned (sleep)(unsigned seconds); -/* PRINTFLIKE2 */ -int (sprintf)(char *s, const char *format, ...); -double (sqrt)(double x); -void (srand)(unsigned seed); -/* SCANFLIKE2 */ -int (sscanf)(const char *s, const char *format, ...); -int (stat)(const char *path, struct stat *buf); -char *(strcat)(char *s1, const char *s2); -char *(strchr)(const char *s, int c); -int (strcmp)(const char *s1, const char *s2); -int (strcoll)(const char *s1, const char *s2); -char *(strcpy)(char *s1, const char *s2); -size_t (strcspn)(const char *s1, const char *s2); -char *(strerror)(int errnum); -size_t (strftime)(char *s, size_t maxsize, const char *format, - const struct tm *timeptr); -size_t (strlen)(const char *s); -char *(strncat)(char *s1, const char *s2, size_t n); -int (strncmp)(const char *s1, const char *s2, size_t n); -char *(strncpy)(char *s1, const char *s2, size_t n); -char *(strpbrk)(const char *s1, const char *s2); -char *(strrchr)(const char *s, int c); -size_t (strspn)(const char *s1, const char *s2); -char *(strstr)(const char *s1, const char *s2); -double (strtod)(const char *nptr, char **endptr); -char *(strtok)(char *s1, const char *s2); -long (strtol)(const char *nptr, char **endptr, int base); -unsigned long (strtoul)(const char *nptr, char **endptr, int base); -size_t (strxfrm)(char *s1, const char *s2, size_t n); -long (sysconf)(int name); -int (system)(const char *string); -double (tan)(double x); -double (tanh)(double x); -int (tcdrain)(int fildes); -int (tcflow)(int fildes, int action); -int (tcflush)(int fildes, int queue_selector); -int (tcgetattr)(int fildes, struct termios *tp); -pid_t (tcgetpgrp)(int fildes); -int (tcsendbreak)(int fildes, int duration); -int (tcsetattr)(int fildes, int options, const struct termios *tp); -int (tcsetpgrp)(int fildes, pid_t pgrpid); -time_t (time)(time_t *timer); -clock_t (times)(struct tms *buffer); -FILE *(tmpfile)(void); -char *(tmpnam)(char *s); -int (tolower)(int c); -int (toupper)(int c); -char *(ttyname)(int filedes); -void (tzset)(void); -mode_t (umask)(mode_t cmask); -int (uname)(struct utsname *name); -int (ungetc)(int c, FILE *stream); -int (unlink)(const char *path); -int (utime)(const char *path, const struct utimbuf *times); -int (vfprintf)(FILE *stream, const char *format, va_list arg); -int (vprintf)(const char *format, va_list arg); -int (vsprintf)(char *s, const char *format, va_list arg); -pid_t (wait)(int *statloc); -pid_t (waitpid)(pid_t pid, int *stat_loc, int options); -size_t (wcstombs)(char *s, const wchar_t *pwcs, size_t n); -int (wctomb)(char *s, wchar_t wchar); -ssize_t (write)(int fildes, const void *buf, size_t nbyte); diff --git a/usr.bin/xlint/llib/llib-lstdc b/usr.bin/xlint/llib/llib-lstdc deleted file mode 100644 index 83b44f24f950..000000000000 --- a/usr.bin/xlint/llib/llib-lstdc +++ /dev/null @@ -1,254 +0,0 @@ -/* $NetBSD: llib-lstdc,v 1.2 1995/07/03 21:25:11 cgd Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* LINTLIBRARY */ - -#define _ANSI_SOURCE - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* PROTOLIB1 */ - -/* - * assert.h - */ -#ifdef __NetBSD__ -void (__assert)(const char *expression, int line, const char *file); -#else -void (assert)(int expression); -#endif - -/* - * ctype.h - */ -int (isalnum)(int c); -int (isalpha)(int c); -int (iscntrl)(int c); -int (isdigit)(int c); -int (isgraph)(int c); -int (islower)(int c); -int (isprint)(int c); -int (ispunct)(int c); -int (isspace)(int c); -int (isupper)(int c); -int (isxdigit)(int c); -int (tolower)(int c); -int (toupper)(int c); - -/* - * errno.h - */ -int (errno); - -/* - * locale.h - */ -char *(setlocale)(int category, const char *locale); -struct lconv *(localeconv)(void); - -/* - * math.h - */ -double (acos)(double x); -double (asin)(double x); -double (atan)(double x); -double (atan2)(double y, double x); -double (cos)(double x); -double (sin)(double x); -double (tan)(double x); -double (cosh)(double x); -double (sinh)(double x); -double (tanh)(double x); -double (exp)(double x); -double (frexp)(double value, int *exp); -double (ldexp)(double x, int exp); -double (log)(double x); -double (log10)(double x); -double (modf)(double value, double *iptr); -double (pow)(double x, double y); -double (sqrt)(double x); -double (ceil)(double x); -double (fabs)(double x); -double (floor)(double x); -double (fmod)(double x, double y); - -/* - * setjmp.h - */ -int (setjmp)(jmp_buf env); -void (longjmp)(jmp_buf env, int val); - -/* - * signal.h - */ -void (*(signal)(int sig, void (*func)(int)))(int); -int (raise)(int sig); - -/* - * stdio.h - */ -int (remove)(const char *filename); -int (rename)(const char *old, const char *new); -FILE *(tmpfile)(void); -char *(tmpnam)(char *s); -int (fclose)(FILE *stream); -int (fflush)(FILE *stream); -FILE *(fopen)(const char *filename, const char *mode); -FILE *(freopen)(const char *filename, const char *mode, FILE *stream); -void (setbuf)(FILE *stream, char *buf); -int (setvbuf)(FILE *stream, char *buf, int mode, size_t size); -/* PRINTFLIKE2 */ -int (fprintf)(FILE *stream, const char *format, ...); -/* SCANFLIKE2 */ -int (fscanf)(FILE *stream, const char *format, ...); -/* PRINTFLIKE1 */ -int (printf)(const char *format, ...); -/* SCANFLIKE1 */ -int (scanf)(const char *format, ...); -/* PRINTFLIKE2 */ -int (sprintf)(char *s, const char *format, ...); -/* SCANFLIKE2 */ -int (sscanf)(const char *s, const char *format, ...); -int (vfprintf)(FILE *stream, const char *format, va_list arg); -int (vprintf)(const char *format, va_list arg); -int (vsprintf)(char *s, const char *format, va_list arg); -int (fgetc)(FILE *stream); -char *(fgets)(char *s, int n, FILE *stream); -int (fputc)(int c, FILE *stream); -int (fputs)(const char *s, FILE *stream); -int (getc)(FILE *stream); -int (getchar)(void); -char *(gets)(char *s); -int (putc)(int c, FILE *stream); -int (putchar)(int c); -int (puts)(const char *s); -int (ungetc)(int c, FILE *stream); -size_t (fread)(void *ptr, size_t size, size_t nmemb, FILE *stream); -size_t (fwrite)(const void *ptr, size_t size, size_t nmemb, FILE *stream); -int (fgetpos)(FILE *stream, fpos_t *pos); -int (fseek)(FILE *stream, long offset, int whence); -int (fsetpos)(FILE *stream, const fpos_t *pos); -long (ftell)(FILE *stream); -void (rewind)(FILE *stream); -void (clearerr)(FILE *stream); -int (feof)(FILE *stream); -int (ferror)(FILE *stream); -void (perror)(const char *s); - -/* - * stdlib.h - */ -double (atof)(const char *nptr); -int (atoi)(const char *nptr); -long (atol)(const char *nptr); -double (strtod)(const char *nptr, char **endptr); -long (strtol)(const char *nptr, char **endptr, int base); -unsigned long (strtoul)(const char *nptr, char **endptr, int base); -int (rand)(void); -void (srand)(unsigned seed); -void *(calloc)(size_t nmemb, size_t size); -void (free)(void *ptr); -void *(malloc)(size_t size); -void *(realloc)(void *ptr, size_t size); -void (abort)(void); -int (atexit)(void (*func)(void)); -void (exit)(int status); -char *(getenv)(const char *name); -int (system)(const char *string); -void *(bsearch)(const void *key, const void *base, size_t nmemb, - size_t size, int (*compar)(const void *, const void *)); -void (qsort)(void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); -int (abs)(int j); -div_t (div)(int numer, int denom); -long (labs)(long j); -ldiv_t (ldiv)(long numer, long denom); -int (mblen)(const char *s, size_t n); -int (mbtowc)(wchar_t *PWC, const char *s, size_t n); -int (wctomb)(char *s, wchar_t wchar); -size_t (mbstowcs)(wchar_t *pwcs, const char *s, size_t n); -size_t (wcstombs)(char *s, const wchar_t *pwcs, size_t n); - -/* - * string.h - */ -void *(memcpy)(void *s1, const void *s2, size_t n); -void *(memmove)(void *s1, const void *s2, size_t n); -char *(strcpy)(char *s1, const char *s2); -char *(strncpy)(char *s1, const char *s2, size_t n); -char *(strcat)(char *s1, const char *s2); -char *(strncat)(char *s1, const char *s2, size_t n); -int (memcmp)(const void *s1, const void *s2, size_t n); -int (strcmp)(const char *s1, const char *s2); -int (strcoll)(const char *s1, const char *s2); -int (strncmp)(const char *s1, const char *s2, size_t n); -size_t (strxfrm)(char *s1, const char *s2, size_t n); -void *(memchr)(const void *s, int c, size_t n); -char *(strchr)(const char *s, int c); -size_t (strcspn)(const char *s1, const char *s2); -char *(strpbrk)(const char *s1, const char *s2); -char *(strrchr)(const char *s1, int c); -size_t (strspn)(const char *s1, const char *s2); -char *(strstr)(const char *s1, const char *s2); -char *(strtok)(char *s1, const char *s2); -void *(memset)(void *s, int c, size_t n); -char *(strerror)(int errnom); -size_t (strlen)(const char *s); - -/* - * time.h - */ -clock_t (clock)(void); -double (difftime)(time_t time1, time_t time2); -time_t (mktime)(struct tm *timeptr); -time_t (time)(time_t *timer); -char *(asctime)(const struct tm *timeptr); -char *(ctime)(const time_t *timer); -struct tm *(gmtime)(const time_t *timer); -struct tm *(localtime)(const time_t *timer); -size_t (strftime)(char *s, size_t maxsize, const char *format, - const struct tm *timeptr); diff --git a/usr.bin/xlint/xlint/Makefile b/usr.bin/xlint/xlint/Makefile deleted file mode 100644 index 5dfdfb314a71..000000000000 --- a/usr.bin/xlint/xlint/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# $NetBSD: Makefile,v 1.2 1995/07/03 21:25:14 cgd Exp $ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../lint1 - -PROG= xlint -PROGNAME= lint -SRCS= xlint.c mem.c -MAN= lint.1 - -CFLAGS+=-I${.CURDIR}/../lint1 -CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}\" - -.include "${.CURDIR}/../../Makefile.inc" -.include diff --git a/usr.bin/xlint/xlint/Makefile.depend b/usr.bin/xlint/xlint/Makefile.depend deleted file mode 100644 index 6cfaab1c3644..000000000000 --- a/usr.bin/xlint/xlint/Makefile.depend +++ /dev/null @@ -1,17 +0,0 @@ -# $FreeBSD$ -# Autogenerated - do NOT edit! - -DIRDEPS = \ - gnu/lib/csu \ - include \ - include/xlocale \ - lib/${CSU_DIR} \ - lib/libc \ - lib/libcompiler_rt \ - - -.include - -.if ${DEP_RELDIR} == ${_DEP_RELDIR} -# local dependencies - needed for -jN in clean tree -.endif diff --git a/usr.bin/xlint/xlint/lint.1 b/usr.bin/xlint/xlint/lint.1 deleted file mode 100644 index 30731d2df3a3..000000000000 --- a/usr.bin/xlint/xlint/lint.1 +++ /dev/null @@ -1,627 +0,0 @@ -.\" $NetBSD: lint.1,v 1.29 2004/01/26 21:59:42 wiz Exp $ -.\" -.\" Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. -.\" Copyright (c) 1994, 1995 Jochen Pohl -.\" All Rights Reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Jochen Pohl for -.\" The NetBSD Project. -.\" 4. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" $FreeBSD$ -.\" -.Dd Mar 23, 2015 -.Dt LINT 1 -.Os -.Sh NAME -.Nm lint -.Nd a C program verifier -.Sh SYNOPSIS -.Bk -words -.Nm -.Op Fl abceghprvwxzHFV -.Op Fl s | t -.Op Fl i | nu -.Op Fl D Ar name Ns Op = Ns Ar def -.Op Fl U Ar name -.Op Fl I Ar directory -.Op Fl d Ar directory -.Op Fl L Ar directory -.Op Fl MD -.Op Fl l Ar library -.Op Fl o Ar outputfile -.Op Fl B Ar directory -.Op Fl X Ar id Ns Op , Ns Ar id ... -.Ar -.Nm -.Op Fl abceghprvwzHFV -.Op Fl s | t -.Fl C Ar library -.Op Fl D Ar name Ns Op = Ns Ar def -.Op Fl U Ar name -.Op Fl I Ar directory -.Op Fl d Ar directory -.Op Fl B Ar directory -.Op Fl X Ar id Ns Op , Ns Ar id ... -.Ar -.Ek -.Sh DESCRIPTION -The -.Nm -utility attempts to detect features of the named C program files -that are likely to be bugs, to be non-portable, or to be -wasteful. -It also performs stricter type checking than does -the C compiler. -The -.Nm -utility runs the C preprocessor as its first phase, with the -preprocessor symbol -.Dq Dv lint -defined to allow certain questionable code to be altered -or skipped by -.Nm . -Therefore, this symbol should be thought of as a reserved -word for all code that is to be checked by -.Nm . -.Pp -Among the possible problems that are currently noted are -unreachable statements, loops not entered at the top, -variables declared and not used, and logical expressions -with constant values. -Function calls are checked for -inconsistencies, such as calls to functions that return -values in some places and not in others, functions called -with varying numbers of arguments, function calls that -pass arguments of a type other than the type the function -expects to receive, functions whose values are not used, -and calls to functions not returning values that use -the non-existent return value of the function. -.Pp -Filename arguments ending with -.Pa .c -are taken to be C source files. -Filename arguments with -names ending with -.Pa .ln -are taken to be the result of an earlier invocation of -.Nm , -with either the -.Fl i , o , -or -.Fl C -option in effect. -The -.Pa .ln -files are analogous to the -.Pa .o -(object) files produced by -.Xr cc 1 -from -.Pa .c -files. -The -.Nm -utility also accepts special libraries specified with the -.Fl l -option, which contain definitions of library routines and -variables. -.Pp -The -.Nm -utility takes all the -.Pa .c , .ln , -and -.Pa llib-l Ns Ar library Ns Pa .ln -(lint library) files and processes them in command-line order. -By default, -.Nm -appends the standard C lint library -.Pq Pa llib-lc.ln -to the end of the list of files. -When the -.Fl i -option is used, the -.Pa .ln -files are ignored. -Also, when the -.Fl o -or -.Fl i -options are used, the -.Pa llib-l Ns Ar library Ns Pa .ln -files are ignored. -When the -.Fl i -option is -.Em omitted -the second pass of -.Nm -checks this list of files for mutual compatibility. -At this point, -if a complaint stems not from a given source file, but from one of -its included files, the source filename will be printed followed by -a question mark. -.Pp -The special input file name -.Dq Pa - -causes -.Nm -to take input from standard input (until end of file) and process -it as if it were a -.Pa .c -file. -If the -.Fl i -flag is given and -.Dq Pa - -is named as one of the input files, the -.Fl o -flag must also be specified to provide an output file name. -The options are as follows: -.Bl -tag -width indent -.It Fl a -Report assignments of -.Vt long -values to variables that are not -.Vt long . -.It Fl aa -Additional to -.Fl a , -report -.Em all -assignments of integer values to other integer values which -cause implicit narrowing conversion. -.It Fl b -Report -.Ic break -statements that cannot be reached. -This is not the default -because, unfortunately, most -.Xr lex 1 -and many -.Xr yacc 1 -outputs produce many such complaints. -.It Fl c -Complain about casts which have questionable portability. -.It Fl e -Complain about unusual operations on -.Vt enum Ns -Types -and combinations of -.Vt enum Ns - -and -.Sy integer Ns -Types . -.It Fl g -Do not print warnings for some extensions of -.Xr gcc 1 -to the C language. -Currently these are nonconstant initializers in -automatic aggregate initializations, arithmetic on pointer to void, -trailing commas in -.Vt enum -declarations, C++ -style -.Dq Li // -comments, -zero sized structures, subscripting of non-lvalue arrays, prototypes -overriding old style function declarations and long long -integer types. -The -.Fl g -flag also turns on the keywords -.Ic asm -and -.Ic inline -(alternative keywords with leading underscores for both -.Ic asm -and -.Ic inline -are always available). -.It Fl h -Apply a number of heuristic tests to attempt to intuit -bugs, improve style, and reduce waste. -.It Fl i -Produce a -.Pa .ln -file for every -.Pa .c -file on the command line. -These -.Pa .ln -files are the product of -.Nm Ns 's -first pass only, and are not checked for compatibility -between functions. -.It Fl n -Do not check compatibility against the standard library. -.It Fl p -Attempt to check portability of code to other dialects of C. -.It Fl r -In case of redeclarations report the position of the -previous declaration. -.It Fl s -Strict ANSI C mode. -Issue warnings and errors required by ANSI C. -Also do not produce warnings for constructs which behave -differently in traditional C and ANSI C. -With the -.Fl s -flag, -.Dv __STRICT_ANSI__ -is a predefined preprocessor macro. -.It Fl S -C9X mode. Currently not fully implemented. -.It Fl t -Traditional C mode. -.Dv __STDC__ -is not predefined in this mode. -Warnings are printed for constructs -not allowed in traditional C. -Warnings for constructs which behave -differently in traditional C and ANSI C are suppressed. -Preprocessor -macros describing the machine type (e.g., -.Dv sun3 ) -and machine architecture (e.g., -.Dv m68k ) -are defined without leading and trailing underscores. -The keywords -.Ic const , volatile -and -.Ic signed -are not available in traditional C mode (although the alternative -keywords with leading underscores still are). -.It Fl u -Do not complain about functions and external variables used -and not defined, or defined and not used (this is suitable -for running -.Nm -on a subset of files comprising part of a larger program). -.It Fl v -Suppress complaints about unused arguments in functions. -.It Fl x -Report variables referred to by -.Ic extern -declarations, but never used. -.It Fl z -Do not complain about structures that are never defined -(for example, using a structure pointer without knowing -its contents). -.It Fl B Ar path -Path to use when looking for the -.Pa lint1 -and -.Pa lint2 -binaries. -Defaults to -.Pa /usr/libexec . -.It Fl C Ar library -Create a -.Nm -library with the name -.Pa llib-l Ns Ar library Ns Pa .ln . -This library is built from all -.Pa .c -and -.Pa .ln -input files. -After all global definitions of functions and -variables in these files are written to the newly created library, -.Nm -checks all input files, including libraries specified with the -.Fl l -option, for mutual compatibility. -.It Fl D Ar name Ns Op = Ns Ar def -Define -.Ar name -for -.Xr cpp 1 , -as if by a -.Ic #define -directive. -If no definition is given, -.Ar name -is defined as 1. -.It Fl I Ar directory -Add -.Ar directory -to the list of directories in which to search for include files. -.It Fl d Ar directory -Use -.Ar directory -instead of -.Pa /usr/include -as the default place to find include files. -.It Fl l Ar library -Include the lint library -.Pa llib-l Ns Ar library Ns Pa .ln . -.It Fl L Ar directory -Search for lint libraries in -.Ar directory -and -.Ar directory Ns Pa /lint -before searching the standard place. -.It Fl F -Print pathnames of files. -The -.Nm -utility normally prints the filename without the path. -.It Fl H -If a complaint stems from an included file -.Nm -prints the name of the included file instead of the source file name -followed by a question mark. -.It Fl MD -Pass -.Fl MD -to -.Xr cpp 1 -causing cpp to create files containing dependency information for -each source file. -.It Fl o Ar outputfile -Name the output file -.Ar outputfile . -The output file produced is the input that is given to -.Nm Ns 's -second pass. -The -.Fl o -option simply saves this file in the named output file. -If the -.Fl i -option is also used the files are not checked for compatibility. -To produce a -.Pa llib-l Ns Ar library Ns Pa .ln -without extraneous messages, use of the -.Fl u -option is suggested. -The -.Fl v -option is useful if the source file(s) for the lint library -are just external interfaces. -.It Fl U Ar name -Remove any initial definition of -.Ar name -for the preprocessor. -.It Fl V -Print the command lines constructed by the controller program to -run the C preprocessor and -.Nm Ns 's -first and second pass. -.It Fl w -Treat warnings as errors. -.It Fl X Ar id Ns Op , Ns Ar id ... -Suppress error messages identified by the list of ids. -A list of messages -and ids can be found in -.Xr lint 7 . -.El -.Ss Input Grammar -.Nm Ns 's -first pass reads standard C source files. -The -.Nm -utility recognizes the following C comments as commands. -.Bl -tag -width indent -.It Li /* ARGSUSED Ns Ar n Li */ -Makes -.Nm -check only the first -.Ar n -arguments for usage; a missing -.Ar n -is taken to be 0 (this option acts like the -.Fl v -option for the next function). -.It Li /* BITFIELDTYPE */ -Suppress error messages about illegal bitfield types if the type -is an integer type, and suppress non-portable bitfield type warnings. -.It Xo -.Li /* CONSTCOND */ -or -.Li /* CONSTANTCOND */ -or -.Li /* CONSTANTCONDITION */ -.Xc -suppress complaints about constant operands for the next expression. -.It Xo -.Li /* FALLTHRU */ -or -.Li /* FALLTHROUGH */ -.Xc -suppress complaints about fall through to a -.Ic case -or -.Ic default -labelled statement. -This directive should be placed immediately -preceding the label. -.It Li /* LINTLIBRARY */ -At the beginning of a file, mark all functions and variables defined -in this file as -.Em used . -Also shut off complaints about unused function arguments. -.It Xo -.Li /* LINTED Oo Ar comment Oc Li */ -or -.Li /* NOSTRICT Oo Ar comment Oc Li */ -.Xc -Suppresses any intra-file warning except those dealing with -unused variables or functions. -This directive should be placed -on the line immediately preceding where the -.Nm -warning occurred. -.It Li /* LONGLONG */ -Suppress complaints about use of long long integer types. -.It Li /* NOTREACHED */ -At appropriate points, inhibit complaints about unreachable code. -(This comment is typically placed just after calls to functions -like -.Xr exit 3 ) . -.It Li /* PRINTFLIKE Ns Ar n Li */ -makes -.Nm -check the first -.Pq Ar n Ns -1 -arguments as usual. -The -.Ar n Ns -th -argument is interpreted as a -.Xr printf 3 -format string that is used to check the remaining arguments. -.It Li /* PROTOLIB Ns Ar n Li */ -causes -.Nm -to treat function declaration prototypes as function definitions -if -.Ar n -is non-zero. -This directive can only be used in conjunction with -the -.Li /* LINTLIBRARY */ -directive. -If -.Ar n -is zero, function prototypes will be treated normally. -.It Li /* SCANFLIKE Ns Ar n Li */ -makes -.Nm -check the first -.Pq Ar n Ns -1 -arguments as usual. -The -.Ar n Ns -th -argument is interpreted as a -.Xr scanf 3 -format string that is used to check the remaining arguments. -.It Li /* VARARGS Ns Ar n Li */ -Suppress the usual checking for variable numbers of arguments in -the following function declaration. -The data types of the first -.Ar n -arguments are checked; a missing -.Ar n -is taken to be 0. -.El -.Pp -The behavior of the -.Fl i -and the -.Fl o -options allows for incremental use of -.Nm -on a set of C source files. -Generally, one invokes -.Nm -once for each source file with the -.Fl i -option. -Each of these invocations produces a -.Pa .ln -file that corresponds to the -.Pa .c -file, and prints all messages that are about just that -source file. -After all the source files have been separately -run through -.Nm , -it is invoked once more (without the -.Fl i -option), listing all the -.Pa .ln -files with the needed -.Fl l Ar library -options. -This will print all the inter-file inconsistencies. -This -scheme works well with -.Xr make 1 ; -it allows -.Xr make 1 -to be used to -.Nm -only the source files that have been modified since the last -time the set of source files were -.Nm Ns ed . -.Sh ENVIRONMENT -.Bl -tag -width LIBDIR -.It Ev LIBDIR -the directory where the lint libraries specified by the -.Bk -words -.Fl l Ar library -.Ek -option must exist. -If this environment variable is undefined, -then the default path -.Pa /usr/libdata/lint -will be used to search for the libraries. -.It Ev TMPDIR -usually the path for temporary files can be redefined by setting -this environment variable. -.It Ev CC -Location of the C compiler program. -Defaults to -.Pa /usr/bin/cc . -.El -.Sh FILES -.Bl -tag -width /usr/libdata/lint/llib-lc.ln -compact -.It Pa /usr/libexec/lint Ns Bq Pa 12 -programs -.It Pa /usr/libdata/lint/llib-l*.ln -various prebuilt lint libraries -.It Pa /tmp/lint* -temporaries -.El -.Sh SEE ALSO -.Xr cc 1 , -.Xr cpp 1 , -.Xr make 1 -.Sh AUTHORS -.An Jochen Pohl -.Sh BUGS -.Bl -item -.It -The routines -.Xr exit 3 , -.Xr longjmp 3 -and other functions that do not return are not understood; this -causes various incorrect diagnostics. -.It -Static functions which are used only before their first -extern declaration are reported as unused. -.It -Libraries created by the -.Fl o -option will, when used in later -.Nm -runs, cause certain errors that were reported when the libraries -were created to be reported again, and cause line numbers and file -names from the original source used to create those libraries -to be reported in error messages. -For these reasons, it is recommended -to use the -.Fl C -option to create lint libraries. -.El diff --git a/usr.bin/xlint/xlint/pathnames.h b/usr.bin/xlint/xlint/pathnames.h deleted file mode 100644 index 3f7d210530da..000000000000 --- a/usr.bin/xlint/xlint/pathnames.h +++ /dev/null @@ -1,45 +0,0 @@ -/* $NetBSD: pathnames.h,v 1.3 1999/04/22 04:40:58 mrg Exp $ */ - -/* - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/* directory where lint1 and lint2 reside */ -#ifndef PATH_LIBEXEC -#define PATH_LIBEXEC PREFIX"/usr/libexec" -#endif - -/* directory where cc(1) resides */ -#define PATH_USRBIN PREFIX"/usr/bin" - -/* default library search path */ -#define PATH_LINTLIB PREFIX"/usr/libdata/lint" diff --git a/usr.bin/xlint/xlint/xlint.c b/usr.bin/xlint/xlint/xlint.c deleted file mode 100644 index 7c9994d5cc3a..000000000000 --- a/usr.bin/xlint/xlint/xlint.c +++ /dev/null @@ -1,883 +0,0 @@ -/* $NetBSD: xlint.c,v 1.36 2005/02/09 21:24:48 dsl Exp $ */ - -/* - * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. - * Copyright (c) 1994, 1995 Jochen Pohl - * All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Jochen Pohl for - * The NetBSD Project. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: xlint.c,v 1.36 2005/02/09 21:24:48 dsl Exp $"); -#endif -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "lint.h" -#include "pathnames.h" - -#define DEFAULT_PATH _PATH_DEFPATH - -int main(int, char *[]); - -/* directory for temporary files */ -static const char *tmpdir; - -/* path name for cpp output */ -static char *cppout; - -/* file descriptor for cpp output */ -static int cppoutfd = -1; - -/* files created by 1st pass */ -static char **p1out; - -/* input files for 2nd pass (without libraries) */ -static char **p2in; - -/* library which will be created by 2nd pass */ -static char *p2out; - -/* flags always passed to cc(1) */ -static char **cflags; - -/* flags for cc(1), controlled by sflag/tflag */ -static char **lcflags; - -/* flags for lint1 */ -static char **l1flags; - -/* flags for lint2 */ -static char **l2flags; - -/* libraries for lint2 */ -static char **l2libs; - -/* default libraries */ -static char **deflibs; - -/* additional libraries */ -static char **libs; - -/* search path for libraries */ -static char **libsrchpath; - -static char *libexec_path; - -/* flags */ -static int iflag, oflag, Cflag, sflag, tflag, Fflag, dflag, Bflag, Sflag; - -/* print the commands executed to run the stages of compilation */ -static int Vflag; - -/* filename for oflag */ -static char *outputfn; - -/* reset after first .c source has been processed */ -static int first = 1; - -/* - * name of a file which is currently written by a child and should - * be removed after abnormal termination of the child - */ -static const char *currfn; - -#if !defined(TARGET_PREFIX) -#define TARGET_PREFIX "" -#endif -static const char target_prefix[] = TARGET_PREFIX; - -static void appstrg(char ***, char *); -static void appcstrg(char ***, const char *); -static void applst(char ***, char *const *); -static void freelst(char ***); -static char *concat2(const char *, const char *); -static char *concat3(const char *, const char *, const char *); -static void terminate(int) __attribute__((__noreturn__)); -static const char *lbasename(const char *, int); -static void appdef(char ***, const char *); -static void usage(void) __dead2; -static void fname(const char *); -static void runchild(const char *, char *const *, const char *, int); -static void findlibs(char *const *); -static int rdok(const char *); -static void lint2(void); -static void cat(char *const *, const char *); - -/* - * Some functions to deal with lists of strings. - * Take care that we get no surprises in case of asynchronous signals. - */ -static void -appstrg(char ***lstp, char *s) -{ - char **lst, **olst; - int i; - - olst = *lstp; - for (i = 0; olst[i] != NULL; i++) - continue; - lst = xrealloc(olst, (i + 2) * sizeof (char *)); - lst[i] = s; - lst[i + 1] = NULL; - *lstp = lst; -} - -static void -appcstrg(char ***lstp, const char *s) -{ - - appstrg(lstp, xstrdup(s)); -} - -static void -applst(char ***destp, char *const *src) -{ - int i, k; - char **dest, **odest; - - odest = *destp; - for (i = 0; odest[i] != NULL; i++) - continue; - for (k = 0; src[k] != NULL; k++) - continue; - dest = xrealloc(odest, (i + k + 1) * sizeof (char *)); - for (k = 0; src[k] != NULL; k++) - dest[i + k] = xstrdup(src[k]); - dest[i + k] = NULL; - *destp = dest; -} - -static void -freelst(char ***lstp) -{ - char *s; - int i; - - for (i = 0; (*lstp)[i] != NULL; i++) - continue; - while (i-- > 0) { - s = (*lstp)[i]; - (*lstp)[i] = NULL; - free(s); - } -} - -static char * -concat2(const char *s1, const char *s2) -{ - char *s; - - s = xmalloc(strlen(s1) + strlen(s2) + 1); - (void)strcpy(s, s1); - (void)strcat(s, s2); - - return (s); -} - -static char * -concat3(const char *s1, const char *s2, const char *s3) -{ - char *s; - - s = xmalloc(strlen(s1) + strlen(s2) + strlen(s3) + 1); - (void)strcpy(s, s1); - (void)strcat(s, s2); - (void)strcat(s, s3); - - return (s); -} - -/* - * Clean up after a signal. - */ -static void -terminate(int signo) -{ - int i; - - if (cppoutfd != -1) - (void)close(cppoutfd); - if (cppout != NULL) - (void)remove(cppout); - - if (p1out != NULL) { - for (i = 0; p1out[i] != NULL; i++) - (void)remove(p1out[i]); - } - - if (p2out != NULL) - (void)remove(p2out); - - if (currfn != NULL) - (void)remove(currfn); - - exit(signo != 0 ? 1 : 0); -} - -/* - * Returns a pointer to the last component of strg after delim. - * Returns strg if the string does not contain delim. - */ -static const char * -lbasename(const char *strg, int delim) -{ - const char *cp, *cp1, *cp2; - - cp = cp1 = cp2 = strg; - while (*cp != '\0') { - if (*cp++ == delim) { - cp2 = cp1; - cp1 = cp; - } - } - return (*cp1 == '\0' ? cp2 : cp1); -} - -static void -appdef(char ***lstp, const char *def) -{ - - appstrg(lstp, concat2("-D__", def)); - appstrg(lstp, concat3("-D__", def, "__")); -} - -static void -usage(void) -{ - - (void)fprintf(stderr, - "usage: lint [-abceghprvwxzHFS] [-s|-t] [-i|-nu] [-Dname[=def]]" - " [-Uname] [-X [,]...\n"); - (void)fprintf(stderr, - "\t[-Idirectory] [-Ldirectory] [-llibrary] [-ooutputfile]" - " file...\n"); - (void)fprintf(stderr, - " lint [-abceghprvwzHFS] [-s|-t] -Clibrary [-Dname[=def]]\n" - " [-X [,]...\n"); - (void)fprintf(stderr, "\t[-Idirectory] [-Uname] [-Bpath] file" - " ...\n"); - terminate(-1); -} - - -int -main(int argc, char *argv[]) -{ - int c; - char flgbuf[3], *s; - const char *tmp; - size_t len; - - if ((tmp = getenv("TMPDIR")) == NULL || (len = strlen(tmp)) == 0) { - tmpdir = _PATH_TMP; - } else { - s = xmalloc(len + 2); - (void)sprintf(s, "%s%s", tmp, tmp[len - 1] == '/' ? "" : "/"); - tmpdir = s; - } - - cppout = xmalloc(strlen(tmpdir) + sizeof ("lint0.XXXXXX")); - (void)sprintf(cppout, "%slint0.XXXXXX", tmpdir); - cppoutfd = mkstemp(cppout); - if (cppoutfd == -1) { - warn("can't make temp"); - terminate(-1); - } - - p1out = xcalloc(1, sizeof (char *)); - p2in = xcalloc(1, sizeof (char *)); - cflags = xcalloc(1, sizeof (char *)); - lcflags = xcalloc(1, sizeof (char *)); - l1flags = xcalloc(1, sizeof (char *)); - l2flags = xcalloc(1, sizeof (char *)); - l2libs = xcalloc(1, sizeof (char *)); - deflibs = xcalloc(1, sizeof (char *)); - libs = xcalloc(1, sizeof (char *)); - libsrchpath = xcalloc(1, sizeof (char *)); - - appcstrg(&cflags, "-E"); - appcstrg(&cflags, "-x"); - appcstrg(&cflags, "c"); -#if 0 - appcstrg(&cflags, "-D__attribute__(x)="); - appcstrg(&cflags, "-D__extension__(x)=/*NOSTRICT*/0"); -#else - appcstrg(&cflags, "-U__GNUC__"); - appcstrg(&cflags, "-undef"); -#endif -#if 0 - appcstrg(&cflags, "-Wp,-$"); -#endif - appcstrg(&cflags, "-Wp,-C"); - appcstrg(&cflags, "-Wcomment"); - appcstrg(&cflags, "-D__LINT__"); - appcstrg(&cflags, "-Dlint"); /* XXX don't def. with -s */ - - appdef(&cflags, "lint"); - - appcstrg(&deflibs, "c"); - - if (signal(SIGHUP, terminate) == SIG_IGN) - (void)signal(SIGHUP, SIG_IGN); - (void)signal(SIGINT, terminate); - (void)signal(SIGQUIT, terminate); - (void)signal(SIGTERM, terminate); - while ((c = getopt(argc, argv, "abcd:eghil:no:prstuvwxzB:C:D:FHI:L:M:SU:VX:")) != -1) { - switch (c) { - - case 'a': - case 'b': - case 'c': - case 'e': - case 'g': - case 'r': - case 'v': - case 'w': - case 'z': - (void)sprintf(flgbuf, "-%c", c); - appcstrg(&l1flags, flgbuf); - break; - - case 'F': - Fflag = 1; - /* FALLTHROUGH */ - case 'u': - case 'h': - (void)sprintf(flgbuf, "-%c", c); - appcstrg(&l1flags, flgbuf); - appcstrg(&l2flags, flgbuf); - break; - - case 'X': - (void)sprintf(flgbuf, "-%c", c); - appcstrg(&l1flags, flgbuf); - appcstrg(&l1flags, optarg); - break; - - case 'i': - if (Cflag) - usage(); - iflag = 1; - break; - - case 'n': - freelst(&deflibs); - break; - - case 'p': - appcstrg(&lcflags, "-Wtraditional"); - appcstrg(&lcflags, "-Wno-system-headers"); - appcstrg(&l1flags, "-p"); - appcstrg(&l2flags, "-p"); - if (*deflibs != NULL) { - freelst(&deflibs); - appcstrg(&deflibs, "c"); - } - break; - - case 's': - if (tflag) - usage(); - freelst(&lcflags); - appcstrg(&lcflags, "-trigraphs"); - appcstrg(&lcflags, "-Wtrigraphs"); - appcstrg(&lcflags, "-pedantic"); - appcstrg(&lcflags, "-D__STRICT_ANSI__"); - appcstrg(&l1flags, "-s"); - appcstrg(&l2flags, "-s"); - sflag = 1; - break; - - case 'S': - if (tflag) - usage(); - appcstrg(&l1flags, "-S"); - Sflag = 1; - break; - -#if !HAVE_CONFIG_H - case 't': - if (sflag) - usage(); - freelst(&lcflags); - appcstrg(&lcflags, "-traditional"); - appstrg(&lcflags, concat2("-D", MACHINE)); - appstrg(&lcflags, concat2("-D", MACHINE_ARCH)); - appcstrg(&l1flags, "-t"); - appcstrg(&l2flags, "-t"); - tflag = 1; - break; -#endif - - case 'x': - appcstrg(&l2flags, "-x"); - break; - - case 'C': - if (Cflag || oflag || iflag) - usage(); - Cflag = 1; - appstrg(&l2flags, concat2("-C", optarg)); - p2out = xmalloc(sizeof ("llib-l.ln") + strlen(optarg)); - (void)sprintf(p2out, "llib-l%s.ln", optarg); - freelst(&deflibs); - break; - - case 'd': - if (dflag) - usage(); - dflag = 1; - appcstrg(&cflags, "-nostdinc"); - appcstrg(&cflags, "-idirafter"); - appcstrg(&cflags, optarg); - break; - - case 'D': - case 'I': - case 'M': - case 'U': - (void)sprintf(flgbuf, "-%c", c); - appstrg(&cflags, concat2(flgbuf, optarg)); - break; - - case 'l': - appcstrg(&libs, optarg); - break; - - case 'o': - if (Cflag || oflag) - usage(); - oflag = 1; - outputfn = xstrdup(optarg); - break; - - case 'L': - appcstrg(&libsrchpath, optarg); - break; - - case 'H': - appcstrg(&l2flags, "-H"); - break; - - case 'B': - Bflag = 1; - libexec_path = xstrdup(optarg); - break; - - case 'V': - Vflag = 1; - break; - - default: - usage(); - /* NOTREACHED */ - } - } - argc -= optind; - argv += optind; - - /* - * To avoid modifying getopt(3)'s state engine midstream, we - * explicitly accept just a few options after the first source file. - * - * In particular, only -l and -L (and these with a space - * after -l or -L) are allowed. - */ - while (argc > 0) { - const char *arg = argv[0]; - - if (arg[0] == '-') { - char ***list; - - /* option */ - switch (arg[1]) { - case 'l': - list = &libs; - break; - - case 'L': - list = &libsrchpath; - break; - - default: - usage(); - /* NOTREACHED */ - } - if (arg[2]) - appcstrg(list, arg + 2); - else if (argc > 1) { - argc--; - appcstrg(list, *++argv); - } else - usage(); - } else { - /* filename */ - fname(arg); - first = 0; - } - argc--; - argv++; - } - - if (first) - usage(); - - if (iflag) - terminate(0); - - if (!oflag) { - if ((tmp = getenv("LIBDIR")) == NULL || strlen(tmp) == 0) - tmp = PATH_LINTLIB; - appcstrg(&libsrchpath, tmp); - findlibs(libs); - findlibs(deflibs); - } - - (void)printf("Lint pass2:\n"); - lint2(); - - if (oflag) - cat(p2in, outputfn); - - if (Cflag) - p2out = NULL; - - terminate(0); - /* NOTREACHED */ -} - -/* - * Read a file name from the command line - * and pass it through lint1 if it is a C source. - */ -static void -fname(const char *name) -{ - const char *bn, *suff; - char **args, *ofn, *p, *pathname; - size_t len; - int is_stdin; - int fd; - - is_stdin = (strcmp(name, "-") == 0); - bn = lbasename(name, '/'); - suff = lbasename(bn, '.'); - - if (strcmp(suff, "ln") == 0) { - /* only for lint2 */ - if (!iflag) - appcstrg(&p2in, name); - return; - } - - if (!is_stdin && strcmp(suff, "c") != 0 && - (strncmp(bn, "llib-l", 6) != 0 || bn != suff)) { - warnx("unknown file type: %s\n", name); - return; - } - - if (!iflag || !first) - (void)printf("%s:\n", - is_stdin ? "{standard input}" : Fflag ? name : bn); - - /* build the name of the output file of lint1 */ - if (oflag) { - ofn = outputfn; - outputfn = NULL; - oflag = 0; - } else if (iflag) { - if (is_stdin) { - warnx("-i not supported without -o for standard input"); - return; - } - ofn = xmalloc(strlen(bn) + (bn == suff ? 4 : 2)); - len = bn == suff ? strlen(bn) : (size_t)((suff - 1) - bn); - (void)sprintf(ofn, "%.*s", (int)len, bn); - (void)strcat(ofn, ".ln"); - } else { - ofn = xmalloc(strlen(tmpdir) + sizeof ("lint1.XXXXXX")); - (void)sprintf(ofn, "%slint1.XXXXXX", tmpdir); - fd = mkstemp(ofn); - if (fd == -1) { - warn("can't make temp"); - terminate(-1); - } - close(fd); - } - if (!iflag) - appcstrg(&p1out, ofn); - - args = xcalloc(1, sizeof (char *)); - - /* run cc */ - - if (getenv("CC") == NULL) { - pathname = xmalloc(strlen(PATH_USRBIN) + sizeof ("/cc")); - (void)sprintf(pathname, "%s/cc", PATH_USRBIN); - appcstrg(&args, pathname); - } else { - pathname = strdup(getenv("CC")); - for (p = strtok(pathname, " \t"); p; p = strtok(NULL, " \t")) - appcstrg(&args, p); - } - - applst(&args, cflags); - applst(&args, lcflags); - appcstrg(&args, name); - - /* we reuse the same tmp file for cpp output, so rewind and truncate */ - if (lseek(cppoutfd, (off_t)0, SEEK_SET) != 0) { - warn("lseek"); - terminate(-1); - } - if (ftruncate(cppoutfd, (off_t)0) != 0) { - warn("ftruncate"); - terminate(-1); - } - - runchild(pathname, args, cppout, cppoutfd); - free(pathname); - freelst(&args); - - /* run lint1 */ - - if (!Bflag) { - pathname = xmalloc(strlen(PATH_LIBEXEC) + sizeof ("/lint1") + - strlen(target_prefix)); - (void)sprintf(pathname, "%s/%slint1", PATH_LIBEXEC, - target_prefix); - } else { - /* - * XXX Unclear whether we should be using target_prefix - * XXX here. --thorpej@wasabisystems.com - */ - pathname = xmalloc(strlen(libexec_path) + sizeof ("/lint1")); - (void)sprintf(pathname, "%s/lint1", libexec_path); - } - - appcstrg(&args, pathname); - applst(&args, l1flags); - appcstrg(&args, cppout); - appcstrg(&args, ofn); - - runchild(pathname, args, ofn, -1); - free(pathname); - freelst(&args); - - appcstrg(&p2in, ofn); - free(ofn); - - free(args); -} - -static void -runchild(const char *path, char *const *args, const char *crfn, int fdout) -{ - int status, rv, signo, i; - - if (Vflag) { - for (i = 0; args[i] != NULL; i++) - (void)printf("%s ", args[i]); - (void)printf("\n"); - } - - currfn = crfn; - - (void)fflush(stdout); - - switch (vfork()) { - case -1: - warn("cannot fork"); - terminate(-1); - /* NOTREACHED */ - default: - /* parent */ - break; - case 0: - /* child */ - - /* setup the standard output if necessary */ - if (fdout != -1) { - dup2(fdout, STDOUT_FILENO); - close(fdout); - } - (void)execvp(path, args); - warn("cannot exec %s", path); - _exit(1); - /* NOTREACHED */ - } - - while ((rv = wait(&status)) == -1 && errno == EINTR) ; - if (rv == -1) { - warn("wait"); - terminate(-1); - } - if (WIFSIGNALED(status)) { - signo = WTERMSIG(status); -#if HAVE_DECL_SYS_SIGNAME - warnx("%s got SIG%s", path, sys_signame[signo]); -#else - warnx("%s got signal %d", path, signo); -#endif - terminate(-1); - } - if (WEXITSTATUS(status) != 0) - terminate(-1); - currfn = NULL; -} - -static void -findlibs(char *const *liblst) -{ - int i, k; - const char *lib, *path; - char *lfn; - size_t len; - - lfn = NULL; - - for (i = 0; (lib = liblst[i]) != NULL; i++) { - for (k = 0; (path = libsrchpath[k]) != NULL; k++) { - len = strlen(path) + strlen(lib); - lfn = xrealloc(lfn, len + sizeof ("/llib-l.ln")); - (void)sprintf(lfn, "%s/llib-l%s.ln", path, lib); - if (rdok(lfn)) - break; - lfn = xrealloc(lfn, len + sizeof ("/lint/llib-l.ln")); - (void)sprintf(lfn, "%s/lint/llib-l%s.ln", path, lib); - if (rdok(lfn)) - break; - } - if (path != NULL) { - appstrg(&l2libs, concat2("-l", lfn)); - } else { - warnx("cannot find llib-l%s.ln", lib); - } - } - - free(lfn); -} - -static int -rdok(const char *path) -{ - struct stat sbuf; - - if (stat(path, &sbuf) == -1) - return (0); - if (!S_ISREG(sbuf.st_mode)) - return (0); - if (access(path, R_OK) == -1) - return (0); - return (1); -} - -static void -lint2(void) -{ - char *path, **args; - - args = xcalloc(1, sizeof (char *)); - - if (!Bflag) { - path = xmalloc(strlen(PATH_LIBEXEC) + sizeof ("/lint2") + - strlen(target_prefix)); - (void)sprintf(path, "%s/%slint2", PATH_LIBEXEC, - target_prefix); - } else { - /* - * XXX Unclear whether we should be using target_prefix - * XXX here. --thorpej@wasabisystems.com - */ - path = xmalloc(strlen(libexec_path) + sizeof ("/lint2")); - (void)sprintf(path, "%s/lint2", libexec_path); - } - - appcstrg(&args, path); - applst(&args, l2flags); - applst(&args, l2libs); - applst(&args, p2in); - - runchild(path, args, p2out, -1); - free(path); - freelst(&args); - free(args); -} - -static void -cat(char *const *srcs, const char *dest) -{ - int ifd, ofd, i; - char *src, *buf; - ssize_t rlen; - - if ((ofd = open(dest, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1) { - warn("cannot open %s", dest); - terminate(-1); - } - - buf = xmalloc(MBLKSIZ); - - for (i = 0; (src = srcs[i]) != NULL; i++) { - if ((ifd = open(src, O_RDONLY)) == -1) { - free(buf); - warn("cannot open %s", src); - terminate(-1); - } - do { - if ((rlen = read(ifd, buf, MBLKSIZ)) == -1) { - free(buf); - warn("read error on %s", src); - terminate(-1); - } - if (write(ofd, buf, (size_t)rlen) == -1) { - free(buf); - warn("write error on %s", dest); - terminate(-1); - } - } while (rlen == MBLKSIZ); - (void)close(ifd); - } - (void)close(ofd); - free(buf); -} From ea4fe0b6a2070b538947530d6dc16f81182803db Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Thu, 16 Nov 2017 15:26:39 +0000 Subject: [PATCH 26/92] Improve the library dependencies helper script in src/tools. Implement double pass of the relevant Makefiles. First make a list of library names and directories and then scan for all the dependencies. Spaces in directories in the source tree are not supported. This avoids using hardcoded mappings between the library name and the directory containing the library Makefile. Add support for scanning contrib/ofed . Bail out on any errors. Sponsored by: Mellanox Technologies MFC after: 1 week --- tools/make_libdeps.sh | 77 ++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 22 deletions(-) diff --git a/tools/make_libdeps.sh b/tools/make_libdeps.sh index 84bf895efeb7..77525093bbd7 100644 --- a/tools/make_libdeps.sh +++ b/tools/make_libdeps.sh @@ -28,9 +28,12 @@ export PATH=/bin:/usr/bin +set -e + LC_ALL=C # make sort deterministic FS=': ' # internal field separator LIBDEPENDS=./_libdeps # intermediate output file +LIBDIRS=./_libdirs # intermediate output file USRSRC=${1:-/usr/src} # source root LIBS=" lib @@ -39,44 +42,74 @@ LIBS=" secure/lib usr.bin/lex/lib cddl/lib + contrib/ofed " # where to scan for libraries -# This sed(1) filter is used to convert -lfoo to path/to/libfoo. -# -SED_FILTER=" -sed -E - -e's; ;! ;g' - -e's;$;!;' - -e's;-lbsdxml!;lib/libexpat;g' - -e's;-lpthread!;lib/libthr;g' - -e's;-lm!;lib/msun;g' - -e's;-l(ncurses|termcap)!;lib/ncurses/ncurses;g' - -e's;-l(gcc)!;gnu/lib/lib\1;g' - -e's;-lssp_nonshared!;gnu/lib/libssp/libssp_nonshared;g' - -e's;-l(asn1|hdb|kdc|heimbase|heimntlm|heimsqlite|hx509|krb5|roken|wind)!;kerberos5/lib/lib\1;g' - -e's;-l(crypto|ssh|ssl)!;secure/lib/lib\1;g' - -e's;-l([^!]+)!;lib/lib\1;g' -" + +# convert -lfoo to foo +convert() +{ + sed -e "s/\-l//g" -e "s/pthread/thr/g" -e "s/ncurses.*/ncurses/g" +} + +# find library build directory given library name +findlibdir() +{ + while read NAME && read DIR + do + if [ "$NAME" = "$1" ]; then + echo "$DIR" + exit + fi + done + + # Should not happen + echo lib_not_found/lib$1 +} + +# find library build directories given one or more library names +resolvelibdirs() +{ + while read LIBNAME + do + cat $LIBDIRS | tr ' ' '\n' | findlibdir "$LIBNAME" + done +} # Generate interdependencies between libraries. # genlibdepends() { ( + # Reset file + echo -n > $LIBDIRS + + # First pass - generate list of directories cd ${USRSRC} - find -s ${LIBS} -mindepth 1 -name Makefile | + find -s ${LIBS} -name Makefile | + xargs grep -l 'bsd\.lib\.mk' | + while read makefile; do + libdir=$(dirname ${makefile}) + libname=$( + cd ${libdir} + make -m ${USRSRC}/share/mk WITH_OFED=YES -V LIB + ) + if [ "${libname}" ]; then + echo "${libname} ${libdir}" >> $LIBDIRS + fi + done + + # Second pass - generate dependencies + find -s ${LIBS} -name Makefile | xargs grep -l 'bsd\.lib\.mk' | while read makefile; do libdir=$(dirname ${makefile}) deps=$( cd ${libdir} - make -m ${USRSRC}/share/mk -V LDADD + make -m ${USRSRC}/share/mk WITH_OFED=YES -V LDADD ) if [ "${deps}" ]; then - echo ${libdir}"${FS}"$( - echo ${deps} | - eval ${SED_FILTER} - ) + echo ${libdir}"${FS}"$(echo ${deps} | tr ' ' '\n' | convert | resolvelibdirs) fi done ) From d27352644ae285e56ae5576a47ee8c8fab38210c Mon Sep 17 00:00:00 2001 From: Stephen Hurd Date: Thu, 16 Nov 2017 18:52:58 +0000 Subject: [PATCH 27/92] Fix default numbers of iflib queue sets The intent appears to be having one RX/TX queue set per core, but since scctx->isc_n[tr]xqsets is set to max before calling iflib_msix_init(), both end up being set to total number of cores. Use ctx->ifc_sysctl_n[rt]xqs as the selected value and scctx->isc_n[rt]xqsets as the max. This should result in what appears to be the intended behaviour Reviewed by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D13096 --- sys/net/iflib.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 14d267812388..7a0952be650e 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5312,11 +5312,11 @@ iflib_msix_init(if_ctx_t ctx) int iflib_num_tx_queues, iflib_num_rx_queues; int err, admincnt, bar; - iflib_num_tx_queues = scctx->isc_ntxqsets; - iflib_num_rx_queues = scctx->isc_nrxqsets; + iflib_num_tx_queues = ctx->ifc_sysctl_ntxqs; + iflib_num_rx_queues = ctx->ifc_sysctl_nrxqs; + + device_printf(dev, "msix_init qsets capped at %d\n", imax(scctx->isc_ntxqsets, scctx->isc_nrxqsets)); - device_printf(dev, "msix_init qsets capped at %d\n", iflib_num_tx_queues); - bar = ctx->ifc_softc_ctx.isc_msix_bar; admincnt = sctx->isc_admin_intrcnt; /* Override by global tuneable */ @@ -5414,6 +5414,10 @@ iflib_msix_init(if_ctx_t ctx) rx_queues = iflib_num_rx_queues; else rx_queues = queues; + + if (rx_queues > scctx->isc_nrxqsets) + rx_queues = scctx->isc_nrxqsets; + /* * We want this to be all logical CPUs by default */ @@ -5422,6 +5426,9 @@ iflib_msix_init(if_ctx_t ctx) else tx_queues = mp_ncpus; + if (tx_queues > scctx->isc_ntxqsets) + tx_queues = scctx->isc_ntxqsets; + if (ctx->ifc_sysctl_qs_eq_override == 0) { #ifdef INVARIANTS if (tx_queues != rx_queues) From a3c15a4445062c80fef96dfeab1a10fb3f4f2194 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 16 Nov 2017 21:28:14 +0000 Subject: [PATCH 28/92] Only try to enable CK_CLYGRP if we're running on kernel newer than 1200046, the first version that supports this feature. If we set it, then use an old kernel, we'll break the 'contract' of having checksummed cylinder groups this flag signifies. To avoid creating something with an inconsistent state, don't turn the flag on in these cases. The first full fsck with a new kernel will turn this on. Spnsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13114 --- sbin/fsck_ffs/pass5.c | 2 ++ sbin/newfs/mkfs.c | 3 ++- sbin/newfs/newfs.c | 4 ---- sys/sys/param.h | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index 16c46bece00b..a4828a20e1f8 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -35,6 +35,7 @@ static const char sccsid[] = "@(#)pass5.c 8.9 (Berkeley) 4/28/95"; #include __FBSDID("$FreeBSD$"); +#define IN_RTLD /* So we pickup the P_OSREL defines */ #include #include @@ -73,6 +74,7 @@ pass5(void) newcg->cg_niblk = fs->fs_ipg; if (preen == 0 && yflag == 0 && fs->fs_magic == FS_UFS2_MAGIC && fswritefd != -1 && (fs->fs_metackhash & CK_CYLGRP) == 0 && + getosreldate() >= P_OSREL_CK_CLYGRP && reply("ADD CYLINDER GROUP CHECKSUM PROTECTION") != 0) { fs->fs_metackhash |= CK_CYLGRP; rewritecg = 1; diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index f68c42ec6b36..a7d570ea5619 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -44,6 +44,7 @@ static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95"; #include __FBSDID("$FreeBSD$"); +#define IN_RTLD /* So we pickup the P_OSREL defines */ #include #include #include @@ -495,7 +496,7 @@ mkfs(struct partition *pp, char *fsys) /* * Set flags for metadata that is being check-hashed. */ - if (Oflag > 1) + if (Oflag > 1 && getosreldate() >= P_OSREL_CK_CLYGRP) sblock.fs_metackhash = CK_CYLGRP; /* diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 2928878ad901..8b32792c3c83 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -398,10 +398,6 @@ main(int argc, char *argv[]) if (pp != NULL) pp->p_size *= secperblk; } - if (getosreldate() < __FreeBSD_version) { - warnx("%s is newer than the running kernel and may not be compatible", - getprogname()); - } mkfs(pp, special); ufs_disk_close(&disk); if (!jflag) diff --git a/sys/sys/param.h b/sys/sys/param.h index cac8cbad00dd..e7289d71be30 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -84,6 +84,7 @@ #define P_OSREL_SHUTDOWN_ENOTCONN 1100077 #define P_OSREL_MAP_GUARD 1200035 #define P_OSREL_WRFSBASE 1200041 +#define P_OSREL_CK_CLYGRP 1200046 #define P_OSREL_VMTOTAL64 1200054 #define P_OSREL_MAJOR(x) ((x) / 100000) From 6effb213230da4e5405cf91d880de79f630e39d1 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Thu, 16 Nov 2017 22:14:49 +0000 Subject: [PATCH 29/92] procstat: fix a crash with -k -a options The traditional / legacy usage should still be supported. This fixes a regression in r324619 that introduced a nicer, verb based interface. Reviewed by: brooks X-MFC with: r324619 --- usr.bin/procstat/procstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/procstat/procstat.c b/usr.bin/procstat/procstat.c index 7ab9ba458aea..f13807939f5a 100644 --- a/usr.bin/procstat/procstat.c +++ b/usr.bin/procstat/procstat.c @@ -296,7 +296,7 @@ main(int argc, char *argv[]) cmd = getcmd("tsignals"); break; case 'k': - if (cmd->cmd == procstat_kstack) { + if (cmd != NULL && cmd->cmd == procstat_kstack) { if ((procstat_opts & PS_OPT_VERBOSE) != 0) usage(); procstat_opts |= PS_OPT_VERBOSE; From e41d6166845a050bebd1a956d9943ee5124e26db Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 02:21:07 +0000 Subject: [PATCH 30/92] sx: avoid branches if in the slow path if lockstat is disabled --- sys/kern/kern_sx.c | 53 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index bc3d22b21f37..7e7c0b0962f6 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -88,8 +88,9 @@ PMC_SOFT_DECLARE( , , lock, failed); int _giantcnt = 0; \ WITNESS_SAVE_DECL(Giant) \ -#define GIANT_SAVE() do { \ +#define GIANT_SAVE(work) do { \ if (mtx_owned(&Giant)) { \ + work++; \ WITNESS_SAVE(&Giant.lock_object, Giant); \ while (mtx_owned(&Giant)) { \ _giantcnt++; \ @@ -513,11 +514,14 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, struct lock_delay_arg lda; #endif #ifdef KDTRACE_HOOKS - uintptr_t state; u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; #endif +#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) + uintptr_t state; + int extra_work; +#endif if (SCHEDULER_STOPPED()) return (0); @@ -547,10 +551,17 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__, sx->lock_object.lo_name, (void *)sx->sx_lock, file, line); -#ifdef KDTRACE_HOOKS - all_time -= lockstat_nsecs(&sx->lock_object); +#ifdef LOCK_PROFILING + extra_work = 1; state = x; +#elif defined(KDTRACE_HOOKS) + extra_work = lockstat_enabled; + if (__predict_false(extra_work)) { + all_time -= lockstat_nsecs(&sx->lock_object); + state = x; + } #endif + for (;;) { if (x == SX_LOCK_UNLOCKED) { if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid)) @@ -583,7 +594,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, sched_tdname(curthread), "spinning", "lockname:\"%s\"", sx->lock_object.lo_name); - GIANT_SAVE(); + GIANT_SAVE(extra_work); do { lock_delay(&lda); x = SX_READ_VALUE(sx); @@ -598,7 +609,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), "spinning", "lockname:\"%s\"", sx->lock_object.lo_name); - GIANT_SAVE(); + GIANT_SAVE(extra_work); spintries++; for (i = 0; i < asx_loops; i += n) { if (LOCK_LOG_TEST(&sx->lock_object, 0)) @@ -705,7 +716,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, #ifdef KDTRACE_HOOKS sleep_time -= lockstat_nsecs(&sx->lock_object); #endif - GIANT_SAVE(); + GIANT_SAVE(extra_work); sleepq_add(&sx->lock_object, NULL, sx->lock_object.lo_name, SLEEPQ_SX | ((opts & SX_INTERRUPTIBLE) ? SLEEPQ_INTERRUPTIBLE : 0), SQ_EXCLUSIVE_QUEUE); @@ -729,6 +740,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, __func__, sx); x = SX_READ_VALUE(sx); } +#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) + if (__predict_true(!extra_work)) + return (error); +#endif #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&sx->lock_object); if (sleep_time) @@ -856,11 +871,14 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) struct lock_delay_arg lda; #endif #ifdef KDTRACE_HOOKS - uintptr_t state; u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; #endif +#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) + uintptr_t state; + int extra_work; +#endif if (SCHEDULER_STOPPED()) return (0); @@ -870,9 +888,16 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) #elif defined(KDTRACE_HOOKS) lock_delay_arg_init(&lda, NULL); #endif -#ifdef KDTRACE_HOOKS - all_time -= lockstat_nsecs(&sx->lock_object); + +#ifdef LOCK_PROFILING + extra_work = 1; state = x; +#elif defined(KDTRACE_HOOKS) + extra_work = lockstat_enabled; + if (__predict_false(extra_work)) { + all_time -= lockstat_nsecs(&sx->lock_object); + state = x; + } #endif /* @@ -908,7 +933,7 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), "spinning", "lockname:\"%s\"", sx->lock_object.lo_name); - GIANT_SAVE(); + GIANT_SAVE(extra_work); do { lock_delay(&lda); x = SX_READ_VALUE(sx); @@ -982,7 +1007,7 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) #ifdef KDTRACE_HOOKS sleep_time -= lockstat_nsecs(&sx->lock_object); #endif - GIANT_SAVE(); + GIANT_SAVE(extra_work); sleepq_add(&sx->lock_object, NULL, sx->lock_object.lo_name, SLEEPQ_SX | ((opts & SX_INTERRUPTIBLE) ? SLEEPQ_INTERRUPTIBLE : 0), SQ_SHARED_QUEUE); @@ -1006,6 +1031,10 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) __func__, sx); x = SX_READ_VALUE(sx); } +#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) + if (__predict_true(!extra_work)) + return (error); +#endif #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&sx->lock_object); if (sleep_time) From 3af300592cdcfa008e8464d47bfc50dbb78a4a22 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 02:21:24 +0000 Subject: [PATCH 31/92] rwlock: avoid branches in the slow path if lockstat is disabled --- sys/kern/kern_rwlock.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index ffe0e9ca8f39..61535962d14f 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -424,11 +424,14 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v, struct lock_delay_arg lda; #endif #ifdef KDTRACE_HOOKS - uintptr_t state; u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; #endif +#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) + uintptr_t state; + int doing_lockprof; +#endif if (SCHEDULER_STOPPED()) return; @@ -440,12 +443,17 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v, #endif rw = rwlock2rw(c); -#ifdef KDTRACE_HOOKS - all_time -= lockstat_nsecs(&rw->lock_object); -#endif -#ifdef KDTRACE_HOOKS +#ifdef LOCK_PROFILING + doing_lockprof = 1; state = v; +#elif defined(KDTRACE_HOOKS) + doing_lockprof = lockstat_enabled; + if (__predict_false(doing_lockprof)) { + all_time -= lockstat_nsecs(&rw->lock_object); + state = v; + } #endif + for (;;) { if (__rw_rlock_try(rw, td, &v, file, line)) break; @@ -583,6 +591,10 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v, __func__, rw); v = RW_READ_VALUE(rw); } +#if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) + if (__predict_true(!doing_lockprof)) + return; +#endif #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&rw->lock_object); if (sleep_time) From ae7d25a4d736392ecf325f3f1386d405e572e830 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 02:22:51 +0000 Subject: [PATCH 32/92] locks: pull up PMC_SOFT_CALLs out of slow path loops --- sys/kern/kern_rwlock.c | 23 +++++++++++++---------- sys/kern/kern_sx.c | 23 ++++++++++++----------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index 61535962d14f..78b5f428073a 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -443,6 +443,12 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v, #endif rw = rwlock2rw(c); +#ifdef HWPMC_HOOKS + PMC_SOFT_CALL( , , lock, failed); +#endif + lock_profile_obtain_lock_failed(&rw->lock_object, + &contested, &waittime); + #ifdef LOCK_PROFILING doing_lockprof = 1; state = v; @@ -460,11 +466,6 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v, #ifdef KDTRACE_HOOKS lda.spin_cnt++; #endif -#ifdef HWPMC_HOOKS - PMC_SOFT_CALL( , , lock, failed); -#endif - lock_profile_obtain_lock_failed(&rw->lock_object, - &contested, &waittime); #ifdef ADAPTIVE_RWLOCKS /* @@ -890,6 +891,12 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__, rw->lock_object.lo_name, (void *)rw->rw_lock, file, line); +#ifdef HWPMC_HOOKS + PMC_SOFT_CALL( , , lock, failed); +#endif + lock_profile_obtain_lock_failed(&rw->lock_object, + &contested, &waittime); + #ifdef LOCK_PROFILING doing_lockprof = 1; state = v; @@ -910,11 +917,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, #ifdef KDTRACE_HOOKS lda.spin_cnt++; #endif -#ifdef HWPMC_HOOKS - PMC_SOFT_CALL( , , lock, failed); -#endif - lock_profile_obtain_lock_failed(&rw->lock_object, - &contested, &waittime); + #ifdef ADAPTIVE_RWLOCKS /* * If the lock is write locked and the owner is diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index 7e7c0b0962f6..f3f38cfd996c 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -551,6 +551,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, CTR5(KTR_LOCK, "%s: %s contested (lock=%p) at %s:%d", __func__, sx->lock_object.lo_name, (void *)sx->sx_lock, file, line); +#ifdef HWPMC_HOOKS + PMC_SOFT_CALL( , , lock, failed); +#endif + lock_profile_obtain_lock_failed(&sx->lock_object, &contested, + &waittime); + #ifdef LOCK_PROFILING extra_work = 1; state = x; @@ -571,11 +577,6 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, #ifdef KDTRACE_HOOKS lda.spin_cnt++; #endif -#ifdef HWPMC_HOOKS - PMC_SOFT_CALL( , , lock, failed); -#endif - lock_profile_obtain_lock_failed(&sx->lock_object, &contested, - &waittime); #ifdef ADAPTIVE_SX /* * If the lock is write locked and the owner is @@ -889,6 +890,12 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) lock_delay_arg_init(&lda, NULL); #endif +#ifdef HWPMC_HOOKS + PMC_SOFT_CALL( , , lock, failed); +#endif + lock_profile_obtain_lock_failed(&sx->lock_object, &contested, + &waittime); + #ifdef LOCK_PROFILING extra_work = 1; state = x; @@ -911,12 +918,6 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) lda.spin_cnt++; #endif -#ifdef HWPMC_HOOKS - PMC_SOFT_CALL( , , lock, failed); -#endif - lock_profile_obtain_lock_failed(&sx->lock_object, &contested, - &waittime); - #ifdef ADAPTIVE_SX /* * If the owner is running on another CPU, spin until From 8448e020813ca77e5b4ff60411eac6ddcb955e6b Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 02:25:04 +0000 Subject: [PATCH 33/92] mtx: unlock before traversing threads to wake up This shortens the lock hold time while not affecting corretness. All the woken up threads end up competing can lose the race against a completely unrelated thread getting the lock anyway. --- sys/kern/kern_mutex.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 435cbe753bf7..27df45c10757 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -629,7 +629,8 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) #ifdef KDTRACE_HOOKS sleep_time -= lockstat_nsecs(&m->lock_object); #endif - turnstile_wait(ts, mtx_owner(m), TS_EXCLUSIVE_QUEUE); + MPASS(owner == mtx_owner(m)); + turnstile_wait(ts, owner, TS_EXCLUSIVE_QUEUE); #ifdef KDTRACE_HOOKS sleep_time += lockstat_nsecs(&m->lock_object); sleep_cnt++; @@ -1002,7 +1003,7 @@ __mtx_unlock_sleep(volatile uintptr_t *c) { struct mtx *m; struct turnstile *ts; - uintptr_t tid, v; + uintptr_t tid; if (SCHEDULER_STOPPED()) return; @@ -1028,12 +1029,12 @@ __mtx_unlock_sleep(volatile uintptr_t *c) * can be removed from the hash list if it is empty. */ turnstile_chain_lock(&m->lock_object); + _mtx_release_lock_quick(m); ts = turnstile_lookup(&m->lock_object); + MPASS(ts != NULL); if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR1(KTR_LOCK, "_mtx_unlock_sleep: %p contested", m); - MPASS(ts != NULL); turnstile_broadcast(ts, TS_EXCLUSIVE_QUEUE); - _mtx_release_lock_quick(m); /* * This turnstile is now no longer associated with the mutex. We can From 8fef6b2c67812c4e8ea667870ff1d8db3f5964d7 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 02:26:15 +0000 Subject: [PATCH 34/92] rwlock: unlock before traversing threads to wake up While here perform a minor cleanup of the unlock path. --- sys/kern/kern_rwlock.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index 78b5f428073a..6cd6e3da4cc7 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -1081,7 +1081,7 @@ __rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file, { struct rwlock *rw; struct turnstile *ts; - uintptr_t v; + uintptr_t v, setv; int queue; if (SCHEDULER_STOPPED()) @@ -1108,8 +1108,6 @@ __rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file, CTR2(KTR_LOCK, "%s: %p contested", __func__, rw); turnstile_chain_lock(&rw->lock_object); - ts = turnstile_lookup(&rw->lock_object); - MPASS(ts != NULL); /* * Use the same algo as sx locks for now. Prefer waking up shared @@ -1127,19 +1125,23 @@ __rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file, * there that could be worked around either by waking both queues * of waiters or doing some complicated lock handoff gymnastics. */ - v = RW_UNLOCKED; - if (rw->rw_lock & RW_LOCK_WRITE_WAITERS) { + setv = RW_UNLOCKED; + v = RW_READ_VALUE(rw); + queue = TS_SHARED_QUEUE; + if (v & RW_LOCK_WRITE_WAITERS) { queue = TS_EXCLUSIVE_QUEUE; - v |= (rw->rw_lock & RW_LOCK_READ_WAITERS); - } else - queue = TS_SHARED_QUEUE; + setv |= (v & RW_LOCK_READ_WAITERS); + } + atomic_store_rel_ptr(&rw->rw_lock, setv); /* Wake up all waiters for the specific queue. */ if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR3(KTR_LOCK, "%s: %p waking up %s waiters", __func__, rw, queue == TS_SHARED_QUEUE ? "read" : "write"); + + ts = turnstile_lookup(&rw->lock_object); + MPASS(ts != NULL); turnstile_broadcast(ts, queue); - atomic_store_rel_ptr(&rw->rw_lock, v); turnstile_unpend(ts, TS_EXCLUSIVE_LOCK); turnstile_chain_unlock(&rw->lock_object); } From bc24577c252dc551430ee2f7df77f5bafbe5b493 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 02:27:04 +0000 Subject: [PATCH 35/92] sx: perform a minor cleanup of the unlock slowpath No functional changes. --- sys/kern/kern_sx.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index f3f38cfd996c..6629b0a63fdd 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -772,7 +772,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, void _sx_xunlock_hard(struct sx *sx, uintptr_t tid, const char *file, int line) { - uintptr_t x; + uintptr_t x, setx; int queue, wakeup_swapper; if (SCHEDULER_STOPPED()) @@ -801,7 +801,7 @@ _sx_xunlock_hard(struct sx *sx, uintptr_t tid, const char *file, int line) CTR2(KTR_LOCK, "%s: %p contested", __func__, sx); sleepq_lock(&sx->lock_object); - x = SX_LOCK_UNLOCKED; + x = SX_READ_VALUE(sx); /* * The wake up algorithm here is quite simple and probably not @@ -812,19 +812,21 @@ _sx_xunlock_hard(struct sx *sx, uintptr_t tid, const char *file, int line) * starvation for the threads sleeping on the exclusive queue by giving * them precedence and cleaning up the shared waiters bit anyway. */ - if ((sx->sx_lock & SX_LOCK_SHARED_WAITERS) != 0 && + setx = SX_LOCK_UNLOCKED; + queue = SQ_EXCLUSIVE_QUEUE; + if ((x & SX_LOCK_SHARED_WAITERS) != 0 && sleepq_sleepcnt(&sx->lock_object, SQ_SHARED_QUEUE) != 0) { queue = SQ_SHARED_QUEUE; - x |= (sx->sx_lock & SX_LOCK_EXCLUSIVE_WAITERS); - } else - queue = SQ_EXCLUSIVE_QUEUE; + setx |= (x & SX_LOCK_EXCLUSIVE_WAITERS); + } + atomic_store_rel_ptr(&sx->sx_lock, setx); /* Wake up all the waiters for the specific queue. */ if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR3(KTR_LOCK, "%s: %p waking up all threads on %s queue", __func__, sx, queue == SQ_SHARED_QUEUE ? "shared" : "exclusive"); - atomic_store_rel_ptr(&sx->sx_lock, x); + wakeup_swapper = sleepq_broadcast(&sx->lock_object, SLEEPQ_SX, 0, queue); sleepq_release(&sx->lock_object); From 997131646f75f696f4fd2e066896da7f552f87eb Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 02:29:06 +0000 Subject: [PATCH 36/92] Check for PRS_NEW without locking the proc in sysctl_kern_proc --- sys/kern/kern_proc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 6fdb6f6d6589..b072ac66557c 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1479,11 +1479,9 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) /* * Skip embryonic processes. */ - PROC_LOCK(p); - if (p->p_state == PRS_NEW) { - PROC_UNLOCK(p); + if (p->p_state == PRS_NEW) continue; - } + PROC_LOCK(p); KASSERT(p->p_ucred != NULL, ("process credential is NULL for non-NEW proc")); /* From 32aef9ff05d6dda84bd8924efca2f5fb30e602d2 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 02:45:38 +0000 Subject: [PATCH 37/92] sched: move panic handling code out of choosethread This avoids jumps in the common case of the kernel not being panicked. --- sys/kern/kern_switch.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index f58acd5ed4c6..2cdec8d930f9 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -150,22 +150,21 @@ SYSCTL_PROC(_kern_sched_stats, OID_AUTO, reset, CTLTYPE_INT | CTLFLAG_WR, NULL, /* * Select the thread that will be run next. */ -struct thread * -choosethread(void) -{ - struct thread *td; -retry: - td = sched_choose(); +static __noinline struct thread * +choosethread_panic(struct thread *td) +{ /* * If we are in panic, only allow system threads, * plus the one we are running in, to be run. */ - if (panicstr && ((td->td_proc->p_flag & P_SYSTEM) == 0 && +retry: + if (((td->td_proc->p_flag & P_SYSTEM) == 0 && (td->td_flags & TDF_INPANIC) == 0)) { /* note that it is no longer on the run queue */ TD_SET_CAN_RUN(td); + td = sched_choose(); goto retry; } @@ -173,6 +172,20 @@ choosethread(void) return (td); } +struct thread * +choosethread(void) +{ + struct thread *td; + + td = sched_choose(); + + if (__predict_false(panicstr != NULL)) + return (choosethread_panic(td)); + + TD_SET_RUNNING(td); + return (td); +} + /* * Kernel thread preemption implementation. Critical sections mark * regions of code in which preemptions are not allowed. From 2ccee9cc522bb6260efba1b6efebfee2ba43c606 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 02:59:28 +0000 Subject: [PATCH 38/92] mtx: add missing parts of the diff in r325920 Fixes build breakage. --- sys/kern/kern_mutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 27df45c10757..063456ec9f97 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -463,7 +463,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) struct turnstile *ts; uintptr_t tid; #ifdef ADAPTIVE_MUTEXES - volatile struct thread *owner; + struct thread *owner; #endif #ifdef KTR int cont_logged = 0; @@ -1003,7 +1003,7 @@ __mtx_unlock_sleep(volatile uintptr_t *c) { struct mtx *m; struct turnstile *ts; - uintptr_t tid; + uintptr_t tid, v; if (SCHEDULER_STOPPED()) return; From bb7137e1a3ec78218693271b56319ad221c2d01e Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Fri, 17 Nov 2017 04:10:52 +0000 Subject: [PATCH 39/92] Stop special casing 32-bit AIM in memory parsing There's no need to special case 32-bit AIM to short circuit processing. Some AIM CPUs can handle 36 bit addresses, and 64-bit CPUs can run 32-bit OSes, so this will allow us to expand for that in the future if we desire. --- sys/powerpc/ofw/ofw_machdep.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/sys/powerpc/ofw/ofw_machdep.c b/sys/powerpc/ofw/ofw_machdep.c index 25b2009e056c..246496c7414f 100644 --- a/sys/powerpc/ofw/ofw_machdep.c +++ b/sys/powerpc/ofw/ofw_machdep.c @@ -184,14 +184,6 @@ parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output) i = 0; j = 0; while (i < sz/sizeof(cell_t)) { - #if !defined(__powerpc64__) && !defined(BOOKE) - /* On 32-bit PPC (OEA), ignore regions starting above 4 GB */ - if (address_cells > 1 && OFmem[i] > 0) { - i += address_cells + size_cells; - continue; - } - #endif - output[j].mr_start = OFmem[i++]; if (address_cells == 2) { output[j].mr_start <<= 32; @@ -204,19 +196,20 @@ parse_ofw_memory(phandle_t node, const char *prop, struct mem_region *output) output[j].mr_size += OFmem[i++]; } - #if !defined(__powerpc64__) && !defined(BOOKE) - /* Book-E can support 36-bit addresses. */ + if (output[j].mr_start > BUS_SPACE_MAXADDR) + continue; + /* - * Check for memory regions extending above 32-bit - * memory space, and restrict them to stay there. + * Constrain memory to that which we can access. + * 32-bit AIM can only reference 32 bits of address currently, + * but Book-E can access 36 bits. */ if (((uint64_t)output[j].mr_start + - (uint64_t)output[j].mr_size) > - BUS_SPACE_MAXADDR_32BIT) { - output[j].mr_size = BUS_SPACE_MAXADDR_32BIT - - output[j].mr_start; + (uint64_t)output[j].mr_size - 1) > + BUS_SPACE_MAXADDR) { + output[j].mr_size = BUS_SPACE_MAXADDR - + output[j].mr_start + 1; } - #endif j++; } From c3f3cd058f3fc52c27f3c4da382e13310b5dc28f Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Fri, 17 Nov 2017 04:29:32 +0000 Subject: [PATCH 40/92] Add jumbo frame support to dtsec(4) MFC after: 2 weeks --- sys/dev/dpaa/if_dtsec.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sys/dev/dpaa/if_dtsec.c b/sys/dev/dpaa/if_dtsec.c index d8c2e6643b3d..2c6291b07e34 100644 --- a/sys/dev/dpaa/if_dtsec.c +++ b/sys/dev/dpaa/if_dtsec.c @@ -67,6 +67,10 @@ __FBSDID("$FreeBSD$"); #include "if_dtsec_im.h" #include "if_dtsec_rm.h" +#define DTSEC_MIN_FRAME_SIZE 64 +#define DTSEC_MAX_FRAME_SIZE 9600 + +#define DTSEC_REG_MAXFRM 0x110 /** * @group dTSEC private defines. @@ -320,6 +324,22 @@ dtsec_fm_port_free_both(struct dtsec_softc *sc) * @group IFnet routines. * @{ */ +static int +dtsec_set_mtu(struct dtsec_softc *sc, unsigned int mtu) +{ + + mtu += ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + ETHER_CRC_LEN; + + DTSEC_LOCK_ASSERT(sc); + + if (mtu >= DTSEC_MIN_FRAME_SIZE && mtu <= DTSEC_MAX_FRAME_SIZE) { + bus_write_4(sc->sc_mem, DTSEC_REG_MAXFRM, mtu); + return (mtu); + } + + return (0); +} + static int dtsec_if_enable_locked(struct dtsec_softc *sc) { @@ -384,6 +404,14 @@ dtsec_if_ioctl(struct ifnet *ifp, u_long command, caddr_t data) /* Basic functionality to achieve media status reports */ switch (command) { + case SIOCSIFMTU: + DTSEC_LOCK(sc); + if (dtsec_set_mtu(sc, ifr->ifr_mtu)) + ifp->if_mtu = ifr->ifr_mtu; + else + error = EINVAL; + DTSEC_UNLOCK(sc); + break; case SIOCSIFFLAGS: DTSEC_LOCK(sc); @@ -678,7 +706,7 @@ dtsec_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = TSEC_TX_NUM_DESC - 1; IFQ_SET_READY(&ifp->if_snd); #endif - ifp->if_capabilities = 0; /* TODO: Check */ + ifp->if_capabilities = IFCAP_JUMBO_MTU; /* TODO: HWCSUM */ ifp->if_capenable = ifp->if_capabilities; /* Attach PHY(s) */ From 5cdf66d629fb0f76956564939e990f413a14c266 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Fri, 17 Nov 2017 09:29:26 +0000 Subject: [PATCH 41/92] Do not remove the sources when zstd is called as zstdcat --- sys/contrib/zstd/programs/zstdcli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/zstd/programs/zstdcli.c b/sys/contrib/zstd/programs/zstdcli.c index e76e6d75a4d1..47e7cb0cd12c 100644 --- a/sys/contrib/zstd/programs/zstdcli.c +++ b/sys/contrib/zstd/programs/zstdcli.c @@ -421,7 +421,7 @@ int main(int argCount, const char* argv[]) /* preset behaviors */ if (exeNameMatch(programName, ZSTD_ZSTDMT)) nbThreads=0; if (exeNameMatch(programName, ZSTD_UNZSTD)) operation=zom_decompress; - if (exeNameMatch(programName, ZSTD_CAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; } + if (exeNameMatch(programName, ZSTD_CAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; g_removeSrcFile=0; } if (exeNameMatch(programName, ZSTD_GZ)) { suffix = GZ_EXTENSION; FIO_setCompressionType(FIO_gzipCompression); FIO_setRemoveSrcFile(1); } /* behave like gzip */ if (exeNameMatch(programName, ZSTD_GUNZIP)) { operation=zom_decompress; FIO_setRemoveSrcFile(1); } /* behave like gunzip */ if (exeNameMatch(programName, ZSTD_GZCAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; } /* behave like gzcat */ From 6247019ec279193161abb3f2b12f3f388ae83ffa Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Fri, 17 Nov 2017 09:33:29 +0000 Subject: [PATCH 42/92] Actually commit the right patch for r325929 --- sys/contrib/zstd/programs/zstdcli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/zstd/programs/zstdcli.c b/sys/contrib/zstd/programs/zstdcli.c index 47e7cb0cd12c..d3c373c8ddd0 100644 --- a/sys/contrib/zstd/programs/zstdcli.c +++ b/sys/contrib/zstd/programs/zstdcli.c @@ -421,7 +421,7 @@ int main(int argCount, const char* argv[]) /* preset behaviors */ if (exeNameMatch(programName, ZSTD_ZSTDMT)) nbThreads=0; if (exeNameMatch(programName, ZSTD_UNZSTD)) operation=zom_decompress; - if (exeNameMatch(programName, ZSTD_CAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; g_removeSrcFile=0; } + if (exeNameMatch(programName, ZSTD_CAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; FIO_setRemoveSrcFile(0); } if (exeNameMatch(programName, ZSTD_GZ)) { suffix = GZ_EXTENSION; FIO_setCompressionType(FIO_gzipCompression); FIO_setRemoveSrcFile(1); } /* behave like gzip */ if (exeNameMatch(programName, ZSTD_GUNZIP)) { operation=zom_decompress; FIO_setRemoveSrcFile(1); } /* behave like gunzip */ if (exeNameMatch(programName, ZSTD_GZCAT)) { operation=zom_decompress; forceStdout=1; FIO_overwriteMode(); outFileName=stdoutmark; g_displayLevel=1; } /* behave like gzcat */ From 7841fefb62f03afcd7f44ecac18e4cd0db991b5b Mon Sep 17 00:00:00 2001 From: Scott Long Date: Fri, 17 Nov 2017 13:12:20 +0000 Subject: [PATCH 43/92] Rename P_OSREL_CK_CLYGRP to P_OSREL_CK_CYLGRP --- sbin/fsck_ffs/pass5.c | 2 +- sbin/newfs/mkfs.c | 2 +- sys/sys/param.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index a4828a20e1f8..f544cc79079a 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -74,7 +74,7 @@ pass5(void) newcg->cg_niblk = fs->fs_ipg; if (preen == 0 && yflag == 0 && fs->fs_magic == FS_UFS2_MAGIC && fswritefd != -1 && (fs->fs_metackhash & CK_CYLGRP) == 0 && - getosreldate() >= P_OSREL_CK_CLYGRP && + getosreldate() >= P_OSREL_CK_CYLGRP && reply("ADD CYLINDER GROUP CHECKSUM PROTECTION") != 0) { fs->fs_metackhash |= CK_CYLGRP; rewritecg = 1; diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index a7d570ea5619..957a3674e7c6 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -496,7 +496,7 @@ mkfs(struct partition *pp, char *fsys) /* * Set flags for metadata that is being check-hashed. */ - if (Oflag > 1 && getosreldate() >= P_OSREL_CK_CLYGRP) + if (Oflag > 1 && getosreldate() >= P_OSREL_CK_CYLGRP) sblock.fs_metackhash = CK_CYLGRP; /* diff --git a/sys/sys/param.h b/sys/sys/param.h index e7289d71be30..6dcfd4300d76 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -84,7 +84,7 @@ #define P_OSREL_SHUTDOWN_ENOTCONN 1100077 #define P_OSREL_MAP_GUARD 1200035 #define P_OSREL_WRFSBASE 1200041 -#define P_OSREL_CK_CLYGRP 1200046 +#define P_OSREL_CK_CYLGRP 1200046 #define P_OSREL_VMTOTAL64 1200054 #define P_OSREL_MAJOR(x) ((x) / 100000) From 84de4b977aa2c21dd749a395dd84e053dcd01ecb Mon Sep 17 00:00:00 2001 From: Gordon Tetlow Date: Fri, 17 Nov 2017 15:46:19 +0000 Subject: [PATCH 44/92] Correct grammar nit. --- UPDATING | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index 6f852439bc7d..38b8003b95eb 100644 --- a/UPDATING +++ b/UPDATING @@ -66,7 +66,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: 20171102: Building in a FreeBSD src checkout will automatically create object directories now rather than store files in the current directory if - 'make obj' was not ran. Calling 'make obj' is no longer necesarry. + 'make obj' was not ran. Calling 'make obj' is no longer necessary. This feature can be disabled by setting WITHOUT_AUTO_OBJ=yes in /etc/src-env.conf (not /etc/src.conf), or passing the option in the environment. From 27a077f20c08c1e5bb1ea5eb559f748a4d9dd8c9 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Fri, 17 Nov 2017 16:04:37 +0000 Subject: [PATCH 45/92] VOP_LOOKUP.9: update locking info The old description has been inaccurate since at least 243271, if not before. Submitted by: will Reviewed by: kib MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13108 --- share/man/man9/VOP_LOOKUP.9 | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/share/man/man9/VOP_LOOKUP.9 b/share/man/man9/VOP_LOOKUP.9 index c00810507b91..ec3b36e7583d 100644 --- a/share/man/man9/VOP_LOOKUP.9 +++ b/share/man/man9/VOP_LOOKUP.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2017 +.Dd November 17, 2017 .Dt VOP_LOOKUP 9 .Os .Sh NAME @@ -121,19 +121,9 @@ If not at end, add name to cache; if at end and neither creating nor deleting, add name to cache. .Ed .Sh LOCKS -The directory, +The directory .Fa dvp -should be locked on entry. -If an error (note: the return value -.Er EJUSTRETURN -is not considered an error) -is detected, it will be returned locked. -Otherwise, it will be unlocked unless both -.Dv LOCKPARENT -and -.Dv ISLASTCN -are specified in -.Fa cnp->cn_flags . +should be locked on entry and exit, regardless of error condition. If an entry is found in the directory, it will be returned locked. .Sh RETURN VALUES Zero is returned with From 602740b689f27d05713ac329a27bc0775d6b527c Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Fri, 17 Nov 2017 17:13:00 +0000 Subject: [PATCH 46/92] Fix potential NULL pointer dereference of device physical path In scsi_dev_advinfo(), if the physical path is being stored and there is a malloc failure (malloc(9) is called with M_NOWAIT), we could wind up in a situation where the device's physpath_len is set to the length the user provided, but the physpath itself is NULL. If another context then comes in to fetch the physical path value, we would wind up trying to memcpy a NULL pointer into the caller's buffer. So, set the physpath_len to 0 when we free the physpath on entry into the store case for the physical path. Reset the length to a non-zero value only after we've successfully malloced a buffer to hold it. Submitted by: ken Reviewed by: asomers MFC after: 3 weeks Sponsored by: Spectra Logic Corp --- sys/cam/scsi/scsi_xpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 74364f05f4b3..1dd167cd92d4 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -2549,8 +2549,8 @@ scsi_dev_advinfo(union ccb *start_ccb) if (device->physpath != NULL) { free(device->physpath, M_CAMXPT); device->physpath = NULL; + device->physpath_len = 0; } - device->physpath_len = cdai->bufsiz; /* Clear existing buffer if zero length */ if (cdai->bufsiz == 0) break; @@ -2559,6 +2559,7 @@ scsi_dev_advinfo(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_ABORTED; return; } + device->physpath_len = cdai->bufsiz; memcpy(device->physpath, cdai->buf, cdai->bufsiz); } else { cdai->provsiz = device->physpath_len; From 14dc747a100c13b5c7a65ba2f5eea911604b4117 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 17 Nov 2017 17:33:06 +0000 Subject: [PATCH 47/92] Remove stray SRCBRANCH included by mistake. Sponsored by: The FreeBSD Foundation --- release/arm64/PINE64.conf | 1 - release/arm64/RPI3.conf | 1 - 2 files changed, 2 deletions(-) diff --git a/release/arm64/PINE64.conf b/release/arm64/PINE64.conf index a01e417426c1..a41dce93f707 100644 --- a/release/arm64/PINE64.conf +++ b/release/arm64/PINE64.conf @@ -3,7 +3,6 @@ # $FreeBSD$ # -SRCBRANCH="base/head@rHEAD" EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm64" EMBEDDED_TARGET_ARCH="aarch64" diff --git a/release/arm64/RPI3.conf b/release/arm64/RPI3.conf index 216acae43a5a..a37fab9bbe84 100644 --- a/release/arm64/RPI3.conf +++ b/release/arm64/RPI3.conf @@ -3,7 +3,6 @@ # $FreeBSD$ # -SRCBRANCH="base/head@rHEAD" EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm64" EMBEDDED_TARGET_ARCH="aarch64" From d025cec6250eb4e6be6290eca20c75eef4b28020 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 17 Nov 2017 17:34:52 +0000 Subject: [PATCH 48/92] Sort variables in arm64 SoC configurations. Remove an unneeded UBLDR_LOADADDR from RPI3.conf. Sponsored by: The FreeBSD Foundation --- release/arm64/PINE64.conf | 10 +++++----- release/arm64/RPI3.conf | 23 +++++++++++------------ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/release/arm64/PINE64.conf b/release/arm64/PINE64.conf index a41dce93f707..e48a4c57bcf7 100644 --- a/release/arm64/PINE64.conf +++ b/release/arm64/PINE64.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm64" EMBEDDED_TARGET_ARCH="aarch64" +EMBEDDED_TARGET="arm64" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pine64" -KERNEL="GENERIC" -IMAGE_SIZE="2560M" -PART_SCHEME="MBR" FAT_SIZE="54m -b 1m" FAT_TYPE="16" +IMAGE_SIZE="2560M" +KERNEL="GENERIC" MD_ARGS="-x 16384 -y 255" NODOC=1 +PART_SCHEME="MBR" export BOARDNAME="PINE64" arm_install_uboot() { diff --git a/release/arm64/RPI3.conf b/release/arm64/RPI3.conf index a37fab9bbe84..79753952608c 100644 --- a/release/arm64/RPI3.conf +++ b/release/arm64/RPI3.conf @@ -3,21 +3,20 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm64" -EMBEDDED_TARGET_ARCH="aarch64" -EMBEDDEDPORTS="sysutils/u-boot-rpi3 security/ca_root_nss" -KERNEL="GENERIC" -WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="2560M" -PART_SCHEME="MBR" -FAT_SIZE="50m -b 1m" -FAT_TYPE="16" -MD_ARGS="-x 63 -y 255" -NODOC=1 DTB_REPO="https://github.com/raspberrypi/firmware/blob/master/boot" DTB="bcm2710-rpi-3-b.dtb" +EMBEDDED_TARGET_ARCH="aarch64" +EMBEDDED_TARGET="arm64" +EMBEDDEDBUILD=1 +EMBEDDEDPORTS="sysutils/u-boot-rpi3 security/ca_root_nss" +FAT_SIZE="50m -b 1m" +FAT_TYPE="16" +IMAGE_SIZE="2560M" +KERNEL="GENERIC" +MD_ARGS="-x 63 -y 255" +NODOC=1 OVERLAYS="mmc.dtbo pi3-disable-bt.dtbo" +PART_SCHEME="MBR" export BOARDNAME="RPI3" arm_install_uboot() { From bcccd559e20d22c29805034b912659ffd0b97813 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 17 Nov 2017 17:36:45 +0000 Subject: [PATCH 49/92] Sort variables for consistency. Sponsored by: The FreeBSD Foundation --- release/arm/BANANAPI.conf | 10 +++++----- release/arm/BEAGLEBONE.conf | 10 +++++----- release/arm/CUBIEBOARD.conf | 10 +++++----- release/arm/CUBIEBOARD2.conf | 10 +++++----- release/arm/CUBOX-HUMMINGBOARD.conf | 10 +++++----- release/arm/GUMSTIX.conf | 10 +++++----- release/arm/PANDABOARD.conf | 10 +++++----- release/arm/RPI-B.conf | 10 +++++----- release/arm/RPI2.conf | 10 +++++----- release/arm/WANDBOARD.conf | 10 +++++----- 10 files changed, 50 insertions(+), 50 deletions(-) diff --git a/release/arm/BANANAPI.conf b/release/arm/BANANAPI.conf index ce000c4663e9..7dc7c8336d63 100644 --- a/release/arm/BANANAPI.conf +++ b/release/arm/BANANAPI.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-bananapi" -KERNEL="GENERIC" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" +IMAGE_SIZE="3072M" +KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" export BOARDNAME="BANANAPI" arm_install_uboot() { diff --git a/release/arm/BEAGLEBONE.conf b/release/arm/BEAGLEBONE.conf index 2bf7a3df5b83..50565f1a944d 100644 --- a/release/arm/BEAGLEBONE.conf +++ b/release/arm/BEAGLEBONE.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-beaglebone" -KERNEL="GENERIC" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" +IMAGE_SIZE="3072M" +KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" export BOARDNAME="BEAGLEBONE" arm_install_uboot() { diff --git a/release/arm/CUBIEBOARD.conf b/release/arm/CUBIEBOARD.conf index b48999b49a16..7ba5ba00d366 100644 --- a/release/arm/CUBIEBOARD.conf +++ b/release/arm/CUBIEBOARD.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubieboard" -KERNEL="GENERIC" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" +IMAGE_SIZE="3072M" +KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" export BOARDNAME="CUBIEBOARD" arm_install_uboot() { diff --git a/release/arm/CUBIEBOARD2.conf b/release/arm/CUBIEBOARD2.conf index a63a47f112a0..fbd2bea13f1f 100644 --- a/release/arm/CUBIEBOARD2.conf +++ b/release/arm/CUBIEBOARD2.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" -KERNEL="GENERIC" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" +IMAGE_SIZE="3072M" +KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" export BOARDNAME="CUBIEBOARD2" arm_install_uboot() { diff --git a/release/arm/CUBOX-HUMMINGBOARD.conf b/release/arm/CUBOX-HUMMINGBOARD.conf index da8bf743d6ea..c49fb3cc5e4a 100644 --- a/release/arm/CUBOX-HUMMINGBOARD.conf +++ b/release/arm/CUBOX-HUMMINGBOARD.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" -KERNEL="IMX6" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" +IMAGE_SIZE="3072M" +KERNEL="IMX6" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" export BOARDNAME="CUBOX-HUMMINGBOARD" arm_install_uboot() { diff --git a/release/arm/GUMSTIX.conf b/release/arm/GUMSTIX.conf index 2763c3bca7c0..fb122b77f905 100644 --- a/release/arm/GUMSTIX.conf +++ b/release/arm/GUMSTIX.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="arm" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-duovero" -KERNEL="GUMSTIX" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" +IMAGE_SIZE="3072M" +KERNEL="GUMSTIX" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-duovero" diff --git a/release/arm/PANDABOARD.conf b/release/arm/PANDABOARD.conf index 3f75258a0beb..87a08e68c451 100644 --- a/release/arm/PANDABOARD.conf +++ b/release/arm/PANDABOARD.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-pandaboard" -KERNEL="GENERIC" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" +IMAGE_SIZE="3072M" +KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" export BOARDNAME="PANDABOARD" arm_install_uboot() { diff --git a/release/arm/RPI-B.conf b/release/arm/RPI-B.conf index e317da7ac57c..9b7bf58f3e1b 100644 --- a/release/arm/RPI-B.conf +++ b/release/arm/RPI-B.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi sysutils/rpi-firmware" -KERNEL="RPI-B" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="17m" FAT_TYPE="16" +IMAGE_SIZE="3072M" +KERNEL="RPI-B" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi" diff --git a/release/arm/RPI2.conf b/release/arm/RPI2.conf index 421f022427c3..f5f307eeee7e 100644 --- a/release/arm/RPI2.conf +++ b/release/arm/RPI2.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-rpi2 sysutils/rpi-firmware" -KERNEL="GENERIC" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="50m" FAT_TYPE="16" +IMAGE_SIZE="3072M" +KERNEL="GENERIC" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" export BOARDNAME="RPI2" arm_install_uboot() { diff --git a/release/arm/WANDBOARD.conf b/release/arm/WANDBOARD.conf index a5e4379f215e..f902ac8c279c 100644 --- a/release/arm/WANDBOARD.conf +++ b/release/arm/WANDBOARD.conf @@ -3,17 +3,17 @@ # $FreeBSD$ # -EMBEDDEDBUILD=1 -EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" +EMBEDDED_TARGET="arm" +EMBEDDEDBUILD=1 EMBEDDEDPORTS="sysutils/u-boot-wandboard" -KERNEL="IMX6" -IMAGE_SIZE="3072M" -PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" +IMAGE_SIZE="3072M" +KERNEL="IMX6" MD_ARGS="-x 63 -y 255" NODOC=1 +PART_SCHEME="MBR" export BOARDNAME="WANDBOARD" arm_install_uboot() { From 41edb6080c7e7f1d0356d527a159262dc00d7dbf Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 17 Nov 2017 17:40:53 +0000 Subject: [PATCH 50/92] Fix indentation. Sponsored by: The FreeBSD Foundation --- release/arm64/RPI3.conf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/arm64/RPI3.conf b/release/arm64/RPI3.conf index 79753952608c..5f3fc394374b 100644 --- a/release/arm64/RPI3.conf +++ b/release/arm64/RPI3.conf @@ -41,9 +41,9 @@ arm_install_uboot() { done BOOTFILES="$(chroot ${CHROOTDIR} \ - env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ - WITH_UNIFIED_OBJDIR=yes \ - make -C ${WORLDDIR}/stand -V .OBJDIR)" + env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ + WITH_UNIFIED_OBJDIR=yes \ + make -C ${WORLDDIR}/stand -V .OBJDIR)" BOOTFILES="$(realpath ${BOOTFILES})" chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT From 3b418d1b9a4a846fac2502e56d1edad13f7c9dd7 Mon Sep 17 00:00:00 2001 From: Ruslan Bukin Date: Fri, 17 Nov 2017 17:54:10 +0000 Subject: [PATCH 51/92] Add Intel Processor Trace registers for: - CPUID - Table of Physical Addresses (ToPA). Sponsored by: DARPA, AFRL --- sys/x86/include/specialreg.h | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/sys/x86/include/specialreg.h b/sys/x86/include/specialreg.h index 39d511330669..e56cc474666a 100644 --- a/sys/x86/include/specialreg.h +++ b/sys/x86/include/specialreg.h @@ -188,6 +188,35 @@ #define CPUTPM1_ARAT 0x00000004 #define CPUTPM2_EFFREQ 0x00000001 +/* Intel Processor Trace CPUID. */ + +/* Leaf 0 ebx. */ +#define CPUPT_CR3 (1 << 0) /* CR3 Filtering Support */ +#define CPUPT_PSB (1 << 1) /* Configurable PSB and Cycle-Accurate Mode Supported */ +#define CPUPT_IPF (1 << 2) /* IP Filtering and TraceStop supported */ +#define CPUPT_MTC (1 << 3) /* MTC Supported */ +#define CPUPT_PRW (1 << 4) /* PTWRITE Supported */ +#define CPUPT_PWR (1 << 5) /* Power Event Trace Supported */ + +/* Leaf 0 ecx. */ +#define CPUPT_TOPA (1 << 0) /* ToPA Output Supported */ +#define CPUPT_TOPA_MULTI (1 << 1) /* ToPA Tables Allow Multiple Output Entries */ +#define CPUPT_SINGLE (1 << 2) /* Single-Range Output Supported */ +#define CPUPT_TT_OUT (1 << 3) /* Output to Trace Transport Subsystem Supported */ +#define CPUPT_LINEAR_IP (1 << 31) /* IP Payloads are Linear IP, otherwise IP is effective */ + +/* Leaf 1 eax. */ +#define CPUPT_NADDR_S 0 /* Number of Address Ranges */ +#define CPUPT_NADDR_M (0x7 << CPUPT_NADDR_S) +#define CPUPT_MTC_BITMAP_S 16 /* Bitmap of supported MTC Period Encodings */ +#define CPUPT_MTC_BITMAP_M (0xffff << CPUPT_MTC_BITMAP_S) + +/* Leaf 1 ebx. */ +#define CPUPT_CT_BITMAP_S 0 /* Bitmap of supported Cycle Threshold values */ +#define CPUPT_CT_BITMAP_M (0xffff << CPUPT_CT_BITMAP_S) +#define CPUPT_PFE_BITMAP_S 16 /* Bitmap of supported Configurable PSB Frequency encoding */ +#define CPUPT_PFE_BITMAP_M (0xffff << CPUPT_PFE_BITMAP_S) + /* * Important bits in the AMD extended cpuid flags */ @@ -602,6 +631,29 @@ #define MSR_IA32_RTIT_ADDR3_A 0x586 /* Region 3 Start Address (R/W) */ #define MSR_IA32_RTIT_ADDR3_B 0x587 /* Region 3 End Address (R/W) */ +/* Intel Processor Trace Table of Physical Addresses (ToPA). */ +#define TOPA_SIZE_S 6 +#define TOPA_SIZE_M (0xf << TOPA_SIZE_S) +#define TOPA_SIZE_4K (0 << TOPA_SIZE_S) +#define TOPA_SIZE_8K (1 << TOPA_SIZE_S) +#define TOPA_SIZE_16K (2 << TOPA_SIZE_S) +#define TOPA_SIZE_32K (3 << TOPA_SIZE_S) +#define TOPA_SIZE_64K (4 << TOPA_SIZE_S) +#define TOPA_SIZE_128K (5 << TOPA_SIZE_S) +#define TOPA_SIZE_256K (6 << TOPA_SIZE_S) +#define TOPA_SIZE_512K (7 << TOPA_SIZE_S) +#define TOPA_SIZE_1M (8 << TOPA_SIZE_S) +#define TOPA_SIZE_2M (9 << TOPA_SIZE_S) +#define TOPA_SIZE_4M (10 << TOPA_SIZE_S) +#define TOPA_SIZE_8M (11 << TOPA_SIZE_S) +#define TOPA_SIZE_16M (12 << TOPA_SIZE_S) +#define TOPA_SIZE_32M (13 << TOPA_SIZE_S) +#define TOPA_SIZE_64M (14 << TOPA_SIZE_S) +#define TOPA_SIZE_128M (15 << TOPA_SIZE_S) +#define TOPA_STOP (1 << 4) +#define TOPA_INT (1 << 2) +#define TOPA_END (1 << 0) + /* * Constants related to MSR's. */ From f295b9db794bbf35d292268ce2db18e4dcf6400f Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Fri, 17 Nov 2017 18:00:52 +0000 Subject: [PATCH 52/92] Add general configuration files used by release/release.sh for big-iron installation images. MFC after: 3 days MFC with: r325948, r325949, r325950, r325951 Sponsored by: The FreeBSD Foundation --- release/amd64/amd64.conf | 10 ++++++++++ release/arm64/aarch64.conf | 11 +++++++++++ release/i386/i386.conf | 12 ++++++++++++ release/powerpc/powerpc.conf | 10 ++++++++++ release/powerpc/powerpc64.conf | 10 ++++++++++ release/powerpc/powerpcspe.conf | 10 ++++++++++ release/sparc64/sparc64.conf | 10 ++++++++++ 7 files changed, 73 insertions(+) create mode 100644 release/amd64/amd64.conf create mode 100644 release/arm64/aarch64.conf create mode 100644 release/i386/i386.conf create mode 100644 release/powerpc/powerpc.conf create mode 100644 release/powerpc/powerpc64.conf create mode 100644 release/powerpc/powerpcspe.conf create mode 100644 release/sparc64/sparc64.conf diff --git a/release/amd64/amd64.conf b/release/amd64/amd64.conf new file mode 100644 index 000000000000..1cc71ed6c1c2 --- /dev/null +++ b/release/amd64/amd64.conf @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build amd64/amd64. + +TARGET="amd64" +TARGET_ARCH="amd64" +KERNEL="GENERIC" diff --git a/release/arm64/aarch64.conf b/release/arm64/aarch64.conf new file mode 100644 index 000000000000..ea6335cd02d8 --- /dev/null +++ b/release/arm64/aarch64.conf @@ -0,0 +1,11 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build arm64/aarch64 +# big-iron installation images (not system-on-chip (SoC) images). + +TARGET="arm64" +TARGET_ARCH="aarch64" +KERNEL="GENERIC" diff --git a/release/i386/i386.conf b/release/i386/i386.conf new file mode 100644 index 000000000000..dd5aa137c52d --- /dev/null +++ b/release/i386/i386.conf @@ -0,0 +1,12 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build i386/i386. +# Note: CHROOT_MAKEENV assumes the build host is amd64. + +TARGET="i386" +TARGET_ARCH="i386" +KERNEL="GENERIC" +CHROOT_MAKEENV="TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH}" diff --git a/release/powerpc/powerpc.conf b/release/powerpc/powerpc.conf new file mode 100644 index 000000000000..5cf9a48387fd --- /dev/null +++ b/release/powerpc/powerpc.conf @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build powerpc/powerpc. + +TARGET="powerpc" +TARGET_ARCH="powerpc" +KERNEL="GENERIC" diff --git a/release/powerpc/powerpc64.conf b/release/powerpc/powerpc64.conf new file mode 100644 index 000000000000..7c756d413dc3 --- /dev/null +++ b/release/powerpc/powerpc64.conf @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build powerpc/powerpc64. + +TARGET="powerpc" +TARGET_ARCH="powerpc64" +KERNEL="GENERIC64" diff --git a/release/powerpc/powerpcspe.conf b/release/powerpc/powerpcspe.conf new file mode 100644 index 000000000000..13b043e4cd23 --- /dev/null +++ b/release/powerpc/powerpcspe.conf @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build powerpc/powerpcspe. + +TARGET="powerpc" +TARGET_ARCH="powerpcspe" +KERNEL="MPC85XXSPE" diff --git a/release/sparc64/sparc64.conf b/release/sparc64/sparc64.conf new file mode 100644 index 000000000000..c0579eaadb4b --- /dev/null +++ b/release/sparc64/sparc64.conf @@ -0,0 +1,10 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# Configuration file for release/release.sh to build sparc64/sparc64. + +TARGET="sparc64" +TARGET_ARCH="sparc64" +KERNEL="GENERIC" From 1cbb58886a477cf282072eaa331d8122e36e9952 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 17 Nov 2017 18:16:46 +0000 Subject: [PATCH 53/92] Remove build system support for lint. Differential Revision: https://reviews.freebsd.org/D13124 --- Makefile | 2 +- share/mk/bsd.README | 23 ++++++++--------------- share/mk/bsd.lib.mk | 21 --------------------- share/mk/bsd.own.mk | 3 --- share/mk/bsd.prog.mk | 7 ------- share/mk/bsd.subdir.mk | 2 +- share/mk/bsd.suffixes.mk | 8 -------- share/mk/sys.mk | 9 +-------- sys/conf/kern.mk | 2 +- sys/conf/kern.post.mk | 10 +--------- sys/conf/kern.pre.mk | 6 ------ sys/conf/kmod.mk | 3 --- usr.sbin/config/mkmakefile.c | 7 ------- 13 files changed, 13 insertions(+), 90 deletions(-) diff --git a/Makefile b/Makefile index 7674e608b6bd..f4515e5d3678 100644 --- a/Makefile +++ b/Makefile @@ -129,7 +129,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ everything hier hierarchy install installcheck installkernel \ installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ - installworld kernel-toolchain libraries lint maninstall \ + installworld kernel-toolchain libraries maninstall \ obj objlink showconfig tags toolchain update \ _worldtmp _legacy _bootstrap-tools _cleanobj _obj \ _build-tools _build-metadata _cross-tools _includes _libraries \ diff --git a/share/mk/bsd.README b/share/mk/bsd.README index 4b9bf92a3538..9e593e0990d8 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -250,8 +250,6 @@ It has seven targets: beforeinstall and afterinstall may also be used to cause actions immediately before and after the install target is executed. - lint: - run lint on the source files tags: create a tags file for the source files. @@ -488,18 +486,17 @@ ${MOD}_oid.h A header which programmatically describes the MIB root and The include file contains the default targets for building subdirectories. It has the same seven targets as : all, clean, -cleandir, depend, install, lint, and tags. For all of the directories -listed in the variable SUBDIRS, the specified directory will be visited -and the target made. There is also a default target which allows the -command "make subdir" where subdir is any directory listed in the variable -SUBDIRS. +cleandir, depend, install, and tags. For all of the directories listed in the +variable SUBDIRS, the specified directory will be visited and the target made. +There is also a default target which allows the command "make subdir" where +subdir is any directory listed in the variable SUBDIRS. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -The include file has support for building libraries. It has -the same seven targets as : all, clean, cleandir, depend, -install, lint, and tags. It has a limited number of suffixes, consistent -with the current needs of the BSD tree. +The include file has support for building libraries. It has the +same seven targets as : all, clean, cleandir, depend, install, and +tags. It has a limited number of suffixes, consistent with the current needs of +the BSD tree. It sets/uses the following variables: @@ -530,8 +527,6 @@ LIB_CXX The name of the library to build. It also causes will be built. NO_PIC can be set to only build a static library. -LINTLIBDIR Target directory for lint libraries. - MAN The manual pages to be installed. See bsd.man.mk for more details. @@ -588,8 +583,6 @@ It has seven targets: targets beforeinstall and afterinstall may also be used to cause actions immediately before and after the install target is executed. - lint: - run lint on the source files. tags: create a tags file for the source files. diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index d3e4d7839cff..7e76d9c78ede 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -285,18 +285,6 @@ lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS} ${RANLIB} ${RANLIBFLAGS} ${.TARGET} .endif -.if defined(WANT_LINT) && !defined(NO_LINT) && defined(LIB) && !empty(LIB) -LINTLIB= llib-l${LIB}.ln -_LIBS+= ${LINTLIB} -LINTOBJS+= ${SRCS:M*.c:.c=.ln} -CLEANFILES+= ${LINTOBJS} - -${LINTLIB}: ${LINTOBJS} - @${ECHO} building lint library ${.TARGET} - @rm -f ${.TARGET} - ${LINT} ${LINTLIBFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} -.endif - .endif # !defined(INTERNALLIB) .if defined(_SKIP_BUILD) @@ -403,10 +391,6 @@ _libinstall: ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/ .endif -.if defined(WANT_LINT) && !defined(NO_LINT) && defined(LIB) && !empty(LIB) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},development} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} ${LINTLIB} ${DESTDIR}${LINTLIBDIR}/ -.endif .endif # !defined(INTERNALLIB) .if !defined(LIBRARIES_ONLY) @@ -425,11 +409,6 @@ realinstall: maninstall .endif -.if !target(lint) -lint: ${SRCS:M*.c} - ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} -.endif - .if ${MK_MAN} != "no" && !defined(LIBRARIES_ONLY) .include .endif diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index cb94b8f96e7d..07bad561acc7 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -32,8 +32,6 @@ # # LIBEXECDIR Base path for system daemons and utilities. [/usr/libexec] # -# LINTLIBDIR Base path for lint libraries. [/usr/libdata/lint] -# # SHLIBDIR Base path for shared libraries. [${LIBDIR}] # # LIBOWN Library owner. [${BINOWN}] @@ -162,7 +160,6 @@ LIBDIR?= ${LIBDIR_BASE} LIBCOMPATDIR?= /usr/lib/compat LIBDATADIR?= /usr/libdata LIBEXECDIR?= /usr/libexec -LINTLIBDIR?= /usr/libdata/lint SHLIBDIR?= ${LIBDIR} LIBOWN?= ${BINOWN} LIBGRP?= ${BINGRP} diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index a3129a8cdca9..c88742aff1e7 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -294,13 +294,6 @@ realinstall: maninstall .endif # !target(install) -.if !target(lint) -lint: ${SRCS:M*.c} -.if defined(PROG) - ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.ALLSRC} -.endif -.endif - .if ${MK_MAN} != "no" .include .endif diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index 1730895705f8..486043a63bb7 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -46,7 +46,7 @@ SUBDIR_TARGETS+= \ all all-man analyze buildconfig buildfiles buildincludes \ checkdpadd clean cleandepend cleandir cleanilinks \ cleanobj depend distribute files includes installconfig \ - installfiles installincludes print-dir realinstall lint \ + installfiles installincludes print-dir realinstall \ maninstall manlint ${_obj} objlink tags \ # Described above. diff --git a/share/mk/bsd.suffixes.mk b/share/mk/bsd.suffixes.mk index 9ca583b0b952..27810f65811e 100644 --- a/share/mk/bsd.suffixes.mk +++ b/share/mk/bsd.suffixes.mk @@ -4,14 +4,6 @@ cp -f ${.IMPSRC} ${.TARGET} chmod a+x ${.TARGET} -.c.ln: - ${LINT} ${LINTOBJFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} || \ - touch ${.TARGET} - -.cc.ln .C.ln .cpp.ln .cxx.ln: - ${LINT} ${LINTOBJFLAGS} ${CXXFLAGS:M-[DIU]*} ${.IMPSRC} || \ - touch ${.TARGET} - .c: ${CC} ${CFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET} ${CTFCONVERT_CMD} diff --git a/share/mk/sys.mk b/share/mk/sys.mk index eace8fe306ec..c32a9fc671f1 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -142,7 +142,7 @@ NO_META_IGNORE_HOST_HEADERS= 1 .if defined(%POSIX) .SUFFIXES: .o .c .y .l .a .sh .f .else -.SUFFIXES: .out .a .ln .o .bco .llo .c .cc .cpp .cxx .C .m .F .f .e .r .y .l .S .asm .s .cl .p .h .sh +.SUFFIXES: .out .a .o .bco .llo .c .cc .cpp .cxx .C .m .F .f .e .r .y .l .S .asm .s .cl .p .h .sh .endif AR ?= ar @@ -245,13 +245,6 @@ LD ?= ld LDFLAGS ?= _LDFLAGS = ${LDFLAGS:S/-Wl,//g:N-mabi=*:N-fuse-ld=*} -LINT ?= lint -LINTFLAGS ?= -cghapbx -LINTKERNFLAGS ?= ${LINTFLAGS} -LINTOBJFLAGS ?= -cghapbxu -i -LINTOBJKERNFLAGS?= ${LINTOBJFLAGS} -LINTLIBFLAGS ?= -cghapbxu -C ${LIB} - MAKE ?= make .if !defined(%POSIX) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 204b8203d6e4..7e56c6b74cab 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -228,7 +228,7 @@ PHONY_NOTMAIN = afterdepend afterinstall all beforedepend beforeinstall \ beforelinking build build-tools buildfiles buildincludes \ checkdpadd clean cleandepend cleandir cleanobj configure \ depend distclean distribute exe \ - html includes install installfiles installincludes lint \ + html includes install installfiles installincludes \ obj objlink objs objwarn \ realinstall regress \ tags whereobj diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index 9a6905b73e8a..d605e5460696 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -153,7 +153,6 @@ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o OBJS_DEPEND_GUESS+= assym.s vnode_if.h ${BEFORE_DEPEND:M*.h} \ ${MFILES:T:S/.m$/.h/} -LNFILES= ${CFILES:T:S/.c$/.ln/} .for mfile in ${MFILES} # XXX the low quality .m.o rules gnerated by config are normally used @@ -167,15 +166,11 @@ ${mfile:T:S/.m$/.h/}: ${mfile} kernel-clean: rm -f *.o *.so *.pico *.ko *.s eddep errs \ ${FULLKERNEL} ${KERNEL_KO} ${KERNEL_KO}.debug \ - linterrs tags vers.c \ + tags vers.c \ vnode_if.c vnode_if.h vnode_if_newproto.h vnode_if_typedef.h \ ${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \ ${CLEAN} -lint: ${LNFILES} - ${LINT} ${LINTKERNFLAGS} ${CFLAGS:M-[DILU]*} ${.ALLSRC} 2>&1 | \ - tee -a linterrs - # This is a hack. BFD "optimizes" away dynamic mode if there are no # dynamic references. We could probably do a '-Bforcedynamic' mode like # in the a.out ld. For now, this works. @@ -365,9 +360,6 @@ config.o env.o hints.o vers.o vnode_if.o: ${NORMAL_C} ${NORMAL_CTFCONVERT} -config.ln env.ln hints.ln vers.ln vnode_if.ln: - ${NORMAL_LINT} - .if ${MK_REPRODUCIBLE_BUILD} != "no" REPRO_FLAG="-r" .endif diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index 473ab573c47b..28528b095300 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -46,7 +46,6 @@ M= ${MACHINE} AWK?= awk CP?= cp -LINT?= lint NM?= nm OBJCOPY?= objcopy SIZE?= size @@ -121,9 +120,6 @@ CFLAGS+= ${CONF_CFLAGS} LDFLAGS+= -Wl,--build-id=sha1 .endif -# Optional linting. This can be overridden in /etc/make.conf. -LINTFLAGS= ${LINTOBJKERNFLAGS} - NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC} NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} PROFILE_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC} @@ -176,8 +172,6 @@ NORMAL_CTFCONVERT= NORMAL_CTFCONVERT= @: .endif -NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} - # Linux Kernel Programming Interface C-flags LINUXKPI_INCLUDES= -I$S/compat/linuxkpi/common/include LINUXKPI_C= ${NORMAL_C} ${LINUXKPI_INCLUDES} diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 6c391e2b1d14..0e35aa26ac83 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -469,9 +469,6 @@ genassym.o: ${SRCS:Mopt_*.h} ${SYSDIR}/${MACHINE}/${MACHINE}/genassym.c .endif -lint: ${SRCS} - ${LINT} ${LINTKERNFLAGS} ${CFLAGS:M-[DILU]*} ${.ALLSRC:M*.c} - .if defined(KERNBUILDDIR) ${OBJS}: opt_global.h .endif diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index 1b93b5a85ef6..4f7148b005bb 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -690,18 +690,11 @@ do_rules(FILE *f) continue; } if (ftp->f_depends) { - fprintf(f, "%s%sln: $S/%s%c %s\n", - ftp->f_objprefix, tail(np), np, och, - ftp->f_depends); - fprintf(f, "\t${NORMAL_LINT}\n\n"); fprintf(f, "%s%so: $S/%s%c %s\n", ftp->f_objprefix, tail(np), np, och, ftp->f_depends); } else { - fprintf(f, "%s%sln: $S/%s%c\n", - ftp->f_objprefix, tail(np), np, och); - fprintf(f, "\t${NORMAL_LINT}\n\n"); fprintf(f, "%s%so: $S/%s%c\n", ftp->f_objprefix, tail(np), np, och); } From 1bf59a71c7b95a3c518fa03ecea183e7afc7d5fd Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 17 Nov 2017 18:34:14 +0000 Subject: [PATCH 54/92] Fix 'local' to not look in the source tree for the file. Usually 'local' is used along with other rules such as 'no-implicit-rule' or 'dependency' which avoids this problem. It's possible to need to use 'local' while relying on the default rules though for a file which is not in the source tree nor generated in the kernel. Sponsored by: Dell Differential Revision: https://reviews.freebsd.org/D13125 --- usr.sbin/config/config.h | 1 + usr.sbin/config/configvers.h | 2 +- usr.sbin/config/mkmakefile.c | 30 ++++++++++++++++++------------ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h index d6b2f62ea151..4ce4eb39cdf2 100644 --- a/usr.sbin/config/config.h +++ b/usr.sbin/config/config.h @@ -54,6 +54,7 @@ struct file_list { char *f_clean; /* File list to add to clean rule */ char *f_warn; /* warning message */ const char *f_objprefix; /* prefix string for object name */ + const char *f_srcprefix; /* source prefix such as $S/ */ }; struct files_name { diff --git a/usr.sbin/config/configvers.h b/usr.sbin/config/configvers.h index 5c2937311d70..993fb9403cf0 100644 --- a/usr.sbin/config/configvers.h +++ b/usr.sbin/config/configvers.h @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600014 +#define CONFIGVERS 600015 #define MAJOR_VERS(x) ((x) / 100000) diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index 4f7148b005bb..d1c397e5c547 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -496,6 +496,10 @@ nextparam:; tp = new_fent(); tp->f_fn = this; tp->f_type = filetype; + if (filetype == LOCAL) + tp->f_srcprefix = ""; + else + tp->f_srcprefix = "$S/"; if (imp_rule) tp->f_flags |= NO_IMPLCT_RULE; if (no_obj) @@ -571,7 +575,8 @@ do_before_depend(FILE *fp) if (tp->f_flags & NO_IMPLCT_RULE) fprintf(fp, "%s ", tp->f_fn); else - fprintf(fp, "$S/%s ", tp->f_fn); + fprintf(fp, "%s%s ", tp->f_srcprefix, + tp->f_fn); lpos += len + 1; } if (lpos != 8) @@ -636,10 +641,7 @@ do_xxfiles(char *tag, FILE *fp) lpos = 8; fputs("\\\n\t", fp); } - if (tp->f_type != LOCAL) - fprintf(fp, "$S/%s ", tp->f_fn); - else - fprintf(fp, "%s ", tp->f_fn); + fprintf(fp, "%s%s ", tp->f_srcprefix, tp->f_fn); lpos += len + 1; } free(suff); @@ -685,18 +687,21 @@ do_rules(FILE *f) else { *cp = '\0'; if (och == 'o') { - fprintf(f, "%s%so:\n\t-cp $S/%so .\n\n", - ftp->f_objprefix, tail(np), np); + fprintf(f, "%s%so:\n\t-cp %s%so .\n\n", + ftp->f_objprefix, tail(np), + ftp->f_srcprefix, np); continue; } if (ftp->f_depends) { - fprintf(f, "%s%so: $S/%s%c %s\n", - ftp->f_objprefix, tail(np), np, och, + fprintf(f, "%s%so: %s%s%c %s\n", + ftp->f_objprefix, tail(np), + ftp->f_srcprefix, np, och, ftp->f_depends); } else { - fprintf(f, "%s%so: $S/%s%c\n", - ftp->f_objprefix, tail(np), np, och); + fprintf(f, "%s%so: %s%s%c\n", + ftp->f_objprefix, tail(np), + ftp->f_srcprefix, np, och); } } compilewith = ftp->f_compilewith; @@ -725,7 +730,8 @@ do_rules(FILE *f) } *cp = och; if (strlen(ftp->f_objprefix)) - fprintf(f, "\t%s $S/%s\n", compilewith, np); + fprintf(f, "\t%s %s%s\n", compilewith, + ftp->f_srcprefix, np); else fprintf(f, "\t%s\n", compilewith); From d7ff64a9b1ad6daca07e2e2956d36ea8dc4f3ca2 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 17 Nov 2017 19:10:10 +0000 Subject: [PATCH 55/92] Bump dates after lint removal. Noted by: wblock Sponsored by: The FreeBSD Foundation --- share/man/man7/hier.7 | 2 +- share/man/man9/style.9 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/hier.7 b/share/man/man7/hier.7 index 47e816294568..e41953d60318 100644 --- a/share/man/man7/hier.7 +++ b/share/man/man7/hier.7 @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 10, 2017 +.Dd November 16, 2017 .Dt HIER 7 .Os .Sh NAME diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index bdd120456ffe..f008a7d613e6 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -26,7 +26,7 @@ .\" From: @(#)style 1.14 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd November 16, 2017 .Dt STYLE 9 .Os .Sh NAME From 38d84d683e0d615a0d0c3217090299ac30146bdf Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Fri, 17 Nov 2017 19:25:39 +0000 Subject: [PATCH 56/92] vfs_lookup: Allow PATH_MAX-1 symlinks Previously, symlinks in FreeBSD were artificially limited to PATH_MAX-2. Add a short test case to verify the change. Submitted by: Gaurav Gangalwar Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12589 --- sys/kern/vfs_lookup.c | 2 +- tests/sys/vfs/Makefile | 2 ++ tests/sys/vfs/lookup_test.sh | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/sys/vfs/lookup_test.sh diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 09503e4ca477..c70329602226 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -499,7 +499,7 @@ namei(struct nameidata *ndp) error = ENOENT; break; } - if (linklen + ndp->ni_pathlen >= MAXPATHLEN) { + if (linklen + ndp->ni_pathlen > MAXPATHLEN) { if (ndp->ni_pathlen > 1) uma_zfree(namei_zone, cp); error = ENAMETOOLONG; diff --git a/tests/sys/vfs/Makefile b/tests/sys/vfs/Makefile index ec1e66b5042f..f4b4bdd946dd 100644 --- a/tests/sys/vfs/Makefile +++ b/tests/sys/vfs/Makefile @@ -7,6 +7,8 @@ TESTSDIR= ${TESTSBASE}/sys/vfs ATF_TESTS_C+= lookup_cap_dotdot CFLAGS.lookup_cap_dotdot.c+= -I${SRCTOP}/tests +#ATF_TESTS_SH+= lookup_test + TAP_TESTS_SH+= trailing_slash .include diff --git a/tests/sys/vfs/lookup_test.sh b/tests/sys/vfs/lookup_test.sh new file mode 100644 index 000000000000..909afddda8d6 --- /dev/null +++ b/tests/sys/vfs/lookup_test.sh @@ -0,0 +1,17 @@ +# $FreeBSD$ + +long_symlink_head() +{ + atf_set "descr" "Test for 1023 (PATH_MAX-1) symlink support" +} +long_symlink_body() +{ + atf_check -s exit:0 ln -s aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa sym_long + # was: "stat: sym_long: stat: File name too long"; exit 1 + atf_check -s exit:0 -o ignore stat -L sym_long +} + +atf_init_test_cases() +{ + atf_add_test_case long_symlink +} From 18f23540d83bede52b2b553e7c5cc76aecf7ecdc Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 20:41:17 +0000 Subject: [PATCH 57/92] lockmgr: remove the ADAPTIVE_LOCKMGRS option The code was never enabled and is very heavy weight. A revamped adaptive spinning may show up at a later time. Discussed with: kib --- share/man/man9/lock.9 | 5 +- sys/conf/options | 1 - sys/kern/kern_lock.c | 189 ------------------------------------------ 3 files changed, 1 insertion(+), 194 deletions(-) diff --git a/share/man/man9/lock.9 b/share/man/man9/lock.9 index 001c5f182120..ef2380ae3f31 100644 --- a/share/man/man9/lock.9 +++ b/share/man/man9/lock.9 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 2, 2014 +.Dd November 17, 2017 .Dt LOCK 9 .Os .Sh NAME @@ -93,9 +93,6 @@ The timeout value passed to .It Fa flags The flags the lock is to be initialized with: .Bl -tag -width ".Dv LK_CANRECURSE" -.It Dv LK_ADAPTIVE -Enable adaptive spinning for this lock if the kernel is compiled with the -ADAPTIVE_LOCKMGRS option. .It Dv LK_CANRECURSE Allow recursive exclusive locks. .It Dv LK_NOPROFILE diff --git a/sys/conf/options b/sys/conf/options index b0cd0629aca5..0b57f3daced5 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -69,7 +69,6 @@ TEXTDUMP_VERBOSE opt_ddb.h NUM_CORE_FILES opt_global.h # Miscellaneous options. -ADAPTIVE_LOCKMGRS ALQ ALTERA_SDCARD_FAST_SIM opt_altera_sdcard.h ATSE_CFI_HACK opt_cfi.h diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 13a8ca9cff27..66df268186b3 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -26,7 +26,6 @@ * DAMAGE. */ -#include "opt_adaptive_lockmgrs.h" #include "opt_ddb.h" #include "opt_hwpmc_hooks.h" @@ -159,15 +158,6 @@ struct lock_class lock_class_lockmgr = { #endif }; -#ifdef ADAPTIVE_LOCKMGRS -static u_int alk_retries = 10; -static u_int alk_loops = 10000; -static SYSCTL_NODE(_debug, OID_AUTO, lockmgr, CTLFLAG_RD, NULL, - "lockmgr debugging"); -SYSCTL_UINT(_debug_lockmgr, OID_AUTO, retries, CTLFLAG_RW, &alk_retries, 0, ""); -SYSCTL_UINT(_debug_lockmgr, OID_AUTO, loops, CTLFLAG_RW, &alk_loops, 0, ""); -#endif - static bool __always_inline lockmgr_slock_try(struct lock *lk, uintptr_t *xp, int flags); static bool __always_inline lockmgr_sunlock_try(struct lock *lk, uintptr_t x); @@ -661,10 +651,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, uint64_t waittime = 0; int contested = 0; #endif -#ifdef ADAPTIVE_LOCKMGRS - volatile struct thread *owner; - u_int i, spintries = 0; -#endif error = 0; tid = (uintptr_t)curthread; @@ -748,75 +734,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, break; } -#ifdef ADAPTIVE_LOCKMGRS - /* - * If the owner is running on another CPU, spin until - * the owner stops running or the state of the lock - * changes. We need a double-state handle here - * because for a failed acquisition the lock can be - * either held in exclusive mode or shared mode - * (for the writer starvation avoidance technique). - */ - if (LK_CAN_ADAPT(lk, flags) && (x & LK_SHARE) == 0 && - LK_HOLDER(x) != LK_KERNPROC) { - owner = (struct thread *)LK_HOLDER(x); - if (LOCK_LOG_TEST(&lk->lock_object, 0)) - CTR3(KTR_LOCK, - "%s: spinning on %p held by %p", - __func__, lk, owner); - KTR_STATE1(KTR_SCHED, "thread", - sched_tdname(td), "spinning", - "lockname:\"%s\"", lk->lock_object.lo_name); - - /* - * If we are holding also an interlock drop it - * in order to avoid a deadlock if the lockmgr - * owner is adaptively spinning on the - * interlock itself. - */ - if (flags & LK_INTERLOCK) { - class->lc_unlock(ilk); - flags &= ~LK_INTERLOCK; - } - GIANT_SAVE(); - while (LK_HOLDER(lk->lk_lock) == - (uintptr_t)owner && TD_IS_RUNNING(owner)) - cpu_spinwait(); - KTR_STATE0(KTR_SCHED, "thread", - sched_tdname(td), "running"); - GIANT_RESTORE(); - continue; - } else if (LK_CAN_ADAPT(lk, flags) && - (x & LK_SHARE) != 0 && LK_SHARERS(x) && - spintries < alk_retries) { - KTR_STATE1(KTR_SCHED, "thread", - sched_tdname(td), "spinning", - "lockname:\"%s\"", lk->lock_object.lo_name); - if (flags & LK_INTERLOCK) { - class->lc_unlock(ilk); - flags &= ~LK_INTERLOCK; - } - GIANT_SAVE(); - spintries++; - for (i = 0; i < alk_loops; i++) { - if (LOCK_LOG_TEST(&lk->lock_object, 0)) - CTR4(KTR_LOCK, - "%s: shared spinning on %p with %u and %u", - __func__, lk, spintries, i); - x = lk->lk_lock; - if ((x & LK_SHARE) == 0 || - LK_CAN_SHARE(x, flags) != 0) - break; - cpu_spinwait(); - } - KTR_STATE0(KTR_SCHED, "thread", - sched_tdname(td), "running"); - GIANT_RESTORE(); - if (i != alk_loops) - continue; - } -#endif - /* * Acquire the sleepqueue chain lock because we * probabilly will need to manipulate waiters flags. @@ -833,24 +750,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, continue; } -#ifdef ADAPTIVE_LOCKMGRS - /* - * The current lock owner might have started executing - * on another CPU (or the lock could have changed - * owner) while we were waiting on the turnstile - * chain lock. If so, drop the turnstile lock and try - * again. - */ - if (LK_CAN_ADAPT(lk, flags) && (x & LK_SHARE) == 0 && - LK_HOLDER(x) != LK_KERNPROC) { - owner = (struct thread *)LK_HOLDER(x); - if (TD_IS_RUNNING(owner)) { - sleepq_release(&lk->lock_object); - continue; - } - } -#endif - /* * Try to set the LK_SHARED_WAITERS flag. If we fail, * loop back and retry. @@ -992,76 +891,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, break; } -#ifdef ADAPTIVE_LOCKMGRS - /* - * If the owner is running on another CPU, spin until - * the owner stops running or the state of the lock - * changes. - */ - x = lk->lk_lock; - if (LK_CAN_ADAPT(lk, flags) && (x & LK_SHARE) == 0 && - LK_HOLDER(x) != LK_KERNPROC) { - owner = (struct thread *)LK_HOLDER(x); - if (LOCK_LOG_TEST(&lk->lock_object, 0)) - CTR3(KTR_LOCK, - "%s: spinning on %p held by %p", - __func__, lk, owner); - KTR_STATE1(KTR_SCHED, "thread", - sched_tdname(td), "spinning", - "lockname:\"%s\"", lk->lock_object.lo_name); - - /* - * If we are holding also an interlock drop it - * in order to avoid a deadlock if the lockmgr - * owner is adaptively spinning on the - * interlock itself. - */ - if (flags & LK_INTERLOCK) { - class->lc_unlock(ilk); - flags &= ~LK_INTERLOCK; - } - GIANT_SAVE(); - while (LK_HOLDER(lk->lk_lock) == - (uintptr_t)owner && TD_IS_RUNNING(owner)) - cpu_spinwait(); - KTR_STATE0(KTR_SCHED, "thread", - sched_tdname(td), "running"); - GIANT_RESTORE(); - continue; - } else if (LK_CAN_ADAPT(lk, flags) && - (x & LK_SHARE) != 0 && LK_SHARERS(x) && - spintries < alk_retries) { - if ((x & LK_EXCLUSIVE_SPINNERS) == 0 && - !atomic_cmpset_ptr(&lk->lk_lock, x, - x | LK_EXCLUSIVE_SPINNERS)) - continue; - KTR_STATE1(KTR_SCHED, "thread", - sched_tdname(td), "spinning", - "lockname:\"%s\"", lk->lock_object.lo_name); - if (flags & LK_INTERLOCK) { - class->lc_unlock(ilk); - flags &= ~LK_INTERLOCK; - } - GIANT_SAVE(); - spintries++; - for (i = 0; i < alk_loops; i++) { - if (LOCK_LOG_TEST(&lk->lock_object, 0)) - CTR4(KTR_LOCK, - "%s: shared spinning on %p with %u and %u", - __func__, lk, spintries, i); - if ((lk->lk_lock & - LK_EXCLUSIVE_SPINNERS) == 0) - break; - cpu_spinwait(); - } - KTR_STATE0(KTR_SCHED, "thread", - sched_tdname(td), "running"); - GIANT_RESTORE(); - if (i != alk_loops) - continue; - } -#endif - /* * Acquire the sleepqueue chain lock because we * probabilly will need to manipulate waiters flags. @@ -1078,24 +907,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, continue; } -#ifdef ADAPTIVE_LOCKMGRS - /* - * The current lock owner might have started executing - * on another CPU (or the lock could have changed - * owner) while we were waiting on the turnstile - * chain lock. If so, drop the turnstile lock and try - * again. - */ - if (LK_CAN_ADAPT(lk, flags) && (x & LK_SHARE) == 0 && - LK_HOLDER(x) != LK_KERNPROC) { - owner = (struct thread *)LK_HOLDER(x); - if (TD_IS_RUNNING(owner)) { - sleepq_release(&lk->lock_object); - continue; - } - } -#endif - /* * The lock can be in the state where there is a * pending queue of waiters, but still no owner. From 1a69c11aab1a9bb5c36e2dc851ba933c3246c144 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Fri, 17 Nov 2017 20:53:52 +0000 Subject: [PATCH 58/92] Add assertion in probedone() that we're holding the device lock. Submitted by: ken Reviewed by: asomers MFC after: 3 weeks Sponsored by: Spectra Logic Corp --- sys/cam/scsi/scsi_xpt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 1dd167cd92d4..4fd25b2a101e 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1171,6 +1171,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) softc = (probe_softc *)periph->softc; path = done_ccb->ccb_h.path; priority = done_ccb->ccb_h.pinfo.priority; + cam_periph_assert(periph, MA_OWNED); switch (softc->action) { case PROBE_TUR: From e11f0a0c4cb237f9442d0f3c68a1cca3db3a1136 Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Fri, 17 Nov 2017 22:40:02 +0000 Subject: [PATCH 59/92] Unconditionally enable support for O_IPSEC opcode. IPsec support can be loaded as kernel module, thus do not depend from kernel option IPSEC and always build O_IPSEC opcode implementation as enabled. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC --- sys/modules/ipfw/Makefile | 2 +- sys/netpfil/ipfw/ip_fw2.c | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/modules/ipfw/Makefile b/sys/modules/ipfw/Makefile index 1b0e79a4c3fd..06a95ecba502 100644 --- a/sys/modules/ipfw/Makefile +++ b/sys/modules/ipfw/Makefile @@ -7,7 +7,7 @@ SRCS= ip_fw2.c ip_fw_pfil.c ip_fw_bpf.c SRCS+= ip_fw_dynamic.c ip_fw_log.c ip_fw_eaction.c SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo.c ip_fw_iface.c SRCS+= ip_fw_table_value.c -SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h opt_ipsec.h +SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h CFLAGS+= -DIPFIREWALL # diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index 46c58bed5821..1d3ef52343d0 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #error "IPFIREWALL requires INET" #endif /* INET */ #include "opt_inet6.h" -#include "opt_ipsec.h" #include #include @@ -1945,10 +1944,8 @@ do { \ break; case O_IPSEC: -#ifdef IPSEC match = (m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL) != NULL); -#endif /* otherwise no match */ break; @@ -2563,7 +2560,7 @@ do { \ case O_NAT: l = 0; /* exit inner loop */ done = 1; /* exit outer loop */ - if (!IPFW_NAT_LOADED) { + if (!is_ipv4 || !IPFW_NAT_LOADED) { retval = IP_FW_DENY; break; } From 879462e916b7e7a0f1acb6933846db52366832e7 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Fri, 17 Nov 2017 23:22:39 +0000 Subject: [PATCH 60/92] cxgbe(4): Add core Vdd to the sysctl MIB. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/common.h | 1 + sys/dev/cxgbe/t4_main.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index c34f57ad9c18..4d46c3169c8b 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -332,6 +332,7 @@ struct adapter_params { struct devlog_params devlog; /* PF-only */ struct rss_params rss; /* VF-only */ struct vf_resources vfres; /* VF-only */ + unsigned int core_vdd; unsigned int sf_size; /* serial flash size in bytes */ unsigned int sf_nsec; /* # of flash sectors */ diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index d377ef7013ee..d1f0036ec197 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -3435,7 +3435,10 @@ get_params__post_init(struct adapter *sc) param[3] = FW_PARAM_PFVF(FILTER_END); param[4] = FW_PARAM_PFVF(L2T_START); param[5] = FW_PARAM_PFVF(L2T_END); - rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 6, param, val); + param[6] = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_DIAG) | + V_FW_PARAMS_PARAM_Y(FW_PARAM_DEV_DIAG_VDD); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 7, param, val); if (rc != 0) { device_printf(sc->dev, "failed to query parameters (post_init): %d.\n", rc); @@ -3453,6 +3456,7 @@ get_params__post_init(struct adapter *sc) KASSERT(sc->vres.l2t.size <= L2T_SIZE, ("%s: L2 table size (%u) larger than expected (%u)", __func__, sc->vres.l2t.size, L2T_SIZE)); + sc->params.core_vdd = val[6]; /* * MPSBGMAP is queried separately because only recent firmwares support @@ -5160,6 +5164,9 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RD, sc, 0, sysctl_temperature, "I", "chip temperature (in Celsius)"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_vdd", CTLFLAG_RD, + &sc->params.core_vdd, 0, "core Vdd (in mV)"); + #ifdef SBUF_DRAIN /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. From 66f84fabb33892cc941ded8c07de2b8c6523fd10 Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Fri, 17 Nov 2017 23:25:06 +0000 Subject: [PATCH 61/92] Add comment for accidentally committed unrelated change in r325960. Do not invoke IPv4 NAT handler for non IPv4 packets. Libalias expects a packet is IPv4. And in case when it is IPv6, it just translates them as IPv4. This leads to corruption and in some cases to panics. In particular a panic can happen when value of ip6_plen modified to something that leads to IP fragmentation, but actual packet length does not match the IP length. Packets that are not IPv4 will be dropped by NAT rule. Reported by: Viktor Dukhovni MFC after: 1 week --- sys/netpfil/ipfw/ip_fw2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/ipfw/ip_fw2.c b/sys/netpfil/ipfw/ip_fw2.c index 1d3ef52343d0..065aaae3aad5 100644 --- a/sys/netpfil/ipfw/ip_fw2.c +++ b/sys/netpfil/ipfw/ip_fw2.c @@ -2560,6 +2560,10 @@ do { \ case O_NAT: l = 0; /* exit inner loop */ done = 1; /* exit outer loop */ + /* + * Ensure that we do not invoke NAT handler for + * non IPv4 packets. Libalias expects only IPv4. + */ if (!is_ipv4 || !IPFW_NAT_LOADED) { retval = IP_FW_DENY; break; From 284194f183196a48200fecabe11bcfc09800b80f Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 17 Nov 2017 23:27:06 +0000 Subject: [PATCH 62/92] locks: fix compilation issues without SMP or KDTRACE_HOOKS --- sys/kern/kern_mutex.c | 5 +++-- sys/kern/kern_sx.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 063456ec9f97..9438bf583e21 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -462,9 +462,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) struct mtx *m; struct turnstile *ts; uintptr_t tid; -#ifdef ADAPTIVE_MUTEXES struct thread *owner; -#endif #ifdef KTR int cont_logged = 0; #endif @@ -628,6 +626,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) */ #ifdef KDTRACE_HOOKS sleep_time -= lockstat_nsecs(&m->lock_object); +#endif +#ifndef ADAPTIVE_MUTEXES + owner = mtx_owner(m); #endif MPASS(owner == mtx_owner(m)); turnstile_wait(ts, owner, TS_EXCLUSIVE_QUEUE); diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index 6629b0a63fdd..a5c2c801b414 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -520,8 +520,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) uintptr_t state; - int extra_work; #endif + int extra_work = 0; if (SCHEDULER_STOPPED()) return (0); @@ -880,8 +880,8 @@ _sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) uintptr_t state; - int extra_work; #endif + int extra_work = 0; if (SCHEDULER_STOPPED()) return (0); From 95197f47ff11839afd791a880394d466fd09eae9 Mon Sep 17 00:00:00 2001 From: Bjoern Heidotting Date: Sat, 18 Nov 2017 11:58:35 +0000 Subject: [PATCH 63/92] Remove leftover in lagg(4) manpage forgotten in r271733 Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D13061 --- share/man/man4/lagg.4 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/share/man/man4/lagg.4 b/share/man/man4/lagg.4 index 71f92212250b..aabdabf2d2f6 100644 --- a/share/man/man4/lagg.4 +++ b/share/man/man4/lagg.4 @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2016 +.Dd November 18, 2017 .Dt LAGG 4 .Os .Sh NAME @@ -86,8 +86,6 @@ This constraint can be relaxed by setting the .Xr sysctl 8 variable to a nonzero value, which is useful for certain bridged network setups. -.Ic loadbalance -mode. .It Ic lacp Supports the IEEE 802.1AX (formerly 802.3ad) Link Aggregation Control Protocol (LACP) and the Marker Protocol. From ef4968d9e7c3b90c1499a32a38fdc34f4da22f41 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Sat, 18 Nov 2017 13:21:22 +0000 Subject: [PATCH 64/92] Increase rtld initial memory pool size from 32kB to 128kB. The old value was probably fine back in 1998, when that code was imported (although the comments still mention VAX, which was quite obsolete by then); now, however, it's too small to handle our libc, which results in some additional calls to munmap/mmap later on. Asking for more virtual address space is virtually free, and syscalls are not, thus the change. It was suggested by kib@ that this might be a symptom of a deeper problem. It doesn't only affect libc, though - the change also improves rtld memory management for eg KDE libraries. I guess it's just a natural bloat. MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12834 --- libexec/rtld-elf/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/malloc.c b/libexec/rtld-elf/malloc.c index 66938d005a5e..d7934d143174 100644 --- a/libexec/rtld-elf/malloc.c +++ b/libexec/rtld-elf/malloc.c @@ -61,7 +61,7 @@ static int findbucket(); /* * Pre-allocate mmap'ed pages */ -#define NPOOLPAGES (32*1024/pagesz) +#define NPOOLPAGES (128*1024/pagesz) static caddr_t pagepool_start, pagepool_end; static int morepages(); From df57947f083046d50552e99b91074927d2458708 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Sat, 18 Nov 2017 14:26:50 +0000 Subject: [PATCH 65/92] spdx: initial adoption of licensing ID tags. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 --- lib/libc/arm/gen/fabs.c | 4 +++- lib/libc/locale/euc.c | 2 ++ lib/libc/mips/SYS.h | 2 ++ lib/libc/mips/gen/fabs.c | 4 +++- lib/libc/net/ether_addr.c | 4 +++- lib/libc/rpc/crypt_client.c | 4 +++- lib/libcam/camlib.h | 4 +++- lib/libcam/scsi_cmdparse.c | 5 ++++- lib/libkiconv/xlat16_sysctl.c | 4 +++- lib/libprocstat/cd9660.c | 2 ++ lib/libprocstat/common_kvm.c | 2 ++ lib/libprocstat/libprocstat.c | 2 ++ lib/libprocstat/msdosfs.c | 4 +++- lib/librpcsvc/yp_passwd.c | 4 +++- lib/librpcsvc/yp_update.c | 4 +++- lib/libthr/sys/thr_error.c | 4 +++- lib/libthr/thread/thr_attr.c | 4 +++- lib/libthr/thread/thr_autoinit.c | 4 +++- lib/libthr/thread/thr_concurrency.c | 4 +++- lib/libthr/thread/thr_getschedparam.c | 4 +++- lib/libthr/thread/thr_init.c | 4 +++- lib/libthr/thread/thr_mutex.c | 4 +++- lib/libthr/thread/thr_setschedparam.c | 4 +++- lib/libthr/thread/thr_switch_np.c | 4 +++- lib/msun/bsdsrc/b_exp.c | 4 +++- lib/msun/bsdsrc/b_log.c | 4 +++- lib/msun/bsdsrc/b_tgamma.c | 2 ++ lib/msun/bsdsrc/mathimpl.h | 4 +++- libexec/mknetid/hash.c | 4 +++- libexec/mknetid/hash.h | 4 +++- libexec/mknetid/mknetid.c | 4 +++- libexec/revnetgroup/hash.c | 4 +++- libexec/revnetgroup/hash.h | 4 +++- libexec/revnetgroup/revnetgroup.c | 4 +++- libexec/ypxfr/yp_dbwrite.c | 4 +++- libexec/ypxfr/ypxfr_extern.h | 4 +++- libexec/ypxfr/ypxfr_getmap.c | 4 +++- libexec/ypxfr/ypxfr_main.c | 4 +++- libexec/ypxfr/ypxfr_misc.c | 4 +++- libexec/ypxfr/ypxfrd_getmap.c | 4 +++- release/picobsd/tinyware/login/pathnames.h | 2 ++ release/picobsd/tinyware/login/pico-login.c | 2 ++ release/picobsd/tinyware/passwd/extern.h | 4 +++- release/picobsd/tinyware/passwd/local_passwd.c | 2 ++ release/picobsd/tinyware/passwd/passwd.c | 4 +++- release/picobsd/tinyware/passwd/pw_copy.c | 2 ++ release/picobsd/tinyware/passwd/pw_util.c | 2 ++ release/picobsd/tinyware/passwd/pw_util.h | 2 ++ sbin/bsdlabel/bsdlabel.c | 4 +++- sbin/etherswitchcfg/ifmedia.c | 4 +++- sbin/ffsinfo/ffsinfo.c | 4 +++- sbin/growfs/debug.c | 4 +++- sbin/growfs/debug.h | 4 +++- sbin/growfs/growfs.c | 4 +++- sbin/gvinum/gvinum.h | 2 ++ sbin/ifconfig/ifmedia.c | 4 +++- sbin/ifconfig/ifvlan.c | 4 +++- sbin/rcorder/ealloc.c | 4 +++- sbin/rcorder/hash.c | 4 +++- sbin/rcorder/hash.h | 4 +++- sbin/rcorder/sprite.h | 5 ++++- sys/amd64/amd64/in_cksum.c | 2 ++ sys/amd64/amd64/machdep.c | 2 ++ sys/amd64/amd64/pmap.c | 2 ++ sys/amd64/amd64/trap.c | 2 ++ sys/amd64/amd64/vm_machdep.c | 2 ++ sys/amd64/ia32/ia32_syscall.c | 2 ++ sys/amd64/include/floatingpoint.h | 2 ++ sys/amd64/include/ieeefp.h | 2 ++ sys/amd64/include/param.h | 2 ++ sys/amd64/include/varargs.h | 2 ++ sys/amd64/include/vmparam.h | 2 ++ sys/arm/arm/autoconf.c | 2 ++ sys/arm/arm/in_cksum.c | 2 ++ sys/arm/arm/vm_machdep.c | 2 ++ sys/arm/include/_align.h | 2 ++ sys/arm/include/_types.h | 2 ++ sys/arm/include/floatingpoint.h | 2 ++ sys/arm/include/param.h | 2 ++ sys/arm/include/proc.h | 2 ++ sys/arm/include/profile.h | 2 ++ sys/arm/include/reloc.h | 2 ++ sys/compat/linprocfs/linprocfs.c | 2 ++ sys/compat/ndis/cfg_var.h | 2 ++ sys/compat/ndis/hal_var.h | 2 ++ sys/compat/ndis/kern_ndis.c | 2 ++ sys/compat/ndis/kern_windrv.c | 2 ++ sys/compat/ndis/ndis_var.h | 2 ++ sys/compat/ndis/ntoskrnl_var.h | 2 ++ sys/compat/ndis/pe_var.h | 2 ++ sys/compat/ndis/resource_var.h | 2 ++ sys/compat/ndis/subr_hal.c | 2 ++ sys/compat/ndis/subr_ndis.c | 2 ++ sys/compat/ndis/subr_ntoskrnl.c | 2 ++ sys/compat/ndis/subr_pe.c | 2 ++ sys/compat/ndis/subr_usbd.c | 2 ++ sys/compat/ndis/usbd_var.h | 2 ++ sys/dev/an/if_aironet_ieee.h | 2 ++ sys/dev/an/if_an.c | 2 ++ sys/dev/an/if_an_isa.c | 2 ++ sys/dev/an/if_an_pccard.c | 2 ++ sys/dev/an/if_an_pci.c | 2 ++ sys/dev/an/if_anreg.h | 2 ++ sys/dev/bge/if_bge.c | 2 ++ sys/dev/bge/if_bgereg.h | 2 ++ sys/dev/dc/dcphy.c | 2 ++ sys/dev/dc/if_dc.c | 2 ++ sys/dev/dc/if_dcreg.h | 2 ++ sys/dev/dc/pnphy.c | 2 ++ sys/dev/dcons/dcons.c | 2 ++ sys/dev/dcons/dcons.h | 2 ++ sys/dev/dcons/dcons_crom.c | 2 ++ sys/dev/dcons/dcons_os.c | 2 ++ sys/dev/dcons/dcons_os.h | 2 ++ sys/dev/firewire/fwcrom.c | 2 ++ sys/dev/firewire/fwdma.c | 2 ++ sys/dev/firewire/fwdma.h | 2 ++ sys/dev/firewire/fwmem.c | 2 ++ sys/dev/firewire/fwmem.h | 2 ++ sys/dev/firewire/fwphyreg.h | 2 ++ sys/dev/firewire/if_fwe.c | 2 ++ sys/dev/firewire/if_fwevar.h | 2 ++ sys/dev/firewire/if_fwip.c | 2 ++ sys/dev/firewire/if_fwipvar.h | 2 ++ sys/dev/firewire/sbp_targ.c | 2 ++ sys/dev/ic/i82586.h | 2 ++ sys/dev/if_ndis/if_ndis.c | 2 ++ sys/dev/if_ndis/if_ndis_pccard.c | 2 ++ sys/dev/if_ndis/if_ndis_pci.c | 2 ++ sys/dev/if_ndis/if_ndis_usb.c | 2 ++ sys/dev/if_ndis/if_ndisvar.h | 2 ++ sys/dev/lge/if_lge.c | 2 ++ sys/dev/lge/if_lgereg.h | 2 ++ sys/dev/mii/amphy.c | 2 ++ sys/dev/mii/amphyreg.h | 2 ++ sys/dev/mii/brgphy.c | 2 ++ sys/dev/mii/brgphyreg.h | 2 ++ sys/dev/mii/ciphy.c | 2 ++ sys/dev/mii/ciphyreg.h | 2 ++ sys/dev/mii/mlphy.c | 2 ++ sys/dev/mii/nsgphyreg.h | 2 ++ sys/dev/mii/pnaphy.c | 2 ++ sys/dev/mii/rgephy.c | 2 ++ sys/dev/mii/rgephyreg.h | 2 ++ sys/dev/mii/rlphy.c | 2 ++ sys/dev/mii/rlswitch.c | 2 ++ sys/dev/mii/xmphy.c | 2 ++ sys/dev/mii/xmphyreg.h | 2 ++ sys/dev/msk/if_msk.c | 2 ++ sys/dev/msk/if_mskreg.h | 2 ++ sys/dev/nge/if_nge.c | 2 ++ sys/dev/nge/if_ngereg.h | 2 ++ sys/dev/pcn/if_pcn.c | 2 ++ sys/dev/pcn/if_pcnreg.h | 2 ++ sys/dev/ppbus/lpt.c | 2 ++ sys/dev/re/if_re.c | 2 ++ sys/dev/sf/if_sf.c | 2 ++ sys/dev/sf/if_sfreg.h | 2 ++ sys/dev/sge/if_sge.c | 2 ++ sys/dev/sge/if_sgereg.h | 2 ++ sys/dev/sis/if_sis.c | 2 ++ sys/dev/sis/if_sisreg.h | 2 ++ sys/dev/sk/if_sk.c | 2 ++ sys/dev/sk/if_skreg.h | 2 ++ sys/dev/sk/xmaciireg.h | 2 ++ sys/dev/ste/if_ste.c | 2 ++ sys/dev/ste/if_stereg.h | 2 ++ sys/dev/ti/if_ti.c | 2 ++ sys/dev/ti/if_tireg.h | 2 ++ sys/dev/tl/if_tl.c | 2 ++ sys/dev/tl/if_tlreg.h | 2 ++ sys/dev/txp/if_txp.c | 2 ++ sys/dev/usb/net/if_aue.c | 2 ++ sys/dev/usb/net/if_auereg.h | 2 ++ sys/dev/usb/net/if_axe.c | 2 ++ sys/dev/usb/net/if_axereg.h | 2 ++ sys/dev/usb/net/if_cdce.c | 2 ++ sys/dev/usb/net/if_cdcereg.h | 2 ++ sys/dev/usb/net/if_cue.c | 2 ++ sys/dev/usb/net/if_cuereg.h | 2 ++ sys/dev/usb/net/if_kue.c | 2 ++ sys/dev/usb/net/if_kuefw.h | 2 ++ sys/dev/usb/net/if_kuereg.h | 2 ++ sys/dev/usb/net/if_mosreg.h | 2 ++ sys/dev/usb/net/if_rue.c | 2 ++ sys/dev/vge/if_vge.c | 2 ++ sys/dev/vge/if_vgereg.h | 2 ++ sys/dev/vge/if_vgevar.h | 2 ++ sys/dev/vr/if_vr.c | 2 ++ sys/dev/vr/if_vrreg.h | 2 ++ sys/dev/wb/if_wb.c | 2 ++ sys/dev/wb/if_wbreg.h | 2 ++ sys/dev/wi/if_wavelan_ieee.h | 2 ++ sys/dev/wi/if_wi_macio.c | 2 ++ sys/dev/wi/if_wi_pccard.c | 2 ++ sys/dev/wi/if_wi_pci.c | 2 ++ sys/dev/wi/if_wireg.h | 2 ++ sys/dev/wi/if_wivar.h | 2 ++ sys/dev/xl/if_xl.c | 2 ++ sys/dev/xl/if_xlreg.h | 2 ++ sys/fs/procfs/procfs.c | 2 ++ sys/fs/procfs/procfs_rlimit.c | 2 ++ sys/geom/vinum/geom_vinum_share.c | 2 ++ sys/geom/vinum/geom_vinum_subr.c | 2 ++ sys/geom/vinum/geom_vinum_var.h | 4 +++- sys/i386/i386/longrun.c | 2 ++ sys/i386/i386/machdep.c | 2 ++ sys/i386/i386/pmap.c | 2 ++ sys/i386/i386/trap.c | 2 ++ sys/i386/i386/vm_machdep.c | 2 ++ sys/i386/ibcs2/ibcs2_misc.c | 2 ++ sys/i386/include/floatingpoint.h | 2 ++ sys/i386/include/ieeefp.h | 2 ++ sys/isa/pnpreg.h | 2 ++ sys/kern/init_main.c | 2 ++ sys/kern/kern_acct.c | 2 ++ sys/kern/ksched.c | 2 ++ sys/kern/p1003_1b.c | 2 ++ sys/kern/posix4_mib.c | 2 ++ sys/kern/subr_syscall.c | 2 ++ sys/kern/subr_trap.c | 2 ++ sys/libkern/strcasecmp.c | 2 ++ sys/libkern/strstr.c | 2 ++ sys/mips/include/_types.h | 2 ++ sys/mips/include/cpuinfo.h | 2 ++ sys/mips/include/floatingpoint.h | 2 ++ sys/mips/include/reloc.h | 2 ++ sys/mips/mips/db_disasm.c | 2 ++ sys/mips/mips/in_cksum.c | 2 ++ sys/mips/mips/sys_machdep.c | 2 ++ sys/net/fddi.h | 2 ++ sys/net/if_arcsubr.c | 2 ++ sys/net/if_fddisubr.c | 2 ++ sys/netinet6/ip6_id.c | 2 ++ sys/netsmb/smb_crypt.c | 2 ++ sys/nfs/bootp_subr.c | 2 ++ sys/nfs/krpc_subr.c | 2 ++ sys/powerpc/fpu/fpu_emu.c | 4 +++- sys/powerpc/include/_align.h | 2 ++ sys/powerpc/include/_types.h | 2 ++ sys/powerpc/include/param.h | 2 ++ sys/powerpc/powerpc/in_cksum.c | 2 ++ sys/powerpc/powerpc/vm_machdep.c | 2 ++ sys/riscv/riscv/in_cksum.c | 2 ++ sys/riscv/riscv/pmap.c | 2 ++ sys/sparc64/include/cache.h | 2 ++ sys/sparc64/sparc64/cache.c | 2 ++ sys/sparc64/sparc64/eeprom.c | 2 ++ sys/sys/kernel.h | 2 ++ sys/sys/pioctl.h | 2 ++ sys/sys/posix4.h | 2 ++ sys/sys/sched.h | 2 ++ sys/sys/tiio.h | 2 ++ sys/vm/swap_pager.c | 2 ++ sys/vm/vm_fault.c | 2 ++ sys/vm/vm_pageout.c | 2 ++ sys/vm/vnode_pager.c | 2 ++ sys/x86/include/_align.h | 2 ++ sys/x86/include/_types.h | 2 ++ tools/regression/p1003_1b/fifo.c | 4 +++- tools/regression/p1003_1b/memlock.c | 4 +++- tools/regression/p1003_1b/p26.c | 4 +++- tools/regression/p1003_1b/sched.c | 4 +++- tools/regression/p1003_1b/yield.c | 4 +++- usr.bin/chpass/chpass.c | 2 ++ usr.bin/chpass/chpass.h | 4 +++- usr.bin/chpass/edit.c | 2 ++ usr.bin/chpass/field.c | 4 +++- usr.bin/chpass/util.c | 2 ++ usr.bin/diff/diffreg.c | 4 +++- usr.bin/indent/args.c | 2 ++ usr.bin/indent/indent.c | 2 ++ usr.bin/indent/indent_codes.h | 2 ++ usr.bin/indent/indent_globs.h | 2 ++ usr.bin/indent/io.c | 2 ++ usr.bin/indent/lexi.c | 2 ++ usr.bin/indent/parse.c | 2 ++ usr.bin/indent/pr_comment.c | 2 ++ usr.bin/locate/bigram/locate.bigram.c | 2 ++ usr.bin/locate/code/locate.code.c | 2 ++ usr.bin/locate/locate/fastfind.c | 2 ++ usr.bin/locate/locate/locate.c | 2 ++ usr.bin/locate/locate/locate.h | 2 ++ usr.bin/locate/locate/pathnames.h | 2 ++ usr.bin/locate/locate/util.c | 2 ++ usr.bin/login/login.c | 2 ++ usr.bin/netstat/mbuf.c | 2 ++ usr.bin/netstat/mroute.c | 2 ++ usr.bin/netstat/mroute6.c | 2 ++ usr.bin/pr/egetopt.c | 2 ++ usr.bin/pr/extern.h | 2 ++ usr.bin/pr/pr.c | 2 ++ usr.bin/pr/pr.h | 2 ++ usr.bin/rup/rup.c | 2 ++ usr.bin/rusers/rusers.c | 2 ++ usr.bin/rwall/rwall.c | 4 +++- usr.bin/truss/amd64-freebsd.c | 4 +++- usr.bin/truss/amd64-freebsd32.c | 4 +++- usr.bin/truss/amd64-linux.c | 4 +++- usr.bin/truss/amd64-linux32.c | 4 +++- usr.bin/truss/arm-freebsd.c | 4 +++- usr.bin/truss/extern.h | 4 +++- usr.bin/truss/i386-freebsd.c | 4 +++- usr.bin/truss/i386-linux.c | 4 +++- usr.bin/truss/main.c | 2 ++ usr.bin/truss/mips-freebsd.c | 4 +++- usr.bin/truss/setup.c | 2 ++ usr.bin/truss/sparc64-freebsd.c | 4 +++- usr.bin/truss/syscalls.c | 4 +++- usr.bin/uname/uname.c | 2 ++ usr.sbin/ancontrol/ancontrol.c | 4 +++- usr.sbin/dconschat/dconschat.c | 4 +++- usr.sbin/fwcontrol/fwcontrol.c | 4 +++- usr.sbin/fwcontrol/fwdv.c | 4 +++- usr.sbin/fwcontrol/fwmpegts.c | 4 +++- usr.sbin/kldxref/ef.c | 4 +++- usr.sbin/kldxref/ef_obj.c | 4 +++- usr.sbin/kldxref/kldxref.c | 4 +++- usr.sbin/lpr/common_source/common.c | 4 +++- usr.sbin/lpr/common_source/net.c | 4 +++- usr.sbin/lpr/common_source/printcap.c | 4 +++- usr.sbin/lpr/lpr/lpr.c | 4 +++- usr.sbin/makefs/ffs.c | 4 +++- usr.sbin/manctl/manctl.sh | 2 ++ usr.sbin/ndiscvt/inf-parse.y | 4 +++- usr.sbin/ndiscvt/inf-token.l | 4 +++- usr.sbin/ndiscvt/inf.c | 4 +++- usr.sbin/ndiscvt/ndiscvt.c | 2 ++ usr.sbin/ndiscvt/ndisgen.sh | 2 ++ usr.sbin/ndiscvt/windrv_stub.c | 2 ++ usr.sbin/rpc.lockd/lock_proc.c | 4 +++- usr.sbin/rpc.lockd/lockd.c | 4 +++- usr.sbin/rpc.lockd/lockd.h | 4 +++- usr.sbin/rpc.lockd/lockd_lock.c | 4 +++- usr.sbin/rpc.statd/file.c | 4 +++- usr.sbin/rpc.statd/procs.c | 4 +++- usr.sbin/rpc.statd/statd.c | 4 +++- usr.sbin/rpc.statd/statd.h | 4 +++- usr.sbin/rpc.yppasswdd/yppasswdd_extern.h | 4 +++- usr.sbin/rpc.yppasswdd/yppasswdd_main.c | 2 ++ usr.sbin/rpc.yppasswdd/yppasswdd_server.c | 4 +++- usr.sbin/rpc.ypupdated/yp_dbdelete.c | 4 +++- usr.sbin/rpc.ypupdated/yp_dbupdate.c | 4 +++- usr.sbin/rpc.ypupdated/ypupdated_main.c | 4 +++- usr.sbin/rpc.ypupdated/ypupdated_server.c | 4 +++- usr.sbin/rpc.ypxfrd/ypxfrd_extern.h | 4 +++- usr.sbin/rpc.ypxfrd/ypxfrd_main.c | 4 +++- usr.sbin/rpc.ypxfrd/ypxfrd_server.c | 4 +++- usr.sbin/rrenumd/rrenumd.h | 4 +++- usr.sbin/wpa/ndis_events/ndis_events.c | 2 ++ usr.sbin/wpa/wpa_supplicant/Packet32.c | 2 ++ usr.sbin/wpa/wpa_supplicant/Packet32.h | 2 ++ usr.sbin/yp_mkdb/yp_mkdb.c | 4 +++- usr.sbin/ypbind/yp_ping.c | 2 ++ usr.sbin/yppush/yppush_main.c | 4 +++- usr.sbin/ypserv/yp_access.c | 4 +++- usr.sbin/ypserv/yp_dblookup.c | 4 +++- usr.sbin/ypserv/yp_dnslookup.c | 4 +++- usr.sbin/ypserv/yp_error.c | 4 +++- usr.sbin/ypserv/yp_extern.h | 4 +++- usr.sbin/ypserv/yp_main.c | 4 +++- usr.sbin/ypserv/yp_server.c | 4 +++- usr.sbin/ypserv/yp_svc_udp.c | 4 +++- 363 files changed, 842 insertions(+), 114 deletions(-) diff --git a/lib/libc/arm/gen/fabs.c b/lib/libc/arm/gen/fabs.c index 8bb15025aead..6730a6746289 100644 --- a/lib/libc/arm/gen/fabs.c +++ b/lib/libc/arm/gen/fabs.c @@ -1,6 +1,8 @@ /* $NetBSD: fabs.c,v 1.2 2002/05/26 11:48:01 wiz Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 Mark Brinicombe * * Redistribution and use in source and binary forms, with or without diff --git a/lib/libc/locale/euc.c b/lib/libc/locale/euc.c index 2fe40462e9be..f5b5fd473068 100644 --- a/lib/libc/locale/euc.c +++ b/lib/libc/locale/euc.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 2013 Garrett D'Amore * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2002-2004 Tim J. Robbins. All rights reserved. diff --git a/lib/libc/mips/SYS.h b/lib/libc/mips/SYS.h index ceb68121b07d..99d3b470fa92 100644 --- a/lib/libc/mips/SYS.h +++ b/lib/libc/mips/SYS.h @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 Jonathan Stone * All rights reserved. * diff --git a/lib/libc/mips/gen/fabs.c b/lib/libc/mips/gen/fabs.c index 8bb15025aead..6730a6746289 100644 --- a/lib/libc/mips/gen/fabs.c +++ b/lib/libc/mips/gen/fabs.c @@ -1,6 +1,8 @@ /* $NetBSD: fabs.c,v 1.2 2002/05/26 11:48:01 wiz Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 Mark Brinicombe * * Redistribution and use in source and binary forms, with or without diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c index 19aa6f64e8c4..98e5398096ff 100644 --- a/lib/libc/net/ether_addr.c +++ b/lib/libc/net/ether_addr.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Bill Paul . * Copyright (c) 2007 Robert N. M. Watson * All rights reserved. diff --git a/lib/libc/rpc/crypt_client.c b/lib/libc/rpc/crypt_client.c index b7f0d1fff48c..c2ed109e10bb 100644 --- a/lib/libc/rpc/crypt_client.c +++ b/lib/libc/rpc/crypt_client.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 * Bill Paul . All rights reserved. * diff --git a/lib/libcam/camlib.h b/lib/libcam/camlib.h index 5c14740c6ed8..4aab63b31952 100644 --- a/lib/libcam/camlib.h +++ b/lib/libcam/camlib.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause AND BSD-2-Clause-FreeBSD + * * Copyright (c) 1997, 1998 Kenneth D. Merry. * All rights reserved. * diff --git a/lib/libcam/scsi_cmdparse.c b/lib/libcam/scsi_cmdparse.c index 4561b0b7e86c..b123d2747ca9 100644 --- a/lib/libcam/scsi_cmdparse.c +++ b/lib/libcam/scsi_cmdparse.c @@ -1,7 +1,10 @@ /* * Taken from the original FreeBSD user SCSI library. */ -/* Copyright (c) 1994 HD Associates +/*- + * SPDX-License-Identifier: BSD-4-Clause + * + * Copyright (c) 1994 HD Associates * (contact: dufault@hda.com) * All rights reserved. * diff --git a/lib/libkiconv/xlat16_sysctl.c b/lib/libkiconv/xlat16_sysctl.c index ae4dae7a5158..4eb6a681584e 100644 --- a/lib/libkiconv/xlat16_sysctl.c +++ b/lib/libkiconv/xlat16_sysctl.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000-2001, Boris Popov * All rights reserved. * diff --git a/lib/libprocstat/cd9660.c b/lib/libprocstat/cd9660.c index cc3c363f7bed..26e0b732eb55 100644 --- a/lib/libprocstat/cd9660.c +++ b/lib/libprocstat/cd9660.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 Peter Edwards * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. diff --git a/lib/libprocstat/common_kvm.c b/lib/libprocstat/common_kvm.c index 4ca25145b75d..2889f802775d 100644 --- a/lib/libprocstat/common_kvm.c +++ b/lib/libprocstat/common_kvm.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2009 Stanislav Sedov * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c index d5961c6af990..450ccdb5481f 100644 --- a/lib/libprocstat/libprocstat.c +++ b/lib/libprocstat/libprocstat.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2017 Dell EMC * Copyright (c) 2009 Stanislav Sedov * Copyright (c) 1988, 1993 diff --git a/lib/libprocstat/msdosfs.c b/lib/libprocstat/msdosfs.c index 84b437e6c95a..87906423f9b6 100644 --- a/lib/libprocstat/msdosfs.c +++ b/lib/libprocstat/msdosfs.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 Peter Edwards * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. diff --git a/lib/librpcsvc/yp_passwd.c b/lib/librpcsvc/yp_passwd.c index e7c59145fa2e..b8d99a66ab59 100644 --- a/lib/librpcsvc/yp_passwd.c +++ b/lib/librpcsvc/yp_passwd.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/lib/librpcsvc/yp_update.c b/lib/librpcsvc/yp_update.c index 1d2848d4ea61..081ef4f547f7 100644 --- a/lib/librpcsvc/yp_update.c +++ b/lib/librpcsvc/yp_update.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/lib/libthr/sys/thr_error.c b/lib/libthr/sys/thr_error.c index 852588a21092..922d818c3ca8 100644 --- a/lib/libthr/sys/thr_error.c +++ b/lib/libthr/sys/thr_error.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 John Birrell . * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu * All rights reserved. diff --git a/lib/libthr/thread/thr_attr.c b/lib/libthr/thread/thr_attr.c index a79048325104..4a5b4afc93ee 100644 --- a/lib/libthr/thread/thr_attr.c +++ b/lib/libthr/thread/thr_attr.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 Craig Rodrigues . * All rights reserved. * diff --git a/lib/libthr/thread/thr_autoinit.c b/lib/libthr/thread/thr_autoinit.c index 7d9e52cc6ee4..d741f3cf1af7 100644 --- a/lib/libthr/thread/thr_autoinit.c +++ b/lib/libthr/thread/thr_autoinit.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002 Alfred Perlstein . * Copyright (c) 1995 John Birrell . * All rights reserved. diff --git a/lib/libthr/thread/thr_concurrency.c b/lib/libthr/thread/thr_concurrency.c index 24714e6cbd3d..9f60dca1e445 100644 --- a/lib/libthr/thread/thr_concurrency.c +++ b/lib/libthr/thread/thr_concurrency.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 Sergey Osokin . * All rights reserved. * diff --git a/lib/libthr/thread/thr_getschedparam.c b/lib/libthr/thread/thr_getschedparam.c index 04ff3991b9cc..8301b4bf8743 100644 --- a/lib/libthr/thread/thr_getschedparam.c +++ b/lib/libthr/thread/thr_getschedparam.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1998 Daniel Eischen . * All rights reserved. * diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 909f14236d17..65f7d111f73d 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 Daniel M. Eischen * Copyright (c) 1995-1998 John Birrell * All rights reserved. diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index 4ab7720b665b..f3f815c99684 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 John Birrell . * Copyright (c) 2006 David Xu . * Copyright (c) 2015, 2016 The FreeBSD Foundation diff --git a/lib/libthr/thread/thr_setschedparam.c b/lib/libthr/thread/thr_setschedparam.c index 4db09e759ec4..cf2c1f919e12 100644 --- a/lib/libthr/thread/thr_setschedparam.c +++ b/lib/libthr/thread/thr_setschedparam.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1998 Daniel Eischen . * All rights reserved. * diff --git a/lib/libthr/thread/thr_switch_np.c b/lib/libthr/thread/thr_switch_np.c index 4380386e09f1..aad8641e4806 100644 --- a/lib/libthr/thread/thr_switch_np.c +++ b/lib/libthr/thread/thr_switch_np.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1998 Daniel Eischen . * All rights reserved. * diff --git a/lib/msun/bsdsrc/b_exp.c b/lib/msun/bsdsrc/b_exp.c index 4400992795b6..f922d02a03aa 100644 --- a/lib/msun/bsdsrc/b_exp.c +++ b/lib/msun/bsdsrc/b_exp.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1985, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/lib/msun/bsdsrc/b_log.c b/lib/msun/bsdsrc/b_log.c index 5a4b9644f7b3..04a92522d5a0 100644 --- a/lib/msun/bsdsrc/b_log.c +++ b/lib/msun/bsdsrc/b_log.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/lib/msun/bsdsrc/b_tgamma.c b/lib/msun/bsdsrc/b_tgamma.c index 1d0af4432863..832a729c20f8 100644 --- a/lib/msun/bsdsrc/b_tgamma.c +++ b/lib/msun/bsdsrc/b_tgamma.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/lib/msun/bsdsrc/mathimpl.h b/lib/msun/bsdsrc/mathimpl.h index 04a4b6e3d788..abf299658615 100644 --- a/lib/msun/bsdsrc/mathimpl.h +++ b/lib/msun/bsdsrc/mathimpl.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/libexec/mknetid/hash.c b/libexec/mknetid/hash.c index b4a39cbc12ec..d340142aad90 100644 --- a/libexec/mknetid/hash.c +++ b/libexec/mknetid/hash.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/libexec/mknetid/hash.h b/libexec/mknetid/hash.h index 7918ae2e95f0..c1cf98cb2765 100644 --- a/libexec/mknetid/hash.h +++ b/libexec/mknetid/hash.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/libexec/mknetid/mknetid.c b/libexec/mknetid/mknetid.c index 66868664c3c5..3a39b4b3e675 100644 --- a/libexec/mknetid/mknetid.c +++ b/libexec/mknetid/mknetid.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/libexec/revnetgroup/hash.c b/libexec/revnetgroup/hash.c index 118008023551..2dd1a3f91d74 100644 --- a/libexec/revnetgroup/hash.c +++ b/libexec/revnetgroup/hash.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/libexec/revnetgroup/hash.h b/libexec/revnetgroup/hash.h index 2485901ed68e..b12c91e8d293 100644 --- a/libexec/revnetgroup/hash.h +++ b/libexec/revnetgroup/hash.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/libexec/revnetgroup/revnetgroup.c b/libexec/revnetgroup/revnetgroup.c index 505c482b3be8..11fba515a7ba 100644 --- a/libexec/revnetgroup/revnetgroup.c +++ b/libexec/revnetgroup/revnetgroup.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/libexec/ypxfr/yp_dbwrite.c b/libexec/ypxfr/yp_dbwrite.c index 488f9e4ad446..120e6748b609 100644 --- a/libexec/ypxfr/yp_dbwrite.c +++ b/libexec/ypxfr/yp_dbwrite.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/libexec/ypxfr/ypxfr_extern.h b/libexec/ypxfr/ypxfr_extern.h index f843b645b6dd..6929bf38f27e 100644 --- a/libexec/ypxfr/ypxfr_extern.h +++ b/libexec/ypxfr/ypxfr_extern.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/libexec/ypxfr/ypxfr_getmap.c b/libexec/ypxfr/ypxfr_getmap.c index 1bde10efe3d4..5fc45b327d85 100644 --- a/libexec/ypxfr/ypxfr_getmap.c +++ b/libexec/ypxfr/ypxfr_getmap.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/libexec/ypxfr/ypxfr_main.c b/libexec/ypxfr/ypxfr_main.c index 03ebbe12fcaf..d7eb75a94c51 100644 --- a/libexec/ypxfr/ypxfr_main.c +++ b/libexec/ypxfr/ypxfr_main.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/libexec/ypxfr/ypxfr_misc.c b/libexec/ypxfr/ypxfr_misc.c index 323fd53cf9cd..3ee3ff58b8d5 100644 --- a/libexec/ypxfr/ypxfr_misc.c +++ b/libexec/ypxfr/ypxfr_misc.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/libexec/ypxfr/ypxfrd_getmap.c b/libexec/ypxfr/ypxfrd_getmap.c index a5ac92da578d..2358b68b9be2 100644 --- a/libexec/ypxfr/ypxfrd_getmap.c +++ b/libexec/ypxfr/ypxfrd_getmap.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/release/picobsd/tinyware/login/pathnames.h b/release/picobsd/tinyware/login/pathnames.h index 333c2ca280fa..1984631aa944 100644 --- a/release/picobsd/tinyware/login/pathnames.h +++ b/release/picobsd/tinyware/login/pathnames.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/release/picobsd/tinyware/login/pico-login.c b/release/picobsd/tinyware/login/pico-login.c index e540ca861a51..080954c8bfcd 100644 --- a/release/picobsd/tinyware/login/pico-login.c +++ b/release/picobsd/tinyware/login/pico-login.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * diff --git a/release/picobsd/tinyware/passwd/extern.h b/release/picobsd/tinyware/passwd/extern.h index eae768c6e82a..0c6c9f505ec6 100644 --- a/release/picobsd/tinyware/passwd/extern.h +++ b/release/picobsd/tinyware/passwd/extern.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * diff --git a/release/picobsd/tinyware/passwd/local_passwd.c b/release/picobsd/tinyware/passwd/local_passwd.c index 33af88ac38c7..41b6fe998443 100644 --- a/release/picobsd/tinyware/passwd/local_passwd.c +++ b/release/picobsd/tinyware/passwd/local_passwd.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * diff --git a/release/picobsd/tinyware/passwd/passwd.c b/release/picobsd/tinyware/passwd/passwd.c index 42ebd8c1fd48..419396390afe 100644 --- a/release/picobsd/tinyware/passwd/passwd.c +++ b/release/picobsd/tinyware/passwd/passwd.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. * diff --git a/release/picobsd/tinyware/passwd/pw_copy.c b/release/picobsd/tinyware/passwd/pw_copy.c index 753e1a67ff81..7586980e4a55 100644 --- a/release/picobsd/tinyware/passwd/pw_copy.c +++ b/release/picobsd/tinyware/passwd/pw_copy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * diff --git a/release/picobsd/tinyware/passwd/pw_util.c b/release/picobsd/tinyware/passwd/pw_util.c index 1c163d2d57ed..cfab6e115269 100644 --- a/release/picobsd/tinyware/passwd/pw_util.c +++ b/release/picobsd/tinyware/passwd/pw_util.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * diff --git a/release/picobsd/tinyware/passwd/pw_util.h b/release/picobsd/tinyware/passwd/pw_util.h index 1000a9abdc7f..d441b1907966 100644 --- a/release/picobsd/tinyware/passwd/pw_util.h +++ b/release/picobsd/tinyware/passwd/pw_util.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 83df67ae0fe3..f013cde3ef09 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1994, 1995 Gordon W. Ross * Copyright (c) 1994 Theo de Raadt * All rights reserved. diff --git a/sbin/etherswitchcfg/ifmedia.c b/sbin/etherswitchcfg/ifmedia.c index b9bd3b9c56ff..fd2a7fb86db2 100644 --- a/sbin/etherswitchcfg/ifmedia.c +++ b/sbin/etherswitchcfg/ifmedia.c @@ -1,7 +1,9 @@ /* $NetBSD: ifconfig.c,v 1.34 1997/04/21 01:17:58 lukem Exp $ */ /* $FreeBSD$ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997 Jason R. Thorpe. * All rights reserved. * diff --git a/sbin/ffsinfo/ffsinfo.c b/sbin/ffsinfo/ffsinfo.c index 1c082aba8fb0..5e08d35e5d91 100644 --- a/sbin/ffsinfo/ffsinfo.c +++ b/sbin/ffsinfo/ffsinfo.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz * Copyright (c) 1980, 1989, 1993 The Regents of the University of California. * All rights reserved. diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c index 9a320ecd89ee..e0dfc997fcf6 100644 --- a/sbin/growfs/debug.c +++ b/sbin/growfs/debug.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz * Copyright (c) 1980, 1989, 1993 The Regents of the University of California. * All rights reserved. diff --git a/sbin/growfs/debug.h b/sbin/growfs/debug.h index 3cad9d97874c..068e89c3441f 100644 --- a/sbin/growfs/debug.h +++ b/sbin/growfs/debug.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz * Copyright (c) 1980, 1989, 1993 The Regents of the University of California. * All rights reserved. diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index 2e8271b39d5d..7670317caae7 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1980, 1989, 1993 The Regents of the University of California. * Copyright (c) 2000 Christoph Herrmann, Thomas-Henning von Kamptz * Copyright (c) 2012 The FreeBSD Foundation diff --git a/sbin/gvinum/gvinum.h b/sbin/gvinum/gvinum.h index 8b72eea7834f..e9c112a5e936 100644 --- a/sbin/gvinum/gvinum.h +++ b/sbin/gvinum/gvinum.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998 * Nan Yang Computer Services Limited. All rights reserved. * diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c index abcad7f368c7..0c586331bbec 100644 --- a/sbin/ifconfig/ifmedia.c +++ b/sbin/ifconfig/ifmedia.c @@ -1,7 +1,9 @@ /* $NetBSD: ifconfig.c,v 1.34 1997/04/21 01:17:58 lukem Exp $ */ /* $FreeBSD$ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997 Jason R. Thorpe. * All rights reserved. * diff --git a/sbin/ifconfig/ifvlan.c b/sbin/ifconfig/ifvlan.c index 3b37160c3c85..a29c50f11efa 100644 --- a/sbin/ifconfig/ifvlan.c +++ b/sbin/ifconfig/ifvlan.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1999 Bill Paul * Copyright (c) 2012 ADARA Networks, Inc. * All rights reserved. diff --git a/sbin/rcorder/ealloc.c b/sbin/rcorder/ealloc.c index 997119315531..eae8bb67d69a 100644 --- a/sbin/rcorder/ealloc.c +++ b/sbin/rcorder/ealloc.c @@ -1,7 +1,9 @@ /* $FreeBSD$ */ /* $NetBSD: ealloc.c,v 1.1.1.1 1999/11/19 04:30:56 mrg Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1989 by Berkeley Softworks diff --git a/sbin/rcorder/hash.c b/sbin/rcorder/hash.c index 34b95ce82f7a..3dcb77054960 100644 --- a/sbin/rcorder/hash.c +++ b/sbin/rcorder/hash.c @@ -1,7 +1,9 @@ /* $FreeBSD$ */ /* $NetBSD: hash.c,v 1.1.1.1 1999/11/19 04:30:56 mrg Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. * Copyright (c) 1988, 1989 by Adam de Boor * Copyright (c) 1989 by Berkeley Softworks diff --git a/sbin/rcorder/hash.h b/sbin/rcorder/hash.h index fd2f9783377b..d190633861a0 100644 --- a/sbin/rcorder/hash.h +++ b/sbin/rcorder/hash.h @@ -1,7 +1,9 @@ /* $FreeBSD$ */ /* $NetBSD: hash.h,v 1.1.1.1 1999/11/19 04:30:56 mrg Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. * Copyright (c) 1988, 1989 by Adam de Boor * Copyright (c) 1989 by Berkeley Softworks diff --git a/sbin/rcorder/sprite.h b/sbin/rcorder/sprite.h index 5e5d7f3640f7..e311ee6e0f66 100644 --- a/sbin/rcorder/sprite.h +++ b/sbin/rcorder/sprite.h @@ -1,6 +1,8 @@ /* $NetBSD: sprite.h,v 1.1 1999/11/23 05:28:22 mrg Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1989 by Berkeley Softworks @@ -38,6 +40,7 @@ * SUCH DAMAGE. * * from: @(#)sprite.h 8.1 (Berkeley) 6/6/93 + * $FreeBSD$ */ /* diff --git a/sys/amd64/amd64/in_cksum.c b/sys/amd64/amd64/in_cksum.c index ae02e91d9203..30e90f043cc3 100644 --- a/sys/amd64/amd64/in_cksum.c +++ b/sys/amd64/amd64/in_cksum.c @@ -1,6 +1,8 @@ /* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1992, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1996 diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 4ce0285b1fa6..3175616d0ce0 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 Peter Wemm. * Copyright (c) 1992 Terrence R. Lambert. * Copyright (c) 1982, 1987, 1990 The Regents of the University of California. diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index e93936685347..f200a34af6c8 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * Copyright (c) 1994 John S. Dyson diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index e5a69d715a7b..35cded01ecce 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, David Greenman * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index fae37d731b06..24fc65a4af3c 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1982, 1986 The Regents of the University of California. * Copyright (c) 1989, 1990 William Jolitz * Copyright (c) 1994 John Dyson diff --git a/sys/amd64/ia32/ia32_syscall.c b/sys/amd64/ia32/ia32_syscall.c index c07b38cb438a..22d6f211fb41 100644 --- a/sys/amd64/ia32/ia32_syscall.c +++ b/sys/amd64/ia32/ia32_syscall.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, David Greenman * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/amd64/include/floatingpoint.h b/sys/amd64/include/floatingpoint.h index cda9e46230ca..b7c154743d0c 100644 --- a/sys/amd64/include/floatingpoint.h +++ b/sys/amd64/include/floatingpoint.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1993 Andrew Moore, Talke Studio * All rights reserved. * diff --git a/sys/amd64/include/ieeefp.h b/sys/amd64/include/ieeefp.h index a40366092d57..df2263098f46 100644 --- a/sys/amd64/include/ieeefp.h +++ b/sys/amd64/include/ieeefp.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 Peter Wemm. * Copyright (c) 1990 Andrew Moore, Talke Studio * All rights reserved. diff --git a/sys/amd64/include/param.h b/sys/amd64/include/param.h index 23fce271e901..86f7e08d9725 100644 --- a/sys/amd64/include/param.h +++ b/sys/amd64/include/param.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002 David E. O'Brien. All rights reserved. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/amd64/include/varargs.h b/sys/amd64/include/varargs.h index 93faac6a84dd..8d1d7d7e1f38 100644 --- a/sys/amd64/include/varargs.h +++ b/sys/amd64/include/varargs.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002 David E. O'Brien. All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h index 381097adf8b1..6d63201c6581 100644 --- a/sys/amd64/include/vmparam.h +++ b/sys/amd64/include/vmparam.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Copyright (c) 1994 John S. Dyson diff --git a/sys/arm/arm/autoconf.c b/sys/arm/arm/autoconf.c index f18f67dcda8f..3b9036200406 100644 --- a/sys/arm/arm/autoconf.c +++ b/sys/arm/arm/autoconf.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * diff --git a/sys/arm/arm/in_cksum.c b/sys/arm/arm/in_cksum.c index 3bce65018397..d37c68720d2a 100644 --- a/sys/arm/arm/in_cksum.c +++ b/sys/arm/arm/in_cksum.c @@ -1,6 +1,8 @@ /* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1992, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1996 diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c index bebae6c703af..f16c884637c8 100644 --- a/sys/arm/arm/vm_machdep.c +++ b/sys/arm/arm/vm_machdep.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1982, 1986 The Regents of the University of California. * Copyright (c) 1989, 1990 William Jolitz * Copyright (c) 1994 John Dyson diff --git a/sys/arm/include/_align.h b/sys/arm/include/_align.h index e382fe2ac311..8b575ceca082 100644 --- a/sys/arm/include/_align.h +++ b/sys/arm/include/_align.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 David E. O'Brien * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. diff --git a/sys/arm/include/_types.h b/sys/arm/include/_types.h index 204d8b3c42c5..de299e9bb680 100644 --- a/sys/arm/include/_types.h +++ b/sys/arm/include/_types.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002 Mike Barcroft * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/arm/include/floatingpoint.h b/sys/arm/include/floatingpoint.h index fd328a9d739b..b1c28e91d79e 100644 --- a/sys/arm/include/floatingpoint.h +++ b/sys/arm/include/floatingpoint.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1993 Andrew Moore, Talke Studio * All rights reserved. * diff --git a/sys/arm/include/param.h b/sys/arm/include/param.h index 6c20dd28716b..39dcc5e341bf 100644 --- a/sys/arm/include/param.h +++ b/sys/arm/include/param.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 David E. O'Brien * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. diff --git a/sys/arm/include/proc.h b/sys/arm/include/proc.h index fc4b31eabac1..94855b6f60e7 100644 --- a/sys/arm/include/proc.h +++ b/sys/arm/include/proc.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * diff --git a/sys/arm/include/profile.h b/sys/arm/include/profile.h index 49769a93ee82..a4973175f3bd 100644 --- a/sys/arm/include/profile.h +++ b/sys/arm/include/profile.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/sys/arm/include/reloc.h b/sys/arm/include/reloc.h index df4a126eb1a9..688475703225 100644 --- a/sys/arm/include/reloc.h +++ b/sys/arm/include/reloc.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index b707a18d3e87..686d417d00fc 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 Dag-Erling Coïdan Smørgrav * Copyright (c) 1999 Pierre Beyssac * Copyright (c) 1993 Jan-Simon Pendry diff --git a/sys/compat/ndis/cfg_var.h b/sys/compat/ndis/cfg_var.h index 1fb44ce268a1..ff40a85926be 100644 --- a/sys/compat/ndis/cfg_var.h +++ b/sys/compat/ndis/cfg_var.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/hal_var.h b/sys/compat/ndis/hal_var.h index 699b01ca0efd..f8864e2e7071 100644 --- a/sys/compat/ndis/hal_var.h +++ b/sys/compat/ndis/hal_var.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index fb9dcaaf7a8d..0542f40cd877 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/kern_windrv.c b/sys/compat/ndis/kern_windrv.c index 5572988ca3d4..597b8362b37e 100644 --- a/sys/compat/ndis/kern_windrv.c +++ b/sys/compat/ndis/kern_windrv.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2005 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/ndis_var.h b/sys/compat/ndis/ndis_var.h index 92e62a1fbdbc..0782853cf661 100644 --- a/sys/compat/ndis/ndis_var.h +++ b/sys/compat/ndis/ndis_var.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/ntoskrnl_var.h b/sys/compat/ndis/ntoskrnl_var.h index 48ddcd9d8baf..9c8c19964504 100644 --- a/sys/compat/ndis/ntoskrnl_var.h +++ b/sys/compat/ndis/ntoskrnl_var.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/pe_var.h b/sys/compat/ndis/pe_var.h index 9729f0b5e4bf..2e5758c592e1 100644 --- a/sys/compat/ndis/pe_var.h +++ b/sys/compat/ndis/pe_var.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/resource_var.h b/sys/compat/ndis/resource_var.h index 5ce096c08e02..b06a2e09f910 100644 --- a/sys/compat/ndis/resource_var.h +++ b/sys/compat/ndis/resource_var.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2005 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/subr_hal.c b/sys/compat/ndis/subr_hal.c index 7bb3f28e6caf..ea30675d66b0 100644 --- a/sys/compat/ndis/subr_hal.c +++ b/sys/compat/ndis/subr_hal.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 98a0a284ce8f..e1ba8cc12cd6 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c index cfa97275d7ee..5bf3e7aeee49 100644 --- a/sys/compat/ndis/subr_ntoskrnl.c +++ b/sys/compat/ndis/subr_ntoskrnl.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/subr_pe.c b/sys/compat/ndis/subr_pe.c index 47bef25499c1..1cd698fdd51c 100644 --- a/sys/compat/ndis/subr_pe.c +++ b/sys/compat/ndis/subr_pe.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/subr_usbd.c b/sys/compat/ndis/subr_usbd.c index eca2708bfc1a..2c877ea533a5 100644 --- a/sys/compat/ndis/subr_usbd.c +++ b/sys/compat/ndis/subr_usbd.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2005 * Bill Paul . All rights reserved. * diff --git a/sys/compat/ndis/usbd_var.h b/sys/compat/ndis/usbd_var.h index 019bd32a9715..6566a29d52d6 100644 --- a/sys/compat/ndis/usbd_var.h +++ b/sys/compat/ndis/usbd_var.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/an/if_aironet_ieee.h b/sys/dev/an/if_aironet_ieee.h index 28e4f72148e9..bc1247e041a2 100644 --- a/sys/dev/an/if_aironet_ieee.h +++ b/sys/dev/an/if_aironet_ieee.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index cae604c055c1..c1871e513d4d 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/an/if_an_isa.c b/sys/dev/an/if_an_isa.c index 19e5cd07552d..a6d3c81d52da 100644 --- a/sys/dev/an/if_an_isa.c +++ b/sys/dev/an/if_an_isa.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/an/if_an_pccard.c b/sys/dev/an/if_an_pccard.c index 6f26d7a39035..4c9f94350ec9 100644 --- a/sys/dev/an/if_an_pccard.c +++ b/sys/dev/an/if_an_pccard.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/an/if_an_pci.c b/sys/dev/an/if_an_pci.c index db658cfa6139..5fa071e0f8b7 100644 --- a/sys/dev/an/if_an_pci.c +++ b/sys/dev/an/if_an_pci.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/an/if_anreg.h b/sys/dev/an/if_anreg.h index ee69b8856019..b9a6d523cb10 100644 --- a/sys/dev/an/if_anreg.h +++ b/sys/dev/an/if_anreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 929bedc5ee0a..1edf2a274632 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2001 * Bill Paul . All rights reserved. diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h index 0cf9ca18c9bc..eb7686e70d05 100644 --- a/sys/dev/bge/if_bgereg.h +++ b/sys/dev/bge/if_bgereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2001 * Bill Paul . All rights reserved. diff --git a/sys/dev/dc/dcphy.c b/sys/dev/dc/dcphy.c index f96a9b360bb2..8b28d462a5b3 100644 --- a/sys/dev/dc/dcphy.c +++ b/sys/dev/dc/dcphy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 421e326d256c..dba0f642906e 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/dc/if_dcreg.h b/sys/dev/dc/if_dcreg.h index e290881fa017..9ae26cc6e59f 100644 --- a/sys/dev/dc/if_dcreg.h +++ b/sys/dev/dc/if_dcreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/dc/pnphy.c b/sys/dev/dc/pnphy.c index f8d31de782ef..f2da30cc6cf0 100644 --- a/sys/dev/dc/pnphy.c +++ b/sys/dev/dc/pnphy.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/dcons/dcons.c b/sys/dev/dcons/dcons.c index da5183e15cd3..07dda2940621 100644 --- a/sys/dev/dcons/dcons.c +++ b/sys/dev/dcons/dcons.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2003,2004 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/dcons/dcons.h b/sys/dev/dcons/dcons.h index e613f5bbe51d..c7ade863b6ef 100644 --- a/sys/dev/dcons/dcons.h +++ b/sys/dev/dcons/dcons.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2002-2004 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/dcons/dcons_crom.c b/sys/dev/dcons/dcons_crom.c index cb206752be9f..1fa7dcb92efe 100644 --- a/sys/dev/dcons/dcons_crom.c +++ b/sys/dev/dcons/dcons_crom.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/dcons/dcons_os.c b/sys/dev/dcons/dcons_os.c index 01e61663e5b0..3b17ffeaa5c4 100644 --- a/sys/dev/dcons/dcons_os.c +++ b/sys/dev/dcons/dcons_os.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2003,2004 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/dcons/dcons_os.h b/sys/dev/dcons/dcons_os.h index bd6dfeff8009..7421b4734d78 100644 --- a/sys/dev/dcons/dcons_os.h +++ b/sys/dev/dcons/dcons_os.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2002-2004 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/firewire/fwcrom.c b/sys/dev/firewire/fwcrom.c index e53d3b678cd6..251173a7e71b 100644 --- a/sys/dev/firewire/fwcrom.c +++ b/sys/dev/firewire/fwcrom.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002-2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/firewire/fwdma.c b/sys/dev/firewire/fwdma.c index 45598f2828d7..27599c41bdf8 100644 --- a/sys/dev/firewire/fwdma.c +++ b/sys/dev/firewire/fwdma.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/firewire/fwdma.h b/sys/dev/firewire/fwdma.h index ec67971ad229..dfa942d91448 100644 --- a/sys/dev/firewire/fwdma.h +++ b/sys/dev/firewire/fwdma.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/firewire/fwmem.c b/sys/dev/firewire/fwmem.c index 034481d086d0..2faa4d3d3618 100644 --- a/sys/dev/firewire/fwmem.c +++ b/sys/dev/firewire/fwmem.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002-2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/firewire/fwmem.h b/sys/dev/firewire/fwmem.h index de717947e844..f79dec68eccf 100644 --- a/sys/dev/firewire/fwmem.h +++ b/sys/dev/firewire/fwmem.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2002-2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/firewire/fwphyreg.h b/sys/dev/firewire/fwphyreg.h index c54881e582b4..6b9c11e8cc60 100644 --- a/sys/dev/firewire/fwphyreg.h +++ b/sys/dev/firewire/fwphyreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index 07b41ef6230b..3541d199c0b2 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002-2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/firewire/if_fwevar.h b/sys/dev/firewire/if_fwevar.h index 4b8eb76d0605..cb043cb35481 100644 --- a/sys/dev/firewire/if_fwevar.h +++ b/sys/dev/firewire/if_fwevar.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002-2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 3928ef13ae5b..bc72709a3915 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004 * Doug Rabson * Copyright (c) 2002-2003 diff --git a/sys/dev/firewire/if_fwipvar.h b/sys/dev/firewire/if_fwipvar.h index 57e7904b5f81..acf6fb93598b 100644 --- a/sys/dev/firewire/if_fwipvar.h +++ b/sys/dev/firewire/if_fwipvar.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004 * Doug Rabson * Copyright (c) 2002-2003 diff --git a/sys/dev/firewire/sbp_targ.c b/sys/dev/firewire/sbp_targ.c index cf4457d3ac41..f1b302528213 100644 --- a/sys/dev/firewire/sbp_targ.c +++ b/sys/dev/firewire/sbp_targ.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/sys/dev/ic/i82586.h b/sys/dev/ic/i82586.h index d594730a0dd5..8a0f9dc4356e 100644 --- a/sys/dev/ic/i82586.h +++ b/sys/dev/ic/i82586.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1992, University of Vermont and State Agricultural College. * Copyright (c) 1992, Garrett A. Wollman. * All rights reserved. diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 6083d9778c01..c0a4a3cc1907 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/if_ndis/if_ndis_pccard.c b/sys/dev/if_ndis/if_ndis_pccard.c index 7cbc0cef8753..36d52986691d 100644 --- a/sys/dev/if_ndis/if_ndis_pccard.c +++ b/sys/dev/if_ndis/if_ndis_pccard.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/if_ndis/if_ndis_pci.c b/sys/dev/if_ndis/if_ndis_pci.c index bf2f313023df..b9d860f9d889 100644 --- a/sys/dev/if_ndis/if_ndis_pci.c +++ b/sys/dev/if_ndis/if_ndis_pci.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/if_ndis/if_ndis_usb.c b/sys/dev/if_ndis/if_ndis_usb.c index a9a8d67aabde..d88dc59c1968 100644 --- a/sys/dev/if_ndis/if_ndis_usb.c +++ b/sys/dev/if_ndis/if_ndis_usb.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2005 * Bill Paul . All rights reserved. * diff --git a/sys/dev/if_ndis/if_ndisvar.h b/sys/dev/if_ndis/if_ndisvar.h index 7259127aa34c..0182e15f6e2a 100644 --- a/sys/dev/if_ndis/if_ndisvar.h +++ b/sys/dev/if_ndis/if_ndisvar.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index 115d2fa74729..dba01794b139 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 * Bill Paul . All rights reserved. diff --git a/sys/dev/lge/if_lgereg.h b/sys/dev/lge/if_lgereg.h index bb794c2fad6e..e5e8893fb733 100644 --- a/sys/dev/lge/if_lgereg.h +++ b/sys/dev/lge/if_lgereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 * Bill Paul . All rights reserved. diff --git a/sys/dev/mii/amphy.c b/sys/dev/mii/amphy.c index ae3827db9a22..bd6b75e2b2b0 100644 --- a/sys/dev/mii/amphy.c +++ b/sys/dev/mii/amphy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/amphyreg.h b/sys/dev/mii/amphyreg.h index 6cdbc95647b5..30bac3028b05 100644 --- a/sys/dev/mii/amphyreg.h +++ b/sys/dev/mii/amphyreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index eea3588f7038..6d77b11a1e7a 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/brgphyreg.h b/sys/dev/mii/brgphyreg.h index b3535d59fbc2..5cceb392a02b 100644 --- a/sys/dev/mii/brgphyreg.h +++ b/sys/dev/mii/brgphyreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c index 2d2816cddf0a..b91b19f8c89a 100644 --- a/sys/dev/mii/ciphy.c +++ b/sys/dev/mii/ciphy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/ciphyreg.h b/sys/dev/mii/ciphyreg.h index dd73f87783dc..ce91db480ada 100644 --- a/sys/dev/mii/ciphyreg.h +++ b/sys/dev/mii/ciphyreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/mlphy.c b/sys/dev/mii/mlphy.c index 89b4f2cc0b48..486a2fa0241d 100644 --- a/sys/dev/mii/mlphy.c +++ b/sys/dev/mii/mlphy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/nsgphyreg.h b/sys/dev/mii/nsgphyreg.h index 44899191715e..02dff78b97c8 100644 --- a/sys/dev/mii/nsgphyreg.h +++ b/sys/dev/mii/nsgphyreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Wind River Systems * Copyright (c) 2001 * Bill Paul . All rights reserved. diff --git a/sys/dev/mii/pnaphy.c b/sys/dev/mii/pnaphy.c index 6e5c51b255cf..c03c57844985 100644 --- a/sys/dev/mii/pnaphy.c +++ b/sys/dev/mii/pnaphy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 Berkeley Software Design, Inc. * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c index 25cea3abdbaf..362aa200cba0 100644 --- a/sys/dev/mii/rgephy.c +++ b/sys/dev/mii/rgephy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/rgephyreg.h b/sys/dev/mii/rgephyreg.h index 35917daa69c9..39efaee4ddd0 100644 --- a/sys/dev/mii/rgephyreg.h +++ b/sys/dev/mii/rgephyreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/rlphy.c b/sys/dev/mii/rlphy.c index 782fc3c807b5..6433faf23142 100644 --- a/sys/dev/mii/rlphy.c +++ b/sys/dev/mii/rlphy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/rlswitch.c b/sys/dev/mii/rlswitch.c index d3e3c938df7e..e21797a4c9a6 100644 --- a/sys/dev/mii/rlswitch.c +++ b/sys/dev/mii/rlswitch.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * Copyright (c) 2006 Bernd Walter. All rights reserved. diff --git a/sys/dev/mii/xmphy.c b/sys/dev/mii/xmphy.c index 8c35aa5cf749..c0c67e4d19e5 100644 --- a/sys/dev/mii/xmphy.c +++ b/sys/dev/mii/xmphy.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/mii/xmphyreg.h b/sys/dev/mii/xmphyreg.h index 92b9f78b4617..30877233ff34 100644 --- a/sys/dev/mii/xmphyreg.h +++ b/sys/dev/mii/xmphyreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index 9d6373111a5d..ea500fa2f4ea 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -46,6 +46,8 @@ *****************************************************************************/ /*- + * SPDX-License-Identifier: BSD-4-Clause AND BSD-3-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/msk/if_mskreg.h b/sys/dev/msk/if_mskreg.h index 8f2ea634b50d..7bd0b53a49af 100644 --- a/sys/dev/msk/if_mskreg.h +++ b/sys/dev/msk/if_mskreg.h @@ -46,6 +46,8 @@ ******************************************************************************/ /*- + * SPDX-License-Identifier: BSD-4-Clause AND BSD-3-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index 2bd49e1e2799..8d9e1861bea5 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 * Bill Paul . All rights reserved. diff --git a/sys/dev/nge/if_ngereg.h b/sys/dev/nge/if_ngereg.h index 9df0d92c8142..ed638438ef71 100644 --- a/sys/dev/nge/if_ngereg.h +++ b/sys/dev/nge/if_ngereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 * Bill Paul . All rights reserved. diff --git a/sys/dev/pcn/if_pcn.c b/sys/dev/pcn/if_pcn.c index a81bd0178b7d..5a35cac26493 100644 --- a/sys/dev/pcn/if_pcn.c +++ b/sys/dev/pcn/if_pcn.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 Berkeley Software Design, Inc. * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. diff --git a/sys/dev/pcn/if_pcnreg.h b/sys/dev/pcn/if_pcnreg.h index a10edfd76aa4..95cf0ec8f847 100644 --- a/sys/dev/pcn/if_pcnreg.h +++ b/sys/dev/pcn/if_pcnreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000 Berkeley Software Design, Inc. * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c index ce08ccc605c2..9fc3b1b48104 100644 --- a/sys/dev/ppbus/lpt.c +++ b/sys/dev/ppbus/lpt.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990 William F. Jolitz, TeleMuse * All rights reserved. * diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 00c27642b568..e9328b5ec1d1 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998-2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index 2d0df0ffa5d8..ef07f5db7fc2 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/sf/if_sfreg.h b/sys/dev/sf/if_sfreg.h index 0ed20acb6e15..bec92f1c813c 100644 --- a/sys/dev/sf/if_sfreg.h +++ b/sys/dev/sf/if_sfreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/sge/if_sge.c b/sys/dev/sge/if_sge.c index 9aefce1e32e5..7c9bdd954700 100644 --- a/sys/dev/sge/if_sge.c +++ b/sys/dev/sge/if_sge.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2008-2010 Nikolay Denev * Copyright (c) 2007-2008 Alexander Pohoyda * Copyright (c) 1997, 1998, 1999 diff --git a/sys/dev/sge/if_sgereg.h b/sys/dev/sge/if_sgereg.h index a72d1a5a5646..5b7d75ed6913 100644 --- a/sys/dev/sge/if_sgereg.h +++ b/sys/dev/sge/if_sgereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2008, 2009, 2010 Nikolay Denev * Copyright (c) 2007, 2008 Alexander Pohoyda * Copyright (c) 1997, 1998, 1999 diff --git a/sys/dev/sis/if_sis.c b/sys/dev/sis/if_sis.c index 71593e6b9b00..cf719ec310dc 100644 --- a/sys/dev/sis/if_sis.c +++ b/sys/dev/sis/if_sis.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2005 Poul-Henning Kamp * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. diff --git a/sys/dev/sis/if_sisreg.h b/sys/dev/sis/if_sisreg.h index 6256fde33f04..9523af1d2ec8 100644 --- a/sys/dev/sis/if_sisreg.h +++ b/sys/dev/sis/if_sisreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 265172970634..a288b5145b07 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -1,6 +1,8 @@ /* $OpenBSD: if_sk.c,v 2.33 2003/08/12 05:23:06 nate Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/sk/if_skreg.h b/sys/dev/sk/if_skreg.h index 49c958320b90..85d3f14ea625 100644 --- a/sys/dev/sk/if_skreg.h +++ b/sys/dev/sk/if_skreg.h @@ -1,6 +1,8 @@ /* $OpenBSD: if_skreg.h,v 1.10 2003/08/12 05:23:06 nate Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/sk/xmaciireg.h b/sys/dev/sk/xmaciireg.h index 604073b72a38..30bd16c9a749 100644 --- a/sys/dev/sk/xmaciireg.h +++ b/sys/dev/sk/xmaciireg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/ste/if_ste.c b/sys/dev/ste/if_ste.c index e6cffb3d23b2..0005615a6304 100644 --- a/sys/dev/ste/if_ste.c +++ b/sys/dev/ste/if_ste.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/ste/if_stereg.h b/sys/dev/ste/if_stereg.h index e3aa51bff266..a27cb0a89a25 100644 --- a/sys/dev/ste/if_stereg.h +++ b/sys/dev/ste/if_stereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index 421f5fd16145..c966302c7136 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/ti/if_tireg.h b/sys/dev/ti/if_tireg.h index d55e1507fff0..a6b358bc1ea9 100644 --- a/sys/dev/ti/if_tireg.h +++ b/sys/dev/ti/if_tireg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/tl/if_tl.c b/sys/dev/tl/if_tl.c index 5d218e794f5e..70c1d17ec3fc 100644 --- a/sys/dev/tl/if_tl.c +++ b/sys/dev/tl/if_tl.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998 * Bill Paul . All rights reserved. * diff --git a/sys/dev/tl/if_tlreg.h b/sys/dev/tl/if_tlreg.h index 4a82cc5d9727..51fb6820bd8e 100644 --- a/sys/dev/tl/if_tlreg.h +++ b/sys/dev/tl/if_tlreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998 * Bill Paul . All rights reserved. * diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c index b048ad92d0d7..f4031bf47ccf 100644 --- a/sys/dev/txp/if_txp.c +++ b/sys/dev/txp/if_txp.c @@ -1,6 +1,8 @@ /* $OpenBSD: if_txp.c,v 1.48 2001/06/27 06:34:50 kjc Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 * Jason L. Wright , Theo de Raadt, and * Aaron Campbell . All rights reserved. diff --git a/sys/dev/usb/net/if_aue.c b/sys/dev/usb/net/if_aue.c index a756820bf358..5669e3fc4b47 100644 --- a/sys/dev/usb/net/if_aue.c +++ b/sys/dev/usb/net/if_aue.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_auereg.h b/sys/dev/usb/net/if_auereg.h index 4d0843eb8b1a..dfbaac424bf8 100644 --- a/sys/dev/usb/net/if_auereg.h +++ b/sys/dev/usb/net/if_auereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c index aa1ce0ed4c37..68f4479d8e21 100644 --- a/sys/dev/usb/net/if_axe.c +++ b/sys/dev/usb/net/if_axe.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000-2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_axereg.h b/sys/dev/usb/net/if_axereg.h index 64cb2352485a..2654bbbab9af 100644 --- a/sys/dev/usb/net/if_axereg.h +++ b/sys/dev/usb/net/if_axereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000-2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c index 8b220ae84051..d3662fe22e86 100644 --- a/sys/dev/usb/net/if_cdce.c +++ b/sys/dev/usb/net/if_cdce.c @@ -1,6 +1,8 @@ /* $NetBSD: if_cdce.c,v 1.4 2004/10/24 12:50:54 augustss Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul * Copyright (c) 2003-2005 Craig Boston * Copyright (c) 2004 Daniel Hartmeier diff --git a/sys/dev/usb/net/if_cdcereg.h b/sys/dev/usb/net/if_cdcereg.h index 1bc2d6039dc1..26d037c593b8 100644 --- a/sys/dev/usb/net/if_cdcereg.h +++ b/sys/dev/usb/net/if_cdcereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003-2005 Craig Boston * All rights reserved. * diff --git a/sys/dev/usb/net/if_cue.c b/sys/dev/usb/net/if_cue.c index 1190f98231e2..9d66e51289b9 100644 --- a/sys/dev/usb/net/if_cue.c +++ b/sys/dev/usb/net/if_cue.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_cuereg.h b/sys/dev/usb/net/if_cuereg.h index ff245c0513eb..b5cccee42c19 100644 --- a/sys/dev/usb/net/if_cuereg.h +++ b/sys/dev/usb/net/if_cuereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_kue.c b/sys/dev/usb/net/if_kue.c index 562ead2809e7..4c07043e1712 100644 --- a/sys/dev/usb/net/if_kue.c +++ b/sys/dev/usb/net/if_kue.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_kuefw.h b/sys/dev/usb/net/if_kuefw.h index 2b055a92ed7b..8b799f01f850 100644 --- a/sys/dev/usb/net/if_kuefw.h +++ b/sys/dev/usb/net/if_kuefw.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_kuereg.h b/sys/dev/usb/net/if_kuereg.h index 16ad044d07ef..2f5d7ccb3b38 100644 --- a/sys/dev/usb/net/if_kuereg.h +++ b/sys/dev/usb/net/if_kuereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_mosreg.h b/sys/dev/usb/net/if_mosreg.h index c811d55279e3..b8034feb8e44 100644 --- a/sys/dev/usb/net/if_mosreg.h +++ b/sys/dev/usb/net/if_mosreg.h @@ -32,6 +32,8 @@ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999, 2000-2003 * Bill Paul . All rights reserved. * diff --git a/sys/dev/usb/net/if_rue.c b/sys/dev/usb/net/if_rue.c index 9b86e88474b8..3766c993e4ed 100644 --- a/sys/dev/usb/net/if_rue.c +++ b/sys/dev/usb/net/if_rue.c @@ -25,6 +25,8 @@ * SUCH DAMAGE. */ /*- + * SPDX-License-Identifier: BSD-4-Clause AND BSD-2-Clause-FreeBSD + * * Copyright (c) 1997, 1998, 1999, 2000 * Bill Paul . All rights reserved. * diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c index 315f273eef9d..e0ae98fa0b39 100644 --- a/sys/dev/vge/if_vge.c +++ b/sys/dev/vge/if_vge.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004 * Bill Paul . All rights reserved. * diff --git a/sys/dev/vge/if_vgereg.h b/sys/dev/vge/if_vgereg.h index c8b3f1bb459b..88e6f22f3124 100644 --- a/sys/dev/vge/if_vgereg.h +++ b/sys/dev/vge/if_vgereg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004 * Bill Paul . All rights reserved. * diff --git a/sys/dev/vge/if_vgevar.h b/sys/dev/vge/if_vgevar.h index ca899cc5fc0a..6e707e2d5965 100644 --- a/sys/dev/vge/if_vgevar.h +++ b/sys/dev/vge/if_vgevar.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004 * Bill Paul . All rights reserved. * diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index 5ffee24c1588..b1c7b540155c 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998 * Bill Paul . All rights reserved. * diff --git a/sys/dev/vr/if_vrreg.h b/sys/dev/vr/if_vrreg.h index 3618c1bae936..fdb581ace0a2 100644 --- a/sys/dev/vr/if_vrreg.h +++ b/sys/dev/vr/if_vrreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998 * Bill Paul . All rights reserved. * diff --git a/sys/dev/wb/if_wb.c b/sys/dev/wb/if_wb.c index aa882f0d26c0..e91d38739f94 100644 --- a/sys/dev/wb/if_wb.c +++ b/sys/dev/wb/if_wb.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998 * Bill Paul . All rights reserved. * diff --git a/sys/dev/wb/if_wbreg.h b/sys/dev/wb/if_wbreg.h index 16eb8a1cc2f8..a1dd905ea4d5 100644 --- a/sys/dev/wb/if_wbreg.h +++ b/sys/dev/wb/if_wbreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998 * Bill Paul . All rights reserved. * diff --git a/sys/dev/wi/if_wavelan_ieee.h b/sys/dev/wi/if_wavelan_ieee.h index c2a8e1b2fd46..dd8a9883eda3 100644 --- a/sys/dev/wi/if_wavelan_ieee.h +++ b/sys/dev/wi/if_wavelan_ieee.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/wi/if_wi_macio.c b/sys/dev/wi/if_wi_macio.c index 6f25553af013..96d2f9906fa4 100644 --- a/sys/dev/wi/if_wi_macio.c +++ b/sys/dev/wi/if_wi_macio.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2013 Justin Hibbits * All rights reserved. * Copyright (c) 1997, 1998, 1999 diff --git a/sys/dev/wi/if_wi_pccard.c b/sys/dev/wi/if_wi_pccard.c index 82c1680bd08f..22bd0d6f8dfa 100644 --- a/sys/dev/wi/if_wi_pccard.c +++ b/sys/dev/wi/if_wi_pccard.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/wi/if_wi_pci.c b/sys/dev/wi/if_wi_pci.c index 0478a6d42b25..c347f2b3f0d3 100644 --- a/sys/dev/wi/if_wi_pci.c +++ b/sys/dev/wi/if_wi_pci.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/wi/if_wireg.h b/sys/dev/wi/if_wireg.h index d5e12cabe514..4bc504e3bb9d 100644 --- a/sys/dev/wi/if_wireg.h +++ b/sys/dev/wi/if_wireg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/wi/if_wivar.h b/sys/dev/wi/if_wivar.h index 55151fe9a43d..ce9a07ad61f2 100644 --- a/sys/dev/wi/if_wivar.h +++ b/sys/dev/wi/if_wivar.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002 * M Warner Losh . All rights reserved. * Copyright (c) 1997, 1998, 1999 diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c index 4c1c238981d1..48b1962051db 100644 --- a/sys/dev/xl/if_xl.c +++ b/sys/dev/xl/if_xl.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/sys/dev/xl/if_xlreg.h b/sys/dev/xl/if_xlreg.h index b27e038e2580..56d073a6e2e8 100644 --- a/sys/dev/xl/if_xlreg.h +++ b/sys/dev/xl/if_xlreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1997, 1998 * Bill Paul . All rights reserved. * diff --git a/sys/fs/procfs/procfs.c b/sys/fs/procfs/procfs.c index 91ef0d83efd2..f6d0b90512d6 100644 --- a/sys/fs/procfs/procfs.c +++ b/sys/fs/procfs/procfs.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Dag-Erling Smørgrav * Copyright (c) 1993 Jan-Simon Pendry * Copyright (c) 1993 diff --git a/sys/fs/procfs/procfs_rlimit.c b/sys/fs/procfs/procfs_rlimit.c index 3885f566f6ea..8e16b8939e6c 100644 --- a/sys/fs/procfs/procfs_rlimit.c +++ b/sys/fs/procfs/procfs_rlimit.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1999 Adrian Chadd * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/geom/vinum/geom_vinum_share.c b/sys/geom/vinum/geom_vinum_share.c index eb70c28bcc63..5ca245a40554 100644 --- a/sys/geom/vinum/geom_vinum_share.c +++ b/sys/geom/vinum/geom_vinum_share.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004, 2007 Lukas Ertl * Copyright (c) 1997, 1998, 1999 * Nan Yang Computer Services Limited. All rights reserved. diff --git a/sys/geom/vinum/geom_vinum_subr.c b/sys/geom/vinum/geom_vinum_subr.c index a2642c29ece7..6e65a65f3389 100644 --- a/sys/geom/vinum/geom_vinum_subr.c +++ b/sys/geom/vinum/geom_vinum_subr.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004, 2007 Lukas Ertl * Copyright (c) 2007, 2009 Ulf Lilleengen * Copyright (c) 1997, 1998, 1999 diff --git a/sys/geom/vinum/geom_vinum_var.h b/sys/geom/vinum/geom_vinum_var.h index 350661c73236..ee4e30ba53d1 100644 --- a/sys/geom/vinum/geom_vinum_var.h +++ b/sys/geom/vinum/geom_vinum_var.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2004, 2007 Lukas Ertl * Copyright (c) 1997, 1998, 1999 * Nan Yang Computer Services Limited. All rights reserved. @@ -7,7 +9,7 @@ * Parts written by Greg Lehey. * * This software is distributed under the so-called ``Berkeley - * License'': * + * License'': * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: diff --git a/sys/i386/i386/longrun.c b/sys/i386/i386/longrun.c index 08fe3b1b27b1..d298ba06bacf 100644 --- a/sys/i386/i386/longrun.c +++ b/sys/i386/i386/longrun.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Tamotsu Hattori. * Copyright (c) 2001 Mitsuru IWASAKI. * All rights reserved. diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 4ea9a1583b10..68a452208582 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1992 Terrence R. Lambert. * Copyright (c) 1982, 1987, 1990 The Regents of the University of California. * All rights reserved. diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index d0dbf5162c16..0c2a507a7885 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * Copyright (c) 1994 John S. Dyson diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 2acdb6cfc4f8..6a112354c19d 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, David Greenman * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 40a84db91818..ec95c80aac78 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1982, 1986 The Regents of the University of California. * Copyright (c) 1989, 1990 William Jolitz * Copyright (c) 1994 John Dyson diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index 6e1b43ffdf27..c166d78a1486 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Steven Wallace * Copyright (c) 1994, 1995 Scott Bartram * Copyright (c) 1992, 1993 diff --git a/sys/i386/include/floatingpoint.h b/sys/i386/include/floatingpoint.h index cda9e46230ca..b7c154743d0c 100644 --- a/sys/i386/include/floatingpoint.h +++ b/sys/i386/include/floatingpoint.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1993 Andrew Moore, Talke Studio * All rights reserved. * diff --git a/sys/i386/include/ieeefp.h b/sys/i386/include/ieeefp.h index c676c4541831..9ece4e968c7b 100644 --- a/sys/i386/include/ieeefp.h +++ b/sys/i386/include/ieeefp.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 Peter Wemm. * Copyright (c) 1990 Andrew Moore, Talke Studio * All rights reserved. diff --git a/sys/isa/pnpreg.h b/sys/isa/pnpreg.h index 1b4cdc77822f..982ea98bd029 100644 --- a/sys/isa/pnpreg.h +++ b/sys/isa/pnpreg.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996, Sujal M. Patel * All rights reserved. * diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index dc4b836b7e61..645d120d9807 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Terrence R. Lambert * All rights reserved. * diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index c13baa5d3891..b1602c6bb59b 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. diff --git a/sys/kern/ksched.c b/sys/kern/ksched.c index 27aea72a3e94..bf03a46315c2 100644 --- a/sys/kern/ksched.c +++ b/sys/kern/ksched.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996, 1997 * HD Associates, Inc. All rights reserved. * diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c index 07049c7399a7..c1f51dd60a7a 100644 --- a/sys/kern/p1003_1b.c +++ b/sys/kern/p1003_1b.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996, 1997, 1998 * HD Associates, Inc. All rights reserved. * diff --git a/sys/kern/posix4_mib.c b/sys/kern/posix4_mib.c index a4d7951305d7..f95b1be832ed 100644 --- a/sys/kern/posix4_mib.c +++ b/sys/kern/posix4_mib.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1998 * HD Associates, Inc. All rights reserved. * diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index 6a5dc3f601ae..bca47edaf613 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, David Greenman * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index d382628c6e7b..6d36b2b92919 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1994, David Greenman * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/libkern/strcasecmp.c b/sys/libkern/strcasecmp.c index a7bba221d02d..cfa2d8ed9a59 100644 --- a/sys/libkern/strcasecmp.c +++ b/sys/libkern/strcasecmp.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/sys/libkern/strstr.c b/sys/libkern/strstr.c index 2f0ad6ac8ea2..b7494f3235da 100644 --- a/sys/libkern/strstr.c +++ b/sys/libkern/strstr.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/sys/mips/include/_types.h b/sys/mips/include/_types.h index d37b1bc99886..1f654c4894f5 100644 --- a/sys/mips/include/_types.h +++ b/sys/mips/include/_types.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002 Mike Barcroft * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/mips/include/cpuinfo.h b/sys/mips/include/cpuinfo.h index 5111f65f4973..cdc98ef8e098 100644 --- a/sys/mips/include/cpuinfo.h +++ b/sys/mips/include/cpuinfo.h @@ -1,6 +1,8 @@ /* $NetBSD: cpu.h,v 1.70 2003/01/17 23:36:08 thorpej Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/sys/mips/include/floatingpoint.h b/sys/mips/include/floatingpoint.h index cda9e46230ca..b7c154743d0c 100644 --- a/sys/mips/include/floatingpoint.h +++ b/sys/mips/include/floatingpoint.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1993 Andrew Moore, Talke Studio * All rights reserved. * diff --git a/sys/mips/include/reloc.h b/sys/mips/include/reloc.h index 113745f82623..7b5610bda2af 100644 --- a/sys/mips/include/reloc.h +++ b/sys/mips/include/reloc.h @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1998 John Birrell . * All rights reserved. * diff --git a/sys/mips/mips/db_disasm.c b/sys/mips/mips/db_disasm.c index 4adf6f31dfeb..8df7e0e0197e 100644 --- a/sys/mips/mips/db_disasm.c +++ b/sys/mips/mips/db_disasm.c @@ -1,5 +1,7 @@ /* $OpenBSD: db_disasm.c,v 1.1 1998/03/16 09:03:24 pefo Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/sys/mips/mips/in_cksum.c b/sys/mips/mips/in_cksum.c index 31bcd3ebdd0a..8f9a2d9de106 100644 --- a/sys/mips/mips/in_cksum.c +++ b/sys/mips/mips/in_cksum.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1992, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1996 diff --git a/sys/mips/mips/sys_machdep.c b/sys/mips/mips/sys_machdep.c index 551b30504adf..5c4941ea75af 100644 --- a/sys/mips/mips/sys_machdep.c +++ b/sys/mips/mips/sys_machdep.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * diff --git a/sys/net/fddi.h b/sys/net/fddi.h index 71e3b6fbd438..0badcc3c38b9 100644 --- a/sys/net/fddi.h +++ b/sys/net/fddi.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1995 Matt Thomas (thomas@lkg.dec.com) diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c index 6296e2e267dd..0e97125f19ef 100644 --- a/sys/net/if_arcsubr.c +++ b/sys/net/if_arcsubr.c @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1994, 1995 Ignatios Souvatzis * Copyright (c) 1982, 1989, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 67a72c1f293e..5afe0c4525ea 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -1,3 +1,5 @@ + * SPDX-License-Identifier: BSD-4-Clause + * /*- * Copyright (c) 1995, 1996 * Matt Thomas . All rights reserved. diff --git a/sys/netinet6/ip6_id.c b/sys/netinet6/ip6_id.c index 9a8086f48c53..5939ae9830cc 100644 --- a/sys/netinet6/ip6_id.c +++ b/sys/netinet6/ip6_id.c @@ -30,6 +30,8 @@ */ /*- + * SPDX-License-Identifier: BSD-4-Clause AND BSD-3-Clause + * * Copyright 1998 Niels Provos * All rights reserved. * diff --git a/sys/netsmb/smb_crypt.c b/sys/netsmb/smb_crypt.c index b647afd09ae8..394b026523a9 100644 --- a/sys/netsmb/smb_crypt.c +++ b/sys/netsmb/smb_crypt.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000-2001, Boris Popov * All rights reserved. * diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index 51c76e767755..74bee40d5846 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Gordon Ross, Adam Glass * Copyright (c) 1992 Regents of the University of California. * All rights reserved. diff --git a/sys/nfs/krpc_subr.c b/sys/nfs/krpc_subr.c index 7ec8332d2781..21e8e3ad44d0 100644 --- a/sys/nfs/krpc_subr.c +++ b/sys/nfs/krpc_subr.c @@ -1,6 +1,8 @@ /* $NetBSD: krpc_subr.c,v 1.12.4.1 1996/06/07 00:52:26 cgd Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Gordon Ross, Adam Glass * Copyright (c) 1992 Regents of the University of California. * All rights reserved. diff --git a/sys/powerpc/fpu/fpu_emu.c b/sys/powerpc/fpu/fpu_emu.c index 6d4e20cd7a82..75f44c7b786a 100644 --- a/sys/powerpc/fpu/fpu_emu.c +++ b/sys/powerpc/fpu/fpu_emu.c @@ -1,6 +1,8 @@ /* $NetBSD: fpu_emu.c,v 1.14 2005/12/11 12:18:42 christos Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 2001 Wasabi Systems, Inc. * All rights reserved. * diff --git a/sys/powerpc/include/_align.h b/sys/powerpc/include/_align.h index 6eb8be28777d..9b425b6ee1e1 100644 --- a/sys/powerpc/include/_align.h +++ b/sys/powerpc/include/_align.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 David E. O'Brien * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. diff --git a/sys/powerpc/include/_types.h b/sys/powerpc/include/_types.h index 0e5a941b4617..9ed2d8f62a13 100644 --- a/sys/powerpc/include/_types.h +++ b/sys/powerpc/include/_types.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002 Mike Barcroft * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/sys/powerpc/include/param.h b/sys/powerpc/include/param.h index a74ccf212a8f..9039d307f586 100644 --- a/sys/powerpc/include/param.h +++ b/sys/powerpc/include/param.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 David E. O'Brien * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. diff --git a/sys/powerpc/powerpc/in_cksum.c b/sys/powerpc/powerpc/in_cksum.c index f4f5fff96d05..ed0881d7520a 100644 --- a/sys/powerpc/powerpc/in_cksum.c +++ b/sys/powerpc/powerpc/in_cksum.c @@ -2,6 +2,8 @@ /* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1992, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1996 diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index 858fb1453820..cc9eea85a378 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1982, 1986 The Regents of the University of California. * Copyright (c) 1989, 1990 William Jolitz * Copyright (c) 1994 John Dyson diff --git a/sys/riscv/riscv/in_cksum.c b/sys/riscv/riscv/in_cksum.c index ae02e91d9203..30e90f043cc3 100644 --- a/sys/riscv/riscv/in_cksum.c +++ b/sys/riscv/riscv/in_cksum.c @@ -1,6 +1,8 @@ /* $NetBSD: in_cksum.c,v 1.7 1997/09/02 13:18:15 thorpej Exp $ */ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1992, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1996 diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 0fee628470f9..0fe2db214fcf 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * Copyright (c) 1994 John S. Dyson diff --git a/sys/sparc64/include/cache.h b/sys/sparc64/include/cache.h index 3d0ac4f17648..a299f2e4974a 100644 --- a/sys/sparc64/include/cache.h +++ b/sys/sparc64/include/cache.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 * The President and Fellows of Harvard College. All rights reserved. * Copyright (c) 1992, 1993 diff --git a/sys/sparc64/sparc64/cache.c b/sys/sparc64/sparc64/cache.c index 0dc3aa1662a1..5d92a4286660 100644 --- a/sys/sparc64/sparc64/cache.c +++ b/sys/sparc64/sparc64/cache.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 * The President and Fellows of Harvard College. All rights reserved. * Copyright (c) 1992, 1993 diff --git a/sys/sparc64/sparc64/eeprom.c b/sys/sparc64/sparc64/eeprom.c index 9470bafeab54..fa385ea35eb7 100644 --- a/sys/sparc64/sparc64/eeprom.c +++ b/sys/sparc64/sparc64/eeprom.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1994 Gordon W. Ross diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 6b6564668ae6..ea3bf2620dab 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Terrence R. Lambert * All rights reserved. * diff --git a/sys/sys/pioctl.h b/sys/sys/pioctl.h index 93bdbeccd2f8..1a0bf11f8794 100644 --- a/sys/sys/pioctl.h +++ b/sys/sys/pioctl.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/sys/sys/posix4.h b/sys/sys/posix4.h index 8dcf36dec335..3019c6d5ccf8 100644 --- a/sys/sys/posix4.h +++ b/sys/sys/posix4.h @@ -1,6 +1,8 @@ #ifndef _P1003_1B_P1003_1B_H_ #define _P1003_1B_P1003_1B_H_ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996, 1997, 1998 * HD Associates, Inc. All rights reserved. * diff --git a/sys/sys/sched.h b/sys/sys/sched.h index 576c8b1fc2b1..812434eba18b 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996, 1997 * HD Associates, Inc. All rights reserved. * diff --git a/sys/sys/tiio.h b/sys/sys/tiio.h index 442dceb012c0..9de9dd927587 100644 --- a/sys/sys/tiio.h +++ b/sys/sys/tiio.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause AND BSD-2-Clause-FreeBSD + * * Copyright (c) 1999, 2000 Kenneth D. Merry. * All rights reserved. * diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 19601431d440..2350c92729de 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1998 Matthew Dillon, * Copyright (c) 1994 John S. Dyson * Copyright (c) 1990 University of Utah. diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 23284a6df5ac..1b03af4314d0 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 1994 John S. Dyson diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index c61010cf81af..e6086be03850 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * Copyright (c) 1994 John S. Dyson diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index e569503cc74d..cd5a749d4f9d 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990 University of Utah. * Copyright (c) 1991 The Regents of the University of California. * All rights reserved. diff --git a/sys/x86/include/_align.h b/sys/x86/include/_align.h index 9f7b6b953236..efb8d59bb70f 100644 --- a/sys/x86/include/_align.h +++ b/sys/x86/include/_align.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 David E. O'Brien * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. diff --git a/sys/x86/include/_types.h b/sys/x86/include/_types.h index 8aa0e2ba01b7..c9a7787fcab6 100644 --- a/sys/x86/include/_types.h +++ b/sys/x86/include/_types.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002 Mike Barcroft * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. diff --git a/tools/regression/p1003_1b/fifo.c b/tools/regression/p1003_1b/fifo.c index 925e7c21368e..bf8fae0bb262 100644 --- a/tools/regression/p1003_1b/fifo.c +++ b/tools/regression/p1003_1b/fifo.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 - 2000 * HD Associates, Inc. All rights reserved. * diff --git a/tools/regression/p1003_1b/memlock.c b/tools/regression/p1003_1b/memlock.c index b55b4056dac8..3033fbbacfd5 100644 --- a/tools/regression/p1003_1b/memlock.c +++ b/tools/regression/p1003_1b/memlock.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 - 1999 * HD Associates, Inc. All rights reserved. * diff --git a/tools/regression/p1003_1b/p26.c b/tools/regression/p1003_1b/p26.c index 538deaf87863..ae869bffddf3 100644 --- a/tools/regression/p1003_1b/p26.c +++ b/tools/regression/p1003_1b/p26.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996-1999 * HD Associates, Inc. All rights reserved. * diff --git a/tools/regression/p1003_1b/sched.c b/tools/regression/p1003_1b/sched.c index 1814c79194e4..ea6fcc7a461f 100644 --- a/tools/regression/p1003_1b/sched.c +++ b/tools/regression/p1003_1b/sched.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996-1999 * HD Associates, Inc. All rights reserved. * diff --git a/tools/regression/p1003_1b/yield.c b/tools/regression/p1003_1b/yield.c index a9b7badb3452..479ce50ef886 100644 --- a/tools/regression/p1003_1b/yield.c +++ b/tools/regression/p1003_1b/yield.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996-1999 * HD Associates, Inc. All rights reserved. * diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c index 74c96beb92e7..643b0f387c3a 100644 --- a/usr.bin/chpass/chpass.c +++ b/usr.bin/chpass/chpass.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. * Copyright (c) 2002 Networks Associates Technology, Inc. diff --git a/usr.bin/chpass/chpass.h b/usr.bin/chpass/chpass.h index fd3a8390378e..b655c5dd0b59 100644 --- a/usr.bin/chpass/chpass.h +++ b/usr.bin/chpass/chpass.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. * Copyright (c) 2002 Networks Associates Technology, Inc. diff --git a/usr.bin/chpass/edit.c b/usr.bin/chpass/edit.c index ce82f8ee4644..fbe101592b3a 100644 --- a/usr.bin/chpass/edit.c +++ b/usr.bin/chpass/edit.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * Copyright (c) 2002 Networks Associates Technology, Inc. diff --git a/usr.bin/chpass/field.c b/usr.bin/chpass/field.c index eac5561a8dc2..3b5129c085a1 100644 --- a/usr.bin/chpass/field.c +++ b/usr.bin/chpass/field.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. * Copyright (c) 2002 Networks Associates Technology, Inc. diff --git a/usr.bin/chpass/util.c b/usr.bin/chpass/util.c index baf160e8762e..bfece1d4ae10 100644 --- a/usr.bin/chpass/util.c +++ b/usr.bin/chpass/util.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. * Copyright (c) 2002 Networks Associates Technology, Inc. diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index f9bffbaff26f..6113d2b3e63c 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1,6 +1,8 @@ /* $OpenBSD: diffreg.c,v 1.91 2016/03/01 20:57:35 natano Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. * diff --git a/usr.bin/indent/args.c b/usr.bin/indent/args.c index 9f5b08f2d1ce..d2d30c7d0587 100644 --- a/usr.bin/indent/args.c +++ b/usr.bin/indent/args.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1985 Sun Microsystems, Inc. * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c index 3c6f27f42585..f63b3c49aa3a 100644 --- a/usr.bin/indent/indent.c +++ b/usr.bin/indent/indent.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1985 Sun Microsystems, Inc. * Copyright (c) 1976 Board of Trustees of the University of Illinois. * Copyright (c) 1980, 1993 diff --git a/usr.bin/indent/indent_codes.h b/usr.bin/indent/indent_codes.h index 7b23997b6e70..ee9afc5f4ebb 100644 --- a/usr.bin/indent/indent_codes.h +++ b/usr.bin/indent/indent_codes.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1985 Sun Microsystems, Inc. * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/indent/indent_globs.h b/usr.bin/indent/indent_globs.h index 018badb7e89b..bdc00647e1a4 100644 --- a/usr.bin/indent/indent_globs.h +++ b/usr.bin/indent/indent_globs.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1985 Sun Microsystems, Inc. * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/indent/io.c b/usr.bin/indent/io.c index fea13c1d44f0..5f0ad9908b30 100644 --- a/usr.bin/indent/io.c +++ b/usr.bin/indent/io.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1985 Sun Microsystems, Inc. * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c index 8634591018a2..3b81ec753740 100644 --- a/usr.bin/indent/lexi.c +++ b/usr.bin/indent/lexi.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1985 Sun Microsystems, Inc. * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/indent/parse.c b/usr.bin/indent/parse.c index f6590fd253c2..c53b4447ac6d 100644 --- a/usr.bin/indent/parse.c +++ b/usr.bin/indent/parse.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1985 Sun Microsystems, Inc. * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/indent/pr_comment.c b/usr.bin/indent/pr_comment.c index 723247b77c83..6a7ce5c036dc 100644 --- a/usr.bin/indent/pr_comment.c +++ b/usr.bin/indent/pr_comment.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1985 Sun Microsystems, Inc. * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/locate/bigram/locate.bigram.c b/usr.bin/locate/bigram/locate.bigram.c index 90111e7e2516..24bd0009e97d 100644 --- a/usr.bin/locate/bigram/locate.bigram.c +++ b/usr.bin/locate/bigram/locate.bigram.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Wolfram Schneider . Berlin. * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/locate/code/locate.code.c b/usr.bin/locate/code/locate.code.c index 9a87c16bb6e6..18ee68c93527 100644 --- a/usr.bin/locate/code/locate.code.c +++ b/usr.bin/locate/code/locate.code.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Wolfram Schneider . Berlin. * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/locate/locate/fastfind.c b/usr.bin/locate/locate/fastfind.c index c15730ba5af4..e2f6d74552ec 100644 --- a/usr.bin/locate/locate/fastfind.c +++ b/usr.bin/locate/locate/fastfind.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Wolfram Schneider . Berlin. * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c index ee9d26d0fccc..31b75efd1b09 100644 --- a/usr.bin/locate/locate/locate.c +++ b/usr.bin/locate/locate/locate.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Wolfram Schneider . Berlin. * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/locate/locate/locate.h b/usr.bin/locate/locate/locate.h index c2f27fb33759..7b4f672f7d80 100644 --- a/usr.bin/locate/locate/locate.h +++ b/usr.bin/locate/locate/locate.h @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Wolfram Schneider . Berlin. * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/locate/locate/pathnames.h b/usr.bin/locate/locate/pathnames.h index 8665fd76561c..dfd8084b2598 100644 --- a/usr.bin/locate/locate/pathnames.h +++ b/usr.bin/locate/locate/pathnames.h @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/usr.bin/locate/locate/util.c b/usr.bin/locate/locate/util.c index a315d50c6a7f..fa208f3dfe8e 100644 --- a/usr.bin/locate/locate/util.c +++ b/usr.bin/locate/locate/util.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 Wolfram Schneider . Berlin. * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 525ccfcf672b..e99ee5efc2eb 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Copyright (c) 2002 Networks Associates Technologies, Inc. diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c index c1d0dd35376f..2391de8b2c9c 100644 --- a/usr.bin/netstat/mbuf.c +++ b/usr.bin/netstat/mbuf.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1983, 1988, 1993 * The Regents of the University of California. * Copyright (c) 2005 Robert N. M. Watson diff --git a/usr.bin/netstat/mroute.c b/usr.bin/netstat/mroute.c index d4d60145f18e..afc5458e5e11 100644 --- a/usr.bin/netstat/mroute.c +++ b/usr.bin/netstat/mroute.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1989 Stephen Deering * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/netstat/mroute6.c b/usr.bin/netstat/mroute6.c index 8f59c6b544cc..6360fd6ed4ee 100644 --- a/usr.bin/netstat/mroute6.c +++ b/usr.bin/netstat/mroute6.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause AND BSD-3-Clause + * * Copyright (C) 1998 WIDE Project. * All rights reserved. * diff --git a/usr.bin/pr/egetopt.c b/usr.bin/pr/egetopt.c index 22a093a61ba9..4c60204c10e0 100644 --- a/usr.bin/pr/egetopt.c +++ b/usr.bin/pr/egetopt.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991 Keith Muller. * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/pr/extern.h b/usr.bin/pr/extern.h index c39e18f89bfc..b44eb4187757 100644 --- a/usr.bin/pr/extern.h +++ b/usr.bin/pr/extern.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991 Keith Muller. * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index 0493aec0d0b7..cc6d290ca4c2 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991 Keith Muller. * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/pr/pr.h b/usr.bin/pr/pr.h index a4346c788dcc..2c9e50f6b4fa 100644 --- a/usr.bin/pr/pr.h +++ b/usr.bin/pr/pr.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1991 Keith Muller. * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.bin/rup/rup.c b/usr.bin/rup/rup.c index 239b313ce811..5f4f2b45e8bf 100644 --- a/usr.bin/rup/rup.c +++ b/usr.bin/rup/rup.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1993, John Brezak * All rights reserved. * diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c index 4d641dcd070f..381d935611b1 100644 --- a/usr.bin/rusers/rusers.c +++ b/usr.bin/rusers/rusers.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1993, John Brezak * All rights reserved. * diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c index c235ea72e560..2daa6a8b6ea7 100644 --- a/usr.bin/rwall/rwall.c +++ b/usr.bin/rwall/rwall.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1993 Christopher G. Demetriou * Copyright (c) 1988, 1990 Regents of the University of California. * All rights reserved. diff --git a/usr.bin/truss/amd64-freebsd.c b/usr.bin/truss/amd64-freebsd.c index 7e2ed160a90d..e83e916d1bc0 100644 --- a/usr.bin/truss/amd64-freebsd.c +++ b/usr.bin/truss/amd64-freebsd.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/amd64-freebsd32.c b/usr.bin/truss/amd64-freebsd32.c index 66ca417e9495..ffb76e46b8ba 100644 --- a/usr.bin/truss/amd64-freebsd32.c +++ b/usr.bin/truss/amd64-freebsd32.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/amd64-linux.c b/usr.bin/truss/amd64-linux.c index 00eb06ff75f8..ead388008a64 100644 --- a/usr.bin/truss/amd64-linux.c +++ b/usr.bin/truss/amd64-linux.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/amd64-linux32.c b/usr.bin/truss/amd64-linux32.c index 70e201adfe91..69344e9fce8f 100644 --- a/usr.bin/truss/amd64-linux32.c +++ b/usr.bin/truss/amd64-linux32.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/arm-freebsd.c b/usr.bin/truss/arm-freebsd.c index 753829005946..683ece5d22c9 100644 --- a/usr.bin/truss/arm-freebsd.c +++ b/usr.bin/truss/arm-freebsd.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/extern.h b/usr.bin/truss/extern.h index f19a1cbb7c92..dd160a7d2cc2 100644 --- a/usr.bin/truss/extern.h +++ b/usr.bin/truss/extern.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/i386-freebsd.c b/usr.bin/truss/i386-freebsd.c index 8103ca7beead..b222958df247 100644 --- a/usr.bin/truss/i386-freebsd.c +++ b/usr.bin/truss/i386-freebsd.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/i386-linux.c b/usr.bin/truss/i386-linux.c index e96db16c7a91..77185d156b4e 100644 --- a/usr.bin/truss/i386-linux.c +++ b/usr.bin/truss/i386-linux.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c index 052546a032c0..9ba7968828fc 100644 --- a/usr.bin/truss/main.c +++ b/usr.bin/truss/main.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/mips-freebsd.c b/usr.bin/truss/mips-freebsd.c index e3f2a04e97fb..cade9d65d8f6 100644 --- a/usr.bin/truss/mips-freebsd.c +++ b/usr.bin/truss/mips-freebsd.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1998 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c index 97dd9650189b..092188a4b60c 100644 --- a/usr.bin/truss/setup.c +++ b/usr.bin/truss/setup.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/sparc64-freebsd.c b/usr.bin/truss/sparc64-freebsd.c index d1ae89685de7..d9a55973e358 100644 --- a/usr.bin/truss/sparc64-freebsd.c +++ b/usr.bin/truss/sparc64-freebsd.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1998 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 251a43f6cec3..b80f5ba17444 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997 Sean Eric Fagan * * Redistribution and use in source and binary forms, with or without diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c index cf616223275c..c3bf57303b3c 100644 --- a/usr.bin/uname/uname.c +++ b/usr.bin/uname/uname.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2002 Juli Mallett. * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. diff --git a/usr.sbin/ancontrol/ancontrol.c b/usr.sbin/ancontrol/ancontrol.c index ba2419a7f90e..6d76f0770f4a 100644 --- a/usr.sbin/ancontrol/ancontrol.c +++ b/usr.sbin/ancontrol/ancontrol.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright 1997, 1998, 1999 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/dconschat/dconschat.c b/usr.sbin/dconschat/dconschat.c index dba568aac7de..6d4750585df6 100644 --- a/usr.sbin/dconschat/dconschat.c +++ b/usr.sbin/dconschat/dconschat.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/usr.sbin/fwcontrol/fwcontrol.c b/usr.sbin/fwcontrol/fwcontrol.c index 36efea16030e..48dfa4b94afc 100644 --- a/usr.sbin/fwcontrol/fwcontrol.c +++ b/usr.sbin/fwcontrol/fwcontrol.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2002 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/usr.sbin/fwcontrol/fwdv.c b/usr.sbin/fwcontrol/fwdv.c index afb3ada34e64..e35281f73735 100644 --- a/usr.sbin/fwcontrol/fwdv.c +++ b/usr.sbin/fwcontrol/fwdv.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2003 * Hidetoshi Shimokawa. All rights reserved. * diff --git a/usr.sbin/fwcontrol/fwmpegts.c b/usr.sbin/fwcontrol/fwmpegts.c index ae9a52b9db57..509d941021c8 100644 --- a/usr.sbin/fwcontrol/fwmpegts.c +++ b/usr.sbin/fwcontrol/fwmpegts.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 2005 * Petr Holub, Hidetoshi Shimokawa. All rights reserved. * diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c index d700b2a6d102..6ac694015630 100644 --- a/usr.sbin/kldxref/ef.c +++ b/usr.sbin/kldxref/ef.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000, Boris Popov * All rights reserved. * diff --git a/usr.sbin/kldxref/ef_obj.c b/usr.sbin/kldxref/ef_obj.c index e6099f2e1fe8..d35aa76e7216 100644 --- a/usr.sbin/kldxref/ef_obj.c +++ b/usr.sbin/kldxref/ef_obj.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000, Boris Popov * Copyright (c) 1998-2000 Doug Rabson * Copyright (c) 2004 Peter Wemm diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index fe28cbce24a8..493ca3435922 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2000, Boris Popov * All rights reserved. * diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 729e0c9d9887..b20855515adb 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. diff --git a/usr.sbin/lpr/common_source/net.c b/usr.sbin/lpr/common_source/net.c index c495bbbe93fb..3954b2286dc6 100644 --- a/usr.sbin/lpr/common_source/net.c +++ b/usr.sbin/lpr/common_source/net.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. diff --git a/usr.sbin/lpr/common_source/printcap.c b/usr.sbin/lpr/common_source/printcap.c index 707b7b824d9a..2cf4de4a395a 100644 --- a/usr.sbin/lpr/common_source/printcap.c +++ b/usr.sbin/lpr/common_source/printcap.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c index 9a4382f12c5f..72ba2b3929f1 100644 --- a/usr.sbin/lpr/lpr/lpr.c +++ b/usr.sbin/lpr/lpr/lpr.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index 0f686eabaa09..706f7e14f0d5 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -1,6 +1,8 @@ /* $NetBSD: ffs.c,v 1.45 2011/10/09 22:49:26 christos Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Wasabi Systems, Inc. * All rights reserved. * diff --git a/usr.sbin/manctl/manctl.sh b/usr.sbin/manctl/manctl.sh index 8264e00582ac..e79da64868a9 100644 --- a/usr.sbin/manctl/manctl.sh +++ b/usr.sbin/manctl/manctl.sh @@ -1,5 +1,7 @@ #!/bin/sh # +# SPDX-License-Identifier: BSD-4-Clause +# # Copyright (c) 1994 Geoffrey M. Rehmet, Rhodes University # All rights reserved. # diff --git a/usr.sbin/ndiscvt/inf-parse.y b/usr.sbin/ndiscvt/inf-parse.y index 2a8876d2eb5d..740aba5e87d1 100644 --- a/usr.sbin/ndiscvt/inf-parse.y +++ b/usr.sbin/ndiscvt/inf-parse.y @@ -1,5 +1,7 @@ %{ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ndiscvt/inf-token.l b/usr.sbin/ndiscvt/inf-token.l index 3e2a1278d530..56359263074e 100644 --- a/usr.sbin/ndiscvt/inf-token.l +++ b/usr.sbin/ndiscvt/inf-token.l @@ -1,5 +1,7 @@ %{ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ndiscvt/inf.c b/usr.sbin/ndiscvt/inf.c index 4b30da0a3024..eb1015083dbb 100644 --- a/usr.sbin/ndiscvt/inf.c +++ b/usr.sbin/ndiscvt/inf.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ndiscvt/ndiscvt.c b/usr.sbin/ndiscvt/ndiscvt.c index 7636c4c75059..09f7faeb3068 100644 --- a/usr.sbin/ndiscvt/ndiscvt.c +++ b/usr.sbin/ndiscvt/ndiscvt.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2003 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ndiscvt/ndisgen.sh b/usr.sbin/ndiscvt/ndisgen.sh index 1674ea105c7a..c5a0dbd4fc46 100644 --- a/usr.sbin/ndiscvt/ndisgen.sh +++ b/usr.sbin/ndiscvt/ndisgen.sh @@ -1,5 +1,7 @@ #!/bin/sh # +# SPDX-License-Identifier: BSD-4-Clause +# # Copyright (c) 2005 # Bill Paul . All rights reserved. # diff --git a/usr.sbin/ndiscvt/windrv_stub.c b/usr.sbin/ndiscvt/windrv_stub.c index 46a0e8384415..8aaa23835cba 100644 --- a/usr.sbin/ndiscvt/windrv_stub.c +++ b/usr.sbin/ndiscvt/windrv_stub.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2005 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.lockd/lock_proc.c b/usr.sbin/rpc.lockd/lock_proc.c index 3b040e5f14a0..160e1844e5a8 100644 --- a/usr.sbin/rpc.lockd/lock_proc.c +++ b/usr.sbin/rpc.lockd/lock_proc.c @@ -1,6 +1,8 @@ /* $NetBSD: lock_proc.c,v 1.7 2000/10/11 20:23:56 is Exp $ */ /* $FreeBSD$ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. * diff --git a/usr.sbin/rpc.lockd/lockd.c b/usr.sbin/rpc.lockd/lockd.c index 6ac4962c078d..a208fdbf3352 100644 --- a/usr.sbin/rpc.lockd/lockd.c +++ b/usr.sbin/rpc.lockd/lockd.c @@ -1,7 +1,9 @@ /* $NetBSD: lockd.c,v 1.7 2000/08/12 18:08:44 thorpej Exp $ */ /* $FreeBSD$ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. * diff --git a/usr.sbin/rpc.lockd/lockd.h b/usr.sbin/rpc.lockd/lockd.h index 0a8e2e60b616..23cb19fd79c6 100644 --- a/usr.sbin/rpc.lockd/lockd.h +++ b/usr.sbin/rpc.lockd/lockd.h @@ -1,7 +1,9 @@ /* $NetBSD: lockd.h,v 1.2 2000/06/07 14:34:40 bouyer Exp $ */ /* $FreeBSD$ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. * diff --git a/usr.sbin/rpc.lockd/lockd_lock.c b/usr.sbin/rpc.lockd/lockd_lock.c index 59a312df3a66..594d01f7e1ec 100644 --- a/usr.sbin/rpc.lockd/lockd_lock.c +++ b/usr.sbin/rpc.lockd/lockd_lock.c @@ -1,6 +1,8 @@ /* $NetBSD: lockd_lock.c,v 1.5 2000/11/21 03:47:41 enami Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2001 Andrew P. Lentvorski, Jr. * Copyright (c) 2000 Manuel Bouyer. * diff --git a/usr.sbin/rpc.statd/file.c b/usr.sbin/rpc.statd/file.c index beef0e4db904..c2207c73aebf 100644 --- a/usr.sbin/rpc.statd/file.c +++ b/usr.sbin/rpc.statd/file.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. * diff --git a/usr.sbin/rpc.statd/procs.c b/usr.sbin/rpc.statd/procs.c index f6067e7acb70..517c3f62414e 100644 --- a/usr.sbin/rpc.statd/procs.c +++ b/usr.sbin/rpc.statd/procs.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. * diff --git a/usr.sbin/rpc.statd/statd.c b/usr.sbin/rpc.statd/statd.c index 1a79ac2b7ed4..b789f8149106 100644 --- a/usr.sbin/rpc.statd/statd.c +++ b/usr.sbin/rpc.statd/statd.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. * diff --git a/usr.sbin/rpc.statd/statd.h b/usr.sbin/rpc.statd/statd.h index a82d760f96f2..ede159039ada 100644 --- a/usr.sbin/rpc.statd/statd.h +++ b/usr.sbin/rpc.statd/statd.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * A.R. Gordon (andrew.gordon@net-tel.co.uk). All rights reserved. * diff --git a/usr.sbin/rpc.yppasswdd/yppasswdd_extern.h b/usr.sbin/rpc.yppasswdd/yppasswdd_extern.h index db15be228a6d..563d47c2205f 100644 --- a/usr.sbin/rpc.yppasswdd/yppasswdd_extern.h +++ b/usr.sbin/rpc.yppasswdd/yppasswdd_extern.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.yppasswdd/yppasswdd_main.c b/usr.sbin/rpc.yppasswdd/yppasswdd_main.c index 38719c4a5c1a..349f1cd59e17 100644 --- a/usr.sbin/rpc.yppasswdd/yppasswdd_main.c +++ b/usr.sbin/rpc.yppasswdd/yppasswdd_main.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.yppasswdd/yppasswdd_server.c b/usr.sbin/rpc.yppasswdd/yppasswdd_server.c index ae5ca5964053..8845d0d10f9b 100644 --- a/usr.sbin/rpc.yppasswdd/yppasswdd_server.c +++ b/usr.sbin/rpc.yppasswdd/yppasswdd_server.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.ypupdated/yp_dbdelete.c b/usr.sbin/rpc.ypupdated/yp_dbdelete.c index 0552aab9d3ea..7ef145867391 100644 --- a/usr.sbin/rpc.ypupdated/yp_dbdelete.c +++ b/usr.sbin/rpc.ypupdated/yp_dbdelete.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.ypupdated/yp_dbupdate.c b/usr.sbin/rpc.ypupdated/yp_dbupdate.c index 3481a6b2b3c4..84bacb905ac3 100644 --- a/usr.sbin/rpc.ypupdated/yp_dbupdate.c +++ b/usr.sbin/rpc.ypupdated/yp_dbupdate.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.ypupdated/ypupdated_main.c b/usr.sbin/rpc.ypupdated/ypupdated_main.c index 92d8374a7162..96bf4460a251 100644 --- a/usr.sbin/rpc.ypupdated/ypupdated_main.c +++ b/usr.sbin/rpc.ypupdated/ypupdated_main.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.ypupdated/ypupdated_server.c b/usr.sbin/rpc.ypupdated/ypupdated_server.c index c4e163a50919..67fa05eceee5 100644 --- a/usr.sbin/rpc.ypupdated/ypupdated_server.c +++ b/usr.sbin/rpc.ypupdated/ypupdated_server.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_extern.h b/usr.sbin/rpc.ypxfrd/ypxfrd_extern.h index 5aba934a6ec4..165b144f2c45 100644 --- a/usr.sbin/rpc.ypxfrd/ypxfrd_extern.h +++ b/usr.sbin/rpc.ypxfrd/ypxfrd_extern.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c index 8fa3e2205b43..62420a48c0a9 100644 --- a/usr.sbin/rpc.ypxfrd/ypxfrd_main.c +++ b/usr.sbin/rpc.ypxfrd/ypxfrd_main.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c index 5f60712e9fef..ca8a2a3c4fe4 100644 --- a/usr.sbin/rpc.ypxfrd/ypxfrd_server.c +++ b/usr.sbin/rpc.ypxfrd/ypxfrd_server.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/rrenumd/rrenumd.h b/usr.sbin/rrenumd/rrenumd.h index df0280b2591e..2e9390d023fd 100644 --- a/usr.sbin/rrenumd/rrenumd.h +++ b/usr.sbin/rrenumd/rrenumd.h @@ -1,6 +1,8 @@ /* $KAME: rrenumd.h,v 1.2 2000/07/03 02:54:09 itojun Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (C) 1998 WIDE Project. * All rights reserved. * diff --git a/usr.sbin/wpa/ndis_events/ndis_events.c b/usr.sbin/wpa/ndis_events/ndis_events.c index b61fd0a297ab..cfd971af8ea1 100644 --- a/usr.sbin/wpa/ndis_events/ndis_events.c +++ b/usr.sbin/wpa/ndis_events/ndis_events.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2005 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/wpa/wpa_supplicant/Packet32.c b/usr.sbin/wpa/wpa_supplicant/Packet32.c index 8e7da035af95..3f852b722080 100644 --- a/usr.sbin/wpa/wpa_supplicant/Packet32.c +++ b/usr.sbin/wpa/wpa_supplicant/Packet32.c @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2005 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/wpa/wpa_supplicant/Packet32.h b/usr.sbin/wpa/wpa_supplicant/Packet32.h index e0598e70d4fd..c96553afc8a1 100644 --- a/usr.sbin/wpa/wpa_supplicant/Packet32.h +++ b/usr.sbin/wpa/wpa_supplicant/Packet32.h @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 2005 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/yp_mkdb/yp_mkdb.c b/usr.sbin/yp_mkdb/yp_mkdb.c index 290e40500de6..c8c545306e18 100644 --- a/usr.sbin/yp_mkdb/yp_mkdb.c +++ b/usr.sbin/yp_mkdb/yp_mkdb.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ypbind/yp_ping.c b/usr.sbin/ypbind/yp_ping.c index 2efc7a2d0617..d65c5eb695e2 100644 --- a/usr.sbin/ypbind/yp_ping.c +++ b/usr.sbin/ypbind/yp_ping.c @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996, 1997 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/yppush/yppush_main.c b/usr.sbin/yppush/yppush_main.c index 5a712e5a41b0..e5e852280095 100644 --- a/usr.sbin/yppush/yppush_main.c +++ b/usr.sbin/yppush/yppush_main.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ypserv/yp_access.c b/usr.sbin/ypserv/yp_access.c index dddde7405bba..bee8dd4231dd 100644 --- a/usr.sbin/ypserv/yp_access.c +++ b/usr.sbin/ypserv/yp_access.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ypserv/yp_dblookup.c b/usr.sbin/ypserv/yp_dblookup.c index ecd90522f7ad..291daba0da09 100644 --- a/usr.sbin/ypserv/yp_dblookup.c +++ b/usr.sbin/ypserv/yp_dblookup.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ypserv/yp_dnslookup.c b/usr.sbin/ypserv/yp_dnslookup.c index 6534967cfa98..b33b80c2e82c 100644 --- a/usr.sbin/ypserv/yp_dnslookup.c +++ b/usr.sbin/ypserv/yp_dnslookup.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995, 1996 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ypserv/yp_error.c b/usr.sbin/ypserv/yp_error.c index a5b12902d0d1..9bc287280c76 100644 --- a/usr.sbin/ypserv/yp_error.c +++ b/usr.sbin/ypserv/yp_error.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ypserv/yp_extern.h b/usr.sbin/ypserv/yp_extern.h index 2e574b6c3bfe..4a1c6b3528dc 100644 --- a/usr.sbin/ypserv/yp_extern.h +++ b/usr.sbin/ypserv/yp_extern.h @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c index 8c538ca8ca46..d0fff1eb1e8d 100644 --- a/usr.sbin/ypserv/yp_main.c +++ b/usr.sbin/ypserv/yp_main.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ypserv/yp_server.c b/usr.sbin/ypserv/yp_server.c index 304fd50efe34..828957788b2b 100644 --- a/usr.sbin/ypserv/yp_server.c +++ b/usr.sbin/ypserv/yp_server.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1995 * Bill Paul . All rights reserved. * diff --git a/usr.sbin/ypserv/yp_svc_udp.c b/usr.sbin/ypserv/yp_svc_udp.c index 33d058ef9b87..c865c01d9b7e 100644 --- a/usr.sbin/ypserv/yp_svc_udp.c +++ b/usr.sbin/ypserv/yp_svc_udp.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1996 * Bill Paul . All rights reserved. * From 3aa239f18776f900fdbfc370d41a54e694a4156e Mon Sep 17 00:00:00 2001 From: Mariusz Zaborski Date: Sat, 18 Nov 2017 15:34:31 +0000 Subject: [PATCH 66/92] Remove unused Casper configurations files. This is a reaming of Casper daemon. --- ObsoleteFiles.inc | 7 +++++++ etc/Makefile | 3 --- etc/casper/Makefile | 12 ------------ etc/casper/system.dns | 1 - etc/casper/system.grp | 1 - etc/casper/system.pwd | 1 - etc/casper/system.random | 1 - etc/casper/system.sysctl | 1 - 8 files changed, 7 insertions(+), 20 deletions(-) delete mode 100644 etc/casper/Makefile delete mode 100644 etc/casper/system.dns delete mode 100644 etc/casper/system.grp delete mode 100644 etc/casper/system.pwd delete mode 100644 etc/casper/system.random delete mode 100644 etc/casper/system.sysctl diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 54267ad3aaef..8c5afe102afe 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -38,6 +38,13 @@ # xargs -n1 | sort | uniq -d; # done +# 20171118: Remove old etc capser failes +OLD_FILES+=etc/casper/system.dns +OLD_FILES+=etc/casper/system.grp +OLD_FILES+=etc/casper/system.pwd +OLD_FILES+=etc/casper/system.random +OLD_FILES+=etc/casper/system.sysctl +OLD_DIRS+=etc/casper # 20171116: lint(1) removal OLD_FILES+=usr/bin/lint OLD_FILES+=usr/libexec/lint1 diff --git a/etc/Makefile b/etc/Makefile index 17b34b791183..641cf2dcfe6e 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -227,9 +227,6 @@ distribution: .endif .if ${MK_BLUETOOTH} != "no" ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install -.endif -.if ${MK_CASPER} != "no" - ${_+_}cd ${.CURDIR}/casper; ${MAKE} install .endif ${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install diff --git a/etc/casper/Makefile b/etc/casper/Makefile deleted file mode 100644 index d1cd9f4da4a4..000000000000 --- a/etc/casper/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# $FreeBSD$ - -FILES= system.dns -FILES+= system.grp -FILES+= system.pwd -FILES+= system.random -FILES+= system.sysctl - -NO_OBJ= -FILESDIR= /etc/casper - -.include diff --git a/etc/casper/system.dns b/etc/casper/system.dns deleted file mode 100644 index b3c1ca069224..000000000000 --- a/etc/casper/system.dns +++ /dev/null @@ -1 +0,0 @@ -/libexec/casper/dns diff --git a/etc/casper/system.grp b/etc/casper/system.grp deleted file mode 100644 index 32eea2ca1d1f..000000000000 --- a/etc/casper/system.grp +++ /dev/null @@ -1 +0,0 @@ -/libexec/casper/grp diff --git a/etc/casper/system.pwd b/etc/casper/system.pwd deleted file mode 100644 index a5f7c2529a3b..000000000000 --- a/etc/casper/system.pwd +++ /dev/null @@ -1 +0,0 @@ -/libexec/casper/pwd diff --git a/etc/casper/system.random b/etc/casper/system.random deleted file mode 100644 index ac98b356b1c6..000000000000 --- a/etc/casper/system.random +++ /dev/null @@ -1 +0,0 @@ -/libexec/casper/random diff --git a/etc/casper/system.sysctl b/etc/casper/system.sysctl deleted file mode 100644 index 9f80c5d8b539..000000000000 --- a/etc/casper/system.sysctl +++ /dev/null @@ -1 +0,0 @@ -/libexec/casper/sysctl From 784775678127bf83f51be255b93900ccb67751f5 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 16:07:53 +0000 Subject: [PATCH 67/92] dts: Allwinner: Remove our last custom DTS All Allwinner boards should use the upstream DTS so remove our remaining custom ones. --- sys/dts/arm/a83t.dtsi | 290 ------------ sys/dts/arm/h3.dtsi | 107 ----- sys/dts/arm/nanopi-neo.dts | 69 --- sys/dts/arm/orangepi-plus-2e.dts | 119 ----- sys/dts/arm/sinovoip-bpi-m3.dts | 171 ------- sys/dts/arm/sun7i-a20-hdmi.dtsi | 97 ---- sys/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts | 81 ---- sys/dts/arm/sun8i-a83t.dtsi | 510 --------------------- sys/dts/arm/sun8i-h3-nanopi-neo.dts | 128 ------ sys/dts/arm/xpowers-axp209.dtsi | 33 -- sys/modules/dtb/allwinner/Makefile | 7 +- 11 files changed, 3 insertions(+), 1609 deletions(-) delete mode 100644 sys/dts/arm/a83t.dtsi delete mode 100644 sys/dts/arm/h3.dtsi delete mode 100644 sys/dts/arm/nanopi-neo.dts delete mode 100644 sys/dts/arm/orangepi-plus-2e.dts delete mode 100644 sys/dts/arm/sinovoip-bpi-m3.dts delete mode 100644 sys/dts/arm/sun7i-a20-hdmi.dtsi delete mode 100644 sys/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts delete mode 100644 sys/dts/arm/sun8i-a83t.dtsi delete mode 100644 sys/dts/arm/sun8i-h3-nanopi-neo.dts delete mode 100644 sys/dts/arm/xpowers-axp209.dtsi diff --git a/sys/dts/arm/a83t.dtsi b/sys/dts/arm/a83t.dtsi deleted file mode 100644 index 1a31987e6718..000000000000 --- a/sys/dts/arm/a83t.dtsi +++ /dev/null @@ -1,290 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - cpus { - cpu@0 { - clocks = <&c0_cpux_clk>; - clock-latency = <2000000>; - }; - - cpu@100 { - clocks = <&c1_cpux_clk>; - clock-latency = <2000000>; - }; - }; - - pmu { - compatible = "arm,cortex-a7-pmu", "arm,cortex-a15-pmu"; - - /* Cluster 0 only */ - interrupts = , - , - , - ; - }; - - clocks { - pll_c0cpux: clk@01c20000 { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a83t-pllcpux-clk"; - reg = <0x01c20000 0x4>; - clocks = <&osc24M>; - clock-output-names = "pll_c0cpux"; - }; - - pll_c1cpux: clk@01c20004 { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a83t-pllcpux-clk"; - reg = <0x01c20004 0x4>; - clocks = <&osc24M>; - clock-output-names = "pll_c1cpux"; - }; - - c0_cpux_clk: c0clk@01c20050 { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a83t-c0cpu-clk"; - reg = <0x01c20050 0x4>; - clocks = <&osc24M>, <&pll_c0cpux>; - clock-output-names = "c0_cpux"; - }; - - c1_cpux_clk: c1clk@01c20050 { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a83t-c1cpu-clk"; - reg = <0x01c20050 0x4>; - clocks = <&osc24M>, <&pll_c1cpux>; - clock-output-names = "c1_cpux"; - }; - - /* cpus_clk compatible in gnu dt is incorrect */ - cpus_clk: clk@01f01400 { - compatible = "allwinner,sun8i-a83t-cpus-clk"; - }; - - pll_hsic: clk@01c20044 { - #clock-cells = <0>; - compatible = "allwinner,sun9i-a80-pll4-clk"; - reg = <0x01c20044 0x4>; - clocks = <&osc24M>; - clock-output-names = "pll_hsic"; - }; - - usb_clk: clk@01c200cc { - #clock-cells = <1>; - #reset-cells = <1>; - compatible = "allwinner,sun8i-a83t-usb-clk"; - reg = <0x01c200cc 0x4>; - clocks = <&osc24M>, <&pll_hsic>; - clock-indices = <8>, <9>, - <10>, <11>, - <16>; - clock-output-names = "usb_phy0", "usb_phy1", - "usb_hsic_pll", "usb_hsic_12m", - "usb_ohci0"; - }; - - mii_phy_tx_clk: clk@1 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <25000000>; - clock-output-names = "mii_phy_tx"; - }; - - emac_int_tx_clk: clk@2 { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <125000000>; - clock-output-names = "emac_int_tx"; - }; - - emac_tx_clk: clk@01c00030 { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a83t-emac-clk"; - reg = <0x01c00030 0x4>; - clocks = <&mii_phy_tx_clk>, <&emac_int_tx_clk>; - clock-output-names = "emac_tx"; - }; - }; - - soc { - nmi_intc: interrupt-controller@01f00c0c { - compatible = "allwinner,sun6i-a31-sc-nmi"; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x01f00c0c 0x38>; - interrupts = ; - }; - - i2c0: i2c@01c2ac00 { - compatible = "allwinner,sun8i-a83t-i2c"; - reg = <0x01c2ac00 0x400>; - interrupts = ; - clocks = <&bus_gates 96>; - resets = <&apb2_reset 0>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - i2c1: i2c@01c2b000 { - compatible = "allwinner,sun8i-a83t-i2c"; - reg = <0x01c2b000 0x400>; - interrupts = ; - clocks = <&bus_gates 97>; - resets = <&apb2_reset 1>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - i2c2: i2c@01c2b400 { - compatible = "allwinner,sun8i-a83t-i2c"; - reg = <0x01c2b400 0x400>; - interrupts = ; - clocks = <&bus_gates 98>; - resets = <&apb2_reset 2>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - usbphy: phy@01c19400 { - compatible = "allwinner,sun8i-a83t-usb-phy"; - reg = <0x01c19400 0x2c>, - <0x01c1a800 0x4>, - <0x01c1b800 0x4>; - clocks = <&usb_clk 8>, - <&usb_clk 9>, - <&usb_clk 10>, - <&usb_clk 11>; - clock-names = "usb0_phy", - "usb1_phy", - "hsic_pll", - "hsic_12m"; - resets = <&usb_clk 0>, - <&usb_clk 1>, - <&usb_clk 2>; - reset-names = "usb0_reset", - "usb1_reset", - "usb2_reset"; - status = "disabled"; - #phy-cells = <1>; - }; - - ehci0: usb@01c1a000 { - compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci"; - reg = <0x01c1a000 0x100>; - interrupts = ; - clocks = <&bus_gates 26>; - resets = <&ahb_reset 26>; - phys = <&usbphy 1>; - phy-names = "usb"; - status = "disabled"; - }; - - ehci1: usb@01c1b000 { - compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci"; - reg = <0x01c1b000 0x100>; - interrupts = ; - clocks = <&bus_gates 27>; - resets = <&ahb_reset 27>; - phys = <&usbphy 2>; - phy-names = "usb"; - status = "disabled"; - }; - - emac: ethernet@01c30000 { - compatible = "allwinner,sun8i-a83t-emac"; - reg = <0x01c30000 0x100>; - interrupts = ; - interrupt-names = "macirq"; - clocks = <&bus_gates 17>, <&emac_tx_clk>; - clock-names = "ahb", "tx"; - resets = <&ahb_reset 17>; - reset-names = "ahb"; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - sid: eeprom@01c14000 { - compatible = "allwinner,sun8i-a83t-sid"; - reg = <0x01c14000 0x400>; - }; - - rtp: rtp@01f04000 { - compatible = "allwinner,sun8i-a83t-ts"; - reg = <0x01f04000 0x400>; - interrupts = ; - #thermal-sensor-cells = <0>; - }; - }; -}; - -&pio { - mmc2_8bit_pins: mmc2_8bit { - allwinner,pins = "PC5", "PC6", "PC8", - "PC9", "PC10", "PC11", - "PC12", "PC13", "PC14", - "PC15", "PC16"; - allwinner,function = "mmc2"; - allwinner,drive = ; - allwinner,pull = ; - }; - - emac_pins_rgmii_a: emac_rgmii@0 { - allwinner,pins = "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", - "PD11", "PD12", "PD13", "PD14", - "PD18", "PD19", "PD20", "PD21", "PD22", "PD23"; - allwinner,function = "emac"; - allwinner,drive = ; - allwinner,pull = ; - }; - - i2c0_pins_a: i2c0@0 { - allwinner,pins = "PH0", "PH1"; - allwinner,function = "i2c0"; - allwinner,drive = ; - allwinner,pull = ; - }; - - i2c1_pins_a: i2c1@0 { - allwinner,pins = "PH2", "PH3"; - allwinner,function = "i2c1"; - allwinner,drive = ; - allwinner,pull = ; - }; - - i2c2_pins_a: i2c2@0 { - allwinner,pins = "PH4", "PH5"; - allwinner,function = "i2c2"; - allwinner,drive = ; - allwinner,pull = ; - }; -}; diff --git a/sys/dts/arm/h3.dtsi b/sys/dts/arm/h3.dtsi deleted file mode 100644 index 078b802c0669..000000000000 --- a/sys/dts/arm/h3.dtsi +++ /dev/null @@ -1,107 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - cpus { - cpu0: cpu@0 { - clocks = <&ccu CLK_CPUX>; - clock-latency = <2000000>; - }; - }; - - soc { - emac: ethernet@1c30000 { - compatible = "allwinner,sun8i-h3-emac"; - reg = <0x01c30000 0x104>, <0x01c00030 0x4>; - reg-names = "emac", "syscon"; - interrupts = ; - resets = <&ccu RST_BUS_EMAC>, <&ccu RST_BUS_EPHY>; - reset-names = "ahb", "ephy"; - clocks = <&ccu CLK_BUS_EMAC>, <&ccu CLK_BUS_EPHY>; - clock-names = "ahb", "ephy"; - #address-cells = <1>; - #size-cells = <0>; - status = "disabled"; - }; - - r_i2c: i2c@1f02400 { - compatible = "allwinner,sun6i-a31-i2c"; - reg = <0x01f02400 0x400>; - interrupts = ; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - sid: eeprom@1c14000 { - compatible = "allwinner,sun8i-a83t-sid"; - reg = <0x01c14000 0x400>; - }; - - rtp: rtp@1c25000 { - compatible = "allwinner,sun8i-h3-ts"; - reg = <0x01c25000 0x400>; - interrupts = ; - clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; - clock-names = "ahb", "ths"; - resets = <&ccu RST_BUS_THS 8>; - #thermal-sensor-cells = <0>; - }; - - /* codec: codec@01c22c00 { */ - /* compatible = "allwinner,sun8i-h3-codec"; */ - /* reg = <0x01c22c00 0x100>, <0x01f015c0 0x4>; */ - /* reg-names = "codec", "pr"; */ - /* interrupts = ; */ - /* clocks = <&ccu CLK_BUS_CODEC>, <&codec_clk>; */ - /* clock-names = "ahb", "codec"; */ - /* resets = <&ahb_rst 128>; */ - /* reset-names = "ahb"; */ - /* dmas = <&dma 15>, <&dma 15>; */ - /* dma-names = "rx", "tx"; */ - /* status = "disabled"; */ - /* }; */ - - }; -}; - -&pio { - emac_pins_rgmii_a: emac_rgmii@0 { - allwinner,pins = "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", - "PD7", "PD8", "PD9", "PD10", "PD12", "PD13", - "PD15", "PD16", "PD17"; - allwinner,function = "emac"; - allwinner,drive = <40>; - }; - - emac_phy_reset_pin: emac_phy_reset_pin@0 { - allwinner,pins = "PD6"; - allwinner,function = "gpio_out"; - allwinner,drive = <10>; - }; -}; diff --git a/sys/dts/arm/nanopi-neo.dts b/sys/dts/arm/nanopi-neo.dts deleted file mode 100644 index d227209ade6b..000000000000 --- a/sys/dts/arm/nanopi-neo.dts +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "sun8i-h3-nanopi-neo.dts" -#include "h3.dtsi" - -/ { - vdd_cpu: reg_cpux_vset { - compatible = "regulator-gpio"; - - regulator-name = "cpux-supply"; - regulator-min-microvolt = <1100000>; - regulator-max-microvolt = <1300000>; - regulator-boot-on; - - gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* GPIOL6 */ - states = <1300000 0x1 - 1100000 0x0>; - - enable-active-high; - }; -}; - -&emac { - phy = <&phy1>; - phy-mode = "mii"; - allwinner,use-internal-phy; - allwinner,leds-active-low; - status = "okay"; - - phy1: ethernet-phy@1 { - reg = <1>; - }; -}; - -&cpu0 { - cpu-supply = <&vdd_cpu>; - operating-points = < - /* kHz uV */ - 1008000 1300000 - 816000 1100000 - 480000 1100000 - >; -}; diff --git a/sys/dts/arm/orangepi-plus-2e.dts b/sys/dts/arm/orangepi-plus-2e.dts deleted file mode 100644 index 28298cac50e5..000000000000 --- a/sys/dts/arm/orangepi-plus-2e.dts +++ /dev/null @@ -1,119 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "sun8i-h3-orangepi-plus.dts" -#include "h3.dtsi" - -/ { - model = "Xunlong Orange Pi Plus 2E"; - compatible = "xunlong,orangepi-plus-2e", "allwinner,sun8i-h3"; - - reg_gmac_3v3: gmac-3v3 { - compatible = "regulator-fixed"; - pinctrl-names = "default"; - pinctrl-0 = <&emac_phy_reset_pin>; - regulator-name = "gmac-3v3"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - startup-delay-us = <100000>; - enable-active-high; - gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; - }; -}; - -&pio { - emac_phy_reset_pin: emac_phy_reset_pin@0 { - allwinner,pins = "PD6"; - allwinner,function = "gpio_out"; - allwinner,drive = <10>; - }; - - codec_pa_pin: codec_pa_pin@0 { - allwinner,pins = "PA16"; - allwinner,function = "gpio_out"; - allwinner,drive = <10>; - }; -}; - -&emac { - pinctrl-names = "default"; - pinctrl-0 = <&emac_pins_rgmii_a>; - phy-supply = <®_gmac_3v3>; - phy-mode = "rgmii"; - phy = <&phy1>; - - allwinner,leds-active-low; - status = "okay"; - - phy1: ethernet-phy@1 { - reg = <1>; - }; -}; - -&ehci2 { - status = "okay"; -}; - -&i2c0 { - status = "okay"; -}; - -&r_i2c { - status = "okay"; - - vdd_cpu: regulator@65 { - compatible = "silergy,sy8106a"; - reg = <0x65>; - - regulator-name = "vdd-cpu"; - regulator-min-microvolt = <1000000>; - regulator-max-microvolt = <1400000>; - regulator-ramp-delay = <200>; - regulator-boot-on; - regulator-always-on; - }; -}; - -/* &codec { */ -/* pinctrl-names = "default"; */ -/* pinctrl-0 = <&codec_pa_pin>; */ -/* allwinner,pa-gpios = <&pio 0 16 GPIO_ACTIVE_HIGH>; /\* PA16 *\/ */ -/* status = "okay"; */ -/* }; */ - -&cpu0 { - cpu-supply = <&vdd_cpu>; - operating-points = < - /* kHz uV */ - 1296000 1340000 - 1200000 1320000 - 1008000 1200000 - 816000 1100000 - 648000 1040000 - >; -}; diff --git a/sys/dts/arm/sinovoip-bpi-m3.dts b/sys/dts/arm/sinovoip-bpi-m3.dts deleted file mode 100644 index b88ef52ff22d..000000000000 --- a/sys/dts/arm/sinovoip-bpi-m3.dts +++ /dev/null @@ -1,171 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "sun8i-a83t-sinovoip-bpi-m3.dts" -#include "a83t.dtsi" - -/ { - cpus { - cpu@0 { - cpu-supply = <®_dcdc2>; - operating-points = < - /* kHz uV */ - 1200000 840000 - 1008000 840000 - 648000 840000 - 408000 840000 - >; - }; - - cpu@100 { - cpu-supply = <®_dcdc3>; - operating-points = < - /* kHz uV */ - 1200000 840000 - 1008000 840000 - 648000 840000 - 408000 840000 - >; - }; - }; -}; - -&ehci0 { - status = "okay"; -}; - -&ehci1 { - status = "okay"; -}; - -®_ahci_5v { - gpio = <&pio 3 25 GPIO_ACTIVE_HIGH>; /* PD25 */ - status = "okay"; -}; - -&ahci_pwr_pin_a { - allwinner,pins = "PD25"; -}; - -®_usb1_vbus { - gpio = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ - status = "okay"; -}; - -&usb1_vbus_pin_a { - allwinner,pins = "PD24"; -}; - -&usbphy { - usb1_vbus-supply = <®_usb1_vbus>; - status = "okay"; -}; - -&mmc2 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc2_8bit_pins>; - vmmc-supply = <®_vcc3v3>; - bus-width = <8>; - non-removable; - status = "okay"; -}; - -&emac { - pinctrl-names = "default"; - pinctrl-0 = <&emac_pins_rgmii_a>; - phy = <&phy1>; - phy-mode = "rgmii"; - status = "okay"; - - phy1: ethernet-phy@1 { - reg = <1>; - }; -}; - -&emac_tx_clk { - /* EMAC transmit/receive clock delay chain values for BPI-M3 */ - tx-delay = <0x7>; - rx-delay = <0x7>; -}; - -&i2c0 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c0_pins_a>; - status = "okay"; -}; - -&i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -}; - -&i2c2 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -}; - -&r_rsb { - status = "okay"; - - axp81x: pmic@3a3 { - compatible = "x-powers,axp813"; - reg = <0x3a3>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; - gpio-controller; - #gpio-cells = <1>; - - regulators { - reg_dcdc2: dcdc2 { - regulator-name = "dcdc2"; - }; - - reg_dcdc3: dcdc3 { - regulator-name = "dcdc3"; - }; - }; - }; -}; - -/ { - leds { - compatible = "gpio-leds"; - - green_led { - gpios = <&axp81x 0>; /* AXP PMIC GPIO0 */ - label = "green_led"; - }; - - blue_led { - gpios = <&axp81x 1>; /* AXP PMIC GPIO1 */ - label = "blue_led"; - }; - }; -}; diff --git a/sys/dts/arm/sun7i-a20-hdmi.dtsi b/sys/dts/arm/sun7i-a20-hdmi.dtsi deleted file mode 100644 index c83d6a2c1d99..000000000000 --- a/sys/dts/arm/sun7i-a20-hdmi.dtsi +++ /dev/null @@ -1,97 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - clocks { - hdmi_clk: clk@01c20150 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-hdmi-clk"; - reg = <0x01c20150 0x4>; - clocks = <&pll3>, <&pll7>, <&pll3x2>, <&pll7x2>; - clock-output-names = "hdmi"; - }; - - lcd0_ch0_clk: clk@01c20118 { - #clock-cells = <0>; - #reset-cells = <0>; - compatible = "allwinner,sun4i-a10-lcd-ch0-clk"; - reg = <0x01c20118 0x4>; - clocks = <&pll3>, <&pll7>, <&pll3x2>, <&pll6 2>; - clock-output-names = "lcd0_ch0"; - }; - - lcd0_ch1_clk: clk@01c2012c { - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-lcd-ch1-clk"; - reg = <0x01c2012c 0x4>; - clocks = <&pll3>, <&pll7>, <&pll3x2>, <&pll7x2>; - clock-output-names = "lcd0_ch1_sclk1", - "lcd0_ch1_sclk2"; - }; - - de_be0_clk: clk@01c20104 { - #clock-cells = <0>; - #reset-cells = <0>; - compatible = "allwinner,sun4i-a10-de-be-clk"; - reg = <0x01c20104 0x4>; - clocks = <&pll3>, <&pll7>, <&pll5 1>; - clock-output-names = "de_be0"; - }; - }; - - soc@01c00000 { - hdmi: hdmi@01c16000 { - compatible = "allwinner,sun7i-a20-hdmi"; - reg = <0x01c16000 0x1000>; - clocks = <&ahb_gates 43>, <&hdmi_clk>, - <&lcd0_ch1_clk 1>; - clock-names = "ahb", "hdmi", - "lcd"; - status = "disabled"; - }; - - hdmiaudio { - compatible = "allwinner,sun7i-a20-hdmiaudio"; - status = "disabled"; - }; - - fb: fb@01e60000 { - compatible = "allwinner,sun7i-a20-fb"; - reg = <0x01e60000 0x10000>, /* DEBE0 */ - <0x01c0c000 0x1000>; /* LCD0 */ - clocks = <&ahb_gates 44>, <&dram_gates 26>, - <&de_be0_clk>, <&ahb_gates 36>, - <&lcd0_ch1_clk 0>, <&lcd0_ch1_clk 1>; - clock-names = "ahb_de_be", "dram_de_be", - "de_be", "ahb_lcd", - "lcd_ch1_sclk1", "lcd_ch1_sclk2"; - resets = <&de_be0_clk>, <&lcd0_ch0_clk>; - reset-names = "de_be", "lcd"; - }; - }; -}; diff --git a/sys/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts b/sys/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts deleted file mode 100644 index f019bfca4ea8..000000000000 --- a/sys/dts/arm/sun8i-a83t-sinovoip-bpi-m3.dts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2016 Vishnu Patekar - * Vishnu Patekar - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -/dts-v1/; -#include "sun8i-a83t.dtsi" -#include "sunxi-common-regulators.dtsi" - -/ { - model = "Sinovoip BananaPi M3 v1.2"; - compatible = "sinovoip,bpi-m3", "allwinner,sun8i-a83t"; - - aliases { - serial0 = &uart0; - }; - - chosen { - stdout-path = "serial0:115200n8"; - }; -}; - -&mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; - vmmc-supply = <®_vcc3v0>; - cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ - bus-width = <4>; - cd-inverted; - status = "okay"; -}; - -&r_rsb { - status = "okay"; -}; - -&uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_b>; - status = "okay"; -}; diff --git a/sys/dts/arm/sun8i-a83t.dtsi b/sys/dts/arm/sun8i-a83t.dtsi deleted file mode 100644 index 4e421423236e..000000000000 --- a/sys/dts/arm/sun8i-a83t.dtsi +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Copyright 2015 Vishnu Patekar - * - * Vishnu Patekar - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -#include "skeleton.dtsi" - -#include - -#include - -/ { - interrupt-parent = <&gic>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0>; - }; - - cpu@1 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <1>; - }; - - cpu@2 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <2>; - }; - - cpu@3 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <3>; - }; - - cpu@100 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0x100>; - }; - - cpu@101 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0x101>; - }; - - cpu@102 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0x102>; - }; - - cpu@103 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; - reg = <0x103>; - }; - }; - - timer { - compatible = "arm,armv7-timer"; - interrupts = , - , - , - ; - }; - - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - /* TODO: PRCM block has a mux for this. */ - osc24M: osc24M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <24000000>; - clock-output-names = "osc24M"; - }; - - /* - * This is called "internal OSC" in some places. - * It is an internal RC-based oscillator. - * TODO: Its controls are in the PRCM block. - */ - osc16M: osc16M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <16000000>; - clock-output-names = "osc16M"; - }; - - osc16Md512: osc16Md512_clk { - #clock-cells = <0>; - compatible = "fixed-factor-clock"; - clock-div = <512>; - clock-mult = <1>; - clocks = <&osc16M>; - clock-output-names = "osc16M-d512"; - }; - - pll6: clk@01c20028 { - #clock-cells = <0>; - compatible = "allwinner,sun9i-a80-pll4-clk"; - reg = <0x01c20028 0x4>; - clocks = <&osc24M>; - clock-output-names = "pll6"; - }; - - pll6d2: pll6d2_clk { - #clock-cells = <0>; - compatible = "fixed-factor-clock"; - clock-div = <2>; - clock-mult = <1>; - clocks = <&pll6>; - clock-output-names = "pll6d2"; - }; - - ahb1: clk@01c20054 { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a83t-ahb1-clk"; - reg = <0x01c20054 0x4>; - clocks = <&osc16Md512>, <&osc24M>, <&pll6>, <&pll6>; - clock-output-names = "ahb1"; - }; - - apb1: apb1_clk@01c20054 { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a83t-apb1-clk"; - reg = <0x01c20054 0x4>; - clocks = <&ahb1>; - clock-output-names = "apb1"; - }; - - apb2: clk@01c20058 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-apb1-clk"; - reg = <0x01c20058 0x4>; - clocks = <&osc16Md512>, <&osc24M>, <&pll6>, <&pll6>; - clock-output-names = "apb2"; - }; - - ahb2: clk@01c2005c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-h3-ahb2-clk"; - reg = <0x01c2005c 0x4>; - clocks = <&ahb1>, <&pll6d2>; - clock-output-names = "ahb2"; - }; - - bus_gates: clk@01c20060 { - #clock-cells = <1>; - compatible = "allwinner,sun8i-a83t-bus-gates-clk"; - reg = <0x01c20060 0x10>; - clocks = <&ahb1>, <&ahb2>, <&apb1>, <&apb2>; - clock-names = "ahb1", "ahb2", "apb1", "apb2"; - clock-indices = <1>, <5>, <6>, - <8>, <9>, <10>, - <13>, <14>, <17>, - <19>, <20>, - <21>, <24>, - <26>, <27>, - <29>, <32>, - <36>, <37>, - <40>, <43>, - <44>, <52>, <53>, - <54>, <65>, - <69>, <76>, <77>, - <78>, <79>, <96>, - <97>, <98>, - <112>, <113>, - <114>, <115>, - <116>; - clock-output-names = "bus_mipidsi", "bus_ss", "bus_dma", - "bus_mmc0", "bus_mmc1", "bus_mmc2", - "bus_nand", "bus_sdram", "bus_emac", - "bus_hstimer", "bus_spi0", - "bus_spi1", "bus_usb_otg", - "bus_ehci0", "bus_ehci1", - "bus_ohci0", "bus_ve", - "bus_lcd0", "bus_lcd1", - "bus_csi", "bus_hdmi", - "bus_de", "bus_gpu", "bus_msgbox", - "bus_spinlock", "bus_spdif", - "bus_pio", "bus_i2s0", "bus_i2s1", - "bus_i2s2", "bus_tdm", "bus_i2c0", - "bus_i2c1", "bus_i2c2", - "bus_uart0", "bus_uart1", - "bus_uart2", "bus_uart3", - "bus_uart4"; - }; - - mmc0_clk: clk@01c20088 { - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c20088 0x4>; - clocks = <&osc24M>, <&pll6>; - clock-output-names = "mmc0", - "mmc0_output", - "mmc0_sample"; - }; - - mmc1_clk: clk@01c2008c { - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c2008c 0x4>; - clocks = <&osc24M>, <&pll6>; - clock-output-names = "mmc1", - "mmc1_output", - "mmc1_sample"; - }; - - mmc2_clk: clk@01c20090 { - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c20090 0x4>; - clocks = <&osc24M>, <&pll6>; - clock-output-names = "mmc2", - "mmc2_output", - "mmc2_sample"; - }; - - cpus_clk: clk@01f01400 { - compatible = "allwinner,sun9i-a80-cpus-clk"; - reg = <0x01f01400 0x4>; - #clock-cells = <0>; - clocks = <&osc16Md512>, <&osc24M>, <&pll6>, <&osc16M>; - clock-output-names = "cpus"; - }; - - ahb0: ahb0_clk { - compatible = "fixed-factor-clock"; - #clock-cells = <0>; - clock-div = <1>; - clock-mult = <1>; - clocks = <&cpus_clk>; - clock-output-names = "ahb0"; - }; - - apb0: clk@01f0140c { - compatible = "allwinner,sun8i-a23-apb0-clk"; - reg = <0x01f0140c 0x4>; - #clock-cells = <0>; - clocks = <&ahb0>; - clock-output-names = "apb0"; - }; - - apb0_gates: clk@01f01428 { - compatible = "allwinner,sun8i-a83t-apb0-gates-clk"; - reg = <0x01f01428 0x4>; - #clock-cells = <1>; - clocks = <&apb0>; - clock-indices = <0>, <1>, - <2>, <3>, - <4>, <6>, <7>; - clock-output-names = "apb0_pio", "apb0_ir", - "apb0_timer", "apb0_rsb", - "apb0_uart", "apb0_i2c0", "apb0_twd"; - }; - }; - - soc { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - - mmc0: mmc@01c0f000 { - compatible = "allwinner,sun5i-a13-mmc"; - reg = <0x01c0f000 0x1000>; - clocks = <&bus_gates 8>, - <&mmc0_clk 0>, - <&mmc0_clk 1>, - <&mmc0_clk 2>; - clock-names = "ahb", - "mmc", - "output", - "sample"; - resets = <&ahb_reset 8>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - mmc1: mmc@01c10000 { - compatible = "allwinner,sun5i-a13-mmc"; - reg = <0x01c10000 0x1000>; - clocks = <&bus_gates 9>, - <&mmc1_clk 0>, - <&mmc1_clk 1>, - <&mmc1_clk 2>; - clock-names = "ahb", - "mmc", - "output", - "sample"; - resets = <&ahb_reset 9>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - mmc2: mmc@01c11000 { - compatible = "allwinner,sun5i-a13-mmc"; - reg = <0x01c11000 0x1000>; - clocks = <&bus_gates 10>, - <&mmc2_clk 0>, - <&mmc2_clk 1>, - <&mmc2_clk 2>; - clock-names = "ahb", - "mmc", - "output", - "sample"; - resets = <&ahb_reset 10>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - pio: pinctrl@01c20800 { - compatible = "allwinner,sun8i-a83t-pinctrl"; - interrupts = , - , - ; - reg = <0x01c20800 0x400>; - clocks = <&bus_gates 69>; - gpio-controller; - interrupt-controller; - #interrupt-cells = <3>; - #gpio-cells = <3>; - - mmc0_pins_a: mmc0@0 { - allwinner,pins = "PF0", "PF1", "PF2", - "PF3", "PF4", "PF5"; - allwinner,function = "mmc0"; - allwinner,drive = ; - allwinner,pull = ; - }; - - mmc0_cd_pin_reference_design: mmc0_cd_pin@0 { - allwinner,pins = "PF6"; - allwinner,function = "gpio_in"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart0_pins_a: uart0@0 { - allwinner,pins = "PF2", "PF4"; - allwinner,function = "uart0"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart0_pins_b: uart0@1 { - allwinner,pins = "PB9", "PB10"; - allwinner,function = "uart0"; - allwinner,drive = ; - allwinner,pull = ; - }; - }; - - ahb_reset: reset@01c202c0 { - reg = <0x01c202c0 0xc>; - compatible = "allwinner,sun6i-a31-clock-reset"; - #reset-cells = <1>; - }; - - apb1_reset: reset@01c202d0 { - reg = <0x01c202d0 0x4>; - compatible = "allwinner,sun6i-a31-clock-reset"; - #reset-cells = <1>; - }; - - apb2_reset: reset@01c202d8 { - reg = <0x01c202d8 0x4>; - compatible = "allwinner,sun6i-a31-clock-reset"; - #reset-cells = <1>; - }; - - timer@01c20c00 { - compatible = "allwinner,sun4i-a10-timer"; - reg = <0x01c20c00 0xa0>; - interrupts = , - ; - clocks = <&osc24M>; - }; - - watchdog@01c20ca0 { - compatible = "allwinner,sun6i-a31-wdt"; - reg = <0x01c20ca0 0x20>; - interrupts = ; - clocks = <&osc24M>; - }; - - uart0: serial@01c28000 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28000 0x400>; - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 112>; - resets = <&apb2_reset 16>; - status = "disabled"; - }; - - gic: interrupt-controller@01c81000 { - compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; - reg = <0x01c81000 0x1000>, - <0x01c82000 0x1000>, - <0x01c84000 0x2000>, - <0x01c86000 0x2000>; - interrupt-controller; - #interrupt-cells = <3>; - interrupts = ; - }; - - apb0_reset: reset@01f014b0 { - reg = <0x01f014b0 0x4>; - compatible = "allwinner,sun6i-a31-clock-reset"; - #reset-cells = <1>; - }; - - r_pio: pinctrl@01f02c00 { - compatible = "allwinner,sun8i-a83t-r-pinctrl"; - reg = <0x01f02c00 0x400>; - interrupts = ; - clocks = <&apb0_gates 0>; - resets = <&apb0_reset 0>; - gpio-controller; - interrupt-controller; - #interrupt-cells = <3>; - #gpio-cells = <3>; - - r_rsb_pins: r_rsb { - allwinner,pins = "PL0", "PL1"; - allwinner,function = "s_rsb"; - allwinner,drive = ; - allwinner,pull = ; - }; - }; - - r_rsb: i2c@01f03400 { - compatible = "allwinner,sun8i-a23-rsb"; - reg = <0x01f03400 0x400>; - interrupts = ; - clocks = <&apb0_gates 3>; - clock-frequency = <3000000>; - resets = <&apb0_reset 3>; - pinctrl-names = "default"; - pinctrl-0 = <&r_rsb_pins>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - }; -}; diff --git a/sys/dts/arm/sun8i-h3-nanopi-neo.dts b/sys/dts/arm/sun8i-h3-nanopi-neo.dts deleted file mode 100644 index 7ea454faae8c..000000000000 --- a/sys/dts/arm/sun8i-h3-nanopi-neo.dts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2016 James Pettigrew - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -/dts-v1/; -#include "sun8i-h3.dtsi" -#include "sunxi-common-regulators.dtsi" - -#include -#include -#include - -/ { - model = "FriendlyARM NanoPi NEO"; - compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3"; - - aliases { - serial0 = &uart0; - }; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; - pinctrl-0 = <&leds_opc>, <&leds_r_opc>; - - pwr_led { - label = "nanopi:green:pwr"; - gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - - status_led { - label = "nanopi:blue:status"; - gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; - }; - }; -}; - -&ehci3 { - status = "okay"; -}; - -&mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; - vmmc-supply = <®_vcc3v3>; - bus-width = <4>; - cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ - cd-inverted; - status = "okay"; -}; - -&ohci3 { - status = "okay"; -}; - -&pio { - leds_opc: led_pins@0 { - allwinner,pins = "PA10"; - allwinner,function = "gpio_out"; - allwinner,drive = ; - allwinner,pull = ; - }; -}; - -&r_pio { - leds_r_opc: led_pins@0 { - allwinner,pins = "PL10"; - allwinner,function = "gpio_out"; - allwinner,drive = ; - allwinner,pull = ; - }; -}; - -&uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; - status = "okay"; -}; - -&usbphy { - /* USB VBUS is always on */ - status = "okay"; -}; diff --git a/sys/dts/arm/xpowers-axp209.dtsi b/sys/dts/arm/xpowers-axp209.dtsi deleted file mode 100644 index 566e61d12ced..000000000000 --- a/sys/dts/arm/xpowers-axp209.dtsi +++ /dev/null @@ -1,33 +0,0 @@ -/*- - * Copyright (c) 2016 Emmanuel Vadot - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - - -&axp209 { - gpio-controller; - #gpio-cells = <1>; -}; diff --git a/sys/modules/dtb/allwinner/Makefile b/sys/modules/dtb/allwinner/Makefile index c21856c0dfee..af4486abdb1d 100644 --- a/sys/modules/dtb/allwinner/Makefile +++ b/sys/modules/dtb/allwinner/Makefile @@ -1,8 +1,6 @@ # $FreeBSD$ # All the dts files for allwinner systems we support. DTS= \ - nanopi-neo.dts \ - orangepi-plus-2e.dts \ sun4i-a10-cubieboard.dts \ sun4i-a10-olinuxino-lime.dts \ sun6i-a31s-sinovoip-bpi-m2.dts \ @@ -14,7 +12,9 @@ DTS= \ sun7i-a20-pcduino3.dts \ sun8i-h2-plus-orangepi-zero.dts \ sun8i-h3-nanopi-m1.dts \ - sun8i-h3-orangepi-one.dts + sun8i-h3-nanopi-neo.dts \ + sun8i-h3-orangepi-one.dts \ + sun8i-h3-orangepi-plus2e.dts LINKS= \ ${DTBDIR}/sun4i-a10-cubieboard.dtb ${DTBDIR}/cubieboard.dtb \ @@ -24,6 +24,5 @@ LINKS= \ ${DTBDIR}/sun7i-a20-cubieboard2.dtb ${DTBDIR}/cubieboard2.dtb \ ${DTBDIR}/sun7i-a20-olimex-som-evb.dtb ${DTBDIR}/olimex-a20-som-evb.dtb \ ${DTBDIR}/sun7i-a20-pcduino3.dtb ${DTBDIR}/pcduino3.dtb \ - ${DTBDIR}/nanopi-neo.dtb ${DTBDIR}/sun8i-h3-nanopi-neo.dtb .include From 3faecc70e85c8c832a9f0fa3c38596914dedfb0e Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 18 Nov 2017 20:01:02 +0000 Subject: [PATCH 68/92] Fix 'make -n' for {reinstall,distribute}kernel. PR: 201779 Sponsored by: Dell --- Makefile.inc1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index c4042e109953..f5fdc6b28a0c 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1442,7 +1442,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${INSTALLKERNEL}" @echo "--------------------------------------------------------------" - cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ + ${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} .endif @@ -1451,7 +1451,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY @echo "--------------------------------------------------------------" @echo ">>> Installing kernel ${_kernel}" @echo "--------------------------------------------------------------" - cd ${KRNLOBJDIR}/${_kernel}; \ + ${_+_}cd ${KRNLOBJDIR}/${_kernel}; \ ${CROSSENV} PATH=${TMPPATH} \ ${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//} .endfor @@ -1467,7 +1467,7 @@ distributekernel distributekernel.debug: .PHONY .if defined(NO_ROOT) @echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta .endif - cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ + ${_+_}cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \ ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ DESTDIR=${INSTALL_DDIR}/kernel \ @@ -1482,7 +1482,7 @@ distributekernel distributekernel.debug: .PHONY .if defined(NO_ROOT) @echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta .endif - cd ${KRNLOBJDIR}/${_kernel}; \ + ${_+_}cd ${KRNLOBJDIR}/${_kernel}; \ ${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \ ${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \ KERNEL=${INSTKERNNAME}.${_kernel} \ From b00ea69b51fb9e30d2c217d905256adff77a46cd Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 18 Nov 2017 20:01:05 +0000 Subject: [PATCH 69/92] Fix PORTS_MODULES+'make reinstallkernel' trying to run bogus 'make redeinstall'. Also fix 'make installkernel' running 'make deinstall' twice. PR: 201779 MFC after: 2 weeks Sponsored by: Dell --- sys/conf/kern.post.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index d605e5460696..88c3eb657ed9 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -87,7 +87,7 @@ ${__target}: ports-${__target} ports-${__target}: .for __i in ${PORTS_MODULES} @${ECHO} "===> Ports module ${__i} (${__target})" - cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/install/deinstall reinstall/:C/reinstall/deinstall reinstall/} + cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/(re)?install/deinstall reinstall/} .endfor .endfor .endif From f7789552132d69ab34c89a9080b97b52c62c90e1 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 18 Nov 2017 20:01:09 +0000 Subject: [PATCH 70/92] Include Makefile.sys.inc if possible for top-level only. This will allow disabling some things like AUTO_OBJ early if not needed for the directory/targets, without putting special logic into share/mk/*.sys.mk. Sponsored by: Dell --- share/mk/src.sys.env.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/mk/src.sys.env.mk b/share/mk/src.sys.env.mk index b100c2ad1429..d8612a13540a 100644 --- a/share/mk/src.sys.env.mk +++ b/share/mk/src.sys.env.mk @@ -44,4 +44,7 @@ MAKESYSPATH:= ${.PARSEDIR:tA} .export MAKESYSPATH .endif +.if ${RELDIR:U} == "." && ${.MAKE.LEVEL} == 0 +.sinclude "${.CURDIR}/Makefile.sys.inc" +.endif .include From a7fa261e37ba3d9983e8481d34ed14ecc16d59d9 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 18 Nov 2017 20:01:12 +0000 Subject: [PATCH 71/92] Move top-level AUTO_OBJ logic to Makefile.sys.inc. Sponsored by: Dell --- Makefile | 29 +---------------------------- Makefile.sys.inc | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 Makefile.sys.inc diff --git a/Makefile b/Makefile index f4515e5d3678..ec55add8ef8f 100644 --- a/Makefile +++ b/Makefile @@ -167,18 +167,6 @@ META_TGT_WHITELIST+= \ tinderbox toolchain \ toolchains universe world worlds xdev xdev-build -# Likewise for AUTO_OBJ. Many targets do not need object directories created -# for each visited directory. Only when things are being built are they -# needed. Having AUTO_OBJ disabled in a build target is fine as it should -# fallback to running 'make obj' as needed. If a target is not in this list -# then it is ran with MK_AUTO_OBJ=no in environment. -# 'showconfig' is in the list to avoid forcing MK_AUTO_OBJ=no for it. -AUTO_OBJ_TGT_WHITELIST+= \ - _* all all-man build* depend everything *toolchain* includes \ - libraries obj objlink showconfig tags xdev xdev-build native-xtools \ - stage* create-packages* real-packages sign-packages package-pkg \ - tinderbox universe* kernel kernels world worlds bmake - .ORDER: buildworld installworld .ORDER: buildworld distrib-dirs .ORDER: buildworld distribution @@ -245,7 +233,7 @@ SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk .endif _MAKE= PATH=${PATH} MAKE_CMD="${MAKE}" ${SUB_MAKE} -f Makefile.inc1 \ - TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} + TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} ${_MAKEARGS} .if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" # Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST @@ -276,21 +264,6 @@ MK_META_MODE= no .endif # ${MK_META_MODE} == yes .endif # defined(MK_META_MODE) && ${MK_META_MODE} == yes -# Only allow AUTO_OBJ for the whitelisted targets. See AUTO_OBJ_TGT_WHITELIST -# above. MK_AUTO_OBJ not checked here for "yes" as it may not yet be enabled -# since it is opportunistic. -.if empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) -.for _tgt in ${AUTO_OBJ_TGT_WHITELIST} -.if make(${_tgt}) -_CAN_USE_AUTO_OBJ?= yes -.endif -.endfor -.if !defined(_CAN_USE_AUTO_OBJ) -_MAKE+= MK_AUTO_OBJ=no -MK_AUTO_OBJ= no -.endif -.endif # empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) - # Guess target architecture from target type, and vice versa, based on # historic FreeBSD practice of tending to have TARGET == TARGET_ARCH # expanding to TARGET == TARGET_CPUARCH in recent times, with known diff --git a/Makefile.sys.inc b/Makefile.sys.inc new file mode 100644 index 000000000000..c21ed19bdc62 --- /dev/null +++ b/Makefile.sys.inc @@ -0,0 +1,39 @@ +# $FreeBSD$ +# +# This is included very early from share/mk/src.sys.env.mk, after +# /etc/src-env.conf but before /etc/make.conf, /etc/src.conf, or OBJDIR +# handling. +# - It is not safe to use .OBJDIR/OBJTOP/OBJROOT here. +# - __ENV_ONLY_OPTIONS have been parsed by now except for opporutunistic +# MK_AUTO_OBJ. +# + +.if ${MK_DIRDEPS_BUILD} == "no" +# For AUTO_OBJ many targets do not need object directories created at top-level +# for each visited directory. Only when things are being built are they +# needed. Having AUTO_OBJ disabled in a build target is fine as it should +# fallback to running 'make obj' as needed. If a target is not in this list +# then it is ran with MK_AUTO_OBJ=no in environment. +# 'showconfig' is in the list to avoid forcing MK_AUTO_OBJ=no for it. +AUTO_OBJ_TGT_WHITELIST+= \ + _* all all-man build* depend everything *toolchain* includes \ + libraries obj objlink showconfig tags xdev xdev-build native-xtools \ + stage* create-packages* real-packages sign-packages package-pkg \ + tinderbox universe* kernel kernels world worlds bmake + +# Only allow AUTO_OBJ for the whitelisted targets. See AUTO_OBJ_TGT_WHITELIST +# above. MK_AUTO_OBJ not checked here for "yes" as it may not yet be enabled +# since it is opportunistic. +.if empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) +.for _tgt in ${AUTO_OBJ_TGT_WHITELIST} +.if make(${_tgt}) +_CAN_USE_AUTO_OBJ?= yes +.endif +.endfor +.if !defined(_CAN_USE_AUTO_OBJ) +_MAKEARGS+= MK_AUTO_OBJ=no +MK_AUTO_OBJ= no +.endif +.endif # empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) + +.endif # ${MK_DIRDEPS_BUILD} == "no" From 7e0aabd961995cf708f5a3796163f5f5bc31ffe1 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 18 Nov 2017 20:01:15 +0000 Subject: [PATCH 72/92] Fix top-level targets with read-only OBJDIR. This also makes it so that top-level build targets do not immediately create the OBJDIR. Only sub-make targets will do so. This avoids creating object directories for targets like 'make check-old' or creating unneeded MACHINE.MACHINE_ARCH directories during 'make tinderbox'. Reported by: npn, lifanov Tested by: npn, Mark Millard Sponsored by: Dell --- Makefile.sys.inc | 5 +++++ share/mk/src.sys.obj.mk | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/Makefile.sys.inc b/Makefile.sys.inc index c21ed19bdc62..6bb597de2fd7 100644 --- a/Makefile.sys.inc +++ b/Makefile.sys.inc @@ -33,6 +33,11 @@ _CAN_USE_AUTO_OBJ?= yes .if !defined(_CAN_USE_AUTO_OBJ) _MAKEARGS+= MK_AUTO_OBJ=no MK_AUTO_OBJ= no +# This will prevent src.sys.obj.mk from opportunistically enabling AUTO_OBJ +# in this make execution and for sub-makes. For all of these targets we +# just want to read any existing OBJDIR but we don't care if we can create +# or write to them. +.MAKEOVERRIDES+= MK_AUTO_OBJ .endif .endif # empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) diff --git a/share/mk/src.sys.obj.mk b/share/mk/src.sys.obj.mk index fe15717d4f05..3671f974742a 100644 --- a/share/mk/src.sys.obj.mk +++ b/share/mk/src.sys.obj.mk @@ -19,6 +19,12 @@ # TARGET.TARGET_ARCH added in as it assumes that MAKEOBJDIRPREFIX is # nested in the existing OBJTOP with TARGET.TARGET_ARCH in it. # +# The expected OBJDIR is stored in __objdir for auto.obj.mk to use. +# +# AUTO_OBJ is opportunistically enabled if the computed .OBJDIR is writable +# by the current user. Some top-level targets disable this behavior in +# Makefile.sys.inc. +# _default_makeobjdirprefix?= /usr/obj _default_makeobjdir= $${.CURDIR:S,^$${SRCTOP},$${OBJTOP},} From f70bac64491e12cb4687268259f93dd4046fbabb Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 18 Nov 2017 20:10:36 +0000 Subject: [PATCH 73/92] Evaluate options after including src-env.conf and before Makefile.sys.inc. Fixes top-level breakage in r325974. Pointyhat to: bdrewery Sponsored by: Dell --- share/mk/src.sys.env.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/mk/src.sys.env.mk b/share/mk/src.sys.env.mk index d8612a13540a..5888f6a07bff 100644 --- a/share/mk/src.sys.env.mk +++ b/share/mk/src.sys.env.mk @@ -22,6 +22,8 @@ SRC_ENV_CONF?= /etc/src-env.conf _src_env_conf_included_: .NOTMAIN .endif +.include + # Top-level installs should not use meta mode as it may prevent installing # based on cookies. .if make(*install*) && ${.MAKE.LEVEL} == 0 From b108f35740525ab97aae4ff79dca5f7d289f47b5 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Sat, 18 Nov 2017 20:32:09 +0000 Subject: [PATCH 74/92] Remove duplicate static function prototype to fix compilation of mlx5_fs_tree.c after r325638 when using GCC. Found by: kib @ MFC after: 1 week Sponsored by: Mellanox Technologies --- sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c index bf796d65b5f4..d0ffa44387ca 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c @@ -2553,10 +2553,6 @@ static void iterate_rules_in_ft(struct mlx5_flow_table *ft, mutex_unlock(&ft->base.lock); } -static void iterate_rules_in_ns(struct mlx5_flow_namespace *ns, - rule_event_fn add_rule_cb, - void *context); - static void iterate_rules_in_prio(struct fs_prio *prio, rule_event_fn add_rule_cb, void *context) From 1ee5a3d3b279c03d295a844e8c7c0770353b67b7 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 20:38:05 +0000 Subject: [PATCH 75/92] if_awg: only request completion interrupt on the last descriptor of a tx frame The hardware will not issue a completion interrupt for a descriptor with TX_INT_CTL set if it doesn't also have TX_LAST_DESC set. Submitted by: Guy Yur Differential Revision: https://reviews.freebsd.org/D13029 --- sys/arm/allwinner/if_awg.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index d254b37e3cdd..3c61e93faeb5 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -169,6 +169,7 @@ struct awg_txring { bus_dma_tag_t buf_tag; struct awg_bufmap buf_map[TX_DESC_COUNT]; u_int cur, next, queued; + u_int segs; }; struct awg_rxring { @@ -399,8 +400,6 @@ awg_setup_txdesc(struct awg_softc *sc, int index, int flags, bus_addr_t paddr, } else { status = TX_DESC_CTL; size = flags | len; - if ((index & (awg_tx_interval - 1)) == 0) - size |= TX_INT_CTL; ++sc->tx.queued; } @@ -449,8 +448,18 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) for (cur = index, i = 0; i < nsegs; i++) { sc->tx.buf_map[cur].mbuf = (i == 0 ? m : NULL); - if (i == nsegs - 1) + sc->tx.segs++; + if (i == nsegs - 1) { flags |= TX_LAST_DESC; + /* + * Can only request TX completion + * interrupt on last descriptor. + */ + if (sc->tx.segs >= awg_tx_interval) { + sc->tx.segs = 0; + flags |= TX_INT_CTL; + } + } awg_setup_txdesc(sc, cur, flags, segs[i].ds_addr, segs[i].ds_len); flags &= ~TX_FIR_DESC; From c6110e75146b65100ed334ba59e9cd434c86daed Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 20:42:48 +0000 Subject: [PATCH 76/92] if_awg: mark the first tx descriptor as ready only after all the other tx descriptors are set up In a multi segment frame, if the first tx descriptor is marked with TX_DESC_CTL but not all tx descriptors for the other segments in the frame are set up, the TX DMA may transmit an incomplete frame. To prevent this, set TX_DESC_CTL for the first tx descriptor only when done with all the other segments. Also, don't bother cleaning transmitted tx descriptors since TX_DESC_CTL is cleared for them by the hardware and they will be reprogrammed before TX_DESC_CTL is reenabled for them. Submitted by: Guy Yur Differential Revision: https://reviews.freebsd.org/D13030 --- sys/arm/allwinner/if_awg.c | 86 ++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 41 deletions(-) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index 3c61e93faeb5..038349b5abe1 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -387,35 +387,17 @@ awg_media_change(if_t ifp) return (error); } -static void -awg_setup_txdesc(struct awg_softc *sc, int index, int flags, bus_addr_t paddr, - u_int len) -{ - uint32_t status, size; - - if (paddr == 0 || len == 0) { - status = 0; - size = 0; - --sc->tx.queued; - } else { - status = TX_DESC_CTL; - size = flags | len; - ++sc->tx.queued; - } - - sc->tx.desc_ring[index].addr = htole32((uint32_t)paddr); - sc->tx.desc_ring[index].size = htole32(size); - sc->tx.desc_ring[index].status = htole32(status); -} - static int awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) { bus_dma_segment_t segs[TX_MAX_SEGS]; - int error, nsegs, cur, i, flags; + int error, nsegs, cur, first, i; u_int csum_flags; + uint32_t flags, status; struct mbuf *m; + cur = first = index; + m = *mp; error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, sc->tx.buf_map[index].map, m, segs, &nsegs, BUS_DMA_NOWAIT); @@ -438,6 +420,7 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) BUS_DMASYNC_PREWRITE); flags = TX_FIR_DESC; + status = 0; if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) { if ((m->m_pkthdr.csum_flags & (CSUM_TCP|CSUM_UDP)) != 0) csum_flags = TX_CHECKSUM_CTL_FULL; @@ -446,8 +429,7 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) flags |= (csum_flags << TX_CHECKSUM_CTL_SHIFT); } - for (cur = index, i = 0; i < nsegs; i++) { - sc->tx.buf_map[cur].mbuf = (i == 0 ? m : NULL); + for (i = 0; i < nsegs; i++) { sc->tx.segs++; if (i == nsegs - 1) { flags |= TX_LAST_DESC; @@ -460,15 +442,50 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) flags |= TX_INT_CTL; } } - awg_setup_txdesc(sc, cur, flags, segs[i].ds_addr, - segs[i].ds_len); + + sc->tx.desc_ring[cur].addr = htole32((uint32_t)segs[i].ds_addr); + sc->tx.desc_ring[cur].size = htole32(flags | segs[i].ds_len); + sc->tx.desc_ring[cur].status = htole32(status); + flags &= ~TX_FIR_DESC; + /* + * Setting of the valid bit in the first descriptor is + * deferred until the whole chain is fully set up. + */ + status = TX_DESC_CTL; + + ++sc->tx.queued; cur = TX_NEXT(cur); } + sc->tx.buf_map[first].mbuf = m; + + /* + * The whole mbuf chain has been DMA mapped, + * fix the first descriptor. + */ + sc->tx.desc_ring[first].status = htole32(TX_DESC_CTL); + return (nsegs); } +static void +awg_clean_txbuf(struct awg_softc *sc, int index) +{ + struct awg_bufmap *bmap; + + --sc->tx.queued; + + bmap = &sc->tx.buf_map[index]; + if (bmap->mbuf != NULL) { + bus_dmamap_sync(sc->tx.buf_tag, bmap->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->tx.buf_tag, bmap->map); + m_freem(bmap->mbuf); + bmap->mbuf = NULL; + } +} + static void awg_setup_rxdesc(struct awg_softc *sc, int index, bus_addr_t paddr) { @@ -891,7 +908,6 @@ awg_rxintr(struct awg_softc *sc) static void awg_txintr(struct awg_softc *sc) { - struct awg_bufmap *bmap; struct emac_desc *desc; uint32_t status; if_t ifp; @@ -908,23 +924,12 @@ awg_txintr(struct awg_softc *sc) status = le32toh(desc->status); if ((status & TX_DESC_CTL) != 0) break; - bmap = &sc->tx.buf_map[i]; - if (bmap->mbuf != NULL) { - bus_dmamap_sync(sc->tx.buf_tag, bmap->map, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->tx.buf_tag, bmap->map); - m_freem(bmap->mbuf); - bmap->mbuf = NULL; - } - awg_setup_txdesc(sc, i, 0, 0, 0); + awg_clean_txbuf(sc, i); if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } sc->tx.next = i; - - bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map, - BUS_DMASYNC_PREWRITE); } static void @@ -1519,7 +1524,7 @@ awg_setup_dma(device_t dev) return (error); } - sc->tx.queued = TX_DESC_COUNT; + sc->tx.queued = 0; for (i = 0; i < TX_DESC_COUNT; i++) { error = bus_dmamap_create(sc->tx.buf_tag, 0, &sc->tx.buf_map[i].map); @@ -1527,7 +1532,6 @@ awg_setup_dma(device_t dev) device_printf(dev, "cannot create TX buffer map\n"); return (error); } - awg_setup_txdesc(sc, i, 0, 0, 0); } /* Setup RX ring */ From fce9d29f8d7d0174aa93a825c1a9fed1f3b0f862 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 20:46:31 +0000 Subject: [PATCH 77/92] if_awg: store mbuf and dma mapping in the last segment of a tx frame instead of the first According to the datasheet, TX_DESC_CTL is cleared when whole frame is transmitted or all data in the current descriptor's buffer are transmitted. When the mbuf and mapping are stored in the first segment and in a scenario where a tx completion interrupt arrives for a frame and only the start of the next frame was transmitted, at the time of interrupt processing the mbuf and mapping will be freed when processing the first segment of the next frame but the other untrasmitted segments still need to use them. Submitted by: Guy Yur Differential Revision: https://reviews.freebsd.org/D13031 --- sys/arm/allwinner/if_awg.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index 038349b5abe1..e19213657fc9 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -390,17 +390,19 @@ awg_media_change(if_t ifp) static int awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) { + bus_dmamap_t map; bus_dma_segment_t segs[TX_MAX_SEGS]; - int error, nsegs, cur, first, i; + int error, nsegs, cur, first, last, i; u_int csum_flags; uint32_t flags, status; struct mbuf *m; cur = first = index; + map = sc->tx.buf_map[first].map; m = *mp; - error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, - sc->tx.buf_map[index].map, m, segs, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, map, m, segs, + &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { m = m_collapse(m, M_NOWAIT, TX_MAX_SEGS); if (m == NULL) { @@ -408,16 +410,15 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) return (0); } *mp = m; - error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, - sc->tx.buf_map[index].map, m, segs, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, map, m, + segs, &nsegs, BUS_DMA_NOWAIT); } if (error != 0) { device_printf(sc->dev, "awg_setup_txbuf: bus_dmamap_load_mbuf_sg failed\n"); return (0); } - bus_dmamap_sync(sc->tx.buf_tag, sc->tx.buf_map[index].map, - BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->tx.buf_tag, map, BUS_DMASYNC_PREWRITE); flags = TX_FIR_DESC; status = 0; @@ -458,7 +459,11 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) cur = TX_NEXT(cur); } - sc->tx.buf_map[first].mbuf = m; + /* Store mapping and mbuf in the last segment */ + last = TX_SKIP(cur, TX_DESC_COUNT - 1); + sc->tx.buf_map[first].map = sc->tx.buf_map[last].map; + sc->tx.buf_map[last].map = map; + sc->tx.buf_map[last].mbuf = m; /* * The whole mbuf chain has been DMA mapped, From 09e2285c4c3a6c6ea609cac33ded85e0f026a948 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 20:50:31 +0000 Subject: [PATCH 78/92] if_awg: only increment IFCOUNTER_OPACKETS when the last segment of a frame has been successfully transmitted A packet may be built from multiple segments, don't increase the count for each segment Submitted by: Guy Yur Differential Revision: https://reviews.freebsd.org/D13032 --- sys/arm/allwinner/if_awg.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index e19213657fc9..a942768ef7f1 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -914,7 +914,7 @@ static void awg_txintr(struct awg_softc *sc) { struct emac_desc *desc; - uint32_t status; + uint32_t status, size; if_t ifp; int i; @@ -929,9 +929,15 @@ awg_txintr(struct awg_softc *sc) status = le32toh(desc->status); if ((status & TX_DESC_CTL) != 0) break; + size = le32toh(desc->size); + if (size & TX_LAST_DESC) { + if ((status & (TX_HEADER_ERR | TX_PAYLOAD_ERR)) != 0) + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + else + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + } awg_clean_txbuf(sc, i); if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } sc->tx.next = i; From f179ed0561bdc026267042aeae2bf5aed6900ac5 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 20:55:37 +0000 Subject: [PATCH 79/92] if_awg: replace multiple calls to if_setdrvflagbits with one call in awg_txintr Small optimization Submitted by: Guy Yur Differential Revision: https://reviews.freebsd.org/D13033 --- sys/arm/allwinner/if_awg.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index a942768ef7f1..ed8ac4932e56 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -916,7 +916,7 @@ awg_txintr(struct awg_softc *sc) struct emac_desc *desc; uint32_t status, size; if_t ifp; - int i; + int i, prog; AWG_ASSERT_LOCKED(sc); @@ -924,6 +924,8 @@ awg_txintr(struct awg_softc *sc) BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); ifp = sc->ifp; + + prog = 0; for (i = sc->tx.next; sc->tx.queued > 0; i = TX_NEXT(i)) { desc = &sc->tx.desc_ring[i]; status = le32toh(desc->status); @@ -936,11 +938,14 @@ awg_txintr(struct awg_softc *sc) else if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); } + prog++; awg_clean_txbuf(sc, i); - if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); } - sc->tx.next = i; + if (prog > 0) { + sc->tx.next = i; + if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE); + } } static void From 0d2abe1e2b7e809be412c1d14f6e8b1c497bda75 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 20:59:20 +0000 Subject: [PATCH 80/92] if_awg: don't process transmitted packets on TX_BUF_UA_INT, only on TX_INT TX_BUF_UA_INT is set when there are no buffers to transmit and can happen before hw.awg.tx_interval segments have been transmitted. To reduce load, tx cleanup should be done in hw.awg.tx_interval intervals. Submitted by: Guy Yur Differential Revision: https://reviews.freebsd.org/D13034 --- sys/arm/allwinner/if_awg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index ed8ac4932e56..7589a852d477 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -963,8 +963,10 @@ awg_intr(void *arg) if (val & RX_INT) awg_rxintr(sc); - if (val & (TX_INT|TX_BUF_UA_INT)) { + if (val & TX_INT) awg_txintr(sc); + + if (val & (TX_INT | TX_BUF_UA_INT)) { if (!if_sendq_empty(sc->ifp)) awg_start_locked(sc); } From 337c6940a9fac95ce4ff94192feb14bd7a587176 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 21:04:39 +0000 Subject: [PATCH 81/92] if_awg: rename tx functions to match other drivers and free mbuf on m_collapse failure - use awg_encap and awg_txeof names to match iflib and other network drivers. - handle m_collapse failure similarly by freeing the mbuf rather than reenqueuing it where it will continue to fail. Submitted by: Guy Yur Differential Revision: https://reviews.freebsd.org/D13035 --- sys/arm/allwinner/if_awg.c | 55 ++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index 7589a852d477..04f0128b2bf5 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -388,7 +388,7 @@ awg_media_change(if_t ifp) } static int -awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) +awg_encap(struct awg_softc *sc, struct mbuf **mp) { bus_dmamap_t map; bus_dma_segment_t segs[TX_MAX_SEGS]; @@ -397,7 +397,7 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) uint32_t flags, status; struct mbuf *m; - cur = first = index; + cur = first = sc->tx.cur; map = sc->tx.buf_map[first].map; m = *mp; @@ -406,16 +406,32 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) if (error == EFBIG) { m = m_collapse(m, M_NOWAIT, TX_MAX_SEGS); if (m == NULL) { - device_printf(sc->dev, "awg_setup_txbuf: m_collapse failed\n"); - return (0); + device_printf(sc->dev, "awg_encap: m_collapse failed\n"); + m_freem(*mp); + *mp = NULL; + return (ENOMEM); } *mp = m; error = bus_dmamap_load_mbuf_sg(sc->tx.buf_tag, map, m, segs, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + m_freem(*mp); + *mp = NULL; + } } if (error != 0) { - device_printf(sc->dev, "awg_setup_txbuf: bus_dmamap_load_mbuf_sg failed\n"); - return (0); + device_printf(sc->dev, "awg_encap: bus_dmamap_load_mbuf_sg failed\n"); + return (error); + } + if (nsegs == 0) { + m_freem(*mp); + *mp = NULL; + return (EIO); + } + + if (sc->tx.queued + nsegs > TX_DESC_COUNT) { + bus_dmamap_unload(sc->tx.buf_tag, map); + return (ENOBUFS); } bus_dmamap_sync(sc->tx.buf_tag, map, BUS_DMASYNC_PREWRITE); @@ -459,6 +475,8 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) cur = TX_NEXT(cur); } + sc->tx.cur = cur; + /* Store mapping and mbuf in the last segment */ last = TX_SKIP(cur, TX_DESC_COUNT - 1); sc->tx.buf_map[first].map = sc->tx.buf_map[last].map; @@ -471,7 +489,7 @@ awg_setup_txbuf(struct awg_softc *sc, int index, struct mbuf **mp) */ sc->tx.desc_ring[first].status = htole32(TX_DESC_CTL); - return (nsegs); + return (0); } static void @@ -546,7 +564,7 @@ awg_start_locked(struct awg_softc *sc) struct mbuf *m; uint32_t val; if_t ifp; - int cnt, nsegs; + int cnt, err; AWG_ASSERT_LOCKED(sc); @@ -560,22 +578,19 @@ awg_start_locked(struct awg_softc *sc) return; for (cnt = 0; ; cnt++) { - if (sc->tx.queued >= TX_DESC_COUNT - TX_MAX_SEGS) { - if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); - break; - } - m = if_dequeue(ifp); if (m == NULL) break; - nsegs = awg_setup_txbuf(sc, sc->tx.cur, &m); - if (nsegs == 0) { - if_sendq_prepend(ifp, m); + err = awg_encap(sc, &m); + if (err != 0) { + if (err == ENOBUFS) + if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0); + if (m != NULL) + if_sendq_prepend(ifp, m); break; } if_bpfmtap(ifp, m); - sc->tx.cur = TX_SKIP(sc->tx.cur, nsegs); } if (cnt != 0) { @@ -911,7 +926,7 @@ awg_rxintr(struct awg_softc *sc) } static void -awg_txintr(struct awg_softc *sc) +awg_txeof(struct awg_softc *sc) { struct emac_desc *desc; uint32_t status, size; @@ -964,7 +979,7 @@ awg_intr(void *arg) awg_rxintr(sc); if (val & TX_INT) - awg_txintr(sc); + awg_txeof(sc); if (val & (TX_INT | TX_BUF_UA_INT)) { if (!if_sendq_empty(sc->ifp)) @@ -993,7 +1008,7 @@ awg_poll(if_t ifp, enum poll_cmd cmd, int count) } rx_npkts = awg_rxintr(sc); - awg_txintr(sc); + awg_txeof(sc); if (!if_sendq_empty(ifp)) awg_start_locked(sc); From bd9063297c518e5a9743cfe2d7df516d6c8054d9 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 21:08:18 +0000 Subject: [PATCH 82/92] if_awg: avoid hole in the rx ring buffer when mbuf allocation fails Use a spare dma map when attempting to map a new mbuf on the rx path. If the mbuf allocation fails or the dma map loading for the new mbuf fails just reuse the old mbuf and increase the drop counter. Submitted by: Guy Yur Differential Revision: https://reviews.freebsd.org/D12538 --- sys/arm/allwinner/if_awg.c | 167 ++++++++++++++++++++----------------- 1 file changed, 92 insertions(+), 75 deletions(-) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index 04f0128b2bf5..64085703583a 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -179,6 +179,7 @@ struct awg_rxring { bus_addr_t desc_ring_paddr; bus_dma_tag_t buf_tag; struct awg_bufmap buf_map[RX_DESC_COUNT]; + bus_dmamap_t buf_spare_map; u_int cur; }; @@ -519,24 +520,45 @@ awg_setup_rxdesc(struct awg_softc *sc, int index, bus_addr_t paddr) sc->rx.desc_ring[index].addr = htole32((uint32_t)paddr); sc->rx.desc_ring[index].size = htole32(size); - sc->rx.desc_ring[index].next = - htole32(sc->rx.desc_ring_paddr + DESC_OFF(RX_NEXT(index))); sc->rx.desc_ring[index].status = htole32(status); } -static int -awg_setup_rxbuf(struct awg_softc *sc, int index, struct mbuf *m) +static void +awg_reuse_rxdesc(struct awg_softc *sc, int index) { - bus_dma_segment_t seg; - int error, nsegs; + sc->rx.desc_ring[index].status = htole32(RX_DESC_CTL); +} + +static int +awg_newbuf_rx(struct awg_softc *sc, int index) +{ + struct mbuf *m; + bus_dma_segment_t seg; + bus_dmamap_t map; + int nsegs; + + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + + m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; m_adj(m, ETHER_ALIGN); - error = bus_dmamap_load_mbuf_sg(sc->rx.buf_tag, - sc->rx.buf_map[index].map, m, &seg, &nsegs, 0); - if (error != 0) - return (error); + if (bus_dmamap_load_mbuf_sg(sc->rx.buf_tag, sc->rx.buf_spare_map, + m, &seg, &nsegs, BUS_DMA_NOWAIT) != 0) { + m_freem(m); + return (ENOBUFS); + } + if (sc->rx.buf_map[index].mbuf != NULL) { + bus_dmamap_sync(sc->rx.buf_tag, sc->rx.buf_map[index].map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->rx.buf_tag, sc->rx.buf_map[index].map); + } + map = sc->rx.buf_map[index].map; + sc->rx.buf_map[index].map = sc->rx.buf_spare_map; + sc->rx.buf_spare_map = map; bus_dmamap_sync(sc->rx.buf_tag, sc->rx.buf_map[index].map, BUS_DMASYNC_PREREAD); @@ -546,18 +568,6 @@ awg_setup_rxbuf(struct awg_softc *sc, int index, struct mbuf *m) return (0); } -static struct mbuf * -awg_alloc_mbufcl(struct awg_softc *sc) -{ - struct mbuf *m; - - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - if (m != NULL) - m->m_pkthdr.len = m->m_len = m->m_ext.ext_size; - - return (m); -} - static void awg_start_locked(struct awg_softc *sc) { @@ -840,7 +850,7 @@ static int awg_rxintr(struct awg_softc *sc) { if_t ifp; - struct mbuf *m, *m0, *mh, *mt; + struct mbuf *m, *mh, *mt; int error, index, len, cnt, npkt; uint32_t status; @@ -857,61 +867,62 @@ awg_rxintr(struct awg_softc *sc) if ((status & RX_DESC_CTL) != 0) break; - bus_dmamap_sync(sc->rx.buf_tag, sc->rx.buf_map[index].map, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->rx.buf_tag, sc->rx.buf_map[index].map); - len = (status & RX_FRM_LEN) >> RX_FRM_LEN_SHIFT; - if (len != 0) { - m = sc->rx.buf_map[index].mbuf; - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - m->m_len = len; - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0 && - (status & RX_FRM_TYPE) != 0) { - m->m_pkthdr.csum_flags = CSUM_IP_CHECKED; - if ((status & RX_HEADER_ERR) == 0) - m->m_pkthdr.csum_flags |= CSUM_IP_VALID; - if ((status & RX_PAYLOAD_ERR) == 0) { - m->m_pkthdr.csum_flags |= - CSUM_DATA_VALID | CSUM_PSEUDO_HDR; - m->m_pkthdr.csum_data = 0xffff; - } - } - - m->m_nextpkt = NULL; - if (mh == NULL) - mh = m; - else - mt->m_nextpkt = m; - mt = m; - ++cnt; - ++npkt; - - if (cnt == awg_rx_batch) { - AWG_UNLOCK(sc); - if_input(ifp, mh); - AWG_LOCK(sc); - mh = mt = NULL; - cnt = 0; - } - + if (len == 0) { + if ((status & (RX_NO_ENOUGH_BUF_ERR | RX_OVERFLOW_ERR)) != 0) + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + awg_reuse_rxdesc(sc, index); + continue; } - if ((m0 = awg_alloc_mbufcl(sc)) != NULL) { - error = awg_setup_rxbuf(sc, index, m0); - if (error != 0) { - /* XXX hole in RX ring */ - } - } else + m = sc->rx.buf_map[index].mbuf; + + error = awg_newbuf_rx(sc, index); + if (error != 0) { if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + awg_reuse_rxdesc(sc, index); + continue; + } + + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = len; + m->m_len = len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + + if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0 && + (status & RX_FRM_TYPE) != 0) { + m->m_pkthdr.csum_flags = CSUM_IP_CHECKED; + if ((status & RX_HEADER_ERR) == 0) + m->m_pkthdr.csum_flags |= CSUM_IP_VALID; + if ((status & RX_PAYLOAD_ERR) == 0) { + m->m_pkthdr.csum_flags |= + CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xffff; + } + } + + m->m_nextpkt = NULL; + if (mh == NULL) + mh = m; + else + mt->m_nextpkt = m; + mt = m; + ++cnt; + ++npkt; + + if (cnt == awg_rx_batch) { + AWG_UNLOCK(sc); + if_input(ifp, mh); + AWG_LOCK(sc); + mh = mt = NULL; + cnt = 0; + } } if (index != sc->rx.cur) { bus_dmamap_sync(sc->rx.desc_tag, sc->rx.desc_map, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); } if (mh != NULL) { @@ -1500,7 +1511,6 @@ static int awg_setup_dma(device_t dev) { struct awg_softc *sc; - struct mbuf *m; int error, i; sc = device_get_softc(dev); @@ -1615,18 +1625,25 @@ awg_setup_dma(device_t dev) return (error); } + error = bus_dmamap_create(sc->rx.buf_tag, 0, &sc->rx.buf_spare_map); + if (error != 0) { + device_printf(dev, + "cannot create RX buffer spare map\n"); + return (error); + } + for (i = 0; i < RX_DESC_COUNT; i++) { + sc->rx.desc_ring[i].next = + htole32(sc->rx.desc_ring_paddr + DESC_OFF(RX_NEXT(i))); + error = bus_dmamap_create(sc->rx.buf_tag, 0, &sc->rx.buf_map[i].map); if (error != 0) { device_printf(dev, "cannot create RX buffer map\n"); return (error); } - if ((m = awg_alloc_mbufcl(sc)) == NULL) { - device_printf(dev, "cannot allocate RX mbuf\n"); - return (ENOMEM); - } - error = awg_setup_rxbuf(sc, i, m); + sc->rx.buf_map[i].mbuf = NULL; + error = awg_newbuf_rx(sc, i); if (error != 0) { device_printf(dev, "cannot create RX buffer\n"); return (error); From 3f9ade0643fa201b60cb48a339b62ef0f6bae90d Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 21:12:06 +0000 Subject: [PATCH 83/92] if_awg: drain tx buffers and clear rx buffers when stopping Stale packets should not be transmitted when the interface comes up after being down. Count the successfully transmitted ones for statistics and drop the rest. Submitted by: Guy Yur Differential Revision: https://reviews.freebsd.org/D12539 --- sys/arm/allwinner/if_awg.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/sys/arm/allwinner/if_awg.c b/sys/arm/allwinner/if_awg.c index 64085703583a..81aca029082f 100644 --- a/sys/arm/allwinner/if_awg.c +++ b/sys/arm/allwinner/if_awg.c @@ -215,6 +215,8 @@ static struct resource_spec awg_spec[] = { { -1, 0 } }; +static void awg_txeof(struct awg_softc *sc); + static int awg_miibus_readreg(device_t dev, int phy, int reg) { @@ -809,6 +811,7 @@ awg_stop(struct awg_softc *sc) { if_t ifp; uint32_t val; + int i; AWG_ASSERT_LOCKED(sc); @@ -843,6 +846,39 @@ awg_stop(struct awg_softc *sc) sc->link = 0; + /* Finish handling transmitted buffers */ + awg_txeof(sc); + + /* Release any untransmitted buffers. */ + for (i = sc->tx.next; sc->tx.queued > 0; i = TX_NEXT(i)) { + val = le32toh(sc->tx.desc_ring[i].status); + if ((val & TX_DESC_CTL) != 0) + break; + awg_clean_txbuf(sc, i); + } + sc->tx.next = i; + for (; sc->tx.queued > 0; i = TX_NEXT(i)) { + sc->tx.desc_ring[i].status = 0; + awg_clean_txbuf(sc, i); + } + sc->tx.cur = sc->tx.next; + bus_dmamap_sync(sc->tx.desc_tag, sc->tx.desc_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + /* Setup RX buffers for reuse */ + bus_dmamap_sync(sc->rx.desc_tag, sc->rx.desc_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + for (i = sc->rx.cur; ; i = RX_NEXT(i)) { + val = le32toh(sc->rx.desc_ring[i].status); + if ((val & RX_DESC_CTL) != 0) + break; + awg_reuse_rxdesc(sc, i); + } + sc->rx.cur = i; + bus_dmamap_sync(sc->rx.desc_tag, sc->rx.desc_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING | IFF_DRV_OACTIVE); } From 4a76893d57b4d96570e9dc8c9bc5a74fde7d39cd Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Sat, 18 Nov 2017 21:27:33 +0000 Subject: [PATCH 84/92] Remove unneeded special case for .OBJDIR=.CURDIR. The else statement is already handling this by ensuring a safe .OBJDIR is used. Sponsored by: Dell --- share/mk/src.sys.obj.mk | 7 ------- 1 file changed, 7 deletions(-) diff --git a/share/mk/src.sys.obj.mk b/share/mk/src.sys.obj.mk index 3671f974742a..280150b6c7ad 100644 --- a/share/mk/src.sys.obj.mk +++ b/share/mk/src.sys.obj.mk @@ -192,13 +192,6 @@ MK_AUTO_OBJ:= ${__objdir_writable} # The expected OBJDIR already exists, set it as .OBJDIR. .if !empty(__objdir) && exists(${__objdir}) .OBJDIR: ${__objdir} -# Special case to work around bmake bug. If the top-level .OBJDIR does not yet -# exist and MAKEOBJDIR is passed into environment and yield a blank value, -# bmake will incorrectly set .OBJDIR=${SRCTOP}/ rather than the expected -# ${SRCTOP} to match ${.CURDIR}. -.elif ${MAKE_VERSION} <= 20170720 && \ - ${.CURDIR} == ${SRCTOP} && ${.OBJDIR} == ${SRCTOP}/ -.OBJDIR: ${.CURDIR} .else # The OBJDIR we wanted does not yet exist, ensure we default to safe .CURDIR # in case make started with a bogus MAKEOBJDIR, that expanded before OBJTOP From dab900583d52edce17089d4824e075dd3606b552 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Sat, 18 Nov 2017 21:39:54 +0000 Subject: [PATCH 85/92] dts: arm64: allwinner: Remove unused dts for pine64 Latest u-boot port provide the dts for pine64, remove our custom and outdated dts for this board. --- sys/dts/arm64/Makefile | 7 - sys/dts/arm64/a64.dtsi | 189 ------ sys/dts/arm64/pine64_plus.dts | 101 --- sys/dts/arm64/sun50i-a64-pine64-common.dtsi | 82 --- sys/dts/arm64/sun50i-a64-pine64-plus.dts | 73 --- sys/dts/arm64/sun50i-a64-pine64.dts | 72 --- sys/dts/arm64/sun50i-a64.dtsi | 661 -------------------- 7 files changed, 1185 deletions(-) delete mode 100644 sys/dts/arm64/Makefile delete mode 100644 sys/dts/arm64/a64.dtsi delete mode 100644 sys/dts/arm64/pine64_plus.dts delete mode 100644 sys/dts/arm64/sun50i-a64-pine64-common.dtsi delete mode 100644 sys/dts/arm64/sun50i-a64-pine64-plus.dts delete mode 100644 sys/dts/arm64/sun50i-a64-pine64.dts delete mode 100644 sys/dts/arm64/sun50i-a64.dtsi diff --git a/sys/dts/arm64/Makefile b/sys/dts/arm64/Makefile deleted file mode 100644 index 03d156d94770..000000000000 --- a/sys/dts/arm64/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -DTS!=ls *.dts - -all: test-dts - -.include diff --git a/sys/dts/arm64/a64.dtsi b/sys/dts/arm64/a64.dtsi deleted file mode 100644 index 5cf1d38c235f..000000000000 --- a/sys/dts/arm64/a64.dtsi +++ /dev/null @@ -1,189 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/ { - cpus { - cpu@0 { - clocks = <&cpu>; - clock-latency = <2000000>; - operating-points = < - /* kHz uV */ - 1200000 1300000 - 1008000 1200000 - 816000 1100000 - 648000 1040000 - 408000 1040000 - >; - }; - }; - - clocks { - pll_hsic: clk@01c20044 { - #clock-cells = <0>; - compatible = "allwinner,sun50i-a64-pllhsic-clk"; - reg = <0x01c20044 0x4>; - clocks = <&osc24M>; - clock-output-names = "pll_hsic"; - }; - - usb_clk: clk@01c200cc { - #clock-cells = <1>; - #reset-cells = <1>; - compatible = "allwinner,sun8i-a83t-usb-clk"; - reg = <0x01c200cc 0x4>; - clocks = <&osc24M>, <&pll_hsic>; - clock-indices = <8>, <9>, - <10>, <11>, - <16>, <17>; - clock-output-names = "usb_phy0", "usb_phy1", - "usb_hsic_pll", "usb_hsic_12m", - "usb_otg_ohci", "usb_ohci0"; - }; - - ths_clk: clk@01c20074 { - #clock-cells = <0>; - compatible = "allwinner,sun50i-a64-ths-clk"; - reg = <0x01c20074 0x4>; - clocks = <&osc24M>; - clock-output-names = "ths"; - }; - }; - - soc { - watchdog: watchdog@01c20ca0 { - compatible = "allwinner,sun6i-a31-wdt"; - reg = <0x01c20ca0 0x20>; - interrupts = ; - clocks = <&osc24M>; - }; - - nmi_intc: interrupt-controller@01f00c0c { - compatible = "allwinner,sun6i-a31-sc-nmi"; - interrupt-controller; - #interrupt-cells = <2>; - reg = <0x01f00c0c 0x38>; - interrupts = ; - }; - - r_rsb: i2c@01f03400 { - compatible = "allwinner,sun8i-a23-rsb"; - reg = <0x01f03400 0x400>; - interrupts = ; - clock-frequency = <3000000>; - pinctrl-names = "default"; - pinctrl-0 = <&r_rsb_pins>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - sid: eeprom@01c14000 { - compatible = "allwinner,sun8i-a83t-sid"; - reg = <0x01c14000 0x400>; - }; - - rtp: rtp@01c25000 { - compatible = "allwinner,sun50i-a64-ts"; - reg = <0x01c25000 0x400>; - interrupts = ; - clocks = <&bus_gates 72>, <&ths_clk>; - clock-names = "ahb", "ths"; - resets = <&ahb_rst 136>; - #thermal-sensor-cells = <0>; - }; - - usbphy: phy@01c19400 { - compatible = "allwinner,sun50i-a64-usb-phy"; - reg = <0x01c19400 0x24 0x01c1a800 0x4 0x01c1b800 0x4>; - reg-names = "phy_ctrl", "pmu1", "pmu2"; - clocks = <&usb_clk 8>, - <&usb_clk 9>; - clock-names = "usb0_phy", - "usb1_phy"; - resets = <&usb_clk 0>, - <&usb_clk 1>; - reset-names = "usb0_reset", - "usb1_reset"; - status = "disabled"; - #phy-cells = <1>; - }; - - ohci0: usb@01c1a400 { - compatible = "generic-ohci"; - reg = <0x01c1a400 0x100>; - interrupts = ; - clocks = <&bus_gates 28>, <&usb_clk 16>, <&usb_clk 17>; - resets = <&ahb_rst 28>; - phys = <&usbphy 1>; - phy-names = "usb"; - status = "disabled"; - }; - - ehci0: usb@01c1a000 { - compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci"; - reg = <0x01c1a000 0x100>; - interrupts = ; - clocks = <&bus_gates 24>; - resets = <&ahb_rst 24>; - phys = <&usbphy 1>; - phy-names = "usb"; - status = "disabled"; - }; - - ohci1: usb@01c1b400 { - compatible = "generic-ohci"; - reg = <0x01c1b400 0x100>; - interrupts = ; - clocks = <&bus_gates 29>, <&usb_clk 16>, <&usb_clk 17>; - resets = <&ahb_rst 29>; - phys = <&usbphy 2>; - phy-names = "usb"; - status = "disabled"; - }; - - ehci1: usb@01c1b000 { - compatible = "allwinner,sun8i-a83t-ehci", "generic-ehci"; - reg = <0x01c1b000 0x100>; - interrupts = ; - clocks = <&bus_gates 25>; - resets = <&ahb_rst 25>; - phys = <&usbphy 2>; - phy-names = "usb"; - status = "disabled"; - }; - }; -}; - -&pio { - r_rsb_pins: r_rsb { - allwinner,pins = "PL0", "PL1"; - allwinner,function = "s_rsb"; - allwinner,drive = ; - allwinner,pull = ; - }; -}; diff --git a/sys/dts/arm64/pine64_plus.dts b/sys/dts/arm64/pine64_plus.dts deleted file mode 100644 index 5182c23b7ee1..000000000000 --- a/sys/dts/arm64/pine64_plus.dts +++ /dev/null @@ -1,101 +0,0 @@ -/*- - * Copyright (c) 2016 Jared McNeill - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include "sun50i-a64-pine64-plus.dts" -#include "a64.dtsi" - -#include - -/ { - cpus { - cpu@0 { - cpu-supply = <®_dcdc2>; - }; - }; -}; - -&pio { - emac_phy_reset_pin_pine64_plus: emac_phy_reset_pin@0 { - allwinner,pins = "PD14"; - allwinner,function = "gpio_out"; - allwinner,drive = ; - allwinner,pull = ; - }; -}; - -&emac { - pinctrl-names = "default"; - pinctrl-0 = <&rgmii_pins>, <&emac_phy_reset_pin_pine64_plus>; - phy-supply = <®_dc1dc>; - allwinner,reset-gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>; - allwinner,reset-active-low; - allwinner,reset-delays-us = <0 10000 30000>; -}; - -&r_rsb { - status = "okay"; - - axp81x: pmic@3a3 { - compatible = "x-powers,axp813"; - reg = <0x3a3>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; - gpio-controller; - #gpio-cells = <1>; - - regulators { - reg_dc1dc: dc1sw { - regulator-name = "dc1sw"; - }; - - reg_dcdc2: dcdc2 { - regulator-name = "dcdc2"; - }; - }; - }; -}; - -&usbphy { - status = "okay"; -}; - -&ehci0 { - status = "okay"; -}; - -&ohci0 { - status = "okay"; -}; - -&ehci1 { - status = "okay"; -}; - -&ohci1 { - status = "okay"; -}; diff --git a/sys/dts/arm64/sun50i-a64-pine64-common.dtsi b/sys/dts/arm64/sun50i-a64-pine64-common.dtsi deleted file mode 100644 index d4de80aedcba..000000000000 --- a/sys/dts/arm64/sun50i-a64-pine64-common.dtsi +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2016 ARM Ltd. - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This library 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 library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -#include "sun50i-a64.dtsi" - -/ { - - aliases { - serial0 = &uart0; - }; - - soc { - reg_vcc3v3: vcc3v3 { - compatible = "regulator-fixed"; - regulator-name = "vcc3v3"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - }; - }; -}; - -&mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins>, <&mmc0_default_cd_pin>; - vmmc-supply = <®_vcc3v3>; - cd-gpios = <&pio 5 6 0>; - cd-inverted; - status = "okay"; -}; - -&uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; - status = "okay"; -}; - -&i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; - status = "okay"; -}; diff --git a/sys/dts/arm64/sun50i-a64-pine64-plus.dts b/sys/dts/arm64/sun50i-a64-pine64-plus.dts deleted file mode 100644 index 1b9eefaa4757..000000000000 --- a/sys/dts/arm64/sun50i-a64-pine64-plus.dts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2016 ARM Ltd. - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This library 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 library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -#include "sun50i-a64-pine64-common.dtsi" - -/ { - model = "Pine64+"; - compatible = "pine64,pine64-plus", "allwinner,sun50i-a64"; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - /* There is a model with 2GB of DRAM, but U-Boot fixes this for us. */ - memory { - reg = <0x40000000 0x40000000>; - }; -}; - -&emac { - pinctrl-names = "default"; - pinctrl-0 = <&rgmii_pins>; - phy-mode = "rgmii"; - phy = <&phy1>; - status = "okay"; - - phy1: ethernet-phy@1 { - reg = <1>; - }; -}; diff --git a/sys/dts/arm64/sun50i-a64-pine64.dts b/sys/dts/arm64/sun50i-a64-pine64.dts deleted file mode 100644 index 4ec68bcf593c..000000000000 --- a/sys/dts/arm64/sun50i-a64-pine64.dts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2016 ARM Ltd. - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This library 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 library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -#include "sun50i-a64-pine64-common.dtsi" - -/ { - model = "Pine64"; - compatible = "pine64,pine64", "allwinner,sun50i-a64"; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - memory { - reg = <0x40000000 0x20000000>; - }; -}; - -&emac { - pinctrl-names = "default"; - pinctrl-0 = <&rmii_pins>; - phy-mode = "rmii"; - phy = <&phy1>; - status = "okay"; - - phy1: ethernet-phy@1 { - reg = <1>; - }; -}; diff --git a/sys/dts/arm64/sun50i-a64.dtsi b/sys/dts/arm64/sun50i-a64.dtsi deleted file mode 100644 index fe187575e5ac..000000000000 --- a/sys/dts/arm64/sun50i-a64.dtsi +++ /dev/null @@ -1,661 +0,0 @@ -/* - * Copyright (C) 2016 ARM Ltd. - * based on the Allwinner H3 dtsi: - * Copyright (C) 2015 Jens Kuske - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual - * licensing only applies to this file, and not this project as a - * whole. - * - * a) This file is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Or, alternatively, - * - * b) Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following - * conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * $FreeBSD$ - */ - -#include -#include - -/ { - interrupt-parent = <&gic>; - #address-cells = <1>; - #size-cells = <1>; - - cpus { - #address-cells = <1>; - #size-cells = <0>; - - cpu@0 { - compatible = "arm,cortex-a53", "arm,armv8"; - device_type = "cpu"; - reg = <0>; - enable-method = "psci"; - }; - - cpu@1 { - compatible = "arm,cortex-a53", "arm,armv8"; - device_type = "cpu"; - reg = <1>; - enable-method = "psci"; - }; - - cpu@2 { - compatible = "arm,cortex-a53", "arm,armv8"; - device_type = "cpu"; - reg = <2>; - enable-method = "psci"; - }; - - cpu@3 { - compatible = "arm,cortex-a53", "arm,armv8"; - device_type = "cpu"; - reg = <3>; - enable-method = "psci"; - }; - }; - - psci { - compatible = "arm,psci-0.2"; - method = "smc"; - }; - - memory { - device_type = "memory"; - reg = <0x40000000 0>; - }; - - gic: interrupt-controller@1c81000 { - compatible = "arm,gic-400"; - interrupt-controller; - #interrupt-cells = <3>; - #address-cells = <0>; - - reg = <0x01c81000 0x1000>, - <0x01c82000 0x2000>, - <0x01c84000 0x2000>, - <0x01c86000 0x2000>; - interrupts = ; - }; - - timer { - compatible = "arm,armv8-timer"; - interrupts = , - , - , - ; - }; - - clocks { - #address-cells = <1>; - #size-cells = <1>; - ranges; - - osc24M: osc24M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <24000000>; - clock-output-names = "osc24M"; - }; - - osc32k: osc32k_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; - clock-frequency = <32768>; - clock-output-names = "osc32k"; - }; - - cpux: clk@1c20000 { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a23-pll1-clk"; - reg = <0x01c20000 0x4>; - clocks = <&osc24M>; - clock-output-names = "cpux"; - }; - - periph0: clk@1c20028 { - #clock-cells = <1>; - compatible = "allwinner,sun6i-a31-pll6-clk"; - reg = <0x01c20028 0x4>; - clocks = <&osc24M>; - clock-output-names = "periph0", "periph0x2"; - }; - - periph0d2: periph0d2_clk { - #clock-cells = <0>; - compatible = "fixed-factor-clock"; - clock-div = <2>; - clock-mult = <1>; - clocks = <&periph0 0>; - clock-output-names = "periph0d2"; - }; - - periph1: clk@1c2002c { - #clock-cells = <1>; - compatible = "allwinner,sun6i-a31-pll6-clk"; - reg = <0x01c2002c 0x4>; - clocks = <&osc24M>; - clock-output-names = "periph1", "periph1x2"; - }; - - cpu: cpu_clk@1c20050 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-cpu-clk"; - reg = <0x01c20050 0x4>; - clocks = <&osc32k>, <&osc24M>, <&cpux>, <&cpux>; - clock-output-names = "cpu"; - critical-clocks = <0>; - }; - - axi: axi_clk@1c20050 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-axi-clk"; - reg = <0x01c20050 0x4>; - clocks = <&cpu>; - clock-output-names = "axi"; - }; - - ahb1: ahb1_clk@1c20054 { - #clock-cells = <0>; - compatible = "allwinner,sun6i-a31-ahb1-clk"; - reg = <0x01c20054 0x4>; - clocks = <&osc32k>, <&osc24M>, <&axi>, <&periph0 0>; - clock-output-names = "ahb1"; - }; - - ahb2: ahb2_clk@1c2005c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-h3-ahb2-clk"; - reg = <0x01c2005c 0x4>; - clocks = <&ahb1>, <&periph0d2>; - clock-output-names = "ahb2"; - }; - - apb1: apb1_clk@1c20054 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-apb0-clk"; - reg = <0x01c20054 0x4>; - clocks = <&ahb1>; - clock-output-names = "apb1"; - }; - - apb2: apb2_clk@1c20058 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-apb1-clk"; - reg = <0x01c20058 0x4>; - clocks = <&osc32k>, <&osc24M>, - <&periph0 1>, <&periph0 1>; - clock-output-names = "apb2"; - }; - - bus_gates: bus_gates_clk@1c20060 { - #clock-cells = <1>; - compatible = "allwinner,sun50i-a64-bus-gates-clk", - "allwinner,sunxi-multi-bus-gates-clk"; - reg = <0x01c20060 0x14>; - ahb1_parent { - clocks = <&ahb1>; - clock-indices = <1>, <5>, - <6>, <8>, - <9>, <10>, - <13>, <14>, - <18>, <19>, - <20>, <21>, - <23>, <24>, - <25>, <28>, - <32>, <35>, - <36>, <37>, - <40>, <43>, - <44>, <52>, - <53>, <54>, - <135>; - clock-output-names = "bus_mipidsi", "bus_ce", - "bus_dma", "bus_mmc0", - "bus_mmc1", "bus_mmc2", - "bus_nand", "bus_sdram", - "bus_ts", "bus_hstimer", - "bus_spi0", "bus_spi1", - "bus_otg", "bus_otg_ehci0", - "bus_ehci0", "bus_otg_ohci0", - "bus_ve", "bus_lcd0", - "bus_lcd1", "bus_deint", - "bus_csi", "bus_hdmi", - "bus_de", "bus_gpu", - "bus_msgbox", "bus_spinlock", - "bus_dbg"; - }; - ahb2_parent { - clocks = <&ahb2>; - clock-indices = <17>, <29>; - clock-output-names = "bus_gmac", "bus_ohci0"; - }; - apb1_parent { - clocks = <&apb1>; - clock-indices = <64>, <65>, - <69>, <72>, - <76>, <77>, - <78>; - clock-output-names = "bus_codec", "bus_spdif", - "bus_pio", "bus_ths", - "bus_i2s0", "bus_i2s1", - "bus_i2s2"; - }; - abp2_parent { - clocks = <&apb2>; - clock-indices = <96>, <97>, - <98>, <101>, - <112>, <113>, - <114>, <115>, - <116>; - clock-output-names = "bus_i2c0", "bus_i2c1", - "bus_i2c2", "bus_scr", - "bus_uart0", "bus_uart1", - "bus_uart2", "bus_uart3", - "bus_uart4"; - }; - }; - - mmc0_clk: mmc0_clk@1c20088 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-mod0-clk"; - reg = <0x01c20088 0x4>; - clocks = <&osc24M>, <&periph0 1>, <&periph1 1>; - clock-output-names = "mmc0"; - }; - - mmc1_clk: mmc1_clk@1c2008c { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-mod0-clk"; - reg = <0x01c2008c 0x4>; - clocks = <&osc24M>, <&periph0 1>, <&periph1 1>; - clock-output-names = "mmc1"; - }; - - mmc2_clk: mmc2_clk@1c20090 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-mod0-clk"; - reg = <0x01c20090 0x4>; - clocks = <&osc24M>, <&periph0 1>, <&periph1 1>; - clock-output-names = "mmc2"; - }; - }; - - soc { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - - mmc0: mmc@1c0f000 { - compatible = "allwinner,sun50i-a64-mmc", - "allwinner,sun5i-a13-mmc"; - reg = <0x01c0f000 0x1000>; - clocks = <&bus_gates 8>, <&mmc0_clk>, - <&mmc0_clk>, <&mmc0_clk>; - clock-names = "ahb", "mmc", - "output", "sample"; - resets = <&ahb_rst 8>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - mmc1: mmc@1c10000 { - compatible = "allwinner,sun50i-a64-mmc", - "allwinner,sun5i-a13-mmc"; - reg = <0x01c10000 0x1000>; - clocks = <&bus_gates 9>, <&mmc1_clk>, - <&mmc1_clk>, <&mmc1_clk>; - clock-names = "ahb", "mmc", - "output", "sample"; - resets = <&ahb_rst 9>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - mmc2: mmc@1c11000 { - compatible = "allwinner,sun50i-a64-mmc", - "allwinner,sun5i-a13-mmc"; - reg = <0x01c11000 0x1000>; - clocks = <&bus_gates 10>, <&mmc2_clk>, - <&mmc2_clk>, <&mmc2_clk>; - clock-names = "ahb", "mmc", - "output", "sample"; - resets = <&ahb_rst 10>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - pio: pinctrl@1c20800 { - compatible = "allwinner,sun50i-a64-pinctrl"; - reg = <0x01c20800 0x400>; - interrupts = , - , - ; - clocks = <&bus_gates 69>; - gpio-controller; - #gpio-cells = <3>; - interrupt-controller; - #interrupt-cells = <2>; - - uart0_pins_a: uart0@0 { - allwinner,pins = "PB8", "PB9"; - allwinner,function = "uart0"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart0_pins_b: uart0@1 { - allwinner,pins = "PF2", "PF3"; - allwinner,function = "uart0"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart1_2pins: uart1_2@0 { - allwinner,pins = "PG6", "PG7"; - allwinner,function = "uart1"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart1_4pins: uart1_4@0 { - allwinner,pins = "PG6", "PG7", "PG8", "PG9"; - allwinner,function = "uart1"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart2_2pins: uart2_2@0 { - allwinner,pins = "PB0", "PB1"; - allwinner,function = "uart2"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart2_4pins: uart2_4@0 { - allwinner,pins = "PB0", "PB1", "PB2", "PB3"; - allwinner,function = "uart2"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart3_pins_a: uart3@0 { - allwinner,pins = "PD0", "PD1"; - allwinner,function = "uart3"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart3_2pins_b: uart3_2@1 { - allwinner,pins = "PH4", "PH5"; - allwinner,function = "uart3"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart3_4pins_b: uart3_4@1 { - allwinner,pins = "PH4", "PH5", "PH6", "PH7"; - allwinner,function = "uart3"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart4_2pins: uart4_2@0 { - allwinner,pins = "PD2", "PD3"; - allwinner,function = "uart4"; - allwinner,drive = ; - allwinner,pull = ; - }; - - uart4_4pins: uart4_4@0 { - allwinner,pins = "PD2", "PD3", "PD4", "PD5"; - allwinner,function = "uart4"; - allwinner,drive = ; - allwinner,pull = ; - }; - - mmc0_pins: mmc0@0 { - allwinner,pins = "PF0", "PF1", "PF2", "PF3", - "PF4", "PF5"; - allwinner,function = "mmc0"; - allwinner,drive = ; - allwinner,pull = ; - }; - - mmc0_default_cd_pin: mmc0_cd_pin@0 { - allwinner,pins = "PF6"; - allwinner,function = "gpio_in"; - allwinner,drive = ; - allwinner,pull = ; - }; - - mmc1_pins: mmc1@0 { - allwinner,pins = "PG0", "PG1", "PG2", "PG3", - "PG4", "PG5"; - allwinner,function = "mmc1"; - allwinner,drive = ; - allwinner,pull = ; - }; - - mmc2_pins: mmc2@0 { - allwinner,pins = "PC1", "PC5", "PC6", "PC8", - "PC9", "PC10"; - allwinner,function = "mmc2"; - allwinner,drive = ; - allwinner,pull = ; - }; - - i2c0_pins: i2c0_pins { - allwinner,pins = "PH0", "PH1"; - allwinner,function = "i2c0"; - allwinner,drive = ; - allwinner,pull = ; - }; - - i2c1_pins: i2c1_pins { - allwinner,pins = "PH2", "PH3"; - allwinner,function = "i2c1"; - allwinner,drive = ; - allwinner,pull = ; - }; - - i2c2_pins: i2c2_pins { - allwinner,pins = "PE14", "PE15"; - allwinner,function = "i2c2"; - allwinner,drive = ; - allwinner,pull = ; - }; - - rmii_pins: rmii_pins { - allwinner,pins = "PD10", "PD11", "PD13", "PD14", - "PD17", "PD18", "PD19", "PD20", - "PD22", "PD23"; - allwinner,function = "emac"; - allwinner,drive = ; - allwinner,pull = ; - }; - - rgmii_pins: rgmii_pins { - allwinner,pins = "PD8", "PD9", "PD10", "PD11", - "PD12", "PD13", "PD15", - "PD16", "PD17", "PD18", "PD19", - "PD20", "PD21", "PD22", "PD23"; - allwinner,function = "emac"; - allwinner,drive = ; - allwinner,pull = ; - }; - }; - - ahb_rst: reset@1c202c0 { - #reset-cells = <1>; - compatible = "allwinner,sun6i-a31-clock-reset"; - reg = <0x01c202c0 0xc>; - }; - - apb1_rst: reset@1c202d0 { - #reset-cells = <1>; - compatible = "allwinner,sun6i-a31-clock-reset"; - reg = <0x01c202d0 0x4>; - }; - - apb2_rst: reset@1c202d8 { - #reset-cells = <1>; - compatible = "allwinner,sun6i-a31-clock-reset"; - reg = <0x01c202d8 0x4>; - }; - - uart0: serial@1c28000 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28000 0x400>; - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 112>; - resets = <&apb2_rst 16>; - status = "disabled"; - }; - - uart1: serial@1c28400 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28400 0x400>; - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 113>; - resets = <&apb2_rst 17>; - status = "disabled"; - }; - - uart2: serial@1c28800 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28800 0x400>; - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 114>; - resets = <&apb2_rst 18>; - status = "disabled"; - }; - - uart3: serial@1c28c00 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28c00 0x400>; - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 115>; - resets = <&apb2_rst 19>; - status = "disabled"; - }; - - uart4: serial@1c29000 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c29000 0x400>; - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 116>; - resets = <&apb2_rst 20>; - status = "disabled"; - }; - - rtc: rtc@1f00000 { - compatible = "allwinner,sun6i-a31-rtc"; - reg = <0x01f00000 0x54>; - interrupts = , - ; - }; - - i2c0: i2c@1c2ac00 { - compatible = "allwinner,sun6i-a31-i2c"; - reg = <0x01c2ac00 0x400>; - interrupts = ; - clocks = <&bus_gates 96>; - resets = <&apb2_rst 0>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - i2c1: i2c@1c2b000 { - compatible = "allwinner,sun6i-a31-i2c"; - reg = <0x01c2b000 0x400>; - interrupts = ; - clocks = <&bus_gates 97>; - resets = <&apb2_rst 1>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - i2c2: i2c@1c2b400 { - compatible = "allwinner,sun6i-a31-i2c"; - reg = <0x01c2b400 0x400>; - interrupts = ; - clocks = <&bus_gates 98>; - resets = <&apb2_rst 2>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - - emac: ethernet@1c30000 { - compatible = "allwinner,sun50i-a64-emac", - "allwinner,sun8i-h3-emac"; - reg = <0x01c30000 0x100>, <0x01c00030 0x4>; - reg-names = "emac", "syscon"; - interrupts = ; - resets = <&ahb_rst 17>; - reset-names = "ahb"; - clocks = <&bus_gates 17>; - clock-names = "ahb"; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; - }; - }; -}; From 4a8dea8cf97aab33f4e6a11afcc64dd9562f3bfd Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Sun, 19 Nov 2017 00:31:13 +0000 Subject: [PATCH 86/92] ANSIfy sys/libkern PR: 223641 Submitted by: ota@j.email.ne.jp MFC after: 1 week --- sys/libkern/ashrdi3.c | 4 +--- sys/libkern/bcmp.c | 4 +--- sys/libkern/bsearch.c | 8 ++------ sys/libkern/cmpdi2.c | 3 +-- sys/libkern/divdi3.c | 3 +-- sys/libkern/lshrdi3.c | 4 +--- sys/libkern/mcount.c | 6 ++---- sys/libkern/moddi3.c | 3 +-- sys/libkern/qdivrem.c | 3 +-- sys/libkern/random.c | 3 +-- sys/libkern/scanc.c | 5 +---- sys/libkern/strcmp.c | 3 +-- sys/libkern/strlcat.c | 5 +---- sys/libkern/strsep.c | 4 +--- sys/libkern/strtol.c | 5 +---- sys/libkern/strtoul.c | 5 +---- sys/libkern/ucmpdi2.c | 3 +-- sys/libkern/udivdi3.c | 3 +-- sys/libkern/umoddi3.c | 3 +-- 19 files changed, 21 insertions(+), 56 deletions(-) diff --git a/sys/libkern/ashrdi3.c b/sys/libkern/ashrdi3.c index bba4897b2b8c..df3d569b071f 100644 --- a/sys/libkern/ashrdi3.c +++ b/sys/libkern/ashrdi3.c @@ -40,9 +40,7 @@ __FBSDID("$FreeBSD$"); * Shift a (signed) quad value right (arithmetic shift right). */ quad_t -__ashrdi3(a, shift) - quad_t a; - qshift_t shift; +__ashrdi3(quad_t a, qshift_t shift) { union uu aa; diff --git a/sys/libkern/bcmp.c b/sys/libkern/bcmp.c index 37cce24956fe..023d4cbe3cbf 100644 --- a/sys/libkern/bcmp.c +++ b/sys/libkern/bcmp.c @@ -42,9 +42,7 @@ typedef const unsigned long *culp; * bcmp -- vax cmpc3 instruction */ int -bcmp(b1, b2, length) - const void *b1, *b2; - size_t length; +bcmp(const void *b1, const void *b2, size_t length) { #if BYTE_ORDER == LITTLE_ENDIAN /* diff --git a/sys/libkern/bsearch.c b/sys/libkern/bsearch.c index 689f6203051b..37bf6fff50bf 100644 --- a/sys/libkern/bsearch.c +++ b/sys/libkern/bsearch.c @@ -53,12 +53,8 @@ __FBSDID("$FreeBSD$"); * look at item 3. */ void * -bsearch(key, base0, nmemb, size, compar) - const void *key; - const void *base0; - size_t nmemb; - size_t size; - int (*compar)(const void *, const void *); +bsearch(const void *key, const void *base0, size_t nmemb, size_t size, + int (*compar)(const void *, const void *)) { const char *base = base0; size_t lim; diff --git a/sys/libkern/cmpdi2.c b/sys/libkern/cmpdi2.c index ae077e9514bb..d0b44a896fb8 100644 --- a/sys/libkern/cmpdi2.c +++ b/sys/libkern/cmpdi2.c @@ -42,8 +42,7 @@ __FBSDID("$FreeBSD$"); * signed. */ int -__cmpdi2(a, b) - quad_t a, b; +__cmpdi2(quad_t a, quad_t b) { union uu aa, bb; diff --git a/sys/libkern/divdi3.c b/sys/libkern/divdi3.c index e080b290164c..499e0b78a7dc 100644 --- a/sys/libkern/divdi3.c +++ b/sys/libkern/divdi3.c @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); * ??? if -1/2 should produce -1 on this machine, this code is wrong */ quad_t -__divdi3(a, b) - quad_t a, b; +__divdi3(quad_t a, quad_t b) { u_quad_t ua, ub, uq; int neg; diff --git a/sys/libkern/lshrdi3.c b/sys/libkern/lshrdi3.c index df8f5e852dc9..ec87e07cf564 100644 --- a/sys/libkern/lshrdi3.c +++ b/sys/libkern/lshrdi3.c @@ -40,9 +40,7 @@ __FBSDID("$FreeBSD$"); * Shift an (unsigned) quad value right (logical shift right). */ quad_t -__lshrdi3(a, shift) - quad_t a; - qshift_t shift; +__lshrdi3(quad_t a, qshift_t shift) { union uu aa; diff --git a/sys/libkern/mcount.c b/sys/libkern/mcount.c index a0768c1ea274..f180967a7206 100644 --- a/sys/libkern/mcount.c +++ b/sys/libkern/mcount.c @@ -56,8 +56,7 @@ __FBSDID("$FreeBSD$"); * both frompcindex and frompc. Any reasonable, modern compiler will * perform this optimization. */ -_MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */ - uintfptr_t frompc, selfpc; +_MCOUNT_DECL(uintfptr_t frompc, uintfptr_t selfpc) /* _mcount; may be static, inline, etc */ { #ifdef GUPROF int delta; @@ -245,8 +244,7 @@ MCOUNT #ifdef GUPROF void -mexitcount(selfpc) - uintfptr_t selfpc; +mexitcount(uintfptr_t selfpc) { struct gmonparam *p; uintfptr_t selfpcdiff; diff --git a/sys/libkern/moddi3.c b/sys/libkern/moddi3.c index ad0e5dda15ad..5564b9c24a2d 100644 --- a/sys/libkern/moddi3.c +++ b/sys/libkern/moddi3.c @@ -43,8 +43,7 @@ __FBSDID("$FreeBSD$"); * If -1/2 should produce -1 on this machine, this code is wrong. */ quad_t -__moddi3(a, b) - quad_t a, b; +__moddi3(quad_t a, quad_t b) { u_quad_t ua, ub, ur; int neg; diff --git a/sys/libkern/qdivrem.c b/sys/libkern/qdivrem.c index 7f95ea195cd1..336a4b53e135 100644 --- a/sys/libkern/qdivrem.c +++ b/sys/libkern/qdivrem.c @@ -77,8 +77,7 @@ __shl(digit *p, int len, int sh) * leading zeros). */ u_quad_t -__qdivrem(uq, vq, arq) - u_quad_t uq, vq, *arq; +__qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq) { union uu tmp; digit *u, *v, *q; diff --git a/sys/libkern/random.c b/sys/libkern/random.c index 85bd3677baa8..e580b7130890 100644 --- a/sys/libkern/random.c +++ b/sys/libkern/random.c @@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$"); static u_long randseed = 937186357; /* after srandom(1), NSHUFF counted */ void -srandom(seed) - u_long seed; +srandom(u_long seed) { int i; diff --git a/sys/libkern/scanc.c b/sys/libkern/scanc.c index e27522982bd5..4531faa81cd8 100644 --- a/sys/libkern/scanc.c +++ b/sys/libkern/scanc.c @@ -35,10 +35,7 @@ __FBSDID("$FreeBSD$"); #include int -scanc(size, cp, table, mask0) - u_int size; - const u_char *cp, table[]; - int mask0; +scanc(u_int size, const u_char *cp, const u_char table[], int mask0) { const u_char *end; u_char mask; diff --git a/sys/libkern/strcmp.c b/sys/libkern/strcmp.c index 8b80027a35b1..fcfdde8fface 100644 --- a/sys/libkern/strcmp.c +++ b/sys/libkern/strcmp.c @@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$"); * Compare strings. */ int -strcmp(s1, s2) - const char *s1, *s2; +strcmp(const char *s1, const char *s2) { while (*s1 == *s2++) if (*s1++ == 0) diff --git a/sys/libkern/strlcat.c b/sys/libkern/strlcat.c index 74d3bcc87d54..c532ffcdbe99 100644 --- a/sys/libkern/strlcat.c +++ b/sys/libkern/strlcat.c @@ -44,10 +44,7 @@ __FBSDID("$FreeBSD$"); * If retval >= siz, truncation occurred. */ size_t -strlcat(dst, src, siz) - char *dst; - const char *src; - size_t siz; +strlcat(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; diff --git a/sys/libkern/strsep.c b/sys/libkern/strsep.c index 31a86a42349e..bf74112da63c 100644 --- a/sys/libkern/strsep.c +++ b/sys/libkern/strsep.c @@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$"); * If *stringp is NULL, strsep returns NULL. */ char * -strsep(stringp, delim) - char **stringp; - const char *delim; +strsep(char **stringp, const char *delim) { char *s; const char *spanp; diff --git a/sys/libkern/strtol.c b/sys/libkern/strtol.c index b1a5c01cd59b..739cccbff492 100644 --- a/sys/libkern/strtol.c +++ b/sys/libkern/strtol.c @@ -47,10 +47,7 @@ __FBSDID("$FreeBSD$"); * alphabets and digits are each contiguous. */ long -strtol(nptr, endptr, base) - const char *nptr; - char **endptr; - int base; +strtol(const char *nptr, char **endptr, int base) { const char *s = nptr; unsigned long acc; diff --git a/sys/libkern/strtoul.c b/sys/libkern/strtoul.c index 746ac923bd09..7b24e2272270 100644 --- a/sys/libkern/strtoul.c +++ b/sys/libkern/strtoul.c @@ -47,10 +47,7 @@ __FBSDID("$FreeBSD$"); * alphabets and digits are each contiguous. */ unsigned long -strtoul(nptr, endptr, base) - const char *nptr; - char **endptr; - int base; +strtoul(const char *nptr, char **endptr, int base) { const char *s = nptr; unsigned long acc; diff --git a/sys/libkern/ucmpdi2.c b/sys/libkern/ucmpdi2.c index fe0d8f5e4d40..91c3c5a3556d 100644 --- a/sys/libkern/ucmpdi2.c +++ b/sys/libkern/ucmpdi2.c @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); * Neither a nor b are considered signed. */ int -__ucmpdi2(a, b) - u_quad_t a, b; +__ucmpdi2(u_quad_t a, u_quad_t b) { union uu aa, bb; diff --git a/sys/libkern/udivdi3.c b/sys/libkern/udivdi3.c index 9bf7542b878c..2d00ea6c5a13 100644 --- a/sys/libkern/udivdi3.c +++ b/sys/libkern/udivdi3.c @@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$"); * Divide two unsigned quads. */ u_quad_t -__udivdi3(a, b) - u_quad_t a, b; +__udivdi3(u_quad_t a, u_quad_t b) { return (__qdivrem(a, b, (u_quad_t *)0)); diff --git a/sys/libkern/umoddi3.c b/sys/libkern/umoddi3.c index 9b2111196e66..2f5c540dc6b1 100644 --- a/sys/libkern/umoddi3.c +++ b/sys/libkern/umoddi3.c @@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$"); * Return remainder after dividing two unsigned quads. */ u_quad_t -__umoddi3(a, b) - u_quad_t a, b; +__umoddi3(u_quad_t a, u_quad_t b) { u_quad_t r; From 6be8e27be013a67c96cbdda060a5f17b13a66eea Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Sun, 19 Nov 2017 02:16:11 +0000 Subject: [PATCH 87/92] Add missing call to services_mkdb to build the services.db Approved by: gjb --- release/packages/runtime.ucl | 1 + 1 file changed, 1 insertion(+) diff --git a/release/packages/runtime.ucl b/release/packages/runtime.ucl index 8f37ccaa53c4..975c50f87048 100644 --- a/release/packages/runtime.ucl +++ b/release/packages/runtime.ucl @@ -20,6 +20,7 @@ scripts: { post-install = < Date: Sun, 19 Nov 2017 03:14:10 +0000 Subject: [PATCH 88/92] aw_nmi: add support for a31/a83t's r_intc We currently support the a83t's r_intc in a somewhat hack-ish way; our .dts describes it as nmi_intc, and uses a subset of the actual register space to make it line up with a20/a31 nmi offsets. This breaks with the recent 4.14 update describing r_intc using the full register space, so update aw_nmi to use the correct register offsets with the right compat data in a way that doesn't break our current dts with nmi_intc or upstream with r_intc described. Reviewed by: manu Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D13122 --- sys/arm/allwinner/aw_nmi.c | 69 ++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/sys/arm/allwinner/aw_nmi.c b/sys/arm/allwinner/aw_nmi.c index 86c122f5300a..73783c13cee4 100644 --- a/sys/arm/allwinner/aw_nmi.c +++ b/sys/arm/allwinner/aw_nmi.c @@ -57,6 +57,10 @@ __FBSDID("$FreeBSD$"); #define A31_NMI_IRQ_ENABLE_REG 0x34 #define NMI_IRQ_ENABLE (1U << 0) +#define R_NMI_IRQ_CTRL_REG 0x0c +#define R_NMI_IRQ_PENDING_REG 0x10 +#define R_NMI_IRQ_ENABLE_REG 0x40 + #define SC_NMI_READ(_sc, _reg) bus_read_4(_sc->res[0], _reg) #define SC_NMI_WRITE(_sc, _reg, _val) bus_write_4(_sc->res[0], _reg, _val) @@ -73,21 +77,43 @@ struct aw_nmi_intr { enum intr_trigger tri; }; +struct aw_nmi_reg_cfg { + uint8_t ctrl_reg; + uint8_t pending_reg; + uint8_t enable_reg; +}; + struct aw_nmi_softc { device_t dev; struct resource * res[2]; void * intrcookie; struct aw_nmi_intr intr; - uint8_t enable_reg; + struct aw_nmi_reg_cfg * cfg; }; -#define A20_NMI 1 -#define A31_NMI 2 +static struct aw_nmi_reg_cfg a20_nmi_cfg = { + .ctrl_reg = NMI_IRQ_CTRL_REG, + .pending_reg = NMI_IRQ_PENDING_REG, + .enable_reg = A20_NMI_IRQ_ENABLE_REG, +}; + +static struct aw_nmi_reg_cfg a31_nmi_cfg = { + .ctrl_reg = NMI_IRQ_CTRL_REG, + .pending_reg = NMI_IRQ_PENDING_REG, + .enable_reg = A31_NMI_IRQ_ENABLE_REG, +}; + +static struct aw_nmi_reg_cfg a83t_r_nmi_cfg = { + .ctrl_reg = R_NMI_IRQ_CTRL_REG, + .pending_reg = R_NMI_IRQ_PENDING_REG, + .enable_reg = R_NMI_IRQ_ENABLE_REG, +}; static struct ofw_compat_data compat_data[] = { - {"allwinner,sun7i-a20-sc-nmi", A20_NMI}, - {"allwinner,sun6i-a31-sc-nmi", A31_NMI}, - + {"allwinner,sun7i-a20-sc-nmi", (uintptr_t)&a20_nmi_cfg}, + {"allwinner,sun6i-a31-sc-nmi", (uintptr_t)&a31_nmi_cfg}, + {"allwinner,sun6i-a31-r-intc", (uintptr_t)&a83t_r_nmi_cfg}, + {"allwinner,sun8i-a83t-r-intc", (uintptr_t)&a83t_r_nmi_cfg}, {NULL, 0}, }; @@ -98,13 +124,13 @@ aw_nmi_intr(void *arg) sc = arg; - if (SC_NMI_READ(sc, NMI_IRQ_PENDING_REG) == 0) { + if (SC_NMI_READ(sc, sc->cfg->pending_reg) == 0) { device_printf(sc->dev, "Spurious interrupt\n"); return (FILTER_HANDLED); } if (intr_isrc_dispatch(&sc->intr.isrc, curthread->td_intr_frame) != 0) { - SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE); device_printf(sc->dev, "Stray interrupt, NMI disabled\n"); } @@ -118,7 +144,7 @@ aw_nmi_enable_intr(device_t dev, struct intr_irqsrc *isrc) sc = device_get_softc(dev); - SC_NMI_WRITE(sc, sc->enable_reg, NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, NMI_IRQ_ENABLE); } static void @@ -128,7 +154,7 @@ aw_nmi_disable_intr(device_t dev, struct intr_irqsrc *isrc) sc = device_get_softc(dev); - SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE); } static int @@ -254,7 +280,7 @@ aw_nmi_setup_intr(device_t dev, struct intr_irqsrc *isrc, icfg = NMI_IRQ_LOW_EDGE; } - SC_NMI_WRITE(sc, NMI_IRQ_CTRL_REG, icfg); + SC_NMI_WRITE(sc, sc->cfg->ctrl_reg, icfg); return (0); } @@ -271,7 +297,7 @@ aw_nmi_teardown_intr(device_t dev, struct intr_irqsrc *isrc, sc->intr.pol = INTR_POLARITY_CONFORM; sc->intr.tri = INTR_TRIGGER_CONFORM; - SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE); } return (0); @@ -284,7 +310,7 @@ aw_nmi_pre_ithread(device_t dev, struct intr_irqsrc *isrc) sc = device_get_softc(dev); aw_nmi_disable_intr(dev, isrc); - SC_NMI_WRITE(sc, NMI_IRQ_PENDING_REG, NMI_IRQ_ACK); + SC_NMI_WRITE(sc, sc->cfg->pending_reg, NMI_IRQ_ACK); } static void @@ -303,7 +329,7 @@ aw_nmi_post_filter(device_t dev, struct intr_irqsrc *isrc) sc = device_get_softc(dev); arm_irq_memory_barrier(0); - SC_NMI_WRITE(sc, NMI_IRQ_PENDING_REG, NMI_IRQ_ACK); + SC_NMI_WRITE(sc, sc->cfg->pending_reg, NMI_IRQ_ACK); } static int @@ -327,6 +353,8 @@ aw_nmi_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + sc->cfg = (struct aw_nmi_reg_cfg *) + ofw_bus_search_compatible(dev, compat_data)->ocd_data; if (bus_alloc_resources(dev, aw_nmi_res_spec, sc->res) != 0) { device_printf(dev, "can't allocate device resources\n"); @@ -339,18 +367,9 @@ aw_nmi_attach(device_t dev) return (ENXIO); } - switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { - case A20_NMI: - sc->enable_reg = A20_NMI_IRQ_ENABLE_REG; - break; - case A31_NMI: - sc->enable_reg = A31_NMI_IRQ_ENABLE_REG; - break; - } - /* Disable and clear interrupts */ - SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); - SC_NMI_WRITE(sc, NMI_IRQ_PENDING_REG, NMI_IRQ_ACK); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->pending_reg, NMI_IRQ_ACK); xref = OF_xref_from_node(ofw_bus_get_node(dev)); /* Register our isrc */ From eafe4941b3d1dd2e61306f3797bb869efa037db2 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Sun, 19 Nov 2017 03:51:47 +0000 Subject: [PATCH 89/92] Remove unused header. --- sys/fs/tmpfs/tmpfs_fifoops.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/fs/tmpfs/tmpfs_fifoops.c b/sys/fs/tmpfs/tmpfs_fifoops.c index 30e5d1a91493..025132b44b92 100644 --- a/sys/fs/tmpfs/tmpfs_fifoops.c +++ b/sys/fs/tmpfs/tmpfs_fifoops.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include From 11d38f2ca0904d4b3c521e35636166e9a671a237 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Sun, 19 Nov 2017 03:52:03 +0000 Subject: [PATCH 90/92] Remove unused header. --- sys/fs/nfsclient/nfs_clnfsiod.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clnfsiod.c b/sys/fs/nfsclient/nfs_clnfsiod.c index 452e299e6dac..b0933e56ed58 100644 --- a/sys/fs/nfsclient/nfs_clnfsiod.c +++ b/sys/fs/nfsclient/nfs_clnfsiod.c @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From 319a53f5ada4bbe6331af016b352fe37fd746067 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sun, 19 Nov 2017 11:21:16 +0000 Subject: [PATCH 91/92] Fix build. Sponsored by: The FreeBSD Foundation --- sys/net/if_fddisubr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index 5afe0c4525ea..5d3cd4272dd0 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -1,6 +1,6 @@ +/*- * SPDX-License-Identifier: BSD-4-Clause * -/*- * Copyright (c) 1995, 1996 * Matt Thomas . All rights reserved. * Copyright (c) 1982, 1989, 1993 From d12546572d581e2a46793b3bd09fe29f8046398b Mon Sep 17 00:00:00 2001 From: Yoshihiro Takahashi Date: Sun, 19 Nov 2017 11:33:46 +0000 Subject: [PATCH 92/92] Remove empty directories.