Moving sunxi-next to 4.17.y (#1049)
* [Early WIP] Update sunxi-next to kernel 4.17 * Switch Allwinner 32 and 64bit to U-boot 2018.05 * Adjust patched for 4.17.y / sunxi-next - adjust both configurations - removing FAT support from u-boot (breaks if you try to save) Tested those boards: Cubietruck: wlan fails http://ix.io/1fYS USB OK, HDMI yes Bananapi R40: http://ix.io/1fZm USB OK, HDMI yes Lime A64: USB no, HDMI no, wireless buggy, eMMC yes Orangepi prime H5: OK http://ix.io/1fZJ DVFS no Orangepi2e: DVFS OK, HDMI OK, net OK, wifi OK, eMMC ok, http://ix.io/1fZT * Kernel config update, enabling HDMI on CT+ * Trying to fix A64 HDMI but failed. Fixed M64 ethernet instead * Update orangepioneplus.wip * Update orangepioneplus.wip * Fix H6 build process * Add regulator bits for Orangepizero+, thanks to @5kft * add H5 support for optional 1.3v regulator and 1.3GHz operation This patch adds two optional overlays that can be used to: 1) enable the 1.1v/1.3v regulator on boards that provide the necessary compatible H/W support 2) modify the default CPU clock operating table to add new 1.2GHz and 1.3GHz clocks Note that the generated regulator overlay will only support boards whose 1.1v/1.3v regulator is controlled by GPIO PL6. * updates for the NanoPi NEO Plus2 This change introduces a patch that provides two changes for the NanoPi NEO Plus2: * Configure the "cpu0" to use the "vdd_cpux" regulator; this enables the ability to use higher CPU clocks * Correct the configurations of the on-board power and status LEDs * Adjust nightly building and few boards config cleanup
This commit is contained in:
parent
1d18b1ea1b
commit
1a12994e79
@ -5,4 +5,4 @@ BOOTCONFIG=Awsom_defconfig
|
||||
MODULES="hci_uart gpio_sunxi rfcomm hidp bonding spi_sun7i"
|
||||
MODULES_NEXT="bonding"
|
||||
#
|
||||
KERNEL_TARGET=""
|
||||
KERNEL_TARGET="next"
|
||||
|
||||
@ -9,5 +9,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default,next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -12,5 +12,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default,next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -10,6 +10,4 @@ KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET=""
|
||||
#
|
||||
BOARDRATING=""
|
||||
HARDWARE="https://linux-sunxi.org/Banana_Pi_M3"
|
||||
FORUMS="http://forum.armbian.com/index.php/forum/11-other-boards/"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -9,5 +9,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default,next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -12,5 +12,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default,next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -9,4 +9,4 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default,next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
11
config/boards/cubietruckplus.csc
Normal file
11
config/boards/cubietruckplus.csc
Normal file
@ -0,0 +1,11 @@
|
||||
# A83T octa core 2Gb SoC Wifi
|
||||
BOARD_NAME="Cubietruck+"
|
||||
BOARDFAMILY="sun8i"
|
||||
BOOTCONFIG="Cubietruck_plus_defconfig"
|
||||
MODULES=""
|
||||
MODULES_NEXT=""
|
||||
OVERLAY_PREFIX="sun8i-a83t"
|
||||
#
|
||||
KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET=""
|
||||
@ -10,4 +10,4 @@ KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET="stretch:next"
|
||||
DESKTOP_TARGET=""
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -9,4 +9,4 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default,next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -11,4 +11,4 @@ CLI_TARGET="stretch:default,next"
|
||||
DESKTOP_TARGET="xenial:default,next"
|
||||
#
|
||||
CLI_BETA_TARGET=""
|
||||
DESKTOP_BETA_TARGET=""
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -14,4 +14,4 @@ BUILD_DESKTOP="no"
|
||||
KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -13,4 +13,4 @@ BUILD_DESKTOP="no"
|
||||
KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -12,5 +12,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -12,4 +12,4 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch:next"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -11,5 +11,5 @@ KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET=""
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET=""
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -14,4 +14,4 @@ BUILD_DESKTOP="no"
|
||||
KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -14,4 +14,4 @@ BUILD_DESKTOP="no"
|
||||
KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -14,4 +14,4 @@ BUILD_DESKTOP="no"
|
||||
KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET="stretch:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -14,4 +14,4 @@ BUILD_DESKTOP="no"
|
||||
KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -12,4 +12,4 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -12,4 +12,4 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="stretch:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -6,9 +6,9 @@ BOOTCONFIG="orangepi_lite2_defconfig"
|
||||
MODULES=""
|
||||
MODULES_NEXT=""
|
||||
#
|
||||
KERNEL_TARGET="dev"
|
||||
KERNEL_TARGET="next"
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET=""
|
||||
#
|
||||
CLI_BETA_TARGET="stretch:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="stretch:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -12,4 +12,4 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -6,9 +6,9 @@ BOOTCONFIG="orangepi_one_plus_defconfig"
|
||||
MODULES=""
|
||||
MODULES_NEXT=""
|
||||
#
|
||||
KERNEL_TARGET="dev"
|
||||
KERNEL_TARGET="next"
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET=""
|
||||
#
|
||||
CLI_BETA_TARGET="stretch:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="stretch:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -12,4 +12,4 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -11,4 +11,4 @@ KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -11,4 +11,4 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -12,5 +12,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -12,5 +12,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -11,5 +11,5 @@ KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -13,5 +13,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="xenial:default"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -14,4 +14,4 @@ BUILD_DESKTOP="no"
|
||||
KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -13,4 +13,4 @@ BUILD_DESKTOP="no"
|
||||
KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -14,5 +14,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -14,4 +14,4 @@ BUILD_DESKTOP="no"
|
||||
KERNEL_TARGET="next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
|
||||
@ -11,5 +11,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="jessie,xenial:default"
|
||||
DESKTOP_TARGET="xenial:default"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -11,5 +11,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="xenial:default"
|
||||
DESKTOP_TARGET=""
|
||||
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="bionic:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -6,9 +6,9 @@ BOOTCONFIG="pine_h64_defconfig"
|
||||
MODULES=""
|
||||
MODULES_NEXT=""
|
||||
#
|
||||
KERNEL_TARGET="dev"
|
||||
KERNEL_TARGET="next"
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET=""
|
||||
#
|
||||
CLI_BETA_TARGET="stretch:dev"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
CLI_BETA_TARGET="stretch:next"
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -9,13 +9,6 @@ MODULES_NEXT=""
|
||||
KERNEL_TARGET="default"
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET=""
|
||||
|
||||
CLI_BETA_TARGET="xenial:default,stretch:dev"
|
||||
DESKTOP_BETA_TARGET="stretch:default"
|
||||
#
|
||||
RECOMMENDED="Debian_stretch_default_desktop_nightly:50"
|
||||
#
|
||||
CHIP="https://en.wikipedia.org/wiki/Rockchip#RK33xx_series"
|
||||
HARDWARE="http://www.t-firefly.com/doc/product/info/id/245.html"
|
||||
FORUMS="https://forum.armbian.com/index.php?/forum/21-rockchip"
|
||||
BUY="http://store.t-firefly.com/goods.php?id=66"
|
||||
CLI_BETA_TARGET=""
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -14,5 +14,5 @@ KERNEL_TARGET="default,next,dev"
|
||||
CLI_TARGET="stretch,xenial:next"
|
||||
DESKTOP_TARGET="stretch:next"
|
||||
#
|
||||
CLI_BETA_TARGET="bionic:dev"
|
||||
CLI_BETA_TARGET=""
|
||||
DESKTOP_BETA_TARGET=""
|
||||
|
||||
@ -10,11 +10,5 @@ KERNEL_TARGET="default"
|
||||
CLI_TARGET=""
|
||||
DESKTOP_TARGET="stretch:default"
|
||||
#
|
||||
CLI_BETA_TARGET="stretch:dev"
|
||||
CLI_BETA_TARGET=""
|
||||
DESKTOP_BETA_TARGET=""
|
||||
#
|
||||
RECOMMENDED="Debian_stretch_default_desktop:75"
|
||||
#
|
||||
CHIP="https://en.wikipedia.org/wiki/Rockchip#RK33xx_series"
|
||||
HARDWARE="https://www.pine64.org/?page_id=7147"
|
||||
FORUMS="https://forum.armbian.com/index.php?/forum/21-rockchip"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ GOVERNOR=ondemand
|
||||
ASOUND_STATE='asound.state.sun50iw2-dev'
|
||||
|
||||
case $BRANCH in
|
||||
dev)
|
||||
next)
|
||||
ATFSOURCE='https://github.com/Icenowy/arm-trusted-firmware'
|
||||
ATFDIR='arm-trusted-firmware-sunxi-mainline'
|
||||
ATFBRANCH='branch:h6-smp'
|
||||
@ -28,9 +28,10 @@ case $BRANCH in
|
||||
|
||||
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
||||
KERNELBRANCH='branch:master'
|
||||
KERNELBRANCH='branch:linux-4.17.y'
|
||||
KERNELDIR=$MAINLINE_KERNEL_DIR
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
KERNELPATCHDIR='sunxi-dev'
|
||||
KERNELPATCHDIR='sunxi-next'
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@ -2,57 +2,55 @@ ARCH=arm64
|
||||
KERNEL_IMAGE_TYPE=Image
|
||||
BOOTDELAY=1
|
||||
|
||||
BOOTSOURCE=$MAINLINE_UBOOT_SOURCE
|
||||
BOOTDIR=$MAINLINE_UBOOT_DIR
|
||||
BOOTBRANCH='tag:v2018.05'
|
||||
BOOTPATCHDIR='u-boot-sunxi'
|
||||
UBOOT_USE_GCC='> 7.0'
|
||||
UBOOT_TARGET_MAP=';;spl/sunxi-spl.bin u-boot.itb'
|
||||
BOOTSCRIPT='boot-sun50i-next.cmd:boot.cmd'
|
||||
|
||||
# Here we want to rename LINUXFAMILY from sun50iw1, sun50iw2, etc for next and dev branches
|
||||
# since this doesn't affect any stable images don't add any backwards compatibility hacks
|
||||
[[ $BRANCH != default ]] && LINUXFAMILY=sunxi64
|
||||
|
||||
case $BRANCH in
|
||||
default)
|
||||
CAN_BUILD_STRETCH=no
|
||||
|
||||
CAN_BUILD_STRETCH=no
|
||||
|
||||
;;
|
||||
|
||||
next)
|
||||
ATFSOURCE='https://github.com/apritzel/arm-trusted-firmware'
|
||||
ATFDIR='arm-trusted-firmware-sunxi-mainline'
|
||||
ATFBRANCH='branch:allwinner'
|
||||
ATF_USE_GCC='> 6.3'
|
||||
ATF_TARGET_MAP='PLAT=sun50iw1p1 DEBUG=1 bl31;;build/sun50iw1p1/debug/bl31.bin'
|
||||
|
||||
BOOTSOURCE=$MAINLINE_UBOOT_SOURCE
|
||||
BOOTDIR=$MAINLINE_UBOOT_DIR
|
||||
BOOTBRANCH='tag:v2017.11'
|
||||
BOOTPATCHDIR='u-boot-sunxi'
|
||||
UBOOT_USE_GCC='> 7.0'
|
||||
UBOOT_TARGET_MAP=';;spl/sunxi-spl.bin u-boot.itb'
|
||||
BOOTSCRIPT='boot-sun50i-next.cmd:boot.cmd'
|
||||
ATFSOURCE='https://github.com/apritzel/arm-trusted-firmware'
|
||||
ATFDIR='arm-trusted-firmware-sunxi-mainline'
|
||||
ATFBRANCH='branch:allwinner'
|
||||
ATF_USE_GCC='> 6.3'
|
||||
ATF_TARGET_MAP='PLAT=sun50iw1p1 DEBUG=1 bl31;;build/sun50iw1p1/debug/bl31.bin'
|
||||
|
||||
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
||||
KERNELBRANCH='branch:linux-4.17.y'
|
||||
KERNELDIR=$MAINLINE_KERNEL_DIR
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
KERNELPATCHDIR='sunxi-next'
|
||||
|
||||
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
||||
KERNELBRANCH='branch:linux-4.14.y'
|
||||
KERNELDIR=$MAINLINE_KERNEL_DIR
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
KERNELPATCHDIR='sunxi-next'
|
||||
;;
|
||||
|
||||
dev)
|
||||
ATFSOURCE='https://github.com/apritzel/arm-trusted-firmware'
|
||||
ATFDIR='arm-trusted-firmware-sunxi-mainline'
|
||||
ATFBRANCH='branch:allwinner'
|
||||
ATF_USE_GCC='> 6.3'
|
||||
ATF_TARGET_MAP='PLAT=sun50iw1p1 DEBUG=1 bl31;;build/sun50iw1p1/debug/bl31.bin'
|
||||
|
||||
BOOTSOURCE=$MAINLINE_UBOOT_SOURCE
|
||||
BOOTDIR=$MAINLINE_UBOOT_DIR
|
||||
BOOTBRANCH='tag:v2018.05'
|
||||
BOOTPATCHDIR='u-boot-sunxi-dev'
|
||||
UBOOT_USE_GCC='> 7.0'
|
||||
UBOOT_TARGET_MAP=';;spl/sunxi-spl.bin u-boot.itb'
|
||||
BOOTSCRIPT='boot-sun50i-next.cmd:boot.cmd'
|
||||
ATFSOURCE='https://github.com/apritzel/arm-trusted-firmware'
|
||||
ATFDIR='arm-trusted-firmware-sunxi-mainline'
|
||||
ATFBRANCH='branch:allwinner'
|
||||
ATF_USE_GCC='> 6.3'
|
||||
ATF_TARGET_MAP='PLAT=sun50iw1p1 DEBUG=1 bl31;;build/sun50iw1p1/debug/bl31.bin'
|
||||
|
||||
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
||||
KERNELBRANCH='branch:master'
|
||||
KERNELDIR=$MAINLINE_KERNEL_DIR
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
KERNELPATCHDIR='sunxi-dev'
|
||||
|
||||
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
||||
KERNELBRANCH='branch:linux-4.17.y'
|
||||
KERNELDIR=$MAINLINE_KERNEL_DIR
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
KERNELPATCHDIR='sunxi-dev'
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
BOOTSOURCE=$MAINLINE_UBOOT_SOURCE
|
||||
BOOTDIR=$MAINLINE_UBOOT_DIR
|
||||
BOOTBRANCH='tag:v2017.11'
|
||||
BOOTBRANCH='tag:v2018.05'
|
||||
BOOTSCRIPT="boot-sunxi.cmd:boot.cmd"
|
||||
BOOTENV_FILE='sunxi-default.txt'
|
||||
BOOTPATCHDIR='u-boot-sunxi'
|
||||
@ -11,35 +11,37 @@ UBOOT_USE_GCC='> 7.0'
|
||||
UBOOT_FW_ENV='0x88000,0x20000' # /etc/fw_env.config offset and env size
|
||||
|
||||
BOOTDELAY=1
|
||||
GOVERNOR=ondemand
|
||||
|
||||
# Here we want to rename LINUXFAMILY from sun4i, sun5i, etc for next and dev branches
|
||||
[[ $BRANCH != default ]] && LINUXFAMILY=sunxi
|
||||
|
||||
case $BRANCH in
|
||||
default)
|
||||
GOVERNOR=interactive
|
||||
CAN_BUILD_STRETCH=no
|
||||
|
||||
GOVERNOR=interactive
|
||||
CAN_BUILD_STRETCH=no
|
||||
|
||||
;;
|
||||
|
||||
next)
|
||||
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
||||
KERNELBRANCH='branch:linux-4.14.y'
|
||||
KERNELDIR=$MAINLINE_KERNEL_DIR
|
||||
|
||||
GOVERNOR=ondemand
|
||||
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
||||
KERNELBRANCH='branch:linux-4.17.y'
|
||||
KERNELDIR=$MAINLINE_KERNEL_DIR
|
||||
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
;;
|
||||
|
||||
dev)
|
||||
BOOTBRANCH='tag:v2018.05'
|
||||
BOOTPATCHDIR='u-boot-sunxi-dev'
|
||||
|
||||
GOVERNOR=ondemand
|
||||
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
||||
KERNELBRANCH='branch:linux-4.17.y'
|
||||
KERNELDIR=$MAINLINE_KERNEL_DIR
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
KERNELSOURCE=$MAINLINE_KERNEL_SOURCE
|
||||
KERNELBRANCH='branch:master'
|
||||
KERNELDIR=$MAINLINE_KERNEL_DIR
|
||||
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@ -149,6 +149,7 @@ compile_uboot()
|
||||
[[ -f .config ]] && sed -i 's/CONFIG_LOCALVERSION=""/CONFIG_LOCALVERSION="-armbian"/g' .config
|
||||
[[ -f .config ]] && sed -i 's/CONFIG_LOCALVERSION_AUTO=.*/# CONFIG_LOCALVERSION_AUTO is not set/g' .config
|
||||
if [[ $BOOTBRANCH == "tag:v2018".* ]]; then
|
||||
[[ -f .config ]] && sed -i 's/^.*CONFIG_ENV_IS_IN_FAT.*/# CONFIG_ENV_IS_IN_FAT is not set/g' .config
|
||||
[[ -f .config ]] && sed -i 's/^.*CONFIG_ENV_IS_IN_EXT4.*/CONFIG_ENV_IS_IN_EXT4=y/g' .config
|
||||
[[ -f .config ]] && sed -i 's/^.*CONFIG_ENV_IS_IN_MMC.*/# CONFIG_ENV_IS_IN_MMC is not set/g' .config
|
||||
[[ -f .config ]] && sed -i 's/^.*CONFIG_ENV_IS_NOWHERE.*/# CONFIG_ENV_IS_NOWHERE is not set/g' .config | echo "# CONFIG_ENV_IS_NOWHERE is not set" >> .config
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
|
||||
index bd0c476..5791e43 100644
|
||||
--- a/arch/arm/boot/dts/sun7i-a20.dtsi
|
||||
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi
|
||||
@@ -1389,6 +1389,58 @@
|
||||
allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
};
|
||||
+
|
||||
+ nand_pins_a: nand_base0@0 {
|
||||
+ allwinner,pins = "PC0", "PC1", "PC2",
|
||||
+ "PC5", "PC8", "PC9", "PC10",
|
||||
+ "PC11", "PC12", "PC13", "PC14",
|
||||
+ "PC15", "PC16";
|
||||
+ allwinner,function = "nand0";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
+
|
||||
+ nand_cs0_pins_a: nand_cs@0 {
|
||||
+ allwinner,pins = "PC4";
|
||||
+ allwinner,function = "nand0";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
+
|
||||
+ nand_cs1_pins_a: nand_cs@1 {
|
||||
+ allwinner,pins = "PC3";
|
||||
+ allwinner,function = "nand0";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
+
|
||||
+ nand_cs2_pins_a: nand_cs@2 {
|
||||
+ allwinner,pins = "PC17";
|
||||
+ allwinner,function = "nand0";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
+
|
||||
+ nand_cs3_pins_a: nand_cs@3 {
|
||||
+ allwinner,pins = "PC18";
|
||||
+ allwinner,function = "nand0";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
+
|
||||
+ nand_rb0_pins_a: nand_rb@0 {
|
||||
+ allwinner,pins = "PC6";
|
||||
+ allwinner,function = "nand0";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
+
|
||||
+ nand_rb1_pins_a: nand_rb@1 {
|
||||
+ allwinner,pins = "PC7";
|
||||
+ allwinner,function = "nand0";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
};
|
||||
|
||||
timer@01c20c00 {
|
||||
@ -1,23 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
|
||||
index 7e3006f..de809ec 100644
|
||||
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
|
||||
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
|
||||
@@ -213,6 +213,18 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&nfc {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&nand_pins_a>, <&nand_cs0_pins_a>, <&nand_rb0_pins_a>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ nand@0 {
|
||||
+ reg = <0>;
|
||||
+ allwinner,rb = <0>;
|
||||
+ nand-ecc-mode = "hw";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&ohci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@ -1,60 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
|
||||
index 7e3006f..7e44d19 100644
|
||||
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
|
||||
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
|
||||
@@ -213,6 +213,55 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&nfc {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&nand_pins_a>, <&nand_cs0_pins_a>, <&nand_rb0_pins_a>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ nand@0 {
|
||||
+ reg = <0>;
|
||||
+ allwinner,rb = <0>;
|
||||
+ nand-ecc-mode = "hw";
|
||||
+ nand-on-flash-bbt;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <2>;
|
||||
+ #size-cells = <2>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "SPL";
|
||||
+ reg = <0x0 0x0 0x0 0x400000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@400000 {
|
||||
+ label = "SPL.backup";
|
||||
+ reg = <0x0 0x400000 0x0 0x400000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@800000 {
|
||||
+ label = "U-Boot";
|
||||
+ reg = <0x0 0x800000 0x0 0x400000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@c00000 {
|
||||
+ label = "U-Boot.backup";
|
||||
+ reg = <0x0 0xc00000 0x0 0x400000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@1000000 {
|
||||
+ label = "env";
|
||||
+ reg = <0x0 0x1000000 0x0 0x400000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@1400000 {
|
||||
+ label = "rootfs";
|
||||
+ reg = <0x0 0x1400000 0x0 0xff000000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&ohci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@ -1,61 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
|
||||
index 83f39b0..dc1d42b 100644
|
||||
--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
|
||||
+++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
|
||||
@@ -210,6 +210,56 @@
|
||||
allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
|
||||
};
|
||||
|
||||
+&nfc {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&nand_pins_a>, <&nand_cs0_pins_a>, <&nand_rb0_pins_a>;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ nand@0 {
|
||||
+ reg = <0>;
|
||||
+ allwinner,rb = <0>;
|
||||
+ nand-ecc-mode = "hw";
|
||||
+ nand-on-flash-bbt;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <2>;
|
||||
+ #size-cells = <2>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ label = "SPL";
|
||||
+ reg = <0x0 0x0 0x0 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@200000 {
|
||||
+ label = "SPL.backup";
|
||||
+ reg = <0x0 0x200000 0x0 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@400000 {
|
||||
+ label = "U-Boot";
|
||||
+ reg = <0x0 0x400000 0x0 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@600000 {
|
||||
+ label = "U-Boot.backup";
|
||||
+ reg = <0x0 0x600000 0x0 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@800000 {
|
||||
+ label = "env";
|
||||
+ reg = <0x0 0x800000 0x0 0x200000>;
|
||||
+ read-only;
|
||||
+ };
|
||||
+
|
||||
+ partition@a00000 {
|
||||
+ label = "rootfs";
|
||||
+ reg = <0x0 0xa00000 0x01 0xff000000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&ohci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@ -1,397 +0,0 @@
|
||||
From ba9ba2949e86b5a00b0ae89b5e298b4cd46118ee Mon Sep 17 00:00:00 2001
|
||||
From: wuweidong <625769020@qq.com>
|
||||
Date: Mon, 27 Nov 2017 10:23:51 +0800
|
||||
Subject: [PATCH] arm64: dts: sun50i-h5-nanopi: Add a new board NanoPi K1 Plus
|
||||
|
||||
---
|
||||
arch/arm64/boot/dts/allwinner/Makefile | 1 +
|
||||
.../allwinner/sun50i-h5-nanopi-k1-plus.dts | 555 ++++++++++++++++++
|
||||
2 files changed, 556 insertions(+)
|
||||
create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-k1-plus.dts
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
index c03224962034..eb4494332002 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/Makefile
|
||||
+++ b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
@@ -10,6 +10,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
|
||||
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-k1-plus.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-k1-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-k1-plus.dts
|
||||
new file mode 100644
|
||||
index 000000000000..52337a18721f
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-k1-plus.dts
|
||||
@@ -0,0 +1,367 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2016 ARM Ltd.
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This 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 "sun50i-h5.dtsi"
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+#include <dt-bindings/pinctrl/sun4i-a10.h>
|
||||
+
|
||||
+/ {
|
||||
+ model = "FriendlyElec NanoPi K1 Plus";
|
||||
+ compatible = "friendlyelec,nanopi-k1-plus", "allwinner,sun50i-h5";
|
||||
+
|
||||
+ reg_vcc3v3: vcc3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ };
|
||||
+
|
||||
+ aliases {
|
||||
+ ethernet0 = &emac;
|
||||
+ serial0 = &uart0;
|
||||
+ };
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = "serial0:115200n8";
|
||||
+ };
|
||||
+
|
||||
+ connector {
|
||||
+ compatible = "hdmi-connector";
|
||||
+ type = "a";
|
||||
+
|
||||
+ port {
|
||||
+ hdmi_con_in: endpoint {
|
||||
+ remote-endpoint = <&hdmi_out_con>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ status {
|
||||
+ label = "nanopi:blue:status";
|
||||
+ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
|
||||
+ linux,default-trigger = "heartbeat";
|
||||
+ };
|
||||
+ pwr {
|
||||
+ label = "nanopi:green:pwr";
|
||||
+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
|
||||
+ default-state = "on";
|
||||
+ };
|
||||
+
|
||||
+ };
|
||||
+
|
||||
+ r-gpio-keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ sw4 {
|
||||
+ label = "sw4";
|
||||
+ linux,code = <BTN_0>;
|
||||
+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ reg_gmac_3v3: gmac-3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&gmac_power_pin_nanopi>;
|
||||
+ regulator-name = "gmac-3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ startup-delay-us = <100000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ reg_usb0_vbus: usb0-vbus {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "usb0-vbus";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ wifi_pwrseq: wifi_pwrseq {
|
||||
+ compatible = "mmc-pwrseq-simple";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&wifi_en_npi>;
|
||||
+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
|
||||
+ post-power-on-delay-ms = <200>;
|
||||
+ };
|
||||
+
|
||||
+ rfkill_bt {
|
||||
+ compatible = "rfkill-gpio";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&bt_pwr_pin>;
|
||||
+ reset-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
|
||||
+ clocks = <&osc32k>;
|
||||
+ clock-frequency = <32768>;
|
||||
+ rfkill-name = "sunxi-bt";
|
||||
+ rfkill-type = "bluetooth";
|
||||
+ };
|
||||
+
|
||||
+ pcm5102a: pcm5102a-codec {
|
||||
+ #sound-dai-cells = <0>;
|
||||
+ compatible = "ti,pcm5102a";
|
||||
+ status = "disabled";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&codec {
|
||||
+ allwinner,audio-routing =
|
||||
+ "Line Out", "LINEOUT",
|
||||
+ "MIC1", "Mic",
|
||||
+ "Mic", "MBIAS";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&external_mdio {
|
||||
+ ext_rgmii_phy: ethernet-phy@1 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <0>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emac_rgmii_pins>;
|
||||
+ phy-supply = <®_gmac_3v3>;
|
||||
+ phy-handle = <&ext_rgmii_phy>;
|
||||
+ phy-mode = "rgmii";
|
||||
+ local-mac-address = [ 00 00 00 00 00 00 ];
|
||||
+ allwinner,leds-active-low;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ir {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&ir_pins_a>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mmc0 {
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <4>;
|
||||
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mmc1 {
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ vqmmc-supply = <®_vcc3v3>;
|
||||
+ mmc-pwrseq = <&wifi_pwrseq>;
|
||||
+ bus-width = <4>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+ brcmf: bcrmf@1 {
|
||||
+ reg = <1>;
|
||||
+ compatible = "brcm,bcm4329-fmac";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc2 {
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <8>;
|
||||
+ non-removable;
|
||||
+ cap-mmc-hw-reset;
|
||||
+ boot_device = <0>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mmc2_8bit_pins {
|
||||
+ /* Increase drive strength for DDR modes */
|
||||
+ drive-strength = <40>;
|
||||
+ /* eMMC is missing pull-ups */
|
||||
+ bias-pull-up;
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi_out {
|
||||
+ hdmi_out_con: endpoint {
|
||||
+ remote-endpoint = <&hdmi_con_in>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+
|
||||
+&pio {
|
||||
+ leds_npi: led_pins@0 {
|
||||
+ pins = "PA10";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+ gmac_power_pin_nanopi: gmac_power_pin@0 {
|
||||
+ pins = "PD6";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+ bt_pwr_pin: bt_pwr_pin@0 {
|
||||
+ pins = "PG13";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+ spi0_cs_pins: spi0_cs_pins {
|
||||
+ pins = "PC3", "PA6";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+};
|
||||
+&r_pio {
|
||||
+ leds_r_npi: led_pins@0 {
|
||||
+ pins = "PL10";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+ vdd_cpux_r_npi: regulator_pins@0 {
|
||||
+ allwinner,pins = "PL6";
|
||||
+ allwinner,function = "gpio_out";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
+ wifi_en_npi: wifi_en_pin {
|
||||
+ pins = "PL7";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+};
|
||||
+&ohci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ status = "okay";
|
||||
+ spi-flash@0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ compatible = "jedec,spi-nor";
|
||||
+ reg = <0>; /* Chip select 0 */
|
||||
+ spi-max-frequency = <10000000>;
|
||||
+ status = "okay";
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ partition@0 {
|
||||
+ label = "uboot";
|
||||
+ reg = <0x0 0x100000>;
|
||||
+ };
|
||||
+ partition@100000 {
|
||||
+ label = "env";
|
||||
+ reg = <0x100000 0x100000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart0_pins_a>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart1_pins>;
|
||||
+ status = "disabled";
|
||||
+};
|
||||
+
|
||||
+&uart2 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart2_pins>;
|
||||
+ status = "disabled";
|
||||
+};
|
||||
+
|
||||
+&uart3 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart3_pins>, <&uart3_rts_cts_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+&usb_otg {
|
||||
+ dr_mode = "otg";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usbphy {
|
||||
+ /* USB Type-A ports' VBUS is always on */
|
||||
+ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
|
||||
+ usb0_vbus-supply = <®_usb0_vbus>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2s0 {
|
||||
+ sound-dai = <&pcm5102a>;
|
||||
+ status = "disabled";
|
||||
+};
|
||||
\ No newline at end of file
|
||||
@ -1,27 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
|
||||
index 53c8c116..0a531e55 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
|
||||
@@ -82,6 +82,22 @@
|
||||
reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
|
||||
post-power-on-delay-ms = <200>;
|
||||
};
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+ pwr {
|
||||
+ label = "orangepi:green:pwr";
|
||||
+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
|
||||
+ default-state = "on";
|
||||
+ };
|
||||
+ status {
|
||||
+ label = "orangepi:red:status";
|
||||
+ linux,default-trigger = "mmc0";
|
||||
+ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
|
||||
+ default-state = "on";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
};
|
||||
|
||||
&de {
|
||||
@ -1,175 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
--- a/arch/arm64/boot/dts/allwinner/Makefile
|
||||
+++ b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
@@ -6,6 +6,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-teres-i.dtb
|
||||
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopim1plus2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopim1plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopim1plus2.dts
|
||||
new file mode 100644
|
||||
index 0000000..4fc6ffd
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopim1plus2.dts
|
||||
@@ -0,0 +1,158 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2016 ARM Ltd.
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively,
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use,
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/pinctrl/sun4i-a10.h>
|
||||
+#include "sun50i-h5-orangepi-pc2.dts"
|
||||
+
|
||||
+/ {
|
||||
+ model = "NanoPi M1 Plus2";
|
||||
+ compatible = "nanopim1plus2", "allwinner,sun50i-h5";
|
||||
+
|
||||
+ aliases {
|
||||
+ spi0 = &spi0;
|
||||
+ spi1 = &spi1;
|
||||
+ };
|
||||
+
|
||||
+ reg_gmac_3v3: gmac-3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "gmac-3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ startup-delay-us = <100000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&pio 3 14 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ wifi_pwrseq: wifi_pwrseq {
|
||||
+ compatible = "mmc-pwrseq-simple";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&wifi_en_pin>;
|
||||
+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
|
||||
+ post-power-on-delay-ms = <50>;
|
||||
+ };
|
||||
+
|
||||
+ reg_usb1_vbus: usb1-vbus {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&usb1_vbus_pin_a>;
|
||||
+ regulator-name = "usb1-vbus";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ regulator-boot-on;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ /* TODO: Camera, touchscreen, etc. */
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emac_rgmii_pins>;
|
||||
+ phy-supply = <®_gmac_3v3>;
|
||||
+ phy-mode = "rgmii";
|
||||
+};
|
||||
+
|
||||
+&mmc1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc1_pins_a>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ vqmmc-supply = <®_vcc3v3>;
|
||||
+ mmc-pwrseq = <&wifi_pwrseq>;
|
||||
+ bus-width = <4>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ brcmf: brcmf@1 {
|
||||
+ reg = <1>;
|
||||
+ compatible = "brcm,bcm4329-fmac";
|
||||
+ interrupt-parent = <&pio>;
|
||||
+ interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
|
||||
+ interrupt-names = "host-wake";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc2 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc2_8bit_pins>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ vqmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <8>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pio {
|
||||
+ usb1_vbus_pin_a: usb1_vbus_pin@0 {
|
||||
+ allwinner,pins = "PD6";
|
||||
+ allwinner,function = "gpio_out";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
+
|
||||
+ wifi_wake: wifi_wake@0 {
|
||||
+ allwinner,pins = "PG10";
|
||||
+ allwinner,function = "irq";
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&r_pio {
|
||||
+ wifi_en_pin: wifi_en_pin@0 {
|
||||
+ allwinner,pins = "PL7";
|
||||
+ allwinner,function = "gpio_out";
|
||||
+ allwinner,drive = <SUN4I_PINCTRL_10_MA>;
|
||||
+ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ /delete-node/ spi-flash@0;
|
||||
+};
|
||||
+
|
||||
+&usbphy {
|
||||
+ usb1_vbus-supply = <®_usb1_vbus>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
@ -1,44 +0,0 @@
|
||||
From 54c453465d296a98be67d6d758b564424952fc63 Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.io>
|
||||
Date: Tue, 1 Aug 2017 21:12:57 +0800
|
||||
Subject: [PATCH] clk: sunxi-ng: export CLK_PLL_DE for H3
|
||||
|
||||
The CLK_PLL_DE is needed to be referenced in device tree for H3, for
|
||||
both forcing the parent of PLL_DE.
|
||||
|
||||
So export it to the device tree binding header.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
drivers/clk/sunxi-ng/ccu-sun8i-h3.h | 3 +--
|
||||
include/dt-bindings/clock/sun8i-h3-ccu.h | 2 ++
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-h3.h b/drivers/clk/sunxi-ng/ccu-sun8i-h3.h
|
||||
index 1b4baea37d810..add3a7c182123 100644
|
||||
--- a/drivers/clk/sunxi-ng/ccu-sun8i-h3.h
|
||||
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-h3.h
|
||||
@@ -35,9 +35,8 @@
|
||||
#define CLK_PLL_PERIPH0_2X 10
|
||||
#define CLK_PLL_GPU 11
|
||||
#define CLK_PLL_PERIPH1 12
|
||||
-#define CLK_PLL_DE 13
|
||||
|
||||
-/* The CPUX clock is exported */
|
||||
+/* The PLL_DE and CPUX clocks is exported */
|
||||
|
||||
#define CLK_AXI 15
|
||||
#define CLK_AHB1 16
|
||||
diff --git a/include/dt-bindings/clock/sun8i-h3-ccu.h b/include/dt-bindings/clock/sun8i-h3-ccu.h
|
||||
index e139fe5c62ecd..5345957a8c2e6 100644
|
||||
--- a/include/dt-bindings/clock/sun8i-h3-ccu.h
|
||||
+++ b/include/dt-bindings/clock/sun8i-h3-ccu.h
|
||||
@@ -45,6 +45,8 @@
|
||||
|
||||
#define CLK_PLL_PERIPH0 9
|
||||
|
||||
+#define CLK_PLL_DE 13
|
||||
+
|
||||
#define CLK_CPUX 14
|
||||
|
||||
#define CLK_BUS_CE 20
|
||||
@ -1,54 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
index b36f9f42..f2973669 100644
|
||||
--- a/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3.dtsi
|
||||
@@ -72,6 +72,49 @@
|
||||
};
|
||||
};
|
||||
|
||||
+ soc {
|
||||
+ mali: gpu@1c40000 {
|
||||
+ compatible = "allwinner,sun8i-h3-mali",
|
||||
+ "allwinner,sun7i-a20-mali", "arm,mali-400";
|
||||
+ reg = <0x01c40000 0x10000>;
|
||||
+ interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
|
||||
+ <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupt-names = "gp",
|
||||
+ "gpmmu",
|
||||
+ "pp0",
|
||||
+ "ppmmu0",
|
||||
+ "pp1",
|
||||
+ "ppmmu1",
|
||||
+ "pmu";
|
||||
+ clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
|
||||
+ clock-names = "bus", "core";
|
||||
+ resets = <&ccu RST_BUS_GPU>;
|
||||
+ memory-region = <&cma>;
|
||||
+
|
||||
+ assigned-clocks = <&ccu CLK_GPU>;
|
||||
+ assigned-clock-rates = <384000000>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ reserved-memory {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ ranges;
|
||||
+
|
||||
+ cma: linux,cma {
|
||||
+ compatible = "shared-dma-pool";
|
||||
+ reusable;
|
||||
+ size = <0x4000000>;
|
||||
+ alignment = <0x2000>;
|
||||
+ linux,cma-default;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
timer {
|
||||
compatible = "arm,armv7-timer";
|
||||
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
|
||||
@ -1,271 +0,0 @@
|
||||
From 5bcc6066f1dfbbef937ca8584a0fba44bb1468f0 Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Sat, 25 Jun 2016 02:13:50 +0200
|
||||
Subject: [PATCH] regulator: SY8106A regulator driver
|
||||
|
||||
SY8106A is I2C attached single output voltage regulator
|
||||
made by Silergy.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
drivers/regulator/Kconfig | 8 +-
|
||||
drivers/regulator/Makefile | 2 +-
|
||||
drivers/regulator/sy8106a-regulator.c | 167 ++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 175 insertions(+), 2 deletions(-)
|
||||
create mode 100644 drivers/regulator/sy8106a-regulator.c
|
||||
|
||||
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
|
||||
index be06eb2..9c4b51e 100644
|
||||
--- a/drivers/regulator/Kconfig
|
||||
+++ b/drivers/regulator/Kconfig
|
||||
@@ -727,6 +727,13 @@ config REGULATOR_STW481X_VMMC
|
||||
This driver supports the internal VMMC regulator in the STw481x
|
||||
PMIC chips.
|
||||
|
||||
+config REGULATOR_SY8106A
|
||||
+ tristate "Silergy SY8106A"
|
||||
+ depends on I2C && (OF || COMPILE_TEST)
|
||||
+ select REGMAP_I2C
|
||||
+ help
|
||||
+ This driver provides support for SY8106A voltage regulator.
|
||||
+
|
||||
config REGULATOR_TPS51632
|
||||
tristate "TI TPS51632 Power Regulator"
|
||||
depends on I2C
|
||||
@@ -886,4 +893,3 @@ config REGULATOR_WM8994
|
||||
WM8994 CODEC.
|
||||
|
||||
endif
|
||||
-
|
||||
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
|
||||
index ef7725e..a829718 100644
|
||||
--- a/drivers/regulator/Makefile
|
||||
+++ b/drivers/regulator/Makefile
|
||||
@@ -91,6 +91,7 @@ obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
|
||||
obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
|
||||
obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o
|
||||
+obj-$(CONFIG_REGULATOR_SY8106A) += sy8106a-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_TI_ABB) += ti-abb-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
|
||||
@@ -114,5 +115,4 @@ obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
|
||||
obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o
|
||||
|
||||
-
|
||||
ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
|
||||
diff --git a/drivers/regulator/sy8106a-regulator.c b/drivers/regulator/sy8106a-regulator.c
|
||||
new file mode 100644
|
||||
index 0000000..7274965
|
||||
--- /dev/null
|
||||
+++ b/drivers/regulator/sy8106a-regulator.c
|
||||
@@ -0,0 +1,167 @@
|
||||
+/*
|
||||
+ * sy8106a-regulator.c - Regulator device driver for SY8106A
|
||||
+ *
|
||||
+ * Copyright (C) 2016 Ondřej Jirman <megous@megous.com>
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Library General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Library General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Library General Public
|
||||
+ * License along with this library; if not, write to the
|
||||
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
+ * Boston, MA 02110-1301, USA.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/err.h>
|
||||
+#include <linux/i2c.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/regmap.h>
|
||||
+#include <linux/regulator/driver.h>
|
||||
+#include <linux/regulator/of_regulator.h>
|
||||
+
|
||||
+#define SY8106A_REG_VOUT1_SEL 0x01
|
||||
+#define SY8106A_REG_VOUT_COM 0x02
|
||||
+#define SY8106A_REG_VOUT1_SEL_MASK 0x7f
|
||||
+#define SY8106A_DISABLE_REG BIT(0)
|
||||
+#define SY8106A_GO_BIT BIT(7)
|
||||
+
|
||||
+struct sy8106a {
|
||||
+ struct regulator_dev *rdev;
|
||||
+ struct regmap *regmap;
|
||||
+};
|
||||
+
|
||||
+static const struct regmap_config sy8106a_regmap_config = {
|
||||
+ .reg_bits = 8,
|
||||
+ .val_bits = 8,
|
||||
+};
|
||||
+
|
||||
+static int sy8106a_set_voltage_sel(struct regulator_dev *rdev, unsigned sel)
|
||||
+{
|
||||
+ /* We use our set_voltage_sel in order to avoid unnecessary I2C chatter,
|
||||
+ * because the regulator_get_voltage_sel_regmap using apply_bit
|
||||
+ * would perform 4 unnecessary transfers instead of one, increasing the
|
||||
+ * chance of error.
|
||||
+ */
|
||||
+ return regmap_write(rdev->regmap, rdev->desc->vsel_reg,
|
||||
+ sel | SY8106A_GO_BIT);
|
||||
+}
|
||||
+
|
||||
+static const struct regulator_ops sy8106a_ops = {
|
||||
+ .is_enabled = regulator_is_enabled_regmap,
|
||||
+ .set_voltage_sel = sy8106a_set_voltage_sel,
|
||||
+ .set_voltage_time_sel = regulator_set_voltage_time_sel,
|
||||
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
|
||||
+ .list_voltage = regulator_list_voltage_linear,
|
||||
+};
|
||||
+
|
||||
+/* Default limits measured in millivolts and milliamps */
|
||||
+#define SY8106A_MIN_MV 680
|
||||
+#define SY8106A_MAX_MV 1950
|
||||
+#define SY8106A_STEP_MV 10
|
||||
+
|
||||
+static const struct regulator_desc sy8106a_reg = {
|
||||
+ .name = "SY8106A",
|
||||
+ .id = 0,
|
||||
+ .ops = &sy8106a_ops,
|
||||
+ .type = REGULATOR_VOLTAGE,
|
||||
+ .n_voltages = ((SY8106A_MAX_MV - SY8106A_MIN_MV) / SY8106A_STEP_MV) + 1,
|
||||
+ .min_uV = (SY8106A_MIN_MV * 1000),
|
||||
+ .uV_step = (SY8106A_STEP_MV * 1000),
|
||||
+ .vsel_reg = SY8106A_REG_VOUT1_SEL,
|
||||
+ .vsel_mask = SY8106A_REG_VOUT1_SEL_MASK,
|
||||
+ .enable_reg = SY8106A_REG_VOUT_COM,
|
||||
+ .enable_mask = SY8106A_DISABLE_REG,
|
||||
+ .disable_val = SY8106A_DISABLE_REG,
|
||||
+ .enable_is_inverted = 1,
|
||||
+ .owner = THIS_MODULE,
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * I2C driver interface functions
|
||||
+ */
|
||||
+static int sy8106a_i2c_probe(struct i2c_client *i2c,
|
||||
+ const struct i2c_device_id *id)
|
||||
+{
|
||||
+ struct sy8106a *chip;
|
||||
+ struct device *dev = &i2c->dev;
|
||||
+ struct regulator_dev *rdev = NULL;
|
||||
+ struct regulator_config config = { };
|
||||
+ unsigned int selector;
|
||||
+ int error;
|
||||
+
|
||||
+ chip = devm_kzalloc(&i2c->dev, sizeof(struct sy8106a), GFP_KERNEL);
|
||||
+ if (!chip)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ chip->regmap = devm_regmap_init_i2c(i2c, &sy8106a_regmap_config);
|
||||
+ if (IS_ERR(chip->regmap)) {
|
||||
+ error = PTR_ERR(chip->regmap);
|
||||
+ dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
|
||||
+ error);
|
||||
+ return error;
|
||||
+ }
|
||||
+
|
||||
+ config.dev = &i2c->dev;
|
||||
+ config.regmap = chip->regmap;
|
||||
+ config.driver_data = chip;
|
||||
+
|
||||
+ config.of_node = dev->of_node;
|
||||
+ config.init_data = of_get_regulator_init_data(dev, dev->of_node, &sy8106a_reg);
|
||||
+ if (!config.init_data) {
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ /* Probe regulator */
|
||||
+ error = regmap_read(chip->regmap, SY8106A_REG_VOUT1_SEL, &selector);
|
||||
+ if (error) {
|
||||
+ dev_err(&i2c->dev, "Failed to read voltage at probe time: %d\n", error);
|
||||
+ return error;
|
||||
+ }
|
||||
+
|
||||
+ rdev = devm_regulator_register(&i2c->dev, &sy8106a_reg, &config);
|
||||
+ if (IS_ERR(rdev)) {
|
||||
+ error = PTR_ERR(rdev);
|
||||
+ dev_err(&i2c->dev, "Failed to register SY8106A regulator: %d\n", error);
|
||||
+ return error;
|
||||
+ }
|
||||
+
|
||||
+ chip->rdev = rdev;
|
||||
+
|
||||
+ i2c_set_clientdata(i2c, chip);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id sy8106a_i2c_of_match[] = {
|
||||
+ { .compatible = "silergy,sy8106a" },
|
||||
+ { },
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, sy8106a_i2c_of_match);
|
||||
+
|
||||
+static const struct i2c_device_id sy8106a_i2c_id[] = {
|
||||
+ { "sy8106a", 0 },
|
||||
+ { },
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(i2c, sy8106a_i2c_id);
|
||||
+
|
||||
+static struct i2c_driver sy8106a_regulator_driver = {
|
||||
+ .driver = {
|
||||
+ .name = "sy8106a",
|
||||
+ .of_match_table = of_match_ptr(sy8106a_i2c_of_match),
|
||||
+ },
|
||||
+ .probe = sy8106a_i2c_probe,
|
||||
+ .id_table = sy8106a_i2c_id,
|
||||
+};
|
||||
+
|
||||
+module_i2c_driver(sy8106a_regulator_driver);
|
||||
+
|
||||
+MODULE_AUTHOR("Ondřej Jirman <megous@megous.com>");
|
||||
+MODULE_DESCRIPTION("Regulator device driver for Silergy SY8106A");
|
||||
+MODULE_LICENSE("GPL v2");
|
||||
From cbbe21d790a5a47e69238ed64d53acd36752d7ae Mon Sep 17 00:00:00 2001
|
||||
From: Ondrej Jirman <megous@megous.com>
|
||||
Date: Sat, 25 Jun 2016 02:20:08 +0200
|
||||
Subject: [PATCH] dt-bindings: document SY8106A regulator driver
|
||||
|
||||
This patch adds the binding documentation for the
|
||||
sy8106a regulator driver.
|
||||
|
||||
Signed-off-by: Ondrej Jirman <megous@megous.com>
|
||||
---
|
||||
.../bindings/regulator/sy8106a-regulator.txt | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt b/Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
|
||||
new file mode 100644
|
||||
index 0000000..1e623a34
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
|
||||
@@ -0,0 +1,21 @@
|
||||
+SY8106A Voltage regulator
|
||||
+
|
||||
+Required properties:
|
||||
+- compatible: Must be "silergy,sy8106a"
|
||||
+- reg: I2C slave address - must be <0x65>
|
||||
+
|
||||
+Any property defined as part of the core regulator binding, defined in
|
||||
+regulator.txt, can also be used.
|
||||
+
|
||||
+Example:
|
||||
+
|
||||
+ sy8106a {
|
||||
+ compatible = "silergy,sy8106a";
|
||||
+ reg = <0x65>;
|
||||
+ regulator-name = "sy8106a-vdd";
|
||||
+ regulator-min-microvolt = <1000000>;
|
||||
+ regulator-max-microvolt = <1400000>;
|
||||
+ regulator-ramp-delay = <200>;
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ };
|
||||
@ -1,32 +0,0 @@
|
||||
---
|
||||
arch/arm/boot/dts/sunxi-h3-h5.dtsi | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
index 3a5f2aad7449..19fb71d29159 100644
|
||||
--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
|
||||
@@ -634,6 +634,20 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ r_i2c: i2c@01f02400 {
|
||||
+ compatible = "allwinner,sun6i-a31-i2c";
|
||||
+ reg = <0x01f02400 0x400>;
|
||||
+ interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&r_i2c_pins>;
|
||||
+ clocks = <&r_ccu CLK_APB0_I2C>;
|
||||
+ clock-frequency = <100000>;
|
||||
+ resets = <&r_ccu RST_APB0_I2C>;
|
||||
+ status = "disabled";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ };
|
||||
+
|
||||
i2c0: i2c@1c2ac00 {
|
||||
compatible = "allwinner,sun6i-a31-i2c";
|
||||
reg = <0x01c2ac00 0x400>;
|
||||
--
|
||||
2.13.5
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
|
||||
index 113ea66f..96cf1a73 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
|
||||
@@ -99,6 +99,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&cpu0 {
|
||||
+ cpu-supply = <®_dcdc2>;
|
||||
+};
|
||||
+
|
||||
&mmc0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mmc0_pins>;
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
|
||||
index a5da18a6..44da934e 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi
|
||||
@@ -54,6 +54,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&cpu0 {
|
||||
+ cpu-supply = <®_dcdc2>;
|
||||
+};
|
||||
+
|
||||
&mmc0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mmc0_pins>;
|
||||
@ -1,49 +0,0 @@
|
||||
diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
|
||||
index 27954085..3c76c670 100644
|
||||
--- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
|
||||
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
|
||||
@@ -879,11 +879,26 @@ static const struct sunxi_ccu_desc sun50i_a64_ccu_desc = {
|
||||
.num_resets = ARRAY_SIZE(sun50i_a64_ccu_resets),
|
||||
};
|
||||
|
||||
+static struct ccu_pll_nb sun50i_a64_pll_cpu_nb = {
|
||||
+ .common = &pll_cpux_clk.common,
|
||||
+ /* copy from pll_cpux_clk */
|
||||
+ .enable = BIT(31),
|
||||
+ .lock = BIT(28),
|
||||
+};
|
||||
+
|
||||
+static struct ccu_mux_nb sun50i_a64_cpu_nb = {
|
||||
+ .common = &cpux_clk.common,
|
||||
+ .cm = &cpux_clk.mux,
|
||||
+ .delay_us = 1, /* > 8 clock cycles at 24 MHz */
|
||||
+ .bypass_index = 1, /* index of 24 MHz oscillator */
|
||||
+};
|
||||
+
|
||||
static int sun50i_a64_ccu_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res;
|
||||
void __iomem *reg;
|
||||
u32 val;
|
||||
+ int ret;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
reg = devm_ioremap_resource(&pdev->dev, res);
|
||||
@@ -897,7 +912,16 @@ static int sun50i_a64_ccu_probe(struct platform_device *pdev)
|
||||
|
||||
writel(0x515, reg + SUN50I_A64_PLL_MIPI_REG);
|
||||
|
||||
- return sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_a64_ccu_desc);
|
||||
+ ret = sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_a64_ccu_desc);
|
||||
+
|
||||
+ /* Gate then ungate PLL CPU after any rate changes */
|
||||
+ ccu_pll_notifier_register(&sun50i_a64_pll_cpu_nb);
|
||||
+
|
||||
+ /* Reparent CPU during PLL CPU rate changes */
|
||||
+ ccu_mux_notifier_register(pll_cpux_clk.common.hw.clk,
|
||||
+ &sun50i_a64_cpu_nb);
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static const struct of_device_id sun50i_a64_ccu_ids[] = {
|
||||
@ -1,73 +0,0 @@
|
||||
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
|
||||
index 933f2e68f42a..c3aa839a453d 100644
|
||||
--- a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
|
||||
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
|
||||
@@ -12,7 +12,8 @@
|
||||
*/
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
-#include <linux/of_address.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/regmap.h>
|
||||
|
||||
#include "ccu_common.h"
|
||||
#include "ccu_reset.h"
|
||||
@@ -1250,17 +1251,17 @@ static struct ccu_mux_nb sun8i_r40_cpu_nb = {
|
||||
.bypass_index = 1, /* index of 24 MHz oscillator */
|
||||
};
|
||||
|
||||
-static void __init sun8i_r40_ccu_setup(struct device_node *node)
|
||||
+static int sun8i_r40_ccu_probe(struct platform_device *pdev)
|
||||
{
|
||||
+ struct resource *res;
|
||||
void __iomem *reg;
|
||||
u32 val;
|
||||
+ int ret;
|
||||
|
||||
- reg = of_io_request_and_map(node, 0, of_node_full_name(node));
|
||||
- if (IS_ERR(reg)) {
|
||||
- pr_err("%s: Could not map the clock registers\n",
|
||||
- of_node_full_name(node));
|
||||
- return;
|
||||
- }
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
+ reg = devm_ioremap_resource(&pdev->dev, res);
|
||||
+ if (IS_ERR(reg))
|
||||
+ return PTR_ERR(reg);
|
||||
|
||||
/* Force the PLL-Audio-1x divider to 4 */
|
||||
val = readl(reg + SUN8I_R40_PLL_AUDIO_REG);
|
||||
@@ -1277,7 +1278,9 @@ static void __init sun8i_r40_ccu_setup(struct device_node *node)
|
||||
val &= ~GENMASK(25, 20);
|
||||
writel(val, reg + SUN8I_R40_USB_CLK_REG);
|
||||
|
||||
- sunxi_ccu_probe(node, reg, &sun8i_r40_ccu_desc);
|
||||
+ ret = sunxi_ccu_probe(pdev->dev.of_node, reg, &sun8i_r40_ccu_desc);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
|
||||
/* Gate then ungate PLL CPU after any rate changes */
|
||||
ccu_pll_notifier_register(&sun8i_r40_pll_cpu_nb);
|
||||
@@ -1285,6 +1288,20 @@ static void __init sun8i_r40_ccu_setup(struct device_node *node)
|
||||
/* Reparent CPU during PLL CPU rate changes */
|
||||
ccu_mux_notifier_register(pll_cpu_clk.common.hw.clk,
|
||||
&sun8i_r40_cpu_nb);
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
-CLK_OF_DECLARE(sun8i_r40_ccu, "allwinner,sun8i-r40-ccu",
|
||||
- sun8i_r40_ccu_setup);
|
||||
+
|
||||
+static const struct of_device_id sun8i_r40_ccu_ids[] = {
|
||||
+ { .compatible = "allwinner,sun8i-r40-ccu" },
|
||||
+ { }
|
||||
+};
|
||||
+
|
||||
+static struct platform_driver sun8i_r40_ccu_driver = {
|
||||
+ .probe = sun8i_r40_ccu_probe,
|
||||
+ .driver = {
|
||||
+ .name = "sun8i-r40-ccu",
|
||||
+ .of_match_table = sun8i_r40_ccu_ids,
|
||||
+ },
|
||||
+};
|
||||
+builtin_platform_driver(sun8i_r40_ccu_driver);
|
||||
@ -1,52 +0,0 @@
|
||||
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
|
||||
index c3aa839a453d..54c7a6106206 100644
|
||||
--- a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
|
||||
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
|
||||
@@ -1251,9 +1251,35 @@ static struct ccu_mux_nb sun8i_r40_cpu_nb = {
|
||||
.bypass_index = 1, /* index of 24 MHz oscillator */
|
||||
};
|
||||
|
||||
+/*
|
||||
+ * Add a regmap for the GMAC driver (dwmac-sun8i) to access the
|
||||
+ * GMAC configuration register.
|
||||
+ * Only this register is allowed to be written, in order to
|
||||
+ * prevent overriding critical clock configuration.
|
||||
+ */
|
||||
+
|
||||
+#define SUN8I_R40_GMAC_CFG_REG 0x164
|
||||
+static bool sun8i_r40_ccu_regmap_writeable_reg(struct device *dev,
|
||||
+ unsigned int reg)
|
||||
+{
|
||||
+ if (reg == SUN8I_R40_GMAC_CFG_REG)
|
||||
+ return true;
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+static struct regmap_config sun8i_r40_ccu_regmap_config = {
|
||||
+ .reg_bits = 32,
|
||||
+ .val_bits = 32,
|
||||
+ .reg_stride = 4,
|
||||
+ .max_register = 0x320, /* PLL_LOCK_CTRL_REG */
|
||||
+
|
||||
+ .writeable_reg = sun8i_r40_ccu_regmap_writeable_reg,
|
||||
+};
|
||||
+
|
||||
static int sun8i_r40_ccu_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res;
|
||||
+ struct regmap *regmap;
|
||||
void __iomem *reg;
|
||||
u32 val;
|
||||
int ret;
|
||||
@@ -1278,6 +1304,11 @@ static int sun8i_r40_ccu_probe(struct platform_device *pdev)
|
||||
val &= ~GENMASK(25, 20);
|
||||
writel(val, reg + SUN8I_R40_USB_CLK_REG);
|
||||
|
||||
+ regmap = devm_regmap_init_mmio(&pdev->dev, reg,
|
||||
+ &sun8i_r40_ccu_regmap_config);
|
||||
+ if (IS_ERR(regmap))
|
||||
+ return PTR_ERR(regmap);
|
||||
+
|
||||
ret = sunxi_ccu_probe(pdev->dev.of_node, reg, &sun8i_r40_ccu_desc);
|
||||
if (ret)
|
||||
return ret;
|
||||
@ -1,22 +0,0 @@
|
||||
diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
|
||||
index 3d6d5fa0c4d5..b8a3028d6c30 100644
|
||||
--- a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
|
||||
+++ b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
|
||||
@@ -28,10 +28,13 @@ Required properties:
|
||||
- allwinner,sun8i-a83t-system-controller
|
||||
|
||||
Optional properties:
|
||||
-- allwinner,tx-delay-ps: TX clock delay chain value in ps. Range value is 0-700. Default is 0)
|
||||
-- allwinner,rx-delay-ps: RX clock delay chain value in ps. Range value is 0-3100. Default is 0)
|
||||
-Both delay properties need to be a multiple of 100. They control the delay for
|
||||
-external PHY.
|
||||
+- allwinner,tx-delay-ps: TX clock delay chain value in ps.
|
||||
+ Range is 0-700. Default is 0.
|
||||
+- allwinner,rx-delay-ps: RX clock delay chain value in ps.
|
||||
+ Range is 0-3100. Default is 0.
|
||||
+Both delay properties need to be a multiple of 100. They control the
|
||||
+clock delay for external RGMII PHY. They are do apply to the internal
|
||||
+PHY or external non-RGMII PHYs.
|
||||
|
||||
Optional properties for the following compatibles:
|
||||
- "allwinner,sun8i-h3-emac",
|
||||
@ -1,30 +0,0 @@
|
||||
diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
|
||||
index 74b3ef79e57a..fe4a48a1eb50 100644
|
||||
--- a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
|
||||
+++ b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt
|
||||
@@ -7,6 +7,7 @@ Required properties:
|
||||
- compatible: must be one of the following string:
|
||||
"allwinner,sun8i-a83t-emac"
|
||||
"allwinner,sun8i-h3-emac"
|
||||
+ "allwinner,sun8i-r40-gmac"
|
||||
"allwinner,sun8i-v3s-emac"
|
||||
"allwinner,sun50i-a64-emac"
|
||||
- reg: address and length of the register for the device.
|
||||
@@ -24,14 +25,17 @@ Required properties:
|
||||
compatible string:
|
||||
- allwinner,sun8i-a83t-system-controller
|
||||
- allwinner,sun8i-h3-system-controller
|
||||
+ - allwinner,sun8i-r40-ccu
|
||||
- allwinner,sun8i-v3s-system-controller
|
||||
- allwinner,sun50i-a64-system-controller
|
||||
|
||||
Optional properties:
|
||||
- allwinner,tx-delay-ps: TX clock delay chain value in ps.
|
||||
Range is 0-700. Default is 0.
|
||||
+ Unavailable for allwinner,sun8i-r40-gmac
|
||||
- allwinner,rx-delay-ps: RX clock delay chain value in ps.
|
||||
Range is 0-3100. Default is 0.
|
||||
+ Range is 0-700 for allwinner,sun8i-r40-gmac
|
||||
Both delay properties need to be a multiple of 100. They control the
|
||||
clock delay for external RGMII PHY. They are do apply to the internal
|
||||
PHY or external non-RGMII PHYs.
|
||||
@ -1,70 +0,0 @@
|
||||
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
|
||||
index de93f0faf58d..a51175bcfd11 100644
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
|
||||
@@ -43,6 +43,9 @@
|
||||
* and used as a good starting value in case of the
|
||||
* boot process(uboot) leave some stuff.
|
||||
* @syscon_field reg_field for the syscon's gmac register
|
||||
+ * @syscon_from_dev syscon regmap is in ccu address space and
|
||||
+ * needs to be retrieved using dev_get_regmap()
|
||||
+ * instead of syscon_regmap_lookup_by_phandle()
|
||||
* @soc_has_internal_phy: Does the MAC embed an internal PHY
|
||||
* @support_mii: Does the MAC handle MII
|
||||
* @support_rmii: Does the MAC handle RMII
|
||||
@@ -51,6 +54,7 @@
|
||||
struct emac_variant {
|
||||
u32 default_syscon_value;
|
||||
const struct reg_field *syscon_field;
|
||||
+ bool syscon_from_dev;
|
||||
bool soc_has_internal_phy;
|
||||
bool support_mii;
|
||||
bool support_rmii;
|
||||
@@ -983,6 +987,34 @@ static struct mac_device_info *sun8i_dwmac_setup(void *ppriv)
|
||||
return mac;
|
||||
}
|
||||
|
||||
+static struct regmap *sun8i_dwmac_get_syscon_from_dev(struct device_node *node)
|
||||
+{
|
||||
+ struct device_node *syscon_node;
|
||||
+ struct platform_device *syscon_pdev;
|
||||
+ struct regmap *regmap = NULL;
|
||||
+
|
||||
+ syscon_node = of_parse_phandle(node, "syscon", 0);
|
||||
+ if (!syscon_node)
|
||||
+ return ERR_PTR(-ENODEV);
|
||||
+
|
||||
+ syscon_pdev = of_find_device_by_node(syscon_node);
|
||||
+ if (!syscon_pdev) {
|
||||
+ /* platform device might not be probed yet */
|
||||
+ regmap = ERR_PTR(-EPROBE_DEFER);
|
||||
+ goto out_put_node;
|
||||
+ }
|
||||
+
|
||||
+ /* If no regmap is found then the other device driver is at fault */
|
||||
+ regmap = dev_get_regmap(&syscon_pdev->dev, NULL);
|
||||
+ if (!regmap)
|
||||
+ regmap = ERR_PTR(-EINVAL);
|
||||
+
|
||||
+ platform_device_put(syscon_pdev);
|
||||
+out_put_node:
|
||||
+ of_node_put(syscon_node);
|
||||
+ return regmap;
|
||||
+}
|
||||
+
|
||||
static int sun8i_dwmac_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct plat_stmmacenet_data *plat_dat;
|
||||
@@ -1027,7 +1059,11 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
|
||||
gmac->regulator = NULL;
|
||||
}
|
||||
|
||||
- regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "syscon");
|
||||
+ if (gmac->variant->syscon_from_dev)
|
||||
+ regmap = sun8i_dwmac_get_syscon_from_dev(pdev->dev.of_node);
|
||||
+ else
|
||||
+ regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
|
||||
+ "syscon");
|
||||
if (IS_ERR(regmap)) {
|
||||
ret = PTR_ERR(regmap);
|
||||
dev_err(&pdev->dev, "Unable to map syscon: %d\n", ret);
|
||||
@ -1,93 +0,0 @@
|
||||
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
|
||||
index a51175bcfd11..08d263567a52 100644
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
|
||||
@@ -50,6 +50,12 @@
|
||||
* @support_mii: Does the MAC handle MII
|
||||
* @support_rmii: Does the MAC handle RMII
|
||||
* @support_rgmii: Does the MAC handle RGMII
|
||||
+ *
|
||||
+ * @rx_delay_max: Maximum raw value for RX delay chain
|
||||
+ * @tx_delay_max: Maximum raw value for TX delay chain
|
||||
+ * These two also indicate the bitmask for
|
||||
+ * the RX and TX delay chain registers. A
|
||||
+ * value of zero indicates this is not supported.
|
||||
*/
|
||||
struct emac_variant {
|
||||
u32 default_syscon_value;
|
||||
@@ -59,6 +65,8 @@ struct emac_variant {
|
||||
bool support_mii;
|
||||
bool support_rmii;
|
||||
bool support_rgmii;
|
||||
+ u8 rx_delay_max;
|
||||
+ u8 tx_delay_max;
|
||||
};
|
||||
|
||||
/* struct sunxi_priv_data - hold all sunxi private data
|
||||
@@ -95,7 +103,9 @@ static const struct emac_variant emac_variant_h3 = {
|
||||
.soc_has_internal_phy = true,
|
||||
.support_mii = true,
|
||||
.support_rmii = true,
|
||||
- .support_rgmii = true
|
||||
+ .support_rgmii = true,
|
||||
+ .rx_delay_max = 31,
|
||||
+ .tx_delay_max = 7,
|
||||
};
|
||||
|
||||
static const struct emac_variant emac_variant_v3s = {
|
||||
@@ -110,7 +120,9 @@ static const struct emac_variant emac_variant_a83t = {
|
||||
.syscon_field = &sun8i_syscon_reg_field,
|
||||
.soc_has_internal_phy = false,
|
||||
.support_mii = true,
|
||||
- .support_rgmii = true
|
||||
+ .support_rgmii = true,
|
||||
+ .rx_delay_max = 31,
|
||||
+ .tx_delay_max = 7,
|
||||
};
|
||||
|
||||
static const struct emac_variant emac_variant_a64 = {
|
||||
@@ -119,7 +131,9 @@ static const struct emac_variant emac_variant_a64 = {
|
||||
.soc_has_internal_phy = false,
|
||||
.support_mii = true,
|
||||
.support_rmii = true,
|
||||
- .support_rgmii = true
|
||||
+ .support_rgmii = true,
|
||||
+ .rx_delay_max = 31,
|
||||
+ .tx_delay_max = 7,
|
||||
};
|
||||
|
||||
#define EMAC_BASIC_CTL0 0x00
|
||||
@@ -223,9 +237,7 @@ static const struct emac_variant emac_variant_a64 = {
|
||||
#define SYSCON_RMII_EN BIT(13) /* 1: enable RMII (overrides EPIT) */
|
||||
|
||||
/* Generic system control EMAC_CLK bits */
|
||||
-#define SYSCON_ETXDC_MASK GENMASK(2, 0)
|
||||
#define SYSCON_ETXDC_SHIFT 10
|
||||
-#define SYSCON_ERXDC_MASK GENMASK(4, 0)
|
||||
#define SYSCON_ERXDC_SHIFT 5
|
||||
/* EMAC PHY Interface Type */
|
||||
#define SYSCON_EPIT BIT(2) /* 1: RGMII, 0: MII */
|
||||
@@ -851,8 +863,9 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
|
||||
}
|
||||
val /= 100;
|
||||
dev_dbg(priv->device, "set tx-delay to %x\n", val);
|
||||
- if (val <= SYSCON_ETXDC_MASK) {
|
||||
- reg &= ~(SYSCON_ETXDC_MASK << SYSCON_ETXDC_SHIFT);
|
||||
+ if (val <= gmac->variant->tx_delay_max) {
|
||||
+ reg &= ~(gmac->variant->tx_delay_max <<
|
||||
+ SYSCON_ETXDC_SHIFT);
|
||||
reg |= (val << SYSCON_ETXDC_SHIFT);
|
||||
} else {
|
||||
dev_err(priv->device, "Invalid TX clock delay: %d\n",
|
||||
@@ -868,8 +881,9 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
|
||||
}
|
||||
val /= 100;
|
||||
dev_dbg(priv->device, "set rx-delay to %x\n", val);
|
||||
- if (val <= SYSCON_ERXDC_MASK) {
|
||||
- reg &= ~(SYSCON_ERXDC_MASK << SYSCON_ERXDC_SHIFT);
|
||||
+ if (val <= gmac->variant->rx_delay_max) {
|
||||
+ reg &= ~(gmac->variant->rx_delay_max <<
|
||||
+ SYSCON_ERXDC_SHIFT);
|
||||
reg |= (val << SYSCON_ERXDC_SHIFT);
|
||||
} else {
|
||||
dev_err(priv->device, "Invalid RX clock delay: %d\n",
|
||||
@ -1,43 +0,0 @@
|
||||
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
|
||||
index 08d263567a52..be6705e89e95 100644
|
||||
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
|
||||
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
|
||||
@@ -97,6 +97,13 @@ const struct reg_field sun8i_syscon_reg_field = {
|
||||
.msb = 31,
|
||||
};
|
||||
|
||||
+/* EMAC clock register @ 0x164 in the CCU address range */
|
||||
+const struct reg_field sun8i_ccu_reg_field = {
|
||||
+ .reg = 0x164,
|
||||
+ .lsb = 0,
|
||||
+ .msb = 31,
|
||||
+};
|
||||
+
|
||||
static const struct emac_variant emac_variant_h3 = {
|
||||
.default_syscon_value = 0x58000,
|
||||
.syscon_field = &sun8i_syscon_reg_field,
|
||||
@@ -125,6 +132,15 @@ static const struct emac_variant emac_variant_a83t = {
|
||||
.tx_delay_max = 7,
|
||||
};
|
||||
|
||||
+static const struct emac_variant emac_variant_r40 = {
|
||||
+ .default_syscon_value = 0,
|
||||
+ .syscon_field = &sun8i_ccu_reg_field,
|
||||
+ .syscon_from_dev = true,
|
||||
+ .support_mii = true,
|
||||
+ .support_rgmii = true,
|
||||
+ .rx_delay_max = 7,
|
||||
+};
|
||||
+
|
||||
static const struct emac_variant emac_variant_a64 = {
|
||||
.default_syscon_value = 0,
|
||||
.syscon_field = &sun8i_syscon_reg_field,
|
||||
@@ -1148,6 +1164,8 @@ static const struct of_device_id sun8i_dwmac_match[] = {
|
||||
.data = &emac_variant_v3s },
|
||||
{ .compatible = "allwinner,sun8i-a83t-emac",
|
||||
.data = &emac_variant_a83t },
|
||||
+ { .compatible = "allwinner,sun8i-r40-gmac",
|
||||
+ .data = &emac_variant_r40 },
|
||||
{ .compatible = "allwinner,sun50i-a64-emac",
|
||||
.data = &emac_variant_a64 },
|
||||
{ }
|
||||
@ -1,52 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
|
||||
index 173dcc1652d2..bd97ca3dc2fa 100644
|
||||
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
|
||||
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
|
||||
@@ -265,6 +265,19 @@
|
||||
#interrupt-cells = <3>;
|
||||
#gpio-cells = <3>;
|
||||
|
||||
+ gmac_rgmii_pins: gmac-rgmii-pins {
|
||||
+ pins = "PA0", "PA1", "PA2", "PA3",
|
||||
+ "PA4", "PA5", "PA6", "PA7",
|
||||
+ "PA8", "PA10", "PA11", "PA12",
|
||||
+ "PA13", "PA15", "PA16";
|
||||
+ function = "gmac";
|
||||
+ /*
|
||||
+ * data lines in RGMII mode use DDR mode
|
||||
+ * and need a higher signal drive strength
|
||||
+ */
|
||||
+ drive-strength = <40>;
|
||||
+ };
|
||||
+
|
||||
i2c0_pins: i2c0-pins {
|
||||
pins = "PB0", "PB1";
|
||||
function = "i2c0";
|
||||
@@ -451,6 +464,27 @@
|
||||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
+ gmac: ethernet@1c50000 {
|
||||
+ compatible = "allwinner,sun8i-r40-gmac";
|
||||
+ syscon = <&ccu>;
|
||||
+ reg = <0x01c50000 0x10000>;
|
||||
+ interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
|
||||
+ interrupt-names = "macirq";
|
||||
+ resets = <&ccu RST_BUS_GMAC>;
|
||||
+ reset-names = "stmmaceth";
|
||||
+ clocks = <&ccu CLK_BUS_GMAC>;
|
||||
+ clock-names = "stmmaceth";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ gmac_mdio: mdio {
|
||||
+ compatible = "snps,dwmac-mdio";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
gic: interrupt-controller@1c81000 {
|
||||
compatible = "arm,gic-400";
|
||||
reg = <0x01c81000 0x1000>,
|
||||
@ -1,62 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
|
||||
index c6da21e43572..25fb048c7df2 100644
|
||||
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
|
||||
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
|
||||
@@ -51,6 +51,7 @@
|
||||
compatible = "sinovoip,bpi-m2-ultra", "allwinner,sun8i-r40";
|
||||
|
||||
aliases {
|
||||
+ ethernet0 = &gmac;
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
@@ -101,6 +102,22 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&gmac {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&gmac_rgmii_pins>;
|
||||
+ phy-handle = <&phy1>;
|
||||
+ phy-mode = "rgmii";
|
||||
+ phy-supply = <®_dc1sw>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&gmac_mdio {
|
||||
+ phy1: ethernet-phy@1 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <1>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
&i2c0 {
|
||||
status = "okay";
|
||||
|
||||
@@ -149,6 +166,13 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+®_aldo2 {
|
||||
+ regulator-always-on;
|
||||
+ regulator-min-microvolt = <2500000>;
|
||||
+ regulator-max-microvolt = <2500000>;
|
||||
+ regulator-name = "vcc-pa";
|
||||
+};
|
||||
+
|
||||
®_aldo3 {
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <2700000>;
|
||||
@@ -156,6 +180,12 @@
|
||||
regulator-name = "avcc";
|
||||
};
|
||||
|
||||
+®_dc1sw {
|
||||
+ regulator-min-microvolt = <3000000>;
|
||||
+ regulator-max-microvolt = <3000000>;
|
||||
+ regulator-name = "vcc-gmac-phy";
|
||||
+};
|
||||
+
|
||||
®_dcdc1 {
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <3000000>;
|
||||
@ -1,165 +0,0 @@
|
||||
From 488fbb1ff0931604f2e97db76c840ef5f7305eae Mon Sep 17 00:00:00 2001
|
||||
From: Icenowy Zheng <icenowy@aosc.xyz>
|
||||
Date: Tue, 1 Aug 2017 21:12:54 +0800
|
||||
Subject: [PATCH] drm: sun4i: add support for H3's TCON
|
||||
|
||||
Allwinner H3 has two special TCONs without channel 0.
|
||||
|
||||
Add support for this kind of TCON.
|
||||
|
||||
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
|
||||
---
|
||||
drivers/gpu/drm/sun4i/sun4i_drv.c | 1 +
|
||||
drivers/gpu/drm/sun4i/sun4i_tcon.c | 43 +++++++++++++++++++++++++++-----------
|
||||
drivers/gpu/drm/sun4i/sun4i_tcon.h | 1 +
|
||||
3 files changed, 33 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
|
||||
index ace59651892fb..fd99fe8a4df72 100644
|
||||
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
|
||||
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
|
||||
@@ -188,6 +188,7 @@ static bool sun4i_drv_node_is_tcon(struct device_node *node)
|
||||
of_device_is_compatible(node, "allwinner,sun6i-a31-tcon") ||
|
||||
of_device_is_compatible(node, "allwinner,sun6i-a31s-tcon") ||
|
||||
of_device_is_compatible(node, "allwinner,sun8i-a33-tcon") ||
|
||||
+ of_device_is_compatible(node, "allwinner,sun8i-h3-tcon") ||
|
||||
of_device_is_compatible(node, "allwinner,sun8i-v3s-tcon");
|
||||
}
|
||||
|
||||
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
|
||||
index d9791292553ef..270f09e381a5e 100644
|
||||
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
|
||||
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
|
||||
@@ -59,6 +59,7 @@ void sun4i_tcon_channel_disable(struct sun4i_tcon *tcon, int channel)
|
||||
|
||||
/* Disable the TCON's channel */
|
||||
if (channel == 0) {
|
||||
+ WARN_ON(!tcon->quirks->has_channel_0);
|
||||
regmap_update_bits(tcon->regs, SUN4I_TCON0_CTL_REG,
|
||||
SUN4I_TCON0_CTL_TCON_ENABLE, 0);
|
||||
clk_disable_unprepare(tcon->dclk);
|
||||
@@ -78,6 +79,7 @@ void sun4i_tcon_channel_enable(struct sun4i_tcon *tcon, int channel)
|
||||
|
||||
/* Enable the TCON's channel */
|
||||
if (channel == 0) {
|
||||
+ WARN_ON(!tcon->quirks->has_channel_0);
|
||||
regmap_update_bits(tcon->regs, SUN4I_TCON0_CTL_REG,
|
||||
SUN4I_TCON0_CTL_TCON_ENABLE,
|
||||
SUN4I_TCON0_CTL_TCON_ENABLE);
|
||||
@@ -157,6 +159,8 @@ void sun4i_tcon0_mode_set(struct sun4i_tcon *tcon,
|
||||
u8 clk_delay;
|
||||
u32 val = 0;
|
||||
|
||||
+ WARN_ON(!tcon->quirks->has_channel_0);
|
||||
+
|
||||
/* Configure the dot clock */
|
||||
clk_set_rate(tcon->dclk, mode->crtc_clock * 1000);
|
||||
|
||||
@@ -366,10 +370,12 @@ static int sun4i_tcon_init_clocks(struct device *dev,
|
||||
}
|
||||
clk_prepare_enable(tcon->clk);
|
||||
|
||||
- tcon->sclk0 = devm_clk_get(dev, "tcon-ch0");
|
||||
- if (IS_ERR(tcon->sclk0)) {
|
||||
- dev_err(dev, "Couldn't get the TCON channel 0 clock\n");
|
||||
- return PTR_ERR(tcon->sclk0);
|
||||
+ if (tcon->quirks->has_channel_0) {
|
||||
+ tcon->sclk0 = devm_clk_get(dev, "tcon-ch0");
|
||||
+ if (IS_ERR(tcon->sclk0)) {
|
||||
+ dev_err(dev, "Couldn't get the TCON channel 0 clock\n");
|
||||
+ return PTR_ERR(tcon->sclk0);
|
||||
+ }
|
||||
}
|
||||
|
||||
if (tcon->quirks->has_channel_1) {
|
||||
@@ -551,10 +557,12 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
|
||||
goto err_free_clocks;
|
||||
}
|
||||
|
||||
- ret = sun4i_dclk_create(dev, tcon);
|
||||
- if (ret) {
|
||||
- dev_err(dev, "Couldn't create our TCON dot clock\n");
|
||||
- goto err_free_clocks;
|
||||
+ if (tcon->quirks->has_channel_0) {
|
||||
+ ret = sun4i_dclk_create(dev, tcon);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "Couldn't create our TCON dot clock\n");
|
||||
+ goto err_free_clocks;
|
||||
+ }
|
||||
}
|
||||
|
||||
ret = sun4i_tcon_init_irq(dev, tcon);
|
||||
@@ -579,7 +587,8 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master,
|
||||
return 0;
|
||||
|
||||
err_free_dotclock:
|
||||
- sun4i_dclk_free(tcon);
|
||||
+ if (tcon->quirks->has_channel_0)
|
||||
+ sun4i_dclk_free(tcon);
|
||||
err_free_clocks:
|
||||
sun4i_tcon_free_clocks(tcon);
|
||||
err_assert_reset:
|
||||
@@ -593,7 +602,9 @@ static void sun4i_tcon_unbind(struct device *dev, struct device *master,
|
||||
struct sun4i_tcon *tcon = dev_get_drvdata(dev);
|
||||
|
||||
list_del(&tcon->list);
|
||||
- sun4i_dclk_free(tcon);
|
||||
+
|
||||
+ if (tcon->quirks->has_channel_0)
|
||||
+ sun4i_dclk_free(tcon);
|
||||
sun4i_tcon_free_clocks(tcon);
|
||||
}
|
||||
|
||||
@@ -625,23 +636,30 @@ static int sun4i_tcon_remove(struct platform_device *pdev)
|
||||
|
||||
static const struct sun4i_tcon_quirks sun5i_a13_quirks = {
|
||||
.has_unknown_mux = true,
|
||||
+ .has_channel_0 = true,
|
||||
.has_channel_1 = true,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun6i_a31_quirks = {
|
||||
+ .has_channel_0 = true,
|
||||
.has_channel_1 = true,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun6i_a31s_quirks = {
|
||||
+ .has_channel_0 = true,
|
||||
.has_channel_1 = true,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun8i_a33_quirks = {
|
||||
- /* nothing is supported */
|
||||
+ .has_channel_0 = true,
|
||||
};
|
||||
|
||||
static const struct sun4i_tcon_quirks sun8i_v3s_quirks = {
|
||||
- /* nothing is supported */
|
||||
+ .has_channel_0 = true,
|
||||
+};
|
||||
+
|
||||
+static const struct sun4i_tcon_quirks sun8i_h3_quirks = {
|
||||
+ .has_channel_1 = true,
|
||||
};
|
||||
|
||||
static const struct of_device_id sun4i_tcon_of_table[] = {
|
||||
@@ -649,6 +667,7 @@ static const struct of_device_id sun4i_tcon_of_table[] = {
|
||||
{ .compatible = "allwinner,sun6i-a31-tcon", .data = &sun6i_a31_quirks },
|
||||
{ .compatible = "allwinner,sun6i-a31s-tcon", .data = &sun6i_a31s_quirks },
|
||||
{ .compatible = "allwinner,sun8i-a33-tcon", .data = &sun8i_a33_quirks },
|
||||
+ { .compatible = "allwinner,sun8i-h3-tcon", .data = &sun8i_h3_quirks },
|
||||
{ .compatible = "allwinner,sun8i-v3s-tcon", .data = &sun8i_v3s_quirks },
|
||||
{ }
|
||||
};
|
||||
diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.h b/drivers/gpu/drm/sun4i/sun4i_tcon.h
|
||||
index 552c88ec16be3..de035e598129b 100644
|
||||
--- a/drivers/gpu/drm/sun4i/sun4i_tcon.h
|
||||
+++ b/drivers/gpu/drm/sun4i/sun4i_tcon.h
|
||||
@@ -145,6 +145,7 @@
|
||||
|
||||
struct sun4i_tcon_quirks {
|
||||
bool has_unknown_mux; /* sun5i has undocumented mux */
|
||||
+ bool has_channel_0; /* some A83T+ TCONs don't have channel 0*/
|
||||
bool has_channel_1; /* a33 does not have channel 1 */
|
||||
};
|
||||
|
||||
@ -1,197 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
index c8e7afa0..dc36bc38 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
|
||||
@@ -46,12 +46,72 @@
|
||||
#include <dt-bindings/clock/sun8i-r-ccu.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
#include <dt-bindings/reset/sun50i-a64-ccu.h>
|
||||
+#include <dt-bindings/thermal/thermal.h>
|
||||
|
||||
/ {
|
||||
interrupt-parent = <&gic>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
+ cpu0_opp_table: opp_table0 {
|
||||
+ compatible = "operating-points-v2";
|
||||
+ opp-shared;
|
||||
+
|
||||
+ opp@408000000 {
|
||||
+ opp-hz = /bits/ 64 <408000000>;
|
||||
+ opp-microvolt = <1000000 1000000 1300000>;
|
||||
+ clock-latency-ns = <244144>; /* 8 32k periods */
|
||||
+ };
|
||||
+
|
||||
+ opp@648000000 {
|
||||
+ opp-hz = /bits/ 64 <648000000>;
|
||||
+ opp-microvolt = <1040000 1040000 1300000>;
|
||||
+ clock-latency-ns = <244144>; /* 8 32k periods */
|
||||
+ };
|
||||
+
|
||||
+ opp@816000000 {
|
||||
+ opp-hz = /bits/ 64 <816000000>;
|
||||
+ opp-microvolt = <1080000 1080000 1300000>;
|
||||
+ clock-latency-ns = <244144>; /* 8 32k periods */
|
||||
+ };
|
||||
+
|
||||
+ opp@912000000 {
|
||||
+ opp-hz = /bits/ 64 <912000000>;
|
||||
+ opp-microvolt = <1120000 1120000 1300000>;
|
||||
+ clock-latency-ns = <244144>; /* 8 32k periods */
|
||||
+ };
|
||||
+
|
||||
+ opp@960000000 {
|
||||
+ opp-hz = /bits/ 64 <960000000>;
|
||||
+ opp-microvolt = <1160000 1160000 1300000>;
|
||||
+ clock-latency-ns = <244144>; /* 8 32k periods */
|
||||
+ };
|
||||
+
|
||||
+ opp@1008000000 {
|
||||
+ opp-hz = /bits/ 64 <1008000000>;
|
||||
+ opp-microvolt = <1200000 1200000 1300000>;
|
||||
+ clock-latency-ns = <244144>; /* 8 32k periods */
|
||||
+ };
|
||||
+
|
||||
+ opp@1056000000 {
|
||||
+ opp-hz = /bits/ 64 <1056000000>;
|
||||
+ opp-microvolt = <1240000 1240000 1300000>;
|
||||
+ clock-latency-ns = <244144>; /* 8 32k periods */
|
||||
+ };
|
||||
+
|
||||
+ opp@1104000000 {
|
||||
+ opp-hz = /bits/ 64 <1104000000>;
|
||||
+ opp-microvolt = <1260000 1260000 1300000>;
|
||||
+ clock-latency-ns = <244144>; /* 8 32k periods */
|
||||
+ };
|
||||
+
|
||||
+ opp@1152000000 {
|
||||
+ opp-hz = /bits/ 64 <1152000000>;
|
||||
+ opp-microvolt = <1300000 1300000 1300000>;
|
||||
+ clock-latency-ns = <244144>; /* 8 32k periods */
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@@ -65,6 +125,12 @@
|
||||
device_type = "cpu";
|
||||
reg = <0>;
|
||||
enable-method = "psci";
|
||||
+ clocks = <&ccu 21>;
|
||||
+ clock-names = "cpu";
|
||||
+ operating-points-v2 = <&cpu0_opp_table>;
|
||||
+ #cooling-cells = <2>;
|
||||
+ cooling-min-level = <0>;
|
||||
+ cooling-max-level = <8>;
|
||||
};
|
||||
|
||||
cpu1: cpu@1 {
|
||||
@@ -72,6 +138,8 @@
|
||||
device_type = "cpu";
|
||||
reg = <1>;
|
||||
enable-method = "psci";
|
||||
+ clocks = <&ccu 21>;
|
||||
+ operating-points-v2 = <&cpu0_opp_table>;
|
||||
};
|
||||
|
||||
cpu2: cpu@2 {
|
||||
@@ -79,6 +147,8 @@
|
||||
device_type = "cpu";
|
||||
reg = <2>;
|
||||
enable-method = "psci";
|
||||
+ clocks = <&ccu 21>;
|
||||
+ operating-points-v2 = <&cpu0_opp_table>;
|
||||
};
|
||||
|
||||
cpu3: cpu@3 {
|
||||
@@ -86,6 +156,59 @@
|
||||
device_type = "cpu";
|
||||
reg = <3>;
|
||||
enable-method = "psci";
|
||||
+ clocks = <&ccu 21>;
|
||||
+ operating-points-v2 = <&cpu0_opp_table>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ thermal-zones {
|
||||
+ cpu_thermal: cpu_thermal {
|
||||
+ polling-delay-passive = <330>;
|
||||
+ polling-delay = <1000>;
|
||||
+ thermal-sensors = <&ths>;
|
||||
+
|
||||
+ trips {
|
||||
+ cpu_warm: cpu_warm {
|
||||
+ temperature = <65000>;
|
||||
+ hysteresis = <2000>;
|
||||
+ type = "passive";
|
||||
+ };
|
||||
+
|
||||
+ cpu_hot: cpu_hot {
|
||||
+ temperature = <75000>;
|
||||
+ hysteresis = <2000>;
|
||||
+ type = "passive";
|
||||
+ };
|
||||
+
|
||||
+ cpu_very_hot: cpu_very_hot {
|
||||
+ temperature = <90000>;
|
||||
+ hysteresis = <2000>;
|
||||
+ type = "passive";
|
||||
+ };
|
||||
+
|
||||
+ cpu_crit: cpu_crit {
|
||||
+ temperature = <105000>;
|
||||
+ hysteresis = <2000>;
|
||||
+ type = "critical";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ cooling-maps {
|
||||
+ cpu_warm_limit_cpu {
|
||||
+ trip = <&cpu_warm>;
|
||||
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT 2>;
|
||||
+ };
|
||||
+
|
||||
+ cpu_hot_limit_cpu {
|
||||
+ trip = <&cpu_hot>;
|
||||
+ cooling-device = <&cpu0 3 5>;
|
||||
+ };
|
||||
+
|
||||
+ cpu_very_hot_limit_cpu {
|
||||
+ trip = <&cpu_very_hot>;
|
||||
+ cooling-device = <&cpu0 6 THERMAL_NO_LIMIT>;
|
||||
+ };
|
||||
+ };
|
||||
};
|
||||
};
|
||||
|
||||
@@ -149,6 +272,11 @@
|
||||
(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
|
||||
};
|
||||
|
||||
+ iio-hwmon {
|
||||
+ compatible = "iio-hwmon";
|
||||
+ io-channels = <&ths>;
|
||||
+ };
|
||||
+
|
||||
soc {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
@@ -594,6 +722,16 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
+ ths: thermal-sensor@1c25000 {
|
||||
+ compatible = "allwinner,sun50i-a64-ths";
|
||||
+ reg = <0x01c25000 0x100>;
|
||||
+ clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>;
|
||||
+ clock-names = "bus", "mod";
|
||||
+ resets = <&ccu RST_BUS_THS>;
|
||||
+ #thermal-sensor-cells = <0>;
|
||||
+ #io-channel-cells = <0>;
|
||||
+ };
|
||||
+
|
||||
uart0: serial@1c28000 {
|
||||
compatible = "snps,dw-apb-uart";
|
||||
reg = <0x01c28000 0x400>;
|
||||
@ -1,174 +0,0 @@
|
||||
diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c
|
||||
index 19216af1..e839d23a 100644
|
||||
--- a/drivers/staging/iio/frequency/ad9834.c
|
||||
+++ b/drivers/staging/iio/frequency/ad9834.c
|
||||
@@ -13,11 +13,14 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/list.h>
|
||||
+#include <linux/of.h>
|
||||
+#include <linux/of_device.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/module.h>
|
||||
#include <asm/div64.h>
|
||||
+#include <linux/clk.h>
|
||||
|
||||
#include <linux/iio/iio.h>
|
||||
#include <linux/iio/sysfs.h>
|
||||
@@ -316,14 +319,81 @@ static const struct iio_info ad9833_info = {
|
||||
.driver_module = THIS_MODULE,
|
||||
};
|
||||
|
||||
+#if defined(CONFIG_OF)
|
||||
+static struct ad9834_platform_data *ad9834_parse_dt(struct spi_device *spi)
|
||||
+{
|
||||
+ struct ad9834_platform_data *pdata;
|
||||
+ struct device_node *np = spi->dev.of_node;
|
||||
+
|
||||
+ pdata = devm_kzalloc(&spi->dev, sizeof(*pdata), GFP_KERNEL);
|
||||
+ if (!pdata)
|
||||
+ return ERR_PTR(-ENOMEM);
|
||||
+
|
||||
+ pdata->freq0 = 134000;
|
||||
+ of_property_read_u32(np, "freq0", &pdata->freq0);
|
||||
+
|
||||
+ pdata->freq1 = 134000;
|
||||
+ of_property_read_u32(np, "freq1", &pdata->freq1);
|
||||
+
|
||||
+ pdata->phase0 = 0;
|
||||
+ of_property_read_u16(np, "phase0", &pdata->phase0);
|
||||
+
|
||||
+ pdata->phase1 = 0;
|
||||
+ of_property_read_u16(np, "phase1", &pdata->phase1);
|
||||
+
|
||||
+ pdata->en_div2 = of_property_read_bool(np, "en_div2");
|
||||
+ pdata->en_signbit_msb_out = of_property_read_bool(np,
|
||||
+ "en_signbit_msb_out");
|
||||
+
|
||||
+ return pdata;
|
||||
+}
|
||||
+#else
|
||||
+static struct ad9834_platform_data *ad9834_parse_dt(struct spi_device *spi)
|
||||
+{
|
||||
+ return NULL;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+static const struct of_device_id ad9834_of_match[] = {
|
||||
+ {
|
||||
+ .compatible = "adi,ad9833",
|
||||
+ .data = (void *)ID_AD9833,
|
||||
+ },
|
||||
+ {
|
||||
+ .compatible = "adi,ad9834",
|
||||
+ .data = (void *)ID_AD9834,
|
||||
+ },
|
||||
+ {
|
||||
+ .compatible = "adi,ad9837",
|
||||
+ .data = (void *)ID_AD9837,
|
||||
+ },
|
||||
+ {
|
||||
+ .compatible = "adi,ad9838",
|
||||
+ .data = (void *)ID_AD9838,
|
||||
+ },
|
||||
+ { }
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, ad9834_of_match);
|
||||
+
|
||||
static int ad9834_probe(struct spi_device *spi)
|
||||
{
|
||||
- struct ad9834_platform_data *pdata = dev_get_platdata(&spi->dev);
|
||||
+ const struct of_device_id *of_id = of_match_device(ad9834_of_match,
|
||||
+ &spi->dev);
|
||||
+ struct ad9834_platform_data *pdata;
|
||||
struct ad9834_state *st;
|
||||
struct iio_dev *indio_dev;
|
||||
struct regulator *reg;
|
||||
+ struct clk *clk = NULL;
|
||||
int ret;
|
||||
|
||||
+ if (!pdata && spi->dev.of_node) {
|
||||
+ pdata = ad9834_parse_dt(spi);
|
||||
+ if (IS_ERR(pdata))
|
||||
+ return PTR_ERR(pdata);
|
||||
+ } else {
|
||||
+ pdata = spi->dev.platform_data;
|
||||
+ }
|
||||
+
|
||||
if (!pdata) {
|
||||
dev_dbg(&spi->dev, "no platform data?\n");
|
||||
return -ENODEV;
|
||||
@@ -346,9 +416,30 @@ static int ad9834_probe(struct spi_device *spi)
|
||||
}
|
||||
spi_set_drvdata(spi, indio_dev);
|
||||
st = iio_priv(indio_dev);
|
||||
- st->mclk = pdata->mclk;
|
||||
+
|
||||
+ if (!pdata->mclk) {
|
||||
+ clk = devm_clk_get(&spi->dev, NULL);
|
||||
+ if (IS_ERR(clk))
|
||||
+ return -EPROBE_DEFER;
|
||||
+
|
||||
+ ret = clk_prepare_enable(clk);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ if (clk) {
|
||||
+ st->clk = clk;
|
||||
+ st->mclk = clk_get_rate(clk);
|
||||
+ } else {
|
||||
+ st->mclk = pdata->mclk;
|
||||
+ }
|
||||
+
|
||||
+ if (of_id)
|
||||
+ st->devid = (enum ad9834_supported_device_ids)of_id->data;
|
||||
+ else
|
||||
+ st->devid = spi_get_device_id(spi)->driver_data;
|
||||
+
|
||||
st->spi = spi;
|
||||
- st->devid = spi_get_device_id(spi)->driver_data;
|
||||
st->reg = reg;
|
||||
indio_dev->dev.parent = &spi->dev;
|
||||
indio_dev->name = spi_get_device_id(spi)->name;
|
||||
@@ -421,6 +512,9 @@ static int ad9834_probe(struct spi_device *spi)
|
||||
error_disable_reg:
|
||||
regulator_disable(reg);
|
||||
|
||||
+if (clk)
|
||||
+ clk_disable_unprepare(clk);
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -431,6 +525,8 @@ static int ad9834_remove(struct spi_device *spi)
|
||||
|
||||
iio_device_unregister(indio_dev);
|
||||
regulator_disable(st->reg);
|
||||
+if (st->clk)
|
||||
+ clk_disable_unprepare(st->clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -447,6 +543,7 @@ MODULE_DEVICE_TABLE(spi, ad9834_id);
|
||||
static struct spi_driver ad9834_driver = {
|
||||
.driver = {
|
||||
.name = "ad9834",
|
||||
+ .of_match_table = of_match_ptr(ad9834_of_match),
|
||||
},
|
||||
.probe = ad9834_probe,
|
||||
.remove = ad9834_remove,
|
||||
diff --git a/drivers/staging/iio/frequency/ad9834.h b/drivers/staging/iio/frequency/ad9834.h
|
||||
index 40fdd5da..fd9cccf3 100644
|
||||
--- a/drivers/staging/iio/frequency/ad9834.h
|
||||
+++ b/drivers/staging/iio/frequency/ad9834.h
|
||||
@@ -53,6 +53,7 @@
|
||||
struct ad9834_state {
|
||||
struct spi_device *spi;
|
||||
struct regulator *reg;
|
||||
+ struct clk *clk;
|
||||
unsigned int mclk;
|
||||
unsigned short control;
|
||||
unsigned short devid;
|
||||
@ -1,141 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts b/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
|
||||
old mode 100644
|
||||
new mode 100755
|
||||
index 10da56e..7d2f879
|
||||
--- a/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Marcus Cooper <codekipper@gmail.com>
|
||||
+ * Copyright (C) 2018 Armbian
|
||||
*
|
||||
* 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
|
||||
@@ -52,18 +53,27 @@
|
||||
compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
|
||||
|
||||
aliases {
|
||||
+ ethernet0 = &emac;
|
||||
serial0 = &uart0;
|
||||
- /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
|
||||
- ethernet1 = &sdiowifi;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
+ connector {
|
||||
+ compatible = "hdmi-connector";
|
||||
+ type = "a";
|
||||
+
|
||||
+ port {
|
||||
+ hdmi_con_in: endpoint {
|
||||
+ remote-endpoint = <&hdmi_out_con>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
-
|
||||
blue {
|
||||
label = "beelink-x2:blue:pwr";
|
||||
gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
|
||||
@@ -76,15 +86,9 @@
|
||||
};
|
||||
};
|
||||
|
||||
- wifi_pwrseq: wifi_pwrseq {
|
||||
- compatible = "mmc-pwrseq-simple";
|
||||
- reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
|
||||
- };
|
||||
-
|
||||
sound_spdif {
|
||||
compatible = "simple-audio-card";
|
||||
simple-audio-card,name = "On-board SPDIF";
|
||||
-
|
||||
simple-audio-card,cpu {
|
||||
sound-dai = <&spdif>;
|
||||
};
|
||||
@@ -100,6 +104,19 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&codec {
|
||||
+ allwinner,audio-routing =
|
||||
+ "Line Out", "LINEOUT",
|
||||
+ "MIC1", "Mic",
|
||||
+ "Mic", "MBIAS";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+
|
||||
+};
|
||||
+
|
||||
&ehci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -108,12 +125,45 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&ehci2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ phy-handle = <&int_mii_phy>;
|
||||
+ phy-mode = "mii";
|
||||
+ allwinner,leds-active-low;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi_out {
|
||||
+ hdmi_out_con: endpoint {
|
||||
+ remote-endpoint = <&hdmi_con_in>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2s2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ir {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&ir_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&mixer0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&mmc0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
|
||||
@@ -164,6 +214,14 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&sound_hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&tcon0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&spdif {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spdif_tx_pins_a>;
|
||||
@ -1,266 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
index c01e6d7..d7ff830
|
||||
--- a/arch/arm64/boot/dts/allwinner/Makefile
|
||||
+++ b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
@@ -6,6 +6,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
|
||||
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-m1-plus2.dtb
|
||||
|
||||
always := $(dtb-y)
|
||||
subdir-y := $(dts-dirs) overlay
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-m1-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-m1-plus2.dts
|
||||
new file mode 100644
|
||||
index 0000000..a6bf32d
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-m1-plus2.dts
|
||||
@@ -0,0 +1,248 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
|
||||
+ * Copyright (C) 2017 Armbian
|
||||
+ *
|
||||
+ * 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 "sun50i-h5.dtsi"
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+
|
||||
+/ {
|
||||
+ model = "FriendlyARM Nanopi M1 Plus 2";
|
||||
+ compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5";
|
||||
+
|
||||
+ aliases {
|
||||
+ ethernet0 = &emac;
|
||||
+ serial0 = &uart0;
|
||||
+ };
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = "serial0:115200n8";
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ pwr {
|
||||
+ label = "nanopi:green:pwr";
|
||||
+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
|
||||
+ default-state = "on";
|
||||
+ };
|
||||
+
|
||||
+ status {
|
||||
+ label = "nanopi:blue:status";
|
||||
+ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ reg_gmac_3v3: gmac-3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "gmac-3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ startup-delay-us = <100000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ reg_vcc3v3: vcc3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ };
|
||||
+
|
||||
+ reg_usb0_vbus: usb0-vbus {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "usb0-vbus";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ wifi_pwrseq: wifi_pwrseq {
|
||||
+ compatible = "mmc-pwrseq-simple";
|
||||
+ reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
|
||||
+ post-power-on-delay-ms = <50>;
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
+
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emac_rgmii_pins>;
|
||||
+ phy-supply = <®_gmac_3v3>;
|
||||
+ phy-handle = <&ext_rgmii_phy>;
|
||||
+ phy-mode = "rgmii";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mdio {
|
||||
+ ext_rgmii_phy: ethernet-phy@7 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <7>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <4>;
|
||||
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mmc1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc1_pins_a>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ vqmmc-supply = <®_vcc3v3>;
|
||||
+ mmc-pwrseq = <&wifi_pwrseq>;
|
||||
+ bus-width = <4>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ brcmf: brcmf@1 {
|
||||
+ reg = <1>;
|
||||
+ compatible = "brcm,bcm4329-fmac";
|
||||
+ interrupt-parent = <&r_pio>;
|
||||
+ interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>; /* PL7 / EINT7 */
|
||||
+ interrupt-names = "host-wake";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&wifi_wake>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc2 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc2_8bit_pins>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <8>;
|
||||
+ non-removable;
|
||||
+ cap-mmc-hw-reset;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mixer0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&r_pio {
|
||||
+ wifi_wake: wifi_wake@0 {
|
||||
+ pins = "PL7";
|
||||
+ function = "irq";
|
||||
+ bias-pull-up;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&sound_hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&tcon0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&r_i2c {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart0_pins_a>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_otg {
|
||||
+ dr_mode = "peripheral";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usbphy {
|
||||
+ /* USB Type-A port's VBUS is always on */
|
||||
+ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
|
||||
+ usb0_vbus-supply = <®_usb0_vbus>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
@ -1,483 +0,0 @@
|
||||
diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
|
||||
index 137f577d..b0b231da 100644
|
||||
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
|
||||
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
|
||||
@@ -22,6 +22,7 @@
|
||||
* shutdown for not being used.
|
||||
*/
|
||||
|
||||
+#include <linux/clk.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
@@ -31,6 +32,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/regmap.h>
|
||||
+#include <linux/reset.h>
|
||||
#include <linux/thermal.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
@@ -49,46 +51,22 @@ static unsigned int sun6i_gpadc_chan_select(unsigned int chan)
|
||||
return SUN6I_GPADC_CTRL1_ADC_CHAN_SELECT(chan);
|
||||
}
|
||||
|
||||
+struct sun4i_gpadc_iio;
|
||||
+
|
||||
struct gpadc_data {
|
||||
int temp_offset;
|
||||
int temp_scale;
|
||||
+ int temp_divider;
|
||||
unsigned int tp_mode_en;
|
||||
unsigned int tp_adc_select;
|
||||
unsigned int (*adc_chan_select)(unsigned int chan);
|
||||
unsigned int adc_chan_mask;
|
||||
-};
|
||||
-
|
||||
-static const struct gpadc_data sun4i_gpadc_data = {
|
||||
- .temp_offset = -1932,
|
||||
- .temp_scale = 133,
|
||||
- .tp_mode_en = SUN4I_GPADC_CTRL1_TP_MODE_EN,
|
||||
- .tp_adc_select = SUN4I_GPADC_CTRL1_TP_ADC_SELECT,
|
||||
- .adc_chan_select = &sun4i_gpadc_chan_select,
|
||||
- .adc_chan_mask = SUN4I_GPADC_CTRL1_ADC_CHAN_MASK,
|
||||
-};
|
||||
-
|
||||
-static const struct gpadc_data sun5i_gpadc_data = {
|
||||
- .temp_offset = -1447,
|
||||
- .temp_scale = 100,
|
||||
- .tp_mode_en = SUN4I_GPADC_CTRL1_TP_MODE_EN,
|
||||
- .tp_adc_select = SUN4I_GPADC_CTRL1_TP_ADC_SELECT,
|
||||
- .adc_chan_select = &sun4i_gpadc_chan_select,
|
||||
- .adc_chan_mask = SUN4I_GPADC_CTRL1_ADC_CHAN_MASK,
|
||||
-};
|
||||
-
|
||||
-static const struct gpadc_data sun6i_gpadc_data = {
|
||||
- .temp_offset = -1623,
|
||||
- .temp_scale = 167,
|
||||
- .tp_mode_en = SUN6I_GPADC_CTRL1_TP_MODE_EN,
|
||||
- .tp_adc_select = SUN6I_GPADC_CTRL1_TP_ADC_SELECT,
|
||||
- .adc_chan_select = &sun6i_gpadc_chan_select,
|
||||
- .adc_chan_mask = SUN6I_GPADC_CTRL1_ADC_CHAN_MASK,
|
||||
-};
|
||||
-
|
||||
-static const struct gpadc_data sun8i_a33_gpadc_data = {
|
||||
- .temp_offset = -1662,
|
||||
- .temp_scale = 162,
|
||||
- .tp_mode_en = SUN8I_GPADC_CTRL1_CHOP_TEMP_EN,
|
||||
+ unsigned int temp_data;
|
||||
+ int (*sample_start)(struct sun4i_gpadc_iio *info);
|
||||
+ int (*sample_end)(struct sun4i_gpadc_iio *info);
|
||||
+ bool has_bus_clk;
|
||||
+ bool has_bus_rst;
|
||||
+ bool has_mod_clk;
|
||||
};
|
||||
|
||||
struct sun4i_gpadc_iio {
|
||||
@@ -103,6 +81,9 @@ struct sun4i_gpadc_iio {
|
||||
atomic_t ignore_temp_data_irq;
|
||||
const struct gpadc_data *data;
|
||||
bool no_irq;
|
||||
+ struct clk *ths_bus_clk;
|
||||
+ struct clk *mod_clk;
|
||||
+ struct reset_control *reset;
|
||||
/* prevents concurrent reads of temperature and ADC */
|
||||
struct mutex mutex;
|
||||
struct thermal_zone_device *tzd;
|
||||
@@ -277,7 +258,7 @@ static int sun4i_gpadc_temp_read(struct iio_dev *indio_dev, int *val)
|
||||
if (info->no_irq) {
|
||||
pm_runtime_get_sync(indio_dev->dev.parent);
|
||||
|
||||
- regmap_read(info->regmap, SUN4I_GPADC_TEMP_DATA, val);
|
||||
+ regmap_read(info->regmap, info->data->temp_data, val);
|
||||
|
||||
pm_runtime_mark_last_busy(indio_dev->dev.parent);
|
||||
pm_runtime_put_autosuspend(indio_dev->dev.parent);
|
||||
@@ -306,6 +287,15 @@ static int sun4i_gpadc_temp_scale(struct iio_dev *indio_dev, int *val)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int sun4i_gpadc_temp_divider(struct iio_dev *indio_dev, int *val)
|
||||
+{
|
||||
+ struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
|
||||
+
|
||||
+ *val = info->data->temp_divider;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int sun4i_gpadc_read_raw(struct iio_dev *indio_dev,
|
||||
struct iio_chan_spec const *chan, int *val,
|
||||
int *val2, long mask)
|
||||
@@ -383,10 +373,8 @@ static irqreturn_t sun4i_gpadc_fifo_data_irq_handler(int irq, void *dev_id)
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
-static int sun4i_gpadc_runtime_suspend(struct device *dev)
|
||||
+static int sun4i_gpadc_sample_end(struct sun4i_gpadc_iio *info)
|
||||
{
|
||||
- struct sun4i_gpadc_iio *info = iio_priv(dev_get_drvdata(dev));
|
||||
-
|
||||
/* Disable the ADC on IP */
|
||||
regmap_write(info->regmap, SUN4I_GPADC_CTRL1, 0);
|
||||
/* Disable temperature sensor on IP */
|
||||
@@ -395,10 +383,23 @@ static int sun4i_gpadc_runtime_suspend(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int sun4i_gpadc_runtime_resume(struct device *dev)
|
||||
+static int sun8i_h3_gpadc_sample_end(struct sun4i_gpadc_iio *info)
|
||||
+{
|
||||
+ /* Disable temperature sensor */
|
||||
+ regmap_write(info->regmap, SUN8I_H3_GPADC_CTRL2, 0);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int sun4i_gpadc_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct sun4i_gpadc_iio *info = iio_priv(dev_get_drvdata(dev));
|
||||
|
||||
+ return info->data->sample_end(info);
|
||||
+}
|
||||
+
|
||||
+static int sun4i_gpadc_sample_start(struct sun4i_gpadc_iio *info)
|
||||
+{
|
||||
/* clkin = 6MHz */
|
||||
regmap_write(info->regmap, SUN4I_GPADC_CTRL0,
|
||||
SUN4I_GPADC_CTRL0_ADC_CLK_DIVIDER(2) |
|
||||
@@ -416,18 +417,52 @@ static int sun4i_gpadc_runtime_resume(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int sun8i_h3_gpadc_sample_start(struct sun4i_gpadc_iio *info)
|
||||
+{
|
||||
+ regmap_write(info->regmap, SUN8I_H3_GPADC_CTRL2,
|
||||
+ SUN8I_H3_GPADC_CTRL2_TEMP_SENSE_EN |
|
||||
+ SUN8I_H3_GPADC_CTRL2_T_ACQ1(31));
|
||||
+ regmap_write(info->regmap, SUN4I_GPADC_CTRL0,
|
||||
+ SUN4I_GPADC_CTRL0_T_ACQ(31));
|
||||
+ regmap_write(info->regmap, SUN8I_H3_GPADC_CTRL3,
|
||||
+ SUN4I_GPADC_CTRL3_FILTER_EN |
|
||||
+ SUN4I_GPADC_CTRL3_FILTER_TYPE(1));
|
||||
+ regmap_write(info->regmap, SUN8I_H3_GPADC_INTC,
|
||||
+ SUN8I_H3_GPADC_INTC_TEMP_PERIOD(800));
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int sun4i_gpadc_runtime_resume(struct device *dev)
|
||||
+{
|
||||
+ struct sun4i_gpadc_iio *info = iio_priv(dev_get_drvdata(dev));
|
||||
+
|
||||
+ return info->data->sample_start(info);
|
||||
+}
|
||||
+
|
||||
+/* temperature = ( MINUPA - reg * MULPA) / DIVPA
|
||||
+#define MULPA 25000
|
||||
+#define DIVPA 214
|
||||
+#define MINUPA 2170
|
||||
+static int sun50_th_reg_to_temp(uint32_t reg_data)
|
||||
+{
|
||||
+ return ((MINUPA - (int)reg_data) * MULPA) / DIVPA;
|
||||
+}
|
||||
+*/
|
||||
+
|
||||
static int sun4i_gpadc_get_temp(void *data, int *temp)
|
||||
{
|
||||
struct sun4i_gpadc_iio *info = data;
|
||||
- int val, scale, offset;
|
||||
+ int val, scale, offset, divider;
|
||||
|
||||
if (sun4i_gpadc_temp_read(info->indio_dev, &val))
|
||||
return -ETIMEDOUT;
|
||||
|
||||
sun4i_gpadc_temp_scale(info->indio_dev, &scale);
|
||||
sun4i_gpadc_temp_offset(info->indio_dev, &offset);
|
||||
+ sun4i_gpadc_temp_divider(info->indio_dev, ÷r);
|
||||
|
||||
- *temp = (val + offset) * scale;
|
||||
+ *temp = ((val + offset) * scale) / divider;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -490,11 +525,116 @@ static int sun4i_irq_init(struct platform_device *pdev, const char *name,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static const struct gpadc_data sun4i_gpadc_data = {
|
||||
+ .temp_offset = -1932,
|
||||
+ .temp_scale = 133,
|
||||
+ .temp_divider = 1,
|
||||
+ .tp_mode_en = SUN4I_GPADC_CTRL1_TP_MODE_EN,
|
||||
+ .tp_adc_select = SUN4I_GPADC_CTRL1_TP_ADC_SELECT,
|
||||
+ .adc_chan_select = &sun4i_gpadc_chan_select,
|
||||
+ .adc_chan_mask = SUN4I_GPADC_CTRL1_ADC_CHAN_MASK,
|
||||
+ .temp_data = SUN4I_GPADC_TEMP_DATA,
|
||||
+ .sample_start = sun4i_gpadc_sample_start,
|
||||
+ .sample_end = sun4i_gpadc_sample_end,
|
||||
+};
|
||||
+
|
||||
+static const struct gpadc_data sun5i_gpadc_data = {
|
||||
+ .temp_offset = -1447,
|
||||
+ .temp_scale = 100,
|
||||
+ .temp_divider = 1,
|
||||
+ .tp_mode_en = SUN4I_GPADC_CTRL1_TP_MODE_EN,
|
||||
+ .tp_adc_select = SUN4I_GPADC_CTRL1_TP_ADC_SELECT,
|
||||
+ .adc_chan_select = &sun4i_gpadc_chan_select,
|
||||
+ .adc_chan_mask = SUN4I_GPADC_CTRL1_ADC_CHAN_MASK,
|
||||
+ .temp_data = SUN4I_GPADC_TEMP_DATA,
|
||||
+ .sample_start = sun4i_gpadc_sample_start,
|
||||
+ .sample_end = sun4i_gpadc_sample_end,
|
||||
+};
|
||||
+
|
||||
+static const struct gpadc_data sun6i_gpadc_data = {
|
||||
+ .temp_offset = -1623,
|
||||
+ .temp_scale = 167,
|
||||
+ .temp_divider = 1,
|
||||
+ .tp_mode_en = SUN6I_GPADC_CTRL1_TP_MODE_EN,
|
||||
+ .tp_adc_select = SUN6I_GPADC_CTRL1_TP_ADC_SELECT,
|
||||
+ .adc_chan_select = &sun6i_gpadc_chan_select,
|
||||
+ .adc_chan_mask = SUN6I_GPADC_CTRL1_ADC_CHAN_MASK,
|
||||
+ .temp_data = SUN4I_GPADC_TEMP_DATA,
|
||||
+ .sample_start = sun4i_gpadc_sample_start,
|
||||
+ .sample_end = sun4i_gpadc_sample_end,
|
||||
+};
|
||||
+
|
||||
+static const struct gpadc_data sun8i_a33_gpadc_data = {
|
||||
+ .temp_offset = -1662,
|
||||
+ .temp_scale = 162,
|
||||
+ .temp_divider = 1,
|
||||
+ .tp_mode_en = SUN8I_A23_GPADC_CTRL1_CHOP_TEMP_EN,
|
||||
+ .temp_data = SUN4I_GPADC_TEMP_DATA,
|
||||
+ .sample_start = sun4i_gpadc_sample_start,
|
||||
+ .sample_end = sun4i_gpadc_sample_end,
|
||||
+};
|
||||
+
|
||||
+static const struct gpadc_data sun8i_h3_gpadc_data = {
|
||||
+ /*
|
||||
+ * The original formula on the datasheet seems to be wrong.
|
||||
+ * These factors are calculated based on the formula in the BSP
|
||||
+ * kernel, which is originally Tem = 217 - (T / 8.253), in which Tem
|
||||
+ * is the temperature in Celsius degree and T is the raw value
|
||||
+ * from the sensor.
|
||||
+ */
|
||||
+ .temp_offset = -1791,
|
||||
+ .temp_scale = -121,
|
||||
+ .temp_divider = 1,
|
||||
+ .temp_data = SUN8I_H3_GPADC_TEMP_DATA,
|
||||
+ .sample_start = sun8i_h3_gpadc_sample_start,
|
||||
+ .sample_end = sun8i_h3_gpadc_sample_end,
|
||||
+ .has_bus_clk = true,
|
||||
+ .has_bus_rst = true,
|
||||
+ .has_mod_clk = true,
|
||||
+};
|
||||
+
|
||||
+static const struct gpadc_data sun50i_a64_gpadc_data = {
|
||||
+ .temp_offset = -2170,
|
||||
+ .temp_scale = -1000,
|
||||
+ .temp_divider = 8560,
|
||||
+ .temp_data = SUN8I_H3_GPADC_TEMP_DATA,
|
||||
+ .sample_start = sun8i_h3_gpadc_sample_start,
|
||||
+ .sample_end = sun8i_h3_gpadc_sample_end,
|
||||
+ .has_bus_clk = true,
|
||||
+ .has_bus_rst = true,
|
||||
+ .has_mod_clk = true,
|
||||
+};
|
||||
+
|
||||
+static const struct gpadc_data sun50i_h5_gpadc_data = {
|
||||
+ /* Not done for now since requires 2 sets of offset+scale */
|
||||
+ .temp_offset = -1321,
|
||||
+ .temp_scale = -121,
|
||||
+ .temp_divider = 1,
|
||||
+ .temp_data = SUN8I_H3_GPADC_TEMP_DATA,
|
||||
+ .sample_start = sun8i_h3_gpadc_sample_start,
|
||||
+ .sample_end = sun8i_h3_gpadc_sample_end,
|
||||
+ .has_bus_clk = true,
|
||||
+ .has_bus_rst = true,
|
||||
+ .has_mod_clk = true,
|
||||
+};
|
||||
+
|
||||
static const struct of_device_id sun4i_gpadc_of_id[] = {
|
||||
{
|
||||
.compatible = "allwinner,sun8i-a33-ths",
|
||||
.data = &sun8i_a33_gpadc_data,
|
||||
},
|
||||
+ {
|
||||
+ .compatible = "allwinner,sun8i-h3-ths",
|
||||
+ .data = &sun8i_h3_gpadc_data,
|
||||
+ },
|
||||
+ {
|
||||
+ .compatible = "allwinner,sun50i-a64-ths",
|
||||
+ .data = &sun50i_a64_gpadc_data,
|
||||
+ },
|
||||
+ {
|
||||
+ .compatible = "allwinner,sun50i-h5-ths",
|
||||
+ .data = &sun50i_h5_gpadc_data,
|
||||
+ },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
@@ -785,6 +785,47 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
+ if (info->data->has_bus_rst) {
|
||||
+ info->reset = devm_reset_control_get(&pdev->dev, NULL);
|
||||
+ if (IS_ERR(info->reset)) {
|
||||
+ ret = PTR_ERR(info->reset);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = reset_control_deassert(info->reset);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ if (info->data->has_bus_clk) {
|
||||
+ info->ths_bus_clk = devm_clk_get(&pdev->dev, "bus");
|
||||
+ if (IS_ERR(info->ths_bus_clk)) {
|
||||
+ ret = PTR_ERR(info->ths_bus_clk);
|
||||
+ goto assert_reset;
|
||||
+ }
|
||||
+
|
||||
+ ret = clk_prepare_enable(info->ths_bus_clk);
|
||||
+ if (ret)
|
||||
+ goto assert_reset;
|
||||
+ }
|
||||
+
|
||||
+ if (info->data->has_mod_clk) {
|
||||
+ info->mod_clk = devm_clk_get(&pdev->dev, "mod");
|
||||
+ if (IS_ERR(info->mod_clk)) {
|
||||
+ ret = PTR_ERR(info->mod_clk);
|
||||
+ goto disable_bus_clk;
|
||||
+ }
|
||||
+
|
||||
+ /* Running at 6MHz */
|
||||
+ ret = clk_set_rate(info->mod_clk, 6000000);
|
||||
+ if (ret)
|
||||
+ goto disable_bus_clk;
|
||||
+
|
||||
+ ret = clk_prepare_enable(info->mod_clk);
|
||||
+ if (ret)
|
||||
+ goto disable_bus_clk;
|
||||
+ }
|
||||
+
|
||||
if (IS_ENABLED(CONFIG_THERMAL_OF)) {
|
||||
info->tzd = thermal_zone_of_sensor_register(info->sensor_device,
|
||||
0, info,
|
||||
@@ -798,6 +839,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
|
||||
"could not register thermal sensor: %ld\n",
|
||||
PTR_ERR(info->tzd));
|
||||
return PTR_ERR(info->tzd);
|
||||
+ goto disable_mod_clk;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -809,6 +851,20 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
|
||||
|
||||
return 0;
|
||||
|
||||
+disable_mod_clk:
|
||||
+ if (info->data->has_mod_clk)
|
||||
+ clk_disable_unprepare(info->mod_clk);
|
||||
+
|
||||
+disable_bus_clk:
|
||||
+ if (info->data->has_bus_clk)
|
||||
+ clk_disable_unprepare(info->ths_bus_clk);
|
||||
+
|
||||
+assert_reset:
|
||||
+ if (info->data->has_bus_rst)
|
||||
+ reset_control_assert(info->reset);
|
||||
+
|
||||
+ return ret;
|
||||
+
|
||||
err_map:
|
||||
if (!info->no_irq && IS_ENABLED(CONFIG_THERMAL_OF))
|
||||
iio_map_array_unregister(indio_dev);
|
||||
|
||||
@@ -698,6 +896,15 @@ static int sun4i_gpadc_remove(struct platform_device *pdev)
|
||||
if (!info->no_irq)
|
||||
iio_map_array_unregister(indio_dev);
|
||||
|
||||
+ if (info->data->has_mod_clk)
|
||||
+ clk_disable_unprepare(info->mod_clk);
|
||||
+
|
||||
+ if (info->data->has_bus_clk)
|
||||
+ clk_disable_unprepare(info->ths_bus_clk);
|
||||
+
|
||||
+ if (info->data->has_bus_rst)
|
||||
+ reset_control_assert(info->reset);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/include/linux/mfd/sun4i-gpadc.h b/include/linux/mfd/sun4i-gpadc.h
|
||||
index 139872c2..f794a298 100644
|
||||
--- a/include/linux/mfd/sun4i-gpadc.h
|
||||
+++ b/include/linux/mfd/sun4i-gpadc.h
|
||||
@@ -38,9 +38,12 @@
|
||||
#define SUN6I_GPADC_CTRL1_ADC_CHAN_SELECT(x) (GENMASK(3, 0) & BIT(x))
|
||||
#define SUN6I_GPADC_CTRL1_ADC_CHAN_MASK GENMASK(3, 0)
|
||||
|
||||
-/* TP_CTRL1 bits for sun8i SoCs */
|
||||
-#define SUN8I_GPADC_CTRL1_CHOP_TEMP_EN BIT(8)
|
||||
-#define SUN8I_GPADC_CTRL1_GPADC_CALI_EN BIT(7)
|
||||
+/* TP_CTRL1 bits for sun8i A23/A33 SoCs */
|
||||
+#define SUN8I_A23_GPADC_CTRL1_CHOP_TEMP_EN BIT(8)
|
||||
+#define SUN8I_A23_GPADC_CTRL1_GPADC_CALI_EN BIT(7)
|
||||
+
|
||||
+/* TP_CTRL1 bits for SoCs after H3 */
|
||||
+#define SUN8I_H3_GPADC_CTRL1_GPADC_CALI_EN BIT(17)
|
||||
|
||||
#define SUN4I_GPADC_CTRL2 0x08
|
||||
|
||||
@@ -49,7 +52,17 @@
|
||||
#define SUN4I_GPADC_CTRL2_PRE_MEA_EN BIT(24)
|
||||
#define SUN4I_GPADC_CTRL2_PRE_MEA_THRE_CNT(x) (GENMASK(23, 0) & (x))
|
||||
|
||||
+#define SUN8I_H3_GPADC_CTRL2 0x40
|
||||
+
|
||||
+#define SUN8I_H3_GPADC_CTRL2_TEMP_SENSE_EN BIT(0)
|
||||
+#define SUN8I_H3_GPADC_CTRL2_T_ACQ1(x) ((GENMASK(15, 0) * (x)) << 16)
|
||||
+
|
||||
#define SUN4I_GPADC_CTRL3 0x0c
|
||||
+/*
|
||||
+ * This register is named "Average filter Control Register" in H3 Datasheet,
|
||||
+ * but the register's definition is the same as the old CTRL3 register.
|
||||
+ */
|
||||
+#define SUN8I_H3_GPADC_CTRL3 0x70
|
||||
|
||||
#define SUN4I_GPADC_CTRL3_FILTER_EN BIT(2)
|
||||
#define SUN4I_GPADC_CTRL3_FILTER_TYPE(x) (GENMASK(1, 0) & (x))
|
||||
@@ -71,6 +84,13 @@
|
||||
#define SUN4I_GPADC_INT_FIFOC_TP_UP_IRQ_EN BIT(1)
|
||||
#define SUN4I_GPADC_INT_FIFOC_TP_DOWN_IRQ_EN BIT(0)
|
||||
|
||||
+#define SUN8I_H3_GPADC_INTC 0x44
|
||||
+
|
||||
+#define SUN8I_H3_GPADC_INTC_TEMP_PERIOD(x) ((GENMASK(19, 0) & (x)) << 12)
|
||||
+#define SUN8I_H3_GPADC_INTC_TEMP_DATA BIT(8)
|
||||
+#define SUN8I_H3_GPADC_INTC_TEMP_SHUT BIT(4)
|
||||
+#define SUN8I_H3_GPADC_INTC_TEMP_ALARM BIT(0)
|
||||
+
|
||||
#define SUN4I_GPADC_INT_FIFOS 0x14
|
||||
|
||||
#define SUN4I_GPADC_INT_FIFOS_TEMP_DATA_PENDING BIT(18)
|
||||
@@ -80,9 +100,16 @@
|
||||
#define SUN4I_GPADC_INT_FIFOS_TP_UP_PENDING BIT(1)
|
||||
#define SUN4I_GPADC_INT_FIFOS_TP_DOWN_PENDING BIT(0)
|
||||
|
||||
+#define SUN8I_H3_GPADC_INTS 0x44
|
||||
+
|
||||
+#define SUN8I_H3_GPADC_INTS_TEMP_DATA BIT(8)
|
||||
+#define SUN8I_H3_GPADC_INTS_TEMP_SHUT BIT(4)
|
||||
+#define SUN8I_H3_GPADC_INTS_TEMP_ALARM BIT(0)
|
||||
+
|
||||
#define SUN4I_GPADC_CDAT 0x1c
|
||||
#define SUN4I_GPADC_TEMP_DATA 0x20
|
||||
#define SUN4I_GPADC_DATA 0x24
|
||||
+#define SUN8I_H3_GPADC_TEMP_DATA 0x80
|
||||
|
||||
#define SUN4I_GPADC_IRQ_FIFO_DATA 0
|
||||
#define SUN4I_GPADC_IRQ_TEMP_DATA 1
|
||||
@ -1,200 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
old mode 100644
|
||||
new mode 100755
|
||||
index dae16cd..501b5a2
|
||||
--- a/arch/arm64/boot/dts/allwinner/Makefile
|
||||
+++ b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
@@ -5,6 +5,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb
|
||||
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-m1-plus2.dtb
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts
|
||||
new file mode 100755
|
||||
index 0000000..b8e5ca9
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus.dts
|
||||
@@ -0,0 +1,180 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2016 ARM Ltd.
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This 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 "sun50i-h5.dtsi"
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+#include <dt-bindings/pinctrl/sun4i-a10.h>
|
||||
+
|
||||
+/ {
|
||||
+ model = "Xunlong Orange Pi Zero Plus";
|
||||
+ compatible = "xunlong,orangepi-pc2", "allwinner,sun50i-h5";
|
||||
+
|
||||
+ reg_vcc3v3: vcc3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ };
|
||||
+
|
||||
+ aliases {
|
||||
+ ethernet0 = &emac;
|
||||
+ ethernet1 = &rtl8189ftv;
|
||||
+ serial0 = &uart0;
|
||||
+ };
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = "serial0:115200n8";
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ pwr {
|
||||
+ label = "orangepi:green:pwr";
|
||||
+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
|
||||
+ default-state = "on";
|
||||
+ };
|
||||
+
|
||||
+ status {
|
||||
+ label = "orangepi:red:status";
|
||||
+ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ reg_gmac_3v3: gmac-3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "gmac-3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ startup-delay-us = <100000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ reg_usb0_vbus: usb0-vbus {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "usb0-vbus";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emac_rgmii_pins>;
|
||||
+ phy-supply = <®_gmac_3v3>;
|
||||
+ phy-handle = <&ext_rgmii_phy>;
|
||||
+ phy-mode = "rgmii";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mdio {
|
||||
+ ext_rgmii_phy: ethernet-phy@1 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <1>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <4>;
|
||||
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mmc1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc1_pins_a>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <4>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ /*
|
||||
+ * Explicitly define the sdio device, so that we can add an ethernet
|
||||
+ * alias for it (which e.g. makes u-boot set a mac-address).
|
||||
+ */
|
||||
+ rtl8189ftv: sdio_wifi@1 {
|
||||
+ reg = <1>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&ohci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart0_pins_a>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_otg {
|
||||
+ dr_mode = "peripheral";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usbphy {
|
||||
+ /* USB Type-A ports' VBUS is always on */
|
||||
+ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
|
||||
+ status = "okay";
|
||||
+};
|
||||
@ -1,13 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
|
||||
index f2bcbb2..47b9bd3 100644
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
|
||||
@@ -258,7 +258,7 @@
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&emac_rmii_pins>;
|
||||
phy-handle = <&ext_phy>;
|
||||
- phy-supply = <®_dc1sw>;
|
||||
+// phy-supply = <®_dc1sw>;
|
||||
phy-mode = "rmii";
|
||||
|
||||
allwinner,leds-active-low;
|
||||
@ -1,26 +0,0 @@
|
||||
diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c
|
||||
b/drivers/staging/rtl8723bs/hal/sdio_ops.c
|
||||
index 6285b72faa9a..ad65cd74c3c8 100644
|
||||
--- a/drivers/staging/rtl8723bs/hal/sdio_ops.c
|
||||
+++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c
|
||||
@@ -1008,6 +1008,7 @@ static struct recv_buf *sd_recv_rxfifo(struct
|
||||
adapter *padapter, u32 size)
|
||||
}
|
||||
|
||||
if (precvbuf->pskb == NULL) {
|
||||
+ rtw_enqueue_recvbuf(precvbuf, &precvpriv->free_recv_buf_queue);
|
||||
DBG_871X("%s: alloc_skb fail! read =%d\n", __func__, readsize);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1017,6 +1018,7 @@ static struct recv_buf *sd_recv_rxfifo(struct
|
||||
adapter *padapter, u32 size)
|
||||
preadbuf = precvbuf->pskb->data;
|
||||
ret = sdio_read_port(&padapter->iopriv.intf, WLAN_RX0FF_DEVICE_ID,
|
||||
readsize, preadbuf);
|
||||
if (ret == _FAIL) {
|
||||
+ rtw_enqueue_recvbuf(precvbuf, &precvpriv->free_recv_buf_queue);
|
||||
RT_TRACE(_module_hci_ops_os_c_, _drv_err_, ("%s: read port FAIL!\n",
|
||||
__func__));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,32 +0,0 @@
|
||||
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
|
||||
index bb44f0c..9e9202b
|
||||
--- a/drivers/net/vxlan.c
|
||||
+++ b/drivers/net/vxlan.c
|
||||
@@ -2155,13 +2155,6 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
|
||||
}
|
||||
|
||||
ndst = &rt->dst;
|
||||
- if (skb_dst(skb)) {
|
||||
- int mtu = dst_mtu(ndst) - VXLAN_HEADROOM;
|
||||
-
|
||||
- skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL,
|
||||
- skb, mtu);
|
||||
- }
|
||||
-
|
||||
tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
|
||||
ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);
|
||||
err = vxlan_build_skb(skb, ndst, sizeof(struct iphdr),
|
||||
@@ -2197,13 +2190,6 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
- if (skb_dst(skb)) {
|
||||
- int mtu = dst_mtu(ndst) - VXLAN6_HEADROOM;
|
||||
-
|
||||
- skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL,
|
||||
- skb, mtu);
|
||||
- }
|
||||
-
|
||||
tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
|
||||
ttl = ttl ? : ip6_dst_hoplimit(ndst);
|
||||
skb_scrub_packet(skb, xnet);
|
||||
@ -1,157 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts b/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
|
||||
old mode 100644
|
||||
new mode 100644
|
||||
index e7fae65..af67c1e
|
||||
--- a/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
|
||||
@@ -51,10 +51,21 @@
|
||||
model = "Beelink X2";
|
||||
compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
|
||||
|
||||
+ connector {
|
||||
+ compatible = "hdmi-connector";
|
||||
+ type = "a";
|
||||
+
|
||||
+ port {
|
||||
+ hdmi_con_in: endpoint {
|
||||
+ remote-endpoint = <&hdmi_out_con>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
- /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
|
||||
- ethernet1 = &sdiowifi;
|
||||
+ ethernet0 = &emac;
|
||||
+ ethernet1 = &rtl8189ftv;
|
||||
};
|
||||
|
||||
chosen {
|
||||
@@ -100,10 +111,22 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ehci1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&ehci2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ir {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&ir_pins_a>;
|
||||
@@ -124,6 +147,7 @@
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mmc1_pins_a>;
|
||||
vmmc-supply = <®_vcc3v3>;
|
||||
+ mmc-pwrseq = <&wifi_pwrseq>;
|
||||
bus-width = <4>;
|
||||
non-removable;
|
||||
status = "okay";
|
||||
@@ -132,7 +156,7 @@
|
||||
* Explicitly define the sdio device, so that we can add an ethernet
|
||||
* alias for it (which e.g. makes u-boot set a mac-address).
|
||||
*/
|
||||
- sdiowifi: sdio_wifi@1 {
|
||||
+ rtl8189ftv: sdio_wifi@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
};
|
||||
@@ -147,10 +171,71 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&mmc2_8bit_pins {
|
||||
+ /* Increase drive strength for DDR modes */
|
||||
+ drive-strength = <40>;
|
||||
+ /* eMMC is missing pull-ups */
|
||||
+ bias-pull-up;
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ phy-handle = <&int_mii_phy>;
|
||||
+ phy-mode = "mii";
|
||||
+ allwinner,leds-active-low;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi_out {
|
||||
+ hdmi_out_con: endpoint {
|
||||
+ remote-endpoint = <&hdmi_con_in>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2s2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mixer0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+®_usb0_vbus {
|
||||
+ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sound_hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&tcon0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ohci1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&ohci2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&spdif {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spdif_tx_pins_a>;
|
||||
@@ -163,7 +248,14 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&usb_otg {
|
||||
+ dr_mode = "otg";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&usbphy {
|
||||
+ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
|
||||
+ usb0_vbus-supply = <®_usb0_vbus>;
|
||||
/* USB VBUS is on as long as VCC-IO is on */
|
||||
status = "okay";
|
||||
};
|
||||
@ -1,99 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-m1.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-m1.dts
|
||||
index ec63d10..9dff001
|
||||
--- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1.dts
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1.dts
|
||||
@@ -45,6 +45,66 @@
|
||||
/ {
|
||||
model = "FriendlyArm NanoPi M1";
|
||||
compatible = "friendlyarm,nanopi-m1", "allwinner,sun8i-h3";
|
||||
+
|
||||
+ connector {
|
||||
+ compatible = "hdmi-connector";
|
||||
+ type = "a";
|
||||
+
|
||||
+ port {
|
||||
+ hdmi_con_in: endpoint {
|
||||
+ remote-endpoint = <&hdmi_out_con>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ phy-handle = <&int_mii_phy>;
|
||||
+ phy-mode = "mii";
|
||||
+ allwinner,leds-active-low;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&codec {
|
||||
+ allwinner,audio-routing =
|
||||
+ "Line Out", "LINEOUT",
|
||||
+ "MIC1", "Mic",
|
||||
+ "Mic", "MBIAS";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi_out {
|
||||
+ hdmi_out_con: endpoint {
|
||||
+ remote-endpoint = <&hdmi_con_in>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2s2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mixer0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sound_hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&tcon0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
};
|
||||
|
||||
&ehci1 {
|
||||
@@ -55,6 +115,14 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&ehci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ohci1 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -62,3 +130,11 @@
|
||||
&ohci2 {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&ohci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&r_i2c {
|
||||
+ status = "okay";
|
||||
+};
|
||||
\ No newline at end of file
|
||||
@ -1,196 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
|
||||
index 8ddd1b2..948d0af
|
||||
--- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts
|
||||
@@ -43,8 +43,164 @@
|
||||
#include "sun8i-h3-nanopi.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "FriendlyArm NanoPi M1 Plus";
|
||||
+ model = "FriendlyElec NanoPi M1 Plus";
|
||||
compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3";
|
||||
+
|
||||
+ connector {
|
||||
+ compatible = "hdmi-connector";
|
||||
+ type = "a";
|
||||
+
|
||||
+ port {
|
||||
+ hdmi_con_in: endpoint {
|
||||
+ remote-endpoint = <&hdmi_out_con>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ wifi_pwrseq: wifi_pwrseq {
|
||||
+ compatible = "mmc-pwrseq-simple";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&wifi_en_npi>;
|
||||
+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
|
||||
+ post-power-on-delay-ms = <200>;
|
||||
+ };
|
||||
+
|
||||
+ reg_gmac_3v3: gmac-3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&gmac_power_pin_nanopi>;
|
||||
+ regulator-name = "gmac-3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ startup-delay-us = <100000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ rfkill_bt {
|
||||
+ compatible = "rfkill-gpio";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&bt_pwr_pin>;
|
||||
+ reset-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
|
||||
+ clocks = <&osc32k>;
|
||||
+ clock-frequency = <32768>;
|
||||
+ rfkill-name = "sunxi-bt";
|
||||
+ rfkill-type = "bluetooth";
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
+
|
||||
+&pio {
|
||||
+ gmac_power_pin_nanopi: gmac_power_pin@0 {
|
||||
+ pins = "PD6";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+ bt_pwr_pin: bt_pwr_pin@0 {
|
||||
+ pins = "PG13";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&r_pio {
|
||||
+ wifi_en_npi: wifi_en_pin {
|
||||
+ pins = "PL7";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mdio {
|
||||
+ ext_rgmii_phy: ethernet-phy@1 {
|
||||
+ reg = <0>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emac_rgmii_pins>;
|
||||
+ phy-supply = <®_gmac_3v3>;
|
||||
+ phy-handle = <&ext_rgmii_phy>;
|
||||
+ phy-mode = "rgmii";
|
||||
+
|
||||
+ allwinner,leds-active-low;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mmc1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc1_pins_a>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ vqmmc-supply = <®_vcc3v3>;
|
||||
+ mmc-pwrseq = <&wifi_pwrseq>;
|
||||
+ bus-width = <4>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ brcmf: bcrmf@1 {
|
||||
+ reg = <1>;
|
||||
+ compatible = "brcm,bcm4329-fmac";
|
||||
+ interrupt-parent = <&pio>;
|
||||
+ interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
|
||||
+ interrupt-names = "host-wake";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc2 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc2_8bit_pins>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <8>;
|
||||
+ non-removable;
|
||||
+ cap-mmc-hw-reset;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mmc2_8bit_pins {
|
||||
+ /* Increase drive strength for DDR modes */
|
||||
+ drive-strength = <40>;
|
||||
+ /* eMMC is missing pull-ups */
|
||||
+ bias-pull-up;
|
||||
+};
|
||||
+
|
||||
+&codec {
|
||||
+ allwinner,audio-routing =
|
||||
+ "Line Out", "LINEOUT",
|
||||
+ "MIC1", "Mic",
|
||||
+ "Mic", "MBIAS";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi_out {
|
||||
+ hdmi_out_con: endpoint {
|
||||
+ remote-endpoint = <&hdmi_con_in>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2s2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mixer0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&sound_hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&tcon0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
};
|
||||
|
||||
&ehci1 {
|
||||
@@ -55,6 +207,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&ohci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ohci1 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -62,3 +218,13 @@
|
||||
&ohci2 {
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&r_i2c {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart3 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart3_pins>, <&uart3_rts_cts_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
\ No newline at end of file
|
||||
@ -1,252 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
index d7ff830..fb77763 100755
|
||||
--- a/arch/arm64/boot/dts/allwinner/Makefile
|
||||
+++ b/arch/arm64/boot/dts/allwinner/Makefile
|
||||
@@ -6,6 +6,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
|
||||
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb
|
||||
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-m1-plus2.dtb
|
||||
|
||||
always := $(dtb-y)
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts
|
||||
new file mode 100644
|
||||
index 0000000..d5a672e
|
||||
--- /dev/null
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts
|
||||
@@ -0,0 +1,234 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
|
||||
+ * Copyright (C) 2017 Armbian
|
||||
+ *
|
||||
+ * 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 "sun50i-h5.dtsi"
|
||||
+
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+
|
||||
+/ {
|
||||
+ model = "FriendlyARM NanoPi NEO Plus 2";
|
||||
+ compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5";
|
||||
+
|
||||
+ aliases {
|
||||
+ ethernet0 = &emac;
|
||||
+ serial0 = &uart0;
|
||||
+ };
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = "serial0:115200n8";
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ pwr {
|
||||
+ label = "nanopi:green:pwr";
|
||||
+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
|
||||
+ default-state = "on";
|
||||
+ };
|
||||
+
|
||||
+ status {
|
||||
+ label = "nanopi:blue:status";
|
||||
+ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ reg_gmac_3v3: gmac-3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "gmac-3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ startup-delay-us = <100000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ reg_vcc3v3: vcc3v3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "vcc3v3";
|
||||
+ regulator-min-microvolt = <3300000>;
|
||||
+ regulator-max-microvolt = <3300000>;
|
||||
+ };
|
||||
+
|
||||
+ reg_usb0_vbus: usb0-vbus {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ regulator-name = "usb0-vbus";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ wifi_pwrseq: wifi_pwrseq {
|
||||
+ compatible = "mmc-pwrseq-simple";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&wifi_en_npi>;
|
||||
+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
|
||||
+ post-power-on-delay-ms = <200>;
|
||||
+ };
|
||||
+
|
||||
+ rfkill_bt {
|
||||
+ compatible = "rfkill-gpio";
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&bt_pwr_pin>;
|
||||
+ reset-gpios = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
|
||||
+ clocks = <&osc32k>;
|
||||
+ clock-frequency = <32768>;
|
||||
+ rfkill-name = "sunxi-bt";
|
||||
+ rfkill-type = "bluetooth";
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
+
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&emac_rgmii_pins>;
|
||||
+ phy-supply = <®_gmac_3v3>;
|
||||
+ phy-handle = <&ext_rgmii_phy>;
|
||||
+ phy-mode = "rgmii";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mdio {
|
||||
+ ext_rgmii_phy: ethernet-phy@7 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <7>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <4>;
|
||||
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mmc1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc1_pins_a>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ vqmmc-supply = <®_vcc3v3>;
|
||||
+ mmc-pwrseq = <&wifi_pwrseq>;
|
||||
+ bus-width = <4>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ brcmf: bcrmf@1 {
|
||||
+ reg = <1>;
|
||||
+ compatible = "brcm,bcm4329-fmac";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc2 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc2_8bit_pins>;
|
||||
+ vmmc-supply = <®_vcc3v3>;
|
||||
+ bus-width = <8>;
|
||||
+ non-removable;
|
||||
+ cap-mmc-hw-reset;
|
||||
+ boot_device = <0>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mmc2_8bit_pins {
|
||||
+ /* Increase drive strength for DDR modes */
|
||||
+ drive-strength = <40>;
|
||||
+ /* eMMC is missing pull-ups */
|
||||
+ bias-pull-up;
|
||||
+};
|
||||
+
|
||||
+&ohci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci3 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&pio {
|
||||
+ gmac_power_pin_nanopi: gmac_power_pin@0 {
|
||||
+ pins = "PD6";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+ bt_pwr_pin: bt_pwr_pin@0 {
|
||||
+ pins = "PG13";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&r_pio {
|
||||
+ wifi_en_npi: wifi_en_pin {
|
||||
+ pins = "PL7";
|
||||
+ function = "gpio_out";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart0_pins_a>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usb_otg {
|
||||
+ dr_mode = "host";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usbphy {
|
||||
+ /* USB Type-A port's VBUS is always on */
|
||||
+ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
|
||||
+ usb0_vbus-supply = <®_usb0_vbus>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
@ -1,82 +0,0 @@
|
||||
diff --git a/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts b/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts
|
||||
index d756ff8..e0df87d
|
||||
--- a/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts
|
||||
+++ b/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts
|
||||
@@ -43,7 +43,6 @@
|
||||
/dts-v1/;
|
||||
#include "sun8i-h3.dtsi"
|
||||
#include "sunxi-common-regulators.dtsi"
|
||||
-
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
@@ -61,6 +60,17 @@
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
+ connector {
|
||||
+ compatible = "hdmi-connector";
|
||||
+ type = "a";
|
||||
+
|
||||
+ port {
|
||||
+ hdmi_con_in: endpoint {
|
||||
+ remote-endpoint = <&hdmi_out_con>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-names = "default";
|
||||
@@ -178,6 +188,40 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&codec {
|
||||
+ allwinner,audio-routing =
|
||||
+ "Line Out", "LINEOUT",
|
||||
+ "MIC1", "Mic",
|
||||
+ "Mic", "MBIAS";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi_out {
|
||||
+ hdmi_out_con: endpoint {
|
||||
+ remote-endpoint = <&hdmi_con_in>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&i2s2 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mixer0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&tcon0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&ohci0 {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -190,6 +234,10 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&r_i2c {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&r_pio {
|
||||
pwr_led_bpi_m2p: led_pins@0 {
|
||||
pins = "PL10";
|
||||
@ -1,140 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
|
||||
index ba4d6b1..d71a8b8
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-zero-plus2.dts
|
||||
@@ -43,15 +43,17 @@
|
||||
/dts-v1/;
|
||||
|
||||
#include "sun50i-h5.dtsi"
|
||||
-
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+#include <dt-bindings/pinctrl/sun4i-a10.h>
|
||||
|
||||
/ {
|
||||
- model = "OrangePi Zero Plus2";
|
||||
+ model = "Xunlong Orange Pi Zero Plus2";
|
||||
compatible = "xunlong,orangepi-zero-plus2", "allwinner,sun50i-h5";
|
||||
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
+ ethernet1 = &brcmf;
|
||||
};
|
||||
|
||||
chosen {
|
||||
@@ -65,11 +67,29 @@
|
||||
regulator-max-microvolt = <3300000>;
|
||||
};
|
||||
|
||||
- wifi_pwrseq: wifi_pwrseq {
|
||||
- compatible = "mmc-pwrseq-simple";
|
||||
- reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
|
||||
- post-power-on-delay-ms = <50>;
|
||||
- };
|
||||
+ wifi_pwrseq: wifi_pwrseq {
|
||||
+ compatible = "mmc-pwrseq-simple";
|
||||
+ reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
|
||||
+ post-power-on-delay-ms = <50>;
|
||||
+ };
|
||||
+
|
||||
+ reg_sy8113b: gpio-regulator {
|
||||
+ compatible = "regulator-gpio";
|
||||
+ regulator-name = "vdd-cpux";
|
||||
+ regulator-type = "voltage";
|
||||
+ regulator-boot-on;
|
||||
+ regulator-always-on;
|
||||
+ regulator-min-microvolt = <1100000>;
|
||||
+ regulator-max-microvolt = <1300000>;
|
||||
+ regulator-ramp-delay = <50>; /* 4ms */
|
||||
+
|
||||
+ gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
|
||||
+ enable-active-high;
|
||||
+ gpios-states = <0x1>;
|
||||
+ states = <1100000 0x0
|
||||
+ 1300000 0x1>;
|
||||
+ };
|
||||
+
|
||||
};
|
||||
|
||||
&mmc0 {
|
||||
@@ -112,6 +132,43 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&cpu0 {
|
||||
+ cpu-supply = <®_sy8113b>;
|
||||
+};
|
||||
+
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ /* Disable SPI NOR by default: it optional on Orange Pi Zero boards */
|
||||
+ status = "disabled";
|
||||
+
|
||||
+ flash@0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ compatible = "mxicy,mx25l1606e", "winbond,w25q128";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <40000000>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&mixer0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&r_pio {
|
||||
wifi_wake: wifi_wake@0 {
|
||||
pins = "PL7";
|
||||
@@ -120,8 +177,35 @@
|
||||
};
|
||||
};
|
||||
|
||||
+&sound_hdmi {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&tcon0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&r_i2c {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&uart0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&uart0_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&usb_otg {
|
||||
+ dr_mode = "peripheral";
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usbphy {
|
||||
+ /*
|
||||
+ * USB Type-A port VBUS is always on. However, MicroUSB VBUS can only
|
||||
+ * power up the board; when it's used as OTG port, this VBUS is
|
||||
+ * always off even if the board is powered via GPIO pins.
|
||||
+ */
|
||||
+ usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
|
||||
+ status = "okay";
|
||||
+};
|
||||
\ No newline at end of file
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,156 +0,0 @@
|
||||
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
|
||||
old mode 100644
|
||||
new mode 100755
|
||||
index 1293b25..b0c5703
|
||||
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
|
||||
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
|
||||
+ * Armbian(c)
|
||||
*
|
||||
* 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
|
||||
@@ -51,12 +52,65 @@
|
||||
compatible = "olimex,a64-olinuxino", "allwinner,sun50i-a64";
|
||||
|
||||
aliases {
|
||||
+ ethernet0 = &emac;
|
||||
serial0 = &uart0;
|
||||
+ serial1 = &uart1;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
+
|
||||
+ wifi_pwrseq: wifi_pwrseq {
|
||||
+ compatible = "mmc-pwrseq-simple";
|
||||
+ reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&de {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ehci1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&emac {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&rgmii_pins>;
|
||||
+ phy-mode = "rgmii-txid";
|
||||
+ phy-handle = <&ext_rgmii_phy>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&hdmi {
|
||||
+ hvcc-supply = <®_dldo1>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2c1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&i2c1_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2c1_pins {
|
||||
+ bias-pull-up;
|
||||
+};
|
||||
+
|
||||
+&mdio {
|
||||
+ ext_rgmii_phy: ethernet-phy@1 {
|
||||
+ compatible = "ethernet-phy-ieee802.3-c22";
|
||||
+ reg = <1>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mixer1 {
|
||||
+ status = "okay";
|
||||
};
|
||||
|
||||
&mmc0 {
|
||||
@@ -69,6 +123,42 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
+&mmc1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc1_pins>;
|
||||
+ vmmc-supply = <®_aldo2>;
|
||||
+ vqmmc-supply = <®_dldo4>;
|
||||
+ mmc-pwrseq = <&wifi_pwrseq>;
|
||||
+ bus-width = <4>;
|
||||
+ non-removable;
|
||||
+ status = "okay";
|
||||
+
|
||||
+ rtl8723bs: wifi@1 {
|
||||
+ reg = <1>;
|
||||
+ interrupt-parent = <&r_pio>;
|
||||
+ interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
|
||||
+ interrupt-names = "host-wake";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mmc2 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&mmc2_pins>;
|
||||
+ vmmc-supply = <®_dcdc1>;
|
||||
+ bus-width = <8>;
|
||||
+ non-removable;
|
||||
+ cap-mmc-hw-reset;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&ohci1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
&r_rsb {
|
||||
status = "okay";
|
||||
|
||||
@@ -77,6 +167,7 @@
|
||||
reg = <0x3a3>;
|
||||
interrupt-parent = <&r_intc>;
|
||||
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
|
||||
+ x-powers,drive-vbus-en; /* set N_VBUSEN as output pin */
|
||||
};
|
||||
};
|
||||
|
||||
@@ -191,8 +282,8 @@
|
||||
regulator-name = "vcc-rtc";
|
||||
};
|
||||
|
||||
-&simplefb_hdmi {
|
||||
- vcc-hdmi-supply = <®_dldo1>;
|
||||
+&tcon1 {
|
||||
+ status = "okay";
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
@@ -200,3 +291,13 @@
|
||||
pinctrl-0 = <&uart0_pins_a>;
|
||||
status = "okay";
|
||||
};
|
||||
+
|
||||
+&uart1 {
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&usbphy {
|
||||
+ status = "okay";
|
||||
+};
|
||||
\ No newline at end of file
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,26 +0,0 @@
|
||||
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
|
||||
index 918f449..561b71c 100644
|
||||
--- a/drivers/net/wireless/Kconfig
|
||||
+++ b/drivers/net/wireless/Kconfig
|
||||
@@ -39,6 +39,8 @@ source "drivers/net/wireless/cisco/Kconfig"
|
||||
source "drivers/net/wireless/intel/Kconfig"
|
||||
source "drivers/net/wireless/intersil/Kconfig"
|
||||
source "drivers/net/wireless/marvell/Kconfig"
|
||||
+source "drivers/net/wireless/rtl8812au/Kconfig"
|
||||
+source "drivers/net/wireless/rtl8814au/Kconfig"
|
||||
source "drivers/net/wireless/mediatek/Kconfig"
|
||||
source "drivers/net/wireless/ralink/Kconfig"
|
||||
source "drivers/net/wireless/realtek/Kconfig"
|
||||
diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
|
||||
index 59df552..614ddf4 100644
|
||||
--- a/drivers/net/wireless/Makefile
|
||||
+++ b/drivers/net/wireless/Makefile
|
||||
@@ -12,6 +12,8 @@ obj-$(CONFIG_WLAN_VENDOR_CISCO) += cisco/
|
||||
obj-$(CONFIG_WLAN_VENDOR_INTEL) += intel/
|
||||
obj-$(CONFIG_WLAN_VENDOR_INTERSIL) += intersil/
|
||||
obj-$(CONFIG_WLAN_VENDOR_MARVELL) += marvell/
|
||||
+obj-$(CONFIG_RTL8812AU) += rtl8812au/
|
||||
+obj-$(CONFIG_RTL8814AU) += rtl8814au/
|
||||
obj-$(CONFIG_WLAN_VENDOR_MEDIATEK) += mediatek/
|
||||
obj-$(CONFIG_WLAN_VENDOR_RALINK) += ralink/
|
||||
obj-$(CONFIG_WLAN_VENDOR_REALTEK) += realtek/
|
||||
@ -1,46 +0,0 @@
|
||||
diff --git a/drivers/net/wireless/rtl8812au/Kconfig b/drivers/net/wireless/rtl8812au/Kconfig
|
||||
index 16d3567..f87653d 100644
|
||||
--- a/drivers/net/wireless/rtl8812au/Kconfig
|
||||
+++ b/drivers/net/wireless/rtl8812au/Kconfig
|
||||
@@ -4,8 +4,3 @@ config RTL8812AU
|
||||
---help---
|
||||
Help message of RTL8812AU
|
||||
|
||||
-config RTL8814AU
|
||||
- tristate "Realtek 8814A USB WiFi"
|
||||
- depends on USB
|
||||
- ---help---
|
||||
- Help message of RTL8814AU
|
||||
diff --git a/drivers/net/wireless/rtl8814au/Kconfig b/drivers/net/wireless/rtl8814au/Kconfig
|
||||
index 16d3567..730c4e0 100644
|
||||
--- a/drivers/net/wireless/rtl8814au/Kconfig
|
||||
+++ b/drivers/net/wireless/rtl8814au/Kconfig
|
||||
@@ -1,9 +1,3 @@
|
||||
-config RTL8812AU
|
||||
- tristate "Realtek 8812A USB WiFi"
|
||||
- depends on USB
|
||||
- ---help---
|
||||
- Help message of RTL8812AU
|
||||
-
|
||||
config RTL8814AU
|
||||
tristate "Realtek 8814A USB WiFi"
|
||||
depends on USB
|
||||
diff --git a/drivers/net/wireless/rtl8814au/Makefile b/drivers/net/wireless/rtl8814au/Makefile
|
||||
index ef959e7..f71f524 100644
|
||||
--- a/drivers/net/wireless/rtl8814au/Makefile
|
||||
+++ b/drivers/net/wireless/rtl8814au/Makefile
|
||||
@@ -32,11 +32,11 @@ CONFIG_AUTOCFG_CP = n
|
||||
########################## WIFI IC ############################
|
||||
CONFIG_MULTIDRV = n
|
||||
CONFIG_RTL8188E = n
|
||||
-CONFIG_RTL8812A = y
|
||||
-CONFIG_RTL8821A = y
|
||||
+CONFIG_RTL8812A = n
|
||||
+CONFIG_RTL8821A = n
|
||||
CONFIG_RTL8192E = n
|
||||
CONFIG_RTL8723B = n
|
||||
-CONFIG_RTL8814A = n
|
||||
+CONFIG_RTL8814A = y
|
||||
CONFIG_RTL8723C = n
|
||||
CONFIG_RTL8188F = n
|
||||
CONFIG_RTL8822B = n
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,24 +0,0 @@
|
||||
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
|
||||
index 95cdb48fad061..db9ee74578012 100644
|
||||
--- a/drivers/net/wireless/Kconfig
|
||||
+++ b/drivers/net/wireless/Kconfig
|
||||
@@ -32,6 +32,7 @@ config WIRELESS_WDS
|
||||
|
||||
source "drivers/net/wireless/admtek/Kconfig"
|
||||
source "drivers/net/wireless/ath/Kconfig"
|
||||
+source "drivers/net/wireless/rtl8188eu/Kconfig"
|
||||
source "drivers/net/wireless/atmel/Kconfig"
|
||||
source "drivers/net/wireless/broadcom/Kconfig"
|
||||
source "drivers/net/wireless/cisco/Kconfig"
|
||||
diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
|
||||
index edeb51f6fa551..2c4d8522929bf 100644
|
||||
--- a/drivers/net/wireless/Makefile
|
||||
+++ b/drivers/net/wireless/Makefile
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
obj-$(CONFIG_WLAN_VENDOR_ADMTEK) += admtek/
|
||||
obj-$(CONFIG_WLAN_VENDOR_ATH) += ath/
|
||||
+obj-$(CONFIG_RTL8188EU) += rtl8188eu/
|
||||
obj-$(CONFIG_WLAN_VENDOR_ATMEL) += atmel/
|
||||
obj-$(CONFIG_WLAN_VENDOR_BROADCOM) += broadcom/
|
||||
obj-$(CONFIG_WLAN_VENDOR_CISCO) += cisco/
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user