Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopted Jernej's changes to switch LED definitions on Orange Pis #227

Merged
merged 1 commit into from
Mar 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion boards.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ install_board_specific (){
else
cp $SRC/lib/config/boot.cmd $DEST/cache/sdcard/boot/boot.cmd
# orangepi h3 temp exceptions
[[ $LINUXFAMILY == "sun8i" ]] && sed -i -e '1s/^/gpio set PA15\ngpio set PG11\nsetenv machid 1029\nsetenv bootm_boot_mode sec\n/' -e 's/\ disp.screen0_output_mode=1920x1080p60//' $DEST/cache/sdcard/boot/boot.cmd
[[ $LINUXFAMILY == "sun8i" ]] && sed -i -e '1s/^/gpio set PL10\ngpio set PG11\nsetenv machid 1029\nsetenv bootm_boot_mode sec\n/' \
-e 's/\ disp.screen0_output_mode=1920x1080p60//' -e 's/\ hdmi.audio=EDID:0//' $DEST/cache/sdcard/boot/boot.cmd
# let's prepare for old kernel too
chroot $DEST/cache/sdcard /bin/bash -c \
"ln -s /boot/bin/$BOARD.bin /boot/script.bin >/dev/null 2>&1 || cp /boot/bin/$BOARD.bin /boot/script.bin"
Expand Down
4 changes: 2 additions & 2 deletions config/orangepi2.fex
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ gpio_pin_19 = port:PG07<1><default><default><0>
[leds_para]
leds_used = 1
green_led = port:PL10<1><default><default><0>
green_led_active_low = 0
green_led_active_low = 1
red_led = port:PA15<1><default><default><0>
red_led_active_low = 1
red_led_active_low = 0

;----------------------------------------------------------------------------------
;thermal configuration
Expand Down
4 changes: 2 additions & 2 deletions config/orangepilite.fex
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ gpio_pin_19 = port:PG07<1><default><default><0>
[leds_para]
leds_used = 1
green_led = port:PL10<1><default><default><0>
green_led_active_low = 0
green_led_active_low = 1
red_led = port:PA15<1><default><default><0>
red_led_active_low = 1
red_led_active_low = 0

[ths_para]
ths_used = 1
Expand Down
4 changes: 2 additions & 2 deletions config/orangepione.fex
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ gpio_pin_19 = port:PG07<1><default><default><0>
[leds_para]
leds_used = 1
green_led = port:PL10<1><default><default><0>
green_led_active_low = 0
green_led_active_low = 1
red_led = port:PA15<1><default><default><0>
red_led_active_low = 1
red_led_active_low = 0

[ths_para]
ths_used = 1
Expand Down
4 changes: 2 additions & 2 deletions config/orangepipc.fex
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ gpio_pin_19 = port:PG07<1><default><default><0>
[leds_para]
leds_used = 1
green_led = port:PL10<1><default><default><0>
green_led_active_low = 0
green_led_active_low = 1
red_led = port:PA15<1><default><default><0>
red_led_active_low = 1
red_led_active_low = 0

[ths_para]
ths_used = 1
Expand Down
4 changes: 2 additions & 2 deletions config/orangepiplus.fex
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ gpio_pin_19 = port:PG07<1><default><default><0>
[leds_para]
leds_used = 1
green_led = port:PL10<1><default><default><0>
green_led_active_low = 0
green_led_active_low = 1
red_led = port:PA15<1><default><default><0>
red_led_active_low = 1
red_led_active_low = 0

;----------------------------------------------------------------------------------
;thermal configuration
Expand Down
21 changes: 21 additions & 0 deletions patch/kernel/sun8i-default/0014-no_dev_console.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/init/main.c b/init/main.c
index 9484f4b..db55edd 100644
--- a/init/main.c
+++ b/init/main.c
@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
do_basic_setup();

/* Open the /dev/console on the rootfs, this should never fail */
- if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
- printk(KERN_WARNING "Warning: unable to open an initial console.\n");
+ char *console = "/dev_console";
+
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
+ if (sys_open(console, O_RDWR, 0) < 0)
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
+ sys_unlink(console);
+ }

