From 8cae6a481f4951e01990c8531d8b49805ffc648f Mon Sep 17 00:00:00 2001 From: Dmitry Ermakov Date: Sun, 13 Feb 2022 21:55:43 +0300 Subject: [PATCH] Add board config selector for FH8852v100 --- .../include/mach/board_config.fh8852.appboard | 45 ++++++++++++++++++ .../include/mach/board_config.fh8856.appboard | 47 +++++++++++++++++++ .../kernel/patches/13_boardconfig.patch | 21 +++++++++ 3 files changed, 113 insertions(+) create mode 100644 br-ext-chip-fullhan/board/fh8852v100/kernel/overlay/arch/arm/mach-fh/include/mach/board_config.fh8852.appboard create mode 100644 br-ext-chip-fullhan/board/fh8852v100/kernel/overlay/arch/arm/mach-fh/include/mach/board_config.fh8856.appboard create mode 100644 br-ext-chip-fullhan/board/fh8852v100/kernel/patches/13_boardconfig.patch diff --git a/br-ext-chip-fullhan/board/fh8852v100/kernel/overlay/arch/arm/mach-fh/include/mach/board_config.fh8852.appboard b/br-ext-chip-fullhan/board/fh8852v100/kernel/overlay/arch/arm/mach-fh/include/mach/board_config.fh8852.appboard new file mode 100644 index 00000000..d63cd9b2 --- /dev/null +++ b/br-ext-chip-fullhan/board/fh8852v100/kernel/overlay/arch/arm/mach-fh/include/mach/board_config.fh8852.appboard @@ -0,0 +1,45 @@ +/* + * board_config.h + * + * Created on: Jan 9, 2017 + * Author: duobao + */ + +#ifndef BOARD_CONFIG_H_ +#define BOARD_CONFIG_H_ + +/* + * GPIO0 -> IRCUT_ON + * GPIO1 -> IRCUT_OFF + * GPIO2 -> USB_PWREN + * GPIO3 -> SD1_PWREN/WIFI_REG_ON + * GPIO7 -> IR + * GPIO11 -> EMAC PHY Reset + * GPIO12 -> CIS_CLK + * GPIO13 -> CIS_RSTN + * GPIO14 -> CIS_PDN + */ + +#define CONFIG_GPIO_EMACPHY_RESET 11 +#define CONFIG_GPIO_EMACPHY_RXDV 41 + +#define CONFIG_GPIO_USB_PWREN 2 + +#define CONFIG_ISP_CLK_RATE 150000000 +#define CONFIG_HEVC_CLK_RATE 200000000 +#define CONFIG_PAE_CLK_RATE 240000000 + +#define FH_BOARD_8852 +#define CONFIG_PINCTRL_SELECT \ + "I2C0", "MIPI", "RMII", "SD0_NO_WP", "SSI0_4BIT",\ + "UART0", "GPIO0", "GPIO1", "GPIO2", "GPIO3", "GPIO7",\ + "GPIO11", "GPIO13", "GPIO14",\ + \ + /* 未引出的pad,默认配置为GPIO */ \ + "GPIO4", "GPIO5", "GPIO6", "GPIO8", "GPIO9", "GPIO10",\ + "GPIO19", "GPIO20", "GPIO21", "GPIO22", "GPIO23", "GPIO24",\ + "GPIO25", "GPIO26", "GPIO27", "GPIO28", "GPIO53",\ + "GPIO55" + + +#endif /* BOARD_CONFIG_H_ */ diff --git a/br-ext-chip-fullhan/board/fh8852v100/kernel/overlay/arch/arm/mach-fh/include/mach/board_config.fh8856.appboard b/br-ext-chip-fullhan/board/fh8852v100/kernel/overlay/arch/arm/mach-fh/include/mach/board_config.fh8856.appboard new file mode 100644 index 00000000..1cd8c86c --- /dev/null +++ b/br-ext-chip-fullhan/board/fh8852v100/kernel/overlay/arch/arm/mach-fh/include/mach/board_config.fh8856.appboard @@ -0,0 +1,47 @@ +/* + * board_config.h + * + * Created on: Jan 9, 2017 + * Author: duobao + */ + +#ifndef BOARD_CONFIG_H_ +#define BOARD_CONFIG_H_ + +/* + * GPIO0 -> IRCUT_ON + * GPIO1 -> IRCUT_OFF + * GPIO2 -> USB_PWREN + * GPIO11 -> EMAC PHY Reset + * GPIO12 -> CIS_CLK + * GPIO13 -> CIS_RSTN + * GPIO14 -> CIS_PDN + * GPIO19 -> SD1_PWREN/WIFI_REG_ON + * GPIO20 -> AK7755 Reset + * GPIO24 -> LED0 + * GPIO25 -> LED1 + * GPIO26 -> Reset Configs + * GPIO27 -> AK7755 PowerDown + * GPIO28 -> IR + * GPIO53 -> USB_PWREN/SD0_PWREN + * GPIO55 -> SD1 WIFI Interrupt + */ + +#define CONFIG_GPIO_EMACPHY_RESET 11 +#define CONFIG_GPIO_EMACPHY_RXDV 41 + +#define CONFIG_GPIO_USB_PWREN 2 + +#define CONFIG_ISP_CLK_RATE 200000000 +#define CONFIG_HEVC_CLK_RATE 300000000 +#define CONFIG_PAE_CLK_RATE 400000000 + +#define FH_BOARD_8856 +#define CONFIG_PINCTRL_SELECT \ + "I2C0", "I2C1", "MIPI", "RMII", "SD0_NO_WP", \ + "SD1_NO_WP", "SSI0_4BIT", "UART0", "GPIO0", "GPIO1", \ + "GPIO2", "GPIO3", "GPIO11", "GPIO13", "GPIO14", \ + "GPIO19", "GPIO20", "GPIO24", "GPIO25", "GPIO26", \ + "GPIO27", "GPIO28", "GPIO53", "GPIO55" + +#endif /* BOARD_CONFIG_H_ */ diff --git a/br-ext-chip-fullhan/board/fh8852v100/kernel/patches/13_boardconfig.patch b/br-ext-chip-fullhan/board/fh8852v100/kernel/patches/13_boardconfig.patch new file mode 100644 index 00000000..ab94ca98 --- /dev/null +++ b/br-ext-chip-fullhan/board/fh8852v100/kernel/patches/13_boardconfig.patch @@ -0,0 +1,21 @@ +--- a/Makefile ++++ b/Makefile +@@ -552,11 +552,17 @@ + include/config/auto.conf: ; + endif # $(dot-config) + ++export PROJECT_NAME = $(shell grep -e '^CONFIG_MACH_FH.*' .config|sed 's/CONFIG_MACH_\(.*\)=y/\1/'|awk '{print tolower($$0)}') ++ ++PHONY += boardconfig ++boardconfig: ++ cp arch/arm/mach-fh/include/mach/board_config.$(PROJECT_NAME).appboard arch/arm/mach-fh/include/mach/board_config.h ++ + # The all: target is the default when no target is given on the + # command line. + # This allow a user to issue only 'make' to build a kernel including modules + # Defaults to vmlinux, but the arch makefile usually adds further targets +-all: vmlinux ++all: boardconfig vmlinux + + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE + KBUILD_CFLAGS += -Os