Initial commit

This commit is contained in:
Michel-FK
2018-02-25 20:07:30 +01:00
commit 97f3099480
26 changed files with 1971 additions and 0 deletions

4
board/funkey/boot.cmd Normal file
View File

@@ -0,0 +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
bootz 0x41000000 - 0x41800000

1135
board/funkey/busybox.config Normal file

File diff suppressed because it is too large Load Diff

View File

View File

@@ -0,0 +1,35 @@
image boot.vfat {
vfat {
files = {
"zImage",
"sun8i-v3s-licheepi-zero-dock.dtb",
"sun8i-v3s-licheepi-zero.dtb",
"boot.scr"
}
}
size = 8M
}
image sdcard.img {
hdimage {
}
partition u-boot {
in-partition-table = "no"
image = "u-boot-sunxi-with-spl.bin"
offset = 8192
size = 516096 # 512KB - 8192
}
partition boot {
partition-type = 0xC
bootable = "true"
image = "boot.vfat"
}
partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
size = 60M
}
}

159
board/funkey/linux.config Normal file
View File

@@ -0,0 +1,159 @@
CONFIG_LOCALVERSION="-licheepi-zero"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_CGROUPS=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_PERF_EVENTS=y
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_ARCH_SUNXI=y
# CONFIG_MACH_SUN4I is not set
# CONFIG_MACH_SUN5I is not set
# CONFIG_MACH_SUN6I is not set
# CONFIG_MACH_SUN7I is not set
# CONFIG_MACH_SUN9I is not set
CONFIG_SMP=y
CONFIG_HAVE_ARM_ARCH_TIMER=y
CONFIG_NR_CPUS=8
CONFIG_ARM_PSCI=y
CONFIG_HIGHMEM=y
CONFIG_ARM_APPENDED_DTB=y
CONFIG_ARM_ATAG_DTB_COMPAT=y
CONFIG_CPU_FREQ=y
CONFIG_CPUFREQ_DT=y
CONFIG_VFP=y
CONFIG_NEON=y
CONFIG_NET=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_DIAG is not set
# CONFIG_IPV6 is not set
CONFIG_DNS_RESOLVER=y
CONFIG_CFG80211=y
CONFIG_CFG80211_WEXT=y
CONFIG_MAC80211=y
CONFIG_MAC80211_LEDS=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_MTD=y
CONFIG_MTD_M25P80=y
CONFIG_MTD_SPI_NOR=y
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_NETDEVICES=y
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_CADENCE is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_NET_VENDOR_FARADAY is not set
# CONFIG_NET_VENDOR_INTEL is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MICROCHIP is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SMSC is not set
CONFIG_STMMAC_ETH=y
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
CONFIG_INPUT_EVDEV=y
CONFIG_KEYBOARD_SUN4I_LRADC=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_NS2009=y
CONFIG_INPUT_MISC=y
CONFIG_INPUT_AXP20X_PEK=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=8
CONFIG_SERIAL_8250_RUNTIME_UARTS=8
CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_HW_RANDOM is not set
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MV64XXX=y
CONFIG_SPI=y
CONFIG_SPI_GPIO=y
CONFIG_SPI_SUN6I=y
CONFIG_GPIO_SYSFS=y
CONFIG_POWER_SUPPLY=y
CONFIG_THERMAL=y
CONFIG_CPU_THERMAL=y
CONFIG_WATCHDOG=y
CONFIG_SUNXI_WATCHDOG=y
CONFIG_MFD_AXP20X_I2C=y
CONFIG_MFD_AXP20X_RSB=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_REGULATOR_AXP20X=y
CONFIG_REGULATOR_GPIO=y
CONFIG_MEDIA_SUPPORT=y
CONFIG_DRM=y
CONFIG_DRM_SUN4I=y
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_DRM_DUMB_VGA_DAC=y
CONFIG_FB_SIMPLE=y
CONFIG_FB_SSD1307=y
CONFIG_BACKLIGHT_PWM=y
CONFIG_SOUND=y
CONFIG_SND=y
CONFIG_SND_SOC=y
CONFIG_SND_SUN4I_CODEC=y
CONFIG_SND_SUN8I_CODEC_ANALOG=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_HCD_PLATFORM=y
CONFIG_USB_MUSB_HDRC=y
CONFIG_USB_MUSB_SUNXI=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_GADGET=y
CONFIG_USB_CDC_COMPOSITE=y
CONFIG_MMC=y
CONFIG_MMC_SUNXI=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_GPIO=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_INTF_SYSFS is not set
# CONFIG_RTC_INTF_PROC is not set
CONFIG_DMADEVICES=y
CONFIG_DMA_SUN6I=y
CONFIG_STAGING=y
CONFIG_RTL8723BS=m
CONFIG_FB_TFT=y
CONFIG_FB_TFT_ST7789V=y
CONFIG_FB_FLEX=y
# CONFIG_SUN8I_A23_CCU is not set
# CONFIG_SUN8I_A33_CCU is not set
# CONFIG_SUN8I_H3_CCU is not set
CONFIG_SUN8I_DE2_CCU=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_PWM_SUN4I=y
CONFIG_PHY_SUN4I_USB=y
CONFIG_NVMEM_SUNXI_SID=y
CONFIG_EXT4_FS=y
CONFIG_VFAT_FS=y
CONFIG_TMPFS=y
# CONFIG_MISC_FILESYSTEMS is not set
# CONFIG_NETWORK_FILESYSTEMS is not set
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_PRINTK_TIME=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_KERNEL=y
# CONFIG_FTRACE is not set
CONFIG_KEYS=y
CONFIG_CRYPTO_DEV_SUN4I_SS=y

