From cd3bbb525fb94314c0f89bda8211e93327331b1d Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Tue, 11 Feb 2020 17:26:30 +0800 Subject: [PATCH 1/2] at91: switch to 4.14 (#3040) --- target/linux/at91/Makefile | 7 +- target/linux/at91/{config-4.9 => config-4.14} | 156 +-- .../at91/files/arch/arm/boot/dts/wb45n.dts | 2 +- .../at91/files/arch/arm/boot/dts/wb50n.dts | 2 +- target/linux/at91/image/Makefile | 47 +- .../linux/at91/image/gen_at91_sdcard_img.sh | 4 +- .../linux/at91/image/{legacy.mk => sam9x.mk} | 103 +- target/linux/at91/image/sama5.mk | 123 +++ target/linux/at91/image/sama5d2.mk | 31 - target/linux/at91/image/sama5d3.mk | 33 - target/linux/at91/image/sama5d4.mk | 19 - target/linux/at91/image/uboot-env.txt | 14 + target/linux/at91/legacy/target.mk | 7 - .../100-ARM-at91-build-dtb-for-LMU5000.patch | 2 +- .../101-ARM-at91-build-dtb-for-q5xr5.patch | 2 +- .../102-ARM-at91-build-dtb-for-wb45n.patch | 4 +- .../103-ARM-at91-build-dtb-for-wb50n.patch | 2 +- ...RM-at91-build-dtb-for-sama5d2-ptc-Ek.patch | 5 +- ...-at91-build-dtb-for-sama5d27-SOM1-Ek.patch | 893 ------------------ .../at91/{legacy => sam9x}/config-default | 28 +- target/linux/at91/sam9x/target.mk | 7 + target/linux/at91/sama5/config-default | 0 target/linux/at91/sama5/target.mk | 10 + target/linux/at91/sama5d2/config-default | 44 - target/linux/at91/sama5d2/target.mk | 10 - target/linux/at91/sama5d3/config-default | 39 - target/linux/at91/sama5d3/target.mk | 10 - target/linux/at91/sama5d4/config-default | 39 - target/linux/at91/sama5d4/target.mk | 10 - 29 files changed, 350 insertions(+), 1303 deletions(-) rename target/linux/at91/{config-4.9 => config-4.14} (84%) rename target/linux/at91/image/{legacy.mk => sam9x.mk} (51%) create mode 100644 target/linux/at91/image/sama5.mk delete mode 100644 target/linux/at91/image/sama5d2.mk create mode 100644 target/linux/at91/image/uboot-env.txt delete mode 100644 target/linux/at91/legacy/target.mk rename target/linux/at91/{patches-4.9 => patches-4.14}/100-ARM-at91-build-dtb-for-LMU5000.patch (80%) rename target/linux/at91/{patches-4.9 => patches-4.14}/101-ARM-at91-build-dtb-for-q5xr5.patch (82%) rename target/linux/at91/{patches-4.9 => patches-4.14}/102-ARM-at91-build-dtb-for-wb45n.patch (74%) rename target/linux/at91/{patches-4.9 => patches-4.14}/103-ARM-at91-build-dtb-for-wb50n.patch (85%) rename target/linux/at91/{patches-4.9 => patches-4.14}/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch (98%) delete mode 100644 target/linux/at91/patches-4.9/104-ARM-at91-build-dtb-for-sama5d27-SOM1-Ek.patch rename target/linux/at91/{legacy => sam9x}/config-default (68%) create mode 100644 target/linux/at91/sam9x/target.mk create mode 100644 target/linux/at91/sama5/config-default create mode 100644 target/linux/at91/sama5/target.mk delete mode 100644 target/linux/at91/sama5d2/config-default delete mode 100644 target/linux/at91/sama5d2/target.mk delete mode 100644 target/linux/at91/sama5d3/config-default delete mode 100644 target/linux/at91/sama5d3/target.mk delete mode 100644 target/linux/at91/sama5d4/config-default delete mode 100644 target/linux/at91/sama5d4/target.mk diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile index d71e0850ff..6c1ba11c55 100644 --- a/target/linux/at91/Makefile +++ b/target/linux/at91/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=at91 -MAINTAINER:=Claudio Mignanti +MAINTAINER:=Claudio Mignanti \ + Sandeep Sheriker BOARDNAME:=Microchip (Atmel AT91) FEATURES:=ext4 squashfs targz usb usbgadget ubifs -SUBTARGETS:=sama5d2 sama5d3 sama5d4 legacy +SUBTARGETS:=sama5 sam9x -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.14 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/at91/config-4.9 b/target/linux/at91/config-4.14 similarity index 84% rename from target/linux/at91/config-4.9 rename to target/linux/at91/config-4.14 index 308b346161..b1b49054ab 100644 --- a/target/linux/at91/config-4.9 +++ b/target/linux/at91/config-4.14 @@ -1,15 +1,23 @@ CONFIG_ALIGNMENT_TRAP=y CONFIG_ARCH_AT91=y CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_SET_MEMORY=y CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MULTIPLATFORM=y # CONFIG_ARCH_MULTI_CPU_AUTO is not set +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y @@ -35,44 +43,49 @@ CONFIG_ARM_UNWIND=y CONFIG_ARM_VIRT_EXT=y CONFIG_AT91SAM9X_WATCHDOG=y CONFIG_AT91_ADC=y +CONFIG_AT91_SAMA5D2_ADC=y +CONFIG_AT91_SOC_ID=y CONFIG_ATMEL_AIC5_IRQ=y CONFIG_ATMEL_EBI=y CONFIG_ATMEL_PIT=y +CONFIG_ATMEL_PM=y CONFIG_ATMEL_SDRAMC=y CONFIG_ATMEL_SSC=y CONFIG_ATMEL_TCB_CLKSRC=y CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0 CONFIG_ATMEL_TCLIB=y CONFIG_AT_HDMAC=y -# CONFIG_AT_XDMAC is not set +CONFIG_AT_XDMAC=y CONFIG_AUTO_ZRELADDR=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BACKLIGHT_PWM=y -# CONFIG_BLK_CGROUP is not set +CONFIG_BATTERY_ACT8945A=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=4 CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_SD=y -# CONFIG_BPF_SYSCALL is not set -# CONFIG_BRIDGE is not set +CONFIG_BLK_SCSI_REQUEST=y CONFIG_CACHE_L2X0=y CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLKSRC_OF=y -CONFIG_CLKSRC_PROBE=y CONFIG_CLONE_BACKWARDS=y CONFIG_CMA=y +CONFIG_CMA_ALIGNMENT=8 CONFIG_CMA_AREAS=7 # CONFIG_CMA_DEBUG is not set # CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_SIZE_MBYTES=16 +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw" CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_AT91=y CONFIG_CONFIGFS_FS=y CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_COREDUMP=y -# CONFIG_CPUSETS is not set CONFIG_CPU_32v6K=y CONFIG_CPU_32v7=y CONFIG_CPU_ABRT_EV7=y @@ -86,14 +99,20 @@ CONFIG_CPU_HAS_ASID=y # CONFIG_CPU_ICACHE_DISABLE is not set CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_PABRT_V7=y CONFIG_CPU_PM=y +CONFIG_CPU_SPECTRE=y +CONFIG_CPU_THUMB_CAPABLE=y CONFIG_CPU_TLB_V7=y CONFIG_CPU_V7=y +CONFIG_CRASH_CORE=y +CONFIG_CRASH_DUMP=y CONFIG_CRC16=y # CONFIG_CRC32_SARWATE is not set CONFIG_CRC32_SLICEBY8=y CONFIG_CROSS_MEMORY_ATTACH=y +CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_CCM=y @@ -123,14 +142,13 @@ CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_WORKQUEUE=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +CONFIG_DEBUG_MEMORY_INIT=y # CONFIG_DEBUG_UART_8250 is not set CONFIG_DEBUG_USER=y CONFIG_DEFAULT_IOSCHED="noop" CONFIG_DEFAULT_NOOP=y -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y CONFIG_DMADEVICES=y -# CONFIG_DMA_CMA is not set +CONFIG_DMA_CMA=y CONFIG_DMA_ENGINE=y CONFIG_DMA_OF=y CONFIG_DMA_SHARED_BUFFER=y @@ -139,13 +157,14 @@ CONFIG_DRM=y CONFIG_DRM_ATMEL_HLCDC=y CONFIG_DRM_BRIDGE=y CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 CONFIG_DRM_GEM_CMA_HELPER=y CONFIG_DRM_KMS_CMA_HELPER=y CONFIG_DRM_KMS_FB_HELPER=y CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y CONFIG_DRM_PANEL_SIMPLE=y -CONFIG_DST_CACHE=y CONFIG_DTC=y CONFIG_DUMMY_CONSOLE=y CONFIG_EDAC_ATOMIC_SCRUB=y @@ -153,9 +172,7 @@ CONFIG_EDAC_SUPPORT=y CONFIG_EEPROM_AT24=y CONFIG_ELF_CORE=y CONFIG_ENABLE_MUST_CHECK=y -CONFIG_EXPORTFS=y CONFIG_EXT4_FS=y -CONFIG_FANOTIFY=y CONFIG_FAT_FS=y CONFIG_FB=y # CONFIG_FB_ATMEL is not set @@ -164,22 +181,21 @@ CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_CMDLINE=y CONFIG_FB_DEFERRED_IO=y +# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set CONFIG_FB_SYS_COPYAREA=y CONFIG_FB_SYS_FILLRECT=y CONFIG_FB_SYS_FOPS=y CONFIG_FB_SYS_IMAGEBLIT=y -CONFIG_FHANDLE=y CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_FORCE_MAX_ZONEORDER=15 -CONFIG_FRAME_VECTOR=y CONFIG_FREEZER=y CONFIG_FS_MBCACHE=y -# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CPU_AUTOPROBE=y CONFIG_GENERIC_EARLY_IOREMAP=y CONFIG_GENERIC_IDLE_POLL_SETUP=y CONFIG_GENERIC_IO=y @@ -192,10 +208,11 @@ CONFIG_GENERIC_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GLOB=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_SYSFS=y -CONFIG_GRACE_PERIOD=y +# CONFIG_GRO_CELLS is not set CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y @@ -211,13 +228,13 @@ CONFIG_HAVE_ARCH_PFN_VALID=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y CONFIG_HAVE_ARCH_TRACEHOOK=y CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_AT91_AUDIO_PLL=y CONFIG_HAVE_AT91_GENERATED_CLK=y CONFIG_HAVE_AT91_H32MX=y CONFIG_HAVE_AT91_SMD=y CONFIG_HAVE_AT91_USB_CLK=y CONFIG_HAVE_AT91_UTMI=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_CBPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CLK=y CONFIG_HAVE_CLK_PREPARE=y @@ -227,6 +244,8 @@ CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DMA_API_DEBUG=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_EBPF_JIT=y CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y CONFIG_HAVE_FB_ATMEL=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y @@ -255,7 +274,6 @@ CONFIG_HW_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_ATMEL=y CONFIG_HZ_FIXED=0 -CONFIG_HZ_PERIODIC=y CONFIG_I2C=y CONFIG_I2C_ALGOBIT=y CONFIG_I2C_AT91=y @@ -277,10 +295,6 @@ CONFIG_INPUT_LEDS=y CONFIG_INPUT_TOUCHSCREEN=y CONFIG_IOMMU_HELPER=y # CONFIG_IOSCHED_DEADLINE is not set -CONFIG_IP_PNP=y -# CONFIG_IP_PNP_BOOTP is not set -CONFIG_IP_PNP_DHCP=y -# CONFIG_IP_PNP_RARP is not set CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_DEBUG=y @@ -294,31 +308,33 @@ CONFIG_KEXEC=y CONFIG_KEXEC_CORE=y CONFIG_KEYBOARD_GPIO=y CONFIG_KEYBOARD_QT1070=y -# CONFIG_LCD_PLATFORM is not set +# CONFIG_LCD_CLASS_DEVICE is not set CONFIG_LEDS_GPIO=y CONFIG_LEDS_PWM=y CONFIG_LEDS_TRIGGER_CPU=y # CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set CONFIG_LEDS_TRIGGER_GPIO=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=4 CONFIG_LIBFDT=y CONFIG_LOCALVERSION_AUTO=y -CONFIG_LOCKD=y CONFIG_LOG_BUF_SHIFT=16 CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_MACB=y +CONFIG_MACB_USE_HWSTAMP=y +CONFIG_MAGIC_SYSRQ=y CONFIG_MANDATORY_FILE_LOCKING=y -CONFIG_MDIO_BOARDINFO=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_SUPPORT=y CONFIG_MEDIA_USB_SUPPORT=y -# CONFIG_MEMCG is not set CONFIG_MEMORY=y CONFIG_MEMORY_ISOLATION=y +CONFIG_MFD_ACT8945A=y +CONFIG_MFD_ATMEL_FLEXCOM=y CONFIG_MFD_ATMEL_HLCDC=y +CONFIG_MFD_ATMEL_SMC=y CONFIG_MFD_CORE=y CONFIG_MFD_SYSCON=y CONFIG_MICREL_PHY=y @@ -328,16 +344,20 @@ CONFIG_MIGRATION=y CONFIG_MMC=y CONFIG_MMC_ATMELMCI=y CONFIG_MMC_BLOCK=y -# CONFIG_MMC_BLOCK_BOUNCE is not set +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_OF_AT91=y +CONFIG_MMC_SDHCI_PLTFM=y CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MTD_CFI_AMDSTD is not set # CONFIG_MTD_CFI_INTELEXT is not set CONFIG_MTD_CMDLINE_PARTS=y # CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_M25P80=y CONFIG_MTD_NAND=y CONFIG_MTD_NAND_ATMEL=y CONFIG_MTD_NAND_ECC=y # CONFIG_MTD_PHYSMAP_OF is not set +CONFIG_MTD_SPI_NOR=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 # CONFIG_MTD_UBI_BLOCK is not set @@ -354,6 +374,8 @@ CONFIG_NLS_CODEPAGE_850=y CONFIG_NLS_ISO8859_1=y CONFIG_NLS_UTF8=y CONFIG_NO_BOOTMEM=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y CONFIG_NVMEM=y CONFIG_OF=y CONFIG_OF_ADDRESS=y @@ -369,9 +391,6 @@ CONFIG_OLD_SIGSUSPEND3=y CONFIG_OUTER_CACHE=y CONFIG_OUTER_CACHE_SYNC=y CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -CONFIG_PANIC_TIMEOUT=0 # CONFIG_PARTITION_ADVANCED is not set # CONFIG_PCI_DOMAINS_GENERIC is not set # CONFIG_PCI_SYSCALL is not set @@ -396,32 +415,34 @@ CONFIG_PM_SLEEP_DEBUG=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_AT91_POWEROFF=y CONFIG_POWER_RESET_AT91_RESET=y -# CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC is not set +CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y CONFIG_POWER_SUPPLY=y # CONFIG_PREVENT_FIRMWARE_BUILD is not set -CONFIG_PROC_PAGE_MONITOR=y +CONFIG_PRINTK_TIME=y +CONFIG_PROC_VMCORE=y CONFIG_PWM=y CONFIG_PWM_ATMEL=y CONFIG_PWM_ATMEL_HLCDC_PWM=y CONFIG_PWM_ATMEL_TCB=y CONFIG_PWM_SYSFS=y CONFIG_RATIONAL=y -# CONFIG_RCU_EXPERT is not set +# CONFIG_RCU_NEED_SEGCBLIST is not set # CONFIG_RCU_STALL_COMMON is not set CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y CONFIG_REGMAP_MMIO=y CONFIG_REGMAP_SPI=y CONFIG_REGULATOR=y +CONFIG_REGULATOR_ACT8865=y +CONFIG_REGULATOR_ACT8945A=y CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_ROOT_NFS=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AT91RM9200=y # CONFIG_RTC_DRV_AT91SAM9 is not set # CONFIG_RTC_DRV_CMOS is not set CONFIG_RTC_I2C_AND_SPI=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y -# CONFIG_SAMA5D4_WATCHDOG is not set +CONFIG_SAMA5D4_WATCHDOG=y # CONFIG_SCHED_INFO is not set CONFIG_SCSI=y # CONFIG_SCSI_LOWLEVEL is not set @@ -432,19 +453,18 @@ CONFIG_SERIAL_ATMEL_PDC=y # CONFIG_SERIAL_ATMEL_TTYAT is not set CONFIG_SERIAL_MCTRL_GPIO=y CONFIG_SG_POOL=y -CONFIG_SLAB=y -# CONFIG_SLUB is not set CONFIG_SND=y CONFIG_SND_ARM=y # CONFIG_SND_AT73C213 is not set # CONFIG_SND_AT91_SOC_SAM9G20_WM8731 is not set # CONFIG_SND_AT91_SOC_SAM9X5_WM8731 is not set CONFIG_SND_ATMEL_SOC=y -# CONFIG_SND_ATMEL_SOC_CLASSD is not set +CONFIG_SND_ATMEL_SOC_CLASSD=y CONFIG_SND_ATMEL_SOC_DMA=y # CONFIG_SND_ATMEL_SOC_PDMIC is not set CONFIG_SND_ATMEL_SOC_SSC=y CONFIG_SND_ATMEL_SOC_SSC_DMA=y +# CONFIG_SND_ATMEL_SOC_TSE850_PCM5142 is not set CONFIG_SND_ATMEL_SOC_WM8904=y # CONFIG_SND_COMPRESS_OFFLOAD is not set CONFIG_SND_DMAENGINE_PCM=y @@ -460,76 +480,61 @@ CONFIG_SND_SPI=y CONFIG_SND_SUPPORT_OLD_API=y CONFIG_SND_TIMER=y CONFIG_SOC_BUS=y -# CONFIG_SOC_SAMA5D2 is not set -# CONFIG_SOC_SAMA5D3 is not set -# CONFIG_SOC_SAMA5D4 is not set +CONFIG_SOC_SAMA5=y +CONFIG_SOC_SAMA5D2=y +CONFIG_SOC_SAMA5D3=y +CONFIG_SOC_SAMA5D4=y +CONFIG_SOC_SAM_V7=y CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +# CONFIG_SOUND_OSS_CORE_PRECLAIM is not set CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_ATMEL=y +CONFIG_SPI_ATMEL_QUADSPI=y CONFIG_SPI_BITBANG=y CONFIG_SPI_GPIO=y CONFIG_SPI_MASTER=y # CONFIG_SQUASHFS is not set CONFIG_SRAM=y +CONFIG_SRAM_EXEC=y CONFIG_SRCU=y -# CONFIG_STAGING is not set # CONFIG_STANDALONE is not set -CONFIG_SUNRPC=y CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y -# CONFIG_SWAP is not set CONFIG_SWIOTLB=y CONFIG_SWPHY=y # CONFIG_SWP_EMULATE is not set -# CONFIG_SYN_COOKIES is not set -CONFIG_SYSFS_SYSCALL=y +CONFIG_SYNC_FILE=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y -# CONFIG_TCP_CONG_ADVANCED is not set # CONFIG_THUMB2_KERNEL is not set CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_TMPFS_XATTR is not set +CONFIG_TIMER_OF=y +CONFIG_TIMER_PROBE=y +CONFIG_TINY_SRCU=y +CONFIG_TOUCHSCREEN_ATMEL_MXT=y CONFIG_TOUCHSCREEN_PROPERTIES=y CONFIG_UACCESS_WITH_MEMCPY=y CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y CONFIG_UBIFS_FS_ZLIB=y -# CONFIG_UEVENT_HELPER is not set CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_USB=y CONFIG_USB_ACM=y CONFIG_USB_ANNOUNCE_NEW_DEVICES=y # CONFIG_USB_AT91 is not set -# CONFIG_USB_AUDIO is not set +# CONFIG_USB_ATMEL_USBA is not set CONFIG_USB_COMMON=y -CONFIG_USB_CONFIGFS_ACM=y -# CONFIG_USB_CONFIGFS_ECM is not set -# CONFIG_USB_CONFIGFS_ECM_SUBSET is not set -# CONFIG_USB_CONFIGFS_EEM is not set -# CONFIG_USB_CONFIGFS_F_FS is not set -# CONFIG_USB_CONFIGFS_F_HID is not set -# CONFIG_USB_CONFIGFS_F_LB_SS is not set -# CONFIG_USB_CONFIGFS_F_MIDI is not set -# CONFIG_USB_CONFIGFS_F_PRINTER is not set -# CONFIG_USB_CONFIGFS_F_UAC1 is not set -# CONFIG_USB_CONFIGFS_F_UAC2 is not set -# CONFIG_USB_CONFIGFS_F_UVC is not set -CONFIG_USB_CONFIGFS_MASS_STORAGE=y -# CONFIG_USB_CONFIGFS_NCM is not set -# CONFIG_USB_CONFIGFS_OBEX is not set -# CONFIG_USB_CONFIGFS_RNDIS is not set -# CONFIG_USB_CONFIGFS_SERIAL is not set CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_HCD_AT91=y # CONFIG_USB_EHCI_HCD_PLATFORM is not set # CONFIG_USB_EHCI_ROOT_HUB_TT is not set -# CONFIG_USB_ETH is not set CONFIG_USB_GADGET=y CONFIG_USB_HID=y CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_HCD_AT91=y -# CONFIG_USB_OHCI_HCD_PLATFORM is not set +CONFIG_USB_OHCI_HCD_PLATFORM=y # CONFIG_USB_PWC is not set CONFIG_USB_SERIAL=y # CONFIG_USB_SERIAL_CONSOLE is not set @@ -544,17 +549,12 @@ CONFIG_VFAT_FS=y CONFIG_VFP=y CONFIG_VFPv3=y CONFIG_VIDEOMODE_HELPERS=y +# CONFIG_VIDEO_ATMEL_ISI is not set # CONFIG_VIDEO_CPIA2 is not set CONFIG_VIDEO_DEV=y CONFIG_VIDEO_V4L2=y -# CONFIG_VLAN_8021Q is not set CONFIG_VM_EVENT_COUNTERS=y -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_CONSOLE_SLEEP=y -# CONFIG_VT_HW_CONSOLE_BINDING is not set CONFIG_WATCHDOG_CORE=y -# CONFIG_WLAN is not set # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts b/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts index 2d1fe0c083..1f51893ce3 100644 --- a/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts +++ b/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts @@ -206,7 +206,7 @@ atheros,board-id = "SD32"; }; - gpio_keys { + keys { compatible = "gpio-keys"; #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts index 4101baf64a..febd76b874 100644 --- a/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts +++ b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts @@ -73,7 +73,7 @@ }; }; - gpio_keys { + keys { compatible = "gpio-keys"; #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile index 49d93aa97d..adb7c6d0ba 100644 --- a/target/linux/at91/image/Makefile +++ b/target/linux/at91/image/Makefile @@ -13,17 +13,11 @@ define Build/at91-install-zImage $(CP) $(KDIR)/zImage $@ endef -ifeq ($(SUBTARGET),legacy) -include ./legacy.mk +ifeq ($(SUBTARGET),sam9x) +include ./sam9x.mk endif -ifeq ($(SUBTARGET),sama5d2) -include ./sama5d2.mk -endif -ifeq ($(SUBTARGET),sama5d3) -include ./sama5d3.mk -endif -ifeq ($(SUBTARGET),sama5d4) -include ./sama5d4.mk +ifeq ($(SUBTARGET),sama5) +include ./sama5.mk endif AT91_SD_BOOT_PARTSIZE:=64 @@ -46,37 +40,6 @@ define Device/dtb KERNEL := kernel-bin | lzma | uImage lzma endef -define Build/at91-sdcard - $(if $(findstring ext4,$@), \ - rm -f $@.boot - mkfs.fat -C $@.boot $(FAT32_BLOCKS) - - mcopy -i $@.boot $(KDIR)/zImage ::zImage - - $(foreach dts,$(DEVICE_DTS), \ - mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb \ - ::$(dts).dtb) - - mcopy -i $@.boot \ - $(BIN_DIR)/u-boot-$(DEVICE_NAME:at91-%=%)_mmc/u-boot.bin \ - ::u-boot.bin - - mcopy -i $@.boot \ - $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd*/at91bootstrap.bin \ - ::BOOT.bin - - ./gen_at91_sdcard_img.sh \ - $@.img \ - $@.boot \ - $(KDIR)/root.ext4 \ - $(AT91_SD_BOOT_PARTSIZE) \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) - - gzip -nc9 $@.img > $@ - - rm -f $@.img $@.boot ) -endef - define Device/evaluation-sdimage IMAGES += sdcard.img.gz IMAGE/sdcard.img.gz := at91-sdcard @@ -100,6 +63,8 @@ define Device/evaluation-dtb $(Device/evaluation-zImage) IMAGES += dtb IMAGE/dtb := install-dtb + KERNEL_SUFFIX := -fit-zImage.itb + KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb endef define Device/evaluation-fit diff --git a/target/linux/at91/image/gen_at91_sdcard_img.sh b/target/linux/at91/image/gen_at91_sdcard_img.sh index 316ecea2e4..5171b6723e 100755 --- a/target/linux/at91/image/gen_at91_sdcard_img.sh +++ b/target/linux/at91/image/gen_at91_sdcard_img.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # # Copyright (C) 2017 OpenWrt.org @@ -22,7 +22,7 @@ ROOTFSSIZE="$5" head=4 sect=2048 -set `ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M` +set $(ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M) BOOTOFFSET="$(($1 / 512))" BOOTSIZE="$(($2 / 512))" diff --git a/target/linux/at91/image/legacy.mk b/target/linux/at91/image/sam9x.mk similarity index 51% rename from target/linux/at91/image/legacy.mk rename to target/linux/at91/image/sam9x.mk index ae3c163d94..8fd6b4506f 100644 --- a/target/linux/at91/image/legacy.mk +++ b/target/linux/at91/image/sam9x.mk @@ -5,63 +5,114 @@ define Device/default-nand MKUBIFS_OPTS := -m $$(PAGESIZE) -e 126KiB -c 2048 endef +define Build/at91-sdcard + $(if $(findstring ext4,$@), \ + rm -f $@.boot + mkfs.fat -C $@.boot $(FAT32_BLOCKS) + + mcopy -i $@.boot \ + $(KDIR)/$(DEVICE_NAME)-fit-zImage.itb \ + ::$(DEVICE_NAME)-fit.itb + + mcopy -i $@.boot \ + $(BIN_DIR)/u-boot-at91sam9x5ek_mmc/u-boot.bin \ + ::u-boot.bin + + mcopy -i $@.boot \ + $(BIN_DIR)/at91bootstrap-at91sam9x5eksd_uboot/at91bootstrap.bin \ + ::BOOT.bin + + $(CP) uboot-env.txt $@-uboot-env.txt + sed -i '2d;3d' $@-uboot-env.txt + sed -i '2i board='"$(DEVICE_NAME)"'' $@-uboot-env.txt + sed -i '3i board_name='"$(DEVICE_NAME)"'' $@-uboot-env.txt + + mkenvimage -s 0x4000 -o $@-uboot.env $@-uboot-env.txt + + mcopy -i $@.boot $@-uboot.env ::uboot.env + + ./gen_at91_sdcard_img.sh \ + $@.img \ + $@.boot \ + $(KDIR)/root.ext4 \ + $(AT91_SD_BOOT_PARTSIZE) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) + + gzip -nc9 $@.img > $@ + + rm -f $@.img $@.boot $@-uboot.env $@-uboot-env.txt) +endef + define Device/at91sam9263ek $(Device/evaluation-dtb) - DEVICE_TITLE := Atmel AT91SAM9263-EK + DEVICE_VENDOR := Atmel + DEVICE_MODEL := AT91SAM9263-EK endef TARGET_DEVICES += at91sam9263ek define Device/at91sam9g15ek $(Device/evaluation) - DEVICE_TITLE := Atmel AT91SAM9G15-EK + DEVICE_VENDOR := Atmel + DEVICE_MODEL := AT91SAM9G15-EK endef TARGET_DEVICES += at91sam9g15ek define Device/at91sam9g20ek $(Device/evaluation-dtb) - DEVICE_TITLE := Atmel AT91SAM9G20-EK + DEVICE_VENDOR := Atmel + DEVICE_MODEL := AT91SAM9G20-EK endef TARGET_DEVICES += at91sam9g20ek define Device/at91sam9g20ek_2mmc $(Device/evaluation-dtb) - DEVICE_TITLE := Atmel AT91SAM9G20-EK 2MMC + DEVICE_VENDOR := Atmel + DEVICE_MODEL := AT91SAM9G20-EK + DEVICE_VARIANT := 2MMC endef TARGET_DEVICES += at91sam9g20ek_2mmc define Device/at91sam9g25ek $(Device/evaluation) - DEVICE_TITLE := Atmel AT91SAM9G25-EK + DEVICE_VENDOR := Atmel + DEVICE_MODEL := AT91SAM9G25-EK endef TARGET_DEVICES += at91sam9g25ek define Device/at91sam9g35ek $(Device/evaluation) - DEVICE_TITLE := Atmel AT91SAM9G35-EK + DEVICE_VENDOR := Atmel + DEVICE_MODEL := AT91SAM9G35-EK endef TARGET_DEVICES += at91sam9g35ek define Device/at91sam9m10g45ek $(Device/evaluation) - DEVICE_TITLE := Atmel AT91SAM9M10G45-EK + DEVICE_VENDOR := Atmel + DEVICE_MODEL := AT91SAM9M10G45-EK endef TARGET_DEVICES += at91sam9m10g45ek define Device/at91sam9x25ek - $(Device/evaluation) - DEVICE_TITLE := Atmel AT91SAM9X25-EK + $(Device/evaluation-dtb) + DEVICE_VENDOR := Atmel + DEVICE_MODEL := AT91SAM9X25-EK + $(Device/evaluation-sdimage) endef TARGET_DEVICES += at91sam9x25ek define Device/at91sam9x35ek - $(Device/evaluation) - DEVICE_TITLE := Atmel AT91SAM9X35-EK + $(Device/evaluation-dtb) + DEVICE_VENDOR := Atmel + DEVICE_MODEL := AT91SAM9X35-EK + $(Device/evaluation-sdimage) endef TARGET_DEVICES += at91sam9x35ek define Device/lmu5000 $(Device/production) - DEVICE_TITLE := CalAmp LMU5000 + DEVICE_VENDOR := CalAmp + DEVICE_MODEL := LMU5000 DEVICE_PACKAGES := kmod-rtc-pcf2123 kmod-usb-acm kmod-usb-serial \ kmod-usb-serial-option kmod-usb-serial-sierrawireless kmod-gpio-mcp23s08 endef @@ -69,57 +120,66 @@ TARGET_DEVICES += lmu5000 define Device/tny_a9260 $(Device/production-dtb) - DEVICE_TITLE := Calao TNYA9260 + DEVICE_VENDOR := Calao + DEVICE_MODEL := TNYA9260 endef TARGET_DEVICES += tny_a9260 define Device/tny_a9263 $(Device/production-dtb) - DEVICE_TITLE := Calao TNYA9263 + DEVICE_VENDOR := Calao + DEVICE_MODEL := TNYA9263 endef TARGET_DEVICES += tny_a9263 define Device/tny_a9g20 $(Device/production-dtb) - DEVICE_TITLE := Calao TNYA9G20 + DEVICE_VENDOR := Calao + DEVICE_MODEL := TNYA9G20 endef TARGET_DEVICES += tny_a9g20 define Device/usb_a9260 $(Device/production-dtb) - DEVICE_TITLE := Calao USBA9260 + DEVICE_VENDOR := Calao + DEVICE_MODEL := USBA9260 endef TARGET_DEVICES += usb_a9260 define Device/usb_a9263 $(Device/production-dtb) - DEVICE_TITLE := Calao USBA9263 + DEVICE_VENDOR := Calao + DEVICE_MODEL := USBA9263 endef TARGET_DEVICES += usb_a9263 define Device/usb_a9g20 $(Device/production-dtb) - DEVICE_TITLE := Calao USBA9G20 + DEVICE_VENDOR := Calao + DEVICE_MODEL := USBA9G20 endef TARGET_DEVICES += usb_a9g20 define Device/ethernut5 $(Device/evaluation) - DEVICE_TITLE := Ethernut 5 + DEVICE_VENDOR := egnite + DEVICE_MODEL := Ethernut 5 UBINIZE_OPTS := -E 5 endef TARGET_DEVICES += ethernut5 define Device/at91-q5xr5 $(Device/production-dtb) - DEVICE_TITLE := Exegin Q5XR5 + DEVICE_VENDOR := Exegin + DEVICE_MODEL := Q5XR5 KERNEL_SIZE := 2048k endef #TARGET_DEVICES += at91-q5xr5 define Device/wb45n $(Device/evaluation-fit) - DEVICE_TITLE := Laird WB45N + DEVICE_VENDOR := Laird + DEVICE_MODEL := WB45N DEVICE_PACKAGES := \ kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \ kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \ @@ -130,4 +190,3 @@ define Device/wb45n MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955 endef TARGET_DEVICES += wb45n - diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk new file mode 100644 index 0000000000..527ee7022a --- /dev/null +++ b/target/linux/at91/image/sama5.mk @@ -0,0 +1,123 @@ +define Device/default-nand + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048 +endef + +define Build/at91-sdcard + $(if $(findstring ext4,$@), \ + rm -f $@.boot + mkfs.fat -C $@.boot $(FAT32_BLOCKS) + + mcopy -i $@.boot \ + $(KDIR)/$(DEVICE_NAME)-fit-zImage.itb \ + ::$(DEVICE_NAME:at91-%=%)-fit.itb + + $(if $(findstring at91-sama5d27_som1_ek,$@), \ + mcopy -i $@.boot \ + $(BIN_DIR)/u-boot-$(DEVICE_NAME:at91-%=%)_mmc1/u-boot.bin \ + ::u-boot.bin + mcopy -i $@.boot \ + $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd1_uboot/at91bootstrap.bin \ + ::BOOT.bin, + mcopy -i $@.boot \ + $(BIN_DIR)/u-boot-$(DEVICE_NAME:at91-%=%)_mmc/u-boot.bin \ + ::u-boot.bin + $(if $(findstring sama5d4_xplained, $@), \ + mcopy -i $@.boot \ + $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd_uboot_secure/at91bootstrap.bin \ + ::BOOT.bin, + mcopy -i $@.boot \ + $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd_uboot/at91bootstrap.bin \ + ::BOOT.bin)) + + $(CP) uboot-env.txt $@-uboot-env.txt + sed -i '2d;3d' $@-uboot-env.txt + sed -i '2i board='"$(DEVICE_NAME:at91-%=%)"'' $@-uboot-env.txt + sed -i '3i board_name='"$(DEVICE_NAME:at91-%=%)"'' $@-uboot-env.txt + + mkenvimage -s 0x4000 -o $@-uboot.env $@-uboot-env.txt + + mcopy -i $@.boot $@-uboot.env ::uboot.env + + ./gen_at91_sdcard_img.sh \ + $@.img \ + $@.boot \ + $(KDIR)/root.ext4 \ + $(AT91_SD_BOOT_PARTSIZE) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) + + gzip -nc9 $@.img > $@ + + rm -f $@.img $@.boot $@-uboot.env $@-uboot-env.txt) +endef + +define Device/at91-sama5d2_xplained + $(Device/evaluation-dtb) + DEVICE_VENDOR := Microchip + DEVICE_MODEL := SAMA5D2 Xplained + KERNEL_SIZE := 6144k + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d2_xplained + +define Device/at91-sama5d27_som1_ek + $(Device/evaluation-dtb) + DEVICE_VENDOR := Microchip + DEVICE_MODEL := SAMA5D27 SOM1 Ek + KERNEL_SIZE := 6144k + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d27_som1_ek + +define Device/at91-sama5d2_ptc_ek + $(Device/evaluation-dtb) + DEVICE_VENDOR := Microchip + DEVICE_MODEL := SAMA5D2 PTC Ek + KERNEL_SIZE := 6144k + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d2_ptc_ek + + +define Device/at91-sama5d3_xplained + $(Device/evaluation-dtb) + DEVICE_VENDOR := Microchip + DEVICE_MODEL := SAMA5D3 Xplained + KERNEL_SIZE := 6144k + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d3_xplained + +ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"") + ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"") + define Device/wb50n + $(Device/evaluation-fit) + DEVICE_VENDOR := Laird + DEVICE_MODEL := WB50N + DEVICE_PACKAGES := \ + kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \ + kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \ + kmod-leds-gpio + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955 + endef + TARGET_DEVICES += wb50n + endif +endif + +define Device/at91-sama5d4_xplained + $(Device/evaluation-dtb) + DEVICE_VENDOR := Microchip + DEVICE_MODEL := SAMA5D4 Xplained + KERNEL_SIZE := 6144k + BLOCKSIZE := 256k + PAGESIZE := 4096 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082 + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d4_xplained diff --git a/target/linux/at91/image/sama5d2.mk b/target/linux/at91/image/sama5d2.mk deleted file mode 100644 index b841448633..0000000000 --- a/target/linux/at91/image/sama5d2.mk +++ /dev/null @@ -1,31 +0,0 @@ - -define Device/default-nand - BLOCKSIZE := 128k - PAGESIZE := 2048 - SUBPAGESIZE := 2048 - MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048 -endef - -define Device/at91-sama5d2_xplained - $(Device/evaluation-dtb) - DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 Xplained - KERNEL_SIZE := 6144k - $(Device/evaluation-sdimage) -endef -TARGET_DEVICES += at91-sama5d2_xplained - -define Device/at91-sama5d27_som1_ek - $(Device/evaluation-dtb) - DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D27 SOM1 Ek - KERNEL_SIZE := 6144k - $(Device/evaluation-sdimage) -endef -TARGET_DEVICES += at91-sama5d27_som1_ek - -define Device/at91-sama5d2_ptc_ek - $(Device/evaluation-dtb) - DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 PTC Ek - KERNEL_SIZE := 6144k - $(Device/evaluation-sdimage) -endef -TARGET_DEVICES += at91-sama5d2_ptc_ek diff --git a/target/linux/at91/image/sama5d3.mk b/target/linux/at91/image/sama5d3.mk index f48c981030..e69de29bb2 100644 --- a/target/linux/at91/image/sama5d3.mk +++ b/target/linux/at91/image/sama5d3.mk @@ -1,33 +0,0 @@ - -define Device/default-nand - BLOCKSIZE := 128k - PAGESIZE := 2048 - SUBPAGESIZE := 2048 - MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048 -endef - -define Device/at91-sama5d3_xplained - $(Device/evaluation-dtb) - DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D3 Xplained - KERNEL_SIZE := 6144k - $(Device/evaluation-sdimage) -endef -TARGET_DEVICES += at91-sama5d3_xplained - -ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"") - ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"") - define Device/wb50n - $(Device/evaluation-fit) - DEVICE_TITLE := Laird WB50N - DEVICE_PACKAGES := \ - kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \ - kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \ - kmod-leds-gpio - BLOCKSIZE := 128k - PAGESIZE := 2048 - SUBPAGESIZE := 2048 - MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955 - endef - TARGET_DEVICES += wb50n - endif -endif diff --git a/target/linux/at91/image/sama5d4.mk b/target/linux/at91/image/sama5d4.mk index 1140c3c4b2..e69de29bb2 100644 --- a/target/linux/at91/image/sama5d4.mk +++ b/target/linux/at91/image/sama5d4.mk @@ -1,19 +0,0 @@ - -define Device/default-nand - BLOCKSIZE := 128k - PAGESIZE := 2048 - SUBPAGESIZE := 2048 - MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048 -endef - -define Device/at91-sama5d4_xplained - $(Device/evaluation-dtb) - DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained - KERNEL_SIZE := 6144k - BLOCKSIZE := 256k - PAGESIZE := 4096 - SUBPAGESIZE := 2048 - MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082 - $(Device/evaluation-sdimage) -endef -TARGET_DEVICES += at91-sama5d4_xplained diff --git a/target/linux/at91/image/uboot-env.txt b/target/linux/at91/image/uboot-env.txt new file mode 100644 index 0000000000..80d051b72f --- /dev/null +++ b/target/linux/at91/image/uboot-env.txt @@ -0,0 +1,14 @@ +/* Do Not remove First 2 lines, Makefile will modify these lines with proper board names */ +board=at91sam9x25ek +board_name=at91sam9x25ek +bootargs=console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4 +bootargsd2=console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rw rootwait rootfstype=ext4 +bootargsxx=console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4 +bootcmd=run setbootargs; run fatload_mmc; bootm 0x21000000 +bootdelay=1 +fatload_mmc=if test ${board_name} = sama5d2_xplained || test ${board_name} = sama5d27_som1_ek; then fatload mmc 1:1 0x21000000 ${board_name}-fit.itb; else fatload mmc 0:1 0x21000000 ${board_name}-fit.itb; fi +setbootargs=if test ${board_name} = sama5d2_xplained || test ${board_name} = sama5d27_som1_ek; then setenv bootargs ${bootargsd2}; else setenv bootargs ${bootargsxx}; fi +ethact=gmac0 +stderr=serial +stdin=serial +stdout=serial diff --git a/target/linux/at91/legacy/target.mk b/target/linux/at91/legacy/target.mk deleted file mode 100644 index a3d99bbfb2..0000000000 --- a/target/linux/at91/legacy/target.mk +++ /dev/null @@ -1,7 +0,0 @@ -BOARDNAME:=Legacy (ARMv5) -CPU_TYPE:=arm926ej-s - -define Target/Description - Build generic firmware for legacy Atmel AT91 platforms - using the ARMv5 instruction set. -endef diff --git a/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch b/target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch similarity index 80% rename from target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch rename to target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch index 2a64fb8a5c..c0eb6dafb2 100644 --- a/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch +++ b/target/linux/at91/patches-4.14/100-ARM-at91-build-dtb-for-LMU5000.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -32,6 +32,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ +@@ -33,6 +33,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ usb_a9g20.dtb \ usb_a9g20_lpw.dtb \ at91sam9m10g45ek.dtb \ diff --git a/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch b/target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch similarity index 82% rename from target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch rename to target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch index 1cee5588a0..6c84c9401b 100644 --- a/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch +++ b/target/linux/at91/patches-4.14/101-ARM-at91-build-dtb-for-q5xr5.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -40,6 +40,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ +@@ -41,6 +41,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ at91-ariettag25.dtb \ at91-cosino_mega2560.dtb \ at91-kizboxmini.dtb \ diff --git a/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch b/target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch similarity index 74% rename from target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch rename to target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch index aeb523a5b9..f6190c4959 100644 --- a/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch +++ b/target/linux/at91/patches-4.14/102-ARM-at91-build-dtb-for-wb45n.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -45,7 +45,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ +@@ -46,7 +46,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ at91sam9g25ek.dtb \ at91sam9g35ek.dtb \ at91sam9x25ek.dtb \ @@ -9,4 +9,4 @@ + wb45n.dtb dtb-$(CONFIG_SOC_SAM_V7) += \ at91-kizbox2.dtb \ - at91-sama5d2_xplained.dtb \ + at91-sama5d27_som1_ek.dtb \ diff --git a/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch b/target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch similarity index 85% rename from target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch rename to target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch index a30a803c98..324017c517 100644 --- a/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch +++ b/target/linux/at91/patches-4.14/103-ARM-at91-build-dtb-for-wb50n.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -59,7 +59,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \ +@@ -63,7 +63,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \ at91-sama5d4_ma5d4evk.dtb \ at91-sama5d4_xplained.dtb \ at91-sama5d4ek.dtb \ diff --git a/target/linux/at91/patches-4.9/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch b/target/linux/at91/patches-4.14/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch similarity index 98% rename from target/linux/at91/patches-4.9/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch rename to target/linux/at91/patches-4.14/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch index e33840cfd8..b3bede41dc 100644 --- a/target/linux/at91/patches-4.9/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch +++ b/target/linux/at91/patches-4.14/105-ARM-at91-build-dtb-for-sama5d2-ptc-Ek.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -49,6 +49,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ +@@ -50,6 +50,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ wb45n.dtb dtb-$(CONFIG_SOC_SAM_V7) += \ at91-kizbox2.dtb \ @@ -10,7 +10,7 @@ at91-sama5d3_xplained.dtb \ --- /dev/null +++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts -@@ -0,0 +1,422 @@ +@@ -0,0 +1,421 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR X11) +/* + * at91-sama5d2_ptc_ek.dts - Device Tree file for SAMA5D2 PTC EK board @@ -316,7 +316,6 @@ + , + ; + bias-pull-up; -+ drive-strength = ; + }; + + ale_cle_rdy_cs { diff --git a/target/linux/at91/patches-4.9/104-ARM-at91-build-dtb-for-sama5d27-SOM1-Ek.patch b/target/linux/at91/patches-4.9/104-ARM-at91-build-dtb-for-sama5d27-SOM1-Ek.patch deleted file mode 100644 index 20c69f39ed..0000000000 --- a/target/linux/at91/patches-4.9/104-ARM-at91-build-dtb-for-sama5d27-SOM1-Ek.patch +++ /dev/null @@ -1,893 +0,0 @@ ---- a/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt -+++ b/Documentation/devicetree/bindings/pinctrl/atmel,at91-pio4-pinctrl.txt -@@ -35,7 +35,12 @@ right representation of the pin. - Optional properties: - - GENERIC_PINCONFIG: generic pinconfig options to use, bias-disable, - bias-pull-down, bias-pull-up, drive-open-drain, input-schmitt-enable, --input-debounce, output-low, output-high. -+input-debounce, output-low, output-high, drive-strength. -+ -+Concerning the drive-strength property, the values accepted are -+ATMEL_PIO_DRVSTR_LO, ATMEL_PIO_DRVSTR_ME, ATMEL_PIO_DRVSTR_HI. The current -+depends on VDDIOP. You can find the details in the DC Characteristics table -+from the datasheet. - - Example: - ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -49,6 +49,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ - wb45n.dtb - dtb-$(CONFIG_SOC_SAM_V7) += \ - at91-kizbox2.dtb \ -+ at91-sama5d27_som1_ek.dtb \ - at91-sama5d2_xplained.dtb \ - at91-sama5d3_xplained.dtb \ - sama5d31ek.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi -@@ -0,0 +1,175 @@ -+/* -+ * at91-sama5d27_som1.dtsi - Device Tree file for SAMA5D27 SoM1 board -+ * -+ * Copyright (c) 2017, Microchip Technology Inc. -+ * 2017 Cristian Birsan -+ * 2017 Claudiu Beznea -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+#include "sama5d2.dtsi" -+#include "sama5d2-pinfunc.h" -+ -+/ { -+ model = "Atmel SAMA5D27 SoM1"; -+ compatible = "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5"; -+ -+ clocks { -+ slow_xtal { -+ clock-frequency = <32768>; -+ }; -+ -+ main_xtal { -+ clock-frequency = <24000000>; -+ }; -+ }; -+ -+ ahb { -+ apb { -+ qspi1: spi@f0024000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_qspi1_default>; -+ -+ flash@0 { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ compatible = "jedec,spi-nor"; -+ reg = <0>; -+ spi-max-frequency = <80000000>; -+ m25p,fast-read; -+ -+ at91bootstrap@00000000 { -+ label = "at91bootstrap"; -+ reg = <0x00000000 0x00010000>; -+ }; -+ -+ bootloader@00010000 { -+ label = "bootloader"; -+ reg = <0x00010000 0x000a0000>; -+ }; -+ -+ bootloaderenv@000b0000 { -+ label = "bootloader env"; -+ reg = <0x000b0000 0x00010000>; -+ }; -+ -+ dtb@000c0000 { -+ label = "device tree"; -+ reg = <0x000c0000 0x0020000>; -+ }; -+ -+ kernel@000e0000 { -+ label = "kernel"; -+ reg = <0x000e0000 0x0400000>; -+ }; -+ }; -+ }; -+ -+ macb0: ethernet@f8008000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_macb0_default>; -+ phy-mode = "rmii"; -+ -+ ethernet-phy@0 { -+ reg = <0x0>; -+ interrupt-parent = <&pioA>; -+ interrupts = ; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_macb0_phy_irq>; -+ }; -+ }; -+ -+ i2c0: i2c@f8028000 { -+ dmas = <0>, <0>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c0_default>; -+ status = "okay"; -+ -+ at24@50 { -+ compatible = "24c02"; -+ reg = <0x50>; -+ pagesize = <8>; -+ }; -+ }; -+ -+ pinctrl@fc038000 { -+ pinctrl_i2c0_default: i2c0_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_qspi1_default: qspi1_default { -+ sck_cs { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ data { -+ pinmux = , -+ , -+ , -+ ; -+ bias-pull-up; -+ }; -+ }; -+ -+ pinctrl_macb0_default: macb0_default { -+ pinmux = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_macb0_phy_irq: macb0_phy_irq { -+ pinmux = ; -+ bias-disable; -+ }; -+ }; -+ }; -+ }; -+}; ---- /dev/null -+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts -@@ -0,0 +1,53 @@ -+/* -+ * at91-sama5d27_som1_ek.dts - Device Tree file for SAMA5D27-SOM1-EK board -+ * -+ * Copyright (c) 2017, Microchip Technology Inc. -+ * 2016 Nicolas Ferre -+ * 2017 Cristian Birsan -+ * 2017 Claudiu Beznea -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+/dts-v1/; -+#include "at91-sama5d27_som1_ek_common.dtsi" -+ -+/ { -+ model = "Atmel SAMA5D27 SOM1 EK"; -+ compatible = "atmel,sama5d27-som1-ek", "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5"; -+}; ---- /dev/null -+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek_common.dtsi -@@ -0,0 +1,619 @@ -+/* -+ * at91-sama5d27_som1_ek_common.dtsi - Device Tree file for SAMA5D27-SOM1-EK board -+ * -+ * Copyright (c) 2017, Microchip Technology Inc. -+ * 2016 Nicolas Ferre -+ * 2017 Cristian Birsan -+ * 2017 Claudiu Beznea -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+#include "at91-sama5d27_som1.dtsi" -+#include -+#include -+#include -+ -+/ { -+ model = "Atmel SAMA5D27 SOM1 EK"; -+ compatible = "atmel,sama5d27-som1-ek", "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5"; -+ -+ aliases { -+ serial0 = &uart1; /* DBGU */ -+ serial1 = &uart4; /* mikro BUS 1 */ -+ serial2 = &uart2; /* mikro BUS 2 */ -+ i2c1 = &i2c1; -+ i2c2 = &i2c2; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ ahb { -+ usb0: gadget@00300000 { -+ atmel,vbus-gpio = <&pioA PIN_PD20 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usba_vbus>; -+ status = "okay"; -+ }; -+ -+ usb1: ohci@00400000 { -+ num-ports = <3>; -+ atmel,vbus-gpio = <0 /* &pioA PIN_PD20 GPIO_ACTIVE_HIGH */ -+ &pioA PIN_PA27 GPIO_ACTIVE_HIGH -+ 0 -+ >; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usb_default>; -+ status = "okay"; -+ }; -+ -+ usb2: ehci@00500000 { -+ status = "okay"; -+ }; -+ -+ sdmmc0: sdio-host@a0000000 { -+ bus-width = <8>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_sdmmc0_default>; -+ status = "okay"; -+ }; -+ -+ sdmmc1: sdio-host@b0000000 { -+ bus-width = <4>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_sdmmc1_default>; -+ status = "okay"; -+ }; -+ -+ apb { -+ hlcdc: hlcdc@f0000000 { -+ status = "disabled"; -+ -+ hlcdc-display-controller { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_lcd_base &pinctrl_lcd_rgb>; -+ }; -+ -+ hlcdc_pwm: hlcdc-pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_lcd_pwm>; -+ }; -+ }; -+ -+ pmc: pmc@f0014000 { -+ pmc_fast_restart { -+ compatible = "atmel,sama5d2-pmc-fast-startup"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ atmel,wakeup-rtc-timer; -+ -+ wkpin: input@0 { -+ reg = <0>; -+ }; -+ -+ gmac_wol: input@10 { -+ reg = <10>; -+ atmel,wakeup-active-high; -+ }; -+ }; -+ }; -+ -+ isc: isc@f0008000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>; -+ status = "okay"; -+ }; -+ -+ qspi1: spi@f0024000 { -+ status = "okay"; -+ }; -+ -+ spi0: spi@f8000000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_spi0_default>; -+ status = "okay"; -+ }; -+ -+ macb0: ethernet@f8008000 { -+ status = "okay"; -+ }; -+ -+ uart1: serial@f8020000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_uart1_default>; -+ atmel,use-dma-rx; -+ atmel,use-dma-tx; -+ status = "okay"; -+ }; -+ -+ uart2: serial@f8024000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_mikrobus2_uart>; -+ atmel,use-dma-rx; -+ atmel,use-dma-tx; -+ status = "okay"; -+ }; -+ -+ pwm0: pwm@f802c000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_mikrobus1_pwm &pinctrl_mikrobus2_pwm>; -+ status = "disabled"; /* Conflict with leds. */ -+ }; -+ -+ flx1: flexcom@f8038000 { -+ atmel,flexcom-mode = ; -+ status = "okay"; -+ -+ i2c2: i2c@600 { -+ compatible = "atmel,sama5d2-i2c"; -+ reg = <0x600 0x200>; -+ interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>; -+ dmas = <0>, <0>; -+ dma-names = "tx", "rx"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ clocks = <&flx1_clk>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_mikrobus_i2c>; -+ atmel,fifo-size = <16>; -+ status = "okay"; -+ }; -+ }; -+ -+ shdwc@f8048010 { -+ atmel,shdwc-debouncer = <976>; -+ atmel,wakeup-rtc-timer; -+ -+ input@0 { -+ reg = <0>; -+ atmel,wakeup-type = "low"; -+ }; -+ }; -+ -+ watchdog@f8048040 { -+ status = "okay"; -+ }; -+ -+ uart3: serial@fc008000 { -+ atmel,use-dma-rx; -+ atmel,use-dma-tx; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_uart3_default>; -+ status = "disabled"; /* Conflict with isc. */ -+ }; -+ -+ uart4: serial@fc00c000 { -+ atmel,use-dma-rx; -+ atmel,use-dma-tx; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_mikrobus1_uart>; -+ status = "okay"; -+ }; -+ -+ flx3: flexcom@fc014000 { -+ atmel,flexcom-mode = ; -+ status = "disabled"; -+ -+ uart7: serial@200 { -+ compatible = "atmel,at91sam9260-usart"; -+ reg = <0x200 0x200>; -+ interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>; -+ clocks = <&flx3_clk>; -+ clock-names = "usart"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_flx3_default>; -+ atmel,fifo-size = <32>; -+ status = "disabled"; /* Conflict with isc. */ -+ }; -+ -+ spi2: spi@400 { -+ compatible = "atmel,at91rm9200-spi"; -+ reg = <0x400 0x200>; -+ interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>; -+ clocks = <&flx3_clk>; -+ clock-names = "spi_clk"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_flx3_default>; -+ atmel,fifo-size = <16>; -+ status = "disabled"; /* Conflict with isc. */ -+ }; -+ }; -+ -+ flx4: flexcom@fc018000 { -+ atmel,flexcom-mode = ; -+ status = "okay"; -+ -+ uart6: serial@200 { -+ compatible = "atmel,at91sam9260-usart"; -+ reg = <0x200 0x200>; -+ interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>; -+ clocks = <&flx4_clk>; -+ clock-names = "usart"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_flx4_default>; -+ atmel,fifo-size = <32>; -+ status = "disabled"; /* Conflict with spi3 and i2c3. */ -+ }; -+ -+ spi3: spi@400 { -+ compatible = "atmel,at91rm9200-spi"; -+ reg = <0x400 0x200>; -+ interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>; -+ clocks = <&flx4_clk>; -+ clock-names = "spi_clk"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>; -+ atmel,fifo-size = <16>; -+ status = "okay"; -+ }; -+ -+ i2c3: i2c@600 { -+ compatible = "atmel,sama5d2-i2c"; -+ reg = <0x600 0x200>; -+ interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>; -+ dmas = <0>, <0>; -+ dma-names = "tx", "rx"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ clocks = <&flx4_clk>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_flx4_default>; -+ atmel,fifo-size = <16>; -+ status = "disabled"; /* Conflict with uart6 and spi3. */ -+ }; -+ }; -+ -+ i2c1: i2c@fc028000 { -+ dmas = <0>, <0>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_i2c1_default>; -+ status = "okay"; -+ }; -+ -+ pinctrl@fc038000 { -+ -+ pinctrl_lcd_base: pinctrl_lcd_base { -+ pinmux = , -+ , -+ , -+ ; -+ bias-disable; -+ drive-strength = ; -+ }; -+ -+ pinctrl_lcd_rgb: pinctrl_lcd_rgb { -+ pinmux = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_lcd_pwm: pinctrl_lcd_pwm { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_can1_default: can1_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_flx3_default: flx3_default { -+ pinmux = , -+ , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_i2c1_default: i2c1_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_isc_base: isc_base { -+ pinmux = , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_isc_data_8bit: isc_data_8bit { -+ pinmux = , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_isc_data_9_10: isc_data_9_10 { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_isc_data_11_12: isc_data_11_12 { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_key_gpio_default: key_gpio_default { -+ pinmux = ; -+ bias-pull-up; -+ }; -+ -+ pinctrl_led_gpio_default: led_gpio_default { -+ pinmux = , -+ , -+ ; -+ bias-pull-up; -+ }; -+ -+ pinctrl_sdmmc0_default: sdmmc0_default { -+ cmd_data { -+ pinmux = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ ck_cd_vddsel { -+ pinmux = , -+ , -+ ; -+ bias-disable; -+ }; -+ }; -+ -+ pinctrl_sdmmc1_default: sdmmc1_default { -+ cmd_data { -+ pinmux = , -+ , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ conf-ck_cd { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ }; -+ -+ pinctrl_spi0_default: spi0_default { -+ pinmux = , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_uart1_default: uart1_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_uart3_default: uart3_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_usb_default: usb_default { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_usba_vbus: usba_vbus { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus1_an: mikrobus1_an { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus2_an: mikrobus2_an { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus1_rst: mikrobus1_rst { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus2_rst: mikrobus2_rst { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus1_spi_cs: mikrobus1_spi_cs { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus2_spi_cs: mikrobus2_spi_cs { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus_spi: mikrobus_spi { -+ pinmux = , -+ , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus1_pwm: mikrobus1_pwm { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus2_pwm: mikrobus2_pwm { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus1_int: mikrobus1_int { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus2_int: mikrobus2_int { -+ pinmux = ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus1_uart: mikrobus1_uart { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus2_uart: mikrobus2_uart { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_mikrobus_i2c: mikrobus1_i2c { -+ pinmux = , -+ ; -+ bias-disable; -+ }; -+ -+ pinctrl_flx4_default: flx4_uart_default { -+ pinmux = , -+ , -+ , -+ , -+ ; -+ bias-disable; -+ }; -+ }; -+ -+ can1: can@fc050000 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_can1_default>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ gpio_keys { -+ compatible = "gpio-keys"; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_key_gpio_default>; -+ -+ pb4 { -+ label = "USER"; -+ gpios = <&pioA PIN_PA29 GPIO_ACTIVE_LOW>; -+ linux,code = <0x104>; -+ wakeup-source; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_led_gpio_default>; -+ status = "okay"; /* Conflict with pwm0. */ -+ -+ red { -+ label = "red"; -+ gpios = <&pioA PIN_PA10 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ green { -+ label = "green"; -+ gpios = <&pioA PIN_PB1 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ blue { -+ label = "blue"; -+ gpios = <&pioA PIN_PA31 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ }; -+ }; -+}; ---- a/include/dt-bindings/pinctrl/at91.h -+++ b/include/dt-bindings/pinctrl/at91.h -@@ -37,4 +37,8 @@ - #define AT91_PERIPH_C 3 - #define AT91_PERIPH_D 4 - -+#define ATMEL_PIO_DRVSTR_LO 1 -+#define ATMEL_PIO_DRVSTR_ME 2 -+#define ATMEL_PIO_DRVSTR_HI 3 -+ - #endif /* __DT_BINDINGS_AT91_PINCTRL_H__ */ diff --git a/target/linux/at91/legacy/config-default b/target/linux/at91/sam9x/config-default similarity index 68% rename from target/linux/at91/legacy/config-default rename to target/linux/at91/sam9x/config-default index f53f24e9f5..a8923a6efe 100644 --- a/target/linux/at91/legacy/config-default +++ b/target/linux/at91/sam9x/config-default @@ -2,21 +2,17 @@ CONFIG_ARCH_MULTI_V4T=y CONFIG_ARCH_MULTI_V4_V5=y CONFIG_ARCH_MULTI_V5=y +# CONFIG_ARCH_MULTI_V7 is not set +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set # CONFIG_ARM_AT91_CPUIDLE is not set CONFIG_ARM_L1_CACHE_SHIFT=5 # CONFIG_AT91RM9200_WATCHDOG is not set +# CONFIG_AT91_SAMA5D2_ADC is not set CONFIG_ATMEL_AIC_IRQ=y CONFIG_ATMEL_ST=y -CONFIG_AT_XDMAC=y CONFIG_BACKLIGHT_ATMEL_LCDC=y # CONFIG_CACHE_L2X0 is not set -CONFIG_CMA_ALIGNMENT=8 CONFIG_CMA_DEBUGFS=y -CONFIG_CMA_SIZE_MBYTES=16 -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set CONFIG_CPU_32v4T=y CONFIG_CPU_32v5=y CONFIG_CPU_ABRT_EV4T=y @@ -28,6 +24,7 @@ CONFIG_CPU_CACHE_V4WT=y CONFIG_CPU_CACHE_VIVT=y CONFIG_CPU_COPY_V4WB=y # CONFIG_CPU_DCACHE_WRITETHROUGH is not set +# CONFIG_CPU_IDLE_GOV_MENU is not set CONFIG_CPU_NO_EFFICIENT_FFS=y CONFIG_CPU_PABRT_LEGACY=y CONFIG_CPU_TLB_V4WBI=y @@ -35,8 +32,7 @@ CONFIG_CPU_USE_DOMAINS=y CONFIG_CRC7=y CONFIG_CRC_CCITT=y CONFIG_CRC_ITU_T=y -CONFIG_DEBUG_MEMORY_INIT=y -CONFIG_DMA_CMA=y +CONFIG_DEBUG_INFO=y CONFIG_FB_ATMEL=y CONFIG_FB_BACKLIGHT=y CONFIG_FB_MODE_HELPERS=y @@ -44,12 +40,20 @@ CONFIG_GENERIC_ATOMIC64=y # CONFIG_HAVE_ARCH_BITREVERSE is not set CONFIG_HZ=128 CONFIG_HZ_FIXED=128 -# CONFIG_LCD_CLASS_DEVICE is not set +CONFIG_HZ_PERIODIC=y +# CONFIG_MFD_ACT8945A is not set +# CONFIG_MFD_ATMEL_FLEXCOM is not set +# CONFIG_MMC_SDHCI is not set CONFIG_MMC_SPI=y +# CONFIG_MTD_SPI_NOR is not set CONFIG_NEED_KUSER_HELPERS=y -CONFIG_RFKILL_REGULATOR=y +# CONFIG_NO_HZ_IDLE is not set +# CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC is not set +# CONFIG_REGULATOR_ACT8865 is not set CONFIG_RTC_DRV_AT91SAM9=y +# CONFIG_SAMA5D4_WATCHDOG is not set # CONFIG_SND_ARM is not set +# CONFIG_SND_ATMEL_SOC_CLASSD is not set # CONFIG_SND_DRIVERS is not set # CONFIG_SND_SPI is not set CONFIG_SOC_AT91RM9200=y @@ -57,4 +61,4 @@ CONFIG_SOC_AT91SAM9=y CONFIG_SOC_SAM_V4_V5=y CONFIG_SPLIT_PTLOCK_CPUS=999999 CONFIG_TOUCHSCREEN_ADS7846=y -# CONFIG_USB_ATMEL_USBA is not set +# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set diff --git a/target/linux/at91/sam9x/target.mk b/target/linux/at91/sam9x/target.mk new file mode 100644 index 0000000000..f6da7c003c --- /dev/null +++ b/target/linux/at91/sam9x/target.mk @@ -0,0 +1,7 @@ +BOARDNAME:= SAM9X Boards (ARMv5) +CPU_TYPE:=arm926ej-s + +define Target/Description + Build generic firmware for Microchip AT91 SAM9x platforms + using the ARMv5 instruction set. +endef diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default new file mode 100644 index 0000000000..e69de29bb2 diff --git a/target/linux/at91/sama5/target.mk b/target/linux/at91/sama5/target.mk new file mode 100644 index 0000000000..35df05b70d --- /dev/null +++ b/target/linux/at91/sama5/target.mk @@ -0,0 +1,10 @@ +BOARDNAME:=SAMA5 boards(Cortex-A5) +CPU_TYPE:=cortex-a5 +CPU_SUBTYPE:=vfpv4 +FEATURES+=fpu +DEFAULT_PACKAGES += kmod-usb2 + +define Target/Description + Build generic firmware for Microchip(Atmel AT91) SAMA5D2, + SAMA5D3 and SAMA5D4 MPU's using the ARMv7 instruction set. +endef diff --git a/target/linux/at91/sama5d2/config-default b/target/linux/at91/sama5d2/config-default deleted file mode 100644 index 43f8d240e3..0000000000 --- a/target/linux/at91/sama5d2/config-default +++ /dev/null @@ -1,44 +0,0 @@ -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -CONFIG_AT91_SAMA5D2_ADC=y -CONFIG_AT_XDMAC=y -CONFIG_BATTERY_ACT8945A=y -CONFIG_CAN=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_DEBUGFS=y -CONFIG_CMA_SIZE_MBYTES=16 -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_DEBUG_MEMORY_INIT=y -CONFIG_DMA_CMA=y -# CONFIG_HZ_PERIODIC is not set -# CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_MEMCG=y -CONFIG_MFD_ACT8945A=y -CONFIG_MFD_ATMEL_FLEXCOM=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_IO_ACCESSORS=y -CONFIG_MMC_SDHCI_OF_AT91=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MTD_M25P80=y -CONFIG_MTD_SPI_NOR=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_PAGE_COUNTER=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y -CONFIG_REGULATOR_ACT8865=y -CONFIG_REGULATOR_ACT8945A=y -CONFIG_RFKILL_REGULATOR=y -CONFIG_SAMA5D4_WATCHDOG=y -CONFIG_SND_ATMEL_SOC_CLASSD=y -CONFIG_SOC_SAMA5D2=y -CONFIG_SOC_SAM_V7=y -CONFIG_SPI_ATMEL_QUADSPI=y -CONFIG_TOUCHSCREEN_ATMEL_MXT=y -# CONFIG_TOUCHSCREEN_ATMEL_MXT_T37 is not set -# CONFIG_USB_ATMEL_USBA is not set diff --git a/target/linux/at91/sama5d2/target.mk b/target/linux/at91/sama5d2/target.mk deleted file mode 100644 index 63f50aeea1..0000000000 --- a/target/linux/at91/sama5d2/target.mk +++ /dev/null @@ -1,10 +0,0 @@ -BOARDNAME:=SAMA5D2 boards(Cortex-A5) -CPU_TYPE:=cortex-a5 -CPU_SUBTYPE:=neon-vfpv4 -FEATURES+=fpu -DEFAULT_PACKAGES += kmod-usb2 - -define Target/Description - Build generic firmware for Microchip(Atmel AT91) SAMA5D2 MPU's - using the ARMv7 instruction set. -endef diff --git a/target/linux/at91/sama5d3/config-default b/target/linux/at91/sama5d3/config-default deleted file mode 100644 index 88b4031a94..0000000000 --- a/target/linux/at91/sama5d3/config-default +++ /dev/null @@ -1,39 +0,0 @@ -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -CONFIG_AT91_SAMA5D2_ADC=y -CONFIG_AT_XDMAC=y -CONFIG_BATTERY_ACT8945A=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_DEBUGFS=y -CONFIG_CMA_SIZE_MBYTES=16 -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_DEBUG_MEMORY_INIT=y -CONFIG_DMA_CMA=y -# CONFIG_HZ_PERIODIC is not set -# CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_MFD_ACT8945A=y -CONFIG_MFD_ATMEL_FLEXCOM=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_IO_ACCESSORS=y -CONFIG_MMC_SDHCI_OF_AT91=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MTD_M25P80=y -CONFIG_MTD_SPI_NOR=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y -CONFIG_REGULATOR_ACT8865=y -CONFIG_REGULATOR_ACT8945A=y -CONFIG_RFKILL_REGULATOR=y -CONFIG_SAMA5D4_WATCHDOG=y -CONFIG_SND_ATMEL_SOC_CLASSD=y -CONFIG_SOC_SAMA5D3=y -CONFIG_SOC_SAM_V7=y -CONFIG_SPI_ATMEL_QUADSPI=y -CONFIG_TOUCHSCREEN_ATMEL_MXT=y -# CONFIG_TOUCHSCREEN_ATMEL_MXT_T37 is not set -# CONFIG_USB_ATMEL_USBA is not set diff --git a/target/linux/at91/sama5d3/target.mk b/target/linux/at91/sama5d3/target.mk deleted file mode 100644 index d30931bfc0..0000000000 --- a/target/linux/at91/sama5d3/target.mk +++ /dev/null @@ -1,10 +0,0 @@ -BOARDNAME:=SAMA5D3 boards(Cortex-A5) -CPU_TYPE:=cortex-a5 -CPU_SUBTYPE:=vfpv4 -FEATURES+=fpu -DEFAULT_PACKAGES += kmod-usb2 - -define Target/Description - Build generic firmware for Microchip(Atmel AT91) SAMA5D3 MPU's - using the ARMv7 instruction set. -endef diff --git a/target/linux/at91/sama5d4/config-default b/target/linux/at91/sama5d4/config-default deleted file mode 100644 index baa2d5f46f..0000000000 --- a/target/linux/at91/sama5d4/config-default +++ /dev/null @@ -1,39 +0,0 @@ -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -CONFIG_AT91_SAMA5D2_ADC=y -CONFIG_AT_XDMAC=y -CONFIG_BATTERY_ACT8945A=y -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_DEBUGFS=y -CONFIG_CMA_SIZE_MBYTES=16 -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -CONFIG_CPU_IDLE_GOV_MENU=y -CONFIG_DEBUG_MEMORY_INIT=y -CONFIG_DMA_CMA=y -# CONFIG_HZ_PERIODIC is not set -# CONFIG_LCD_CLASS_DEVICE is not set -CONFIG_MFD_ACT8945A=y -CONFIG_MFD_ATMEL_FLEXCOM=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_IO_ACCESSORS=y -CONFIG_MMC_SDHCI_OF_AT91=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MTD_M25P80=y -CONFIG_MTD_SPI_NOR=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y -CONFIG_REGULATOR_ACT8865=y -CONFIG_REGULATOR_ACT8945A=y -CONFIG_RFKILL_REGULATOR=y -CONFIG_SAMA5D4_WATCHDOG=y -CONFIG_SND_ATMEL_SOC_CLASSD=y -CONFIG_SOC_SAMA5D4=y -CONFIG_SOC_SAM_V7=y -CONFIG_SPI_ATMEL_QUADSPI=y -CONFIG_TOUCHSCREEN_ATMEL_MXT=y -# CONFIG_TOUCHSCREEN_ATMEL_MXT_T37 is not set -# CONFIG_USB_ATMEL_USBA is not set diff --git a/target/linux/at91/sama5d4/target.mk b/target/linux/at91/sama5d4/target.mk deleted file mode 100644 index 2bbab60d81..0000000000 --- a/target/linux/at91/sama5d4/target.mk +++ /dev/null @@ -1,10 +0,0 @@ -BOARDNAME:=SAMA5D4 boards(Cortex-A5) -CPU_TYPE:=cortex-a5 -CPU_SUBTYPE:=neon-vfpv4 -FEATURES+=fpu -DEFAULT_PACKAGES += kmod-usb2 - -define Target/Description - Build generic firmware for Microchip(Atmel AT91) SAMA5D4 MPU's - using the ARMv7 instruction set. -endef From 464fb0c122143f761349b16a7505df9ff6f6ab6d Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Tue, 11 Feb 2020 17:26:50 +0800 Subject: [PATCH 2/2] ipq806x: add support for ruijie_rg-mtfi-m520 (#3025) Signed-off-by: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> --- .../ipq806x/base-files/etc/board.d/01_leds | 4 + .../ipq806x/base-files/etc/board.d/02_network | 7 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 16 + .../lib/preinit/05_set_iface_mac_ipq806x.sh | 15 + .../base-files/lib/upgrade/platform.sh | 4 + .../ipq806x/base-files/lib/upgrade/ruijie.sh | 53 +++ target/linux/ipq806x/config-4.14 | 1 + target/linux/ipq806x/config-4.19 | 1 + .../arm/boot/dts/qcom-ipq8064-mtfi-m520.dts | 395 ++++++++++++++++++ .../arm/boot/dts/qcom-ipq8064-mtfi-m520.dts | 395 ++++++++++++++++++ target/linux/ipq806x/image/Makefile | 19 + .../0069-arm-boot-add-dts-files.patch | 3 +- .../851-ata-add-sata-driver.patch | 308 ++++++++++++++ .../0069-arm-boot-add-dts-files.patch | 3 +- .../851-ata-add-sata-driver.patch | 308 ++++++++++++++ 15 files changed, 1530 insertions(+), 2 deletions(-) create mode 100644 target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh create mode 100644 target/linux/ipq806x/base-files/lib/upgrade/ruijie.sh create mode 100644 target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts create mode 100644 target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts create mode 100644 target/linux/ipq806x/patches-4.14/851-ata-add-sata-driver.patch create mode 100644 target/linux/ipq806x/patches-4.19/851-ata-add-sata-driver.patch diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index f8b6c32358..82a9e9536f 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -33,6 +33,10 @@ netgear,r7800) ucidef_set_led_switch "wan" "WAN" "${boardname}:white:wan" "switch0" "0x20" ucidef_set_led_ide "esata" "eSATA" "${boardname}:white:esata" ;; +ruijie,rg-mtfi-m520) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "${boardname}:green:wlan2g" "phy1tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "${boardname}:green:wlan5g" "phy0tpt" + ;; tplink,c2600) ucidef_set_led_usbport "usb1" "USB 1" "${boardname}:white:usb_2" "usb1-port1" "usb2-port1" ucidef_set_led_usbport "usb2" "USB 2" "${boardname}:white:usb_4" "usb3-port1" "usb4-port1" diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index a3aa0fce70..a241f33214 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -48,6 +48,13 @@ qcom,ipq8064-db149) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0" ;; +ruijie,rg-mtfi-m520) + hw_mac_addr=$(mtd_get_mac_ascii PRODUCTINFO ethaddr) + ucidef_add_switch "switch0" \ + "1:lan" "6@eth1" "5:wan" "0@eth0" + ucidef_set_interface_macaddr "wan" "$hw_mac_addr" + ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 1)" + ;; zyxel,nbg6817) hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr) ucidef_add_switch "switch0" \ diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index e05f2b2c7b..808994d1ea 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -77,6 +77,22 @@ ath10kcal_patch_mac_crc() { board=$(board_name) case "$FIRMWARE" in +"ath10k/cal-pci-0000:01:00.0.bin") + case "$board" in + ruijie,rg-mtfi-m520) + ath10kcal_extract "ART" 4096 2116 + ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii PRODUCTINFO ethaddr) +2) + ;; + esac + ;; +"ath10k/cal-pci-0001:01:00.0.bin") + case "$board" in + ruijie,rg-mtfi-m520) + ath10kcal_extract "ART" 20480 2116 + ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii PRODUCTINFO ethaddr) +3) + ;; + esac + ;; "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in buffalo,wxr-2533dhp) diff --git a/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh new file mode 100644 index 0000000000..8087534221 --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/preinit/05_set_iface_mac_ipq806x.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +. /lib/functions.sh + +preinit_set_mac_address() { + case $(board_name) in + ruijie,rg-mtfi-m520) + base_mac=$(mtd_get_mac_ascii PRODUCTINFO ethaddr) + ip link set dev eth0 address $(macaddr_add "$base_mac" +1) + ip link set dev eth1 address $(macaddr_add "$base_mac" +2) + ;; + esac +} + +boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index 2f0190629e..d825ae434f 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -22,6 +22,7 @@ platform_do_upgrade() { netgear,r7800 |\ qcom,ipq8064-ap148 |\ qcom,ipq8064-ap161 |\ + ruijie,rg-mtfi-m520 |\ zyxel,nbg6817) nand_do_upgrade "$ARGV" ;; @@ -47,6 +48,9 @@ platform_do_upgrade() { platform_nand_pre_upgrade() { case "$(board_name)" in + ruijie,rg-mtfi-m520) + ruijie_do_upgrade "$1" + ;; zyxel,nbg6817) zyxel_do_upgrade "$1" ;; diff --git a/target/linux/ipq806x/base-files/lib/upgrade/ruijie.sh b/target/linux/ipq806x/base-files/lib/upgrade/ruijie.sh new file mode 100644 index 0000000000..2725de4326 --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/upgrade/ruijie.sh @@ -0,0 +1,53 @@ +# +# Copyright (C) 2016 lede-project.org +# Copyright (C) 2020 AnYun +# + +ruijie_do_flash() { + local tar_file=$1 + local kernel=$2 + local rootfs=$3 + + # keep sure its unbound + losetup --detach-all || { + echo Failed to detach all loop devices. Skip this try. + reboot -f + } + + # use the first found directory in the tar archive + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + echo "flashing kernel to $kernel" + tar xf $tar_file ${board_dir}/kernel -O > $kernel + + echo "flashing rootfs to $rootfs" + tar xf $tar_file ${board_dir}/root -O > $rootfs + + # Cleanup + losetup -d /dev/loop0 >/dev/null 2>&1 + sync + umount -a + reboot -f +} + +ruijie_do_upgrade() { + local tar_file="$1" + local board=$(board_name) + local kernel= + local rootfs= + + case "$board" in + ruijie,rg-mtfi-m520) + kernel="/dev/mmcblk0p2" + rootfs="/dev/mmcblk0p3" + ;; + *) + return 1 + ;; + esac + + ruijie_do_flash $tar_file $kernel $rootfs + + return 0 +} diff --git a/target/linux/ipq806x/config-4.14 b/target/linux/ipq806x/config-4.14 index 38f5c94507..eee0c9f0a7 100644 --- a/target/linux/ipq806x/config-4.14 +++ b/target/linux/ipq806x/config-4.14 @@ -1,3 +1,4 @@ +CONFIG_AHCI_IPQ=y CONFIG_ALIGNMENT_TRAP=y # CONFIG_AMBA_PL08X is not set # CONFIG_APQ_GCC_8084 is not set diff --git a/target/linux/ipq806x/config-4.19 b/target/linux/ipq806x/config-4.19 index f4c27d7ae8..367d25f77d 100644 --- a/target/linux/ipq806x/config-4.19 +++ b/target/linux/ipq806x/config-4.19 @@ -1,3 +1,4 @@ +CONFIG_AHCI_IPQ=y CONFIG_ALIGNMENT_TRAP=y # CONFIG_APQ_GCC_8084 is not set # CONFIG_APQ_MMCC_8084 is not set diff --git a/target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts b/target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts new file mode 100644 index 0000000000..b89201e578 --- /dev/null +++ b/target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts @@ -0,0 +1,395 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8064-v2.0.dtsi" + +#include + +/ { + model = "Ruijie RG-MTFi-M520"; + compatible = "ruijie,rg-mtfi-m520", "qcom,ipq8064"; + + memory@0 { + reg = <0x42000000 0x7e000000>; + device_type = "memory"; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + rsvd@41200000 { + reg = <0x41200000 0x300000>; + no-map; + }; + }; + + aliases { + serial0 = &gsbi4_serial; + mdio-gpio0 = &mdio0; + sdcc1 = &sdcc1; + }; + + chosen { + bootargs = "root=/dev/mmcblk0p3 rootfstype=squashfs,ext4 rootwait noinitrd"; + stdout-path = "serial0:115200n8"; + }; + + soc { + pinmux@800000 { + button_pins: button_pins { + mux { + pins = "gpio54"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + i2c4_pins: i2c4_pinmux { + mux { + pins = "gpio12", "gpio13"; + function = "gsbi4"; + drive-strength = <12>; + bias-disable; + }; + }; + + led_pins: led_pins { + mux { + pins = "gpio7", "gpio8", "gpio9", "gpio53"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + }; + + mdio0_pins: mdio0_pins { + mux { + pins = "gpio0", "gpio1"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + }; + + clk { + pins = "gpio1"; + input-disable; + }; + }; + + rgmii2_pins: rgmii2_pins { + mux { + pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32", + "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62"; + function = "rgmii2"; + drive-strength = <8>; + bias-disable; + }; + + tx { + pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32"; + input-disable; + }; + }; + + sdcc1_pins: sdcc1_pinmux { + mux { + pins = "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47"; + function = "sdc1"; + }; + + cmd { + pins = "gpio45"; + drive-strength = <10>; + bias-pull-up; + }; + + data { + pins = "gpio38", "gpio39", "gpio40", "gpio41", + "gpio43", "gpio44", "gpio46", "gpio47"; + drive-strength = <10>; + bias-pull-up; + }; + + clk { + pins = "gpio42"; + drive-strength = <16>; + bias-disable; + }; + }; + + spi_pins: spi_pins { + mux { + pins = "gpio18", "gpio19", "gpio21"; + function = "gsbi5"; + drive-strength = <10>; + bias-none; + }; + + cs { + pins = "gpio20"; + drive-strength = <12>; + }; + }; + }; + + gsbi@16300000 { + qcom,mode = ; + status = "ok"; + serial@16340000 { + status = "ok"; + }; + /* + * The i2c device on gsbi4 should not be enabled. + * On ipq806x designs gsbi4 i2c is meant for exclusive + * RPM usage. Turning this on in kernel manifests as + * i2c failure for the RPM. + */ + }; + + gsbi5: gsbi@1a200000 { + qcom,mode = ; + status = "ok"; + + spi4: spi@1a280000 { + status = "ok"; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + flash: m25p80@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <51200000>; + reg = <0>; + + SBL1@0 { + label = "SBL1"; + reg = <0x0 0x10000>; + read-only; + }; + + MIBIB@10000 { + label = "MIBIB"; + reg = <0x10000 0x10000>; + read-only; + }; + + SBL2@20000 { + label = "SBL2"; + reg = <0x20000 0x20000>; + read-only; + }; + + SBL3@40000 { + label = "SBL3"; + reg = <0x40000 0x30000>; + read-only; + }; + + DDRCONFIG@70000 { + label = "DDRCONFIG"; + reg = <0x70000 0x10000>; + read-only; + }; + + PRODUCTINFO: PRODUCTINFO@80000 { + label = "PRODUCTINFO"; + reg = <0x80000 0x10000>; + read-only; + }; + + TZ@90000 { + label = "TZ"; + reg = <0x90000 0x30000>; + read-only; + }; + + RPM@c0000 { + label = "RPM"; + reg = <0xc0000 0x20000>; + read-only; + }; + + APPSBL@e0000 { + label = "APPSBL"; + reg = <0xe0000 0x80000>; + read-only; + }; + + APPSBLENV@160000 { + label = "APPSBLENV"; + reg = <0x160000 0x10000>; + read-only; + }; + + BOOTCONFIG@170000 { + label = "BOOTCONFIG"; + reg = <0x170000 0x10000>; + read-only; + }; + + ART@180000 { + label = "ART"; + reg = <0x180000 0x40000>; + read-only; + }; + }; + }; + }; + + sata-phy@1b400000 { + status = "ok"; + }; + + sata@29000000 { + ports-implemented = <0x1>; + status = "ok"; + }; + + phy@100f8800 { /* USB3 port 1 HS phy */ + status = "ok"; + }; + + phy@100f8830 { /* USB3 port 1 SS phy */ + status = "ok"; + }; + + phy@110f8800 { /* USB3 port 0 HS phy */ + status = "ok"; + }; + + phy@110f8830 { /* USB3 port 0 SS phy */ + status = "ok"; + }; + + usb30@0 { + status = "ok"; + }; + + usb30@1 { + status = "ok"; + }; + + pcie0: pci@1b500000 { + status = "ok"; + reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&pcie0_pins>; + pinctrl-names = "default"; + }; + + pcie1: pci@1b700000 { + status = "ok"; + reset-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&pcie1_pins>; + pinctrl-names = "default"; + force_gen1 = <1>; + }; + + mdio0: mdio { + compatible = "virtual,mdio-gpio"; + #address-cells = <1>; + #size-cells = <0>; + gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + phy0: ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x00004 0x7600000 /* PAD0_MODE */ + 0x00008 0x1000000 /* PAD5_MODE */ + 0x0000c 0x80 /* PAD6_MODE */ + 0x000e4 0x6a545 /* MAC_POWER_SEL */ + 0x000e0 0xc74164de /* SGMII_CTRL */ + 0x0007c 0x4e /* PORT0_STATUS */ + 0x00094 0x4e /* PORT6_STATUS */ + >; + }; + + phy4: ethernet-phy@4 { + reg = <4>; + }; + }; + + gmac1: ethernet@37200000 { + status = "ok"; + phy-mode = "rgmii"; + qcom,id = <1>; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + mtd-mac-address-ascii = <&PRODUCTINFO 0x86a>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + gmac2: ethernet@37400000 { + status = "ok"; + phy-mode = "sgmii"; + qcom,id = <2>; + + mtd-mac-address-ascii = <&PRODUCTINFO 0x86a>; + mtd-mac-address-increment = <1>; + mtd-mac-address-increment-byte = <0>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + amba { + sdcc1: sdcc@12400000 { + status = "okay"; + pinctrl-0 = <&sdcc1_pins>; + pinctrl-names = "default"; + }; + }; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + usb_1 { + label = "m520:green:usb_1"; + gpios = <&qcom_pinmux 7 GPIO_ACTIVE_HIGH>; + }; + + usb_3 { + label = "m520:green:usb_3"; + gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>; + }; + + status_green { + label = "m520:green:status"; + gpios = <&qcom_pinmux 9 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&adm_dma { + status = "ok"; +}; diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts new file mode 100644 index 0000000000..b89201e578 --- /dev/null +++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-mtfi-m520.dts @@ -0,0 +1,395 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qcom-ipq8064-v2.0.dtsi" + +#include + +/ { + model = "Ruijie RG-MTFi-M520"; + compatible = "ruijie,rg-mtfi-m520", "qcom,ipq8064"; + + memory@0 { + reg = <0x42000000 0x7e000000>; + device_type = "memory"; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + rsvd@41200000 { + reg = <0x41200000 0x300000>; + no-map; + }; + }; + + aliases { + serial0 = &gsbi4_serial; + mdio-gpio0 = &mdio0; + sdcc1 = &sdcc1; + }; + + chosen { + bootargs = "root=/dev/mmcblk0p3 rootfstype=squashfs,ext4 rootwait noinitrd"; + stdout-path = "serial0:115200n8"; + }; + + soc { + pinmux@800000 { + button_pins: button_pins { + mux { + pins = "gpio54"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + i2c4_pins: i2c4_pinmux { + mux { + pins = "gpio12", "gpio13"; + function = "gsbi4"; + drive-strength = <12>; + bias-disable; + }; + }; + + led_pins: led_pins { + mux { + pins = "gpio7", "gpio8", "gpio9", "gpio53"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + }; + + mdio0_pins: mdio0_pins { + mux { + pins = "gpio0", "gpio1"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + }; + + clk { + pins = "gpio1"; + input-disable; + }; + }; + + rgmii2_pins: rgmii2_pins { + mux { + pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32", + "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62"; + function = "rgmii2"; + drive-strength = <8>; + bias-disable; + }; + + tx { + pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32"; + input-disable; + }; + }; + + sdcc1_pins: sdcc1_pinmux { + mux { + pins = "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", + "gpio43", "gpio44", "gpio45", "gpio46", "gpio47"; + function = "sdc1"; + }; + + cmd { + pins = "gpio45"; + drive-strength = <10>; + bias-pull-up; + }; + + data { + pins = "gpio38", "gpio39", "gpio40", "gpio41", + "gpio43", "gpio44", "gpio46", "gpio47"; + drive-strength = <10>; + bias-pull-up; + }; + + clk { + pins = "gpio42"; + drive-strength = <16>; + bias-disable; + }; + }; + + spi_pins: spi_pins { + mux { + pins = "gpio18", "gpio19", "gpio21"; + function = "gsbi5"; + drive-strength = <10>; + bias-none; + }; + + cs { + pins = "gpio20"; + drive-strength = <12>; + }; + }; + }; + + gsbi@16300000 { + qcom,mode = ; + status = "ok"; + serial@16340000 { + status = "ok"; + }; + /* + * The i2c device on gsbi4 should not be enabled. + * On ipq806x designs gsbi4 i2c is meant for exclusive + * RPM usage. Turning this on in kernel manifests as + * i2c failure for the RPM. + */ + }; + + gsbi5: gsbi@1a200000 { + qcom,mode = ; + status = "ok"; + + spi4: spi@1a280000 { + status = "ok"; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + flash: m25p80@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <51200000>; + reg = <0>; + + SBL1@0 { + label = "SBL1"; + reg = <0x0 0x10000>; + read-only; + }; + + MIBIB@10000 { + label = "MIBIB"; + reg = <0x10000 0x10000>; + read-only; + }; + + SBL2@20000 { + label = "SBL2"; + reg = <0x20000 0x20000>; + read-only; + }; + + SBL3@40000 { + label = "SBL3"; + reg = <0x40000 0x30000>; + read-only; + }; + + DDRCONFIG@70000 { + label = "DDRCONFIG"; + reg = <0x70000 0x10000>; + read-only; + }; + + PRODUCTINFO: PRODUCTINFO@80000 { + label = "PRODUCTINFO"; + reg = <0x80000 0x10000>; + read-only; + }; + + TZ@90000 { + label = "TZ"; + reg = <0x90000 0x30000>; + read-only; + }; + + RPM@c0000 { + label = "RPM"; + reg = <0xc0000 0x20000>; + read-only; + }; + + APPSBL@e0000 { + label = "APPSBL"; + reg = <0xe0000 0x80000>; + read-only; + }; + + APPSBLENV@160000 { + label = "APPSBLENV"; + reg = <0x160000 0x10000>; + read-only; + }; + + BOOTCONFIG@170000 { + label = "BOOTCONFIG"; + reg = <0x170000 0x10000>; + read-only; + }; + + ART@180000 { + label = "ART"; + reg = <0x180000 0x40000>; + read-only; + }; + }; + }; + }; + + sata-phy@1b400000 { + status = "ok"; + }; + + sata@29000000 { + ports-implemented = <0x1>; + status = "ok"; + }; + + phy@100f8800 { /* USB3 port 1 HS phy */ + status = "ok"; + }; + + phy@100f8830 { /* USB3 port 1 SS phy */ + status = "ok"; + }; + + phy@110f8800 { /* USB3 port 0 HS phy */ + status = "ok"; + }; + + phy@110f8830 { /* USB3 port 0 SS phy */ + status = "ok"; + }; + + usb30@0 { + status = "ok"; + }; + + usb30@1 { + status = "ok"; + }; + + pcie0: pci@1b500000 { + status = "ok"; + reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&pcie0_pins>; + pinctrl-names = "default"; + }; + + pcie1: pci@1b700000 { + status = "ok"; + reset-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_LOW>; + pinctrl-0 = <&pcie1_pins>; + pinctrl-names = "default"; + force_gen1 = <1>; + }; + + mdio0: mdio { + compatible = "virtual,mdio-gpio"; + #address-cells = <1>; + #size-cells = <0>; + gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + phy0: ethernet-phy@0 { + reg = <0>; + qca,ar8327-initvals = < + 0x00004 0x7600000 /* PAD0_MODE */ + 0x00008 0x1000000 /* PAD5_MODE */ + 0x0000c 0x80 /* PAD6_MODE */ + 0x000e4 0x6a545 /* MAC_POWER_SEL */ + 0x000e0 0xc74164de /* SGMII_CTRL */ + 0x0007c 0x4e /* PORT0_STATUS */ + 0x00094 0x4e /* PORT6_STATUS */ + >; + }; + + phy4: ethernet-phy@4 { + reg = <4>; + }; + }; + + gmac1: ethernet@37200000 { + status = "ok"; + phy-mode = "rgmii"; + qcom,id = <1>; + + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + + mtd-mac-address-ascii = <&PRODUCTINFO 0x86a>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + gmac2: ethernet@37400000 { + status = "ok"; + phy-mode = "sgmii"; + qcom,id = <2>; + + mtd-mac-address-ascii = <&PRODUCTINFO 0x86a>; + mtd-mac-address-increment = <1>; + mtd-mac-address-increment-byte = <0>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + amba { + sdcc1: sdcc@12400000 { + status = "okay"; + pinctrl-0 = <&sdcc1_pins>; + pinctrl-names = "default"; + }; + }; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + usb_1 { + label = "m520:green:usb_1"; + gpios = <&qcom_pinmux 7 GPIO_ACTIVE_HIGH>; + }; + + usb_3 { + label = "m520:green:usb_3"; + gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>; + }; + + status_green { + label = "m520:green:status"; + gpios = <&qcom_pinmux 9 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&adm_dma { + status = "ok"; +}; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index e413357809..cb39da6f1b 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -260,6 +260,25 @@ define Device/qcom_ipq8064-db149 endef TARGET_DEVICES += qcom_ipq8064-db149 +define Device/ruijie_rg-mtfi-m520 + DEVICE_VENDOR := Ruijie + DEVICE_MODEL := RG-MTFi-M520 + DEVICE_DTS := qcom-ipq8064-mtfi-m520 + KERNEL_SIZE := 4096k + BLOCKSIZE := 64k + BOARD_NAME := rg-mtfi-m520 + KERNEL_SUFFIX := -uImage + KERNEL = kernel-bin | append-dtb | uImage none | pad-to $${KERNEL_SIZE} + KERNEL_NAME := zImage + IMAGES := factory.bin sysupgrade.bin mmcblk0p2-kernel.bin mmcblk0p3-rootfs.bin + IMAGE/factory.bin := qsdk-ipq-factory-nor + IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$${BLOCKSIZE} | sysupgrade-tar rootfs=$$$$@ | append-metadata + IMAGE/mmcblk0p2-kernel.bin := append-kernel | pad-to $$$${KERNEL_SIZE} + IMAGE/mmcblk0p3-rootfs.bin := append-rootfs | pad-rootfs + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct blockd e2fsprogs f2fs-tools kmod-fs-ext4 kmod-fs-f2fs losetup +endef +TARGET_DEVICES += ruijie_rg-mtfi-m520 + define Device/tplink_c2600 $(call Device/TpSafeImage) DEVICE_VENDOR := TP-Link diff --git a/target/linux/ipq806x/patches-4.14/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-4.14/0069-arm-boot-add-dts-files.patch index 07bdd5c3fb..800bba67b3 100644 --- a/target/linux/ipq806x/patches-4.14/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-4.14/0069-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -699,6 +699,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -699,6 +699,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8084-mtp.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \ qcom-ipq8064-ap148.dtb \ @@ -19,6 +19,7 @@ Signed-off-by: John Crispin + qcom-ipq8064-d7800.dtb \ + qcom-ipq8064-db149.dtb \ + qcom-ipq8064-ea8500.dtb \ ++ qcom-ipq8064-mtfi-m520.dtb \ + qcom-ipq8064-r7500.dtb \ + qcom-ipq8064-r7500v2.dtb \ + qcom-ipq8064-wg2600hp.dtb \ diff --git a/target/linux/ipq806x/patches-4.14/851-ata-add-sata-driver.patch b/target/linux/ipq806x/patches-4.14/851-ata-add-sata-driver.patch new file mode 100644 index 0000000000..998e99c721 --- /dev/null +++ b/target/linux/ipq806x/patches-4.14/851-ata-add-sata-driver.patch @@ -0,0 +1,308 @@ +From c5ea64dcf7b5d45e402e78b9f291d521669b7b80 Mon Sep 17 00:00:00 2001 +From: Kumar Gala +Date: Fri, 30 May 2014 15:35:40 -0500 +Subject: [PATCH] ata: Add Qualcomm ARM SoC AHCI SATA host controller driver + +Add support for the Qualcomm AHCI SATA controller that exists on several +SoC and specifically the IPQ806x family of chips. The IPQ806x SATA support +requires the associated IPQ806x SATA PHY Driver to be enabled as well. + +Signed-off-by: Kumar Gala +Signed-off-by: Gokul Sriram Palanisamy +--- + drivers/ata/ahci.h | 2 +- + drivers/ata/ahci_ipq.c | 248 ++++++++++++++++++++++++++++++++++++++ + drivers/ata/Kconfig | 8 ++++++++ + drivers/ata/Makefile | 1 + + 4 files changed, 258 insertions(+), 1 deletions(-) + create mode 100644 drivers/ata/ahci_ipq.c + +--- a/drivers/ata/ahci.h ++++ b/drivers/ata/ahci.h +@@ -54,7 +54,7 @@ + + enum { + AHCI_MAX_PORTS = 32, +- AHCI_MAX_CLKS = 5, ++ AHCI_MAX_CLKS = 6, + AHCI_MAX_SG = 168, /* hardware max is 64K */ + AHCI_DMA_BOUNDARY = 0xffffffff, + AHCI_MAX_CMDS = 32, +--- a/dev/null ++++ b/drivers/ata/ahci_ipq.c +@@ -0,0 +1,248 @@ ++/* Copyright (c) 2015 - 2017, The Linux Foundation. All rights reserved. ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "libata.h" ++#include "ahci.h" ++ ++#define IPQ_DRV_NAME "ahci-ipq" ++ ++struct ipq_ahci_priv { ++ struct platform_device *ahci_pdev; ++ struct ahci_host_priv *hpriv; ++ void *preg_reset; ++ int pstate; ++}; ++ ++struct ipq_ahci_priv *ipqpriv; ++ ++static const struct ata_port_info ipq_ahci_port_info = { ++ .flags = AHCI_FLAG_COMMON, ++ .pio_mask = ATA_PIO4, ++ .udma_mask = ATA_UDMA6, ++ .port_ops = &ahci_platform_ops, ++}; ++ ++static struct scsi_host_template ahci_platform_sht = { ++ AHCI_SHT(IPQ_DRV_NAME), ++}; ++ ++#define SATA_PWR_STATE_DOWN 0x1 ++#define SATA_PWR_STATE_UP 0x2 ++#define SATA_RESET 0x00902c1c ++ ++static void ipq_ahci_hard_reset(struct device *dev) ++{ ++ u32 reg; ++ ++ reg = readl_relaxed(ipqpriv->preg_reset); ++ writel_relaxed(reg | BIT(0), ipqpriv->preg_reset); ++ /* To make sure the write is complete before we move on */ ++ mb(); ++ ++ reg = readl_relaxed(ipqpriv->preg_reset); ++ writel_relaxed(reg & (~BIT(0)), ipqpriv->preg_reset); ++ /* To make sure the write is complete before we move on */ ++ mb(); ++} ++ ++static int ipq_ahci_suspend(struct device *dev) ++{ ++ struct ata_host *host = dev_get_drvdata(dev); ++ struct device_type *apt = &ata_port_type; ++ const struct dev_pm_ops *pm = apt->pm; ++ struct ata_port *ap; ++ int ret = 0, i; ++ ++ if (ipqpriv->pstate == SATA_PWR_STATE_UP) { ++ for (i = 0; i < host->n_ports; i++) { ++ ap = host->ports[i]; ++ /* Issue Port PM Suspend */ ++ ret = pm->runtime_suspend(&ap->tdev); ++ if (ret) { ++ dev_err(dev, "SATA controller port suspend failed\n"); ++ return ret; ++ } ++ } ++ ++ /* Issue Contoller PM Suspend */ ++ ret = ahci_platform_suspend_host(dev); ++ if (ret) { ++ dev_err(dev, "SATA controller host suspend failed\n"); ++ return ret; ++ } ++ ++ for (i = 0; i < ipqpriv->hpriv->nports; i++) { ++ if (!ipqpriv->hpriv->phys[i]) ++ continue; ++ ++ phy_power_off(ipqpriv->hpriv->phys[i]); ++ phy_exit(ipqpriv->hpriv->phys[i]); ++ } ++ ++ ahci_platform_disable_clks(ipqpriv->hpriv); ++ ipqpriv->pstate = SATA_PWR_STATE_DOWN; ++ } else { ++ dev_warn(dev, "SATA device already in suspended state"); ++ } ++ ++ return ret; ++} ++ ++static int ipq_ahci_resume(struct device *dev) ++{ ++ struct ata_host *host = dev_get_drvdata(dev); ++ struct device_type *apt = &ata_port_type; ++ const struct dev_pm_ops *pm = apt->pm; ++ struct ata_port *ap; ++ int ret = 0, i; ++ ++ if (ipqpriv->pstate == SATA_PWR_STATE_DOWN) { ++ ++ ahci_platform_enable_clks(ipqpriv->hpriv); ++ ++ /* Issue SATA clock hard reset */ ++ ipq_ahci_hard_reset(dev); ++ ++ for (i = 0; i < ipqpriv->hpriv->nports; i++) { ++ if (!ipqpriv->hpriv->phys[i]) ++ continue; ++ ++ phy_init(ipqpriv->hpriv->phys[i]); ++ phy_power_on(ipqpriv->hpriv->phys[i]); ++ } ++ ++ /* Issue Contoller PM Resume */ ++ ret = ahci_platform_resume_host(dev); ++ if (ret) { ++ dev_err(dev, "SATA controller resume failed\n"); ++ return ret; ++ } ++ ++ for (i = 0; i < host->n_ports; i++) { ++ /* Issue Port PM Resume */ ++ ap = host->ports[i]; ++ ret = pm->runtime_resume(&ap->tdev); ++ if (ret) { ++ dev_err(dev, "SATA controller port resume failed\n"); ++ return ret; ++ } ++ } ++ ipqpriv->pstate = SATA_PWR_STATE_UP; ++ } else { ++ dev_warn(dev, "SATA device already in resume state"); ++ } ++ ++ return ret; ++} ++ ++static int ipq_ahci_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct ahci_host_priv *hpriv; ++ int rc; ++ ++ hpriv = ahci_platform_get_resources(pdev); ++ if (IS_ERR(hpriv)) ++ return PTR_ERR(hpriv); ++ ++ rc = ahci_platform_enable_resources(hpriv); ++ if (rc) ++ return rc; ++ ++ of_property_read_u32(dev->of_node, ++ "ports-implemented", &hpriv->force_port_map); ++ ++ rc = ahci_platform_init_host(pdev, hpriv, &ipq_ahci_port_info, ++ &ahci_platform_sht); ++ ++ if (rc) ++ goto disable_resources; ++ ++ ipqpriv = devm_kzalloc(dev, sizeof(*ipqpriv), GFP_KERNEL); ++ if (!ipqpriv) { ++ dev_err(dev, "can't alloc ahci_host_priv\n"); ++ rc = -ENOMEM; ++ goto disable_resources; ++ } ++ ++ ipqpriv->ahci_pdev = pdev; ++ ipqpriv->hpriv = hpriv; ++ ipqpriv->pstate = SATA_PWR_STATE_UP; ++ ++ ipqpriv->preg_reset = devm_ioremap(dev, SATA_RESET, ++ sizeof(*(ipqpriv->preg_reset))); ++ ++ if (IS_ERR(ipqpriv->preg_reset)) { ++ dev_err(dev, "can't ioremap for preg_reset\n"); ++ rc = -ENOMEM; ++ goto disable_resources; ++ } ++ ++ return 0; ++ ++ disable_resources: ++ ahci_platform_disable_resources(hpriv); ++ return rc; ++} ++ ++int ipq_ahci_remove(struct platform_device *pdev) ++{ ++ ata_platform_remove_one(pdev); ++ return 0; ++} ++ ++static SIMPLE_DEV_PM_OPS(ipq_ahci_pm_ops, ahci_platform_suspend, ++ ahci_platform_resume); ++ ++static const struct of_device_id ipq_ahci_of_match[] = { ++ { .compatible = "qcom,ipq806x-ahci", }, ++ {}, ++}; ++ ++MODULE_DEVICE_TABLE(of, ipq_ahci_of_match); ++ ++static const struct acpi_device_id ahci_acpi_match[] = { ++ { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) }, ++ {}, ++}; ++ ++MODULE_DEVICE_TABLE(acpi, ahci_acpi_match); ++ ++static struct platform_driver ipq_ahci_driver = { ++ .probe = ipq_ahci_probe, ++ .remove = ipq_ahci_remove, ++ .driver = { ++ .name = IPQ_DRV_NAME, ++ .of_match_table = ipq_ahci_of_match, ++ .acpi_match_table = ahci_acpi_match, ++ .pm = &ipq_ahci_pm_ops, ++ }, ++}; ++ ++module_platform_driver(ipq_ahci_driver); ++ ++MODULE_DESCRIPTION("IPQ806x AHCI SATA platform driver"); ++MODULE_ALIAS("platform:ahci-ipq"); ++MODULE_LICENSE("Dual BSD/GPL"); +--- a/drivers/ata/Kconfig ++++ b/drivers/ata/Kconfig +@@ -162,6 +162,14 @@ config AHCI_IMX + + If unsure, say N. + ++config AHCI_IPQ ++ tristate "Qualcomm Atheros IPQ806X AHCI SATA support" ++ help ++ This option enables support for the IPQ806X SoC's ++ onboard AHCI SATA. ++ ++ If unsure, say N. ++ + config AHCI_CEVA + tristate "CEVA AHCI SATA support" + depends on OF +--- a/drivers/ata/Makefile ++++ b/drivers/ata/Makefile +@@ -18,6 +18,7 @@ + obj-$(CONFIG_AHCI_DA850) += ahci_da850.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_DM816) += ahci_dm816.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_IMX) += ahci_imx.o libahci.o libahci_platform.o ++obj-$(CONFIG_AHCI_IPQ) += ahci_ipq.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_MTK) += ahci_mtk.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_MVEBU) += ahci_mvebu.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_OCTEON) += ahci_octeon.o diff --git a/target/linux/ipq806x/patches-4.19/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-4.19/0069-arm-boot-add-dts-files.patch index 8e77e34feb..96db8c5959 100644 --- a/target/linux/ipq806x/patches-4.19/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-4.19/0069-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -791,6 +791,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -791,6 +791,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-ipq4019-ap.dk07.1-c1.dtb \ qcom-ipq4019-ap.dk07.1-c2.dtb \ qcom-ipq8064-ap148.dtb \ @@ -19,6 +19,7 @@ Signed-off-by: John Crispin + qcom-ipq8064-d7800.dtb \ + qcom-ipq8064-db149.dtb \ + qcom-ipq8064-ea8500.dtb \ ++ qcom-ipq8064-mtfi-m520.dtb \ + qcom-ipq8064-r7500.dtb \ + qcom-ipq8064-r7500v2.dtb \ + qcom-ipq8064-wg2600hp.dtb \ diff --git a/target/linux/ipq806x/patches-4.19/851-ata-add-sata-driver.patch b/target/linux/ipq806x/patches-4.19/851-ata-add-sata-driver.patch new file mode 100644 index 0000000000..998e99c721 --- /dev/null +++ b/target/linux/ipq806x/patches-4.19/851-ata-add-sata-driver.patch @@ -0,0 +1,308 @@ +From c5ea64dcf7b5d45e402e78b9f291d521669b7b80 Mon Sep 17 00:00:00 2001 +From: Kumar Gala +Date: Fri, 30 May 2014 15:35:40 -0500 +Subject: [PATCH] ata: Add Qualcomm ARM SoC AHCI SATA host controller driver + +Add support for the Qualcomm AHCI SATA controller that exists on several +SoC and specifically the IPQ806x family of chips. The IPQ806x SATA support +requires the associated IPQ806x SATA PHY Driver to be enabled as well. + +Signed-off-by: Kumar Gala +Signed-off-by: Gokul Sriram Palanisamy +--- + drivers/ata/ahci.h | 2 +- + drivers/ata/ahci_ipq.c | 248 ++++++++++++++++++++++++++++++++++++++ + drivers/ata/Kconfig | 8 ++++++++ + drivers/ata/Makefile | 1 + + 4 files changed, 258 insertions(+), 1 deletions(-) + create mode 100644 drivers/ata/ahci_ipq.c + +--- a/drivers/ata/ahci.h ++++ b/drivers/ata/ahci.h +@@ -54,7 +54,7 @@ + + enum { + AHCI_MAX_PORTS = 32, +- AHCI_MAX_CLKS = 5, ++ AHCI_MAX_CLKS = 6, + AHCI_MAX_SG = 168, /* hardware max is 64K */ + AHCI_DMA_BOUNDARY = 0xffffffff, + AHCI_MAX_CMDS = 32, +--- a/dev/null ++++ b/drivers/ata/ahci_ipq.c +@@ -0,0 +1,248 @@ ++/* Copyright (c) 2015 - 2017, The Linux Foundation. All rights reserved. ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "libata.h" ++#include "ahci.h" ++ ++#define IPQ_DRV_NAME "ahci-ipq" ++ ++struct ipq_ahci_priv { ++ struct platform_device *ahci_pdev; ++ struct ahci_host_priv *hpriv; ++ void *preg_reset; ++ int pstate; ++}; ++ ++struct ipq_ahci_priv *ipqpriv; ++ ++static const struct ata_port_info ipq_ahci_port_info = { ++ .flags = AHCI_FLAG_COMMON, ++ .pio_mask = ATA_PIO4, ++ .udma_mask = ATA_UDMA6, ++ .port_ops = &ahci_platform_ops, ++}; ++ ++static struct scsi_host_template ahci_platform_sht = { ++ AHCI_SHT(IPQ_DRV_NAME), ++}; ++ ++#define SATA_PWR_STATE_DOWN 0x1 ++#define SATA_PWR_STATE_UP 0x2 ++#define SATA_RESET 0x00902c1c ++ ++static void ipq_ahci_hard_reset(struct device *dev) ++{ ++ u32 reg; ++ ++ reg = readl_relaxed(ipqpriv->preg_reset); ++ writel_relaxed(reg | BIT(0), ipqpriv->preg_reset); ++ /* To make sure the write is complete before we move on */ ++ mb(); ++ ++ reg = readl_relaxed(ipqpriv->preg_reset); ++ writel_relaxed(reg & (~BIT(0)), ipqpriv->preg_reset); ++ /* To make sure the write is complete before we move on */ ++ mb(); ++} ++ ++static int ipq_ahci_suspend(struct device *dev) ++{ ++ struct ata_host *host = dev_get_drvdata(dev); ++ struct device_type *apt = &ata_port_type; ++ const struct dev_pm_ops *pm = apt->pm; ++ struct ata_port *ap; ++ int ret = 0, i; ++ ++ if (ipqpriv->pstate == SATA_PWR_STATE_UP) { ++ for (i = 0; i < host->n_ports; i++) { ++ ap = host->ports[i]; ++ /* Issue Port PM Suspend */ ++ ret = pm->runtime_suspend(&ap->tdev); ++ if (ret) { ++ dev_err(dev, "SATA controller port suspend failed\n"); ++ return ret; ++ } ++ } ++ ++ /* Issue Contoller PM Suspend */ ++ ret = ahci_platform_suspend_host(dev); ++ if (ret) { ++ dev_err(dev, "SATA controller host suspend failed\n"); ++ return ret; ++ } ++ ++ for (i = 0; i < ipqpriv->hpriv->nports; i++) { ++ if (!ipqpriv->hpriv->phys[i]) ++ continue; ++ ++ phy_power_off(ipqpriv->hpriv->phys[i]); ++ phy_exit(ipqpriv->hpriv->phys[i]); ++ } ++ ++ ahci_platform_disable_clks(ipqpriv->hpriv); ++ ipqpriv->pstate = SATA_PWR_STATE_DOWN; ++ } else { ++ dev_warn(dev, "SATA device already in suspended state"); ++ } ++ ++ return ret; ++} ++ ++static int ipq_ahci_resume(struct device *dev) ++{ ++ struct ata_host *host = dev_get_drvdata(dev); ++ struct device_type *apt = &ata_port_type; ++ const struct dev_pm_ops *pm = apt->pm; ++ struct ata_port *ap; ++ int ret = 0, i; ++ ++ if (ipqpriv->pstate == SATA_PWR_STATE_DOWN) { ++ ++ ahci_platform_enable_clks(ipqpriv->hpriv); ++ ++ /* Issue SATA clock hard reset */ ++ ipq_ahci_hard_reset(dev); ++ ++ for (i = 0; i < ipqpriv->hpriv->nports; i++) { ++ if (!ipqpriv->hpriv->phys[i]) ++ continue; ++ ++ phy_init(ipqpriv->hpriv->phys[i]); ++ phy_power_on(ipqpriv->hpriv->phys[i]); ++ } ++ ++ /* Issue Contoller PM Resume */ ++ ret = ahci_platform_resume_host(dev); ++ if (ret) { ++ dev_err(dev, "SATA controller resume failed\n"); ++ return ret; ++ } ++ ++ for (i = 0; i < host->n_ports; i++) { ++ /* Issue Port PM Resume */ ++ ap = host->ports[i]; ++ ret = pm->runtime_resume(&ap->tdev); ++ if (ret) { ++ dev_err(dev, "SATA controller port resume failed\n"); ++ return ret; ++ } ++ } ++ ipqpriv->pstate = SATA_PWR_STATE_UP; ++ } else { ++ dev_warn(dev, "SATA device already in resume state"); ++ } ++ ++ return ret; ++} ++ ++static int ipq_ahci_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct ahci_host_priv *hpriv; ++ int rc; ++ ++ hpriv = ahci_platform_get_resources(pdev); ++ if (IS_ERR(hpriv)) ++ return PTR_ERR(hpriv); ++ ++ rc = ahci_platform_enable_resources(hpriv); ++ if (rc) ++ return rc; ++ ++ of_property_read_u32(dev->of_node, ++ "ports-implemented", &hpriv->force_port_map); ++ ++ rc = ahci_platform_init_host(pdev, hpriv, &ipq_ahci_port_info, ++ &ahci_platform_sht); ++ ++ if (rc) ++ goto disable_resources; ++ ++ ipqpriv = devm_kzalloc(dev, sizeof(*ipqpriv), GFP_KERNEL); ++ if (!ipqpriv) { ++ dev_err(dev, "can't alloc ahci_host_priv\n"); ++ rc = -ENOMEM; ++ goto disable_resources; ++ } ++ ++ ipqpriv->ahci_pdev = pdev; ++ ipqpriv->hpriv = hpriv; ++ ipqpriv->pstate = SATA_PWR_STATE_UP; ++ ++ ipqpriv->preg_reset = devm_ioremap(dev, SATA_RESET, ++ sizeof(*(ipqpriv->preg_reset))); ++ ++ if (IS_ERR(ipqpriv->preg_reset)) { ++ dev_err(dev, "can't ioremap for preg_reset\n"); ++ rc = -ENOMEM; ++ goto disable_resources; ++ } ++ ++ return 0; ++ ++ disable_resources: ++ ahci_platform_disable_resources(hpriv); ++ return rc; ++} ++ ++int ipq_ahci_remove(struct platform_device *pdev) ++{ ++ ata_platform_remove_one(pdev); ++ return 0; ++} ++ ++static SIMPLE_DEV_PM_OPS(ipq_ahci_pm_ops, ahci_platform_suspend, ++ ahci_platform_resume); ++ ++static const struct of_device_id ipq_ahci_of_match[] = { ++ { .compatible = "qcom,ipq806x-ahci", }, ++ {}, ++}; ++ ++MODULE_DEVICE_TABLE(of, ipq_ahci_of_match); ++ ++static const struct acpi_device_id ahci_acpi_match[] = { ++ { ACPI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff) }, ++ {}, ++}; ++ ++MODULE_DEVICE_TABLE(acpi, ahci_acpi_match); ++ ++static struct platform_driver ipq_ahci_driver = { ++ .probe = ipq_ahci_probe, ++ .remove = ipq_ahci_remove, ++ .driver = { ++ .name = IPQ_DRV_NAME, ++ .of_match_table = ipq_ahci_of_match, ++ .acpi_match_table = ahci_acpi_match, ++ .pm = &ipq_ahci_pm_ops, ++ }, ++}; ++ ++module_platform_driver(ipq_ahci_driver); ++ ++MODULE_DESCRIPTION("IPQ806x AHCI SATA platform driver"); ++MODULE_ALIAS("platform:ahci-ipq"); ++MODULE_LICENSE("Dual BSD/GPL"); +--- a/drivers/ata/Kconfig ++++ b/drivers/ata/Kconfig +@@ -162,6 +162,14 @@ config AHCI_IMX + + If unsure, say N. + ++config AHCI_IPQ ++ tristate "Qualcomm Atheros IPQ806X AHCI SATA support" ++ help ++ This option enables support for the IPQ806X SoC's ++ onboard AHCI SATA. ++ ++ If unsure, say N. ++ + config AHCI_CEVA + tristate "CEVA AHCI SATA support" + depends on OF +--- a/drivers/ata/Makefile ++++ b/drivers/ata/Makefile +@@ -18,6 +18,7 @@ + obj-$(CONFIG_AHCI_DA850) += ahci_da850.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_DM816) += ahci_dm816.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_IMX) += ahci_imx.o libahci.o libahci_platform.o ++obj-$(CONFIG_AHCI_IPQ) += ahci_ipq.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_MTK) += ahci_mtk.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_MVEBU) += ahci_mvebu.o libahci.o libahci_platform.o + obj-$(CONFIG_AHCI_OCTEON) += ahci_octeon.o