(void) sys_dup(0);
(void) sys_dup(0);
90 changes: 90 additions & 0 deletions patch/u-boot/u-boot-default/u-boot-03-add-R_PIO-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
diff -Nur a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c
--- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c 2016-02-15 22:44:30.000000000 +0100
+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c 2016-03-07 22:29:38.603830589 +0100
@@ -42,6 +42,9 @@

writel(MBUS_CLK_DEFAULT, &ccm->mbus0_clk_cfg);
writel(MBUS_CLK_DEFAULT, &ccm->mbus1_clk_cfg);
+
+ /* enable R_PIO and de-assert resets */
+ prcm_apb0_enable(PRCM_APB0_GATE_PIO);
}
#endif

diff -Nur a/arch/arm/dts/sun8i-h3.dtsi b/arch/arm/dts/sun8i-h3.dtsi
--- a/arch/arm/dts/sun8i-h3.dtsi 2016-02-15 22:44:30.000000000 +0100
+++ b/arch/arm/dts/sun8i-h3.dtsi 2016-03-07 22:27:45.575183986 +0100
@@ -285,6 +285,25 @@
clocks = <&osc24M>, <&pll6 1>, <&pll5>;
clock-output-names = "mbus";
};
+
+ apb0: apb0_clk {
+ compatible = "fixed-factor-clock";
+ #clock-cells = <0>;
+ clock-div = <1>;
+ clock-mult = <1>;
+ clocks = <&osc24M>;
+ clock-output-names = "apb0";
+ };
+
+ apb0_gates: clk@01f01428 {
+ compatible = "allwinner,sun8i-h3-apb0-gates-clk",
+ "allwinner,sun4i-a10-gates-clk";
+ reg = <0x01f01428 0x4>;
+ #clock-cells = <1>;
+ clocks = <&apb0>;
+ clock-indices = <0>, <1>;
+ clock-output-names = "apb0_pio", "apb0_ir";
+ };
};

soc {
@@ -591,5 +610,23 @@
interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
};
+
+ apb0_reset: reset@01f014b0 {
+ reg = <0x01f014b0 0x4>;
+ compatible = "allwinner,sun6i-a31-clock-reset";
+ #reset-cells = <1>;
+ };
+
+ r_pio: pinctrl@01f02c00 {
+ compatible = "allwinner,sun8i-h3-r-pinctrl";
+ reg = <0x01f02c00 0x400>;
+ interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&apb0_gates 0>;
+ resets = <&apb0_reset 0>;
+ gpio-controller;
+ #gpio-cells = <3>;
+ interrupt-controller;
+ #interrupt-cells = <3>;
+ };
};
};
diff -Nur a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
--- a/drivers/gpio/sunxi_gpio.c 2016-03-07 22:19:30.000000000 +0100
+++ b/drivers/gpio/sunxi_gpio.c 2016-03-07 22:24:28.194532112 +0100
@@ -276,8 +276,10 @@
"allwinner,sun6i-a31-r-pinctrl") == 0) {
start = 'L' - 'A';
no_banks = 2; /* L & M */
- } else if (fdt_node_check_compatible(gd->fdt_blob, parent->of_offset,
- "allwinner,sun8i-a23-r-pinctrl") == 0) {
+ } else if ((fdt_node_check_compatible(gd->fdt_blob, parent->of_offset,
+ "allwinner,sun8i-a23-r-pinctrl") == 0) ||
+ (fdt_node_check_compatible(gd->fdt_blob, parent->of_offset,
+ "allwinner,sun8i-h3-r-pinctrl") == 0)) {
start = 'L' - 'A';
no_banks = 1; /* L only */
} else {
@@ -320,6 +322,7 @@
{ .compatible = "allwinner,sun9i-a80-pinctrl" },
{ .compatible = "allwinner,sun6i-a31-r-pinctrl" },
{ .compatible = "allwinner,sun8i-a23-r-pinctrl" },
+ { .compatible = "allwinner,sun8i-h3-r-pinctrl" },
{ }
};