From 645a23bd1cc9bb3bba7db1df4c055305cc319e90 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Wed, 12 Jul 2017 21:09:33 +0300 Subject: [PATCH] Update sunxi-next to 4.12 --- config/kernel/linux-sunxi-next.config | 308 ++- configuration.sh | 6 +- ... => add-ad9834-dt-bindings.patch.disabled} | 0 .../add-overlay-compilation-support.patch | 30 +- ...verlays.patch => add-sunxi-overlays.patch} | 1078 +++++++++- ....patch => cubieboard_green_LED_mmc0.patch} | 0 ....patch => cubietruck_green_LED_mmc0.patch} | 0 ...ng-4.x-NEXT-with-postinstall-scripts.patch | 63 +- .../sunxi-next/resolve-crypto-deps.patch | 198 -- .../scripts-dtc-import-updates.patch | 1896 +---------------- 10 files changed, 1310 insertions(+), 2269 deletions(-) rename patch/kernel/sunxi-next/{add-ad9834-dt-bindings.patch => add-ad9834-dt-bindings.patch.disabled} (100%) rename patch/kernel/sunxi-next/{add-a20-overlays.patch => add-sunxi-overlays.patch} (71%) rename patch/kernel/sunxi-next/{cubieboard_enable_mmc0_trigger_to_green_LED.patch => cubieboard_green_LED_mmc0.patch} (100%) rename patch/kernel/sunxi-next/{cubietruck_enable_mmc0_trigger_to_green_LED.patch => cubietruck_green_LED_mmc0.patch} (100%) delete mode 100644 patch/kernel/sunxi-next/resolve-crypto-deps.patch diff --git a/config/kernel/linux-sunxi-next.config b/config/kernel/linux-sunxi-next.config index 264e83375d..4064a11a1c 100644 --- a/config/kernel/linux-sunxi-next.config +++ b/config/kernel/linux-sunxi-next.config @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.11.2 Kernel Configuration +# Linux/arm 4.12.1 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -109,8 +109,10 @@ CONFIG_TASK_IO_ACCOUNTING=y CONFIG_TREE_RCU=y # CONFIG_RCU_EXPERT is not set CONFIG_SRCU=y +CONFIG_TREE_SRCU=y # CONFIG_TASKS_RCU is not set CONFIG_RCU_STALL_COMMON=y +CONFIG_RCU_NEED_SEGCBLIST=y # CONFIG_TREE_RCU_TRACE is not set CONFIG_BUILD_BIN2C=y CONFIG_IKCONFIG=y @@ -130,7 +132,7 @@ CONFIG_CGROUP_WRITEBACK=y CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_CFS_BANDWIDTH=y -CONFIG_RT_GROUP_SCHED=y +# CONFIG_RT_GROUP_SCHED is not set CONFIG_CGROUP_PIDS=y CONFIG_CGROUP_RDMA=y CONFIG_CGROUP_FREEZER=y @@ -142,7 +144,7 @@ CONFIG_CGROUP_PERF=y CONFIG_CGROUP_BPF=y # CONFIG_CGROUP_DEBUG is not set CONFIG_SOCK_CGROUP_DATA=y -# CONFIG_CHECKPOINT_RESTORE is not set +CONFIG_CHECKPOINT_RESTORE=y CONFIG_NAMESPACES=y CONFIG_UTS_NS=y CONFIG_IPC_NS=y @@ -160,7 +162,6 @@ CONFIG_RD_LZMA=y CONFIG_RD_XZ=y CONFIG_RD_LZO=y CONFIG_RD_LZ4=y -CONFIG_INITRAMFS_COMPRESSION=".gz" CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SYSCTL=y @@ -301,6 +302,7 @@ CONFIG_BLK_DEV_BSGLIB=y CONFIG_BLK_DEV_INTEGRITY=y # CONFIG_BLK_DEV_ZONED is not set CONFIG_BLK_DEV_THROTTLING=y +# CONFIG_BLK_DEV_THROTTLING_LOW is not set # CONFIG_BLK_CMDLINE_PARSER is not set CONFIG_BLK_WBT=y CONFIG_BLK_WBT_SQ=y @@ -327,6 +329,9 @@ CONFIG_DEFAULT_CFQ=y # CONFIG_DEFAULT_NOOP is not set CONFIG_DEFAULT_IOSCHED="cfq" CONFIG_MQ_IOSCHED_DEADLINE=y +CONFIG_MQ_IOSCHED_KYBER=y +CONFIG_IOSCHED_BFQ=y +CONFIG_BFQ_GROUP_IOSCHED=y CONFIG_PADATA=y CONFIG_ASN1=m CONFIG_INLINE_SPIN_UNLOCK_IRQ=y @@ -345,7 +350,6 @@ CONFIG_FREEZER=y # CONFIG_MMU=y CONFIG_ARCH_MULTIPLATFORM=y -# CONFIG_ARCH_GEMINI is not set # CONFIG_ARCH_EBSA110 is not set # CONFIG_ARCH_EP93XX is not set # CONFIG_ARCH_FOOTBRIDGE is not set @@ -499,6 +503,11 @@ CONFIG_MULTI_IRQ_HANDLER=y # # DesignWare PCI Core Support # + +# +# PCI Endpoint +# +# CONFIG_PCI_ENDPOINT is not set # CONFIG_PCCARD is not set # @@ -633,6 +642,7 @@ CONFIG_CPUFREQ_DT=m CONFIG_CPUFREQ_DT_PLATDEV=y CONFIG_ARM_BIG_LITTLE_CPUFREQ=m CONFIG_ARM_DT_BL_CPUFREQ=m +# CONFIG_ARM_DB8500_CPUFREQ is not set # CONFIG_ARM_KIRKWOOD_CPUFREQ is not set # CONFIG_QORIQ_CPUFREQ is not set @@ -1205,7 +1215,7 @@ CONFIG_BRIDGE=m CONFIG_BRIDGE_IGMP_SNOOPING=y CONFIG_BRIDGE_VLAN_FILTERING=y CONFIG_HAVE_NET_DSA=y -CONFIG_NET_DSA=y +CONFIG_NET_DSA=m CONFIG_VLAN_8021Q=m CONFIG_VLAN_8021Q_GVRP=y CONFIG_VLAN_8021Q_MVRP=y @@ -1267,6 +1277,13 @@ CONFIG_NET_SCH_FQ=m # CONFIG_NET_SCH_PIE is not set CONFIG_NET_SCH_INGRESS=m # CONFIG_NET_SCH_PLUG is not set +CONFIG_NET_SCH_DEFAULT=y +# CONFIG_DEFAULT_FQ is not set +# CONFIG_DEFAULT_CODEL is not set +# CONFIG_DEFAULT_FQ_CODEL is not set +# CONFIG_DEFAULT_SFQ is not set +CONFIG_DEFAULT_PFIFO_FAST=y +CONFIG_DEFAULT_NET_SCH="pfifo_fast" # # Classification @@ -1380,6 +1397,7 @@ CONFIG_CAN_GW=m # CAN Device Drivers # CONFIG_CAN_VCAN=m +CONFIG_CAN_VXCAN=m CONFIG_CAN_SLCAN=m CONFIG_CAN_DEV=m CONFIG_CAN_CALC_BITTIMING=y @@ -1400,6 +1418,7 @@ CONFIG_CAN_SUN4I=m # # CAN SPI interfaces # +CONFIG_CAN_HI311X=m CONFIG_CAN_MCP251X=m # @@ -1411,6 +1430,7 @@ CONFIG_CAN_GS_USB=m CONFIG_CAN_KVASER_USB=m CONFIG_CAN_PEAK_USB=m CONFIG_CAN_8DEV_USB=m +CONFIG_CAN_MCBA_USB=m # CONFIG_CAN_DEBUG_DEVICES is not set CONFIG_IRDA=m @@ -1478,7 +1498,9 @@ CONFIG_BT_HCIBTUSB_BCM=y CONFIG_BT_HCIBTUSB_RTL=y CONFIG_BT_HCIBTSDIO=m CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_SERDEV=y CONFIG_BT_HCIUART_H4=y +# CONFIG_BT_HCIUART_NOKIA is not set CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIUART_ATH3K=y CONFIG_BT_HCIUART_LL=y @@ -1580,6 +1602,7 @@ CONFIG_DEV_COREDUMP=y # CONFIG_TEST_ASYNC_DRIVER_PROBE is not set # CONFIG_SYS_HYPERVISOR is not set # CONFIG_GENERIC_CPU_DEVICES is not set +CONFIG_GENERIC_CPU_AUTOPROBE=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y CONFIG_REGMAP_SPI=y @@ -1692,7 +1715,6 @@ CONFIG_MTD_NAND=y # CONFIG_MTD_NAND_DENALI_DT is not set CONFIG_MTD_NAND_GPIO=y # CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set -CONFIG_MTD_NAND_IDS=y # CONFIG_MTD_NAND_DISKONCHIP is not set # CONFIG_MTD_NAND_DOCG4 is not set # CONFIG_MTD_NAND_NANDSIM is not set @@ -1754,7 +1776,6 @@ CONFIG_BLK_DEV_RAM_COUNT=4 CONFIG_BLK_DEV_RAM_SIZE=4096 # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set -# CONFIG_MG_DISK is not set CONFIG_BLK_DEV_RBD=m CONFIG_NVME_CORE=m # CONFIG_BLK_DEV_NVME_SCSI is not set @@ -1784,7 +1805,6 @@ CONFIG_NVME_TARGET_LOOP=m # CONFIG_USB_SWITCH_FSA9480 is not set # CONFIG_LATTICE_ECP3_CONFIG is not set # CONFIG_SRAM is not set -# CONFIG_PANEL is not set # CONFIG_C2PORT is not set # @@ -1950,7 +1970,6 @@ CONFIG_DM_SNAPSHOT=m CONFIG_DM_THIN_PROVISIONING=m CONFIG_DM_CACHE=m CONFIG_DM_CACHE_SMQ=m -CONFIG_DM_CACHE_CLEANER=m # CONFIG_DM_ERA is not set # CONFIG_DM_MIRROR is not set CONFIG_DM_RAID=m @@ -1965,6 +1984,7 @@ CONFIG_DM_VERITY=m # CONFIG_DM_VERITY_FEC is not set CONFIG_DM_SWITCH=m CONFIG_DM_LOG_WRITES=m +CONFIG_DM_INTEGRITY=m CONFIG_TARGET_CORE=m CONFIG_TCM_IBLOCK=m CONFIG_TCM_FILEIO=m @@ -2016,6 +2036,10 @@ CONFIG_B53_MMAP_DRIVER=m CONFIG_B53_SRAB_DRIVER=m # CONFIG_NET_DSA_MV88E6XXX is not set # CONFIG_NET_DSA_QCA8K is not set +# CONFIG_NET_DSA_LOOP is not set +# CONFIG_NET_DSA_MT7530 is not set +# CONFIG_NET_DSA_SMSC_LAN9303_I2C is not set +# CONFIG_NET_DSA_SMSC_LAN9303_MDIO is not set CONFIG_ETHERNET=y # CONFIG_NET_VENDOR_ALACRITECH is not set CONFIG_NET_VENDOR_ALLWINNER=y @@ -2058,19 +2082,18 @@ CONFIG_DWMAC_GENERIC=y CONFIG_DWMAC_SUNXI=y # CONFIG_NET_VENDOR_VIA is not set # CONFIG_NET_VENDOR_WIZNET is not set -CONFIG_PHYLIB=y -CONFIG_SWPHY=y -CONFIG_LED_TRIGGER_PHY=y - -# -# MDIO bus device drivers -# +CONFIG_NET_VENDOR_SYNOPSYS=y +# CONFIG_DWC_XLGMAC is not set +CONFIG_MDIO_DEVICE=y # CONFIG_MDIO_BCM_UNIMAC is not set # CONFIG_MDIO_BITBANG is not set # CONFIG_MDIO_BUS_MUX_GPIO is not set # CONFIG_MDIO_BUS_MUX_MMIOREG is not set # CONFIG_MDIO_HISI_FEMAC is not set CONFIG_MDIO_SUN4I=y +CONFIG_PHYLIB=y +CONFIG_SWPHY=y +CONFIG_LED_TRIGGER_PHY=y # # MII PHY device drivers @@ -2344,6 +2367,7 @@ CONFIG_MOUSE_PS2=m # CONFIG_MOUSE_PS2_BYD is not set CONFIG_MOUSE_PS2_LOGIPS2PP=y # CONFIG_MOUSE_PS2_SYNAPTICS is not set +# CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS is not set # CONFIG_MOUSE_PS2_CYPRESS is not set # CONFIG_MOUSE_PS2_TRACKPOINT is not set # CONFIG_MOUSE_PS2_ELANTECH is not set @@ -2542,6 +2566,7 @@ CONFIG_SERIAL_OF_PLATFORM=y # CONFIG_SERIAL_MAX3100 is not set # CONFIG_SERIAL_MAX310X is not set CONFIG_SERIAL_UARTLITE=m +CONFIG_SERIAL_UARTLITE_NR_UARTS=1 CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_SCCNXP is not set @@ -2583,6 +2608,7 @@ CONFIG_I2C_MUX=y # CONFIG_I2C_ARB_GPIO_CHALLENGE=m CONFIG_I2C_MUX_GPIO=m +CONFIG_I2C_MUX_LTC4306=m CONFIG_I2C_MUX_PCA9541=m CONFIG_I2C_MUX_PCA954x=m CONFIG_I2C_MUX_PINCTRL=m @@ -2716,6 +2742,9 @@ CONFIG_PINCTRL_SUN8I_H3_R=y CONFIG_PINCTRL_SUN8I_V3S=y CONFIG_PINCTRL_SUN9I_A80=y CONFIG_PINCTRL_SUN9I_A80_R=y +# CONFIG_PINCTRL_SUN50I_A64 is not set +# CONFIG_PINCTRL_SUN50I_A64_R is not set +# CONFIG_PINCTRL_SUN50I_H5 is not set CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y CONFIG_GPIOLIB=y CONFIG_OF_GPIO=y @@ -2730,6 +2759,7 @@ CONFIG_GPIO_SYSFS=y CONFIG_GPIO_ALTERA=m CONFIG_GPIO_AXP209=y # CONFIG_GPIO_DWAPB is not set +# CONFIG_GPIO_FTGPIO010 is not set # CONFIG_GPIO_GENERIC_PLATFORM is not set # CONFIG_GPIO_GRGPIO is not set # CONFIG_GPIO_MOCKUP is not set @@ -2795,6 +2825,7 @@ CONFIG_W1_SLAVE_DS2423=m CONFIG_W1_SLAVE_DS2431=m CONFIG_W1_SLAVE_DS2433=m # CONFIG_W1_SLAVE_DS2433_CRC is not set +CONFIG_W1_SLAVE_DS2438=m # CONFIG_W1_SLAVE_DS2760 is not set # CONFIG_W1_SLAVE_DS2780 is not set # CONFIG_W1_SLAVE_DS2781 is not set @@ -2821,9 +2852,13 @@ CONFIG_POWER_SUPPLY=y # CONFIG_BATTERY_DS2780 is not set # CONFIG_BATTERY_DS2781 is not set # CONFIG_BATTERY_DS2782 is not set +# CONFIG_BATTERY_LEGO_EV3 is not set # CONFIG_BATTERY_SBS is not set # CONFIG_CHARGER_SBS is not set # CONFIG_BATTERY_BQ27XXX is not set +CONFIG_CHARGER_AXP20X=y +CONFIG_BATTERY_AXP20X=y +CONFIG_AXP20X_POWER=y CONFIG_AXP288_CHARGER=m CONFIG_AXP288_FUEL_GAUGE=m # CONFIG_BATTERY_MAX17040 is not set @@ -2842,7 +2877,6 @@ CONFIG_AXP288_FUEL_GAUGE=m # CONFIG_CHARGER_SMB347 is not set # CONFIG_BATTERY_GAUGE_LTC2941 is not set # CONFIG_CHARGER_RT9455 is not set -CONFIG_AXP20X_POWER=y CONFIG_HWMON=y CONFIG_HWMON_VID=m # CONFIG_HWMON_DEBUG_CHIP is not set @@ -2867,6 +2901,7 @@ CONFIG_SENSORS_ADT7462=m CONFIG_SENSORS_ADT7470=m CONFIG_SENSORS_ADT7475=m CONFIG_SENSORS_ASC7621=m +# CONFIG_SENSORS_ASPEED is not set CONFIG_SENSORS_ATXP1=m CONFIG_SENSORS_DS620=m CONFIG_SENSORS_DS1621=m @@ -2976,6 +3011,7 @@ CONFIG_SENSORS_W83L786NG=m CONFIG_SENSORS_W83627HF=m CONFIG_SENSORS_W83627EHF=m CONFIG_THERMAL=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 CONFIG_THERMAL_HWMON=y CONFIG_THERMAL_OF=y CONFIG_THERMAL_WRITABLE_TRIPS=y @@ -3123,6 +3159,7 @@ CONFIG_MFD_SYSCON=y # CONFIG_MFD_TI_AM335X_TSCADC is not set # CONFIG_MFD_LP3943 is not set # CONFIG_MFD_LP8788 is not set +# CONFIG_MFD_TI_LMU is not set # CONFIG_MFD_PALMAS is not set # CONFIG_TPS6105X is not set # CONFIG_TPS65010 is not set @@ -3189,7 +3226,10 @@ CONFIG_REGULATOR_PWM=m # CONFIG_REGULATOR_TPS62360 is not set # CONFIG_REGULATOR_TPS65023 is not set # CONFIG_REGULATOR_TPS6507X is not set +# CONFIG_REGULATOR_TPS65132 is not set # CONFIG_REGULATOR_TPS6524X is not set +CONFIG_REGULATOR_VCTRL=m +CONFIG_CEC_CORE=m CONFIG_MEDIA_SUPPORT=y # @@ -3202,7 +3242,7 @@ CONFIG_MEDIA_RADIO_SUPPORT=y CONFIG_MEDIA_SDR_SUPPORT=y CONFIG_MEDIA_RC_SUPPORT=y # CONFIG_MEDIA_CEC_SUPPORT is not set -CONFIG_MEDIA_CEC_EDID=y +CONFIG_MEDIA_CEC_RC=y CONFIG_MEDIA_CONTROLLER=y # CONFIG_MEDIA_CONTROLLER_DVB is not set CONFIG_VIDEO_DEV=y @@ -3258,6 +3298,7 @@ CONFIG_RC_DEVICES=y CONFIG_IR_SUNXI=m CONFIG_IR_SERIAL=m CONFIG_IR_SERIAL_TRANSMITTER=y +CONFIG_IR_SIR=m CONFIG_MEDIA_USB_SUPPORT=y # @@ -3502,7 +3543,9 @@ CONFIG_VIDEO_SAA6588=m CONFIG_VIDEO_ADV7180=m CONFIG_VIDEO_ADV7183=m CONFIG_VIDEO_ADV7604=m +CONFIG_VIDEO_ADV7604_CEC=y CONFIG_VIDEO_ADV7842=m +CONFIG_VIDEO_ADV7842_CEC=y CONFIG_VIDEO_BT819=m CONFIG_VIDEO_BT856=m CONFIG_VIDEO_BT866=m @@ -3536,6 +3579,7 @@ CONFIG_VIDEO_ADV7175=m CONFIG_VIDEO_ADV7343=m CONFIG_VIDEO_ADV7393=m CONFIG_VIDEO_ADV7511=m +CONFIG_VIDEO_ADV7511_CEC=y CONFIG_VIDEO_AD9389B=m CONFIG_VIDEO_AK881X=m CONFIG_VIDEO_THS8200=m @@ -3543,7 +3587,10 @@ CONFIG_VIDEO_THS8200=m # # Camera sensor devices # +# CONFIG_VIDEO_OV2640 is not set # CONFIG_VIDEO_OV2659 is not set +# CONFIG_VIDEO_OV5645 is not set +# CONFIG_VIDEO_OV5647 is not set # CONFIG_VIDEO_OV7640 is not set # CONFIG_VIDEO_OV7670 is not set # CONFIG_VIDEO_OV9650 is not set @@ -3875,6 +3922,7 @@ CONFIG_BACKLIGHT_GENERIC=m # CONFIG_BACKLIGHT_GPIO is not set # CONFIG_BACKLIGHT_LV5207LP is not set # CONFIG_BACKLIGHT_BD6107 is not set +# CONFIG_BACKLIGHT_ARCXCNN is not set # CONFIG_VGASTATE is not set CONFIG_HDMI=y @@ -3906,7 +3954,7 @@ CONFIG_SND_JACK_INPUT_DEV=y CONFIG_SND_PCM_TIMER=y # CONFIG_SND_HRTIMER is not set # CONFIG_SND_DYNAMIC_MINORS is not set -CONFIG_SND_SUPPORT_OLD_API=y +# CONFIG_SND_SUPPORT_OLD_API is not set CONFIG_SND_PROC_FS=y CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SND_VERBOSE_PRINTK is not set @@ -3964,6 +4012,7 @@ CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y # CONFIG_SND_SOC_FSL_SPDIF is not set # CONFIG_SND_SOC_FSL_ESAI is not set # CONFIG_SND_SOC_IMX_AUDMUX is not set +# CONFIG_SND_I2S_HI6210_I2S is not set # CONFIG_SND_SOC_IMG is not set # @@ -3975,99 +4024,123 @@ CONFIG_SND_SUN8I_CODEC_ANALOG=m CONFIG_SND_SUN4I_I2S=m CONFIG_SND_SUN4I_SPDIF=m # CONFIG_SND_SOC_XTFPGA_I2S is not set +# CONFIG_ZX_TDM is not set CONFIG_SND_SOC_I2C_AND_SPI=m # # CODEC drivers # # CONFIG_SND_SOC_AC97_CODEC is not set -# CONFIG_SND_SOC_ADAU1701 is not set -# CONFIG_SND_SOC_ADAU7002 is not set +CONFIG_SND_SOC_ADAU_UTILS=m +CONFIG_SND_SOC_ADAU1701=m +CONFIG_SND_SOC_ADAU17X1=m +CONFIG_SND_SOC_ADAU1761=m +CONFIG_SND_SOC_ADAU1761_I2C=m +CONFIG_SND_SOC_ADAU1761_SPI=m +CONFIG_SND_SOC_ADAU7002=m # CONFIG_SND_SOC_AK4104 is not set # CONFIG_SND_SOC_AK4554 is not set # CONFIG_SND_SOC_AK4613 is not set # CONFIG_SND_SOC_AK4642 is not set # CONFIG_SND_SOC_AK5386 is not set # CONFIG_SND_SOC_ALC5623 is not set -# CONFIG_SND_SOC_BT_SCO is not set -# CONFIG_SND_SOC_CS35L32 is not set -# CONFIG_SND_SOC_CS35L33 is not set -# CONFIG_SND_SOC_CS35L34 is not set -# CONFIG_SND_SOC_CS42L42 is not set -# CONFIG_SND_SOC_CS42L51_I2C is not set -# CONFIG_SND_SOC_CS42L52 is not set -# CONFIG_SND_SOC_CS42L56 is not set -# CONFIG_SND_SOC_CS42L73 is not set -# CONFIG_SND_SOC_CS4265 is not set -# CONFIG_SND_SOC_CS4270 is not set -# CONFIG_SND_SOC_CS4271_I2C is not set -# CONFIG_SND_SOC_CS4271_SPI is not set -# CONFIG_SND_SOC_CS42XX8_I2C is not set -# CONFIG_SND_SOC_CS4349 is not set -# CONFIG_SND_SOC_CS53L30 is not set -# CONFIG_SND_SOC_ES8328_I2C is not set -# CONFIG_SND_SOC_ES8328_SPI is not set -# CONFIG_SND_SOC_GTM601 is not set -# CONFIG_SND_SOC_INNO_RK3036 is not set -# CONFIG_SND_SOC_MAX98504 is not set -# CONFIG_SND_SOC_MAX9860 is not set +CONFIG_SND_SOC_BT_SCO=m +CONFIG_SND_SOC_CS35L32=m +CONFIG_SND_SOC_CS35L33=m +CONFIG_SND_SOC_CS35L34=m +CONFIG_SND_SOC_CS35L35=m +CONFIG_SND_SOC_CS42L42=m +CONFIG_SND_SOC_CS42L51=m +CONFIG_SND_SOC_CS42L51_I2C=m +CONFIG_SND_SOC_CS42L52=m +CONFIG_SND_SOC_CS42L56=m +CONFIG_SND_SOC_CS42L73=m +CONFIG_SND_SOC_CS4265=m +CONFIG_SND_SOC_CS4270=m +CONFIG_SND_SOC_CS4271=m +CONFIG_SND_SOC_CS4271_I2C=m +CONFIG_SND_SOC_CS4271_SPI=m +CONFIG_SND_SOC_CS42XX8=m +CONFIG_SND_SOC_CS42XX8_I2C=m +CONFIG_SND_SOC_CS4349=m +CONFIG_SND_SOC_CS53L30=m +CONFIG_SND_SOC_DIO2125=m +CONFIG_SND_SOC_ES7134=m +CONFIG_SND_SOC_ES8328=m +CONFIG_SND_SOC_ES8328_I2C=m +CONFIG_SND_SOC_ES8328_SPI=m +CONFIG_SND_SOC_GTM601=m +CONFIG_SND_SOC_INNO_RK3036=m +CONFIG_SND_SOC_MAX98504=m +CONFIG_SND_SOC_MAX98927=m +CONFIG_SND_SOC_MAX9860=m # CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set -# CONFIG_SND_SOC_PCM1681 is not set -# CONFIG_SND_SOC_PCM179X_I2C is not set -# CONFIG_SND_SOC_PCM179X_SPI is not set -# CONFIG_SND_SOC_PCM3168A_I2C is not set -# CONFIG_SND_SOC_PCM3168A_SPI is not set -# CONFIG_SND_SOC_PCM512x_I2C is not set -# CONFIG_SND_SOC_PCM512x_SPI is not set -# CONFIG_SND_SOC_RT5616 is not set -# CONFIG_SND_SOC_RT5631 is not set +CONFIG_SND_SOC_PCM1681=m +CONFIG_SND_SOC_PCM179X=m +CONFIG_SND_SOC_PCM179X_I2C=m +CONFIG_SND_SOC_PCM179X_SPI=m +CONFIG_SND_SOC_PCM3168A=m +CONFIG_SND_SOC_PCM3168A_I2C=m +CONFIG_SND_SOC_PCM3168A_SPI=m +CONFIG_SND_SOC_PCM512x=m +CONFIG_SND_SOC_PCM512x_I2C=m +CONFIG_SND_SOC_PCM512x_SPI=m +CONFIG_SND_SOC_RL6231=m +CONFIG_SND_SOC_RT5616=m +CONFIG_SND_SOC_RT5631=m # CONFIG_SND_SOC_RT5677_SPI is not set -# CONFIG_SND_SOC_SGTL5000 is not set +CONFIG_SND_SOC_SGTL5000=m +CONFIG_SND_SOC_SIGMADSP=m +CONFIG_SND_SOC_SIGMADSP_I2C=m +CONFIG_SND_SOC_SIGMADSP_REGMAP=m # CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set CONFIG_SND_SOC_SPDIF=m -# CONFIG_SND_SOC_SSM2602_SPI is not set -# CONFIG_SND_SOC_SSM2602_I2C is not set -# CONFIG_SND_SOC_SSM4567 is not set -# CONFIG_SND_SOC_STA32X is not set -# CONFIG_SND_SOC_STA350 is not set +CONFIG_SND_SOC_SSM2602=m +CONFIG_SND_SOC_SSM2602_SPI=m +CONFIG_SND_SOC_SSM2602_I2C=m +CONFIG_SND_SOC_SSM4567=m +CONFIG_SND_SOC_STA32X=m +CONFIG_SND_SOC_STA350=m # CONFIG_SND_SOC_STI_SAS is not set -# CONFIG_SND_SOC_TAS2552 is not set -# CONFIG_SND_SOC_TAS5086 is not set -# CONFIG_SND_SOC_TAS571X is not set -# CONFIG_SND_SOC_TAS5720 is not set -# CONFIG_SND_SOC_TFA9879 is not set -# CONFIG_SND_SOC_TLV320AIC23_I2C is not set -# CONFIG_SND_SOC_TLV320AIC23_SPI is not set -# CONFIG_SND_SOC_TLV320AIC31XX is not set -# CONFIG_SND_SOC_TLV320AIC3X is not set -# CONFIG_SND_SOC_TS3A227E is not set -# CONFIG_SND_SOC_WM8510 is not set -# CONFIG_SND_SOC_WM8523 is not set -# CONFIG_SND_SOC_WM8580 is not set -# CONFIG_SND_SOC_WM8711 is not set -# CONFIG_SND_SOC_WM8728 is not set -# CONFIG_SND_SOC_WM8731 is not set -# CONFIG_SND_SOC_WM8737 is not set -# CONFIG_SND_SOC_WM8741 is not set -# CONFIG_SND_SOC_WM8750 is not set -# CONFIG_SND_SOC_WM8753 is not set -# CONFIG_SND_SOC_WM8770 is not set -# CONFIG_SND_SOC_WM8776 is not set -# CONFIG_SND_SOC_WM8804_I2C is not set -# CONFIG_SND_SOC_WM8804_SPI is not set -# CONFIG_SND_SOC_WM8903 is not set -# CONFIG_SND_SOC_WM8960 is not set -# CONFIG_SND_SOC_WM8962 is not set -# CONFIG_SND_SOC_WM8974 is not set -# CONFIG_SND_SOC_WM8978 is not set -# CONFIG_SND_SOC_WM8985 is not set -# CONFIG_SND_SOC_NAU8540 is not set -# CONFIG_SND_SOC_NAU8810 is not set -# CONFIG_SND_SOC_TPA6130A2 is not set +CONFIG_SND_SOC_TAS2552=m +CONFIG_SND_SOC_TAS5086=m +CONFIG_SND_SOC_TAS571X=m +CONFIG_SND_SOC_TAS5720=m +CONFIG_SND_SOC_TFA9879=m +CONFIG_SND_SOC_TLV320AIC23=m +CONFIG_SND_SOC_TLV320AIC23_I2C=m +CONFIG_SND_SOC_TLV320AIC23_SPI=m +CONFIG_SND_SOC_TLV320AIC31XX=m +CONFIG_SND_SOC_TLV320AIC3X=m +CONFIG_SND_SOC_TS3A227E=m +CONFIG_SND_SOC_WM8510=m +CONFIG_SND_SOC_WM8523=m +CONFIG_SND_SOC_WM8580=m +CONFIG_SND_SOC_WM8711=m +CONFIG_SND_SOC_WM8728=m +CONFIG_SND_SOC_WM8731=m +CONFIG_SND_SOC_WM8737=m +CONFIG_SND_SOC_WM8741=m +CONFIG_SND_SOC_WM8750=m +CONFIG_SND_SOC_WM8753=m +CONFIG_SND_SOC_WM8770=m +CONFIG_SND_SOC_WM8776=m +CONFIG_SND_SOC_WM8804=m +CONFIG_SND_SOC_WM8804_I2C=m +CONFIG_SND_SOC_WM8804_SPI=m +CONFIG_SND_SOC_WM8903=m +CONFIG_SND_SOC_WM8960=m +CONFIG_SND_SOC_WM8962=m +CONFIG_SND_SOC_WM8974=m +CONFIG_SND_SOC_WM8978=m +CONFIG_SND_SOC_WM8985=m +CONFIG_SND_SOC_NAU8540=m +CONFIG_SND_SOC_NAU8810=m +CONFIG_SND_SOC_NAU8824=m +CONFIG_SND_SOC_TPA6130A2=m CONFIG_SND_SIMPLE_CARD_UTILS=m CONFIG_SND_SIMPLE_CARD=m # CONFIG_SND_SIMPLE_SCU_CARD is not set -# CONFIG_SOUND_PRIME is not set # # HID support @@ -4082,6 +4155,7 @@ CONFIG_HID_GENERIC=y # Special HID drivers # CONFIG_HID_A4TECH=m +# CONFIG_HID_ACCUTOUCH is not set CONFIG_HID_ACRUX=m CONFIG_HID_ACRUX_FF=y CONFIG_HID_APPLE=m @@ -4131,6 +4205,7 @@ CONFIG_HID_MAGICMOUSE=m CONFIG_HID_MICROSOFT=m CONFIG_HID_MONTEREY=m CONFIG_HID_MULTITOUCH=m +# CONFIG_HID_NTI is not set CONFIG_HID_NTRIG=m CONFIG_HID_ORTEK=m CONFIG_HID_PANTHERLORD=m @@ -4466,6 +4541,10 @@ CONFIG_USB_G_MULTI_RNDIS=y CONFIG_USB_G_HID=m # CONFIG_USB_G_DBGP is not set CONFIG_USB_G_WEBCAM=m + +# +# USB Power Delivery and Type-C drivers +# # CONFIG_USB_LED_TRIG is not set CONFIG_USB_ULPI_BUS=m # CONFIG_UWB is not set @@ -4508,6 +4587,7 @@ CONFIG_LEDS_BRIGHTNESS_HW_CHANGED=y # CONFIG_LEDS_PCA9532 is not set CONFIG_LEDS_GPIO=y # CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP3952 is not set # CONFIG_LEDS_LP5521 is not set # CONFIG_LEDS_LP5523 is not set # CONFIG_LEDS_LP5562 is not set @@ -4557,7 +4637,6 @@ CONFIG_LEDS_TRIGGER_PANIC=y # CONFIG_ACCESSIBILITY is not set CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y -# CONFIG_EDAC is not set CONFIG_RTC_LIB=y CONFIG_RTC_CLASS=y # CONFIG_RTC_HCTOSYS is not set @@ -4694,6 +4773,7 @@ CONFIG_ASYNC_TX_DMA=y # # CONFIG_SYNC_FILE is not set # CONFIG_AUXDISPLAY is not set +# CONFIG_PANEL is not set CONFIG_UIO=m CONFIG_UIO_PDRV_GENIRQ=m CONFIG_UIO_DMEM_GENIRQ=m @@ -4709,10 +4789,12 @@ CONFIG_UIO_DMEM_GENIRQ=m # # Microsoft Hyper-V guest support # +# CONFIG_HYPERV_TSCPAGE is not set CONFIG_STAGING=y # CONFIG_PRISM2_USB is not set # CONFIG_COMEDI is not set # CONFIG_RTLLIB is not set +CONFIG_RTL8723BS=m CONFIG_R8712U=m CONFIG_R8188EU=m CONFIG_88EU_AP_MODE=y @@ -4800,8 +4882,6 @@ CONFIG_AD9834=m CONFIG_STAGING_MEDIA=y CONFIG_I2C_BCM2048=m CONFIG_LIRC_STAGING=y -# CONFIG_LIRC_SASEM is not set -# CONFIG_LIRC_SIR is not set # CONFIG_LIRC_ZILOG is not set # @@ -4831,6 +4911,7 @@ CONFIG_FB_TFT_PCD8544=m CONFIG_FB_TFT_RA8875=m CONFIG_FB_TFT_S6D02A1=m CONFIG_FB_TFT_S6D1121=m +CONFIG_FB_TFT_SH1106=m CONFIG_FB_TFT_SSD1289=m CONFIG_FB_TFT_SSD1305=m CONFIG_FB_TFT_SSD1306=m @@ -4860,6 +4941,12 @@ CONFIG_HDM_I2C=m CONFIG_HDM_USB=m # CONFIG_KS7010 is not set # CONFIG_GREYBUS is not set +# CONFIG_CRYPTO_DEV_CCREE is not set + +# +# USB Power Delivery and Type-C drivers +# +# CONFIG_TYPEC_TCPM is not set # CONFIG_GOLDFISH is not set # CONFIG_CHROME_PLATFORMS is not set CONFIG_CLKDEV_LOOKUP=y @@ -4893,7 +4980,6 @@ CONFIG_SUNXI_CCU_NKM=y CONFIG_SUNXI_CCU_NKMP=y CONFIG_SUNXI_CCU_NM=y CONFIG_SUNXI_CCU_MP=y -CONFIG_SUN50I_A64_CCU=y CONFIG_SUN5I_CCU=y CONFIG_SUN6I_A31_CCU=y CONFIG_SUN8I_A23_CCU=y @@ -4901,6 +4987,7 @@ CONFIG_SUN8I_A33_CCU=y CONFIG_SUN8I_H3_CCU=y CONFIG_SUN8I_V3S_CCU=y CONFIG_SUN9I_A80_CCU=y +CONFIG_SUN8I_R_CCU=y # # Hardware Spinlock drivers @@ -4954,6 +5041,10 @@ CONFIG_ARM_SMMU=y # Broadcom SoC drivers # # CONFIG_SOC_BRCMSTB is not set + +# +# i.MX SoC drivers +# CONFIG_SUNXI_SRAM=y # CONFIG_SOC_TI is not set # CONFIG_SOC_ZTE is not set @@ -4999,6 +5090,8 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # # Accelerometers # +# CONFIG_ADXL345_I2C is not set +# CONFIG_ADXL345_SPI is not set # CONFIG_BMA180 is not set # CONFIG_BMA220 is not set # CONFIG_BMC150_ACCEL is not set @@ -5037,6 +5130,7 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_AD7887 is not set # CONFIG_AD7923 is not set # CONFIG_AD799X is not set +CONFIG_AXP20X_ADC=y CONFIG_AXP288_ADC=y # CONFIG_CC10001_ADC is not set # CONFIG_ENVELOPE_DETECTOR is not set @@ -5044,12 +5138,16 @@ CONFIG_AXP288_ADC=y # CONFIG_HX711 is not set # CONFIG_INA2XX_ADC is not set # CONFIG_LTC2485 is not set +# CONFIG_LTC2497 is not set # CONFIG_MAX1027 is not set # CONFIG_MAX11100 is not set +# CONFIG_MAX1118 is not set # CONFIG_MAX1363 is not set +# CONFIG_MAX9611 is not set # CONFIG_MCP320X is not set # CONFIG_MCP3422 is not set # CONFIG_NAU7802 is not set +CONFIG_SUN4I_GPADC=m # CONFIG_TI_ADC081C is not set # CONFIG_TI_ADC0832 is not set # CONFIG_TI_ADC12138 is not set @@ -5100,6 +5198,7 @@ CONFIG_AXP288_ADC=y # CONFIG_AD5593R is not set # CONFIG_AD5504 is not set # CONFIG_AD5624R_SPI is not set +# CONFIG_LTC2632 is not set # CONFIG_AD5686 is not set # CONFIG_AD5755 is not set # CONFIG_AD5761 is not set @@ -5157,6 +5256,7 @@ CONFIG_AXP288_ADC=y # CONFIG_AFE4403 is not set # CONFIG_AFE4404 is not set # CONFIG_MAX30100 is not set +# CONFIG_MAX30102 is not set # # Humidity sensors @@ -5164,6 +5264,7 @@ CONFIG_AXP288_ADC=y # CONFIG_AM2315 is not set CONFIG_DHT11=m # CONFIG_HDC100X is not set +# CONFIG_HID_SENSOR_HUMIDITY is not set # CONFIG_HTS221 is not set # CONFIG_HTU21 is not set CONFIG_SI7005=m @@ -5216,6 +5317,7 @@ CONFIG_SI7020=m # CONFIG_US5182D is not set # CONFIG_VCNL4000 is not set # CONFIG_VEML6070 is not set +# CONFIG_VL6180 is not set # # Magnetometer sensors @@ -5287,6 +5389,7 @@ CONFIG_BMP280_SPI=m # Proximity and distance sensors # # CONFIG_LIDAR_LITE_V2 is not set +# CONFIG_SRF04 is not set # CONFIG_SX9500 is not set # CONFIG_SRF08 is not set @@ -5294,6 +5397,7 @@ CONFIG_BMP280_SPI=m # Temperature sensors # # CONFIG_MAXIM_THERMOCOUPLE is not set +# CONFIG_HID_SENSOR_TEMP is not set # CONFIG_MLX90614 is not set # CONFIG_TMP006 is not set # CONFIG_TMP007 is not set @@ -5312,6 +5416,7 @@ CONFIG_ARCH_HAS_RESET_CONTROLLER=y CONFIG_RESET_CONTROLLER=y # CONFIG_RESET_ATH79 is not set # CONFIG_RESET_BERLIN is not set +# CONFIG_RESET_IMX7 is not set # CONFIG_RESET_LPC18XX is not set # CONFIG_RESET_MESON is not set # CONFIG_RESET_PISTACHIO is not set @@ -5348,6 +5453,7 @@ CONFIG_ARM_PMU=y # Android # # CONFIG_ANDROID is not set +CONFIG_DAX=m CONFIG_NVMEM=m CONFIG_NVMEM_SUNXI_SID=m CONFIG_STM=m @@ -5366,6 +5472,7 @@ CONFIG_STM_SOURCE_CONSOLE=m # FSI support # # CONFIG_FSI is not set +# CONFIG_TEE is not set # # Firmware Drivers @@ -5376,6 +5483,7 @@ CONFIG_ARM_PSCI_FW=y CONFIG_FW_CFG_SYSFS=m # CONFIG_FW_CFG_SYSFS_CMDLINE is not set CONFIG_HAVE_ARM_SMCCC=y +# CONFIG_GOOGLE_FIRMWARE is not set # # Tegra firmware driver @@ -5494,7 +5602,7 @@ CONFIG_NTFS_RW=y CONFIG_PROC_FS=y CONFIG_PROC_SYSCTL=y CONFIG_PROC_PAGE_MONITOR=y -# CONFIG_PROC_CHILDREN is not set +CONFIG_PROC_CHILDREN=y CONFIG_KERNFS=y CONFIG_SYSFS=y CONFIG_TMPFS=y @@ -5531,6 +5639,7 @@ CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y CONFIG_UBIFS_ATIME_SUPPORT=y CONFIG_UBIFS_FS_ENCRYPTION=y +CONFIG_UBIFS_FS_SECURITY=y # CONFIG_CRAMFS is not set CONFIG_SQUASHFS=m CONFIG_SQUASHFS_FILE_CACHE=y @@ -5884,13 +5993,13 @@ CONFIG_ENCRYPTED_KEYS=y # CONFIG_KEY_DH_OPERATIONS is not set # CONFIG_SECURITY_DMESG_RESTRICT is not set CONFIG_SECURITY=y +# CONFIG_SECURITY_WRITABLE_HOOKS is not set CONFIG_SECURITYFS=y CONFIG_SECURITY_NETWORK=y # CONFIG_SECURITY_NETWORK_XFRM is not set CONFIG_SECURITY_PATH=y CONFIG_LSM_MMAP_MIN_ADDR=32768 CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y -CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y # CONFIG_HARDENED_USERCOPY is not set # CONFIG_STATIC_USERMODEHELPER is not set CONFIG_SECURITY_SELINUX=y @@ -6078,6 +6187,7 @@ CONFIG_SYSTEM_TRUSTED_KEYRING=y CONFIG_SYSTEM_TRUSTED_KEYS="" # CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set # CONFIG_SECONDARY_TRUSTED_KEYRING is not set +# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set CONFIG_ARM_CRYPTO=y CONFIG_CRYPTO_SHA1_ARM=m CONFIG_CRYPTO_SHA1_ARM_NEON=m diff --git a/configuration.sh b/configuration.sh index 68c8baf967..2409e896c7 100644 --- a/configuration.sh +++ b/configuration.sh @@ -40,10 +40,8 @@ if [[ $USE_MAINLINE_GOOGLE_MIRROR == yes ]]; then else MAINLINE_KERNEL_SOURCE='git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git' fi -# allow upgrades for same major.minor versions -#ARMBIAN_MAINLINE_KERNEL_VERSION='4.11' -#MAINLINE_KERNEL_BRANCH=tag:v$(wget -qO- https://www.kernel.org/finger_banner | awk '{print $NF}' | grep -oE "^${ARMBIAN_MAINLINE_KERNEL_VERSION//./\\.}\.?[[:digit:]]*" | tail -1) -MAINLINE_KERNEL_BRANCH='branch:linux-4.11.y' + +MAINLINE_KERNEL_BRANCH='branch:linux-4.12.y' MAINLINE_KERNEL_DIR='linux-vanilla' if [[ $USE_GITHUB_UBOOT_MIRROR == yes ]]; then diff --git a/patch/kernel/sunxi-next/add-ad9834-dt-bindings.patch b/patch/kernel/sunxi-next/add-ad9834-dt-bindings.patch.disabled similarity index 100% rename from patch/kernel/sunxi-next/add-ad9834-dt-bindings.patch rename to patch/kernel/sunxi-next/add-ad9834-dt-bindings.patch.disabled diff --git a/patch/kernel/sunxi-next/add-overlay-compilation-support.patch b/patch/kernel/sunxi-next/add-overlay-compilation-support.patch index 62d1b7c31e..877eda1d17 100644 --- a/patch/kernel/sunxi-next/add-overlay-compilation-support.patch +++ b/patch/kernel/sunxi-next/add-overlay-compilation-support.patch @@ -1,5 +1,5 @@ diff --git a/arch/arm/Makefile b/arch/arm/Makefile -index ab30cc63..cc176797 100644 +index 65f4e2a4..9eb2043c 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -339,6 +339,12 @@ $(INSTALL_TARGETS): @@ -16,7 +16,7 @@ index ab30cc63..cc176797 100644 dtbs: prepare scripts diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore -index 3c79f859..eaaeb17e 100644 +index 3c79f859..4e5c1d59 100644 --- a/arch/arm/boot/.gitignore +++ b/arch/arm/boot/.gitignore @@ -3,4 +3,5 @@ zImage @@ -27,10 +27,10 @@ index 3c79f859..eaaeb17e 100644 +*.dtb* +*.scr diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile -index b9a4a934..54e3c38d 100644 +index f839ecd9..9788f16d 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile -@@ -119,6 +119,12 @@ zinstall install: +@@ -121,6 +121,12 @@ zinstall install: %.dtb: scripts $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ @@ -44,7 +44,7 @@ index b9a4a934..54e3c38d 100644 dtbs: prepare scripts diff --git a/arch/arm64/boot/dts/.gitignore b/arch/arm64/boot/dts/.gitignore -index b60ed208..5d65b54b 100644 +index b60ed208..4bec63b6 100644 --- a/arch/arm64/boot/dts/.gitignore +++ b/arch/arm64/boot/dts/.gitignore @@ -1 +1,2 @@ @@ -52,11 +52,11 @@ index b60ed208..5d65b54b 100644 +*.dtb* +*.scr diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst -index a1be75d0..ad8dc1c9 100644 +index 34614a48..8a8313d6 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst -@@ -27,6 +27,9 @@ ifeq ("$(dtbinst-root)", "$(obj)") - endif +@@ -21,6 +21,9 @@ include scripts/Kbuild.include + include $(src)/Makefile dtbinst-files := $(dtb-y) +dtboinst-files := $(dtbo-y) @@ -65,13 +65,7 @@ index a1be75d0..ad8dc1c9 100644 dtbinst-dirs := $(dts-dirs) # Helper targets for Installing DTBs into the boot directory -@@ -35,15 +38,24 @@ quiet_cmd_dtb_install = INSTALL $< - - install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj)) - --$(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep -+$(dtbinst-files) $(dtboinst-files) $(readme-files) $(script-files) $(dtbinst-dirs): | __dtbs_install_prep - +@@ -32,10 +35,19 @@ install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj)) $(dtbinst-files): %.dtb: $(obj)/%.dtb $(call cmd,dtb_install,$(install-dir)) @@ -94,7 +88,7 @@ index a1be75d0..ad8dc1c9 100644 .PHONY: $(PHONY) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib -index 0a07f901..5ccd3490 100644 +index 58c05e5d..2b95dda9 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -278,6 +278,9 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \ @@ -106,8 +100,8 @@ index 0a07f901..5ccd3490 100644 + # Disable noisy checks by default ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),) - DTC_FLAGS += -Wno-unit_address_vs_reg -@@ -312,6 +315,23 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ + DTC_FLAGS += -Wno-unit_address_vs_reg \ +@@ -324,6 +327,23 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ $(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep,dtc) diff --git a/patch/kernel/sunxi-next/add-a20-overlays.patch b/patch/kernel/sunxi-next/add-sunxi-overlays.patch similarity index 71% rename from patch/kernel/sunxi-next/add-a20-overlays.patch rename to patch/kernel/sunxi-next/add-sunxi-overlays.patch index ba815debaa..54051e1083 100644 --- a/patch/kernel/sunxi-next/add-a20-overlays.patch +++ b/patch/kernel/sunxi-next/add-sunxi-overlays.patch @@ -1,8 +1,8 @@ diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 01180849..8a66eadb 100644 +index 9c5e1d94..175523fe 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -1016,4 +1016,7 @@ dtstree := $(srctree)/$(src) +@@ -1047,4 +1047,7 @@ dtstree := $(srctree)/$(src) dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts)) always := $(dtb-y) @@ -12,10 +12,10 @@ index 01180849..8a66eadb 100644 +dts-dirs += overlay diff --git a/arch/arm/boot/dts/overlay/Makefile b/arch/arm/boot/dts/overlay/Makefile new file mode 100644 -index 00000000..af7af653 +index 00000000..ca0e3039 --- /dev/null +++ b/arch/arm/boot/dts/overlay/Makefile -@@ -0,0 +1,56 @@ +@@ -0,0 +1,78 @@ +ifeq ($(CONFIG_OF_CONFIGFS),y) + +dtbo-$(CONFIG_MACH_SUN4I) += \ @@ -60,11 +60,33 @@ index 00000000..af7af653 + sun7i-a20-uart7.dtbo \ + sun7i-a20-w1-gpio.dtbo + ++dtbo-$(CONFIG_MACH_SUN8I) += \ ++ sun8i-h3-analog-codec.dtbo \ ++ sun8i-h3-cir.dtbo \ ++ sun8i-h3-i2c0.dtbo \ ++ sun8i-h3-i2c1.dtbo \ ++ sun8i-h3-i2c2.dtbo \ ++ sun8i-h3-pps-gpio.dtbo \ ++ sun8i-h3-pwm.dtbo \ ++ sun8i-h3-spdif-out.dtbo \ ++ sun8i-h3-spi-add-cs1.dtbo \ ++ sun8i-h3-spi-jedec-nor.dtbo \ ++ sun8i-h3-spi-spidev.dtbo \ ++ sun8i-h3-uart1.dtbo \ ++ sun8i-h3-uart2.dtbo \ ++ sun8i-h3-uart3.dtbo \ ++ sun8i-h3-usbhost0.dtbo \ ++ sun8i-h3-usbhost2.dtbo \ ++ sun8i-h3-usbhost3.dtbo \ ++ sun8i-h3-w1-gpio.dtbo ++ +scr-$(CONFIG_MACH_SUN4I) += sun4i-a10-fixup.scr +scr-$(CONFIG_MACH_SUN7I) += sun7i-a20-fixup.scr ++scr-$(CONFIG_MACH_SUN8I) += sun8i-h3-fixup.scr + +dtbotxt-$(CONFIG_MACH_SUN4I) += README.sun4i-a10-overlays +dtbotxt-$(CONFIG_MACH_SUN7I) += README.sun7i-a20-overlays ++dtbotxt-$(CONFIG_MACH_SUN8I) += README.sun8i-h3-overlays + +targets += $(dtbo-y) $(scr-y) $(dtbotxt-y) + @@ -647,6 +669,262 @@ index 00000000..602a2087 + Set to 1 to enable the pull-up + This option should not be used with multiple sensors or long wires - + please use external pull-up resistor instead +diff --git a/arch/arm/boot/dts/overlay/README.sun8i-h3-overlays b/arch/arm/boot/dts/overlay/README.sun8i-h3-overlays +new file mode 100644 +index 00000000..30297349 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/README.sun8i-h3-overlays +@@ -0,0 +1,250 @@ ++This document describes overlays provided in the kernel packages ++For generic Armbian overlays documentation please see ++https://docs.armbian.com/User-Guide_Allwinner_overlays/ ++ ++### Platform: ++ ++sun8i-h3 (Allwinner H3) ++ ++### Platform details: ++ ++Supported pin banks: PA, PC, PD, PG ++ ++Both SPI controllers have only one hardware CS pin exposed, ++adding fixed software (GPIO) chip selects is possible with a separate overlay ++ ++### Provided overlays: ++ ++- analog-codec ++- cir ++- i2c0 ++- i2c1 ++- i2c2 ++- pps-gpio ++- pwm ++- spdif-out ++- spi-add-cs1 ++- spi-jedec-nor ++- spi-spidev ++- uart1 ++- uart2 ++- uart3 ++- usbhost0 ++- usbhost1 ++- usbhost2 ++- usbhost3 ++- w1-gpio ++ ++### Overlay details: ++ ++### analog-codec ++ ++Activates SoC analog codec driver that provides Line Out and Mic In ++functionality ++ ++### cir ++ ++Activates CIR (Infrared remote) receiver ++ ++CIR pin: PL11 ++ ++### i2c0 ++ ++Activates TWI/I2C bus 0 ++ ++I2C0 pins (SCL, SDA): PA11, PA12 ++ ++### i2c1 ++ ++Activates TWI/I2C bus 1 ++ ++I2C1 pins (SCL, SDA): PA18, PA19 ++ ++### i2c2 ++ ++Activates TWI/I2C bus 2 ++ ++I2C2 pins (SCL, SDA): PE12, PE13 ++ ++On most board this bus is wired to Camera (CSI) socket ++ ++### pps-gpio ++ ++Activates pulse-per-second GPIO client ++ ++Parameters: ++ ++param_pps_pin (pin) ++ Pin PPS source is connected to ++ Optional ++ Default: PD14 ++ ++param_pps_falling_edge (bool) ++ Assert by falling edge ++ Optional ++ Default: 0 ++ When set (to 1), assert is indicated by a falling edge ++ (instead of by a rising edge) ++ ++### pwm ++ ++Activates hardware PWM controller ++ ++PWM pin: PA5 ++ ++Pin PA5 is used as UART0 RX by default, so if this overlay is activated, ++UART0 and kernel console on ttyS0 will be disabled ++ ++### spdif-out ++ ++Activates SPDIF/Toslink audio output ++ ++SPDIF pin: PA17 ++ ++### spi-add-cs1 ++ ++Adds support for using SPI chip select 1 with GPIO for both SPI controllers ++Respective GPIO will be claimed only if controller is enabled by another ++overlay ++This overlay is required for using chip select 1 with other SPI overlays ++Due to the u-boot limitations CS1 pin can't be customized by a parameter, but ++it can be changed by using an edited copy of this overlay ++A total of 4 chip selects can be used with custom overlays (1 HW + 3 GPIO) ++ ++SPI 0 pins (CS1): PA21 ++SPI 1 pins (CS1): PA10 ++ ++### spi-jedec-nor ++ ++Activates MTD support for JEDEC compatible SPI NOR flash chips on SPI bus ++supported by the kernel SPI NOR driver ++ ++SPI 0 pins (MOSI, MISO, SCK, CS): PC0, PC1, PC2, PC3 ++SPI 1 pins (MOSI, MISO, SCK, CS): PA15, PA16, PA14, PA13 ++ ++Parameters: ++ ++param_spinor_spi_bus (int) ++ SPI bus to activate SPI NOR flash support on ++ Required ++ Supported values: 0, 1 ++ ++param_spinor_spi_cs (int) ++ SPI chip select number ++ Optional ++ Default: 0 ++ Supported values: 0, 1 ++ Using chip select 1 requires using "spi-add-cs1" overlay ++ ++param_spinor_max_freq (int) ++ Maximum SPI frequency ++ Optional ++ Default: 1000000 ++ Range: 3000 - 100000000 ++ ++### spi-spidev ++ ++Activates SPIdev device node (/dev/spidevX.Y) for userspace SPI access, ++where X is the bus number and Y is the CS number ++ ++SPI 0 pins (MOSI, MISO, SCK, CS): PC0, PC1, PC2, PC3 ++SPI 1 pins (MOSI, MISO, SCK, CS): PA15, PA16, PA14, PA13 ++ ++Parameters: ++ ++param_spidev_spi_bus (int) ++ SPI bus to activate SPIdev support on ++ Required ++ Supported values: 0, 1 ++ ++param_spidev_spi_cs (int) ++ SPI chip select number ++ Optional ++ Default: 0 ++ Supported values: 0, 1 ++ Using chip select 1 requires using "spi-add-cs1" overlay ++ ++param_spidev_max_freq (int) ++ Maximum SPIdev frequency ++ Optional ++ Default: 1000000 ++ Range: 3000 - 100000000 ++ ++### uart1 ++ ++Activates serial port 1 (/dev/ttyS1) ++ ++UART 1 pins (TX, RX, RTS, CTS): PG6, PG7, PG8, PG9 ++ ++Parameters: ++ ++param_uart1_rtscts (bool) ++ Enable RTS and CTS pins ++ Optional ++ Default: 0 ++ Set to 1 to enable ++ ++### uart2 ++ ++Activates serial port 2 (/dev/ttyS2) ++ ++UART 2 pins (TX, RX, RTS, CTS): PA0, PA1, PA2, PA3 ++ ++Parameters: ++ ++param_uart2_rtscts (bool) ++ Enable RTS and CTS pins ++ Optional ++ Default: 0 ++ Set to 1 to enable CTS and RTS pins ++ ++### uart3 ++ ++Activates serial port 3 (/dev/ttyS3) ++ ++UART 3 pins (TX, RX, RTS, CTS): PA13, PA14, PA15, PA16 ++ ++Parameters: ++ ++param_uart3_rtscts (bool) ++ Enable RTS and CTS pins ++ Optional ++ Default: 0 ++ Set to 1 to enable CTS and RTS pins ++ ++### usbhost0 ++ ++Activates USB host controller 0 ++ ++### usbhost1 ++ ++Activates USB host controller 1 ++ ++### usbhost2 ++ ++Activates USB host controller 2 ++ ++### usbhost3 ++ ++Activates USB host controller 3 ++ ++### w1-gpio ++ ++Activates 1-Wire GPIO master ++Requires an external pull-up resistor on the data pin ++or enabling the internal pull-up ++ ++Parameters: ++ ++param_w1_pin (pin) ++ Data pin for 1-Wire master ++ Optional ++ Default: PD14 ++ ++param_w1_pin_int_pullup (bool) ++ Enable internal pull-up for the data pin ++ Optional ++ Default: 0 ++ Set to 1 to enable the pull-up ++ This option should not be used with multiple devices, parasite power setup ++ or long wires - please use external pull-up resistor instead diff --git a/arch/arm/boot/dts/overlay/sun4i-a10-analog-codec.dts b/arch/arm/boot/dts/overlay/sun4i-a10-analog-codec.dts new file mode 100644 index 00000000..9254e22e @@ -668,42 +946,22 @@ index 00000000..9254e22e +}; diff --git a/arch/arm/boot/dts/overlay/sun4i-a10-can.dts b/arch/arm/boot/dts/overlay/sun4i-a10-can.dts new file mode 100644 -index 00000000..5d394c9f +index 00000000..4be3a38b --- /dev/null +++ b/arch/arm/boot/dts/overlay/sun4i-a10-can.dts -@@ -0,0 +1,35 @@ +@@ -0,0 +1,15 @@ +/dts-v1/; +/plugin/; + -+#include -+ +/ { + compatible = "allwinner,sun4i-a10"; + + fragment@0 { -+ target = <&pio>; ++ target = <&can0>; + __overlay__ { -+ can_pins: can_pins { -+ pins = "PH20", "PH21"; -+ function = "can"; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target-path = "/soc@01c00000"; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ can@01c2bc00 { -+ compatible = "allwinner,sun4i-a10-can"; -+ reg = <0x01c2bc00 0x400>; -+ interrupts = ; -+ clocks = <&apb1_gates 4>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&can_pins>; -+ status = "okay"; -+ }; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&can0_pins_a>; ++ status = "okay"; + }; + }; +}; @@ -1528,42 +1786,22 @@ index 00000000..e1a70c51 +}; diff --git a/arch/arm/boot/dts/overlay/sun7i-a20-can.dts b/arch/arm/boot/dts/overlay/sun7i-a20-can.dts new file mode 100644 -index 00000000..8a5b98e2 +index 00000000..65aebcd4 --- /dev/null +++ b/arch/arm/boot/dts/overlay/sun7i-a20-can.dts -@@ -0,0 +1,35 @@ +@@ -0,0 +1,15 @@ +/dts-v1/; +/plugin/; + -+#include -+ +/ { + compatible = "allwinner,sun7i-a20"; + + fragment@0 { -+ target = <&pio>; ++ target = <&can0>; + __overlay__ { -+ can_pins: can_pins { -+ pins = "PH20", "PH21"; -+ function = "can"; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target-path = "/soc@01c00000"; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ can@01c2bc00 { -+ compatible = "allwinner,sun4i-a10-can"; -+ reg = <0x01c2bc00 0x400>; -+ interrupts = ; -+ clocks = <&apb1_gates 4>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&can_pins>; -+ status = "okay"; -+ }; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&can0_pins_a>; ++ status = "okay"; + }; + }; +}; @@ -2443,3 +2681,731 @@ index 00000000..7d77606a + }; + }; +}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-analog-codec.dts b/arch/arm/boot/dts/overlay/sun8i-h3-analog-codec.dts +new file mode 100644 +index 00000000..36dbc31a +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-analog-codec.dts +@@ -0,0 +1,17 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&codec>; ++ __overlay__ { ++ allwinner,audio-routing = ++ "Line Out", "LINEOUT", ++ "MIC1", "Mic", ++ "Mic", "MBIAS"; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-cir.dts b/arch/arm/boot/dts/overlay/sun8i-h3-cir.dts +new file mode 100644 +index 00000000..9b62fd2b +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-cir.dts +@@ -0,0 +1,15 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&ir>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ir_pins_a>; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-fixup.scr-cmd b/arch/arm/boot/dts/overlay/sun8i-h3-fixup.scr-cmd +new file mode 100644 +index 00000000..744889c6 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-fixup.scr-cmd +@@ -0,0 +1,110 @@ ++# overlays fixup script ++# implements (or rather substitutes) overlay arguments functionality ++# using u-boot scripting, environment variables and "fdt" command ++ ++# setexpr test_var ${tmp_bank} - A ++# works only for hex numbers (A-F) ++ ++setenv decompose_pin 'setexpr tmp_bank sub "P(A|C|D|G)\\d+" "\\1"; ++setexpr tmp_pin sub "P\\S(\\d+)" "\\1"; ++test "${tmp_bank}" = "A" && setenv tmp_bank 0; ++test "${tmp_bank}" = "C" && setenv tmp_bank 2; ++test "${tmp_bank}" = "D" && setenv tmp_bank 3; ++test "${tmp_bank}" = "G" && setenv tmp_bank 6' ++ ++if test -n "${param_spinor_spi_bus}"; then ++ test "${param_spinor_spi_bus}" = "0" && setenv tmp_spi_path "spi@01c68000" ++ test "${param_spinor_spi_bus}" = "1" && setenv tmp_spi_path "spi@01c69000" ++ fdt set /soc/${tmp_spi_path} status "okay" ++ fdt set /soc/${tmp_spi_path}/spiflash status "okay" ++ if test -n "${param_spinor_max_freq}"; then ++ fdt set /soc/${tmp_spi_path}/spiflash spi-max-frequency "<${param_spinor_max_freq}>" ++ fi ++ if test "${param_spinor_spi_cs}" = "1"; then ++ fdt set /soc/${tmp_spi_path}/spiflash reg "<1>" ++ fi ++ env delete tmp_spi_path ++fi ++ ++if test -n "${param_spidev_spi_bus}"; then ++ test "${param_spidev_spi_bus}" = "0" && setenv tmp_spi_path "spi@01c68000" ++ test "${param_spidev_spi_bus}" = "1" && setenv tmp_spi_path "spi@01c69000" ++ fdt set /soc/${tmp_spi_path} status "okay" ++ fdt set /soc/${tmp_spi_path}/spidev status "okay" ++ if test -n "${param_spidev_max_freq}"; then ++ fdt set /soc/${tmp_spi_path}/spidev spi-max-frequency "<${param_spidev_max_freq}>" ++ fi ++ if test "${param_spidev_spi_cs}" = "1"; then ++ fdt set /soc/${tmp_spi_path}/spidev reg "<1>" ++ fi ++ env delete tmp_spi_path ++fi ++ ++if test -n "${param_pps_pin}"; then ++ setenv tmp_bank "${param_pps_pin}" ++ setenv tmp_pin "${param_pps_pin}" ++ run decompose_pin ++ fdt set /soc/pinctrl@01c20800/pps_pins pins "${param_pps_pin}" ++ fdt get value tmp_phandle /soc/pinctrl@01c20800 phandle ++ fdt set /pps@0 gpios "<${tmp_phandle} ${tmp_bank} ${tmp_pin} 0>" ++ env delete tmp_pin tmp_bank tmp_phandle ++fi ++ ++if test "${param_pps_falling_edge}" = "1"; then ++ fdt set /pps@0 assert-falling-edge ++fi ++ ++for f in ${overlays}; do ++ if test "${f}" = "pwm"; then ++ setenv bootargs_new "" ++ for arg in ${bootargs}; do ++ if test "${arg}" = "console=ttyS0,115200"; then ++ echo "Warning: Disabling ttyS0 console due to enabled PWM overlay" ++ else ++ setenv bootargs_new "${bootargs_new} ${arg}" ++ fi ++ done ++ setenv bootargs "${bootargs_new}" ++ fi ++done ++ ++if test -n "${param_w1_pin}"; then ++ setenv tmp_bank "${param_w1_pin}" ++ setenv tmp_pin "${param_w1_pin}" ++ run decompose_pin ++ fdt set /soc/pinctrl@01c20800/w1_pins pins "${param_w1_pin}" ++ fdt get value tmp_phandle /soc/pinctrl@01c20800 phandle ++ fdt set /onewire@0 gpios "<${tmp_phandle} ${tmp_bank} ${tmp_pin} 0>" ++ env delete tmp_pin tmp_bank tmp_phandle ++fi ++ ++if test "${param_w1_pin_int_pullup}" = "1"; then ++ fdt set /soc/pinctrl@01c20800/w1_pins bias-pull-up ++fi ++ ++if test "${param_uart1_rtscts}" = "1"; then ++ fdt get value tmp_phandle1 /soc/pinctrl@01c20800/uart1 phandle ++ fdt get value tmp_phandle2 /soc/pinctrl@01c20800/uart1_rts_cts phandle ++ fdt set /soc/serial@01c28400 pinctrl-names "default" "default" ++ fdt set /soc/serial@01c28400 pinctrl-0 "<${tmp_phandle1}>" ++ fdt set /soc/serial@01c28400 pinctrl-1 "<${tmp_phandle2}>" ++ env delete tmp_phandle1 tmp_phandle2 ++fi ++ ++if test "${param_uart2_rtscts}" = "1"; then ++ fdt get value tmp_phandle1 /soc/pinctrl@01c20800/uart2 phandle ++ fdt get value tmp_phandle2 /soc/pinctrl@01c20800/uart2_rts_cts phandle ++ fdt set /soc/serial@01c28800 pinctrl-names "default" "default" ++ fdt set /soc/serial@01c28800 pinctrl-0 "<${tmp_phandle1}>" ++ fdt set /soc/serial@01c28800 pinctrl-1 "<${tmp_phandle2}>" ++ env delete tmp_phandle1 tmp_phandle2 ++fi ++ ++if test "${param_uart3_rtscts}" = "1"; then ++ fdt get value tmp_phandle1 /soc/pinctrl@01c20800/uart3 phandle ++ fdt get value tmp_phandle2 /soc/pinctrl@01c20800/uart3_rts_cts phandle ++ fdt set /soc/serial@01c28c00 pinctrl-names "default" "default" ++ fdt set /soc/serial@01c28c00 pinctrl-0 "<${tmp_phandle1}>" ++ fdt set /soc/serial@01c28c00 pinctrl-1 "<${tmp_phandle2}>" ++ env delete tmp_phandle1 tmp_phandle2 ++fi +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-i2c0.dts b/arch/arm/boot/dts/overlay/sun8i-h3-i2c0.dts +new file mode 100644 +index 00000000..b457ac71 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-i2c0.dts +@@ -0,0 +1,20 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target-path = "/aliases"; ++ __overlay__ { ++ i2c0 = "/soc/i2c@01c2ac00"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c0>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-i2c1.dts b/arch/arm/boot/dts/overlay/sun8i-h3-i2c1.dts +new file mode 100644 +index 00000000..fd0928a1 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-i2c1.dts +@@ -0,0 +1,20 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target-path = "/aliases"; ++ __overlay__ { ++ i2c1 = "/soc/i2c@01c2b000"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-i2c2.dts b/arch/arm/boot/dts/overlay/sun8i-h3-i2c2.dts +new file mode 100644 +index 00000000..25b75b71 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-i2c2.dts +@@ -0,0 +1,20 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target-path = "/aliases"; ++ __overlay__ { ++ i2c2 = "/soc/i2c@01c2b400"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c2>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-pps-gpio.dts b/arch/arm/boot/dts/overlay/sun8i-h3-pps-gpio.dts +new file mode 100644 +index 00000000..16a737b0 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-pps-gpio.dts +@@ -0,0 +1,29 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&pio>; ++ __overlay__ { ++ pps_pins: pps_pins { ++ pins = "PD14"; ++ function = "gpio_in"; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/"; ++ __overlay__ { ++ pps@0 { ++ compatible = "pps-gpio"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pps_pins>; ++ gpios = <&pio 3 14 0>; /* PD14 */ ++ status = "okay"; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-pwm.dts b/arch/arm/boot/dts/overlay/sun8i-h3-pwm.dts +new file mode 100644 +index 00000000..ed3b8e60 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-pwm.dts +@@ -0,0 +1,39 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target-path = "/chosen"; ++ __overlay__ { ++ /delete-property/ stdout-path; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&uart0>; ++ __overlay__ { ++ status = "disabled"; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&pio>; ++ __overlay__ { ++ pwm0_pin: pwm0 { ++ pins = "PA5"; ++ function = "pwm0"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&pwm>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm0_pin>; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-spdif-out.dts b/arch/arm/boot/dts/overlay/sun8i-h3-spdif-out.dts +new file mode 100644 +index 00000000..c7c01411 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-spdif-out.dts +@@ -0,0 +1,38 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&spdif>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spdif_tx_pins_a>; ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/"; ++ __overlay__ { ++ sound { ++ compatible = "simple-audio-card"; ++ simple-audio-card,name = "On-board SPDIF"; ++ ++ simple-audio-card,cpu { ++ sound-dai = <&spdif>; ++ }; ++ ++ simple-audio-card,codec { ++ sound-dai = <&spdif_out>; ++ }; ++ }; ++ ++ spdif_out: spdif-out { ++ #sound-dai-cells = <0>; ++ compatible = "linux,spdif-dit"; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-spi-add-cs1.dts b/arch/arm/boot/dts/overlay/sun8i-h3-spi-add-cs1.dts +new file mode 100644 +index 00000000..bd8e2561 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-spi-add-cs1.dts +@@ -0,0 +1,41 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&pio>; ++ __overlay__ { ++ spi0_cs1: spi0_cs1 { ++ pins = "PA21"; ++ function = "gpio_out"; ++ output-high; ++ }; ++ ++ spi1_cs1: spi1_cs1 { ++ pins = "PA10"; ++ function = "gpio_out"; ++ output-high; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&spi0>; ++ __overlay__ { ++ pinctrl-names = "default", "default"; ++ pinctrl-1 = <&spi0_cs1>; ++ cs-gpios = <0>, <&pio 0 21 0>; /* PA21 */ ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&spi1>; ++ __overlay__ { ++ pinctrl-names = "default", "default"; ++ pinctrl-1 = <&spi1_cs1>; ++ cs-gpios = <0>, <&pio 0 10 0>; /* PA10 */ ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-spi-jedec-nor.dts b/arch/arm/boot/dts/overlay/sun8i-h3-spi-jedec-nor.dts +new file mode 100644 +index 00000000..ad22a71a +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-spi-jedec-nor.dts +@@ -0,0 +1,42 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target-path = "/aliases"; ++ __overlay__ { ++ spi0 = "/soc/spi@01c68000"; ++ spi1 = "/soc/spi@01c69000"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&spi0>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spiflash { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <1000000>; ++ status = "disabled"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&spi1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spiflash { ++ compatible = "jedec,spi-nor"; ++ reg = <0>; ++ spi-max-frequency = <1000000>; ++ status = "disabled"; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-spi-spidev.dts b/arch/arm/boot/dts/overlay/sun8i-h3-spi-spidev.dts +new file mode 100644 +index 00000000..180979e0 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-spi-spidev.dts +@@ -0,0 +1,42 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target-path = "/aliases"; ++ __overlay__ { ++ spi0 = "/soc/spi@01c68000"; ++ spi1 = "/soc/spi@01c69000"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&spi0>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spidev { ++ compatible = "spidev"; ++ status = "disabled"; ++ reg = <0>; ++ spi-max-frequency = <1000000>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&spi1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ spidev { ++ compatible = "spidev"; ++ status = "disabled"; ++ reg = <0>; ++ spi-max-frequency = <1000000>; ++ }; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-uart1.dts b/arch/arm/boot/dts/overlay/sun8i-h3-uart1.dts +new file mode 100644 +index 00000000..8a4f7e49 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-uart1.dts +@@ -0,0 +1,22 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target-path = "/aliases"; ++ __overlay__ { ++ serial1 = "/soc/serial@01c28400"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&uart1>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-uart2.dts b/arch/arm/boot/dts/overlay/sun8i-h3-uart2.dts +new file mode 100644 +index 00000000..499a1b49 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-uart2.dts +@@ -0,0 +1,22 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target-path = "/aliases"; ++ __overlay__ { ++ serial2 = "/soc/serial@01c28800"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&uart2>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart2_pins>; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-uart3.dts b/arch/arm/boot/dts/overlay/sun8i-h3-uart3.dts +new file mode 100644 +index 00000000..b5734c5b +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-uart3.dts +@@ -0,0 +1,22 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target-path = "/aliases"; ++ __overlay__ { ++ serial3 = "/soc/serial@01c28c00"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&uart3>; ++ __overlay__ { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart3_pins>; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-usbhost0.dts b/arch/arm/boot/dts/overlay/sun8i-h3-usbhost0.dts +new file mode 100644 +index 00000000..ff1d82fd +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-usbhost0.dts +@@ -0,0 +1,20 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&ehci0>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&ohci0>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-usbhost1.dts b/arch/arm/boot/dts/overlay/sun8i-h3-usbhost1.dts +new file mode 100644 +index 00000000..92049ec1 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-usbhost1.dts +@@ -0,0 +1,20 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&ehci1>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&ohci1>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-usbhost2.dts b/arch/arm/boot/dts/overlay/sun8i-h3-usbhost2.dts +new file mode 100644 +index 00000000..bf0c4f59 +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-usbhost2.dts +@@ -0,0 +1,20 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&ehci2>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&ohci2>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-usbhost3.dts b/arch/arm/boot/dts/overlay/sun8i-h3-usbhost3.dts +new file mode 100644 +index 00000000..f737075b +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-usbhost3.dts +@@ -0,0 +1,20 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&ehci3>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&ohci3>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/boot/dts/overlay/sun8i-h3-w1-gpio.dts b/arch/arm/boot/dts/overlay/sun8i-h3-w1-gpio.dts +new file mode 100644 +index 00000000..f4ccb7fb +--- /dev/null ++++ b/arch/arm/boot/dts/overlay/sun8i-h3-w1-gpio.dts +@@ -0,0 +1,29 @@ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "allwinner,sun8i-h3"; ++ ++ fragment@0 { ++ target = <&pio>; ++ __overlay__ { ++ w1_pins: w1_pins { ++ pins = "PD14"; ++ function = "gpio_in"; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/"; ++ __overlay__ { ++ onewire@0 { ++ compatible = "w1-gpio"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&w1_pins>; ++ gpios = <&pio 3 14 0>; /* PD14 */ ++ status = "okay"; ++ }; ++ }; ++ }; ++}; diff --git a/patch/kernel/sunxi-next/cubieboard_enable_mmc0_trigger_to_green_LED.patch b/patch/kernel/sunxi-next/cubieboard_green_LED_mmc0.patch similarity index 100% rename from patch/kernel/sunxi-next/cubieboard_enable_mmc0_trigger_to_green_LED.patch rename to patch/kernel/sunxi-next/cubieboard_green_LED_mmc0.patch diff --git a/patch/kernel/sunxi-next/cubietruck_enable_mmc0_trigger_to_green_LED.patch b/patch/kernel/sunxi-next/cubietruck_green_LED_mmc0.patch similarity index 100% rename from patch/kernel/sunxi-next/cubietruck_enable_mmc0_trigger_to_green_LED.patch rename to patch/kernel/sunxi-next/cubietruck_green_LED_mmc0.patch diff --git a/patch/kernel/sunxi-next/packaging-4.x-NEXT-with-postinstall-scripts.patch b/patch/kernel/sunxi-next/packaging-4.x-NEXT-with-postinstall-scripts.patch index 91c2faad2e..53c827bb11 100644 --- a/patch/kernel/sunxi-next/packaging-4.x-NEXT-with-postinstall-scripts.patch +++ b/patch/kernel/sunxi-next/packaging-4.x-NEXT-with-postinstall-scripts.patch @@ -1,10 +1,10 @@ diff --git a/scripts/package/builddeb b/scripts/package/builddeb -index 6c3b038..cc9b3c0 100755 +index aad67000..006d8ec7 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb -@@ -27,6 +27,28 @@ create_package() { - chown -R root:root "$pdir" - chmod -R go-w "$pdir" +@@ -29,6 +29,28 @@ create_package() { + # in case we are in a restrictive umask environment like 0077 + chmod -R a+rX "$pdir" + # Create preinstall and post install script to remove dtb + if [[ "$1" == *dtb* ]]; then @@ -20,18 +20,18 @@ index 6c3b038..cc9b3c0 100755 + echo "exit 0" >> $pdir/DEBIAN/postinst + chmod 775 $pdir/DEBIAN/postinst + fi -+ ++ + # Create postinstall script for headers + if [[ "$1" == *headers* ]]; then + echo "cd /usr/src/linux-headers-$version; echo \"Compiling headers - please wait ...\"; make -s scripts >/dev/null 2>&1" >> $pdir/DEBIAN/postinst + echo "exit 0" >> $pdir/DEBIAN/postinst + chmod 775 $pdir/DEBIAN/postinst + fi -+ ++ # Create the package dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch}" -p$pname -P"$pdir" dpkg --build "$pdir" .. -@@ -93,11 +115,13 @@ tmpdir="$objtree/debian/tmp" +@@ -95,11 +117,13 @@ tmpdir="$objtree/debian/tmp" fwdir="$objtree/debian/fwtmp" kernel_headers_dir="$objtree/debian/hdrtmp" libc_headers_dir="$objtree/debian/headertmp" @@ -49,7 +49,7 @@ index 6c3b038..cc9b3c0 100755 dbg_packagename=$packagename-dbg debarch= forcearch= -@@ -124,7 +148,9 @@ esac +@@ -126,7 +150,9 @@ esac BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)" # Setup the directory structure @@ -60,7 +60,7 @@ index 6c3b038..cc9b3c0 100755 mkdir -m 755 -p "$tmpdir/DEBIAN" mkdir -p "$tmpdir/lib" "$tmpdir/boot" mkdir -p "$fwdir/lib/firmware/$version/" -@@ -183,6 +209,11 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then +@@ -180,6 +206,11 @@ if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then fi fi @@ -72,28 +72,7 @@ index 6c3b038..cc9b3c0 100755 if [ "$ARCH" != "um" ]; then $MAKE headers_check KBUILD_SRC= $MAKE headers_install KBUILD_SRC= INSTALL_HDR_PATH="$libc_headers_dir/usr" -@@ -195,7 +226,7 @@ fi - # so do we; recent versions of dracut and initramfs-tools will obey this. - debhookdir=${KDEB_HOOKDIR:-/etc/kernel} - if grep -q '^CONFIG_BLK_DEV_INITRD=y' $KCONFIG_CONFIG; then -- want_initrd=Yes -+ want_initrd=Yes - else - want_initrd=No - fi -@@ -207,9 +238,11 @@ for script in postinst postrm preinst prerm ; do - set -e - - # Pass maintainer script parameters to hook scripts -+ - export DEB_MAINT_PARAMS="\$*" - - # Tell initramfs builder whether it's wanted -+ - export INITRD=$want_initrd - - test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d -@@ -218,6 +251,55 @@ EOF +@@ -215,6 +246,55 @@ EOF chmod 755 "$tmpdir/DEBIAN/$script" done @@ -149,33 +128,23 @@ index 6c3b038..cc9b3c0 100755 # Try to determine maintainer and email values if [ -n "$DEBEMAIL" ]; then email=$DEBEMAIL -@@ -328,16 +414,24 @@ fi - (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles" +@@ -329,12 +409,15 @@ if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then + fi destdir=$kernel_headers_dir/usr/src/linux-headers-$version mkdir -p "$destdir" -+######################## headers patch -+ZACNI=$(pwd) -+cd $destdir -+patch -p1 < /tmp/headers-debian-byteshift.patch -+cd $ZACNI -+######################## headers patch ++(cd $destdir; patch -p1 < /tmp/headers-debian-byteshift.patch) (cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -) (cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -) (cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build" rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles" -+(cd "$destdir"; make M=scripts clean) ++(cd $destdir; make M=scripts clean) + cat <> debian/control Package: $kernel_headers_packagename --Provides: linux-headers, linux-headers-2.6 -+Provides: linux-headers - Architecture: any - Description: Linux kernel headers for $KERNELRELEASE on \${kernel:debarch} - This package provides kernel header files for $KERNELRELEASE on \${kernel:debarch} -@@ -363,6 +457,16 @@ fi +@@ -363,6 +446,16 @@ fi cat <> debian/control @@ -192,7 +161,7 @@ index 6c3b038..cc9b3c0 100755 Package: $libc_headers_packagename Section: devel Provides: linux-kernel-headers -@@ -374,7 +478,7 @@ EOF +@@ -374,7 +467,7 @@ EOF if [ "$ARCH" != "um" ]; then create_package "$kernel_headers_packagename" "$kernel_headers_dir" diff --git a/patch/kernel/sunxi-next/resolve-crypto-deps.patch b/patch/kernel/sunxi-next/resolve-crypto-deps.patch deleted file mode 100644 index 3c412e1a1f..0000000000 --- a/patch/kernel/sunxi-next/resolve-crypto-deps.patch +++ /dev/null @@ -1,198 +0,0 @@ -From b56f5cbc7e08ec7d31c42fc41e5247677f20b143 Mon Sep 17 00:00:00 2001 -From: Ard Biesheuvel -Date: Tue, 14 Feb 2017 21:51:01 +0000 -Subject: crypto: arm/aes-neonbs - resolve fallback cipher at runtime - -Currently, the bit sliced NEON AES code for ARM has a link time -dependency on the scalar ARM asm implementation, which it uses as a -fallback to perform CBC encryption and the encryption of the initial -XTS tweak. - -The bit sliced NEON code is both fast and time invariant, which makes -it a reasonable default on hardware that supports it. However, the -ARM asm code it pulls in is not time invariant, and due to the way it -is linked in, cannot be overridden by the new generic time invariant -driver. In fact, it will not be used at all, given that the ARM asm -code registers itself as a cipher with a priority that exceeds the -priority of the fixed time cipher. - -So remove the link time dependency, and allocate the fallback cipher -via the crypto API. Note that this requires this driver's module_init -call to be replaced with late_initcall, so that the (possibly generic) -fallback cipher is guaranteed to be available when the builtin test -is performed at registration time. - -Signed-off-by: Ard Biesheuvel -Signed-off-by: Herbert Xu ---- - arch/arm/crypto/Kconfig | 2 +- - arch/arm/crypto/aes-neonbs-glue.c | 60 +++++++++++++++++++++++++++++---------- - 2 files changed, 46 insertions(+), 16 deletions(-) - -diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig -index a8fce93..b9adedc 100644 ---- a/arch/arm/crypto/Kconfig -+++ b/arch/arm/crypto/Kconfig -@@ -73,7 +73,7 @@ config CRYPTO_AES_ARM_BS - depends on KERNEL_MODE_NEON - select CRYPTO_BLKCIPHER - select CRYPTO_SIMD -- select CRYPTO_AES_ARM -+ select CRYPTO_AES - help - Use a faster and more secure NEON based implementation of AES in CBC, - CTR and XTS modes -diff --git a/arch/arm/crypto/aes-neonbs-glue.c b/arch/arm/crypto/aes-neonbs-glue.c -index 2920b96..c763779 100644 ---- a/arch/arm/crypto/aes-neonbs-glue.c -+++ b/arch/arm/crypto/aes-neonbs-glue.c -@@ -42,9 +42,6 @@ asmlinkage void aesbs_xts_encrypt(u8 out[], u8 const in[], u8 const rk[], - asmlinkage void aesbs_xts_decrypt(u8 out[], u8 const in[], u8 const rk[], - int rounds, int blocks, u8 iv[]); - --asmlinkage void __aes_arm_encrypt(const u32 rk[], int rounds, const u8 in[], -- u8 out[]); -- - struct aesbs_ctx { - int rounds; - u8 rk[13 * (8 * AES_BLOCK_SIZE) + 32] __aligned(AES_BLOCK_SIZE); -@@ -52,12 +49,12 @@ struct aesbs_ctx { - - struct aesbs_cbc_ctx { - struct aesbs_ctx key; -- u32 enc[AES_MAX_KEYLENGTH_U32]; -+ struct crypto_cipher *enc_tfm; - }; - - struct aesbs_xts_ctx { - struct aesbs_ctx key; -- u32 twkey[AES_MAX_KEYLENGTH_U32]; -+ struct crypto_cipher *tweak_tfm; - }; - - static int aesbs_setkey(struct crypto_skcipher *tfm, const u8 *in_key, -@@ -132,20 +129,18 @@ static int aesbs_cbc_setkey(struct crypto_skcipher *tfm, const u8 *in_key, - - ctx->key.rounds = 6 + key_len / 4; - -- memcpy(ctx->enc, rk.key_enc, sizeof(ctx->enc)); -- - kernel_neon_begin(); - aesbs_convert_key(ctx->key.rk, rk.key_enc, ctx->key.rounds); - kernel_neon_end(); - -- return 0; -+ return crypto_cipher_setkey(ctx->enc_tfm, in_key, key_len); - } - - static void cbc_encrypt_one(struct crypto_skcipher *tfm, const u8 *src, u8 *dst) - { - struct aesbs_cbc_ctx *ctx = crypto_skcipher_ctx(tfm); - -- __aes_arm_encrypt(ctx->enc, ctx->key.rounds, src, dst); -+ crypto_cipher_encrypt_one(ctx->enc_tfm, dst, src); - } - - static int cbc_encrypt(struct skcipher_request *req) -@@ -181,6 +176,23 @@ static int cbc_decrypt(struct skcipher_request *req) - return err; - } - -+static int cbc_init(struct crypto_tfm *tfm) -+{ -+ struct aesbs_cbc_ctx *ctx = crypto_tfm_ctx(tfm); -+ -+ ctx->enc_tfm = crypto_alloc_cipher("aes", 0, 0); -+ if (IS_ERR(ctx->enc_tfm)) -+ return PTR_ERR(ctx->enc_tfm); -+ return 0; -+} -+ -+static void cbc_exit(struct crypto_tfm *tfm) -+{ -+ struct aesbs_cbc_ctx *ctx = crypto_tfm_ctx(tfm); -+ -+ crypto_free_cipher(ctx->enc_tfm); -+} -+ - static int ctr_encrypt(struct skcipher_request *req) - { - struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); -@@ -228,7 +240,6 @@ static int aesbs_xts_setkey(struct crypto_skcipher *tfm, const u8 *in_key, - unsigned int key_len) - { - struct aesbs_xts_ctx *ctx = crypto_skcipher_ctx(tfm); -- struct crypto_aes_ctx rk; - int err; - - err = xts_verify_key(tfm, in_key, key_len); -@@ -236,15 +247,30 @@ static int aesbs_xts_setkey(struct crypto_skcipher *tfm, const u8 *in_key, - return err; - - key_len /= 2; -- err = crypto_aes_expand_key(&rk, in_key + key_len, key_len); -+ err = crypto_cipher_setkey(ctx->tweak_tfm, in_key + key_len, key_len); - if (err) - return err; - -- memcpy(ctx->twkey, rk.key_enc, sizeof(ctx->twkey)); -- - return aesbs_setkey(tfm, in_key, key_len); - } - -+static int xts_init(struct crypto_tfm *tfm) -+{ -+ struct aesbs_xts_ctx *ctx = crypto_tfm_ctx(tfm); -+ -+ ctx->tweak_tfm = crypto_alloc_cipher("aes", 0, 0); -+ if (IS_ERR(ctx->tweak_tfm)) -+ return PTR_ERR(ctx->tweak_tfm); -+ return 0; -+} -+ -+static void xts_exit(struct crypto_tfm *tfm) -+{ -+ struct aesbs_xts_ctx *ctx = crypto_tfm_ctx(tfm); -+ -+ crypto_free_cipher(ctx->tweak_tfm); -+} -+ - static int __xts_crypt(struct skcipher_request *req, - void (*fn)(u8 out[], u8 const in[], u8 const rk[], - int rounds, int blocks, u8 iv[])) -@@ -256,7 +282,7 @@ static int __xts_crypt(struct skcipher_request *req, - - err = skcipher_walk_virt(&walk, req, true); - -- __aes_arm_encrypt(ctx->twkey, ctx->key.rounds, walk.iv, walk.iv); -+ crypto_cipher_encrypt_one(ctx->tweak_tfm, walk.iv, walk.iv); - - kernel_neon_begin(); - while (walk.nbytes >= AES_BLOCK_SIZE) { -@@ -309,6 +335,8 @@ static struct skcipher_alg aes_algs[] = { { - .base.cra_ctxsize = sizeof(struct aesbs_cbc_ctx), - .base.cra_module = THIS_MODULE, - .base.cra_flags = CRYPTO_ALG_INTERNAL, -+ .base.cra_init = cbc_init, -+ .base.cra_exit = cbc_exit, - - .min_keysize = AES_MIN_KEY_SIZE, - .max_keysize = AES_MAX_KEY_SIZE, -@@ -342,6 +370,8 @@ static struct skcipher_alg aes_algs[] = { { - .base.cra_ctxsize = sizeof(struct aesbs_xts_ctx), - .base.cra_module = THIS_MODULE, - .base.cra_flags = CRYPTO_ALG_INTERNAL, -+ .base.cra_init = xts_init, -+ .base.cra_exit = xts_exit, - - .min_keysize = 2 * AES_MIN_KEY_SIZE, - .max_keysize = 2 * AES_MAX_KEY_SIZE, -@@ -402,5 +432,5 @@ unregister_simds: - return err; - } - --module_init(aes_init); -+late_initcall(aes_init); - module_exit(aes_exit); --- -cgit v1.1 diff --git a/patch/kernel/sunxi-next/scripts-dtc-import-updates.patch b/patch/kernel/sunxi-next/scripts-dtc-import-updates.patch index 89d2a2adc5..70f06f5454 100644 --- a/patch/kernel/sunxi-next/scripts-dtc-import-updates.patch +++ b/patch/kernel/sunxi-next/scripts-dtc-import-updates.patch @@ -1,670 +1,5 @@ -diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c -index 3d18e453..5adfc8f5 100644 ---- a/scripts/dtc/checks.c -+++ b/scripts/dtc/checks.c -@@ -72,17 +72,16 @@ struct check { - #define CHECK(_nm, _fn, _d, ...) \ - CHECK_ENTRY(_nm, _fn, _d, false, false, __VA_ARGS__) - --#ifdef __GNUC__ --static inline void check_msg(struct check *c, const char *fmt, ...) __attribute__((format (printf, 2, 3))); --#endif --static inline void check_msg(struct check *c, const char *fmt, ...) -+static inline void PRINTF(3, 4) check_msg(struct check *c, struct dt_info *dti, -+ const char *fmt, ...) - { - va_list ap; - va_start(ap, fmt); - - if ((c->warn && (quiet < 1)) - || (c->error && (quiet < 2))) { -- fprintf(stderr, "%s (%s): ", -+ fprintf(stderr, "%s: %s (%s): ", -+ strcmp(dti->outname, "-") ? dti->outname : "", - (c->error) ? "ERROR" : "Warning", c->name); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); -@@ -90,11 +89,11 @@ static inline void check_msg(struct check *c, const char *fmt, ...) - va_end(ap); - } - --#define FAIL(c, ...) \ -- do { \ -- TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__); \ -- (c)->status = FAILED; \ -- check_msg((c), __VA_ARGS__); \ -+#define FAIL(c, dti, ...) \ -+ do { \ -+ TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__); \ -+ (c)->status = FAILED; \ -+ check_msg((c), dti, __VA_ARGS__); \ - } while (0) - - static void check_nodes_props(struct check *c, struct dt_info *dti, struct node *node) -@@ -127,7 +126,7 @@ static bool run_check(struct check *c, struct dt_info *dti) - error = error || run_check(prq, dti); - if (prq->status != PASSED) { - c->status = PREREQ; -- check_msg(c, "Failed prerequisite '%s'", -+ check_msg(c, dti, "Failed prerequisite '%s'", - c->prereq[i]->name); - } - } -@@ -157,7 +156,7 @@ static bool run_check(struct check *c, struct dt_info *dti) - static inline void check_always_fail(struct check *c, struct dt_info *dti, - struct node *node) - { -- FAIL(c, "always_fail check"); -+ FAIL(c, dti, "always_fail check"); - } - CHECK(always_fail, check_always_fail, NULL); - -@@ -172,7 +171,7 @@ static void check_is_string(struct check *c, struct dt_info *dti, - return; /* Not present, assumed ok */ - - if (!data_is_one_string(prop->val)) -- FAIL(c, "\"%s\" property in %s is not a string", -+ FAIL(c, dti, "\"%s\" property in %s is not a string", - propname, node->fullpath); - } - #define WARNING_IF_NOT_STRING(nm, propname) \ -@@ -191,7 +190,7 @@ static void check_is_cell(struct check *c, struct dt_info *dti, - return; /* Not present, assumed ok */ - - if (prop->val.len != sizeof(cell_t)) -- FAIL(c, "\"%s\" property in %s is not a single cell", -+ FAIL(c, dti, "\"%s\" property in %s is not a single cell", - propname, node->fullpath); - } - #define WARNING_IF_NOT_CELL(nm, propname) \ -@@ -213,7 +212,7 @@ static void check_duplicate_node_names(struct check *c, struct dt_info *dti, - child2; - child2 = child2->next_sibling) - if (streq(child->name, child2->name)) -- FAIL(c, "Duplicate node name %s", -+ FAIL(c, dti, "Duplicate node name %s", - child->fullpath); - } - ERROR(duplicate_node_names, check_duplicate_node_names, NULL); -@@ -228,7 +227,7 @@ static void check_duplicate_property_names(struct check *c, struct dt_info *dti, - if (prop2->deleted) - continue; - if (streq(prop->name, prop2->name)) -- FAIL(c, "Duplicate property name %s in %s", -+ FAIL(c, dti, "Duplicate property name %s in %s", - prop->name, node->fullpath); - } - } -@@ -239,6 +238,7 @@ ERROR(duplicate_property_names, check_duplicate_property_names, NULL); - #define UPPERCASE "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - #define DIGITS "0123456789" - #define PROPNODECHARS LOWERCASE UPPERCASE DIGITS ",._+*#?-" -+#define PROPNODECHARSSTRICT LOWERCASE UPPERCASE DIGITS ",-" - - static void check_node_name_chars(struct check *c, struct dt_info *dti, - struct node *node) -@@ -246,16 +246,27 @@ static void check_node_name_chars(struct check *c, struct dt_info *dti, - int n = strspn(node->name, c->data); - - if (n < strlen(node->name)) -- FAIL(c, "Bad character '%c' in node %s", -+ FAIL(c, dti, "Bad character '%c' in node %s", - node->name[n], node->fullpath); - } - ERROR(node_name_chars, check_node_name_chars, PROPNODECHARS "@"); - -+static void check_node_name_chars_strict(struct check *c, struct dt_info *dti, -+ struct node *node) -+{ -+ int n = strspn(node->name, c->data); -+ -+ if (n < node->basenamelen) -+ FAIL(c, dti, "Character '%c' not recommended in node %s", -+ node->name[n], node->fullpath); -+} -+CHECK(node_name_chars_strict, check_node_name_chars_strict, PROPNODECHARSSTRICT); -+ - static void check_node_name_format(struct check *c, struct dt_info *dti, - struct node *node) - { - if (strchr(get_unitname(node), '@')) -- FAIL(c, "Node %s has multiple '@' characters in name", -+ FAIL(c, dti, "Node %s has multiple '@' characters in name", - node->fullpath); - } - ERROR(node_name_format, check_node_name_format, NULL, &node_name_chars); -@@ -274,11 +285,11 @@ static void check_unit_address_vs_reg(struct check *c, struct dt_info *dti, - - if (prop) { - if (!unitname[0]) -- FAIL(c, "Node %s has a reg or ranges property, but no unit name", -+ FAIL(c, dti, "Node %s has a reg or ranges property, but no unit name", - node->fullpath); - } else { - if (unitname[0]) -- FAIL(c, "Node %s has a unit name, but no reg property", -+ FAIL(c, dti, "Node %s has a unit name, but no reg property", - node->fullpath); - } - } -@@ -293,12 +304,44 @@ static void check_property_name_chars(struct check *c, struct dt_info *dti, - int n = strspn(prop->name, c->data); - - if (n < strlen(prop->name)) -- FAIL(c, "Bad character '%c' in property name \"%s\", node %s", -+ FAIL(c, dti, "Bad character '%c' in property name \"%s\", node %s", - prop->name[n], prop->name, node->fullpath); - } - } - ERROR(property_name_chars, check_property_name_chars, PROPNODECHARS); - -+static void check_property_name_chars_strict(struct check *c, -+ struct dt_info *dti, -+ struct node *node) -+{ -+ struct property *prop; -+ -+ for_each_property(node, prop) { -+ const char *name = prop->name; -+ int n = strspn(name, c->data); -+ -+ if (n == strlen(prop->name)) -+ continue; -+ -+ /* Certain names are whitelisted */ -+ if (streq(name, "device_type")) -+ continue; -+ -+ /* -+ * # is only allowed at the beginning of property names not counting -+ * the vendor prefix. -+ */ -+ if (name[n] == '#' && ((n == 0) || (name[n-1] == ','))) { -+ name += n + 1; -+ n = strspn(name, c->data); -+ } -+ if (n < strlen(name)) -+ FAIL(c, dti, "Character '%c' not recommended in property name \"%s\", node %s", -+ name[n], prop->name, node->fullpath); -+ } -+} -+CHECK(property_name_chars_strict, check_property_name_chars_strict, PROPNODECHARSSTRICT); -+ - #define DESCLABEL_FMT "%s%s%s%s%s" - #define DESCLABEL_ARGS(node,prop,mark) \ - ((mark) ? "value of " : ""), \ -@@ -327,7 +370,7 @@ static void check_duplicate_label(struct check *c, struct dt_info *dti, - return; - - if ((othernode != node) || (otherprop != prop) || (othermark != mark)) -- FAIL(c, "Duplicate label '%s' on " DESCLABEL_FMT -+ FAIL(c, dti, "Duplicate label '%s' on " DESCLABEL_FMT - " and " DESCLABEL_FMT, - label, DESCLABEL_ARGS(node, prop, mark), - DESCLABEL_ARGS(othernode, otherprop, othermark)); -@@ -367,7 +410,7 @@ static cell_t check_phandle_prop(struct check *c, struct dt_info *dti, - return 0; - - if (prop->val.len != sizeof(cell_t)) { -- FAIL(c, "%s has bad length (%d) %s property", -+ FAIL(c, dti, "%s has bad length (%d) %s property", - node->fullpath, prop->val.len, prop->name); - return 0; - } -@@ -379,7 +422,7 @@ static cell_t check_phandle_prop(struct check *c, struct dt_info *dti, - /* "Set this node's phandle equal to some - * other node's phandle". That's nonsensical - * by construction. */ { -- FAIL(c, "%s in %s is a reference to another node", -+ FAIL(c, dti, "%s in %s is a reference to another node", - prop->name, node->fullpath); - } - /* But setting this node's phandle equal to its own -@@ -393,7 +436,7 @@ static cell_t check_phandle_prop(struct check *c, struct dt_info *dti, - phandle = propval_cell(prop); - - if ((phandle == 0) || (phandle == -1)) { -- FAIL(c, "%s has bad value (0x%x) in %s property", -+ FAIL(c, dti, "%s has bad value (0x%x) in %s property", - node->fullpath, phandle, prop->name); - return 0; - } -@@ -420,7 +463,7 @@ static void check_explicit_phandles(struct check *c, struct dt_info *dti, - return; - - if (linux_phandle && phandle && (phandle != linux_phandle)) -- FAIL(c, "%s has mismatching 'phandle' and 'linux,phandle'" -+ FAIL(c, dti, "%s has mismatching 'phandle' and 'linux,phandle'" - " properties", node->fullpath); - - if (linux_phandle && !phandle) -@@ -428,7 +471,7 @@ static void check_explicit_phandles(struct check *c, struct dt_info *dti, - - other = get_node_by_phandle(root, phandle); - if (other && (other != node)) { -- FAIL(c, "%s has duplicated phandle 0x%x (seen before at %s)", -+ FAIL(c, dti, "%s has duplicated phandle 0x%x (seen before at %s)", - node->fullpath, phandle, other->fullpath); - return; - } -@@ -453,7 +496,7 @@ static void check_name_properties(struct check *c, struct dt_info *dti, - - if ((prop->val.len != node->basenamelen+1) - || (memcmp(prop->val.val, node->name, node->basenamelen) != 0)) { -- FAIL(c, "\"name\" property in %s is incorrect (\"%s\" instead" -+ FAIL(c, dti, "\"name\" property in %s is incorrect (\"%s\" instead" - " of base node name)", node->fullpath, prop->val.val); - } else { - /* The name property is correct, and therefore redundant. -@@ -488,16 +531,16 @@ static void fixup_phandle_references(struct check *c, struct dt_info *dti, - refnode = get_node_by_ref(dt, m->ref); - if (! refnode) { - if (!(dti->dtsflags & DTSF_PLUGIN)) -- FAIL(c, "Reference to non-existent node or " -+ FAIL(c, dti, "Reference to non-existent node or " - "label \"%s\"\n", m->ref); - else /* mark the entry as unresolved */ -- *((cell_t *)(prop->val.val + m->offset)) = -+ *((fdt32_t *)(prop->val.val + m->offset)) = - cpu_to_fdt32(0xffffffff); - continue; - } - - phandle = get_node_phandle(dt, refnode); -- *((cell_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); -+ *((fdt32_t *)(prop->val.val + m->offset)) = cpu_to_fdt32(phandle); - } - } - } -@@ -520,7 +563,7 @@ static void fixup_path_references(struct check *c, struct dt_info *dti, - - refnode = get_node_by_ref(dt, m->ref); - if (!refnode) { -- FAIL(c, "Reference to non-existent node or label \"%s\"\n", -+ FAIL(c, dti, "Reference to non-existent node or label \"%s\"\n", - m->ref); - continue; - } -@@ -579,19 +622,19 @@ static void check_reg_format(struct check *c, struct dt_info *dti, - return; /* No "reg", that's fine */ - - if (!node->parent) { -- FAIL(c, "Root node has a \"reg\" property"); -+ FAIL(c, dti, "Root node has a \"reg\" property"); - return; - } - - if (prop->val.len == 0) -- FAIL(c, "\"reg\" property in %s is empty", node->fullpath); -+ FAIL(c, dti, "\"reg\" property in %s is empty", node->fullpath); - - addr_cells = node_addr_cells(node->parent); - size_cells = node_size_cells(node->parent); - entrylen = (addr_cells + size_cells) * sizeof(cell_t); - - if (!entrylen || (prop->val.len % entrylen) != 0) -- FAIL(c, "\"reg\" property in %s has invalid length (%d bytes) " -+ FAIL(c, dti, "\"reg\" property in %s has invalid length (%d bytes) " - "(#address-cells == %d, #size-cells == %d)", - node->fullpath, prop->val.len, addr_cells, size_cells); - } -@@ -608,7 +651,7 @@ static void check_ranges_format(struct check *c, struct dt_info *dti, - return; - - if (!node->parent) { -- FAIL(c, "Root node has a \"ranges\" property"); -+ FAIL(c, dti, "Root node has a \"ranges\" property"); - return; - } - -@@ -620,17 +663,17 @@ static void check_ranges_format(struct check *c, struct dt_info *dti, - - if (prop->val.len == 0) { - if (p_addr_cells != c_addr_cells) -- FAIL(c, "%s has empty \"ranges\" property but its " -+ FAIL(c, dti, "%s has empty \"ranges\" property but its " - "#address-cells (%d) differs from %s (%d)", - node->fullpath, c_addr_cells, node->parent->fullpath, - p_addr_cells); - if (p_size_cells != c_size_cells) -- FAIL(c, "%s has empty \"ranges\" property but its " -+ FAIL(c, dti, "%s has empty \"ranges\" property but its " - "#size-cells (%d) differs from %s (%d)", - node->fullpath, c_size_cells, node->parent->fullpath, - p_size_cells); - } else if ((prop->val.len % entrylen) != 0) { -- FAIL(c, "\"ranges\" property in %s has invalid length (%d bytes) " -+ FAIL(c, dti, "\"ranges\" property in %s has invalid length (%d bytes) " - "(parent #address-cells == %d, child #address-cells == %d, " - "#size-cells == %d)", node->fullpath, prop->val.len, - p_addr_cells, c_addr_cells, c_size_cells); -@@ -638,6 +681,229 @@ static void check_ranges_format(struct check *c, struct dt_info *dti, - } - WARNING(ranges_format, check_ranges_format, NULL, &addr_size_cells); - -+static const struct bus_type pci_bus = { -+ .name = "PCI", -+}; -+ -+static void check_pci_bridge(struct check *c, struct dt_info *dti, struct node *node) -+{ -+ struct property *prop; -+ cell_t *cells; -+ -+ prop = get_property(node, "device_type"); -+ if (!prop || !streq(prop->val.val, "pci")) -+ return; -+ -+ node->bus = &pci_bus; -+ -+ if (!strneq(node->name, "pci", node->basenamelen) && -+ !strneq(node->name, "pcie", node->basenamelen)) -+ FAIL(c, dti, "Node %s node name is not \"pci\" or \"pcie\"", -+ node->fullpath); -+ -+ prop = get_property(node, "ranges"); -+ if (!prop) -+ FAIL(c, dti, "Node %s missing ranges for PCI bridge (or not a bridge)", -+ node->fullpath); -+ -+ if (node_addr_cells(node) != 3) -+ FAIL(c, dti, "Node %s incorrect #address-cells for PCI bridge", -+ node->fullpath); -+ if (node_size_cells(node) != 2) -+ FAIL(c, dti, "Node %s incorrect #size-cells for PCI bridge", -+ node->fullpath); -+ -+ prop = get_property(node, "bus-range"); -+ if (!prop) { -+ FAIL(c, dti, "Node %s missing bus-range for PCI bridge", -+ node->fullpath); -+ return; -+ } -+ if (prop->val.len != (sizeof(cell_t) * 2)) { -+ FAIL(c, dti, "Node %s bus-range must be 2 cells", -+ node->fullpath); -+ return; -+ } -+ cells = (cell_t *)prop->val.val; -+ if (fdt32_to_cpu(cells[0]) > fdt32_to_cpu(cells[1])) -+ FAIL(c, dti, "Node %s bus-range 1st cell must be less than or equal to 2nd cell", -+ node->fullpath); -+ if (fdt32_to_cpu(cells[1]) > 0xff) -+ FAIL(c, dti, "Node %s bus-range maximum bus number must be less than 256", -+ node->fullpath); -+} -+WARNING(pci_bridge, check_pci_bridge, NULL, -+ &device_type_is_string, &addr_size_cells); -+ -+static void check_pci_device_bus_num(struct check *c, struct dt_info *dti, struct node *node) -+{ -+ struct property *prop; -+ unsigned int bus_num, min_bus, max_bus; -+ cell_t *cells; -+ -+ if (!node->parent || (node->parent->bus != &pci_bus)) -+ return; -+ -+ prop = get_property(node, "reg"); -+ if (!prop) -+ return; -+ -+ cells = (cell_t *)prop->val.val; -+ bus_num = (fdt32_to_cpu(cells[0]) & 0x00ff0000) >> 16; -+ -+ prop = get_property(node->parent, "bus-range"); -+ if (!prop) { -+ min_bus = max_bus = 0; -+ } else { -+ cells = (cell_t *)prop->val.val; -+ min_bus = fdt32_to_cpu(cells[0]); -+ max_bus = fdt32_to_cpu(cells[0]); -+ } -+ if ((bus_num < min_bus) || (bus_num > max_bus)) -+ FAIL(c, dti, "Node %s PCI bus number %d out of range, expected (%d - %d)", -+ node->fullpath, bus_num, min_bus, max_bus); -+} -+WARNING(pci_device_bus_num, check_pci_device_bus_num, NULL, ®_format, &pci_bridge); -+ -+static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct node *node) -+{ -+ struct property *prop; -+ const char *unitname = get_unitname(node); -+ char unit_addr[5]; -+ unsigned int dev, func, reg; -+ cell_t *cells; -+ -+ if (!node->parent || (node->parent->bus != &pci_bus)) -+ return; -+ -+ prop = get_property(node, "reg"); -+ if (!prop) { -+ FAIL(c, dti, "Node %s missing PCI reg property", node->fullpath); -+ return; -+ } -+ -+ cells = (cell_t *)prop->val.val; -+ if (cells[1] || cells[2]) -+ FAIL(c, dti, "Node %s PCI reg config space address cells 2 and 3 must be 0", -+ node->fullpath); -+ -+ reg = fdt32_to_cpu(cells[0]); -+ dev = (reg & 0xf800) >> 11; -+ func = (reg & 0x700) >> 8; -+ -+ if (reg & 0xff000000) -+ FAIL(c, dti, "Node %s PCI reg address is not configuration space", -+ node->fullpath); -+ if (reg & 0x000000ff) -+ FAIL(c, dti, "Node %s PCI reg config space address register number must be 0", -+ node->fullpath); -+ -+ if (func == 0) { -+ snprintf(unit_addr, sizeof(unit_addr), "%x", dev); -+ if (streq(unitname, unit_addr)) -+ return; -+ } -+ -+ snprintf(unit_addr, sizeof(unit_addr), "%x,%x", dev, func); -+ if (streq(unitname, unit_addr)) -+ return; -+ -+ FAIL(c, dti, "Node %s PCI unit address format error, expected \"%s\"", -+ node->fullpath, unit_addr); -+} -+WARNING(pci_device_reg, check_pci_device_reg, NULL, ®_format, &pci_bridge); -+ -+static const struct bus_type simple_bus = { -+ .name = "simple-bus", -+}; -+ -+static bool node_is_compatible(struct node *node, const char *compat) -+{ -+ struct property *prop; -+ const char *str, *end; -+ -+ prop = get_property(node, "compatible"); -+ if (!prop) -+ return false; -+ -+ for (str = prop->val.val, end = str + prop->val.len; str < end; -+ str += strnlen(str, end - str) + 1) { -+ if (strneq(str, compat, end - str)) -+ return true; -+ } -+ return false; -+} -+ -+static void check_simple_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) -+{ -+ if (node_is_compatible(node, "simple-bus")) -+ node->bus = &simple_bus; -+} -+WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL, &addr_size_cells); -+ -+static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct node *node) -+{ -+ struct property *prop; -+ const char *unitname = get_unitname(node); -+ char unit_addr[17]; -+ unsigned int size; -+ uint64_t reg = 0; -+ cell_t *cells = NULL; -+ -+ if (!node->parent || (node->parent->bus != &simple_bus)) -+ return; -+ -+ prop = get_property(node, "reg"); -+ if (prop) -+ cells = (cell_t *)prop->val.val; -+ else { -+ prop = get_property(node, "ranges"); -+ if (prop && prop->val.len) -+ /* skip of child address */ -+ cells = ((cell_t *)prop->val.val) + node_addr_cells(node); -+ } -+ -+ if (!cells) { -+ if (node->parent->parent && !(node->bus == &simple_bus)) -+ FAIL(c, dti, "Node %s missing or empty reg/ranges property", node->fullpath); -+ return; -+ } -+ -+ size = node_addr_cells(node->parent); -+ while (size--) -+ reg = (reg << 32) | fdt32_to_cpu(*(cells++)); -+ -+ snprintf(unit_addr, sizeof(unit_addr), "%lx", reg); -+ if (!streq(unitname, unit_addr)) -+ FAIL(c, dti, "Node %s simple-bus unit address format error, expected \"%s\"", -+ node->fullpath, unit_addr); -+} -+WARNING(simple_bus_reg, check_simple_bus_reg, NULL, ®_format, &simple_bus_bridge); -+ -+static void check_unit_address_format(struct check *c, struct dt_info *dti, -+ struct node *node) -+{ -+ const char *unitname = get_unitname(node); -+ -+ if (node->parent && node->parent->bus) -+ return; -+ -+ if (!unitname[0]) -+ return; -+ -+ if (!strncmp(unitname, "0x", 2)) { -+ FAIL(c, dti, "Node %s unit name should not have leading \"0x\"", -+ node->fullpath); -+ /* skip over 0x for next test */ -+ unitname += 2; -+ } -+ if (unitname[0] == '0' && isxdigit(unitname[1])) -+ FAIL(c, dti, "Node %s unit name should not have leading 0s", -+ node->fullpath); -+} -+WARNING(unit_address_format, check_unit_address_format, NULL, -+ &node_name_format, &pci_bridge, &simple_bus_bridge); -+ - /* - * Style checks - */ -@@ -656,11 +922,11 @@ static void check_avoid_default_addr_size(struct check *c, struct dt_info *dti, - return; - - if (node->parent->addr_cells == -1) -- FAIL(c, "Relying on default #address-cells value for %s", -+ FAIL(c, dti, "Relying on default #address-cells value for %s", - node->fullpath); - - if (node->parent->size_cells == -1) -- FAIL(c, "Relying on default #size-cells value for %s", -+ FAIL(c, dti, "Relying on default #size-cells value for %s", - node->fullpath); - } - WARNING(avoid_default_addr_size, check_avoid_default_addr_size, NULL, -@@ -684,7 +950,7 @@ static void check_obsolete_chosen_interrupt_controller(struct check *c, - - prop = get_property(chosen, "interrupt-controller"); - if (prop) -- FAIL(c, "/chosen has obsolete \"interrupt-controller\" " -+ FAIL(c, dti, "/chosen has obsolete \"interrupt-controller\" " - "property"); - } - WARNING(obsolete_chosen_interrupt_controller, -@@ -703,9 +969,20 @@ static struct check *check_table[] = { - &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell, - &device_type_is_string, &model_is_string, &status_is_string, - -+ &property_name_chars_strict, -+ &node_name_chars_strict, -+ - &addr_size_cells, ®_format, &ranges_format, - - &unit_address_vs_reg, -+ &unit_address_format, -+ -+ &pci_bridge, -+ &pci_device_reg, -+ &pci_device_bus_num, -+ -+ &simple_bus_bridge, -+ &simple_bus_reg, - - &avoid_default_addr_size, - &obsolete_chosen_interrupt_controller, -diff --git a/scripts/dtc/data.c b/scripts/dtc/data.c -index 8cae2374..aa37a16c 100644 ---- a/scripts/dtc/data.c -+++ b/scripts/dtc/data.c -@@ -171,9 +171,9 @@ struct data data_merge(struct data d1, struct data d2) - struct data data_append_integer(struct data d, uint64_t value, int bits) - { - uint8_t value_8; -- uint16_t value_16; -- uint32_t value_32; -- uint64_t value_64; -+ fdt16_t value_16; -+ fdt32_t value_32; -+ fdt64_t value_64; - - switch (bits) { - case 8: -@@ -197,14 +197,14 @@ struct data data_append_integer(struct data d, uint64_t value, int bits) - } - } - --struct data data_append_re(struct data d, const struct fdt_reserve_entry *re) -+struct data data_append_re(struct data d, uint64_t address, uint64_t size) - { -- struct fdt_reserve_entry bere; -+ struct fdt_reserve_entry re; - -- bere.address = cpu_to_fdt64(re->address); -- bere.size = cpu_to_fdt64(re->size); -+ re.address = cpu_to_fdt64(address); -+ re.size = cpu_to_fdt64(size); - -- return data_append_data(d, &bere, sizeof(bere)); -+ return data_append_data(d, &re, sizeof(re)); - } - - struct data data_append_cell(struct data d, cell_t word) -diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l -index c6006030..fd825ebb 100644 ---- a/scripts/dtc/dtc-lexer.l -+++ b/scripts/dtc/dtc-lexer.l -@@ -62,7 +62,8 @@ static int dts_version = 1; - - static void push_input_file(const char *filename); - static bool pop_input_file(void); --static void lexical_error(const char *fmt, ...); -+static void PRINTF(1, 2) lexical_error(const char *fmt, ...); -+ - %} - - %% diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped -index 2c862bc8..6b016dba 100644 +index 64c24377..6b016dba 100644 --- a/scripts/dtc/dtc-lexer.lex.c_shipped +++ b/scripts/dtc/dtc-lexer.lex.c_shipped @@ -9,7 +9,7 @@ @@ -794,19 +129,16 @@ index 2c862bc8..6b016dba 100644 (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -@@ -655,8 +670,9 @@ static int dts_version = 1; - - static void push_input_file(const char *filename); +@@ -657,7 +672,7 @@ static void push_input_file(const char *filename); static bool pop_input_file(void); --static void lexical_error(const char *fmt, ...); --#line 660 "dtc-lexer.lex.c" -+static void PRINTF(1, 2) lexical_error(const char *fmt, ...); -+ + static void PRINTF(1, 2) lexical_error(const char *fmt, ...); + +-#line 661 "dtc-lexer.lex.c" +#line 676 "dtc-lexer.lex.c" #define INITIAL 0 #define BYTESTRING 1 -@@ -698,7 +714,7 @@ FILE *yyget_out (void ); +@@ -699,7 +714,7 @@ FILE *yyget_out (void ); void yyset_out (FILE * _out_str ); @@ -815,7 +147,7 @@ index 2c862bc8..6b016dba 100644 char *yyget_text (void ); -@@ -755,7 +771,7 @@ static int input (void ); +@@ -756,7 +771,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ @@ -824,7 +156,7 @@ index 2c862bc8..6b016dba 100644 #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, -@@ -779,7 +795,7 @@ static int input (void ); +@@ -780,7 +795,7 @@ static int input (void ); else \ { \ errno=0; \ @@ -833,19 +165,16 @@ index 2c862bc8..6b016dba 100644 { \ if( errno != EINTR) \ { \ -@@ -878,9 +894,9 @@ YY_DECL - } - +@@ -881,7 +896,7 @@ YY_DECL { --#line 68 "dtc-lexer.l" -+#line 69 "dtc-lexer.l" + #line 69 "dtc-lexer.l" --#line 884 "dtc-lexer.lex.c" +-#line 885 "dtc-lexer.lex.c" +#line 900 "dtc-lexer.lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { -@@ -911,7 +927,7 @@ yy_match: +@@ -912,7 +927,7 @@ yy_match: if ( yy_current_state >= 166 ) yy_c = yy_meta[(unsigned int) yy_c]; } @@ -854,268 +183,16 @@ index 2c862bc8..6b016dba 100644 ++yy_cp; } while ( yy_current_state != 165 ); -@@ -937,7 +953,7 @@ do_action: /* This label is used only to access EOF actions. */ - case 1: - /* rule 1 can match eol */ - YY_RULE_SETUP --#line 69 "dtc-lexer.l" -+#line 70 "dtc-lexer.l" - { - char *name = strchr(yytext, '\"') + 1; - yytext[yyleng-1] = '\0'; -@@ -947,7 +963,7 @@ YY_RULE_SETUP - case 2: - /* rule 2 can match eol */ - YY_RULE_SETUP --#line 75 "dtc-lexer.l" -+#line 76 "dtc-lexer.l" - { - char *line, *fnstart, *fnend; - struct data fn; -@@ -981,7 +997,7 @@ case YY_STATE_EOF(INITIAL): - case YY_STATE_EOF(BYTESTRING): - case YY_STATE_EOF(PROPNODENAME): - case YY_STATE_EOF(V1): --#line 104 "dtc-lexer.l" -+#line 105 "dtc-lexer.l" - { - if (!pop_input_file()) { - yyterminate(); -@@ -991,7 +1007,7 @@ case YY_STATE_EOF(V1): - case 3: - /* rule 3 can match eol */ - YY_RULE_SETUP --#line 110 "dtc-lexer.l" -+#line 111 "dtc-lexer.l" - { - DPRINT("String: %s\n", yytext); - yylval.data = data_copy_escape_string(yytext+1, -@@ -1001,7 +1017,7 @@ YY_RULE_SETUP - YY_BREAK - case 4: - YY_RULE_SETUP --#line 117 "dtc-lexer.l" -+#line 118 "dtc-lexer.l" - { - DPRINT("Keyword: /dts-v1/\n"); - dts_version = 1; -@@ -1011,7 +1027,7 @@ YY_RULE_SETUP - YY_BREAK - case 5: - YY_RULE_SETUP --#line 124 "dtc-lexer.l" -+#line 125 "dtc-lexer.l" - { - DPRINT("Keyword: /plugin/\n"); - return DT_PLUGIN; -@@ -1019,7 +1035,7 @@ YY_RULE_SETUP - YY_BREAK - case 6: - YY_RULE_SETUP --#line 129 "dtc-lexer.l" -+#line 130 "dtc-lexer.l" - { - DPRINT("Keyword: /memreserve/\n"); - BEGIN_DEFAULT(); -@@ -1028,7 +1044,7 @@ YY_RULE_SETUP - YY_BREAK - case 7: - YY_RULE_SETUP --#line 135 "dtc-lexer.l" -+#line 136 "dtc-lexer.l" - { - DPRINT("Keyword: /bits/\n"); - BEGIN_DEFAULT(); -@@ -1037,7 +1053,7 @@ YY_RULE_SETUP - YY_BREAK - case 8: - YY_RULE_SETUP --#line 141 "dtc-lexer.l" -+#line 142 "dtc-lexer.l" - { - DPRINT("Keyword: /delete-property/\n"); - DPRINT("\n"); -@@ -1047,7 +1063,7 @@ YY_RULE_SETUP - YY_BREAK - case 9: - YY_RULE_SETUP --#line 148 "dtc-lexer.l" -+#line 149 "dtc-lexer.l" - { - DPRINT("Keyword: /delete-node/\n"); - DPRINT("\n"); -@@ -1057,7 +1073,7 @@ YY_RULE_SETUP - YY_BREAK - case 10: - YY_RULE_SETUP --#line 155 "dtc-lexer.l" -+#line 156 "dtc-lexer.l" - { - DPRINT("Label: %s\n", yytext); - yylval.labelref = xstrdup(yytext); -@@ -1067,7 +1083,7 @@ YY_RULE_SETUP - YY_BREAK - case 11: - YY_RULE_SETUP --#line 162 "dtc-lexer.l" -+#line 163 "dtc-lexer.l" - { - char *e; - DPRINT("Integer Literal: '%s'\n", yytext); -@@ -1093,7 +1109,7 @@ YY_RULE_SETUP - case 12: - /* rule 12 can match eol */ - YY_RULE_SETUP --#line 184 "dtc-lexer.l" -+#line 185 "dtc-lexer.l" - { - struct data d; - DPRINT("Character literal: %s\n", yytext); -@@ -1117,7 +1133,7 @@ YY_RULE_SETUP - YY_BREAK - case 13: - YY_RULE_SETUP --#line 205 "dtc-lexer.l" -+#line 206 "dtc-lexer.l" - { /* label reference */ - DPRINT("Ref: %s\n", yytext+1); - yylval.labelref = xstrdup(yytext+1); -@@ -1126,7 +1142,7 @@ YY_RULE_SETUP - YY_BREAK - case 14: - YY_RULE_SETUP --#line 211 "dtc-lexer.l" -+#line 212 "dtc-lexer.l" - { /* new-style path reference */ - yytext[yyleng-1] = '\0'; - DPRINT("Ref: %s\n", yytext+2); -@@ -1136,7 +1152,7 @@ YY_RULE_SETUP - YY_BREAK - case 15: - YY_RULE_SETUP --#line 218 "dtc-lexer.l" -+#line 219 "dtc-lexer.l" - { - yylval.byte = strtol(yytext, NULL, 16); - DPRINT("Byte: %02x\n", (int)yylval.byte); -@@ -1145,7 +1161,7 @@ YY_RULE_SETUP - YY_BREAK - case 16: - YY_RULE_SETUP --#line 224 "dtc-lexer.l" -+#line 225 "dtc-lexer.l" - { - DPRINT("/BYTESTRING\n"); - BEGIN_DEFAULT(); -@@ -1154,7 +1170,7 @@ YY_RULE_SETUP - YY_BREAK - case 17: - YY_RULE_SETUP --#line 230 "dtc-lexer.l" -+#line 231 "dtc-lexer.l" - { - DPRINT("PropNodeName: %s\n", yytext); - yylval.propnodename = xstrdup((yytext[0] == '\\') ? -@@ -1165,7 +1181,7 @@ YY_RULE_SETUP - YY_BREAK - case 18: - YY_RULE_SETUP --#line 238 "dtc-lexer.l" -+#line 239 "dtc-lexer.l" - { - DPRINT("Binary Include\n"); - return DT_INCBIN; -@@ -1174,64 +1190,64 @@ YY_RULE_SETUP - case 19: - /* rule 19 can match eol */ - YY_RULE_SETUP --#line 243 "dtc-lexer.l" -+#line 244 "dtc-lexer.l" - /* eat whitespace */ - YY_BREAK - case 20: - /* rule 20 can match eol */ - YY_RULE_SETUP --#line 244 "dtc-lexer.l" -+#line 245 "dtc-lexer.l" - /* eat C-style comments */ - YY_BREAK - case 21: - /* rule 21 can match eol */ - YY_RULE_SETUP --#line 245 "dtc-lexer.l" -+#line 246 "dtc-lexer.l" - /* eat C++-style comments */ - YY_BREAK - case 22: - YY_RULE_SETUP --#line 247 "dtc-lexer.l" -+#line 248 "dtc-lexer.l" - { return DT_LSHIFT; }; - YY_BREAK - case 23: - YY_RULE_SETUP --#line 248 "dtc-lexer.l" -+#line 249 "dtc-lexer.l" - { return DT_RSHIFT; }; - YY_BREAK - case 24: - YY_RULE_SETUP --#line 249 "dtc-lexer.l" -+#line 250 "dtc-lexer.l" - { return DT_LE; }; - YY_BREAK - case 25: - YY_RULE_SETUP --#line 250 "dtc-lexer.l" -+#line 251 "dtc-lexer.l" - { return DT_GE; }; - YY_BREAK - case 26: - YY_RULE_SETUP --#line 251 "dtc-lexer.l" -+#line 252 "dtc-lexer.l" - { return DT_EQ; }; - YY_BREAK - case 27: - YY_RULE_SETUP --#line 252 "dtc-lexer.l" -+#line 253 "dtc-lexer.l" - { return DT_NE; }; - YY_BREAK - case 28: - YY_RULE_SETUP --#line 253 "dtc-lexer.l" -+#line 254 "dtc-lexer.l" - { return DT_AND; }; - YY_BREAK - case 29: - YY_RULE_SETUP --#line 254 "dtc-lexer.l" -+#line 255 "dtc-lexer.l" - { return DT_OR; }; - YY_BREAK - case 30: - YY_RULE_SETUP --#line 256 "dtc-lexer.l" -+#line 257 "dtc-lexer.l" - { - DPRINT("Char: %c (\\x%02x)\n", yytext[0], - (unsigned)yytext[0]); -@@ -1249,10 +1265,10 @@ YY_RULE_SETUP - YY_BREAK - case 31: - YY_RULE_SETUP --#line 271 "dtc-lexer.l" -+#line 272 "dtc-lexer.l" +@@ -1253,7 +1268,7 @@ YY_RULE_SETUP + #line 272 "dtc-lexer.l" ECHO; YY_BREAK --#line 1256 "dtc-lexer.lex.c" +-#line 1257 "dtc-lexer.lex.c" +#line 1272 "dtc-lexer.lex.c" case YY_END_OF_BUFFER: { -@@ -1438,7 +1454,7 @@ static int yy_get_next_buffer (void) +@@ -1439,7 +1454,7 @@ static int yy_get_next_buffer (void) else { @@ -1124,7 +201,7 @@ index 2c862bc8..6b016dba 100644 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) -@@ -1452,7 +1468,7 @@ static int yy_get_next_buffer (void) +@@ -1453,7 +1468,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { @@ -1133,7 +210,7 @@ index 2c862bc8..6b016dba 100644 if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; -@@ -1465,7 +1481,7 @@ static int yy_get_next_buffer (void) +@@ -1466,7 +1481,7 @@ static int yy_get_next_buffer (void) } else /* Can't grow it, we don't own it. */ @@ -1142,7 +219,7 @@ index 2c862bc8..6b016dba 100644 if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( -@@ -1548,7 +1564,7 @@ static int yy_get_next_buffer (void) +@@ -1549,7 +1564,7 @@ static int yy_get_next_buffer (void) if ( yy_current_state >= 166 ) yy_c = yy_meta[(unsigned int) yy_c]; } @@ -1151,7 +228,7 @@ index 2c862bc8..6b016dba 100644 } return yy_current_state; -@@ -1576,7 +1592,7 @@ static int yy_get_next_buffer (void) +@@ -1577,7 +1592,7 @@ static int yy_get_next_buffer (void) if ( yy_current_state >= 166 ) yy_c = yy_meta[(unsigned int) yy_c]; } @@ -1160,7 +237,7 @@ index 2c862bc8..6b016dba 100644 yy_is_jam = (yy_current_state == 165); return yy_is_jam ? 0 : yy_current_state; -@@ -1610,7 +1626,7 @@ static int yy_get_next_buffer (void) +@@ -1611,7 +1626,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ @@ -1169,7 +246,7 @@ index 2c862bc8..6b016dba 100644 ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) -@@ -1634,7 +1650,7 @@ static int yy_get_next_buffer (void) +@@ -1635,7 +1650,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) @@ -1178,7 +255,7 @@ index 2c862bc8..6b016dba 100644 if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; -@@ -1884,7 +1900,7 @@ void yypop_buffer_state (void) +@@ -1885,7 +1900,7 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { @@ -1187,7 +264,7 @@ index 2c862bc8..6b016dba 100644 if (!(yy_buffer_stack)) { -@@ -1892,15 +1908,15 @@ static void yyensure_buffer_stack (void) +@@ -1893,15 +1908,15 @@ static void yyensure_buffer_stack (void) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ @@ -1206,7 +283,7 @@ index 2c862bc8..6b016dba 100644 (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; -@@ -1929,7 +1945,7 @@ static void yyensure_buffer_stack (void) +@@ -1930,7 +1945,7 @@ static void yyensure_buffer_stack (void) * @param base the character buffer * @param size the size in bytes of the character buffer * @@ -1215,7 +292,7 @@ index 2c862bc8..6b016dba 100644 */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { -@@ -1939,7 +1955,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +@@ -1940,7 +1955,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ @@ -1224,7 +301,7 @@ index 2c862bc8..6b016dba 100644 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) -@@ -1948,7 +1964,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +@@ -1949,7 +1964,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; @@ -1233,7 +310,7 @@ index 2c862bc8..6b016dba 100644 b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; -@@ -1971,7 +1987,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +@@ -1972,7 +1987,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { @@ -1242,7 +319,7 @@ index 2c862bc8..6b016dba 100644 } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will -@@ -1981,7 +1997,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +@@ -1982,7 +1997,7 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) * * @return the newly allocated buffer state object. */ @@ -1251,7 +328,7 @@ index 2c862bc8..6b016dba 100644 { YY_BUFFER_STATE b; char *buf; -@@ -1989,7 +2005,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +@@ -1990,7 +2005,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ @@ -1260,7 +337,7 @@ index 2c862bc8..6b016dba 100644 buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); -@@ -2015,7 +2031,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +@@ -2016,7 +2031,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) #define YY_EXIT_FAILURE 2 #endif @@ -1269,7 +346,7 @@ index 2c862bc8..6b016dba 100644 { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); -@@ -2045,7 +2061,7 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ) +@@ -2046,7 +2061,7 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ) */ int yyget_lineno (void) { @@ -1278,7 +355,7 @@ index 2c862bc8..6b016dba 100644 return yylineno; } -@@ -2068,7 +2084,7 @@ FILE *yyget_out (void) +@@ -2069,7 +2084,7 @@ FILE *yyget_out (void) /** Get the length of the current token. * */ @@ -1287,7 +364,7 @@ index 2c862bc8..6b016dba 100644 { return yyleng; } -@@ -2124,10 +2140,10 @@ static int yy_init_globals (void) +@@ -2125,10 +2140,10 @@ static int yy_init_globals (void) * This function is called from yylex_destroy(), so don't allocate here. */ @@ -1300,7 +377,7 @@ index 2c862bc8..6b016dba 100644 (yy_init) = 0; (yy_start) = 0; -@@ -2136,8 +2152,8 @@ static int yy_init_globals (void) +@@ -2137,8 +2152,8 @@ static int yy_init_globals (void) yyin = stdin; yyout = stdout; #else @@ -1311,7 +388,7 @@ index 2c862bc8..6b016dba 100644 #endif /* For future reference: Set errno on error, since we are called by -@@ -2195,7 +2211,7 @@ static int yy_flex_strlen (yyconst char * s ) +@@ -2196,7 +2211,7 @@ static int yy_flex_strlen (yyconst char * s ) void *yyalloc (yy_size_t size ) { @@ -1320,7 +397,7 @@ index 2c862bc8..6b016dba 100644 } void *yyrealloc (void * ptr, yy_size_t size ) -@@ -2208,7 +2224,7 @@ void *yyrealloc (void * ptr, yy_size_t size ) +@@ -2209,7 +2224,7 @@ void *yyrealloc (void * ptr, yy_size_t size ) * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ @@ -1329,415 +406,6 @@ index 2c862bc8..6b016dba 100644 } void yyfree (void * ptr ) -@@ -2218,7 +2234,7 @@ void yyfree (void * ptr ) - - #define YYTABLES_NAME "yytables" - --#line 271 "dtc-lexer.l" -+#line 272 "dtc-lexer.l" - - - -diff --git a/scripts/dtc/dtc-parser.tab.c_shipped b/scripts/dtc/dtc-parser.tab.c_shipped -index 2965227a..0a7a5ed8 100644 ---- a/scripts/dtc/dtc-parser.tab.c_shipped -+++ b/scripts/dtc/dtc-parser.tab.c_shipped -@@ -1557,10 +1557,10 @@ yyreduce: - { - struct node *target = get_node_by_ref((yyvsp[-3].node), (yyvsp[-1].labelref)); - -- add_label(&target->labels, (yyvsp[-2].labelref)); -- if (target) -+ if (target) { -+ add_label(&target->labels, (yyvsp[-2].labelref)); - merge_nodes(target, (yyvsp[0].node)); -- else -+ } else - ERROR(&(yylsp[-1]), "Label or path %s not found", (yyvsp[-1].labelref)); - (yyval.node) = (yyvsp[-3].node); - } -diff --git a/scripts/dtc/dtc-parser.y b/scripts/dtc/dtc-parser.y -index b2fd4d15..ca3f5003 100644 ---- a/scripts/dtc/dtc-parser.y -+++ b/scripts/dtc/dtc-parser.y -@@ -171,10 +171,10 @@ devicetree: - { - struct node *target = get_node_by_ref($1, $3); - -- add_label(&target->labels, $2); -- if (target) -+ if (target) { -+ add_label(&target->labels, $2); - merge_nodes(target, $4); -- else -+ } else - ERROR(&@3, "Label or path %s not found", $3); - $$ = $1; - } -diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c -index a4edf4c7..f5eed9d7 100644 ---- a/scripts/dtc/dtc.c -+++ b/scripts/dtc/dtc.c -@@ -138,7 +138,7 @@ static const char *guess_type_by_name(const char *fname, const char *fallback) - static const char *guess_input_format(const char *fname, const char *fallback) - { - struct stat statbuf; -- uint32_t magic; -+ fdt32_t magic; - FILE *f; - - if (stat(fname, &statbuf) != 0) -@@ -159,8 +159,7 @@ static const char *guess_input_format(const char *fname, const char *fallback) - } - fclose(f); - -- magic = fdt32_to_cpu(magic); -- if (magic == FDT_MAGIC) -+ if (fdt32_to_cpu(magic) == FDT_MAGIC) - return "dtb"; - - return guess_type_by_name(fname, fallback); -@@ -216,7 +215,7 @@ int main(int argc, char *argv[]) - alignsize = strtol(optarg, NULL, 0); - if (!is_power_of_2(alignsize)) - die("Invalid argument \"%d\" to -a option\n", -- optarg); -+ alignsize); - break; - case 'f': - force = true; -@@ -309,6 +308,8 @@ int main(int argc, char *argv[]) - else - die("Unknown input format \"%s\"\n", inform); - -+ dti->outname = outname; -+ - if (depfile) { - fputc('\n', depfile); - fclose(depfile); -diff --git a/scripts/dtc/dtc.h b/scripts/dtc/dtc.h -index c6f125c6..fc24e175 100644 ---- a/scripts/dtc/dtc.h -+++ b/scripts/dtc/dtc.h -@@ -43,7 +43,6 @@ - #define debug(...) - #endif - -- - #define DEFAULT_FDT_VERSION 17 - - /* -@@ -114,7 +113,7 @@ struct data data_insert_at_marker(struct data d, struct marker *m, - struct data data_merge(struct data d1, struct data d2); - struct data data_append_cell(struct data d, cell_t word); - struct data data_append_integer(struct data d, uint64_t word, int bits); --struct data data_append_re(struct data d, const struct fdt_reserve_entry *re); -+struct data data_append_re(struct data d, uint64_t address, uint64_t size); - struct data data_append_addr(struct data d, uint64_t addr); - struct data data_append_byte(struct data d, uint8_t byte); - struct data data_append_zeroes(struct data d, int len); -@@ -136,6 +135,10 @@ struct label { - struct label *next; - }; - -+struct bus_type { -+ const char *name; -+}; -+ - struct property { - bool deleted; - char *name; -@@ -162,6 +165,7 @@ struct node { - int addr_cells, size_cells; - - struct label *labels; -+ const struct bus_type *bus; - }; - - #define for_each_label_withdel(l0, l) \ -@@ -227,7 +231,7 @@ uint32_t guess_boot_cpuid(struct node *tree); - /* Boot info (tree plus memreserve information */ - - struct reserve_info { -- struct fdt_reserve_entry re; -+ uint64_t address, size; - - struct reserve_info *next; - -@@ -246,6 +250,7 @@ struct dt_info { - struct reserve_info *reservelist; - uint32_t boot_cpuid_phys; - struct node *dt; /* the device tree */ -+ const char *outname; /* filename being written to, "-" for stdout */ - }; - - /* DTS version flags definitions */ -diff --git a/scripts/dtc/flattree.c b/scripts/dtc/flattree.c -index ebac548b..fcf71541 100644 ---- a/scripts/dtc/flattree.c -+++ b/scripts/dtc/flattree.c -@@ -49,7 +49,7 @@ static struct version_info { - - struct emitter { - void (*cell)(void *, cell_t); -- void (*string)(void *, char *, int); -+ void (*string)(void *, const char *, int); - void (*align)(void *, int); - void (*data)(void *, struct data); - void (*beginnode)(void *, struct label *labels); -@@ -64,7 +64,7 @@ static void bin_emit_cell(void *e, cell_t val) - *dtbuf = data_append_cell(*dtbuf, val); - } - --static void bin_emit_string(void *e, char *str, int len) -+static void bin_emit_string(void *e, const char *str, int len) - { - struct data *dtbuf = e; - -@@ -144,22 +144,14 @@ static void asm_emit_cell(void *e, cell_t val) - (val >> 8) & 0xff, val & 0xff); - } - --static void asm_emit_string(void *e, char *str, int len) -+static void asm_emit_string(void *e, const char *str, int len) - { - FILE *f = e; -- char c = 0; - -- if (len != 0) { -- /* XXX: ewww */ -- c = str[len]; -- str[len] = '\0'; -- } -- -- fprintf(f, "\t.string\t\"%s\"\n", str); -- -- if (len != 0) { -- str[len] = c; -- } -+ if (len != 0) -+ fprintf(f, "\t.string\t\"%.*s\"\n", len, str); -+ else -+ fprintf(f, "\t.string\t\"%s\"\n", str); - } - - static void asm_emit_align(void *e, int a) -@@ -179,7 +171,7 @@ static void asm_emit_data(void *e, struct data d) - emit_offset_label(f, m->ref, m->offset); - - while ((d.len - off) >= sizeof(uint32_t)) { -- asm_emit_cell(e, fdt32_to_cpu(*((uint32_t *)(d.val+off)))); -+ asm_emit_cell(e, fdt32_to_cpu(*((fdt32_t *)(d.val+off)))); - off += sizeof(uint32_t); - } - -@@ -318,17 +310,16 @@ static struct data flatten_reserve_list(struct reserve_info *reservelist, - { - struct reserve_info *re; - struct data d = empty_data; -- static struct fdt_reserve_entry null_re = {0,0}; - int j; - - for (re = reservelist; re; re = re->next) { -- d = data_append_re(d, &re->re); -+ d = data_append_re(d, re->address, re->size); - } - /* - * Add additional reserved slots if the user asked for them. - */ - for (j = 0; j < reservenum; j++) { -- d = data_append_re(d, &null_re); -+ d = data_append_re(d, 0, 0); - } - - return d; -@@ -544,11 +535,11 @@ void dt_to_asm(FILE *f, struct dt_info *dti, int version) - fprintf(f, "\t.globl\t%s\n", l->label); - fprintf(f, "%s:\n", l->label); - } -- ASM_EMIT_BELONG(f, "0x%08x", (unsigned int)(re->re.address >> 32)); -+ ASM_EMIT_BELONG(f, "0x%08x", (unsigned int)(re->address >> 32)); - ASM_EMIT_BELONG(f, "0x%08x", -- (unsigned int)(re->re.address & 0xffffffff)); -- ASM_EMIT_BELONG(f, "0x%08x", (unsigned int)(re->re.size >> 32)); -- ASM_EMIT_BELONG(f, "0x%08x", (unsigned int)(re->re.size & 0xffffffff)); -+ (unsigned int)(re->address & 0xffffffff)); -+ ASM_EMIT_BELONG(f, "0x%08x", (unsigned int)(re->size >> 32)); -+ ASM_EMIT_BELONG(f, "0x%08x", (unsigned int)(re->size & 0xffffffff)); - } - for (i = 0; i < reservenum; i++) { - fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n"); -@@ -609,7 +600,7 @@ static void flat_read_chunk(struct inbuf *inb, void *p, int len) - - static uint32_t flat_read_word(struct inbuf *inb) - { -- uint32_t val; -+ fdt32_t val; - - assert(((inb->ptr - inb->base) % sizeof(val)) == 0); - -@@ -718,13 +709,15 @@ static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb) - * First pass, count entries. - */ - while (1) { -+ uint64_t address, size; -+ - flat_read_chunk(inb, &re, sizeof(re)); -- re.address = fdt64_to_cpu(re.address); -- re.size = fdt64_to_cpu(re.size); -- if (re.size == 0) -+ address = fdt64_to_cpu(re.address); -+ size = fdt64_to_cpu(re.size); -+ if (size == 0) - break; - -- new = build_reserve_entry(re.address, re.size); -+ new = build_reserve_entry(address, size); - reservelist = add_reserve_entry(reservelist, new); - } - -@@ -817,6 +810,7 @@ static struct node *unflatten_tree(struct inbuf *dtbuf, - struct dt_info *dt_from_blob(const char *fname) - { - FILE *f; -+ fdt32_t magic_buf, totalsize_buf; - uint32_t magic, totalsize, version, size_dt, boot_cpuid_phys; - uint32_t off_dt, off_str, off_mem_rsvmap; - int rc; -@@ -833,7 +827,7 @@ struct dt_info *dt_from_blob(const char *fname) - - f = srcfile_relative_open(fname, NULL); - -- rc = fread(&magic, sizeof(magic), 1, f); -+ rc = fread(&magic_buf, sizeof(magic_buf), 1, f); - if (ferror(f)) - die("Error reading DT blob magic number: %s\n", - strerror(errno)); -@@ -844,11 +838,11 @@ struct dt_info *dt_from_blob(const char *fname) - die("Mysterious short read reading magic number\n"); - } - -- magic = fdt32_to_cpu(magic); -+ magic = fdt32_to_cpu(magic_buf); - if (magic != FDT_MAGIC) - die("Blob has incorrect magic number\n"); - -- rc = fread(&totalsize, sizeof(totalsize), 1, f); -+ rc = fread(&totalsize_buf, sizeof(totalsize_buf), 1, f); - if (ferror(f)) - die("Error reading DT blob size: %s\n", strerror(errno)); - if (rc < 1) { -@@ -858,7 +852,7 @@ struct dt_info *dt_from_blob(const char *fname) - die("Mysterious short read reading blob size\n"); - } - -- totalsize = fdt32_to_cpu(totalsize); -+ totalsize = fdt32_to_cpu(totalsize_buf); - if (totalsize < FDT_V1_SIZE) - die("DT blob size (%d) is too small\n", totalsize); - -diff --git a/scripts/dtc/libfdt/fdt_addresses.c b/scripts/dtc/libfdt/fdt_addresses.c -new file mode 100644 -index 00000000..eff4dbcc ---- /dev/null -+++ b/scripts/dtc/libfdt/fdt_addresses.c -@@ -0,0 +1,96 @@ -+/* -+ * libfdt - Flat Device Tree manipulation -+ * Copyright (C) 2014 David Gibson -+ * -+ * libfdt is dual licensed: you can use it either under the terms of -+ * the GPL, or the BSD license, at your option. -+ * -+ * 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. -+ * -+ * You should have received a copy of the GNU General Public -+ * License along with this library; if not, write to the Free -+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, -+ * MA 02110-1301 USA -+ * -+ * Alternatively, -+ * -+ * b) 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 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. -+ */ -+#include "libfdt_env.h" -+ -+#include -+#include -+ -+#include "libfdt_internal.h" -+ -+int fdt_address_cells(const void *fdt, int nodeoffset) -+{ -+ const fdt32_t *ac; -+ int val; -+ int len; -+ -+ ac = fdt_getprop(fdt, nodeoffset, "#address-cells", &len); -+ if (!ac) -+ return 2; -+ -+ if (len != sizeof(*ac)) -+ return -FDT_ERR_BADNCELLS; -+ -+ val = fdt32_to_cpu(*ac); -+ if ((val <= 0) || (val > FDT_MAX_NCELLS)) -+ return -FDT_ERR_BADNCELLS; -+ -+ return val; -+} -+ -+int fdt_size_cells(const void *fdt, int nodeoffset) -+{ -+ const fdt32_t *sc; -+ int val; -+ int len; -+ -+ sc = fdt_getprop(fdt, nodeoffset, "#size-cells", &len); -+ if (!sc) -+ return 2; -+ -+ if (len != sizeof(*sc)) -+ return -FDT_ERR_BADNCELLS; -+ -+ val = fdt32_to_cpu(*sc); -+ if ((val < 0) || (val > FDT_MAX_NCELLS)) -+ return -FDT_ERR_BADNCELLS; -+ -+ return val; -+} diff --git a/scripts/dtc/libfdt/fdt_empty_tree.c b/scripts/dtc/libfdt/fdt_empty_tree.c index f72d13b1..f2ae9b77 100644 --- a/scripts/dtc/libfdt/fdt_empty_tree.c @@ -2453,7 +1121,7 @@ index 3d00d2ee..08de2cce 100644 return prop->data; diff --git a/scripts/dtc/libfdt/fdt_rw.c b/scripts/dtc/libfdt/fdt_rw.c -index 2eed4f58..8b487f6c 100644 +index 3fd58473..8b487f6c 100644 --- a/scripts/dtc/libfdt/fdt_rw.c +++ b/scripts/dtc/libfdt/fdt_rw.c @@ -207,7 +207,7 @@ static int _fdt_resize_property(void *fdt, int nodeoffset, const char *name, @@ -2465,17 +1133,7 @@ index 2eed4f58..8b487f6c 100644 return oldlen; if ((err = _fdt_splice_struct(fdt, (*prop)->data, FDT_TAGALIGN(oldlen), -@@ -283,7 +283,8 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name, - if (err) - return err; - -- memcpy(prop->data, val, len); -+ if (len) -+ memcpy(prop->data, val, len); - return 0; - } - -@@ -322,7 +323,7 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name) +@@ -323,7 +323,7 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name) FDT_RW_CHECK_HEADER(fdt); prop = fdt_get_property_w(fdt, nodeoffset, name, &len); @@ -2541,124 +1199,10 @@ index 6aaab399..5e859198 100644 _fdt_nop_region(prop, len + sizeof(*prop)); diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h -index b842b156..707b5069 100644 +index ba86caa7..707b5069 100644 --- a/scripts/dtc/libfdt/libfdt.h +++ b/scripts/dtc/libfdt/libfdt.h -@@ -143,7 +143,9 @@ - /* Low-level functions (you probably don't need these) */ - /**********************************************************************/ - -+#ifndef SWIG /* This function is not useful in Python */ - const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen); -+#endif - static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) - { - return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen); -@@ -210,7 +212,6 @@ int fdt_next_subnode(const void *fdt, int offset); - /**********************************************************************/ - /* General functions */ - /**********************************************************************/ -- - #define fdt_get_header(fdt, field) \ - (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field)) - #define fdt_magic(fdt) (fdt_get_header(fdt, magic)) -@@ -354,8 +355,10 @@ int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size); - * useful for finding subnodes based on a portion of a larger string, - * such as a full path. - */ -+#ifndef SWIG /* Not available in Python */ - int fdt_subnode_offset_namelen(const void *fdt, int parentoffset, - const char *name, int namelen); -+#endif - /** - * fdt_subnode_offset - find a subnode of a given node - * @fdt: pointer to the device tree blob -@@ -391,7 +394,9 @@ int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name); - * Identical to fdt_path_offset(), but only consider the first namelen - * characters of path as the path name. - */ -+#ifndef SWIG /* Not available in Python */ - int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen); -+#endif - - /** - * fdt_path_offset - find a tree node by its full path -@@ -550,10 +555,12 @@ const struct fdt_property *fdt_get_property_by_offset(const void *fdt, - * Identical to fdt_get_property(), but only examine the first namelen - * characters of name for matching the property name. - */ -+#ifndef SWIG /* Not available in Python */ - const struct fdt_property *fdt_get_property_namelen(const void *fdt, - int nodeoffset, - const char *name, - int namelen, int *lenp); -+#endif - - /** - * fdt_get_property - find a given property in a given node -@@ -624,8 +631,10 @@ static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -+#ifndef SWIG /* This function is not useful in Python */ - const void *fdt_getprop_by_offset(const void *fdt, int offset, - const char **namep, int *lenp); -+#endif - - /** - * fdt_getprop_namelen - get property value based on substring -@@ -638,6 +647,7 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset, - * Identical to fdt_getprop(), but only examine the first namelen - * characters of name for matching the property name. - */ -+#ifndef SWIG /* Not available in Python */ - const void *fdt_getprop_namelen(const void *fdt, int nodeoffset, - const char *name, int namelen, int *lenp); - static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset, -@@ -647,6 +657,7 @@ static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset, - return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name, - namelen, lenp); - } -+#endif - - /** - * fdt_getprop - retrieve the value of a given property -@@ -707,8 +718,10 @@ uint32_t fdt_get_phandle(const void *fdt, int nodeoffset); - * Identical to fdt_get_alias(), but only examine the first namelen - * characters of name for matching the alias name. - */ -+#ifndef SWIG /* Not available in Python */ - const char *fdt_get_alias_namelen(const void *fdt, - const char *name, int namelen); -+#endif - - /** - * fdt_get_alias - retrieve the path referenced by a given alias -@@ -1106,10 +1119,12 @@ int fdt_size_cells(const void *fdt, int nodeoffset); - * of the name. It is useful when you want to manipulate only one value of - * an array and you have a string that doesn't end with \0. - */ -+#ifndef SWIG /* Not available in Python */ - int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset, - const char *name, int namelen, - uint32_t idx, const void *val, - int len); -+#endif - - /** - * fdt_setprop_inplace - change a property's value, but not its size -@@ -1139,8 +1154,10 @@ int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset, - * -FDT_ERR_BADSTRUCTURE, - * -FDT_ERR_TRUNCATED, standard meanings - */ -+#ifndef SWIG /* Not available in Python */ - int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name, - const void *val, int len); -+#endif - - /** - * fdt_setprop_inplace_u32 - change the value of a 32-bit integer property -@@ -1297,6 +1314,22 @@ static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val) +@@ -1314,6 +1314,22 @@ static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val) { return fdt_property_u32(fdt, name, val); } @@ -2681,160 +1225,10 @@ index b842b156..707b5069 100644 #define fdt_property_string(fdt, name, str) \ fdt_property(fdt, name, str, strlen(str)+1) int fdt_end_node(void *fdt); -@@ -1527,6 +1560,36 @@ static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name, - #define fdt_setprop_string(fdt, nodeoffset, name, str) \ - fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1) - -+ -+/** -+ * fdt_setprop_empty - set a property to an empty value -+ * @fdt: pointer to the device tree blob -+ * @nodeoffset: offset of the node whose property to change -+ * @name: name of the property to change -+ * -+ * fdt_setprop_empty() sets the value of the named property in the -+ * given node to an empty (zero length) value, or creates a new empty -+ * property if it does not already exist. -+ * -+ * This function may insert or delete data from the blob, and will -+ * therefore change the offsets of some existing nodes. -+ * -+ * returns: -+ * 0, on success -+ * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to -+ * contain the new property value -+ * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag -+ * -FDT_ERR_BADLAYOUT, -+ * -FDT_ERR_BADMAGIC, -+ * -FDT_ERR_BADVERSION, -+ * -FDT_ERR_BADSTATE, -+ * -FDT_ERR_BADSTRUCTURE, -+ * -FDT_ERR_BADLAYOUT, -+ * -FDT_ERR_TRUNCATED, standard meanings -+ */ -+#define fdt_setprop_empty(fdt, nodeoffset, name) \ -+ fdt_setprop((fdt), (nodeoffset), (name), NULL, 0) -+ - /** - * fdt_appendprop - append to or create a property - * @fdt: pointer to the device tree blob -@@ -1704,8 +1767,10 @@ int fdt_delprop(void *fdt, int nodeoffset, const char *name); - * creating subnodes based on a portion of a larger string, such as a - * full path. - */ -+#ifndef SWIG /* Not available in Python */ - int fdt_add_subnode_namelen(void *fdt, int parentoffset, - const char *name, int namelen); -+#endif - - /** - * fdt_add_subnode - creates a new node -diff --git a/scripts/dtc/libfdt/libfdt_env.h b/scripts/dtc/libfdt/libfdt_env.h -index 99f936da..952056cd 100644 ---- a/scripts/dtc/libfdt/libfdt_env.h -+++ b/scripts/dtc/libfdt/libfdt_env.h -@@ -58,16 +58,16 @@ - #include - - #ifdef __CHECKER__ --#define __force __attribute__((force)) --#define __bitwise __attribute__((bitwise)) -+#define FDT_FORCE __attribute__((force)) -+#define FDT_BITWISE __attribute__((bitwise)) - #else --#define __force --#define __bitwise -+#define FDT_FORCE -+#define FDT_BITWISE - #endif - --typedef uint16_t __bitwise fdt16_t; --typedef uint32_t __bitwise fdt32_t; --typedef uint64_t __bitwise fdt64_t; -+typedef uint16_t FDT_BITWISE fdt16_t; -+typedef uint32_t FDT_BITWISE fdt32_t; -+typedef uint64_t FDT_BITWISE fdt64_t; - - #define EXTRACT_BYTE(x, n) ((unsigned long long)((uint8_t *)&x)[n]) - #define CPU_TO_FDT16(x) ((EXTRACT_BYTE(x, 0) << 8) | EXTRACT_BYTE(x, 1)) -@@ -80,29 +80,29 @@ typedef uint64_t __bitwise fdt64_t; - - static inline uint16_t fdt16_to_cpu(fdt16_t x) - { -- return (__force uint16_t)CPU_TO_FDT16(x); -+ return (FDT_FORCE uint16_t)CPU_TO_FDT16(x); - } - static inline fdt16_t cpu_to_fdt16(uint16_t x) - { -- return (__force fdt16_t)CPU_TO_FDT16(x); -+ return (FDT_FORCE fdt16_t)CPU_TO_FDT16(x); - } - - static inline uint32_t fdt32_to_cpu(fdt32_t x) - { -- return (__force uint32_t)CPU_TO_FDT32(x); -+ return (FDT_FORCE uint32_t)CPU_TO_FDT32(x); - } - static inline fdt32_t cpu_to_fdt32(uint32_t x) - { -- return (__force fdt32_t)CPU_TO_FDT32(x); -+ return (FDT_FORCE fdt32_t)CPU_TO_FDT32(x); - } - - static inline uint64_t fdt64_to_cpu(fdt64_t x) - { -- return (__force uint64_t)CPU_TO_FDT64(x); -+ return (FDT_FORCE uint64_t)CPU_TO_FDT64(x); - } - static inline fdt64_t cpu_to_fdt64(uint64_t x) - { -- return (__force fdt64_t)CPU_TO_FDT64(x); -+ return (FDT_FORCE fdt64_t)CPU_TO_FDT64(x); - } - #undef CPU_TO_FDT64 - #undef CPU_TO_FDT32 diff --git a/scripts/dtc/livetree.c b/scripts/dtc/livetree.c -index afa2f67b..aecd2787 100644 +index 3673de07..aecd2787 100644 --- a/scripts/dtc/livetree.c +++ b/scripts/dtc/livetree.c -@@ -242,7 +242,7 @@ void delete_property_by_name(struct node *node, char *name) - struct property *prop = node->proplist; - - while (prop) { -- if (!strcmp(prop->name, name)) { -+ if (streq(prop->name, name)) { - delete_property(prop); - return; - } -@@ -275,7 +275,7 @@ void delete_node_by_name(struct node *parent, char *name) - struct node *node = parent->children; - - while (node) { -- if (!strcmp(node->name, name)) { -+ if (streq(node->name, name)) { - delete_node(node); - return; - } -@@ -319,8 +319,8 @@ struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size) - - memset(new, 0, sizeof(*new)); - -- new->re.address = address; -- new->re.size = size; -+ new->address = address; -+ new->size = size; - - return new; - } -@@ -393,7 +393,7 @@ struct property *get_property(struct node *node, const char *propname) - cell_t propval_cell(struct property *prop) - { - assert(prop->val.len == sizeof(cell_t)); -- return fdt32_to_cpu(*((cell_t *)prop->val.val)); -+ return fdt32_to_cpu(*((fdt32_t *)prop->val.val)); - } - - struct property *get_property_by_label(struct node *tree, const char *label, @@ -478,7 +478,8 @@ struct node *get_node_by_path(struct node *tree, const char *path) p = strchr(path, '/'); @@ -2845,202 +1239,10 @@ index afa2f67b..aecd2787 100644 return get_node_by_path(child, p+1); else if (!p && streq(path, child->name)) return child; -@@ -599,13 +600,13 @@ static int cmp_reserve_info(const void *ax, const void *bx) - a = *((const struct reserve_info * const *)ax); - b = *((const struct reserve_info * const *)bx); - -- if (a->re.address < b->re.address) -+ if (a->address < b->address) - return -1; -- else if (a->re.address > b->re.address) -+ else if (a->address > b->address) - return 1; -- else if (a->re.size < b->re.size) -+ else if (a->size < b->size) - return -1; -- else if (a->re.size > b->re.size) -+ else if (a->size > b->size) - return 1; - else - return 0; -@@ -847,6 +848,8 @@ static void add_fixup_entry(struct dt_info *dti, struct node *fn, - xasprintf(&entry, "%s:%s:%u", - node->fullpath, prop->name, m->offset); - append_to_property(fn, m->ref, entry, strlen(entry) + 1); -+ -+ free(entry); - } - - static void generate_fixups_tree_internal(struct dt_info *dti, -@@ -900,7 +903,7 @@ static void add_local_fixup_entry(struct dt_info *dti, - struct node *refnode) - { - struct node *wn, *nwn; /* local fixup node, walk node, new */ -- uint32_t value_32; -+ fdt32_t value_32; - char **compp; - int i, depth; - -diff --git a/scripts/dtc/srcpos.c b/scripts/dtc/srcpos.c -index aa3aad04..9d384599 100644 ---- a/scripts/dtc/srcpos.c -+++ b/scripts/dtc/srcpos.c -@@ -252,7 +252,7 @@ srcpos_string(struct srcpos *pos) - const char *fname = ""; - char *pos_str; - -- if (pos) -+ if (pos->file && pos->file->name) - fname = pos->file->name; - - -diff --git a/scripts/dtc/srcpos.h b/scripts/dtc/srcpos.h -index 2cdfcd82..7caca825 100644 ---- a/scripts/dtc/srcpos.h -+++ b/scripts/dtc/srcpos.h -@@ -22,6 +22,7 @@ - - #include - #include -+#include "util.h" - - struct srcfile_state { - FILE *f; -@@ -106,12 +107,10 @@ extern void srcpos_update(struct srcpos *pos, const char *text, int len); - extern struct srcpos *srcpos_copy(struct srcpos *pos); - extern char *srcpos_string(struct srcpos *pos); - --extern void srcpos_verror(struct srcpos *pos, const char *prefix, -- const char *fmt, va_list va) -- __attribute__((format(printf, 3, 0))); --extern void srcpos_error(struct srcpos *pos, const char *prefix, -- const char *fmt, ...) -- __attribute__((format(printf, 3, 4))); -+extern void PRINTF(3, 0) srcpos_verror(struct srcpos *pos, const char *prefix, -+ const char *fmt, va_list va); -+extern void PRINTF(3, 4) srcpos_error(struct srcpos *pos, const char *prefix, -+ const char *fmt, ...); - - extern void srcpos_set_line(char *f, int l); - -diff --git a/scripts/dtc/treesource.c b/scripts/dtc/treesource.c -index c9d89679..2461a3d0 100644 ---- a/scripts/dtc/treesource.c -+++ b/scripts/dtc/treesource.c -@@ -137,7 +137,7 @@ static void write_propval_string(FILE *f, struct data val) - static void write_propval_cells(FILE *f, struct data val) - { - void *propend = val.val + val.len; -- cell_t *cp = (cell_t *)val.val; -+ fdt32_t *cp = (fdt32_t *)val.val; - struct marker *m = val.markers; - - fprintf(f, "<"); -@@ -275,8 +275,8 @@ void dt_to_source(FILE *f, struct dt_info *dti) - for_each_label(re->labels, l) - fprintf(f, "%s: ", l->label); - fprintf(f, "/memreserve/\t0x%016llx 0x%016llx;\n", -- (unsigned long long)re->re.address, -- (unsigned long long)re->re.size); -+ (unsigned long long)re->address, -+ (unsigned long long)re->size); - } - - write_tree_source_node(f, dti->dt, 0); -diff --git a/scripts/dtc/util.c b/scripts/dtc/util.c -index 3550f86b..9953c32a 100644 ---- a/scripts/dtc/util.c -+++ b/scripts/dtc/util.c -@@ -396,7 +396,7 @@ void utilfdt_print_data(const char *data, int len) - } while (s < data + len); - - } else if ((len % 4) == 0) { -- const uint32_t *cell = (const uint32_t *)data; -+ const fdt32_t *cell = (const fdt32_t *)data; - - printf(" = <"); - for (i = 0, len /= 4; i < len; i++) -@@ -412,15 +412,16 @@ void utilfdt_print_data(const char *data, int len) - } - } - --void util_version(void) -+void NORETURN util_version(void) - { - printf("Version: %s\n", DTC_VERSION); - exit(0); - } - --void util_usage(const char *errmsg, const char *synopsis, -- const char *short_opts, struct option const long_opts[], -- const char * const opts_help[]) -+void NORETURN util_usage(const char *errmsg, const char *synopsis, -+ const char *short_opts, -+ struct option const long_opts[], -+ const char * const opts_help[]) - { - FILE *fp = errmsg ? stderr : stdout; - const char a_arg[] = ""; -diff --git a/scripts/dtc/util.h b/scripts/dtc/util.h -index f5c4f1b5..ad5f4119 100644 ---- a/scripts/dtc/util.h -+++ b/scripts/dtc/util.h -@@ -25,9 +25,17 @@ - * USA - */ - -+#ifdef __GNUC__ -+#define PRINTF(i, j) __attribute__((format (printf, i, j))) -+#define NORETURN __attribute__((noreturn)) -+#else -+#define PRINTF(i, j) -+#define NORETURN -+#endif -+ - #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - --static inline void __attribute__((noreturn)) die(const char *str, ...) -+static inline void NORETURN PRINTF(1, 2) die(const char *str, ...) - { - va_list ap; - -@@ -53,13 +61,14 @@ static inline void *xrealloc(void *p, size_t len) - void *new = realloc(p, len); - - if (!new) -- die("realloc() failed (len=%d)\n", len); -+ die("realloc() failed (len=%zd)\n", len); - - return new; - } - - extern char *xstrdup(const char *s); --extern int xasprintf(char **strp, const char *fmt, ...); -+ -+extern int PRINTF(2, 3) xasprintf(char **strp, const char *fmt, ...); - extern char *join_path(const char *path, const char *name); - - /** -@@ -188,7 +197,7 @@ void utilfdt_print_data(const char *data, int len); - /** - * Show source version and exit - */ --void util_version(void) __attribute__((noreturn)); -+void NORETURN util_version(void); - - /** - * Show usage and exit -@@ -202,9 +211,10 @@ void util_version(void) __attribute__((noreturn)); - * @param long_opts The structure of long options - * @param opts_help An array of help strings (should align with long_opts) - */ --void util_usage(const char *errmsg, const char *synopsis, -- const char *short_opts, struct option const long_opts[], -- const char * const opts_help[]) __attribute__((noreturn)); -+void NORETURN util_usage(const char *errmsg, const char *synopsis, -+ const char *short_opts, -+ struct option const long_opts[], -+ const char * const opts_help[]); - - /** - * Show usage and exit +diff --git a/scripts/dtc/version_gen.h b/scripts/dtc/version_gen.h +index 1229e07b..f63127a4 100644 +--- a/scripts/dtc/version_gen.h ++++ b/scripts/dtc/version_gen.h +@@ -1 +1 @@ +-#define DTC_VERSION "DTC 1.4.4-g756ffc4f" ++#define DTC_VERSION "DTC 1.4.4-gd990b801"