View File

@@ -0,0 +1,31 @@
sun8i-v3s-licheepi-zero-dock.dts | 8 ++++----
1 file changed, 4 insertions(+), 4 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 58c4e72..6e9dfcc 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
@@ -49,9 +49,9 @@
compatible = "licheepi,licheepi-zero-dock", "licheepi,licheepi-zero",
"allwinner,sun8i-v3s";
- aliases {
+ /*aliases {
ethernet0 = &emac;
- };
+ };*/
leds {
/* The LEDs use PG0~2 pins, which conflict with MMC1 */
@@ -68,9 +68,9 @@
status = "okay";
};
-&emac {
+/*&emac {
status = "okay";
-};
+};*/
&mmc1 {
broken-cd;

View File

@@ -0,0 +1,29 @@
sun8i-v3s-licheepi-zero.dts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
index d63a9a3..063c6bf 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
@@ -118,3 +118,21 @@
usb0_id_det-gpio = <&pio 5 6 GPIO_ACTIVE_HIGH>;
status = "okay";
};
+
+&spi0 {
+ status = "okay";
+
+ st7789v@0 {
+ compatible = "sitronix,st7789v";
+ reg = <0>;
+
+ spi-max-frequency = <24000000>;
+ txbuflen = <115200>;
+ rotate = <0>;
+ fps = <25>;
+ buswidth = <8>;
+ reset-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>;
+ dc-gpios = <&pio 1 5 GPIO_ACTIVE_LOW>;
+ debug = <0>;
+ };
+};

View File

@@ -0,0 +1,24 @@
sun8i-v3s.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 5379f2d..e437d3f 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -54,14 +54,14 @@
#size-cells = <1>;
ranges;
- simplefb_lcd: framebuffer@0 {
+ /*simplefb_lcd: framebuffer@0 {
compatible = "allwinner,simple-framebuffer",
"simple-framebuffer";
allwinner,pipeline = "de0-lcd0";
clocks = <&ccu CLK_BUS_TCON0>, <&display_clocks 0>,
<&display_clocks 6>, <&ccu CLK_TCON0>;
status = "disabled";
- };
+ };*/
};
cpus {

View File

@@ -0,0 +1,74 @@
fb_st7789v.c | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/fbtft/fb_st7789v.c b/drivers/staging/fbtft/fb_st7789v.c
index a5d7c87..69f52af 100644
--- a/drivers/staging/fbtft/fb_st7789v.c
+++ b/drivers/staging/fbtft/fb_st7789v.c
@@ -86,6 +86,28 @@ enum st7789v_command {
static int init_display(struct fbtft_par *par)
{
/* turn off sleep mode */
+ /*write_reg(par, 0x11);
+ mdelay(120);
+
+ write_reg(par, 0x36, 0x00);
+ write_reg(par, 0x3A, 0x05);
+
+ write_reg(par, 0xB2,0x0C,0x0C,0x00,0x33,0x33);
+ write_reg(par, 0xB7,0x35);
+ write_reg(par, 0xBB,0x1A);
+ write_reg(par, 0xC0,0x2C);
+ write_reg(par, 0xC2,0x01);
+ write_reg(par, 0xC3,0x0B);
+ write_reg(par, 0xC4,0x20);
+ write_reg(par, 0xC6,0x0F);
+ write_reg(par, 0xD0,0xA4,0xA1);
+ write_reg(par, 0x21);
+ write_reg(par, 0xE0,0x00,0x19,0x1E,0x0A,0x09,0x15,0x3D,0x44,0x51,0x12,0x03,0x00,0x3F,0x3F);
+ write_reg(par, 0xE1,0x00,0x18,0x1E,0x0A,0x09,0x25,0x3F,0x43,0x52,0x33,0x03,0x00,0x3F,0x3F);
+ write_reg(par, 0x29);*/
+
+
+ /* turn off sleep mode */
write_reg(par, MIPI_DCS_EXIT_SLEEP_MODE);
mdelay(120);
@@ -128,7 +150,14 @@ 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);
+
write_reg(par, MIPI_DCS_SET_DISPLAY_ON);
+
return 0;
}
@@ -189,7 +218,7 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)
* The masks are the same for both positive and negative voltage
* gamma curves.
*/
- static const u8 gamma_par_mask[] = {
+ const u8 gamma_par_mask[] = {
0xFF, /* V63[3:0], V0[3:0]*/
0x3F, /* V1[5:0] */
0x3F, /* V2[5:0] */
@@ -241,7 +270,7 @@ static int blank(struct fbtft_par *par, bool on)
static struct fbtft_display display = {
.regwidth = 8,
.width = 240,
- .height = 320,
+ .height = 240,
.gamma_num = 2,
.gamma_len = 14,
.gamma = DEFAULT_GAMMA,
@@ -263,3 +292,4 @@ MODULE_ALIAS("platform:st7789v");
MODULE_DESCRIPTION("FB driver for the ST7789V LCD Controller");
MODULE_AUTHOR("Dennis Menschel");
MODULE_LICENSE("GPL");
+

8
board/funkey/post-build.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
BOARD_DIR="$( dirname "${0}" )"
MKIMAGE="${HOST_DIR}/bin/mkimage"
BOOT_CMD="${BOARD_DIR}/boot.cmd"
BOOT_CMD_H="${BINARIES_DIR}/boot.scr"
# U-Boot script
"${MKIMAGE}" -C none -A arm -T script -d "${BOOT_CMD}" "${BOOT_CMD_H}"

19
board/funkey/post-image.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
set -e
BOARD_DIR="$(dirname $0)"
BOARD_NAME="$(basename ${BOARD_DIR})"
GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
rm -rf "${GENIMAGE_TMP}"
genimage \
--rootpath "${TARGET_DIR}" \
--tmppath "${GENIMAGE_TMP}" \
--inputpath "${BINARIES_DIR}" \
--outputpath "${BINARIES_DIR}" \
--config "${GENIMAGE_CFG}"
exit $?

View File

@@ -0,0 +1,68 @@
#!/bin/sh
########################################################################
#
# Description : Module auto-loading script
#
# Authors : Zack Winkles
#
# Version : 00.00
#
# Notes :
#
########################################################################
. /etc/sysconfig/functions
# Assure that the kernel has module support.
[ -e /proc/ksyms -o -e /proc/modules ] || exit 0
case "${1}" in
start)
# Exit if there's no modules file or there are no
# valid entries
[ -r /etc/sysconfig/modules ] &&
egrep -qv '^($|#)' /etc/sysconfig/modules ||
exit 0
boot_mesg -n "Loading modules:" ${INFO}
# Only try to load modules if the user has actually given us
# some modules to load.
while read module args; do
# Ignore comments and blank lines.
case "$module" in
""|"#"*) continue ;;
esac
# Attempt to load the module, making
# sure to pass any arguments provided.
modprobe ${module} ${args} >/dev/null
# Print the module name if successful,
# otherwise take note.
if [ $? -eq 0 ]; then
boot_mesg -n " ${module}" ${NORMAL}
else
failedmod="${failedmod} ${module}"
fi
done < /etc/sysconfig/modules
boot_mesg "" ${NORMAL}
# Print a message about successfully loaded
# modules on the correct line.
echo_ok
# Print a failure message with a list of any
# modules that may have failed to load.
if [ -n "${failedmod}" ]; then
boot_mesg "Failed to load modules:${failedmod}" ${FAILURE}
echo_failure
fi
;;
*)
echo "Usage: ${0} {start}"
exit 1
;;
esac

View File

@@ -0,0 +1,10 @@
_______ __ __
| ___|.--.--.-----.| |/ |.-----.--.--.
| ___|| | | || < | -__| | |
|___| |_____|__|__||__|\\__||_____|___ |
FUN ON A KEYCHAIN |_____|
-----------------------------------------------------
Version 0.1
-----------------------------------------------------

View File

@@ -0,0 +1,9 @@
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
wireless-essid "SSID"
wireless-key "password"
pre-up wpa_supplicant -Dnl80211 -i wlan0 -c /etc/wpa_supplicant.conf -B
post-down killall -q wpa_supplicant

View File

@@ -0,0 +1,145 @@
#!/bin/sh
#######################################################################
#
# Description : Run Level Control Functions
#
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
#
# Version : 00.00
#
# Notes : With code based on Matthias Benkmann's simpleinit-msb
# http://winterdrache.de/linux/newboot/index.html
#
########################################################################
## Environmental setup
# Setup default values for environment
umask 022
export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
# Signal sent to running processes to refresh their configuration
RELOADSIG="HUP"
# Number of seconds between STOPSIG and FALLBACK when stopping processes
KILLDELAY="3"
## Screen Dimensions
# Find current screen size
if [ -z "${COLUMNS}" ]; then
COLUMNS=$(stty size)
COLUMNS=${COLUMNS##* }
fi
# When using remote connections, such as a serial port, stty size returns 0
if [ "${COLUMNS}" = "0" ]; then
COLUMNS=80
fi
## Measurements for positioning result messages
COL=$((${COLUMNS} - 8))
WCOL=$((${COL} - 2))
## Provide an echo that supports -e and -n
# If formatting is needed, $ECHO should be used
case "`echo -e -n test`" in
-[en]*)
ECHO=/bin/echo
;;
*)
ECHO=echo
;;
esac
## Set Cursor Position Commands, used via $ECHO
SET_COL="\\033[${COL}G" # at the $COL char
SET_WCOL="\\033[${WCOL}G" # at the $WCOL char
CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char
## Set color commands, used via $ECHO
# Please consult `man console_codes for more information
# under the "ECMA-48 Set Graphics Rendition" section
#
# Warning: when switching from a 8bit to a 9bit font,
# the linux console will reinterpret the bold (1;) to
# the top 256 glyphs of the 9bit font. This does
# not affect framebuffer consoles
NORMAL="\\033[0;39m" # Standard console grey
SUCCESS="\\033[1;32m" # Success is green
WARNING="\\033[1;33m" # Warnings are yellow
FAILURE="\\033[1;31m" # Failures are red
INFO="\\033[1;36m" # Information is light cyan
BRACKET="\\033[1;34m" # Brackets are blue
STRING_LENGTH="0" # the length of the current message
#*******************************************************************************
# Function - boot_mesg()
#
# Purpose: Sending information from bootup scripts to the console
#
# Inputs: $1 is the message
# $2 is the colorcode for the console
#
# Outputs: Standard Output
#
# Dependencies: - sed for parsing strings.
# - grep for counting string length.
#
# Todo:
#*******************************************************************************
boot_mesg()
{
local ECHOPARM=""
while true
do
case "${1}" in
-n)
ECHOPARM=" -n "
shift 1
;;
-*)
echo "Unknown Option: ${1}"
return 1
;;
*)
break
;;
esac
done
## Figure out the length of what is to be printed to be used
## for warning messages.
STRING_LENGTH=$((${#1} + 1))
# Print the message to the screen
${ECHO} ${ECHOPARM} -e "${2}${1}"
}
boot_mesg_flush()
{
# Reset STRING_LENGTH for next message
STRING_LENGTH="0"
}
echo_ok()
{
${ECHO} -n -e "${CURS_UP}${SET_COL}${BRACKET}[${SUCCESS} OK ${BRACKET}]"
${ECHO} -e "${NORMAL}"
boot_mesg_flush
}
echo_failure()
{
${ECHO} -n -e "${CURS_UP}${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]"
${ECHO} -e "${NORMAL}"
boot_mesg_flush
}
echo_warning()
{
${ECHO} -n -e "${CURS_UP}${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]"
${ECHO} -e "${NORMAL}"
boot_mesg_flush
}

View File

@@ -0,0 +1 @@
r8723bs

View File

@@ -0,0 +1,12 @@
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1
network={
ssid="SSID"
psk="password"
scan_ssid=1
key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
pairwise=TKIP CCMP
group=CCMP TKIP WEP104 WEP40
priority=5
}

15
board/funkey/uboot.config Normal file
View File

@@ -0,0 +1,15 @@
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
# CONFIG_ARMV7_NONSEC is not set
CONFIG_MACH_SUN8I_V3S=y
CONFIG_DRAM_CLK=360
CONFIG_DRAM_ZQ=14779
CONFIG_DEFAULT_DEVICE_TREE="sun8i-v3s-licheepi-zero"
CONFIG_BOOTDELAY=0
# CONFIG_CONSOLE_MUX is not set
CONFIG_SPL=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
# CONFIG_NETDEVICES is not set
CONFIG_OF_LIBFDT_OVERLAY=y

View File