From 700c4011286dd52500979dc82501f5a782c7518f Mon Sep 17 00:00:00 2001 From: ThomasKaiser Date: Sat, 4 Nov 2017 15:37:17 +0100 Subject: [PATCH] Initial Orange Pi R1 support --- config/boards/orangepi-r1.wip | 24 ++++++ config/fex/orangepi-r1.fex | 97 +++++++++++++++--------- packages/bsp/common/etc/init.d/armhwinfo | 2 +- packages/bsp/common/etc/init.d/firstrun | 2 +- 4 files changed, 88 insertions(+), 37 deletions(-) create mode 100644 config/boards/orangepi-r1.wip diff --git a/config/boards/orangepi-r1.wip b/config/boards/orangepi-r1.wip new file mode 100644 index 000000000000..6534052b80a5 --- /dev/null +++ b/config/boards/orangepi-r1.wip @@ -0,0 +1,24 @@ +# H2+ quad core 256/512MB Wi-Fi + dual Ethernet +BOARD_NAME="Orange Pi R1" +LINUXFAMILY="sun8i" +BOOTCONFIG="orangepi_zero_defconfig" +# +MODULES="#w1-sunxi #w1-gpio #w1-therm #sunxi-cir g_serial r8152 8189es" +MODULES_NEXT="g_serial r8152 8189es" +MODULES_BLACKLIST="dhd" +DEFAULT_OVERLAYS="usbhost2 usbhost3" +CPUMIN=240000 +CPUMAX=1200000 +BUILD_DESKTOP="no" +# +KERNEL_TARGET="default,next,dev" +CLI_TARGET="jessie,xenial:default,next" + +CLI_BETA_TARGET="xenial:next" +# +RECOMMENDED="Ubuntu_xenial_default:90,Ubuntu_xenial_next:75" +# +BOARDRATING="" +CHIP="http://docs.armbian.com/Hardware_Allwinner-H3/" +HARDWARE="http://linux-sunxi.org/Xunlong_Orange_Pi_Zero#Variants" +FORUMS="http://forum.armbian.com/index.php/forum/13-allwinner-h3/" diff --git a/config/fex/orangepi-r1.fex b/config/fex/orangepi-r1.fex index 8bc528b61806..d2e05ec25663 100644 --- a/config/fex/orangepi-r1.fex +++ b/config/fex/orangepi-r1.fex @@ -1,6 +1,6 @@ [product] version = "100" -machine = "dolphin_p2" +machine = "Xunlong Orange Pi R1" [platform] debug_mode = 1 @@ -38,8 +38,8 @@ led_state = 0 [boot_init_gpio] used = 1 -gpio0 = port:PL10<1><0> -gpio1 = port:PA17<1><1> +gpio0 = port:PL10<1><1> +gpio1 = port:PA17<1><0> [recovery_para] used = 1 @@ -108,7 +108,7 @@ pll_periph1 = 600 pll_de = 864 [dram_para] -dram_clk = 576 +dram_clk = 408 dram_type = 3 dram_zq = 0x3b3bfb dram_odt_en = 1 @@ -195,7 +195,7 @@ spi_sclk = port:PC02<3> spi_cs0 = port:PC03<3><1> [spi1] -spi_used = 0 +spi_used = 1 spi_cs_bitmap = 1 spi_cs0 = port:PA13<2><1> spi_sclk = port:PA14<2> @@ -203,24 +203,38 @@ spi_mosi = port:PA15<2> spi_miso = port:PA16<2> [spi_devices] -spi_dev_num = 1 +spi_dev_num = 2 [spi_board0] -modalias = "m25p32" +modalias = "spidev" max_speed_hz = 33000000 bus_num = 0 chip_select = 0 mode = 0 +full_duplex = 1 +manual_cs = 0 +[spi_board1] +modalias = "spidev" +max_speed_hz = 33000000 +bus_num = 1 +chip_select = 0 +mode = 0 +full_duplex = 1 +manual_cs = 0 + +; NOTE: This section is necessary only for "gpio_sunxi" driver +; which is obsolete for H3 boards [gpio_para] gpio_used = 0 -gpio_num = 2 -gpio_pin_1 = port:PA07<1><0> -gpio_pin_2 = port:PA10<1><0> +gpio_num = 0 -[led_assign] -normal_led = "gpio_pin_2" -standby_led = "gpio_pin_1" +[leds_para] +leds_used = 1 +green_led = port:PL10<1><1> +green_led_active_low = 0 +red_led = port:PA17<1><0> +red_led_active_low = 0 [ths_para] ths_used = 1 @@ -232,7 +246,7 @@ ths_trip1_3 = 80 ths_trip1_4 = 85 ths_trip1_5 = 90 ths_trip1_6 = 95 -ths_trip1_7 = 105 +ths_trip1_7 = 100 ths_trip1_0_min = 0 ths_trip1_0_max = 1 ths_trip1_1_min = 1 @@ -242,33 +256,27 @@ ths_trip1_2_max = 3 ths_trip1_3_min = 3 ths_trip1_3_max = 4 ths_trip1_4_min = 4 -ths_trip1_4_max = 6 -ths_trip1_5_min = 6 -ths_trip1_5_max = 8 -ths_trip1_6_min = 8 -ths_trip1_6_max = 10 -ths_trip1_7_min = 0 -ths_trip1_7_max = 0 +ths_trip1_4_max = 5 +ths_trip1_5_min = 5 +ths_trip1_5_max = 6 +ths_trip1_6_min = 6 +ths_trip1_6_max = 7 ths_trip2_count = 1 ths_trip2_0 = 105 [cooler_table] -cooler_count = 11 +cooler_count = 8 cooler0 = "1200000 4 4294967295 0" -cooler1 = "1008000 4 4294967295 0" -cooler2 = "816000 4 4294967295 0" -cooler3 = "720000 4 4294967295 0" -cooler4 = "648000 4 4294967295 0" -cooler5 = "480000 4 4294967295 0" -cooler6 = "312000 4 4294967295 0" -cooler7 = "240000 4 4294967295 0" -cooler8 = "240000 3 4294967295 0" -cooler9 = "240000 2 4294967295 0" -cooler10 = "240000 1 4294967295 0" +cooler1 = "912000 4 4294967295 0" +cooler2 = "768000 4 4294967295 0" +cooler3 = "648000 4 4294967295 0" +cooler4 = "480000 4 4294967295 0" +cooler5 = "480000 3 4294967295 0" +cooler6 = "240000 2 4294967295 0" +cooler7 = "240000 1 4294967295 0" [nand0_para] nand_support_2ch = 0 -nand_cache_level = 1 nand0_used = 0 nand0_we = port:PC00<2><0><1> nand0_ale = port:PC01<2><0><1> @@ -411,7 +419,7 @@ tvout_channel_num = 1 tv_en = [tvin_para] -tvin_used = +tvin_used = 0 tvin_channel_num = [di_para] @@ -641,7 +649,7 @@ dachpf_used = 0 audio_pa_ctrl = port:PA10<1><0> [spdif0] -spdif_used = 1 +spdif_used = 0 spdif_dout = port:PA17<2><1> [audiohub] @@ -795,3 +803,22 @@ d7s_used = 0 din_gpio = port:PD00<1><1> clk_gpio = port:PD01<1><1> stb_gpio = port:PD02<1><1> + +;---------------------------------------------------------------------------------- +;mali parameters +;---------------------------------------------------------------------------------- +[mali_para] +mali_used = 0 +mali_clkdiv = 1 +mali_extreme_freq = 600 +mali_extreme_vol = 1400 + +;---------------------------------------------------------------------------------- +;1wire parameters (default - PA10 / pin 26) -- PA20 not available here +;---------------------------------------------------------------------------------- +[w1_para] +w1_used = 1 +gpio = 10 + +[corekeeper] +corekeeper_enabled = 1 diff --git a/packages/bsp/common/etc/init.d/armhwinfo b/packages/bsp/common/etc/init.d/armhwinfo index 424e925feb2d..60d2889a020c 100755 --- a/packages/bsp/common/etc/init.d/armhwinfo +++ b/packages/bsp/common/etc/init.d/armhwinfo @@ -231,7 +231,7 @@ prepare_board() { echo 8 >/proc/irq/$i/smp_affinity done ;; - "Beelink X2") + "Beelink X2"|"Orange Pi R1") # Wifi module reload workaround / fix [[ -n $(lsmod | grep 8189es) ]] && rmmod 8189es && modprobe 8189es # Send SDIO to cpu1, USB to cpu2, Ethernet to cpu3 diff --git a/packages/bsp/common/etc/init.d/firstrun b/packages/bsp/common/etc/init.d/firstrun index c6be80813b21..9779d8b93434 100755 --- a/packages/bsp/common/etc/init.d/firstrun +++ b/packages/bsp/common/etc/init.d/firstrun @@ -243,7 +243,7 @@ case "$1" in # change serial port for BT on FriendlyELEC H3 boards sed -i "s/^PORT=.*/PORT=ttyS3/" /etc/default/ap6212 ;; - "Orange Pi Lite"|"Orange Pi Zero Plus 2"|"NanoPi Air") + "Orange Pi Lite"|"Orange Pi Zero Plus 2"|"NanoPi Air"|"Orange Pi R1") # relink /etc/network/interfaces on Wi-Fi only boards cd /etc/network/ && ln -sf interfaces.network-manager interfaces ;;