experimental FunKey DTS

This commit is contained in:
Michel-FK 2019-03-22 13:58:51 +01:00
parent 6edf1b86a5
commit 8b88601d04
17 changed files with 4483 additions and 60 deletions

View File

@ -1,4 +1,4 @@
setenv bootargs console=ttyS0,115200 panic=5 console=tty0 rootwait fbcon=map:10 fbcon=font:VGA8x8 root=/dev/mmcblk0p2 earlyprintk rw
load mmc 0:1 0x41000000 zImage
load mmc 0:1 0x41800000 sun8i-v3s-licheepi-zero-dock.dtb
load mmc 0:1 0x41800000 sun8i-v3s-funkey.dtb
bootz 0x41000000 - 0x41800000

View File

@ -2,8 +2,7 @@ image boot.vfat {
vfat {
files = {
"zImage",
"sun8i-v3s-licheepi-zero-dock.dtb",
"sun8i-v3s-licheepi-zero.dtb",
"sun8i-v3s-funkey.dtb",
"boot.scr"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
From 700384f1f3c204fa989fddd0ae73c2ebe76483a3 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:33:32 +0100
Subject: [PATCH 1/9] added uart1 & uart2 pins
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts | 6 ++++++
arch/arm/boot/dts/sun8i-v3s.dtsi | 10 ++++++++++
2 files changed, 16 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
index b6f3430..18e9503 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
@@ -109,6 +109,12 @@
status = "okay";
};
+/*&uart2 {
+ pinctrl-0 = <&uart2_pins_a>;
+ pinctrl-names = "default";
+ status = "okay";
+};*/
+
&usb_otg {
dr_mode = "otg";
status = "okay";
diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index e437d3f..6708af1 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -356,6 +356,16 @@
function = "uart0";
};
+ uart1_pins_a: uart1@0 {
+ pins = "PE21", "PE22";
+ function = "uart1";
+ };
+
+ uart2_pins_a: uart2@0 {
+ pins = "PB0", "PB1";
+ function = "uart2";
+ };
+
lcd_rgb666_pins_a: lcd-rgb666-pe {
pins = "PE0", "PE1", "PE2", "PE3", "PE4", "PE5",
"PE6", "PE7", "PE8", "PE9", "PE10", "PE11",
--
2.7.4

View File

@ -0,0 +1,88 @@
From 110d4a501c56aef0986baa5de9e629f11b6ab692 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:22:54 +0100
Subject: [PATCH 2/9] disabled LicheePi LEDs
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts | 4 ++--
arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi | 5 +++++
arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts | 11 ++++++-----
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
index d8b6833..0afd3af 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
@@ -54,8 +54,8 @@
};*/
leds {
- /* The LEDs use PG0~2 pins, which conflict with MMC1 */
- status = "disbaled";
+ // The LEDs use PG0~2 pins, which conflict with MMC1
+ status = "disabled";
};
};
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi
index f7ed577..b7d8ff4 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi
@@ -30,6 +30,11 @@
};
};
};
+
+ leds {
+ // The LEDs use PG0~2 pins, which conflict with MMC1
+ status = "disabled";
+ };
};
&de {
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
index 18e9503..ded54df 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
@@ -50,31 +50,32 @@
aliases {
serial0 = &uart0;
+ //serial0 = &uart2;
};
chosen {
stdout-path = "serial0:115200n8";
};
- leds {
+ /*leds {
compatible = "gpio-leds";
blue_led {
label = "licheepi:blue:usr";
- gpios = <&pio 6 1 GPIO_ACTIVE_LOW>; /* PG1 */
+ gpios = <&pio 6 1 GPIO_ACTIVE_LOW 0x1>; // PG1 //
};
green_led {
label = "licheepi:green:usr";
- gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
+ gpios = <&pio 6 0 GPIO_ACTIVE_LOW 0x1>; // PG0 //
default-state = "on";
};
red_led {
label = "licheepi:red:usr";
- gpios = <&pio 6 2 GPIO_ACTIVE_LOW>; /* PG2 */
+ gpios = <&pio 6 2 GPIO_ACTIVE_LOW 0x1>; // PG2 //
};
- };
+ };*/
};
&ehci0 {
--
2.7.4

View File

@ -0,0 +1,35 @@
From 9163e2926190307570c421c5f6e06057fd87a224 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:48:08 +0100
Subject: [PATCH 3/9] removed USB OTG
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
index ded54df..99785b0 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
@@ -116,7 +116,7 @@
status = "okay";
};*/
-&usb_otg {
+/*&usb_otg {
dr_mode = "otg";
status = "okay";
};
@@ -124,7 +124,7 @@
&usbphy {
usb0_id_det-gpio = <&pio 5 6 GPIO_ACTIVE_HIGH>;
status = "okay";
-};
+};*/
&spi0 {
status = "okay";
--
2.7.4

View File

@ -0,0 +1,76 @@
From c06a4ba80922341138853bf8cedaeef2cd533013 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:51:37 +0100
Subject: [PATCH 4/9] replaced backlight with PWM
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts | 6 ++++++
arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi | 6 +++---
arch/arm/boot/dts/sun8i-v3s.dtsi | 5 +++++
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
index 0afd3af..1c263c2 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
@@ -79,6 +79,12 @@
status = "okay";
};
+&pwm {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm0_pins>;
+ status = "okay";
+};
+
&lradc {
vref-supply = <&reg_vcc3v0>;
status = "okay";
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi
index b7d8ff4..ad3fb39 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi
@@ -7,12 +7,12 @@
#include "sun8i-v3s-licheepi-zero.dts"
/ {
- backlight: backlight {
+ /*backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm 0 1000000 0>;
brightness-levels = <0 30 40 50 60 70 100>;
default-brightness-level = <6>;
- };
+ };*/
panel: panel {
#address-cells = <1>;
@@ -20,7 +20,7 @@
port@0 {
reg = <0>;
- backlight = <&backlight>;
+ //backlight = <&backlight>;
#address-cells = <1>;
#size-cells = <0>;
diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 6708af1..a61c680 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -351,6 +351,11 @@
function = "pwm0";
};
+ pwm1_pins: pwm1 {
+ pins = "PB5";
+ function = "pwm1";
+ };
+
uart0_pins_a: uart0@0 {
pins = "PB8", "PB9";
function = "uart0";
--
2.7.4

View File

@ -0,0 +1,34 @@
From fb026dd5d01a07b3fb2b172647924ddad2f2f863 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:53:38 +0100
Subject: [PATCH 5/9] remapped buttons
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
index 1c263c2..94657bd 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
@@ -105,14 +105,14 @@
button@600 {
label = "Select";
- linux,code = <KEY_SELECT>;
+ linux,code = <KEY_O>;
channel = <0>;
voltage = <600000>;
};
button@800 {
label = "Start";
- linux,code = <KEY_OK>;
+ linux,code = <KEY_P>;
channel = <0>;
voltage = <800000>;
};
--
2.7.4

View File

@ -0,0 +1,32 @@
From a41e4bef4c48ef310617f7ca3a05d6ced241ab26 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:54:24 +0100
Subject: [PATCH 6/9] removed lradc
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
index 94657bd..71a8fea 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
@@ -85,7 +85,7 @@
status = "okay";
};
-&lradc {
+/*&lradc {
vref-supply = <&reg_vcc3v0>;
status = "okay";
@@ -116,4 +116,4 @@
channel = <0>;
voltage = <800000>;
};
-};
+};*/
--
2.7.4

View File

@ -0,0 +1,31 @@
From 1e9535237bda590eb30e160603d760034aae1721 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:56:04 +0100
Subject: [PATCH 7/9] removed tcon0
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi
index ad3fb39..1c16e21 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-with-lcd.dtsi
@@ -47,11 +47,11 @@
status = "okay";
};
-&tcon0 {
+/*&tcon0 {
pinctrl-names = "default";
pinctrl-0 = <&lcd_rgb666_pins_a>;
status = "okay";
-};
+};*/
&tcon0_out {
tcon0_out_lcd: endpoint@0 {
--
2.7.4

View File

@ -0,0 +1,28 @@
From cd2a9cb732a65f5986b625d1c62cba7564215db9 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:57:35 +0100
Subject: [PATCH 8/9] remapped st7789v LCD GPIOs
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
index 99785b0..9d3b27f 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
@@ -138,8 +138,8 @@
rotate = <0>;
fps = <42>;
buswidth = <8>;
- reset-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>;
- dc-gpios = <&pio 1 5 GPIO_ACTIVE_LOW>;
+ reset-gpios = <&pio 4 1 GPIO_ACTIVE_LOW>; //PE1
+ dc-gpios = <&pio 2 0 GPIO_ACTIVE_LOW>; //PC0 (MISO)
debug = <0>;
};
};
--
2.7.4

View File

@ -0,0 +1,80 @@
From 538e97d56bae968580ac046389243383b7559ab9 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Tue, 19 Mar 2019 22:26:56 +0100
Subject: [PATCH 9/9] rotated screen 90 degrees CW
Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts | 2 +-
drivers/staging/fbtft/fb_st7789v.c | 13 ++++++++++---
drivers/staging/fbtft/fbtft-core.c | 8 +++++++-
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
index 9d3b27f..7bf06ab 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
@@ -135,7 +135,7 @@
spi-max-frequency = <40000000>;
txbuflen = <115200>;
- rotate = <0>;
+ rotate = <90>;
fps = <42>;
buswidth = <8>;
reset-gpios = <&pio 4 1 GPIO_ACTIVE_LOW>; //PE1
diff --git a/drivers/staging/fbtft/fb_st7789v.c b/drivers/staging/fbtft/fb_st7789v.c
index 69f52af..e966993 100644
--- a/drivers/staging/fbtft/fb_st7789v.c
+++ b/drivers/staging/fbtft/fb_st7789v.c
@@ -150,9 +150,6 @@ static int init_display(struct fbtft_par *par)
*/
write_reg(par, PWCTRL1, 0xA4, 0xA1);
- /* Ystart at 80 , Yend at 240 */
- write_reg(par, 0x2B, 0x00, 0x50, 0x00, 0xF0);
-
/* Display Inversion of colors */
write_reg(par, 0x21);
@@ -190,6 +187,16 @@ static int set_var(struct fbtft_par *par)
return -EINVAL;
}
write_reg(par, MIPI_DCS_SET_ADDRESS_MODE, madctl_par);
+
+ // All offset operations are done after in fbtft_set_addr_win, not here
+ /* Ystart at 0 , Yend at 239 */
+ //write_reg(par, 0x2B, 0x00, 0x50, 0x00, 0xEF);
+ write_reg(par, 0x2B, 0x00, 0x00, 0x00, 0xEF);
+ //write_reg(par, 0x2B, 0x00, 0x50, 0x01, 0x3F);
+ /* Xstart at 80 , Xend at 319 */
+ write_reg(par, 0x2A, 0x00, 0x50, 0x01, 0x3F);
+ //write_reg(par, 0x2A, 0x00, 0x50, 0x00, 0xEF);
+
return 0;
}
diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 6d0363d..fbb0934 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -391,9 +391,15 @@ static void fbtft_update_display(struct fbtft_par *par, unsigned int start_line,
fbtft_par_dbg(DEBUG_UPDATE_DISPLAY, par, "%s(start_line=%u, end_line=%u)\n",
__func__, start_line, end_line);
- if (par->fbtftops.set_addr_win)
+ // Carefull removing this. this will work only if the full screen is updated at once
+ /*if (par->fbtftops.set_addr_win){
par->fbtftops.set_addr_win(par, 0, start_line,
par->info->var.xres - 1, end_line);
+ }*/
+ if (par->fbtftops.set_addr_win){
+ par->fbtftops.set_addr_win(par, 80, start_line,
+ 320 - 1, end_line);
+ }
offset = start_line * par->info->fix.line_length;
len = (end_line - start_line + 1) * par->info->fix.line_length;
--
2.7.4

View File

@ -0,0 +1,162 @@
/*
* Copyright (C) 2019 Michel Stempin <michel.stempin@wanadoo.fr>
*
* 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 "sun8i-v3s.dtsi"
#include "sunxi-common-regulators.dtsi"
#include "axp209.dtsi"
/ {
model = "FunKey";
compatible = "funkey", "allwinner,sun8i-v3s";
aliases {
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:115200n8";
};
backlight: backlight {
compatible = "pwm-backlight";
pwms = <&pwm 0 1000000 0>;
brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
default-brightness-level = <10>;
};
};
&codec {
allwinner,audio-routing =
"Headphone", "HP",
"Headphone", "HPCOM",
"MIC1", "Mic",
"Mic", "HBIAS";
status = "okay";
};
&ehci0 {
status = "okay";
};
&i2c0 {
status = "okay";
axp209: pmic@34 {
compatible = "x-powers,axp209";
reg = <0x34>;
interrupts = <0>;
interrupt-controller;
#interrupt-cells = <1>;
};
};
&mmc0 {
pinctrl-0 = <&mmc0_pins_a>;
pinctrl-names = "default";
broken-cd;
bus-width = <4>;
vmmc-supply = <&reg_vcc3v3>;
status = "okay";
};
&ohci0 {
status = "okay";
};
&reg_dcdc2 {
regulator-always-on;
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1400000>;
regulator-name = "vdd-cpu-sys-ephy";
};
&reg_dcdc3 {
regulator-always-on;
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3450000>;
regulator-name = "vcc-io-ephy-mcsi-usb";
};
&reg_ldo1 {
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3600000>;
regulator-name = "vcc-rtc";
};
&reg_ldo2 {
regulator-always-on;
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <3300000>;
regulator-name = "avcc-pll";
};
&spi0 {
status = "okay";
st7789v@0 {
compatible = "sitronix,st7789v";
reg = <0>;
spi-max-frequency = <40000000>;
txbuflen = <115200>;
rotate = <90>;
fps = <42>;
buswidth = <8>;
reset-gpios = <&pio 4 1 GPIO_ACTIVE_LOW>; //PE1
dc-gpios = <&pio 2 0 GPIO_ACTIVE_LOW>; //PC0 (MISO)
debug = <0>;
};
};
&uart0 {
pinctrl-0 = <&uart0_pins_a>;
pinctrl-names = "default";
status = "okay";
};
&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm0_pins>;
status = "okay";
};

View File

@ -1,10 +1,11 @@
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
# CONFIG_ARMV7_NONSEC is not set
CONFIG_IDENT_STRING=" FunKey"
CONFIG_MACH_SUN8I_V3S=y
CONFIG_DRAM_CLK=360
CONFIG_DRAM_ZQ=14779
CONFIG_DEFAULT_DEVICE_TREE="sun8i-v3s-licheepi-zero"
CONFIG_DEFAULT_DEVICE_TREE="sun8i-v3s-funkey"
CONFIG_BOOTDELAY=0
# CONFIG_CONSOLE_MUX is not set
CONFIG_SPL=y

View File

@ -1,53 +1,28 @@
# Target options
BR2_arm=y
BR2_cortex_a7=y
# Check if VFPv4 is using 16 bit (default) or 32 bit registers
#BR2_ARM_FPU_VFPV4=y
# Build options
BR2_DL_DIR="$(BR2_EXTERNAL_FUNKEY_PATH)/dl"
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/patches"
# Toolchain
# External Linaro ARM 2017.11 toolchain
BR2_TOOLCHAIN_EXTERNAL=y
# System configuration
BR2_TARGET_GENERIC_HOSTNAME="licheepi-zero"
BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the LicheePi Zero"
BR2_TARGET_GENERIC_HOSTNAME="funkey"
BR2_TARGET_GENERIC_ISSUE="Welcome to Buildroot for the FunKey"
BR2_ROOTFS_DEVICE_TABLE="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/device_table.txt"
BR2_TARGET_GENERIC_ROOT_PASSWD="licheepi"
# Run a getty (login prompt) after boot on ttyS0 @ 115200 bps
BR2_TARGET_GENERIC_ROOT_PASSWD="funkey"
BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y
# External device users table & rootfs overlay
BR2_ROOTFS_USERS_TABLES="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/users_table.txt"
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/rootfs-overlay"
# Custom scripts for image creation
BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/post-image.sh"
# Kernel
# Custom 4.14.14 kernel based on stable linux.4.14.y from Lichee-Pi Github repository
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_GIT=y
BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/Lichee-Pi/linux"
BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="zero-4.14.y"
# Path for Funkey: disable Ethernet MAC, custom LCD init commands
BR2_LINUX_KERNEL_PATCH="0001-disable-ethernet.patch 0002-enable-st7789v-lcd.patch 0003-disable-simplefb_lcd.patch 0004-fb_st7789v-saef-sf-tc154b-8377a-n.patch"
# Custom kernel configuration
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/linux.config"
# AllWinner DTS
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-v3s-licheepi-zero sun8i-v3s-licheepi-zero-dock"
# Target packages
# Custom BusyBox configuration
BR2_LINUX_KERNEL_INTREE_DTS_NAME="sun8i-v3s-funkey"
BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/busybox.config"
# Alsa-utils package
BR2_PACKAGE_ALSA_UTILS=y
BR2_PACKAGE_ALSA_UTILS_ALSACONF=y
BR2_PACKAGE_ALSA_UTILS_ACONNECT=y
@ -65,13 +40,9 @@ BR2_PACKAGE_ALSA_UTILS_BAT=y
BR2_PACKAGE_ALSA_UTILS_IECSET=y
BR2_PACKAGE_ALSA_UTILS_SPEAKER_TEST=y
BR2_PACKAGE_AUMIX=y
# E2fsprog package for e2fsck and resize2fs
BR2_PACKAGE_E2FSPROGS=y
# BR2_PACKAGE_E2FSPROGS_FSCK is not set
BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y
# SDL package for Retro games
BR2_PACKAGE_SDL=y
BR2_PACKAGE_SDL_GFX=y
BR2_PACKAGE_SDL_IMAGE=y
@ -79,31 +50,28 @@ BR2_PACKAGE_SDL_MIXER=y
BR2_PACKAGE_SDL_SOUND=y
BR2_PACKAGE_SDL_SOUND_PLAYSOUND=y
BR2_PACKAGE_SDL_TTF=y
# Zlib package
BR2_PACKAGE_ZLIB=y
# Dhcpcd package DHCP client for Wi-Fi
BR2_PACKAGE_XORG7=y
BR2_PACKAGE_XSERVER_XORG_SERVER=y
BR2_PACKAGE_XSERVER_XORG_SERVER_XVFB=y
BR2_PACKAGE_XAPP_TWM=y
BR2_PACKAGE_XAPP_XCLOCK=y
BR2_PACKAGE_XAPP_XINIT=y
BR2_PACKAGE_XAPP_XINPUT=y
BR2_PACKAGE_XAPP_XKILL=y
BR2_PACKAGE_XAPP_XPROP=y
BR2_PACKAGE_XAPP_XSET=y
BR2_PACKAGE_XAPP_XSETROOT=y
BR2_PACKAGE_XDRIVER_XF86_VIDEO_FBDEV=y
BR2_PACKAGE_DHCPCD=y
# WPA_supplicant package for Wi-Fi Authentication
BR2_PACKAGE_DROPBEAR=y
BR2_PACKAGE_WPA_SUPPLICANT=y
BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN=y
BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
# Util-linux package for fdisk
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
# Nano text editor package
BR2_PACKAGE_NANO=y
# Filesystem images
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
# BR2_TARGET_ROOTFS_TAR is not set
# Bootloaders
# Custom U-Boot from Lichee-Pi Github repository
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_GIT=y
@ -113,16 +81,10 @@ BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_FUNKEY_PATH)/board/funkey/uboot.config"
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin"
# Host utilities
# Required host utilities for building an SDCard image
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_DTC=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_UBOOT_TOOLS=y
# External options
# RTL8723BS firmware
BR2_PACKAGE_RTL8723BS_FIRMWARE=y
# Mednafen
BR2_PACKAGE_MEDNAFEN=y

View File

@ -0,0 +1,253 @@
/*
* Copyright 2013 Emilio López
*
* Emilio López <emilio@elopez.com.ar>
*
* 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 "sun4i-a10.dtsi"
#include "sunxi-common-regulators.dtsi"
#include <dt-bindings/gpio/gpio.h>
/ {
model = "Mele A1000";
compatible = "mele,a1000", "allwinner,sun4i-a10";
aliases {
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:115200n8";
};
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&led_pins_a1000>;
red {
label = "a1000:red:usr";
gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>;
};
blue {
label = "a1000:blue:pwr";
gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
};
reg_emac_3v3: emac-3v3 {
compatible = "regulator-fixed";
pinctrl-names = "default";
pinctrl-0 = <&emac_power_pin_a1000>;
regulator-name = "emac-3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
startup-delay-us = <20000>;
enable-active-high;
gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>;
};
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "On-board SPDIF";
simple-audio-card,cpu {
sound-dai = <&spdif>;
};
simple-audio-card,codec {
sound-dai = <&spdif_out>;
};
};
spdif_out: spdif-out {
#sound-dai-cells = <0>;
compatible = "linux,spdif-dit";
};
};
&ahci {
status = "okay";
};
&codec {
status = "okay";
};
&cpu0 {
cpu-supply = <&reg_dcdc2>;
};
&ehci0 {
status = "okay";
};
&ehci1 {
status = "okay";
};
&emac {
pinctrl-names = "default";
pinctrl-0 = <&emac_pins_a>;
phy = <&phy1>;
status = "okay";
};
&emac_sram {
status = "okay";
};
&i2c0 {
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pins_a>;
status = "okay";
axp209: pmic@34 {
compatible = "x-powers,axp209";
reg = <0x34>;
interrupts = <0>;
interrupt-controller;
#interrupt-cells = <1>;
};
};
&ir0 {
pinctrl-names = "default";
pinctrl-0 = <&ir0_rx_pins_a>;
status = "okay";
};
&mdio {
phy-supply = <&reg_emac_3v3>;
status = "okay";
phy1: ethernet-phy@1 {
reg = <1>;
};
};
&mmc0 {
pinctrl-names = "default";
pinctrl-0 = <&mmc0_pins_a>;
vmmc-supply = <&reg_vcc3v3>;
bus-width = <4>;
cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
cd-inverted;
status = "okay";
};
&ohci0 {
status = "okay";
};
&ohci1 {
status = "okay";
};
&pio {
emac_power_pin_a1000: emac_power_pin@0 {
pins = "PH15";
function = "gpio_out";
};
led_pins_a1000: led_pins@0 {
pins = "PH10", "PH20";
function = "gpio_out";
};
};
#include "axp209.dtsi"
&reg_dcdc2 {
regulator-always-on;
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1400000>;
regulator-name = "vdd-cpu";
};
&reg_dcdc3 {
regulator-always-on;
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <1250000>;
regulator-name = "vdd-int-dll";
};
&reg_ldo1 {
regulator-name = "vdd-rtc";
};
&reg_ldo2 {
regulator-always-on;
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3000000>;
regulator-name = "avcc";
};
&reg_usb1_vbus {
status = "okay";
};
&reg_usb2_vbus {
status = "okay";
};
&spdif {
pinctrl-names = "default";
pinctrl-0 = <&spdif_tx_pins_a>;
status = "okay";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins_a>;
status = "okay";
};
&usbphy {
usb1_vbus-supply = <&reg_usb1_vbus>;
usb2_vbus-supply = <&reg_usb2_vbus>;
status = "okay";
};

View File

@ -0,0 +1,37 @@
Removed buggy test for GCC 81740 bug.
Signed-off-by: "Michel Stempin" <michel.stempin@wanadoo.fr>
---
tests.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- mednafen-0.9.48.orig/src/tests.cpp
+++ mednafen-0.9.48/src/tests.cpp
@@ -766,6 +766,8 @@ void NO_INLINE NO_CLONE TestGCC80631(voi
assert(TestGCC80631_Sub(p) == 0);
}
+// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82750
+#ifdef BUGGY_TEST_GCC81740
NO_INLINE NO_CLONE void TestGCC81740_Sub(int* p, unsigned count)
{
static const int good[20] = { 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 10, 5, 6, 7, 8, 15, 10, 11, 12, 13 };
@@ -791,7 +793,7 @@ NO_INLINE NO_CLONE void TestGCC81740(voi
TestGCC81740_Sub(&v[0][0], sizeof(v) / sizeof(int));
}
-
+#endif
template<typename A, typename B>
void NO_INLINE NO_CLONE TestSUCompare_Sub(A a, B b)
@@ -2045,7 +2047,9 @@ bool MDFN_RunMathTests(void)
TestGCC70941();
TestGCC71488();
TestGCC80631();
+#ifdef BUGGY_TEST_GCC81740
TestGCC81740();
+#endif
TestModTern();
TestBWNotMask31GTZ();